aboutsummaryrefslogtreecommitdiff
path: root/contrib/groff/contrib
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2005-10-20 10:45:19 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2005-10-20 10:45:19 +0000
commit1c7b34d8d72dbef698ec688d638d51d5bbce14eb (patch)
tree37609e1685a209a2a273664ce67fc2f20f789996 /contrib/groff/contrib
parente3ad728cf2a0c16a1ac4677de65aa80b15e2ef67 (diff)
parent22e7cbb8744990e63e02dc3985780d932c67b1a4 (diff)
downloadsrc-1c7b34d8d72dbef698ec688d638d51d5bbce14eb.tar.gz
src-1c7b34d8d72dbef698ec688d638d51d5bbce14eb.zip
This commit was generated by cvs2svn to compensate for changes in r151497,
which included commits to RCS files with non-trunk default branches.
Notes
Notes: svn path=/head/; revision=151498
Diffstat (limited to 'contrib/groff/contrib')
-rw-r--r--contrib/groff/contrib/eqn2graph/eqn2graph.man22
-rw-r--r--contrib/groff/contrib/eqn2graph/eqn2graph.sh33
-rw-r--r--contrib/groff/contrib/gdiffmk/ChangeLog63
-rw-r--r--contrib/groff/contrib/gdiffmk/Makefile.sub47
-rw-r--r--contrib/groff/contrib/gdiffmk/README46
-rw-r--r--contrib/groff/contrib/gdiffmk/gdiffmk.man281
-rw-r--r--contrib/groff/contrib/gdiffmk/gdiffmk.sh346
-rw-r--r--contrib/groff/contrib/gdiffmk/tests/file111
-rw-r--r--contrib/groff/contrib/gdiffmk/tests/file211
-rw-r--r--contrib/groff/contrib/gdiffmk/tests/runtests.in98
-rw-r--r--contrib/groff/contrib/gdiffmk/tests/test_baseline17
-rw-r--r--contrib/groff/contrib/gdiffmk/tests/test_baseline1026
-rw-r--r--contrib/groff/contrib/gdiffmk/tests/test_baseline617
-rw-r--r--contrib/groff/contrib/gdiffmk/tests/test_baseline72
-rw-r--r--contrib/groff/contrib/gdiffmk/tests/test_baseline826
-rw-r--r--contrib/groff/contrib/gdiffmk/tests/test_baseline926
-rw-r--r--contrib/groff/contrib/grap2graph/Makefile.sub19
-rw-r--r--contrib/groff/contrib/grap2graph/grap2graph.man105
-rw-r--r--contrib/groff/contrib/grap2graph/grap2graph.sh85
-rw-r--r--contrib/groff/contrib/groffer/ChangeLog1089
-rw-r--r--contrib/groff/contrib/groffer/Makefile.sub51
-rw-r--r--contrib/groff/contrib/groffer/README117
-rw-r--r--contrib/groff/contrib/groffer/README_SH268
-rw-r--r--contrib/groff/contrib/groffer/TODO88
-rw-r--r--contrib/groff/contrib/groffer/groffer.man3549
-rw-r--r--contrib/groff/contrib/groffer/groffer.sh4600
-rw-r--r--contrib/groff/contrib/groffer/groffer2.sh5854
-rw-r--r--contrib/groff/contrib/mm/ChangeLog34
-rw-r--r--contrib/groff/contrib/mm/groff_mm.man28
-rw-r--r--contrib/groff/contrib/mm/m.tmac60
-rwxr-xr-xcontrib/groff/contrib/mm/mmroff.pl2
-rw-r--r--contrib/groff/contrib/mom/BUGS229
-rw-r--r--contrib/groff/contrib/mom/ChangeLog418
-rw-r--r--contrib/groff/contrib/mom/Makefile.sub74
-rw-r--r--contrib/groff/contrib/mom/NEWS237
-rw-r--r--contrib/groff/contrib/mom/TODO30
-rw-r--r--contrib/groff/contrib/mom/copyright10
-rw-r--r--contrib/groff/contrib/mom/examples/README.txt115
-rw-r--r--contrib/groff/contrib/mom/examples/elvis_syntax216
-rw-r--r--contrib/groff/contrib/mom/examples/elvis_syntax.new106
-rw-r--r--contrib/groff/contrib/mom/examples/sample_docs.mom574
-rw-r--r--contrib/groff/contrib/mom/examples/typesetting.mom673
-rw-r--r--contrib/groff/contrib/mom/groff_mom.man12
-rw-r--r--contrib/groff/contrib/mom/momdoc/appendices.html561
-rw-r--r--contrib/groff/contrib/mom/momdoc/color.html338
-rw-r--r--contrib/groff/contrib/mom/momdoc/cover.html507
-rw-r--r--contrib/groff/contrib/mom/momdoc/definitions.html405
-rw-r--r--contrib/groff/contrib/mom/momdoc/docelement.html3207
-rw-r--r--contrib/groff/contrib/mom/momdoc/docprocessing.html1055
-rw-r--r--contrib/groff/contrib/mom/momdoc/goodies.html276
-rw-r--r--contrib/groff/contrib/mom/momdoc/headfootpage.html537
-rw-r--r--contrib/groff/contrib/mom/momdoc/inlines.html447
-rw-r--r--contrib/groff/contrib/mom/momdoc/intro.html121
-rw-r--r--contrib/groff/contrib/mom/momdoc/letters.html215
-rw-r--r--contrib/groff/contrib/mom/momdoc/macrolist.html1794
-rw-r--r--contrib/groff/contrib/mom/momdoc/rectoverso.html36
-rw-r--r--contrib/groff/contrib/mom/momdoc/refer.html1482
-rw-r--r--contrib/groff/contrib/mom/momdoc/reserved.html2135
-rw-r--r--contrib/groff/contrib/mom/momdoc/toc.html182
-rw-r--r--contrib/groff/contrib/mom/momdoc/typemacdoc.html106
-rw-r--r--contrib/groff/contrib/mom/momdoc/typesetting.html1048
-rw-r--r--contrib/groff/contrib/mom/momdoc/using.html57
-rw-r--r--contrib/groff/contrib/mom/om.tmac11408
-rw-r--r--contrib/groff/contrib/pdfmark/ChangeLog137
-rw-r--r--contrib/groff/contrib/pdfmark/Makefile.sub114
-rw-r--r--contrib/groff/contrib/pdfmark/PROBLEMS25
-rw-r--r--contrib/groff/contrib/pdfmark/README50
-rw-r--r--contrib/groff/contrib/pdfmark/TODO53
-rw-r--r--contrib/groff/contrib/pdfmark/cover.ms57
-rw-r--r--contrib/groff/contrib/pdfmark/pdfmark.ms2531
-rw-r--r--contrib/groff/contrib/pdfmark/pdfmark.tmac1562
-rw-r--r--contrib/groff/contrib/pdfmark/pdfroff.man552
-rw-r--r--contrib/groff/contrib/pdfmark/pdfroff.sh572
-rw-r--r--contrib/groff/contrib/pdfmark/spdf.tmac225
-rw-r--r--contrib/groff/contrib/pic2graph/pic2graph.man19
-rw-r--r--contrib/groff/contrib/pic2graph/pic2graph.sh32
76 files changed, 41253 insertions, 10308 deletions
diff --git a/contrib/groff/contrib/eqn2graph/eqn2graph.man b/contrib/groff/contrib/eqn2graph/eqn2graph.man
index aa71405c3144..3f34cc5e2a22 100644
--- a/contrib/groff/contrib/eqn2graph/eqn2graph.man
+++ b/contrib/groff/contrib/eqn2graph/eqn2graph.man
@@ -1,4 +1,4 @@
-.\" $Id: eqn2graph.man,v 1.2 2002/08/21 17:29:17 wlemb Exp $
+.\" $Id: eqn2graph.man,v 1.4 2003/10/28 07:46:23 wlemb Exp $
.\" This documentation is released to the public domain.
.
.
@@ -31,7 +31,7 @@ Reads an EQN equation (one line) as input; produces an image
file (by default in Portable Network Graphics format) suitable for the
Web as output.
.P
-Your input EQN code should \fInot\fR have the .EQ/.EN preamble that
+Your input EQN code should \fInot\fR have the \&.EQ/.EN preamble that
that normally precedes it within
.BR groff (@MAN1EXT@)
macros; nor do you need to have dollar-sign or other delimiters
@@ -82,7 +82,25 @@ The
initialization file.
.
.
+.SH ENVIRONMENT
+.TP
+.B GROFF_TMPDIR
+The directory in which temporary files will be created.
+If this is not set
+.B eqn2graph
+searches the environment variables
+.BR \%TMPDIR ,
+.BR TMP ,
+and
+.B TEMP
+(in that order).
+Otherwise, temporary files will be created in
+.BR /tmp .
+.
+.
.SH "SEE ALSO"
+.BR pic2graph (@MAN1EXT@),
+.BR grap2graph (@MAN1EXT@),
.BR @g@eqn (@MAN1EXT@),
.BR groff (@MAN1EXT@),
.BR gs (1),
diff --git a/contrib/groff/contrib/eqn2graph/eqn2graph.sh b/contrib/groff/contrib/eqn2graph/eqn2graph.sh
index e314dc912633..98713a854ad5 100644
--- a/contrib/groff/contrib/eqn2graph/eqn2graph.sh
+++ b/contrib/groff/contrib/eqn2graph/eqn2graph.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
#
# eqn2graph -- compile EQN equation descriptions to bitmap images
#
@@ -32,7 +32,7 @@
#
# Thus, we pass -U to groff(1), and everything else to convert(1).
#
-# $Id: eqn2graph.sh,v 1.2 2002/07/17 04:55:46 wlemb Exp $
+# $Id: eqn2graph.sh,v 1.5 2005/05/18 07:03:06 wl Exp $
#
groff_opts=""
convert_opts=""
@@ -58,17 +58,34 @@ do
shift
done
+# create temporary directory
+tmp=
+for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
+ test -z "$d" && continue
+
+ tmp=`(umask 077 && mktemp -d -q "$d/eqn2graph-XXXXXX") 2> /dev/null` \
+ && test -n "$tmp" && test -d "$tmp" \
+ && break
+
+ tmp=$d/eqn2graph$$-$RANDOM
+ (umask 077 && mkdir $tmp) 2> /dev/null && break
+done;
+if test -z "$tmp"; then
+ echo "$0: cannot create temporary directory" >&2
+ { (exit 1); exit 1; }
+fi
+
+trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 2 15
+
# Here goes:
# 1. Add .EQ/.EN.
# 2. Process through eqn(1) to emit troff markup.
# 3. Process through groff(1) to emit Postscript.
# 4. Use convert(1) to crop the Postscript and turn it into a bitmap.
-tmp=/usr/tmp/eqn2graph-$$
-trap "rm ${tmp}.*" 0 2 15
read equation
-(echo ".EQ"; echo 'delim $$'; echo ".EN"; echo '$'"${equation}"'$') | \
- groff -e $groff_opts -Tps >${tmp}.ps \
- && convert -crop 0x0 $convert_opts ${tmp}.ps ${tmp}.${format} \
- && cat ${tmp}.${format}
+(echo ".EQ"; echo 'delim $$'; echo ".EN"; echo '$'"$equation"'$') | \
+ groff -e $groff_opts -Tps -P-pletter > $tmp/eqn2graph.ps \
+ && convert -trim -crop 0x0 $convert_opts $tmp/eqn2graph.ps $tmp/eqn2graph.$format \
+ && cat $tmp/eqn2graph.$format
# End
diff --git a/contrib/groff/contrib/gdiffmk/ChangeLog b/contrib/groff/contrib/gdiffmk/ChangeLog
new file mode 100644
index 000000000000..f8e3f9632edb
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/ChangeLog
@@ -0,0 +1,63 @@
+2005-01-16 Mike Bianchi <MBianchi@Foveal.com>
+
+ * gdiffmk.sh (Usage): Fix typos.
+ <top>: Allow `-M<arg1> <arg2>' also.
+
+ * gdiffmk.man: Updated.
+
+2005-01-13 Mike Bianchi <MBianchi@Foveal.com>
+
+ * gdiffmk.sh: Add the -D, -M, and -B options, which provide actions
+ akin to nrchbar.
+ Thanks to Larry Kollar (http://home.alltel.net/kollar/groff/).
+
+ * gdiffmk.man: Updated.
+
+ * tests/runtests.in: Added tests for gdiffmk's -D, -M, and -B
+ options.
+
+ * tests/baseline8, tests/baseline9, tests/baseline10: New files.
+
+2004-12-16 Mike Bianchi <MBianchi@Foveal.com>
+
+ * tests/runtests.in: Fix typo (s/$(srcdir)/${srcdir}/).
+
+2004-12-15 Werner LEMBERG <wl@gnu.org>
+
+ The configure script now generates tests/runtests.
+
+ * tests/tests.sh: Renamed to...
+ * tests/runtests.in: This.
+ Add proper $srcdir prefixes to make it run from build directory.
+ * README, Makefile.sub (CLEANADD), tests/test_baseline7: Updated.
+
+2004-12-14 Werner LEMBERG <wl@gnu.org>
+
+ * gdiffmk.sh: Make sed pattern work with alternate result of GNU
+ diff's -D option, using `!' instead of `not' in #endif comments.
+ (Exit): Use prefix for each emitted message line.
+
+2004-12-14 Mike Bianchi <MBianchi@Foveal.com>
+
+ * tests/*: New files for testing gdiffmk.
+
+ * README, gdiffmk.man, gdiffmk.sh: Updated.
+ Minor fixes.
+
+2004-12-13 Mike Bianchi <MBianchi@Foveal.com>
+
+ Add `-x' command line option to select a diff program.
+
+ * gdiffmk.sh: Add code to handle `-x'.
+ Move test for working `diff' down.
+ Fix sed pattern -- `.mc *' needs to be followed by `.mc .'.
+ (Usage): Updated.
+ * gdiffmk.man: Updated.
+
+2004-12-12 Mike Bianchi <MBianchi@Foveal.com>
+
+ * README: New file.
+
+2004-12-11 Mike Bianchi <MBianchi@Foveal.com>
+
+ First import of gdiffmk files.
diff --git a/contrib/groff/contrib/gdiffmk/Makefile.sub b/contrib/groff/contrib/gdiffmk/Makefile.sub
new file mode 100644
index 000000000000..5e0cd147a434
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/Makefile.sub
@@ -0,0 +1,47 @@
+# Makefile.sub for `gdiffmk' (integration into the groff source tree)
+
+# File position: <groff-source>/contrib/gdiffmk/Makefile.sub
+
+# Last update: 12 December 2004
+
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Mike Bianchi <MBianchi@Foveal.com <mailto:MBianchi@Foveal.com>>
+
+# This file is part of the gdiffmk utility, which is part of groff.
+
+# groff is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with groff; see the files COPYING and LICENSE in the top
+# directory of the groff source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+########################################################################
+
+MAN1=gdiffmk.n
+CLEANADD=gdiffmk tests/runtests
+
+all: gdiffmk
+
+gdiffmk: gdiffmk.sh
+ rm -f $@; \
+ sed -e "s|@BINDIR@|$(bindir)|g" \
+ -e "s|@VERSION@|$(version)$(revision)|g" \
+ -e $(SH_SCRIPT_SED_CMD) $(srcdir)/gdiffmk.sh >$@; \
+ chmod +x $@
+
+install_data: gdiffmk
+ -test -d $(bindir) || $(mkinstalldirs) $(bindir)
+ -rm -f $(bindir)/gdiffmk
+ $(INSTALL_SCRIPT) gdiffmk $(bindir)/gdiffmk
+
+uninstall_sub:
+ -rm -f $(bindir)/gdiffmk
diff --git a/contrib/groff/contrib/gdiffmk/README b/contrib/groff/contrib/gdiffmk/README
new file mode 100644
index 000000000000..9428717ede8c
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/README
@@ -0,0 +1,46 @@
+gdiffmk is approximately a recreation of the original Bell Labs/AT&T diffmk
+command for troff/nroff documents, with enhancements.
+
+It should not be confused with `diffmk' commands that operate on XML.
+
+The inspiration for this code was a Perl 2 version written in 1989 by Randal
+L. Schwartz. See
+ landfield.com/software/comp.sources.misc/archive-name/volume06/diffmk.p.gz
+
+The command also attempts to reproduce some of the functionality of the old
+`nrchbar' command. See
+ open-systems.ufl.edu/mirrors/ftp.isc.org/usenet/comp.sources.unix/volume10/nrchbar.Z
+
+Thanks to Werner Lemberg for help in making the package more portable and
+fit into the GNU groff source structure.
+
+Gnu diff(1) with the -Dname option does all of the work and sed(1)
+translates the output into something groff/troff/nroff can handle.
+
+Note the BUGS on the man page.
+
+The `tests' directory contains simple tests. `runtests run' runs them and
+compares the output against baseline files. Calling `runtests' without
+argument gives the usage.
+
+----------------------------------------------------------------------------
+
+Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+Written by Mike Bianchi <MBianchi@Foveal.com <mailto:MBianchi@Foveal.com>>
+
+This file is part of the gdiffmk utility, which is part of groff.
+
+groff is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+groff is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with groff; see the files COPYING and LICENSE in the top
+directory of the groff source. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/contrib/groff/contrib/gdiffmk/gdiffmk.man b/contrib/groff/contrib/gdiffmk/gdiffmk.man
new file mode 100644
index 000000000000..9c89182404f6
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/gdiffmk.man
@@ -0,0 +1,281 @@
+.ig \"-*- nroff -*-
+Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of the gdiffmk utility, which is part of groff.
+Written by Mike Bianchi <MBianchi@Foveal.com <mailto:MBianchi@Foveal.com>>
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the
+entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+
+Permission is granted to copy and distribute translations of this
+manual into another language, under the above conditions for modified
+versions, except that this permission notice may be included in
+translations approved by the Free Software Foundation instead of in
+the original English.
+..
+.
+.do mso www.tmac
+.
+.TH GDIFFMK @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.
+.
+.SH NAME
+gdiffmk \- mark differences between groff/nroff/troff files
+.
+.
+.SH SYNOPSIS
+.nr a \n(.j
+.ad l
+.nr i \n(.i
+.in +\w'\fBgdiffmk 'u
+.ti \niu
+.B gdiffmk
+.de OP
+. ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
+. el .RB "[\ " "\\$1" "\ ]"
+..
+.OP \-a \%addmark
+.OP \-c \%changemark
+.OP \-d \%deletemark
+[\ \c
+.B \-D
+.OP \-B
+.OP \-M "mark1 mark2"
+]
+.OP \-x \%diffcmd
+.OP \-\-
+.OP \-\-help
+.OP \%\-\-version
+.I \%file1
+.I \%file2
+[\ \c
+.IR \%output \ \c
+]
+.br
+.ad \na
+.
+.
+.SH DESCRIPTION
+.B gdiffmk
+compares two
+.BR groff (1),
+.BR nroff (1),
+or
+.BR troff (1)
+documents,
+.I file1
+and
+.IR file2 ,
+and creates an output which is
+.I file2
+with added `margin character' (.mc) commands that indicate the differences.
+.
+.LP
+If the
+.I output
+filename is present,
+the output is written there.
+If it is
+.B \-
+or absent the output is written to the standard output.
+.
+.LP
+If the
+.I file1
+or
+.I file2
+argument is
+.B \-
+the standard input is read for that input.
+Clearly both cannot be
+.BR \- .
+.
+.LP
+Note that the output is not necessarily compatible with all macro packages
+and all preprocessors.
+See the
+.B BUGS
+section below.
+.
+.
+.SH OPTIONS
+.TP
+.BI \-a addmark
+Use the
+.I addmark
+for source lines not in
+.I file1
+but present in
+.IR file2 .
+Default:
+.BR + .
+.
+.TP
+.B \-B
+By default, the deleted texts marked by the
+.B \-D
+option end
+with an added troff break command,
+.BR .br ,
+to ensure that the deletions are marked properly.
+This is the only way to guarantee that deletions and small
+changes get flagged.
+This option directs the program not to insert these breaks; it makes no
+sense to use it without
+.BR \-D .
+.
+.TP
+.BI \-c changemark
+Use the
+.I changemark
+for changed source lines.
+Default:
+.BR | .
+.
+.TP
+.BI \-d deletemark
+Use the
+.I deletemark
+for deleted source lines.
+Default:
+.BR * .
+.
+.TP
+.B \-D
+Show the deleted portions from changed and deleted text.
+Default delimiting marks:
+.BR "[[" " .\&.\&.\&. " "]]" .
+.
+.TP
+.BI \-M "mark1 mark2"
+Change the delimiting marks for the
+.B \-D
+option.
+It makes no sense to use this option without
+.BR \-D .
+.
+.TP
+.BI \-x diffcmd
+Use the
+.I diffcmd
+command to perform the comparison of
+.I file1
+and
+.IR file2 .
+In particular,
+.I diffcmd
+should accept the GNU
+.B diff
+.BI \-D name
+option.
+Default:
+.BR diff (1).
+.
+.TP
+.B \-\-
+All the following arguments are treated as file names,
+even if they begin with
+.BR \- .
+.
+.TP
+.B \-\-help
+Print a usage message on standard error output and exit.
+.
+.TP
+.B \-\-version
+Print version information on the standard output and exit.
+.
+.
+.SH BUGS
+The output is not necessarily compatible with all macro packages
+and all preprocessors.
+A workaround that is often successful against preprocessor problems
+is to run
+.B gdiffmk
+on the output of all the preprocessors instead of the input source.
+.
+.LP
+.B gdiffmk
+relies on the
+.BI \-D name
+option of GNU
+.BR diff (1)
+to make a merged `#ifdef' output format.
+It hasn't been tested whether other versions of
+.BR diff (1)
+do support this option.
+See also the
+.BI \-x diffcmd
+option.
+.
+.LP
+Report bugs to bug-groff@gnu.org.
+Include a complete, self-contained example that will allow the bug to
+be reproduced, and say which version of
+.B gdiffmk
+you are using.
+.
+.
+.SH AUTHORS
+This document was written and is maintained by
+.MTO MBianchi@Foveal.com "Mike Bianchi" .
+.
+.LP
+This document is distributed under the terms of the FDL (GNU Free
+Documentation License) version 1.1 or later.
+You should have received a copy of the FDL on your system, it is also
+available on-line at the
+.URL http://\:www.gnu.org/\:copyleft/\:fdl.html "GNU copyleft site" .
+.
+.LP
+.B gdiffmk
+is part of the
+.I groff
+GNU free software project.
+All parts of the
+.I groff package
+are protected by GNU copyleft licenses.
+The software files are distributed under the terms of the GNU General
+Public License (GPL), while the documentation files mostly use the GNU
+Free Documentation License (FDL).
+.
+.
+.SH COPYRIGHT
+Copyright \(co 2004, 2005 Free Software Foundation, Inc.
+.
+.LP
+.B gdiffmk
+is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+.
+.LP
+.B gdiffmk
+is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License for more details.
+.
+.LP
+You should have received a copy of the GNU General Public License along
+with groff; see the file COPYING.
+If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+.
+.
+.SH "SEE ALSO"
+.BR groff (@MAN1EXT@),
+.BR nroff (@MAN1EXT@),
+.BR gtroff (@MAN1EXT@),
+.BR diff (@MAN1EXT@)
+.
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/contrib/groff/contrib/gdiffmk/gdiffmk.sh b/contrib/groff/contrib/gdiffmk/gdiffmk.sh
new file mode 100644
index 000000000000..e55eb6962019
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/gdiffmk.sh
@@ -0,0 +1,346 @@
+#! /bin/sh
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+# Written by Mike Bianchi <MBianchi@Foveal.com <mailto:MBianchi@Foveal.com>>
+
+# This file is part of the gdiffmk utility, which is part of groff.
+
+# groff is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with groff; see the files COPYING and LICENSE in the top
+# directory of the groff source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+# This file is part of GNU gdiffmk.
+
+
+cmd=$( basename $0 )
+
+function Usage {
+ if test "$#" -gt 0
+ then
+ echo >&2 "${cmd}: $@"
+ fi
+ echo >&2 "\
+
+Usage: ${cmd} [ OPTIONS ] FILE1 FILE2 [ OUTPUT ]
+Place difference marks into the new version of a groff/nroff/troff document.
+FILE1 and FILE2 are compared, using \`diff', and FILE2 is output with
+groff \`.mc' requests added to indicate how it is different from FILE1.
+
+ FILE1 Previous version of the groff file. \`-' means standard input.
+ FILE2 Current version of the groff file. \`-' means standard input.
+ Either FILE1 or FILE2 can be standard input, but not both.
+ OUTPUT Copy of FILE2 with \`.mc' commands added.
+ \`-' means standard output (the default).
+
+OPTIONS:
+ -a ADDMARK Mark for added groff source lines. Default: \`+'.
+ -c CHANGEMARK Mark for changed groff source lines. Default: \`|'.
+ -d DELETEMARK Mark for deleted groff source lines. Default: \`*'.
+
+ -D Show the deleted portions from changed and deleted text.
+ Default delimiting marks: \`[[' .... \`]]'.
+ -B By default, the deleted texts marked by the \`-D' option end
+ with an added troff \`.br' command. This option prevents
+ the added \`.br'.
+ -M MARK1 MARK2 Change the delimiting marks for the \`-D' option.
+
+ -x DIFFCMD Use a different diff(1) command;
+ one that accepts the \`-Dname' option, such as GNU diff.
+ --version Print version information on the standard output and exit.
+ --help Print this message on the standard error.
+"
+ exit 255
+}
+
+
+function Exit {
+ exitcode=$1
+ shift
+ for arg
+ do
+ echo >&2 "${cmd}: $1"
+ shift
+ done
+ exit ${exitcode}
+}
+
+# Usage: FileRead exit_code filename
+#
+# Check for existence and readability of given file name.
+# If not found or not readable, print message and exit with EXIT_CODE.
+function FileRead {
+ case "$2" in
+ -)
+ return
+ ;;
+ esac
+
+ if test ! -e "$2"
+ then
+ Exit $1 "File \`$2' not found."
+ fi
+ if test ! -r "$2"
+ then
+ Exit $1 "File \`$2' not readable."
+ fi
+}
+
+
+# Usage: FileCreate exit_code filename
+#
+# Create the given filename if it doesn't exist.
+# If unable to create or write, print message and exit with EXIT_CODE.
+function FileCreate {
+ case "$2" in
+ -)
+ return
+ ;;
+ esac
+
+ if ! touch "$2" 2>/dev/null
+ then
+ if test ! -e "$2"
+ then
+ Exit $1 "File \`$2' not created; " \
+ "Cannot write directory \`$( dirname "$2" )'."
+ fi
+ Exit $1 "File \`$2' not writeable."
+ fi
+}
+
+function WouldClobber {
+ case "$2" in
+ -)
+ return
+ ;;
+ esac
+
+ if test "$1" -ef "$3"
+ then
+ Exit 3 \
+ "The $2 and OUTPUT arguments both point to the same file," \
+ "\`$1', and it would be overwritten."
+ fi
+}
+
+ADDMARK='+'
+CHANGEMARK='|'
+DELETEMARK='*'
+MARK1='[['
+MARK2=']]'
+
+function RequiresArgument {
+ # Process flags that take either concatenated or
+ # separated values.
+ case "$1" in
+ -??*)
+ expr "$1" : '-.\(.*\)'
+ return 1
+ ;;
+ esac
+
+ if test "$#" -lt 2
+ then
+ Exit 255 "Option \`$1' requires a value."
+ fi
+
+ echo "$2"
+ return 0
+}
+
+badoption=
+DIFFCMD=diff
+D_option=
+br=.br
+for OPTION
+do
+ case "${OPTION}" in
+ -a*)
+ ADDMARK=$( RequiresArgument "${OPTION}" $2 ) &&
+ shift
+ ;;
+ -c*)
+ CHANGEMARK=$( RequiresArgument "${OPTION}" $2 ) &&
+ shift
+ ;;
+ -d*)
+ DELETEMARK=$( RequiresArgument "${OPTION}" $2 ) &&
+ shift
+ ;;
+ -D )
+ D_option=D_option
+ ;;
+ -M* )
+ MARK1=$( RequiresArgument "${OPTION}" $2 ) &&
+ shift
+ if [ $# -lt 2 ]
+ then
+ Usage "Option \`-M' is missing the MARK2 value."
+ fi
+ MARK2=$2
+ shift
+ ;;
+ -B )
+ br=.
+ ;;
+ -x* )
+ DIFFCMD=$( RequiresArgument "${OPTION}" $2 ) &&
+ shift
+ ;;
+ --version)
+ echo "GNU ${cmd} (groff) version @VERSION@"
+ exit 0
+ ;;
+ --help)
+ Usage
+ ;;
+ --)
+ # What follows -- are file arguments
+ shift
+ break
+ ;;
+ -)
+ break
+ ;;
+ -*)
+ badoption="${cmd}: invalid option \`$1'"
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+done
+
+${DIFFCMD} -Dx /dev/null /dev/null >/dev/null 2>&1 ||
+ Usage "The \`${DIFFCMD}' program does not accept" \
+ "the required \`-Dname' option.
+Use GNU diff instead. See the \`-x DIFFCMD' option."
+
+if test -n "${badoption}"
+then
+ Usage "${badoption}"
+fi
+
+if test "$#" -lt 2 -o "$#" -gt 3
+then
+ Usage "Incorrect number of arguments."
+fi
+
+if test "1$1" = 1- -a "2$2" = 2-
+then
+ Usage "Both FILE1 and FILE2 are \`-'."
+fi
+
+FILE1=$1
+FILE2=$2
+
+FileRead 1 "${FILE1}"
+FileRead 2 "${FILE2}"
+
+if test "$#" = 3
+then
+ case "$3" in
+ -)
+ # output goes to standard output
+ ;;
+ *)
+ # output goes to a file
+ WouldClobber "${FILE1}" FILE1 "$3"
+ WouldClobber "${FILE2}" FILE2 "$3"
+
+ FileCreate 3 "$3"
+ exec >$3
+ ;;
+ esac
+fi
+
+# To make a very unlikely label even more unlikely ...
+label=__diffmk_$$__
+
+sed_script='
+ /^#ifdef '"${label}"'/,/^#endif \/\* '"${label}"'/ {
+ /^#ifdef '"${label}"'/ s/.*/.mc '"${ADDMARK}"'/
+ /^#endif \/\* '"${label}"'/ s/.*/.mc/
+ p
+ d
+ }
+ /^#ifndef '"${label}"'/,/^#endif \/\* [!not ]*'"${label}"'/ {
+ /^#else \/\* '"${label}"'/,/^#endif \/\* '"${label}"'/ {
+ /^#else \/\* '"${label}"'/ s/.*/.mc '"${CHANGEMARK}"'/
+ /^#endif \/\* '"${label}"'/ s/.*/.mc/
+ p
+ d
+ }
+ /^#endif \/\* \(not\|!\) '"${label}"'/ {
+ s/.*/.mc '"${DELETEMARK}"'/p
+ a\
+.mc
+ }
+ d
+ }
+ p
+ '
+
+if [ ${D_option} ]
+then
+ sed_script='
+ /^#ifdef '"${label}"'/,/^#endif \/\* '"${label}"'/ {
+ /^#ifdef '"${label}"'/ s/.*/.mc '"${ADDMARK}"'/
+ /^#endif \/\* '"${label}"'/ s/.*/.mc/
+ p
+ d
+ }
+ /^#ifndef '"${label}"'/,/^#endif \/\* [!not ]*'"${label}"'/ {
+ /^#ifndef '"${label}"'/ {
+ i\
+'"${MARK1}"'
+ d
+ }
+ /^#else \/\* '"${label}"'/ ! {
+ /^#endif \/\* [!not ]*'"${label}"'/ ! {
+ p
+ d
+ }
+ }
+ /^#else \/\* '"${label}"'/,/^#endif \/\* '"${label}"'/ {
+ /^#else \/\* '"${label}"'/ {
+ i\
+'"${MARK2}"'\
+'"${br}"'
+ s/.*/.mc '"${CHANGEMARK}"'/
+ a\
+.mc '"${CHANGEMARK}"'
+ d
+ }
+ /^#endif \/\* '"${label}"'/ s/.*/.mc/
+ p
+ d
+ }
+ /^#endif \/\* \(not\|!\) '"${label}"'/ {
+ i\
+'"${MARK2}"'\
+'"${br}"'
+ s/.*/.mc '"${DELETEMARK}"'/p
+ a\
+.mc
+ }
+ d
+ }
+ p
+ '
+fi
+
+diff -D"${label}" -- ${FILE1} ${FILE2} |
+ sed -n "${sed_script}"
+
+# EOF
diff --git a/contrib/groff/contrib/gdiffmk/tests/file1 b/contrib/groff/contrib/gdiffmk/tests/file1
new file mode 100644
index 000000000000..ba6a4be2eda5
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/tests/file1
@@ -0,0 +1,11 @@
+.ll 25
+.pl 20
+.nf
+file1 and file2 #1
+file1 only
+file1 and file2 #2
+file1 and file2 #3
+file1 only
+file1 only
+file1 and file2 #4
+file1 and file2 #5
diff --git a/contrib/groff/contrib/gdiffmk/tests/file2 b/contrib/groff/contrib/gdiffmk/tests/file2
new file mode 100644
index 000000000000..54e95eef295b
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/tests/file2
@@ -0,0 +1,11 @@
+.ll 25
+.pl 20
+.nf
+file1 and file2 #1
+file2 only
+file2 only
+file1 and file2 #2
+file2 only
+file1 and file2 #3
+file1 and file2 #4
+file1 and file2 #5
diff --git a/contrib/groff/contrib/gdiffmk/tests/runtests.in b/contrib/groff/contrib/gdiffmk/tests/runtests.in
new file mode 100644
index 000000000000..82952652e2d0
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/tests/runtests.in
@@ -0,0 +1,98 @@
+#! /bin/sh
+# A very simple function test for gdiffmk.sh.
+
+srcdir=@srcdir@
+
+command=../gdiffmk
+
+# Test the number of arguments and the first argument.
+case $#-$1 in
+1-clean )
+ rm -fv test_result* tmp_file*
+ exit 0
+ ;;
+1-run )
+ ;;
+* )
+ echo >&2 "$0 [ clean | run ]
+Run a few simple tests on \`${command}'."'
+
+clean Remove the test_result? and tmp_file? files.
+run Run the tests.
+'
+ exit 255
+ ;;
+esac
+
+function TestResult {
+ if cmp -s $1 $2
+ then
+ echo $2 PASSED
+ else
+ echo ''
+ echo $2 TEST FAILED
+ diff $1 $2
+ echo ''
+ fi
+}
+
+tmpfile=/tmp/$$
+trap 'rm -f ${tmpfile}' 0 1 2 3 15
+
+# Run tests.
+
+# 3 file arguments
+ResultFile=test_result1
+${command} ${srcdir}/file1 ${srcdir}/file2 ${ResultFile} 2>${tmpfile}
+cat ${tmpfile} >>${ResultFile}
+TestResult ${srcdir}/test_baseline ${ResultFile}
+
+# OUTPUT to stdout by default
+ResultFile=test_result2
+${command} ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1
+TestResult ${srcdir}/test_baseline ${ResultFile}
+
+# OUTPUT to stdout via - argument
+ResultFile=test_result3
+${command} ${srcdir}/file1 ${srcdir}/file2 - >${ResultFile} 2>&1
+TestResult ${srcdir}/test_baseline ${ResultFile}
+
+# FILE1 from standard input via - argument
+ResultFile=test_result4
+${command} - ${srcdir}/file2 <${srcdir}/file1 >${ResultFile} 2>&1
+TestResult ${srcdir}/test_baseline ${ResultFile}
+
+# FILE2 from standard input via - argument
+ResultFile=test_result5
+${command} ${srcdir}/file1 - <${srcdir}/file2 >${ResultFile} 2>&1
+TestResult ${srcdir}/test_baseline ${ResultFile}
+
+# Different values for addmark, changemark, deletemark
+ResultFile=test_result6
+${command} -aA -cC -dD ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1
+TestResult ${srcdir}/test_baseline6 ${ResultFile}
+
+# Test for accidental file overwrite.
+ResultFile=test_result7
+cp ${srcdir}/file2 tmp_file7
+${command} -aA -dD -cC ${srcdir}/file1 tmp_file7 tmp_file7 \
+ >${ResultFile} 2>&1
+TestResult ${srcdir}/test_baseline7 ${ResultFile}
+
+# Test -D option
+ResultFile=test_result8
+${command} -D ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1
+TestResult ${srcdir}/test_baseline8 ${ResultFile}
+
+# Test -D and -M options
+ResultFile=test_result9
+${command} -D -M '<<<<' '>>>>' \
+ ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1
+TestResult ${srcdir}/test_baseline9 ${ResultFile}
+
+# Test -D and -B options
+ResultFile=test_result10
+${command} -D -B ${srcdir}/file1 ${srcdir}/file2 >${ResultFile} 2>&1
+TestResult ${srcdir}/test_baseline10 ${ResultFile}
+
+# EOF
diff --git a/contrib/groff/contrib/gdiffmk/tests/test_baseline b/contrib/groff/contrib/gdiffmk/tests/test_baseline
new file mode 100644
index 000000000000..6b329926ae87
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/tests/test_baseline
@@ -0,0 +1,17 @@
+.ll 25
+.pl 20
+.nf
+file1 and file2 #1
+.mc |
+file2 only
+file2 only
+.mc
+file1 and file2 #2
+.mc +
+file2 only
+.mc
+file1 and file2 #3
+.mc *
+.mc
+file1 and file2 #4
+file1 and file2 #5
diff --git a/contrib/groff/contrib/gdiffmk/tests/test_baseline10 b/contrib/groff/contrib/gdiffmk/tests/test_baseline10
new file mode 100644
index 000000000000..b523f4520005
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/tests/test_baseline10
@@ -0,0 +1,26 @@
+.ll 25
+.pl 20
+.nf
+file1 and file2 #1
+[[
+file1 only
+]]
+.
+.mc |
+file2 only
+file2 only
+.mc
+file1 and file2 #2
+.mc +
+file2 only
+.mc
+file1 and file2 #3
+[[
+file1 only
+file1 only
+]]
+.
+.mc *
+.mc
+file1 and file2 #4
+file1 and file2 #5
diff --git a/contrib/groff/contrib/gdiffmk/tests/test_baseline6 b/contrib/groff/contrib/gdiffmk/tests/test_baseline6
new file mode 100644
index 000000000000..3156961b4a21
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/tests/test_baseline6
@@ -0,0 +1,17 @@
+.ll 25
+.pl 20
+.nf
+file1 and file2 #1
+.mc C
+file2 only
+file2 only
+.mc
+file1 and file2 #2
+.mc A
+file2 only
+.mc
+file1 and file2 #3
+.mc D
+.mc
+file1 and file2 #4
+file1 and file2 #5
diff --git a/contrib/groff/contrib/gdiffmk/tests/test_baseline7 b/contrib/groff/contrib/gdiffmk/tests/test_baseline7
new file mode 100644
index 000000000000..b65e8320c34d
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/tests/test_baseline7
@@ -0,0 +1,2 @@
+gdiffmk: The FILE2 and OUTPUT arguments both point to the same file,
+gdiffmk: `tmp_file7', and it would be overwritten.
diff --git a/contrib/groff/contrib/gdiffmk/tests/test_baseline8 b/contrib/groff/contrib/gdiffmk/tests/test_baseline8
new file mode 100644
index 000000000000..9846dd583cb0
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/tests/test_baseline8
@@ -0,0 +1,26 @@
+.ll 25
+.pl 20
+.nf
+file1 and file2 #1
+[[
+file1 only
+]]
+.br
+.mc |
+file2 only
+file2 only
+.mc
+file1 and file2 #2
+.mc +
+file2 only
+.mc
+file1 and file2 #3
+[[
+file1 only
+file1 only
+]]
+.br
+.mc *
+.mc
+file1 and file2 #4
+file1 and file2 #5
diff --git a/contrib/groff/contrib/gdiffmk/tests/test_baseline9 b/contrib/groff/contrib/gdiffmk/tests/test_baseline9
new file mode 100644
index 000000000000..50fe57d6d2b1
--- /dev/null
+++ b/contrib/groff/contrib/gdiffmk/tests/test_baseline9
@@ -0,0 +1,26 @@
+.ll 25
+.pl 20
+.nf
+file1 and file2 #1
+<<<<
+file1 only
+>>>>
+.br
+.mc |
+file2 only
+file2 only
+.mc
+file1 and file2 #2
+.mc +
+file2 only
+.mc
+file1 and file2 #3
+<<<<
+file1 only
+file1 only
+>>>>
+.br
+.mc *
+.mc
+file1 and file2 #4
+file1 and file2 #5
diff --git a/contrib/groff/contrib/grap2graph/Makefile.sub b/contrib/groff/contrib/grap2graph/Makefile.sub
new file mode 100644
index 000000000000..5527618e1581
--- /dev/null
+++ b/contrib/groff/contrib/grap2graph/Makefile.sub
@@ -0,0 +1,19 @@
+MAN1=grap2graph.n
+CLEANADD=grap2graph
+
+all: grap2graph
+
+grap2graph: grap2graph.sh
+ rm -f $@; \
+ sed -e "s|@g@|$(g)|g" \
+ -e "s|@VERSION@|$(version)$(revision)|" \
+ -e $(SH_SCRIPT_SED_CMD) $(srcdir)/grap2graph.sh >$@; \
+ chmod +x $@
+
+install_data: grap2graph
+ -test -d $(bindir) || $(mkinstalldirs) $(bindir)
+ -rm -f $(bindir)/grap2graph
+ $(INSTALL_SCRIPT) grap2graph $(bindir)/grap2graph
+
+uninstall_sub:
+ -rm -f $(bindir)/grap2graph
diff --git a/contrib/groff/contrib/grap2graph/grap2graph.man b/contrib/groff/contrib/grap2graph/grap2graph.man
new file mode 100644
index 000000000000..0c6d4568d77e
--- /dev/null
+++ b/contrib/groff/contrib/grap2graph/grap2graph.man
@@ -0,0 +1,105 @@
+.\" $Id: grap2graph.man,v 1.3 2003/10/28 07:46:23 wlemb Exp $
+.\" This documentation is released to the public domain.
+.
+.
+.TH GRAP2GRAPH @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.IX grap2graph
+.SH NAME
+grap2graph \- convert a grap diagram into a cropped bitmap image
+.
+.
+.SH SYNOPSIS
+.B grap2graph
+[
+.B \-unsafe
+]
+[
+.BI \-resolution\ M\fR|\fPMxN
+]
+[
+.BI \-format\ fmt
+]
+.
+.
+.SH DESCRIPTION
+Reads a grap program as input; produces an image file (by default in
+Portable Network Graphics format) suitable for the Web as output.
+For a description of the grap language, see
+.BR grap (1).
+.P
+Your graph specification should \fInot\fR be wrapped with the \&.G1 and
+\&.G2 macros that normally guard it within
+.BR groff (@MAN1EXT@)
+macros.
+.P
+The output image will be a black-on-white graphic clipped to the
+smallest possible bounding box that contains all the black pixels.
+By specifying command-line options to be passed to
+.BR convert (1)
+you can give it a border, set the background transparent, set the
+image's pixel density, or perform other useful transformations.
+.P
+This program uses
+.BR grap (1),
+.BR @g@pic (@MAN1EXT@),
+.BR groff (@MAN1EXT@),
+and the ImageMagick
+.BR convert (1)
+program.
+These programs must be installed on your system and accessible on your
+$PATH for \fBgrap2graph\fR to work.
+.
+.
+.SH OPTIONS
+.TP
+.B \-unsafe
+Run
+.BR @g@pic (@MAN1EXT@)
+and
+.BR groff (@MAN1EXT@)
+in the `unsafe' mode enabling the PIC macro
+.B sh
+to execute arbitrary commands.
+The default is to forbid this.
+.TP
+.BI \-format\ fmt
+Specify an output format; the default is PNG (Portable Network Graphics).
+Any format that
+.BR convert (1)
+can emit is supported.
+.PP
+Command-line switches and arguments not listed above are passed to
+.BR convert (1).
+.
+.
+.SH ENVIRONMENT
+.TP
+.B GROFF_TMPDIR
+The directory in which temporary files will be created.
+If this is not set
+.B grap2graph
+searches the environment variables
+.BR \%TMPDIR ,
+.BR TMP ,
+and
+.B TEMP
+(in that order).
+Otherwise, temporary files will be created in
+.BR /tmp .
+.
+.
+.SH "SEE ALSO"
+.BR pic2graph (@MAN1EXT@),
+.BR eqn2graph (@MAN1EXT@),
+.BR @g@pic (@MAN1EXT@),
+.BR groff (@MAN1EXT@),
+.BR gs (1),
+.BR convert (1).
+.
+.
+.SH AUTHOR
+Eric S. Raymond <esr@thyrsus.com>
+.
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/contrib/groff/contrib/grap2graph/grap2graph.sh b/contrib/groff/contrib/grap2graph/grap2graph.sh
new file mode 100644
index 000000000000..7c830c1a2519
--- /dev/null
+++ b/contrib/groff/contrib/grap2graph/grap2graph.sh
@@ -0,0 +1,85 @@
+#! /bin/sh
+#
+# grap2graph -- compile graph description descriptions to bitmap images
+#
+# by Eric S. Raymond <esr@thyrsus.com>, May 2003
+#
+# In Unixland, the magic is in knowing what to string together...
+#
+# Take grap description on stdin, emit cropped bitmap on stdout.
+# The pic markup should *not* be wrapped in .G1/.G2, this script will do that.
+# A -U option on the command line enables gpic/groff "unsafe" mode.
+# A -format FOO option changes the image output format to any format
+# supported by convert(1). All other options are passed to convert(1).
+# The default format is PNG.
+#
+
+# Requires the groff suite and the ImageMagick tools. Both are open source.
+# This code is released to the public domain.
+#
+# Here are the assumptions behind the option processing:
+#
+# 1. None of the options of grap(1) are relevant.
+#
+# 2. Only the -U option of groff(1) is relevant.
+#
+# 3. Many options of convert(1) are potentially relevant, (especially
+# -density, -interlace, -transparency, -border, and -comment).
+#
+# Thus, we pass -U to groff(1), and everything else to convert(1).
+#
+# $Id: grap2graph.sh,v 1.4 2005/05/18 07:03:06 wl Exp $
+#
+groff_opts=""
+convert_opts=""
+format="png"
+
+while [ "$1" ]
+do
+ case $1 in
+ -unsafe)
+ groff_opts="-U";;
+ -format)
+ format=$2
+ shift;;
+ -v | --version)
+ echo "GNU grap2graph (groff) version @VERSION@"
+ exit 0;;
+ --help)
+ echo "usage: grap2graph [ option ...] < in > out"
+ exit 0;;
+ *)
+ convert_opts="$convert_opts $1";;
+ esac
+ shift
+done
+
+# create temporary directory
+tmp=
+for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
+ test -z "$d" && continue
+
+ tmp=`(umask 077 && mktemp -d -q "$d/grap2graph-XXXXXX") 2> /dev/null` \
+ && test -n "$tmp" && test -d "$tmp" \
+ && break
+
+ tmp=$d/grap2graph$$-$RANDOM
+ (umask 077 && mkdir $tmp) 2> /dev/null && break
+done;
+if test -z "$tmp"; then
+ echo "$0: cannot create temporary directory" >&2
+ { (exit 1); exit 1; }
+fi
+
+trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 2 15
+
+# Here goes:
+# 1. Add .G1/.G2.
+# 2. Process through grap(1) to emit pic markup.
+# 3. Process through groff(1) with pic preprocessing to emit Postscript.
+# 4. Use convert(1) to crop the Postscript and turn it into a bitmap.
+(echo ".G1"; cat; echo ".G2") | grap | groff -p $groff_opts -Tps -P-pletter | \
+ convert -trim -crop 0x0 $convert_opts - $tmp/grap2graph.$format \
+ && cat $tmp/grap2graph.$format
+
+# End
diff --git a/contrib/groff/contrib/groffer/ChangeLog b/contrib/groff/contrib/groffer/ChangeLog
index f706907d372a..c436f8cee5e1 100644
--- a/contrib/groff/contrib/groffer/ChangeLog
+++ b/contrib/groff/contrib/groffer/ChangeLog
@@ -1,4 +1,977 @@
-2003-01-22 Bernd Warken <bwarken@mayn.de>
+ ________________________________________________________________
+ * release of groffer 0.9.22
+
+2005-22-04 Bernd Warken
+
+ ### `--whatis'
+
+ Produce a `groff' output and allow wild cards on filespec
+ parameters for `--whatis'.
+
+ * groffer2.sh:
+ - $_FILESPEC_ARG: New variable for storing the actual filespec
+ parameter.
+ - main_do_fileargs(): Set $_FILESPEC_ARG and add
+ what_is_filespec().
+ - main_parse_args(): Add --all to --whatis.
+ - to_tmp_line(): New function to write the arguments to the
+ temorary cat file.
+ - whatis_filename(): Rename of what_is(). Construct a better
+ printout using $_FILESPEC_ARG. Repair the sed sequneces.
+ - whatis_filespec(): New function to print the filespec once
+ during the `whatis' process.
+ - whatis_header(): New funtion for printing the header of the
+ `whatis' output.
+
+ * groffer.man: Revise the documentation of --whatis.
+
+ ### `--apropos*'
+
+ Produce `groff' for `--apropos*'. Allow `--sections' for
+ `--apropos', ignore it with `--apropos-*'.
+
+ * groffer2.sh:
+ - --apropos*: Make these options without argument.
+ - $_APROPOS_PROG: New variable for the program that is is used for
+ `apropos'.
+ - $_APROPOS_SECTIONS: New variable to determine the sections that
+ are filtered out of `apropos' output depending on `--apropos-*'.
+ - apropos_filespec(): Handling of apropos at the filespec level.
+ - apropos_run(): Remove it.
+ - apropos_setup(): New function.
+ - main_set_mode(): Remove handling of $_OPT_APROPOS*.
+
+ * groffer.man:
+ - Revise the documentation of `--apropos*'.
+ - Split section 'options for GNU man' into two sections `options
+ for man pages' and `long options taken over from GNU man'.
+ - Move `--apropos*', `--whatis', `--man', and `--no-man' to
+ section `options for man pages'.
+
+ ### special display (apropos and whatis)
+
+ * groffer2.sh:
+ - special_setup(): New function that chooses the setup between
+ apropos and whatis.
+ - special_filespec(): New function that does the output at the
+ filespec level for apropos or whatis.
+
+ ### handle `--sections' for man page searching
+
+ * groffer2.sh:
+ - man_do_filespec(): Use $_OPT_SECTIONS of --sections instead of
+ $_MAN_AUTO_SEC if non-empty. If a section was given on the
+ filespec parameter $_OPT_SECTIONS is ignored. This differs from
+ `man' which always uses the restricted sections of --sections.
+ This function works for both normal man page search and whatis.
+ - apropos_filespec(): Use --sections for --apropos, but not for
+ --apropos-* because these provide already their own sections.
+
+ ### wildcards in filespec arguments
+
+ * groffer2.sh: Wildcards are now accepted. In `--apropos*' and
+ `--whatis' they are interpreted as wildcard search elements; but
+ in normal display they are only handled as their own character.
+
+ ### development; new option
+
+ * groffer2.sh:
+ - --print: New option that prints just its argument for parameter
+ check.
+ - usage(): Add new option.
+ - $_OPT_DO_NOTHING: New variable for do_nothing(). Handle it at
+ the end of main_parse_Args().
+
+ * groffer.man: Add information on --print.
+
+ ### safe exit
+
+ * groffer2.sh:
+ - error(): Always exit with $_ERROR.
+ - exit_test(): New function to exit when first exit was hidden by
+ (). Call it after each $().
+
+ ### automatic shell determination
+
+ * groffer.sh:
+ - If no option --shell is given perform a test of several shells
+ to automatically start some shell for groffer2.sh. `ksh' is used
+ first because it can be safely terminated by Ctrl-C.
+ - This can be cancelled by providing --shell=''.
+ - Add test on `sed' program.
+
+ * groffer.man: Revise information on --shell.
+
+ ### trap
+
+ * groffer2.sh:
+ - trap_set(): Remove argument. Instead of $_ALL_EXIT use only
+ signal 0.
+ - trap_unset(): Rename trap_clean(). Instead of $_ALL_EXIT use
+ only signal 0.
+ - $_ALL_EXIT: Remove this variable.
+ - Replace all direct `trap' calls by trap_set().
+
+ * README_SH: New section `Bugs' on `trap'..
+
+ ### user errors, error output without function stack
+
+ * groffer2.sh:
+ - error_user(): New function for user errors.
+ - error(): Remove call of clean_up() because the trap will do it
+ with the exit. Remove the `kill' commands. Create a temporary
+ file `.error' that can be tested by exit_test() for a better exit
+ test (especially for shell `ksh').
+ - $_DEBUG_USER_WITH_STACK: New variable to enable function stack
+ output in error_user().
+ - list_from_cmdline(), list_single_from_abbrev(), main_set_mode():
+ Use error_user().
+
+ ### test modes on X and tty
+
+ * groffer2,sh:
+ - is_X(), is_not_X(): New functions for checking on X Window.
+ - $_VIEWER_HTML_TTY, $_VIEWER_HTML_X: New variables that split
+ $_VIEWER_HTML. Add `galeon'.
+ - main_parse_args(): Allow mode change for graphical modes only
+ when in X Window.
+ - _do_display() of main_display(): Create a special run for
+ viewers that run on the terminal; `lynx' is the only one so far.
+
+ ### add $GROFFER_MODE to command line
+
+ * groffer.sh:
+ - After the handling of the configuration files integrate
+ $GROFFER_OPT to the command line.
+ - This makes a `set' in the shell determination unnecessary.
+
+ * groffer2.sh:
+ - The debug test gets simpler because quotes are vanished without
+ $GROFFER_OPT.
+ - main_parse_MANOPT(): Prepend $mpm_list to the command line.
+ - main_parse_args(): `set' is unnecessary.
+
+ ### debug; new options
+
+ * groffer2.sh:
+ - --debug-all, --debug-lm, --debug-params, --debug-shell,
+ --debug-stacks, --debug-tmpdir, --debug-user: New options.
+ - --debug: Enable all debug variables except $_DEBUG_STACKS and
+ $_DEBUG_LM. By the new options the smallest abbreviation is now
+ `--debug'.
+ - $_DEBUG_STACKS: Rename $_DEBUG.
+ - $_DEBUG_PRINT_TMPDIR: New debug variable for printing the name
+ of the temporary directory in main_init().
+ - $_OPT_DEBUG: Remove this variable because debug is handled at
+ the early part of the script.
+ - clean_up(): Enlarge $_DEBUG_KEEP_FILES to not deleting the
+ temporary directory.
+ - usage(): Move all development options on a section of its own.
+ - Move the test of rudimentary shell functionality at the
+ beginning of the script. Add test on `sed'.
+ - Follow this by the debug section. The determination of all
+ --debug* options can be done without a function.
+
+ * groffer.man: Revise information on --debug and add new options.
+
+ ### variables
+
+ * groffer.sh:
+ - $_ERROR: Move the definition of this variable here.
+ - $_GROFF_VERSION: New variable, is set over @...@ construct.
+ - $_OUTPUT_FILE_NAME: Move this variable to groffer2.sh.
+
+ * groffer2.sh:
+ - $_MAN_AUTO_SEC_LIST: Rename $_MAN_AUTO_SEC because it represents
+ a list.
+ - $_MAN_AUTO_SEC_CHARS: New read-only variable for storing
+ $_MAN_AUTO_SEC_LIST in [] construct. Use it in man_do_filespec()
+ and whatis_filename().
+ - $_SPACE_CASE: New read-only variable with [] on space characters
+ with \ for `case' patterns. Use it in several functions.
+ - $_SPACE_SED: New read-only variable with [] on space characters
+ for `sed'. Use it in several functions.
+
+ ### options and display
+
+ * groffer2.sh:
+ - list_from_cmdline(): Add test whether the same abbreviation is
+ part of long options with and without arguments. Give handling of
+ `=' a `case' pattern of its own.
+ - main_display(): Remove unnecessary calls of `clean_up' in order
+ to use `mozilla' without problems. In _do_display(): Fix -X by
+ providing a different process when $_DISPLAY_PROG is empty.
+ - main_set_mode(): Accept options for viewers as is, without check
+ for program. Add test whether no program is given for a mode.
+ This avoids unnecessary empty $_DISPLAY_PROG in main_display().
+
+ ### viewer programs that run on the terminal (tty); new options
+
+ * groffer2.sh:
+ - $_VIEWER_TERMINAL: New variable that stores whether a viewer was
+ supposed to run on tty.
+ - --dvi-viewer-tty, --html-viewer-tty, --pdf-viewer-tty,
+ --ps-viewer-tty, --tty-viewer-tty, --X-viewer-tty, --x-viewer-tty,
+ --www-viewer-tty: New options for viewers that run on a terminal.
+ - main_parse_args(), _do_display() of main_display(): Use the new
+ options and the new variable.
+ - usage(): Add the new options.
+
+ * groffer.man: Add information on options --*-viewer-tty.
+
+ ### other fixes
+
+ * groffer2.sh:
+ - _do_display() of main_display(): Bear errors of `groff' run.
+ - is_not_file: Fix to have exactly one argument.
+ - is_not_prog(): Handle no arguments.
+ - list_has_not(): Fix.
+ - main_do_fileargs(): Remove $mdfa_exitcode.
+ - register_title(): Limit title to 4 elements.
+ - version(): Print the version information to standard output just
+ like `groff' does.
+ - --no-special: New option to disable former calls of `--all',
+ `--apropos*', and `whatis.
+ - --title: Make it an option with argument.
+
+2005-08-07 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ * contrib/groffer/Makefile.sub (install): Reference groffer2.sh
+ as $(srcdir)/groffer2.sh, so it will install when building in a
+ different directory from the source.
+
+ ________________________________________________________________
+ * release of groffer 0.9.21
+
+2005-08-02 Bernd Warken
+
+ ### @...@ constructs
+
+ * groffer.sh:
+ - $_AT: New variable for `@'.
+ - @...@: Replace the @...@ constructs by variables _AT_..._AT.
+ These constructs are transformed by `make' to useful information.
+ Keep all of these constructs in the first part of groffer.sh. For
+ a run before a `make' call, the script sets these variables to
+ special values for testing purpose.
+ - $_GROFFER_LIBDIR: Variable pointing to the groffer library
+ directory @libdir@/groff/groffer.
+
+ ### Configuration files
+
+ * groffer.sh:
+ - Add test for `$()' construct.
+ - Read and transform the configuration files and execute the
+ emerging commands. The `sed' script was heavily enlarged to
+ handle line with spaces and quotes. The emerging script is now
+ called by `eval', so no temporary file is needed.
+ - $_CONF_FILE_ETC, $_CONF_FILE_HOME: New variables for the config
+ files.
+ - $_SQ, $_SP: Move variables for characters before the handling of
+ the configuration files. Rename $_SQUOTE to $_SQ and $_SPACE to
+ $_SP.
+ - $GROFFER_OPT: Remove cleaning of this variable before the
+ reading of the configuration files.
+
+ * groffer2.sh:
+ - main_init(): Remove the getting of the configuration files.
+
+ ### Rewrite the shell determination
+
+ * groffer.sh:
+ - Get rid of all functions in `groffer.sh'. Rewrite the shell
+ determination with `` and $().
+ - --shell: Shortest abbreviation is `--sh'. Allow arguments for
+ the shell name.
+ - Allow an empty argument for --shell as shell name to overwrite a
+ specified shell; an empty shell name gets back to the default
+ shell.
+ - The shell determination now inludes the full handling of the
+ config files. The `--shell' option needs no longer a line
+ starting with `-'.
+
+ ### Test of unset
+
+ * groffer.sh:
+ - Remove test of `unset'.
+ - Remove all calls of `unset'.
+ - Use one character names for all variables that are meant to be
+ local in this script.
+
+ * groffer2.sh:
+ - Move the test of `unset' to the testing of rudimentary shell
+ functionality without change.
+
+ ### Allow abbreviations for long options
+
+ * groffer2.sh:
+ - list_has_abbrev(): New function for checking a list having an
+ element with a given abbreviation.
+ - list_get_single_from_abbrev(): New function to retrieve the
+ element having a given abbreviation.
+ - list_from_cmd_line(): For an option abbreviation determine the
+ corresponding long option.
+ - From the man option lists remove the elements that are also in
+ a groffer list.
+ - Allow abbreviation for the early test of --debug.
+
+ * groffer.sh: Allow abbreviation for the early test on --shell.
+ - get_opt_shell(): Rewrite _get_opt_shell() and the shell test
+ around it.
+ - test_on_shell(): Rename function _test_on_shell().
+ - $_SHELL: global variable for the shell to run groffer2.sh.
+
+ ### Get rid of `sh -c'
+
+ * groffer2.sh:
+ - main_display(), _do_display(): Remove the `sh -c' calls. Make
+ the cleanup working without it.
+ - _do_display(): Extend _do_display() such that it can be used for
+ the pdf mode as well.
+ - _make_pdf(): New subfunction of main_display() for running the
+ additional parts of pdf mode in _do_display().
+ - rm_file(), rm_file_with_debug(), rm_tree(): New functions for
+ removing files and directories.
+
+ ### Change directory
+
+ * groffer2.sh:
+ - $_START_DIR: New variable to store the directory at the starting
+ time of the script.
+ - main_display(): Go to the groffer temporary directory to be able
+ to process internal `groff' data like pictures.
+ - clean_up(): Get back to the starting directory.
+
+ ### Compatibility with strange shells
+
+ * groffer2.sh:
+ - clean_up(): `zsh' and `posh' had difficulties with `eval'.
+ - is_*(): Add test on empty argument. Some shells return true on
+ `test -d' etc. with empty argument, while most shells return
+ false.
+ - echo1(); New function to print single line `cat <<EOF'. Replace
+ all `echo x' by `echo1'.
+ - list_has_abbrev(), list_from_cmdline(): Correction.
+ - main_parse_MANOPT(): Repair and revise.
+ - --do-nothing: New option without output (for development).
+ - Rewrite rudimentary shell functionality near the beginning of
+ the script.
+
+ * groffer.sh, groffer2.sh:
+ - Remove `;' after the commands `if', `while', and `until'.
+
+ ### Debugging information
+
+ * groffer2.sh:
+ - $_DEBUG_PRINT_PARAMS: New variable for printing all parameters
+ from the config files, $GROFFER_OPT, and command line after they
+ have been transformed.
+ - $_DEBUG_PRINT_SHELL: New variable for printing the name of the
+ shell found in groff.sh.
+ - main(): Move the landmarks of main-*() into main().
+
+ ### Further checks and additions
+
+ * groffer.sh, groffer2.sh:
+ - $_PROGRAM_NAME: Replace this variable by `groffer'. The program
+ name is now stable.
+ - $_GROFFER_RUN: Remove this variable. As `groffer.sh' or
+ `groffer' is no longer rerun, this variable is not necessary any
+ more.
+
+ * groffer2.sh:
+ - main_set_resources(): Make the default viewers capable to use
+ arguments in the list.
+ - leave(): Add an argument for given exit code. Use it where
+ suitable in main_*().
+ - do_filearg(): Add error messages for non-existing files and man
+ pages.
+ - _do_opt_V(): New subfunction of main_display() to handle the
+ output for option `-V'. `groff -V' is greatly enlarged by
+ `groffer' specific information.
+ - register_title(): Handle file names with spaces. Replace spaces
+ by `_'.
+ - is_existing(): Add `test -c' for special files.
+ - usage(): Add `=arg' to the options with an argument. Add option
+ `--tty-viewer'.
+ - kghostview: In the default viewer list, add option
+ `--scale=1.45'.
+ - $_OPTS_CMDLINE_SHORT_NA: Correct a lacking space.
+
+ * Makefile.sub: Repair the installation instructions for
+ groffer2.sh.
+
+ * groffer.man:
+ - Add paragraph on option handling.
+ - Add option `--do-nothing'.
+ - Reorder option for development and `groff'.
+ - Rewrite documentation for option `-V'.
+ - Expand `--shell'.
+ - Reformulate sections CONFIGURATION FILES, COMPATIBILITY and SEE
+ ALSO.
+ - Make `man' italic where possible.
+ - .copyleft: Adjust the fonts.
+
+ * README: Update sections `Output' and `Compatibility'.
+
+ * README_SH:
+ - Add `mksh' as compatible shell.
+ - Add information on the scripts after the split.
+
+ * TODO: Remove some fulfilled parts.
+
+ * ChangeLog: Remove final spaces.
+
+ ________________________________________________________________
+ * release of groffer 0.9.20
+
+2005-07-30 Bernd Warken
+
+ ### Split groffer.sh into two files groffer.sh and groffer2.sh.
+
+ * groffer.sh:
+ - Remove the second part of this script. It is now in
+ groffer2.sh.
+ - $_GROFFER2_SH: New variable to point to the installed position
+ of `groffer2.sh'. This position is presented using @libdir@.
+
+ * groffer2.sh: New script containing the second part of
+ groffer.sh. This script will be installed in the groffer library
+ directory @libdir@/groff/groffer, this might be
+ /usr/local/lib/groff/groffer/groffer2.sh for example.
+
+ * Makefile.sub:
+ - `groffer': Add replacement of @libdir@.
+ - `install_data': Add the installation of the groffer library
+ directory and groffer2.sh.
+ - `uninstall_sub': Delete the installed `groffer2.sh' and the
+ groffer library directory.
+
+ * README_SH:
+ - Remove the function list.
+ - Add argument options to the list of used commands.
+ - Documentation of the splitting of the script.
+ - Document the possible abbreviation of options.
+
+ ________________________________________________________________
+ * release of groffer 0.9.19
+
+2005-07-07 Bernd Warken
+
+ * groffer.sh: extensions
+ - `mode x': Mode for the equivalent options `--x', `--mode x',
+ `--X' `--mode X', and the default mode. The default assumes a
+ resolution of 75 dpi. The default device for a resolution of 75
+ dpi is `X75-12', the default device for a resolution of 100 dpi is
+ `X100'. The default geometry for the resolution of 100 dpi is set
+ to the width 800 dpi.
+ - `mode X': New mode for option -X only.
+ - `-V': Extent the `groff' output of -V by `groffer' specific
+ information (in main_display()).
+ - register_file(): Replace title `-' by `stdin'.
+ - $_DEBUG_KEEP_FILES: If set to `yes' the files in the temporary
+ directory are not deleted before the end trap.
+
+ * groffer.sh: get `zsh' to work as well
+ - tmp_create(): Use `: >file' for generating an empty file.
+ - rmdir: Replace `rmdir' by `rm -f -r'.
+ - eval: Add `eval' to many commands with variable arguments.
+
+ * groffer.sh: repair `debug'
+ - Print all debug output to stderr.
+ - $_FUNC_STACK: Built function call stack even when $_DEBUG is not
+ set. Now the arguments are not added.
+ - $_DEBUG: If set to `yes' print 3 call stack events: the function
+ that is added with its arguments is printed with `+++ '
+ (func_push()); the call stack after the addition is printed with
+ `>>> ' (func_push()); the call stack after the removing is printed
+ with `<<< ' (func_pop()).
+ - error(): Always print the function call stack on errors.
+
+ * groffer.sh: Corrections
+ - $_groffer_run: Rename to $_GROFFER_RUN.
+ - $unset: Rename to $_UNSET.
+ - Repair test of `unset'.
+ - Repair test for `--shell'. The script is now rerun under the
+ shell specified in the option argument. This can increase the
+ speed.
+
+ * README_SH: `zsh' now works.
+
+ * groffer.man:
+ - Reformulate the information for the `groffer' specific details
+ of option `-V'.
+ - Add information on the debug process.
+ - Add information on the default devices in `x mode'.
+ - Minor corrections.
+
+ ________________________________________________________________
+ * release of groffer 0.9.18
+
+2005-07-01 Bernd Warken
+
+ * groffer.sh: further shell compatibility
+ - `echo': Remove options and possible options of `echo' by
+ preceding the argument with a character `x' that is removed by
+ `sed' or replace `echo' by `cat <<EOF'. `echo -n' seems to be not
+ portable, so it is omitted.
+ - `for': Remove `;' from within `for' (because of ksh).
+ - `ls': Old UNIX systems echoed the error message to standard
+ output. So handle the output with `sed'. If the output contains
+ `not found' map it to an empty string.
+ - `true': Replace `true' by command `:'. Remove test of `true'
+ (because `ash' refuses the redefinition of builtins even in an
+ unreachable `if' branch).
+ - `false': Remove test of `false'; it isn't used any more.
+ - `test': As `test -e' does not exist in Solaris 2.5 replace it by
+ `test -f || test -d'.
+ - `unset': `unset' is said to be not portable. As `ash' protests
+ against the definition of the function `unset()' in the test of
+ `unset' replace the test by defining `$unset' to `unset' if it
+ exists and to `:' otherwise. Use `eval $unset' instead of the
+ direct command `unset'.
+ - _get_opt_shell(): Replace `for' loop with `shift' by `while'.
+ - man_search_section(): Replace `for f in filename*' by a test on
+ the existence of `filename*'.
+ - `zsh' interprets `$...' as `"$..."'. So `eval' must be called;
+ This cannot be used in `for i in $f', so it must be rewritten as
+ `for i in $(eval set x $f; shift; echo "$@")'
+
+ * groffer.sh:
+ - `--X', `--x', `--mode=X', `--mode=x': Make these options
+ equivalent to choosing an X device by setting `-TX75-12'. `-X' is
+ still equivalent to `groff -X'.
+ - main_init(): Choose the name of the temporary file by adding a
+ number using `expr' if it exists and cannot be removed.
+ - main_parse_args():Repair some options by replacing `$mpa_mode'
+ by `$_OPT_MODE'.
+ - catz(): Rename it to cat_z() to avoid problem with existing
+ programs.
+ - where(): Rename to where_is().
+ - $_CONFFILES: Rename to $_CONF_FILES.
+ - $_HAS_BZIP: export and preset it.
+
+ * groffer.man:
+ - Document the `X mode' changes.
+ - Add `@g@' to `troff'.
+
+ * README, README_SH, TODO:
+ - Add date line `Latest update:'.
+ - Add `...' quoting to essential terms.
+ - Add Emacs mode at the end.
+
+ * README_SH:
+ - Add documentation on the above compatibility changes.
+ - Add documentation on used commands.
+ - Mention the tested shells.
+
+ * Makefile.sub:
+ Readd `@g@'.
+
+ ________________________________________________________________
+ * release of groffer 0.9.17
+
+2005-06-23 Bernd Warken
+
+ * groffer.sh: get rid of `local' in functions (it is not POSIX)
+ - Replace local variables by variable names with a special prefix
+ that is an abbreviation of the corresponding function name (quasi-
+ local variables).
+ - Unset the quasi-local function variables before returning.
+ - _t_e_s_t_f_u_n_c_(): Remove tests for local and global
+ variables.
+ - Add quasi-local variables for saving the content of
+ single-character variables.
+ - Remove some unused local and global variables.
+ - Several variables were forgotten to make local. They are now
+ made quasi-local.
+
+ * groffer.sh: other corrections
+ - $return_var: New function (after `eval') for an arbitrary
+ return value.
+ - obj*(): Add return modes.
+ - Rewrite tests for `true' and `false'.
+ - Add function names to error calls where it was forgotten.
+ - `for': Replace `for x in "$@"' by `for x'.
+ - `set': Replace `set -- ...' by `set x ...; shift'.
+ - `sed': Replace `\|.*|s|...|...|' by `s|...|...|'.
+
+ * README_SH:
+ - Add information on the removing of `local'.
+ - New section for non-POSIX shell restrictions.
+
+2005-06-20 Keith Marshall
+
+ * README-SH: Information of `Portable shells' in info autoconf.
+
+ ________________________________________________________________
+ * release of groffer 0.9.16
+
+2005-06-19 Bernd Warken
+
+ * groffer.sh: Place each `then', `else', and `do' on a line of its
+ own because some shells do not support the mixture mode.
+
+ * groffer.man: Add section `BUGS'.
+
+ * README_SH:
+ - Add compatibility information.
+ - Correct documentation for function arguments.
+
+2005-06-18 Keith Marshall
+
+ * groffer.sh: $_NULL_DEV: Replace /dev/null by $_NULL_DEV which is
+ either /dev/null or NUL if /dev/null does not exist.
+
+2005-06-17 Zvezdan Petkovic
+
+ * Makefile.sub: $(RM): Define it to `rm -f' because not all `make'
+ programs have it predefined.
+
+2005-06-16 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.15
+
+ * Makefile.sub:
+ - Use `$(RM)'.
+ - Use `sed -f $(SH_DEPS_SED_SCRIPT)'.
+
+2005-05-20 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.14
+
+ * groffer.man: correction of non-hyphenation
+
+2005-05-17 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.13
+
+ * groffer.sh:
+ - $_VIEWER_DVI: Add `kdvi'.
+ - $_VIEWER_PDF: Add `kghostview', `ggv', and `kpdf'.
+ - $_VIEWER_PS: Add `kghostview' and `ggv'.
+ - $_modefile: For the output file name, add extension .ps for ps
+ mode and .dvi for dvi mode. This exists already for the html and
+ pdf modes.
+ - Update some parts of the documentation.
+
+ * README, README_SH:
+ - Move some parts on usage from README_SH to README.
+ - Reformulate several parts of both files.
+
+ * groffer.man: update
+
+2005-05-14 Keith Marshall
+
+ * groffer.sh:
+ - first line: Add space to `#! /bin/sh'.
+
+2004-11-15 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.12
+
+ * groffer.sh:
+ - main_init(): Rewriting of the creation of the temporary
+ directory to ensure that it cannot be made writable apart from the
+ user. If the directory already exists and cannot be removed then
+ append `X' to the directory name.
+ - is_non_empty_file(): fix it to use POSIX `test -s'.
+ - is_existing(): new function.
+ - POSIX `rm -f -r': use this in `clean_up()' and `main_init()'.
+ - `--macro-file': remove this unused long option.
+ - `-V', `--source', `--device': move these from groff options
+ to groffer options.
+ - `$_TMP_DIR_SUB': remove this unused variable.
+
+2004-06-15 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.11
+
+ * groffer.sh:
+ - To the search of the `--apropos-*' options, add man pages with a
+ subsection in their apropos output.
+
+2004-06-02 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.10
+
+ * groffer.sh:
+ - Remove automatic call of `ash' due to inconsistencies of
+ different ash versions.
+ - In the first run, add recognition of `--shell' lines in the
+ groffer configuration files. To configure an external shell in
+ a configuration file, a line starting with `--shell' is
+ necessary.
+ - list_from_cmdline(): Simplify the arguments.
+ - As $POSIXLY_CORRECT is internally set to `y' by some GNU
+ `/bin/sh' shells the following 2 fixes are necessary:
+ -- `sed': Empty patterns are not allowed with $POSIXLY_CORRECT
+ set; so move the address information before the `s' command to the
+ pattern after the command, and write `.*' to the address field.
+ -- list_from_cmdline(): Remove the strange $POSIXLY_CORRECT style
+ to finish the option processing after the first non-option
+ argument; use the flexible GNU mixing of options and file names
+ instead.
+
+ * groffer.man:
+ - Remove any hints on `ash'.
+ - Add minus line behavior of `--shell' for configuration and add a
+ corresponding example.
+ - Update the information on $POSIXLY_CORRECT.
+
+2004-05-29 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.9
+
+ * groffer.sh:
+ Fix first run section to allow the starting shell to go on if
+ `ash' is not available.
+
+ * groffer.man:
+ Remove unnecessary information on groffer version.
+
+2004-05-12 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.8
+
+ * groffer.sh:
+ Fix problems of `test' by adding subs to arguments.
+
+ * groffer.man:
+ Write the file license as macros that are called in sections
+ AUTHOR and COPYING.
+
+ * .cvsignore:
+ Restore this file.
+
+2004-04-30 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.7
+
+ * groffer.sh:
+ - obj(), obj_data(), obj_from_output(), obj_set(): New object
+ oriented functions to minimize complicated `eval' commands.
+ - list_*(): Corrections.
+ - usage(): Streamlining.
+
+ * groffer.man, README_SH:
+ Corrections.
+
+2004-04-27 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.6
+
+ This version replaces the license of all files except ChangeLog of
+ the groffer source to the GNU General Public License (GPL) of the
+ version described in files COPYING and LICENSE in the groff top
+ source directory.
+
+ * groffer.man:
+ Changement from the GNU Free Documentation License (FDL) to
+ the GNU General Public License (GPL).
+
+ * README, README_SH, TODO:
+ Add license GNU General Public License (GPL).
+
+ * Makefile.sub, groffer.sh:
+ Keep the GNU General Public License (GPL), but refer to the
+ COPYING and LICENSE files.
+
+ * ChangeLog: Add a license in the style of Emacs ChangeLog file,
+ which is weaker than the GPL, but has its flavor.
+
+2004-04-24 Bernd Warken
+ ________________________________________________________________
+ * release of groffer 0.9.5
+
+ This version is a rewrite of groffer in many parts, but it is kept
+ in the old single script style.
+
+ Overview of new options:
+ --text, --mode text, --tty-viewer,
+ --X, --mode X, --X-viewer, --html, --mode html, --html-view,
+ --apropos-data, --apropos-devel, --apropos-progs
+
+ New file:
+ <groffer-source>/README_SH
+
+
+ ******* Extension of the `apropos' handling
+
+ The output of man's `apropos' has grown immensely meanwhile, so it
+ has become inefficient. Now `groffer' provides new options to get
+ the a selected information from this output.
+
+ * groffer.sh:
+ `--apropos-progs': new option for displaying only information
+ on programs (man page sections 1, 6, and 8)
+ `--apropos-data': new option for displaying only information
+ on documented data (man page sections 4, 5 and 7)
+ `--apropos-devel': new option for displaying only information
+ on development documentation (man page sections 2, 3 and 9)
+ `--apropos': still displays just the output of man's `apropos'
+ program.
+ - Specify all of these options as a single argument option; that
+ makes groffer's `--apropos' option slightly different because
+ the corresponding `man' option does not have arguments, but takes
+ all file arguments as apropos targets. So just ignore the `man'
+ options `-k' and `--apropos' in the parsing of $MANOPT.
+ - Exit after processing one `apropos' call.
+
+
+ ******* Quasi object oriented function arguments
+
+ An object is the name of an environment variable. The value of
+ this variable contains the object's content. This allows to
+ specify function arguments and the calling syntax in a simpler way
+ by letting the first argument be a variable name, usable for input
+ or output.
+
+ Such an object type is `list', the string value of a shell
+ variable arranged in space-separated single-quoted elements, such
+ as $GROFFER_OPT internally.
+
+ * groffer.sh:
+ - Remove list_from_args(), list_element_from_arg()
+ list_from_lists(), list_length(), and list_prepend().
+ They can be replaced by list_append().
+ - All list*() functions are rearranged such that the first
+ argument is a list object, the name of a variable.
+
+
+ ******* Simplification of configuration files
+
+ The new syntax of the groffer configuration files is
+ - all lines starting with a `-' character are interpreted as
+ command line options for all calls of groffer; they are collected
+ and prepended to the actual value of $GROFFER_OPT; optional
+ spaces at the beginning.of the line are omitted.
+ - all other lines are interpreted as a shell command and executed
+ in the current shell of the groffer call.
+
+ Precedence:
+ - The command line and the external environment variables such as
+ $GROFFER_OPT of the groffer call have the highest precedence.
+ - This is overwritten by the configuration file in the user's home
+ directory.
+ - The system configuration file in /etc has the lowest
+ precedence.
+
+ * groffer.sh:
+ The configuration files are now called after the determination of
+ the temporary files in main_init().
+
+
+ ******* Script file name
+
+ The file name of the script is needed for the several calls during
+ the search for the optimal shell.
+
+ * groffer.sh:
+ - $_GROFFER_SH: replace $_this by $_GROFFER_SH and use $0 for
+ determining the file name of the script for the following calls,
+ instead of the cumbersome @BINDIR@ construction.
+ - Force the script to be called as an executable file, so $0 must
+ contain the program name.
+
+
+ ******* Improved temporary file names
+
+ Just like groff, groffer mixes all file parameters into a single
+ output file. Its name is now constructed as a comma-separated
+ list built from the file name arguments without a leading comma.
+ So a leading comma can be used for the internal temporary file
+ names.
+
+ * groffer.sh:
+ - $_OUTPUT_FILE_NAME: new global variable as basis for the output
+ file name; it is set in main_set_resources().
+ - tmp_create(): use `,name' for temporary files different from
+ output file because the output file name does not start with a
+ comma. `$$' is not needed anymore.
+ - main_display(): simplification of $_modefile in _do_display()
+ and single display modes.
+ - Add extension `.html' to output file name in html mode.
+ - base_name(): correction for strange positions of `/'.
+
+
+ ******* Mode fixes
+
+ * groffer.sh:
+ - Set the main default mode to `x' with groff's X Window viewer
+ `gxditview'.
+ - Allow 'x' and 'X' in `--mode' for the X Window mode; the same
+ for `--x' and `X', `--x-viewer' and `--X-viewer'.
+ - Make groff's `-X' equivalent to `mode X'.
+ - Fix `--auto', `--mode auto', and `--default-modes'.
+ - `html' mode: new mode equivalent to `www', add `konqueror' and
+ `lynx' as viewers.
+ - `pdf' mode: fix zoom options for pdf-viewer `xpdf' in
+ main_set_resources(); in main_display() fix the display structure.
+ - Set default X Window resolution to 75dpi. This is not optimal,
+ but with a higher value the options and resources for some viewers
+ must be optimized.
+ `--text' and `--mode text': new option for text output without a
+ pager.
+ - `--tty-viewer': new option equivalent to `--pager'.
+ - Correct the pagers for `tty' mode.
+ - Fix `groff' mode in main_set_resources() and main_display().
+ - Harmonize `--mode arg' with the equivalent options `--arg'.
+
+
+ ******* Fixes for command line options
+
+ * groffer.sh:
+ - list_from_cmdline(): fix the parsing of options with arguments.
+ - Rename $_OPT_TTY_DEVICE to $_OPT_TEXT_DEVICE.
+ - $_OPTS_X_*: new variables for the inhereted X Window variables.
+ - Improve the distribution of the command line options into
+ $_OPTS_GROFFER_*, $_OPTS_GROFF_*, $_OPTS_X_*, and $_OPTS_MAN_*.
+ - $_OPTS_MANOPT_*: new variables for the parsing of $MANOPT.
+ - Correct $_OPTS_CMDLINE_*.
+ - Remove some unused $_OPTS_*.
+ - `--iconic': new option from `-iconic' of the X Window toolkit.
+ - Correct `--rv' to an option without argument.
+ - Minor fixes of other X Window toolkit options.
+
+
+ ******* Other fixes
+
+ * groffer.sh:
+ - is_prog(): allow 0 arguments.
+ - is_not_writable(): new function.
+ - is_*(): fix trailing return codes.
+ - Replace most `test' calls by is_*() functions.
+ - man_setup(): due to bugs in `manpath', prefer
+ manpath_set_from_path() for the determination of the man page path.
+ - man_search_section(): correction of some `for' loops.
+ - Remove export of external non-groffer variables.
+
+
+ ******* Documentation
+
+ * groffer.man:
+ - Reorder the option details according to the option origin as
+ groffer, groff, X, and man options.
+ - Add the programming changes information mentioned above.
+ - Support man pages with a dot in their name
+
+ * README_SH: new file
+ Move large parts of the documentation in `groffer.sh' into this
+ file.
+
+ * groffer.sh: usage():
+ - Change the output for `--help' to standard output.
+ - Restructure the information for this help output.
+
+
+ ******* Removement of the author's email address
+
+ Because of the extreme spam attacks, the author removed all
+ occurencies of his email address in every file of the groffer
+ source.
+
+2003-01-22 Bernd Warken
________________________________________________________________
* release of groffer 0.9.4
@@ -15,11 +988,11 @@
- Test existence of directory before deleting it in the
`clean_up' definitions.
- Correct help output in `usage' (called by `--help').
-
+
* TODO:
Remove mention of `shoop' and `apropos'.
-2002-10-21 Bernd Warken <bwarken@mayn.de>
+2002-10-21 Bernd Warken
________________________________________________________________
* release of groffer 0.9.3
@@ -42,8 +1015,8 @@
* TODO: think about...
- writing part of groffer in C/C++.
- handling several files with different macro packages.
-
-2002-10-17 Bernd Warken <bwarken@mayn.de>
+
+2002-10-17 Bernd Warken
________________________________________________________________
* fixes of groffer 0.9.2
@@ -55,12 +1028,12 @@
- New macro ".Header_CB" for CB font in .TP headers; used for
definition of variables in option --mode.
- Fix some option references to refer to long options.
-
+
* README:
New file for general information on the groffer source; it is
not installed.
-
-2002-10-14 Bernd Warken <bwarken@mayn.de>
+
+2002-10-14 Bernd Warken
* Makefile.sub:
add replacement "@BINDIR@" to "$(bindir)" for "groffer:"
@@ -72,7 +1045,7 @@
* groffer.man:
Remove double definition of filespec parameters.
-2002-10-13 Bernd Warken <bwarken@mayn.de>
+2002-10-13 Bernd Warken
________________________________________________________________
* release of groffer 0.9.2
@@ -94,16 +1067,16 @@
- New macro for file names ".File_name".
- "Option Parsing" is moved to section "COMPATIBILITY".
- Fix some "EXAMPLES".
-
-2002-09-30 Bernd Warken <bwarken@mayn.de>
+
+2002-09-30 Bernd Warken
________________________________________________________________
* release of groffer 0.9.1
-
+
* TODO: remove done entries
- Remove request for different shells.
- Remove the 'sed' complaints.
-2002-07-15 Bernd Warken <bwarken@mayn.de>
+2002-07-15 Bernd Warken
* groffer.sh: replace `sed' interface by direct `sed'
- This improves the performance of the shell programming parts
@@ -127,7 +1100,7 @@
groffer was called from the command line, or with the shell
name in the first line of the script, actually `/bin/sh'.
-2002-07-12 Bernd Warken <bwarken@mayn.de>
+2002-07-12 Bernd Warken
________________________________________________________________
* fixes for groffer 0.9.0
@@ -137,7 +1110,7 @@
- the string `is part of '
- groff's version information (version number and copyright),
but not groff's `called subprograms' information.
-
+
* groffer.sh: minor fixes
- Fix the argument parser to process argument `-' correctly.
- Some display programs have trouble with empty input; feed a
@@ -147,7 +1120,7 @@
* TODO:
fix entry `shoop' (not 'shopt').
-2002-06-28 Bernd Warken <bwarken@mayn.de>
+2002-06-28 Bernd Warken
________________________________________________________________
* release of groffer 0.9.0
@@ -160,25 +1133,25 @@
- New options `--pdf', `--pdf-viewer', `--mode pdf'.
- Standard pdf viewers `xpdf' and `acroread'.
- For `xpdf', choose zoom `z 3' for 100 dpi, `z 2' for 75 dpi.
-
+
* groffer.sh: support bzip2 decompression
- add test for `bzip2' with necessary options
- extend functions `catz()' and `save_stdin()'.
* TODO
remove entry on `bzip' decompression (done).
-
+
* groffer.man:
- Document new `pdf' features.
- Document new `bzip2' decompression.
- Fix documentation for `--auto-modes'.
-
+
* groffer.sh: minor fixes
- Improve device tests in `tty' and `dvi' modes.
- Internally, map mode `auto' to '' to facilitate tests.
- Fix auto mode sequence to: `ps,x,tty' as was intended.
-2002-06-25 Bernd Warken <bwarken@mayn.de>
+2002-06-25 Bernd Warken
* groffer.sh:
Fix `source' mode.
@@ -186,7 +1159,7 @@
* groffer.man:
Fix some indentations.
-2002-06-23 Bernd Warken <bwarken@mayn.de>
+2002-06-23 Bernd Warken
________________________________________________________________
* release of groffer 0.8
@@ -198,7 +1171,7 @@
- Document the configuration files in new section `FILES'.
- Redesign section `EXAMPLES'.
- Remove documentation for `-W'.
-
+
* groffer.sh: new debugging features
- Disabled by default; enabled by environment variables.
- Add landmark() to catch typos with quotes.
@@ -210,7 +1183,7 @@
- Actually, the groffer script uses only shell builtins found
in `ash' (a subset of POSIX) and POSIX `sed' as the only
external shell utility.
-
+
* groffer.sh: customization of viewers
- In `groff' mode, the groffer viewing facilities are disabled.
- The postprocessor option `-P' costumizes the viewer only in
@@ -231,7 +1204,7 @@
-> `--title': set viewer window title.
-> `--xrm': set X resource.
- Remove misnamed option `--xrdb'.
-
+
* groffer.sh: new mode structure
- New Postcript mode `ps' (`--ps'):
-> default viewers: gv,ghostview,gs_x11,gs;
@@ -256,7 +1229,7 @@
-> automatically active with one of `-V', `-X', `-Z'.
- Revise `tty' mode:
-> allow several text devices.
- ->
+ ->
- Reorganize the mode management:
-> new mode setting option `--mode'.
-> logically separate source, groff, and display modes.
@@ -269,7 +1242,7 @@
- `${HOME}/.groff/groffer.conf' user configuration.
- The configuration file are shell scripts for now; later
implementations can identify this from the `#! /bin/sh' line.
-
+
* groffer.sh: new data structure `list':
- Implement a `list' data structure as a string consisting of
single-quoted elements, separated by a space character;
@@ -286,18 +1259,18 @@
allow unusual characters in options.
- Parse $MANOPT first; translate essential arguments into
groffer options.
-
+
* groffer.man:
- determine prompt length for `.Shell_cmd'* dynamically.
- naming scheme for static strings and registers changed to
`namespace:macro.variable'.
-
+
2002-06-16 Werner Lemberg <wl@gnu.org>
* groffer.sh:
Implement man option `--ascii' by `-mtty-char'.
-
+
2002-05-31 Werner LEMBERG <wl@gnu.org>
@@ -305,7 +1278,7 @@
Increase to 4m (we use `sh#' as the prompt).
-2002-05-31 Bernd Warken <bwarken@mayn.de>
+2002-05-31 Bernd Warken
________________________________________________________________
* release of groffer 0.7
@@ -341,14 +1314,14 @@
- fix TP_header.
-2002-05-28 Bernd Warken <bwarken@mayn.de>
+2002-05-28 Bernd Warken
________________________________________________________________
* release of groffer 0.6
This is almost a complete rewrite since groffer 0.5 .
________________________________________________________________
* Documentation
-
+
* groffer.man:
- Apply the changes done in www.tmac (.URL and .MTO)
- Replace \fP by \f[].
@@ -381,7 +1354,7 @@
- The only external programs used are POSIX `sed' and the
fallback to `apropos'. All other program calls were
replaced by shell builtins and functions.
-
+
________________________________________________________________
* Cosmetics
@@ -433,10 +1406,10 @@
characters in file names).
- Fix and complement usage().
- The filespec parsers gets a function of its own do_manpage().
-
-
-2002-01-08 Bernd Warken <bwarken@mayn.de>
-
+
+
+2002-01-08 Bernd Warken
+
* groffer 0.5 (beta) released
* groffer.man:
@@ -445,7 +1418,7 @@
- Examples of shell commands now print in font CR instead of CB.
- Remove documentation for option `-X'.
- Add documentation for option `--dpi'.
-
+
* groffer.sh:
- New method for creating temporary files, based on process
IDs. This is reliable enough and suitable for GNU and POSIX.
@@ -462,15 +1435,15 @@
- Implement option `--dpi' for setting the resolution for the X
viewer, which had already been documented in earlier versions.
-2002-01-07 Bernd Warken <bwarken@mayn.de>
+2002-01-07 Bernd Warken
* groffer 0.4 (beta) released (as groff `contrib')
-
+
* groffer.man:
- New features documented.
- Macros stream-lined.
- Section EXAMPLES added.
-
+
* groffer.sh:
- System tests added/optimized.
- Speed/memory optimizations by defining some shell functions
@@ -501,7 +1474,7 @@
* groffer.man (OptDef): Add missing backslashes.
Update copyright.
-2001-12-15 Bernd Warken <bwarken@mayn.de>
+2001-12-15 Bernd Warken
* groffer 0.3 (alpha) released (still stand-alone package).
@@ -519,20 +1492,20 @@
* Recognize the following filespecs as man-page parameters:
man:name(section), man:name, name.section, name.
-
-2001-12-03 Bernd Warken <bwarken@mayn.de>
+
+2001-12-03 Bernd Warken
* Stand-alone package for groffer 0.2 (alpha) created
Files: groffer, groffer.man, Makefile, TODO, ChangeLog
-
-2001-12-02 Bernd Warken <bwarken@mayn.de>
+
+2001-12-02 Bernd Warken
* groffer 0.2 (alpha) program released.
* Name changed from `groffview' to `groffer'.
* Comments added.
-
+
* Name changed from `groffview' to `groffer'.
* Options harmonized with groff.
@@ -544,14 +1517,30 @@
* Bugs with temporary files fixed.
* Code restructured and comments added.
-
-2001-11-28 Bernd Warken <bwarken@mayn.de>
+
+2001-11-28 Bernd Warken
***** groffview 0.1 (experimental) and groffview.man released
(predecessor of groffer, shell script)
* Options : -h --help, -v --version
-
+
* Search for man-pages based on $MANPATH
* development of `groffview' shell script started
+
+2001-11-28 Bernd Warken
+
+ ________________________________________________________________
+ License
+
+ Copyright (C) 2001,2002,2003,2004,2005
+ Free Software Foundation, Inc.
+ Written by Bernd Warken
+
+ Copying and distribution of this file, with or without
+ modification, are permitted provided the copyright notice and this
+ notice are preserved.
+
+ This file is part of `groffer', which is part of the `groff'
+ project.
diff --git a/contrib/groff/contrib/groffer/Makefile.sub b/contrib/groff/contrib/groffer/Makefile.sub
index 333dedbd4533..54dfce40933b 100644
--- a/contrib/groff/contrib/groffer/Makefile.sub
+++ b/contrib/groff/contrib/groffer/Makefile.sub
@@ -1,47 +1,60 @@
-# Makefile.sub for `groffer' (integration into the groff source tree)
+# Makefile.sub for `groffer' (integration into the `groff' source tree)
# File position: <groff-source>/contrib/groffer/Makefile.sub
-# Last update: 21 October 2002
+# Copyright (C) 2001,2002,2005 Free Software Foundation, Inc.
+# Written by Werner Lemberg <wl@gnu.org> and Bernd Warken.
-# Copyright (C) 2001,2002 Free Software Foundation, Inc.
-# Written by Werner Lemberg <wl@gnu.org>
+# Last update: 15 August 2005
-# This file is part of groff.
+# This file is part of `groffer' which is part of `groff'.
-# groff is free software; you can redistribute it and/or modify it
+# `groff' is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
-# groff is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-# License for more details.
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with groff; see the file COPYING. If not, write to the
-# Free Software Foundation, 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
########################################################################
MAN1=groffer.n
CLEANADD=groffer
+# not all make programs have $(RM) predefined.
+RM=rm -f
+
all: groffer
-groffer: groffer.sh
- rm -f $@; \
- sed -e "s|@BINDIR@|$(bindir)|g" \
+groffer: groffer.sh groffer2.sh $(SH_DEPS_SED_SCRIPT)
+ $(RM) $@;
+ sed -f $(SH_DEPS_SED_SCRIPT) \
+ -e "s|@g@|$(g)|g" \
+ -e "s|@BINDIR@|$(bindir)|g" \
+ -e "s|@libdir@|$(libdir)|g" \
-e "s|@VERSION@|$(version)$(revision)|g" \
- -e $(SH_SCRIPT_SED_CMD) $(srcdir)/groffer.sh >$@; \
+ -e $(SH_SCRIPT_SED_CMD) $(srcdir)/groffer.sh >$@;
chmod +x $@
install_data: groffer
-test -d $(bindir) || $(mkinstalldirs) $(bindir)
- -rm -f $(bindir)/groffer
+ -$(RM) $(bindir)/groffer
$(INSTALL_SCRIPT) groffer $(bindir)/groffer
+ -test -d $(libdir)/groff/groffer || \
+ $(mkinstalldirs) $(libdir)/groff/groffer
+ -$(RM) $(libdir)/groff/groffer/groffer2.sh
+ $(INSTALL_SCRIPT) $(srcdir)/groffer2.sh \
+ $(libdir)/groff/groffer/groffer2.sh
uninstall_sub:
- -rm -f $(bindir)/groffer
+ -$(RM) $(bindir)/groffer
+ -$(RM) $(libdir)/groff/groffer/groffer2.sh
+ -rmdir $(libdir)/groff/groffer
diff --git a/contrib/groff/contrib/groffer/README b/contrib/groff/contrib/groffer/README
index 413f49f0c2d2..66d36123e62b 100644
--- a/contrib/groff/contrib/groffer/README
+++ b/contrib/groff/contrib/groffer/README
@@ -1,23 +1,104 @@
-The `groffer' program is the easiest way to read `groff' documents.
-All input is sent to `grog' and then to `groff' such that no special
-`groff' arguments must be determined.
+README
-`groffer' also has many built-in `man' functionalities to find and
-read the manual pages on UNIX and similar operating systems. It
-accepts the information from an installed `man' program, but tries to
-find a man path by itself if there isn't any.
+The `groffer' program is the easiest way to read documents written in
+some `roff' language, such as the `man pages', the manual pages in
+many operating systems.
-So far, `groffer' is a shell script. It should run on any POSIX or
-Bourne style shell, but it runs the fastest if the `ash' shell is
-installed on the system. This shell is found out and started
-automatically. There are efforts to port part of the shell script to
-C/C++ to increase the speed independent of the shell.
+
+Input
+
+Input comes from either standard input or command line parameters that
+represent names of exisiting roff files or standardized specifications
+for searching man pages. All of these can be compressed in a format
+that is decompressible by `gzip', including `.gz', `bz2', and `.Z'.
+
+`groffer' has many built-in `man' functionalities to find and read the
+manual pages on UNIX and similar operating systems. It accepts the
+information from an installed `man' program, but tries to find a man
+path by itself.
+
+`groffer' bundles all filespec parameters into a single output file in
+the same way as `groff'. The disadvantage of this is that all file
+name arguments must use the same groff language. To change this, the
+option parsing must be revised for large parts. It seems that this
+would create incompatibilities, so the actual option strategy is kept.
+
+
+Output
+
+All input is first sent to `grog' to determine the necessary `groff'
+options and then to `groff'. So no special `groff' arguments must be
+given. But all `groff' options can be specified when this seems to be
+appropriate.
+
+The following displaying modes for the output are available:
+- Display formatted input with
+-- the X `roff' viewer `gxditview',
+-- a Postcript viewer,
+-- a PDF viewer,
+-- a DVI viewer,
+-- a web browser,
+-- a pager in a text terminal (tty).
+- Generate `groff' output on stdout without a viewer.
+- Generate the `groff intermediate output' on standard output without
+ postprocessing.
+- Output the source code without any `groff' processing.
+- There are some information outputs without `groff' processing, such
+ as by option `-V' and the `man' like `whatis' and `apropos'
+ outputs.
+
+By default, the program tries to display with `gxditview' as graphical
+device in X; on non-X text terminals, the `tty' text mode with a pager
+is tried by default.
+
+
+Compatibility
+
+`groffer' consists of two shell scripts. It should run on any POSIX
+or Bourne style shell that supports shell functions. See file
+`README_SH' for more information.
+
+
+Mailing lists
For reporting bugs of `groffer', groff's free mailing list
-<bug-groff@gnu.org> can be used. For a general discussion, the
-<groff@gnu.org> is more useful; see the `README' file in the top
-directory of the `groff' source package for more details on this
-mailing list.
+<bug-groff@gnu.org> can be used.
+
+For a general discussion, the mailing list <groff@gnu.org> is more
+useful, but one has to subscribe to this list at
+http://lists.gnu.org/mailman/listinfo/groff.
+
+See the `README' file in the top directory of the `groff' source
+package for more details on these mailing lists.
+
+
+####### License
+
+Last update: 2 August 2005
+
+Copyright (C) 2003,2004,2005 Free Software Foundation, Inc.
+Written by Bernd Warken
+
+This file is part of `groffer', which is part of `groff'.
+
+`groff' is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+`groff' is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with `groff'; see the files COPYING and LICENSE in the top
+directory of the `groff' source. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+####### Emacs settings
-`groffer' is a `groff contrib' project that was written by Bernd
-Warken <bwarken@mayn.de>.
+Local Variables:
+mode: text
+End:
diff --git a/contrib/groff/contrib/groffer/README_SH b/contrib/groff/contrib/groffer/README_SH
new file mode 100644
index 000000000000..05d085e5cb0e
--- /dev/null
+++ b/contrib/groff/contrib/groffer/README_SH
@@ -0,0 +1,268 @@
+Additional description for the shell version of `groffer'
+
+
+Scripts
+
+The shell version of `groffer' contains two files, `groffer.sh' and
+`groffer2.sh'.
+
+`groffer.sh' is a short introductory script without any functions. I
+can be run with a very poor Bourne shell. It just contains some basic
+variables, the reading of the configuration files, and the
+determination of the shell for `groffer2.sh'. This script is
+transformed by `make' into `groffer' which will be installed into
+@bindir@, which is usually /usr/local/bin.
+
+`groffer2.sh' is a long main script with all functions; it is called
+by `groffer.sh' (`groffer' after installation). It is installed
+unchanged into @libdir@/groff/groffer, which is usually
+/usr/local/lib/groff/groffer. This script can be called with a
+different shell, using the `groffer' option `--shell'.
+
+
+Options
+
+The `groffer' script provides its own option parser. It is compatible
+to the usual GNU style command line This includes long option names
+with two signs such as `--option', clusters of short options, the
+mixing of options and non-option file names, the option `--' to close
+the option handling, and it is possible to abbreviate the long option
+names.
+
+The flexible mixing of options and file names in GNU style is always
+possible, even if the environment variable `$POSIXLY_CORRECT' is set
+to a non-empty value. This disables the rather wicked POSIX behavior
+to terminate option parsing when the first non-option command line
+argument is found.
+
+
+Error Handling
+
+Error handling and exit behavior is complicated by the fact that
+`exit' can only escape from the current shell; trouble occurs in
+subshells. This was solved by sending kill signals, see $_PROCESS_ID
+and error().
+
+
+Function Definitions in `groffer2.sh'
+
+Each funtion in groffer2.sh has a description that starts with the
+function name and symbols for its arguments in paranthesis `()'. Each
+`<>' construction gives an argument name that just gives a hint on
+what the argument is meant to be; these argument names are otherwise
+irrelevant. The `>' sign can be followed by another character that
+shows how many of these arguments are possible.
+
+<arg> exactly 1 of this argument
+<arg>? 0 or 1 of these arguments
+<arg>* arbitrarily many such arguments, incl. none
+<arg>+ one or more such arguments
+<arg>... one or more such arguments
+[...] optional arguments
+
+A function that starts with an underscore `_' is an internal function
+for some other function. The internal functions are defined just
+after their corresponding function.
+
+
+External Environment Variables
+
+The groffer.sh script uses the following external system variables.
+It is supposed that these variables are already exported outside of
+groffer.sh; otherwise they do not have a value within the script.
+
+external system environment variables that are explicitly used
+$DISPLAY: Presets the X display.
+$LANG: For language specific man pages.
+$LC_ALL: For language specific man pages.
+$LC_MESSAGES: For language specific man pages.
+$PAGER: Paging program for tty mode.
+$PATH: Path for the programs called (`:' separated list).
+
+groffer native environment variables
+$GROFFER_OPT preset options for groffer.
+
+all groff environment variables are used, see groff(1)
+$GROFF_BIN_PATH: Path for all groff programs.
+$GROFF_COMMAND_PREFIX: '' (normally) or 'g' (several troffs).
+$GROFF_FONT_PATH: Path to non-default groff fonts.
+$GROFF_TMAC_PATH: Path to non-default groff macro files.
+$GROFF_TMPDIR: Directory for groff temporary files.
+$GROFF_TYPESETTER: Preset default device.
+
+all GNU man environment variables are used, see man(1).
+$MANOPT: Preset options for man pages.
+$MANPATH: Search path for man pages (: list).
+$MANROFFSEQ: Ignored because of grog guessing.
+$MANSECT: Search man pages only in sections (:).
+$SYSTEM: Man pages for different OS's (, list).
+
+
+Object-oriented Functions
+
+The groffer script provides an object-oriented construction (OOP). In
+object-oriented terminology, a type of object is called a `class'; a
+function that handles objects from a class is named `method'.
+
+In the groffer script, the object is a variable name whose content is
+the object's data. Methods are functions that have an object as first
+argument.
+
+The basic functions for object handling are obj_*().
+
+The class `list' represents an array structure, see list_*().
+
+
+Shell Compatibility
+
+The `groffer' shell scripts are compatible to both the GNU and the
+POSIX shell and utilities. Care was taken to restrict the programming
+technics used here in order to achieve POSIX compatibility as far back
+as POSIX P1003.2 Draft 11.2 of September 1991. This draft is
+available at http://www.funet.fi/pub/doc/posix/p1003.2/d11.2 in the
+internet.
+
+The POSIX draft does not include `local' variables for functions. So
+this concept was replaced by global variables with a prefix that
+differs for each function. The prefix is chosen from the function
+name. These quasi-local variables are unset before each return of the
+function.
+
+The `groffer' scripts were tested under the shells `ash', `bash',
+`bash-minimal', `dash', 'ksh', `mksh', `pdksh', 'posh', and `zsh'
+without problems in Linux Debian. A shell can be tested by the
+`groffer' option `--shell', but that will run only with groffer2.sh.
+To start it directly from the beginning under this shell the following
+command can be used.
+
+ <shell-name> groffer.sh --shell=<shell-name> <argument>...
+
+
+Some shells are not fully POSIX compatible. For them the following
+restrictions were done. For more information look at the
+documentation `Portable shells' in the `info' page of `autoconf'
+(look-up in Emacs-Help-Manuals_Info).
+
+- The command parts `then', `else', and `do' must be written each on a
+ line of their own.
+
+- Replace `for i in "$@"' by `for i' and remove internal `;' (kah).
+
+- Replace `set -- ...' by `set x ...; shift'. After the first
+ non-option argument, all arguments including those starting with `-'
+ are accepted as non-option. For variables or `$()' constructs with
+ line-breaks, use `eval set' without quotes. That transforms a
+ line-break within a variable to a space.
+
+- The name of the variable in `for' is chosen as a single character
+ (old ash). The content of such variables is not safe because it can
+ also occur in other functions. So it is often stored in an
+ additional quasi-local variable.
+
+- `echo' is not portable on options; some `echo' commands have many
+ options, others have none. So `echo -n' cannot be used, such that
+ the output of each function has complete lines. There are two
+ methods to avoid having `-' as the first character of any argument.
+ Either a character such as `x' can be prepended to the argument;
+ this must later on be removed by `sed'. Otherwise, `echo' can be
+ replaced by `cat <<EOF'.
+
+- `ls' has problems. Old UNIX systems echoed the error message to
+ standard output. So handle the output with `sed'. If the output
+ contains `not found' map it to an empty string.
+
+- As `test -e' is not available in Solaris 2.5 replace it by
+ `test -f || test -d'.
+
+- As `unset' is not supported by all shells replace it by `eval
+ ${_UNSET}' where this variable is `unset' if it exists and `:'
+ otherwise.
+
+- Some shells have problems with options in `eval'. So quoting must
+ be done right to hide the options from `eval'.
+
+- In backquote calls `` avoid the backquote ` in comments.
+
+- Replace `true' by `:', `false' isn't used.
+
+- Do not redefine builtins as functions (ash).
+
+- Avoid `[^...]' in `case' patterns (ash).
+
+- `trap' does not allow error code 127.
+
+The scripts call the following commands with all options used:
+.
+:
+apropos
+break
+bzip2 -c -d -t
+cat
+catz
+cd
+continue
+echo
+eval
+expr
+grep
+groff -v
+grog -T -X -Z
+gs -c -d -f -q -s
+gzip -c -d -f
+less -r -R
+ls
+man -k --apropos
+mkdir
+mv
+pwd
+return
+rm -f -r
+rmdir
+sed -e -n
+set -e
+sh -c
+shift
+test -c -d -f -r -s -w -x
+trap
+umask
+unset
+
+
+Bugs
+
+If the `groffer' run is interrupted by Crtl-C the clean up is not done
+by all shells. The `trap' commands work for the shells `bash',
+`bash-minimal', and 'ksh'; they do not work for `ash', `dash',
+`pdksh', `posh', and `zsh'.
+
+
+####### License
+
+Last update: 19 August 2005
+
+Copyright (C) 2003,2004,2005 Free Software Foundation, Inc.
+Written by Bernd Warken
+
+This file is part of `groffer', which is part of `groff'.
+
+`groff' is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+`groff' is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with `groff'; see the files COPYING and LICENSE in the top
+directory of the `groff' source. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+####### Emacs settings
+
+Local Variables:
+mode: text
+End:
diff --git a/contrib/groff/contrib/groffer/TODO b/contrib/groff/contrib/groffer/TODO
index 3aadb19e2abc..33e86b62db92 100644
--- a/contrib/groff/contrib/groffer/TODO
+++ b/contrib/groff/contrib/groffer/TODO
@@ -1,56 +1,58 @@
-# TODO file for `groffer'
+TODO file for `groffer'
-# File position: <groff-source>/contrib/groffer/TODO
+File position: <groff-source>/contrib/groffer/TODO
-# Last update: 22 Jan 2003
-# Copyright (C) 2001,2002,2003 Free Software Foundation, Inc.
-# Written by Bernd Warken <bwarken@mayn.de>
+####### TODO
-# This file is part of groff.
+Revision:
-# groff is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+Optimization:
+- Optimize `man' path determination in manpath_add_lang_sys() for speed
+ by building-up the `man' path only by and by as far as necessary
+ (not trivial).
+- To increase the running speed write part of the `groffer' shell
+ script in C/C++.
-# groff is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-# License for more details.
+Features of external programs:
+- Revise option handling of `grog'.
-# You should have received a copy of the GNU General Public License
-# along with groff; see the file COPYING. If not, write to the
-# Free Software Foundation, 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
+Documentation:
+- Improve the documentation of the search algorithm for `man' pages in
+ both the `groffer' scripts and the `man' page `groffer.man'.
+- In `groffer.man', add more documentation for parts that were taken
+ over from GNU `man'.
+- The documentation in the headers for some function definitions in
+ `groffer2.sh' needs to be updated.
-########################################################################
-TODO
+####### License
-Optimization:
-- Optimize man path determination in manpath_add_lang_sys() for speed
- by building-up the man path only by and by as far as necessary
- (not trivial).
-- To increase the running speed write part of the groffer shell script
- in C/C++.
+Last update: 16 August 2005
-Features:
-- Revise option handling of `grog'.
-- `gxditview' needs a complete shower.
+Copyright (C) 2003,2004,2005 Free Software Foundation, Inc.
+Written by Bernd Warken
-Revision:
-- Should there be a native implementation for `--apropos'?
-- Revise the `--all' feature to better reflect GNU man.
-- The debug function stack is buggy (no effect on normal operation).
-- The actual `groff' and `grog' do not support file arguments each
-of which has a different macro package (except `man' and `doc'). So
-`roffer' should create several display files for such arguments.
+This file is part of `groffer', which is part of `groff'.
-Documentation:
-- Improve the documentation of the search algorithm for man pages in
- both the groffer script and the man page `groffer.man'.
-- In `groff.man', add more documentation for parts that were taken over
- from GNU `man'.
-- The documentation in the headers for some function definitions in
- `groffer.sh' needs to be updated.
+`groff' is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+`groff' is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+License for more details.
+
+You should have received a copy of the GNU General Public License
+along with `groff'; see the files COPYING and LICENSE in the top
+directory of the `groff' source. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+####### Emacs settings
+
+Local Variables:
+mode: text
+End:
diff --git a/contrib/groff/contrib/groffer/groffer.man b/contrib/groff/contrib/groffer/groffer.man
index da6a53250eb4..80177d6c26e9 100644
--- a/contrib/groff/contrib/groffer/groffer.man
+++ b/contrib/groff/contrib/groffer/groffer.man
@@ -15,22 +15,51 @@ groffer.1 - man page for groffer (section 1).
Source file position: <groff_source_top>/contrib/groffer/groffer.man
Installed position: $prefix/share/man/man1/groffer.1
-Version : groffer 0.9.2
-Last update : 13 Oct 2002
+Last update: 22 August 2005
-This file is part of groff, the GNU roff type-setting system.
-
-Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-Written by Bernd Warken <bwarken@mayn.de>
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
-any later version published by the Free Software Foundation; with the
-Invariant Sections being this .ig-section and AUTHORS, with no
-Front-Cover Texts, and with no Back-Cover Texts.
-
-A copy of the Free Documentation License is included as a file called
-FDL in the main directory of the groff source package.
+Source file position: <groff-source>/contrib/groffer/groffer.man
+..
+.de author
+This file was written by
+.MTO "" "Bernd Warken" .
+..
+.de copyleft
+Copyright (C) 2001,2002,2004,2005 Free Software Foundation, Inc.
+.
+.P
+This file is part of
+.IR \%groffer ,
+which is part of
+.IR \%groff ,
+a free software project.
+.
+You can redistribute it and/or modify it under the terms of the
+.nh
+.B GNU General Public License
+.hy
+as published by the
+.nh
+.BR "Free Software Foundation" ,
+.hy
+either version 2, or (at your option) any later version.
+.
+.P
+You should have received a copy of the \f[CR]GNU General Public
+License\f[] along with
+.IR groff ,
+see the files \%\f[CB]COPYING\f[] and \%\f[CB]LICENSE\f[] in the top
+directory of the
+.I groff
+source package.
+.
+Or read the
+.I man\~page
+.BR gpl (1).
+You can also write to the
+.nh
+.B Free Software Foundation, 51 Franklin St - Fifth Floor, Boston,
+.BR "MA 02110-1301, USA" .
+.hy
..
.
.\" --------------------------------------------------------------------
@@ -50,15 +79,6 @@ FDL in the main directory of the groff source package.
. ftr CB CW
.\}
.
-.ds @- "\-\""
-.ds @-- "\-\^\-\""
-.
-.ds @b- "\f[CB]-\f[]\""
-.ds @b-- "\f[CB]--\f[]\""
-.
-.ds @i- "\f[CI]-\f[]\""
-.ds @i-- "\f[CI]--\f[]\""
-.
.ds Ellipsis ".\|.\|.\""
.
.\" --------------------------------------------------------------------
@@ -180,7 +200,7 @@ FDL in the main directory of the groff source package.
.c --------------------------------------------------------------------
.c .Opt_- ([<punct>])
.c
-.c Print `-' (minus sign); optional punctuation.
+.c Print `-' (minus sign); optional punctuation.
.c
.de Opt_-
. ie (\\n[.$] == 0) \
@@ -191,7 +211,7 @@ FDL in the main directory of the groff source package.
.c --------------------------------------------------------------------
.c .Opt_[-] ([<punct>])
.c
-.c Print `Opt_[-]' (minus sign in brackets); optional punctuation.
+.c Print `Opt_[-]' (minus sign in brackets); optional punctuation.
.c
.de Opt_[-]
. ie (\\n[.$] == 0) \
@@ -202,7 +222,7 @@ FDL in the main directory of the groff source package.
.c --------------------------------------------------------------------
.c .Opt_-- ([<punct>])
.c
-.c Print `--' (double minus); optional punctuation.
+.c Print `--' (double minus); optional punctuation.
.c
.de Opt_--
. ie (\\n[.$] == 0) \
@@ -213,7 +233,7 @@ FDL in the main directory of the groff source package.
.c --------------------------------------------------------------------
.c .Opt_[--] ([<punct>])
.c
-.c Print `Opt_[--]' (double minus in brackets); optional punctuation.
+.c Print `Opt_[--]' (double minus in brackets); optional punctuation.
.c
.de Opt_[--]
. ie (\\n[.$] == 0) \
@@ -276,8 +296,8 @@ FDL in the main directory of the groff source package.
.c Alternating options; base macro for many others; do not use directly.
.c
.c Arguments:
-.c <pre>: prefix, resulted is preceded by this.
-.c <sep>: separator between minux/opt pairs.
+.c <pre>: prefix, result is preceded by this.
+.c <sep>: separator between minus/opt pairs.
.c <post>: postfix, is appended to the result.
.c <minus>: either `-' or `--' (font CB).
.c <opt>: a name for an option, empty allowed (font CB).
@@ -286,7 +306,8 @@ FDL in the main directory of the groff source package.
.c Result:
.c String `<pre>' followed by the <minus>/<opt> argument pairs, each
.c separated by string `<sep>', optionally add '<arg>', separated by
-.c a single space ` ', followed by the string `<post>'.
+.c a single space ` ', followed by the string `<post>'. Terminated
+.c by the optional punctuation <punct>.
.c
.de Opt_alt_base
. nr @font \\n[.f]\"
@@ -306,24 +327,29 @@ FDL in the main directory of the groff source package.
. \}
. c separator
. if (\\n[@count] > 0) \
-. as @res \f[CR]\\*[@sep]\"
+. as @res \f[CR]\\*[@sep]\:\"
. nr @count +1
-. as @res \f[CB]\\$1\\$2\:\" combine minus with option name
+. c combine minus with option name
+. as @res \f[CB]\\-\"
+. if '\\$1'--' \
+. as @res \\-\"
+. as @res \\$2\"
. shift 2
. \}
. if (\\n[.$] >= 3) \
. Error .\\0: wrong arguments: \\$@
-. c all pairs are done
+. c all pairs are done
. ie (\\n[.$] == 0) \
. as @res \f[CR]\\*[@post]\"
. el \{\
-. c optional option argument
+. c optional option argument
. if !'\\$1'' \
. as @res \f[CR] \,\f[I]\\$1\"
. shift
-. as @res \\f[CR]\\*[@post]\" postfix
+. c postfix
+. as @res \\f[CR]\\*[@post]\"
. if (\\n[.$] >= 1) \{\
-. c add punctuation
+. c add punctuation
. as @res \f[\\n[@font]]\\$1\"
. \}
. \}
@@ -399,6 +425,14 @@ FDL in the main directory of the groff source package.
. Opt_alt -- "\\$1" "" "\\$2"
..
.c --------------------------------------------------------------------
+.c .Opt_long_arg ([<name> <arg> [<punct>]])
+.c
+.c Print `--name=arg' somewhere in the text; optional punctuation.
+.c
+.de Opt_long_arg
+. Opt_alt -- "\\$1=\\$2" "" "\\$3"
+..
+.c --------------------------------------------------------------------
.c .Opt_[long] ([<name> [<punct>]])
.c
.c Print `--name' somewhere in the text; optional punctuation.
@@ -536,7 +570,9 @@ FDL in the main directory of the groff source package.
.de Text
. if (\\n[.$] == 0) \
. return
+. nh
. nop \)\\$*\)
+. hy
..
.c --------------------------------------------------------------------
.c .Topic ([<indent>])
@@ -629,10 +665,9 @@ FDL in the main directory of the groff source package.
.
.ad l
.Synopsis groffer
-.RI [ groffer_options ]
-.RI [ groff_options ]
+.RI [ option... ]
.Opt_[--]
-.RI [ "filespec" "\*[Ellipsis]]"
+.RI [ "\%filespec" "\*[Ellipsis]]"
./Synopsis
.
.Synopsis groffer
@@ -649,62 +684,106 @@ FDL in the main directory of the groff source package.
.\" --------------------------------------------------------------------
.
The
-.I groffer
+.B \%groffer
program is the easiest way to use
-.BR groff (@MAN1EXT@).
+.BR \%groff (@MAN1EXT@).
It can display arbitrary documents written in the
-.BR groff (@MAN7EXT@)
-language or other
-.BR roff (@MAN7EXT@)
-languages that are compatible to the original troff language.
+.I \%groff
+language, see
+.BR \%groff (@MAN7EXT@),
+or other
+.I \%roff
+languages, see
+.BR \%roff (@MAN7EXT@),
+that are compatible to the original
+.I \%troff
+language.
.
The
-.I groffer
+.B \%groffer
program also includes many of the features for finding and displaying
-the UNIX manual pages
+the \%\f[CR]Unix\f[] manual pages
+.nh
.RI ( man\~pages ),
+.hy
such that it can be used as a replacement for a
-.BR man (1)
+.BR \%man (1)
program.
.
Moreover, compressed files that can be handled by
-.BR gzip (1)
+.BR \%gzip (1)
or
-.BR bzip2 (1)
+.BR \%bzip2 (1)
are decompressed on-the-fly.
.
.
.P
The normal usage is quite simple by supplying a file name or name of a
-man\~page without further options.
+.I \%man\~page
+without further options.
.
But the option handling has many possibilities for creating special
behaviors.
.
-These can be stored in a configuration file.
+This can be done either in configuration files, with the shell
+environment variable
+.BR \%$GROFFER_OPT ,
+or on the command line.
.
.
.P
The output can be generated and viewed in several different ways
available for
-.IR groff .
-.
-This includes the groff native X viewer
-.BR gxditview (@MAN1EXT@),
-each Postcript or dvi display program, a web browser by generating
-html in www-mode, or several text modes in text terminals.
+.IR \%groff .
+.
+This includes the
+.I \%groff
+native \%\f[CR]X\~Window\f[] viewer
+.BR \%gxditview (@MAN1EXT@),
+each
+.IR \%Postcript ,
+.IR \%pdf ,
+or
+.I \%dvi
+display program, a web browser by generating
+.I \%html
+in
+.IR \%www\~mode ,
+or several
+.I \%text\~modes
+in text terminals.
.
.
.P
-Most options that must be named when running
-.I groff
-are determined automatically because
-.I groffer
-internally calls the
-.BR grog (@MAN1EXT@)
+Most of the options that must be named when running
+.B \%groff
+directly are determined automatically for
+.BR \%groffer ,
+due to the internal usage of the
+.BR \%grog (@MAN1EXT@)
program.
.
-But all parts can be controlled manually by supplying options.
+But all parts can also be controlled manually by arguments.
+.
+.
+.P
+Several file names can be specified on the command line arguments.
+.
+They are transformed into a single document in the normal way of
+.BR \%groff .
+.
+.
+.P
+Option handling is done in \f[CR]GNU\f[] style.
+.
+Options and file names can be mixed freely.
+.
+The option
+.RB ` \-\- '
+closes the option handling, all following arguments are treated as
+file names.
+.
+Long options can be abbreviated.
.
.
.\" --------------------------------------------------------------------
@@ -712,173 +791,136 @@ But all parts can be controlled manually by supplying options.
.\" --------------------------------------------------------------------
.
.TP
-.I groffer_options
-The following options determine and configure the display mode.
-.
-They were synchronized with the options of both
-.BR groff (@MAN1EXT@)
-and GNU
-.BR man (1).
-.
-If none of these options is used groffer tries to find a suitable
-display mode automatically.
+.I breaking options
+.RS
+.P
+.Opt_[alt] - h -- help
+.Opt_[alt] - v -- version
+.RE
.
.
+.TP
+.I \%groffer mode options
.RS
-.
.P
-.Opt_[alt] - Q -- source
-.Opt_[alt] - T -- device device
-.Opt_[alt] -- auto-modes mode1,mode2,\*[Ellipsis]
-.Opt_[alt] -- debug
+.Opt_[alt] -- auto
.Opt_[alt] -- default
+.Opt_[alt] -- default\-modes mode1,mode2,\*[Ellipsis]
.Opt_[alt] -- dvi
-.Opt_[alt] -- dvi-viewer prog
+.Opt_[alt] -- dvi\-viewer prog
+.Opt_[alt] -- dvi\-viewer\-tty prog
.Opt_[alt] -- groff
-.Opt_[alt] -- location
+.Opt_[alt] -- html
+.Opt_[alt] -- html\-viewer prog
+.Opt_[alt] -- html\-viewer\-tty prog
.Opt_[alt] -- mode display_mode
-.Opt_[alt] -- pager program
.Opt_[alt] -- pdf
-.Opt_[alt] -- pdf-viewer prog
+.Opt_[alt] -- pdf\-viewer prog
+.Opt_[alt] -- pdf\-viewer\-tty prog
.Opt_[alt] -- ps
-.Opt_[alt] -- ps-viewer prog
-.Opt_[alt] -- shell
+.Opt_[alt] -- ps\-viewer prog
+.Opt_[alt] -- ps\-viewer\-tty prog
+.Opt_[alt] -- text
.Opt_[alt] -- tty
+.Opt_[alt] -- tty\-viewer prog
+.Opt_[alt] -- tty\-viewer\-tty prog
.Opt_[alt] -- www
-.Opt_[alt] -- www-viewer prog
-.Opt_[alt] -- x
-.Opt_[alt] -- x-viewer prog
+.Opt_[alt] -- www\-viewer prog
+.Opt_[alt] -- www\-viewer\- prog
+.Opt_[alt] -- x -- X
+.Opt_[alt] -- x\-viewer -- X\-viewer prog
+.Opt_[alt] -- x\-viewer\-tty -- X\-viewer\-tty prog
+.RE
.
.
+.TP
+.I development options
+.RS
.P
-The following long options were adapted from the corresponding X
-Toolkit options.
-.
-Their single leading minus in X Toolkit was changed to a double minus
-for long options; see
-.BR X (1).
+.Opt_[alt] -- debug
+.Opt_[alt] -- do\-nothing
+.Opt_[alt] -- shell prog
+.Opt_[alt] - Q -- source
+.Opt_[alt] - V
+.RE
.
.
+.TP
+.I options related to \%groff
+.RS
.P
-.Opt_[alt] -- bd
-.Opt_[alt] -- bg -- background
-.Opt_[alt] -- bw
-.Opt_[alt] -- display
-.Opt_[alt] -- fg -- foreground
-.Opt_[alt] -- ft -- font
-.Opt_[alt] -- geometry size_pos
-.Opt_[alt] -- resolution value
-.Opt_[alt] -- rv
-.Opt_[alt] -- title string
-.Opt_[alt] -- xrm X_resource
-.
-.
+.Opt_[alt] - T -- device device
+.Opt_[alt] - Z -- intermediate\-output -- ditroff
.P
-The following long options regulate whether and how
-.I man\~pages
-(UNIX manual pages) are searched.
+All further
+.B \%groff
+short options are accepted.
+.RE
.
-They were constructed for
-.IR groffer ,
-but they are compatible with the long options of the
-.I GNU man
-program.
+.
+.TP
+.I options for man\~pages
+.Opt_[alt] -- apropos
+.Opt_[alt] -- apropos\-data
+.Opt_[alt] -- apropos\-devel
+.Opt_[alt] -- apropos\-progs
+.Opt_[alt] -- whatis
+.Opt_[alt] -- man
+.Opt_[alt] -- no-man
+.Opt_[alt] -- no-special
.
.
+.TP
+.I long options taken over from GNU man
+.RS
.P
.Opt_[alt] -- all
.Opt_[alt] -- ascii
-.Opt_[alt] -- apropos
.Opt_[alt] -- ditroff
.Opt_[alt] -- extension suffix
.Opt_[alt] -- locale language
.Opt_[alt] -- local-file
-.Opt_[alt] -- man
.Opt_[alt] -- manpath dir1:dir2:\*[Ellipsis]
-.Opt_[alt] -- no-location
-.Opt_[alt] -- no-man
+.Opt_[alt] -- pager program
.Opt_[alt] -- sections sec1:sec2:\*[Ellipsis]
.Opt_[alt] -- systems sys1,sys2,\*[Ellipsis]
.Opt_[alt] -- troff-device device
-.Opt_[alt] -- whatis
-.
-.
.P
-The GNU
-.I man
-long options that are not mentioned are recognized, but they are just
-ignored because of alternative implementations.
-.
-The full set of long and short options of the GNU man program can be
-passed via the environment variable
-.Env_var $MANOPT ;
-see
-.BR man (1)
-if your system has GNU man installed.
-.
+Further long options of \f[CR]GNU\f[]
+.B man
+are accepted as well.
.RE
.
.
.TP
-.I groff_options
-Any combination of (short) options from the
-.BR groff (@MAN1EXT@)
-program is accepted; the options that are not explicitly handled by
-groffer are transparently passed to groff.
-.
-Due to the automatism in groffer, none of these groff options should
-be necessary, except for advanced usage.
-.
-.
+.I X Window Toolkit options
.RS
-.
-.P
-Because of the special outputting behavior of the groff options
-.Opt_short V,
-.Opt_short X,
-and
-.Opt_short Z,
-groffer was designed to be switched into
-.I groff
-mode by each of these options; in this mode, the groffer viewing
-features are disabled.
-.
.P
-The other groff options do not switch the mode, but allow to customize
-the formatting process.
-.
-Useful groff formatting options include
-.Opt_short m
-(to add macro files that cannot be recognized by grog), and
-.Opt_short T
-(to specify an alternative device for the modes
-.I tty
-and
-.IR x ).
-.
+.Opt_[alt] -- bd pixels
+.Opt_[alt] -- bg -- background color
+.Opt_[alt] -- bw pixels
+.Opt_[alt] -- display X-display
+.Opt_[alt] -- fg -- foreground color
+.Opt_[alt] -- ft -- font font_name
+.Opt_[alt] -- geometry size_pos
+.Opt_[alt] -- resolution value
+.Opt_[alt] -- rv
+.Opt_[alt] -- title string
+.Opt_[alt] -- xrm X-resource
.RE
.
.
.TP
-.I filespec
-is one or more file names or templates for searching
-man\~pages, see
-.BR man (1).
-Each
-.I filespec
-can have one of the following forms.
-.
-.
+.I \%filespec arguments
.RS
-.
.P
No
-.I filespec
+.I \%filespec
parameters means standard input.
.
.
.TP 10m
-.Opt_short
+.Opt_short ""
stands for standard input (can occur several times).
.
.
@@ -888,1012 +930,1877 @@ the path name of an existing file.
.
.
.TP
-.I name
-if
-.I name
-is not an existing file search for the man\~page called in the lowest
-man\~section that has a document for this name.
+.BI man: name ( section )
+.TP+
+.IB name ( section )
+search the \%man\~page
+.I \%name
+in \%man\~section
+.IR section .
.
.
.TP
-.BI man: name
-search for a man\~page in the lowest man\~section that has a document
-called
-.IR name .
+.BI man: name . s
+.TP+
+.IB name . s
+if
+.I s
+is a character in
+.BR \%[1-9on] ,
+search for a \%man\~page
+.I \%name
+in \%man\~section
+.IR s .
.
.
.TP
-.BI man: name . section
-.TP+
-.BI man: name ( section )
-.TP+
-.IB name ( section )
-.TP+
-.IB name . section
-each of these search the man\~page
-.I name
-in man\~section\~\c
-.IR section .
+.BI man: name
+\%man\~page in the lowest \%man\~section that has
+.IR \%name .
.
.
.TP
-.I "std_section name"
-two arguments like in the
-.BR man (1)
-program to find man\~page
-.I name
-in man\~section
-.IR std_section .
+.I "s name"
+if
+.I s
+is a character in
+.BR \%[1-9on] ,
+search for a \%man\~page
+.I \%name
+in \%man\~section
+.IR s .
.
-In
-.IR groffer ,
-the argument
-.I std_section
-is a standard section name for man\~pages; these are a digit `1',
-\&\*[Ellipsis], `9', or the single letters `o' or `n'.
.
-This should be used only with care.
+.TP
+.I name
+if
+.I \%name
+is not an existing file search for the man\~page
+.I \%name
+in the lowest man\~section.
.
.RE
.
.
.\" --------------------------------------------------------------------
-.SH "GROFFER OPTIONS"
+.SH "OPTION DETAILS"
.\" --------------------------------------------------------------------
.
+The
+.B \%groffer
+program can usually be run with very few options.
+.
+But for special purposes, it supports many options.
+.
+These can be classified in 5 option classes.
+.
+.
+.P
All short options of
-.I groffer
+.B \%groffer
are compatible with the short options of
-.BR groff (@MAN1EXT@).
+.BR \%groff (@MAN1EXT@).
.
-Some of the
-.I groff
-options were given a special meaning within
-.IR groffer .
+All long options of
+.B \%groffer
+are compatible with the long options of
+.BR \%man (1).
.
-All other
-.I groff
-options are supported by
-.IR groffer ,
-but they are just transparently transferred to
-.I groff
-without any intervention.
.
-Therefore these transparent options are not documented here, but in
-.BR groff (@MAN1EXT@).
+.\" --------------------------------------------------------------------
+.SS "groffer breaking Options"
+.\" --------------------------------------------------------------------
+.
+As soon as one of these options is found on the command line it is
+executed, printed to standard output, and the running
+.B \%groffer
+is terminated thereafter.
+.
+All other arguments are ignored.
+.
+.
+.Opt_def - h -- help
+Print a helping information with a short explanation of option sto
+standard output.
+.
+.
+.Opt_def - v -- version
+Print version information to standard output.
+.
+.
+.\" --------------------------------------------------------------------
+.SS "groffer Mode Options"
+.\" --------------------------------------------------------------------
+.
+The display mode and the viewer programs are determined by these
+options.
+.
+If none of these mode and viewer options is specified
+.B \%groffer
+tries to find a suitable display mode automatically.
+.
+The default modes are
+.I mode x
+with
+.B gxditview
+in \%\f[CR]X\~Window\f[] and
+.I mode tty
+with device
+.I latin1
+under
+.B less
+on a terminal.
.
.
.P
-All long options of
-.I groffer
-are compatible with the long options of
-.BR man (1).
+There are two kinds of options for viewers.
+.Opt_long \fImode\fP-viewer
+chooses the normal viewer programs that run on their own in
+\%\f[CR]X\~Window\f[], while
+.Opt_long \fImode\fP-viewer-tty
+chooses programs that run on the terminal (on tty).
.
-Most of the
-.I man
-long options were implemented as native options into
-.IR groffer .
+Most graphical viewers are programs running in \%\f[CR]X\~Window\f[],
+so there aren't many opportunities to call the tty viewers.
.
-These options are documented in the following; the other
-.I man
-options are recognized, but ignored.
+But they give the chance to view the output source; for example,
+.Opt_long ps\-viewer\-tty=less
+shows the content of the
+.I Postscript
+output with the pager
+.BR less .
.
.
-.Opt_def - h
-Print usage message to standard error and exit.
+.P
+The \%\f[CR]X\~Window\f[] viewers are not critical, you can use both
+.Opt_long *\-viewer
+and
+.Opt_long *\-viewer\-tty
+for them; with
+.Opt_long *\-viewer\-tty
+the viewer program will not become independently, it just stays
+coupled with
+.BR groffer .
+But the program will not run if you specify a terminal program with
+.Opt_long *\-viewer
+because this viewer will stay in background without a chance to reach
+it.
+.
+So you really need
+.Opt_long *\-viewer\-tty
+for viewers that run on tty.
+.
+.
+.Opt_def -- auto
+Equivalent to
+.Opt_long_arg mode auto .
.
.
-.Opt_def - Q
-Output the roff source code of the input files unprocessed.
+.Opt_def -- default
+Reset all configuration from previously processed command line options
+to the default values.
.
-This is the equivalent
-.Opt_long mode\~source .
+This is useful to wipe out all former options of the configuration, in
+.Env_var $GROFFER_OPT ,
+and restart option processing using only the rest of the command line.
.
.
-.Opt_def - T devname
-Switch to
+.Opt_def -- default\-modes mode1,mode2,\*[Ellipsis]
+Set the sequence of modes for
+.I \%auto\~mode
+to the comma separated list given in the argument.
+.
+See
.Opt_long mode
-.IR devname .
+for details on modes. Display in the default manner; actually, this
+means to try the modes
+.IR x ,
+.IR ps ,
+and
+.I \%tty
+in this sequence.
.
-The input is formatted and postprocessed using plain
-.I groff
-with
-.I devname
-as the output device.
.
-The allowed device names are listed in
-.BR groff (@MAN1EXT@).
.
-Note that this forces all device names that begin with the letter
-.I X
-to be displayed with
-.BR gxditview (@MAN1EXT@);
-all other device names generate output for the specified device; this
-is printed onto standard output without a pager.
+.Opt_def -- dvi
+Equivalent to
+.Opt_long_arg mode \%dvi .
.
.
-.Opt_def - v
-Print version information onto standard error.
+.Opt_def -- dvi\-viewer prog
+Choose an \%\f[CR]X\~Window\f[] viewer program for
+.IR \%dvi\~mode .
.
+This can be a file name or a program to be searched in
+.Env_var $PATH .
.
-.Opt_def - V
-Switch into
-.I groff
-mode and format the input with groff option
-.Opt_short V ;
-this produces the groff calling pipe without formatting the input.
+Known \%\f[CR]X\~Window\f[]
+.I \%dvi
+viewers include
+.BR \%xdvi (1)
+and
+.BR \%dvilx (1)
.
-This an advanced option from
-.BR groff (@MAN1EXT@) ,
-only useful for debugging.
+In each case, arguments can be provided additionally.
.
.
-.Opt_def - X
-Switch into
-.I groff
-mode and format the input with groff option
-.Opt_short X ;
-actually, this formats the input and displays it with
-.BR gxditview (@MAN1EXT@) .
+.Opt_def -- dvi\-viewer\-tty prog
+Choose a program running on the terminal for viewing the output of
+.IR \%dvi\~mode .
.
-This differs from groffer's mode
-.I x
-because groffer's viewer options are not used, but the viewer is
-configured like in groff with the groff option
-.Opt_short P .
-This option is inhereted from
-.BR groff (@MAN1EXT@) .
+This can be a file name or a program to be searched in
+.Env_var $PATH ;
+arguments can be provided additionally.
.
.
-.Opt_def - Z
-Switch into
-.I groff
-mode and format the input with groff option
-.Opt_short Z ;
-this produces the groff intermediate output without postprocessing; see
-.BR groff_out (@MAN1EXT@) .
-This an advanced option from
-.BR groff (@MAN1EXT@) ,
-useful for debugging.
+.Opt_def -- groff
+Equivalent to
+.Opt_long_arg mode groff .
.
.
-.Opt_def -- all
-In searching man pages, retrieve all suitable ones instead of only one.
+.Opt_def -- html
+Equivalent to
+.Opt_long_arg mode html .
.
.
-.Opt_def -- apropos
-Instead of displaying, start the `apropos' command for searching
-within man page descriptions; only kept for compatibility with `man'.
+.Opt_def -- html\-viewer
+Choose an \%\f[CR]X\~Window\f[] web browser program for viewing in
+.I \%html\~mode .
.
+It can be the path name of an executable file or a program in
+.Env_var $PATH .
.
-.Opt_def -- auto-modes mode1,mode2,\*[Ellipsis]
-Set the sequence of modes for default mode to the comma separated list
-given in the argument.
+In each case, arguments can be provided additionally.
.
.
-.Opt_def -- background color
-This is equivalent to
-.Opt_long bg .
+.Opt_def -- html\-viewer\-tty
+Choose a terminal program for viewing the output of
+.I \%html\~mode .
.
+It can be the path name of an executable file or a program in
+.Env_var $PATH ;
+arguments can be provided additionally.
.
-.Opt_def -- bd pixels
-Specifies the color of the border surrounding the viewer
-window.
.
-This is an adaption of the X Toolkit option
-.Opt_short bd .
+.Opt_def -- mode value
.
-The argument is an X color name, see
-.BR (1)
-for details.
+Set the display mode.
.
+The following mode values are recognized:
.
-.Opt_def -- bg color
-Set the background color of the viewer window.
+.RS
.
-This is an adaption of the X Toolkit option
-.Opt_short bg .
+.TP
+.Header_CB auto
+Select the automatic determination of the display mode.
.
-The argument is an X color name, see
-.BR (1)
-for details.
+The sequence of modes that are tried can be set with the
+.Opt_long default\-modes
+option.
.
+Useful for restoring the
+.I \%default\~mode
+when a different mode was specified before.
.
-.Opt_def -- bw pixels
-Specifies the width in pixels of the border surrounding the viewer
-window (not available for all viewers).
.
-This is an adaption of the X Toolkit option
-.Opt_short bw .
+.TP
+.Header_CB dvi
+Display formatted input in a
+.I \%dvi
+viewer program.
.
+By default, the formatted input is displayed with the
+.BR \%xdvi (1)
+program.
+.Opt_long dvi .
.
-.Opt_def -- debug
-Print debugging information.
.
-Actually, a function call stack is printed if an error occurs.
+.TP
+.Header_CB groff
+After the file determination, switch
+.B \%groffer
+to process the input like
+.BR \%groff (@MAN1EXT@)
+would do.
+.
+This disables the
+.I \%groffer
+viewing features.
.
.
-.Opt_def -- default
-Reset all configuration from previously processed command line options
-to the default values.
+.TP
+.Header_CB html
+Translate the input into html format and display the result in a web
+browser program.
.
-This is useful to wipe out all effects of former options and restart
-option processing using only the rest of the command line.
+By default, the existence of a sequence of standard web browsers is
+tested, starting with
+.BR \%konqueror (1)
+and
+.BR \%mozilla (1).
+The text html viewer is
+.BR \%lynx (1).
.
.
-.Opt_def -- device
-Eqivalent to
-.Opt_short T .
+.TP
+.Header_CB pdf
+Display formatted input in a
+.I \%PDF
+(Portable Document Format) viewer
+program.
.
+By default, the input is formatted by
+.B \%groff
+using the Postscript device, then it is transformed into the PDF file
+format using
+.BR \%gs (1),
+and finally displayed either with the
+.BR \%xpdf (1)
+or the
+.BR \%acroread (1)
+program.
.
-.Opt_def -- display X-display
-Set the X display on which the viewer program shall be started, see
-.BR X (1)
-for the syntax of the argument.
+PDF has a big advantage because the text is displayed graphically and
+is searchable as well.
.
+But as the transformation takes a considerable amount of time, this
+mode is not suitable as a default device for the
+.I \%auto\~mode .
.
-.Opt_def -- ditroff
-Eqivalent to
-.Opt_short Z .
-This is kept for compatibiliy with GNU
-.BR man (1).
.
+.TP
+.Header_CB ps
+Display formatted input in a Postscript viewer program.
+.
+By default, the formatted input is displayed with the
+.BR \%ghostview (@MAN1EXT@)
+program.
.
-.Opt_def -- dvi
-Choose dvi mode; the formatted input is displayed with the
-by default, the formatted input is displayed with the
-.BR xdvi (1)
+.
+.TP
+.Header_CB text
+Format in a
+.I \%groff\~text\~mode
+and write the result to standard output without a pager or viewer
program.
.
+The text device,
+.I \%latin1
+by default, can be chosen with option
+.Opt_short T .
+.
+.
+.TP
+.Header_CB tty
+Format in a
+.I \%groff\~text\~mode
+and write the result to standard output using a text pager program,
+even when in \%\f[CR]X\~Window\f[].
+.
+.
+.TP
+.Header_CB www
+Equivalent to
+.Opt_long_arg mode html .
+.
+.
+.TP
+.Header_CB x
+Display the formatted input in a native
+.I roff
+viewer.
+.
+By default, the formatted input is displayed with the
+.BR \%gxditview (@MAN1EXT@)
+program being distributed together with
+.BR \%groff .
+But the standard \%\f[CR]X\~Window\f[] tool
+.BR \%xditview (1)
+can also be chosen with the option
+.Opt_long x\-viewer .
+The default resolution is
+.BR 75\~dpi ,
+but
+.B 100\~dpi
+are also possible.
+.
+The default
+.I groff
+device
+for the resolution of
+.B 75\~dpi
+is
+.BR X75\-12 ,
+for
+.B 100\~dpi
+it is
+.BR X100 .
+.
+The corresponding
+.I "groff intermediate output"
+for the actual device is generated and the result is displayed.
+.
+For a resolution of
+.BR 100\~dpi ,
+the default width of the geometry of the display program is chosen to
+.BR 850\~dpi .
+.
+.
+.TP
+.Header_CB X
+Equivalent to
+.Opt_long_arg mode x .
+.
+.
+.P
+The following modes do not use the
+.I \%groffer
+viewing features.
+.
+They are only interesting for advanced applications.
+.
+.
+.TP
+.Header_CB groff
+Generate device output with plain
+.I \%groff
+without using the special viewing features of
+.IR \%groffer .
+If no device was specified by option
+.Opt_short T
+the
+.I \%groff
+default
+.B \%ps
+is assumed.
+.
+.
+.TP
+.Header_CB source
+Display the source code of the input without formatting; equivalent to
+.Opt_short Q .
+.
+.
+.RE
+.
+.
+.Opt_def -- pdf
+Equivalent to
+.Opt_long_arg mode pdf .
+.
+.
+.Opt_def -- pdf\-viewer prog
+Choose an \%\f[CR]X\~Window\f[] viewer program for
+.IR \%pdf\~mode .
+.
+This can be a file name or a program to be searched in
+.Env_var $PATH ;
+arguments can be provided additionally.
+.
+.
+.Opt_def -- pdf\-viewer\-tty prog
+Choose a terminal viewer program for
+.IR \%pdf\~mode .
+.
+This can be a file name or a program to be searched in
+.Env_var $PATH ;
+arguments can be provided additionally.
+.
+.
+.Opt_def -- ps
+Equivalent to
+.Opt_long_arg mode ps .
+.
.
-.Opt_def -- dvi-viewer prog
-Set the viewer program for dvi mode.
+.Opt_def -- ps\-viewer prog
+Choose an \%\f[CR]X\~Window\f[] viewer program for
+.IR \%ps\~mode .
.
This can be a file name or a program to be searched in
.Env_var $PATH .
.
-Known dvi viewers inlude
-.BR xdvi (1)
+Common Postscript viewers inlude
+.BR \%gv (1),
+.BR \%ghostview (1),
and
-.BR dvilx (1)
+.BR \%gs (1),
.
In each case, arguments can be provided additionally.
.
.
-.Opt_def -- extension suffix
-Restrict man\~page search to file names that have
-.I suffix
-appended to their section element.
+.Opt_def -- ps\-viewer\-tty prog
+Choose a terminal viewer program for
+.IR \%ps\~mode .
.
-For example, in the file name
-.I /usr/share/man/man3/terminfo.3ncurses.gz
-the man\~page extension is
-.IR ncurses .
+This can be a file name or a program to be searched in
+.Env_var $PATH ;
+arguments can be provided additionally.
.
-Originates from GNU
-.IR man .
+.
+.Opt_def -- text
+Equivalent to
+.Opt_long_arg mode text .
.
.
-.Opt_def -- foreground color
+.Opt_def -- tty
+Equivalent to
+.Opt_long_arg mode tty .
+.
+.
+.Opt_def -- tty\-viewer prog
+Choose a text pager for mode
+.IR tty .
+The standard pager is
+.BR less (1).
+This option is eqivalent to
+.I man
+option
+.Opt_long_arg pager prog .
+The option argument can be a file name or a program to be searched in
+.Env_var $PATH ;
+arguments can be provided additionally.
+.
+.
+.Opt_def -- tty\-viewer\-tty prog
This is equivalent to
-.Opt_long fg .
+.Opt_long tty\-viewer
+because the programs for
+.I tty
+mode run on a terminal anyway.
.
.
-.Opt_def -- fg color
-Set the foreground color of the viewer window.
+.Opt_def -- www
+Equivalent to
+.Opt_long_arg mode html .
.
-This is an adaption of the X Toolkit option
-.Opt_long bg .
.
-The argument is an X color name, see
-.BR (1)
-for details.
+.Opt_def -- www\-viewer prog
+Equivalent to
+.Opt_long html\-viewer .
.
.
-.Opt_def -- font font_name
-This is equivalent to
-.Opt_long ft .
+.Opt_def -- www\-viewer\-tty prog
+Equivalent to
+.Opt_long html\-viewer\-tty .
.
.
-.Opt_def -- ft font_name
-Set the font used by the viewer window.
+.Opt_def -- X -- x
+Equivalent to
+.Opt_long_arg mode x .
.
-This is an adaption of the X Toolkit option
-.Opt_short ft .
.
-The argument is an X font name, see
-.BR (1)
-for details.
+.Opt_def -- X\-viewer -- x\-viewer prog
+Choose an \%\f[CR]X\~Window\f[] viewer program for
+.IR \%x\~mode .
+Suitable viewer programs are
+.BR \%gxditview (@MAN1EXT@)
+which is the default and
+.BR \%xditview (1).
+The argument can be any executable file or a program in
+.Env_var $PATH ;
+arguments can be provided additionally.
.
.
-.Opt_def -- geometry size_pos
-Set the geometry of the display window, that means its size and its
-starting position.
+.Opt_def -- X\-viewer\-tty -- x\-viewer\-tty prog
+Choose a terminal viewer program for
+.IR \%x\~mode .
+The argument can be any executable file or a program in
+.Env_var $PATH ;
+arguments can be provided additionally.
.
-See
-.BR X (1)
-for details on the syntax of the argument.
.
-If the actual display mode is not X then this option is ignored.
+.TP
+.Opt_--
+Signals the end of option processing; all remaining arguments are
+interpreted as
+.I \%filespec
+parameters.
.
.
-.Opt_def -- groff
-Set
-.I groff
-mode.
+.P
+Besides these,
+.B \%groffer
+accepts all short options that are valid for the
+.BR \%groff (@MAN1EXT@)
+program.
.
-Switch groffer to process the input like
-.BR groff (@MAN1EXT@).
+All
+.RB \%non- groffer
+options are sent unmodified via
+.B \%grog
+to
+.BR \%groff .
.
-This disables the groffer viewing features, all groffer viewing
-options are ignored.
+So postprocessors, macro packages, compatibility with
+.I classical
+.IR \%troff ,
+and much more can be manually specified.
.
.
-.Opt_def -- help
-Eqivalent to
-.Opt_short h .
+.\" --------------------------------------------------------------------
+.SH "Options for Development"
+.\" --------------------------------------------------------------------
.
+.Opt_def -- debug
+Enable five debugging informations.
.
-.Opt_def -- location
-Print the location of the retrieved files to standard error.
+The temporary files are kept and not deleted, the name of the
+temporary directory and the shell name for
+.File_name groffer2.sh
+are printed, the parameters are printed at several steps of
+development, and a function stack is output with function
+\f[CR]error_user()\f[] as well.
.
+Neither the function call stack that is printed at each opening and
+closing of a function call nor the landmark information that is
+printed to determine how far the program is running are used.
.
-.Opt_def -- locale language
+This seems to be the most useful among all debugging options.
.
-Set the language for man pages.
.
-This option originates from GNU
-.BR man (1).
+.Opt_def -- debug\-all
+Enable all seven debugging informations including the function call
+stack and the landmark information.
.
.
-.Opt_def -- man
-Check the non-option command line arguments (filespecs) first on being
-man\~pages, then whether they represent an existing file.
+.Opt_def -- debug\-keep
+Enable two debugging information, the printing of the name of the
+temporary directory and the keeping of the temporary files.
.
-By default, a filespec is first tested if it is an existing file.
.
+.Opt_def -- debug\-lm
+Enable one debugging information, the landmark information.
.
-.Opt_def -- manpath "'dir1:dir2:\*[Ellipsis]'"
-Use the specified search path for retrieving man\~pages instead of the
-program defaults.
.
-If the argument is set to the empty string "" the search for man\~page
-is disabled.
+.Opt_def -- debug\-params
+Enable one debugging information, the parameters at several steps.
.
.
-.Opt_def -- mode value
+.Opt_def -- debug\-shell
+Enable one debugging information, the shell name for
+.File_name groffer2.sh .
.
-Set the display mode.
.
-The following mode values are recognized:
+.Opt_def -- debug\-stacks
+Enable one debugging information, the function call stack.
+.
+.
+.Opt_def -- debug\-tmpdir
+Enable one debugging information, the name of the temporary directory.
+.
+.
+.Opt_def -- debug\-user
+Enable one debugging information, the function stack with
+\f[CR]error_user()\f[].
+.
+.
+.Opt_def -- do-nothing
+This is like
+.Opt_long version ,
+but without the output; no viewer is started.
+.
+This makes only sense in development.
+.
+.
+.Opt_def -- print=text
+Just print the argument to standard error.
+.
+This is good for parameter check.
+.
+.
+.Opt_def -- shell "shell_program"
+Specify the shell under which the
+.File_name \%groffer2.sh
+script should be run.
+.
+This option overwrites the automatic shell determination of the
+program.
+.
+If the argument
+.I shell_program
+is empty a former shell option and the automatic shell determination
+is cancelled and the default shell is restored.
+.
+Some shells run considerably faster than the standard shell.
+.
.
+.Opt_def - Q -- source
+Output the roff source code of the input files without further
+processing.
+.
+This is the equivalent
+.Opt_long_arg mode source .
+.
+.
+.Opt_def - V
+This is an advanced option for debugging only.
+.
+Instead of displaying the formatted input, a lot of
+.I \%groffer
+specific information is printed to standard output:
.
.RS
+.Topic
+the output file name in the temporary directory,
+.
+.Topic
+the display mode of the actual
+.B \%groffer
+run,
.
+.Topic
+the display program for viewing the output with its arguments,
.
-.TP
-.Header_CB auto
-Display in the default manner; this actually means to try the modes
-.IR ps ,
-.IR x ,
+.Topic
+the active parameters from the config files, the arguments in
+.Env_var $GROFFER_OPT ,
+and the arguments of the command line,
+.
+.Topic
+the pipeline that would be run by the
+.B \%groff
+program, but without executing it.
+.RE
+.
+.
+.P
+Other useful debugging options are the
+.B \%groff
+option
+.Opt_short Z
and
-.I tty
-in this sequence.
+.Opt_long_arg mode groff .
.
-Useful for restoring default mode when a different mode was specified
-with
-.Env_var $GROFFER_OPT .
.
+.\" --------------------------------------------------------------------
+.SH "Options related to groff"
+.\" --------------------------------------------------------------------
.
-.TP
-.Header_CB dvi
-Display formatted input in a dvi viewer program; equivalent to
-.Opt_long dvi .
+All short options of
+.B \%groffer
+are compatible with the short options of
+.BR \%groff (@MAN1EXT@).
.
+The following of
+.B \%groff
+options have either an additional special meaning within
+.B \%groffer
+or make sense for normal usage.
.
-.TP
-.Header_CB pdf
-Display formatted input in a PDF (Portable Document Format) viewer
-program; equivalent to
-.Opt_long pdf .
.
+.P
+Because of the special outputting behavior of the
+.B \%groff
+option
+.Opt_short Z
+.B \%groffer
+was designed to be switched into
+.I \%groff\~mode ;
+the
+.I \%groffer
+viewing features are disabled there.
.
-.TP
-.Header_CB ps
-Display formatted input in a Postscript viewer program; equivalent to
-.Opt_long ps .
+The other
+.B \%groff
+options do not switch the mode, but allow to customize the formatting
+process.
.
.
-.TP
-.Header_CB tty
-Display formatted input in a text terminal; equivalent to
-.Opt_long tty .
+.Opt_def - a
+This generates an ascii approximation of output in the
+.IR \%text\~modes .
.
+That could be important when the text pager has problems with control
+sequences in
+.IR "tty mode" .
.
-.TP
-.Header_CB www
-Display formatted input in a internet browser program; equivalent to
-.Opt_long www .
.
+.Opt_def - m file
+Add
+.I \%file
+as a
+.I \%groff
+macro file.
.
-.TP
-.Header_CB x
-Display formatted input in a native roff viewer such as
-.BR gxditview (@MAN1EXT@);
-equivalent to
-.Opt_long x .
+This is useful in case it cannot be recognized automatically.
+.
+.
+.Opt_def - P opt_or_arg
+Send the argument
+.I \%opt_or_arg
+as an option or option argument to the actual
+.B \%groff
+postprocessor.
+.
+.
+.Opt_def - T -- device devname
+.
+This option determines
+.BR \%groff 's
+output device.
+.
+The most important devices are the text output devices for referring
+to the different character sets, such as
+.BR \%ascii ,
+.BR \%utf8 ,
+.BR \%latin1 ,
+and others.
+.
+Each of these arguments switches
+.B \%groffer
+into a
+.I \%text\~mode
+using this device, to
+.I \%mode\~tty
+if the actual mode is not a
+.IR \%text\~mode .
+.
+The following
+.I \%devname
+arguments are mapped to the corresponding
+.B \%groffer
+.Opt_long_arg mode \fIdevname\fR
+option:
+.BR \%dvi ,
+.BR \%html ,
+and
+.BR \%ps .
+All
+.B \%X*
+arguments are mapped to
+.IR \%mode\~x .
+Each other
+.I \%devname
+argument switches to
+.I \%mode\~groff
+using this device.
+.
+.
+.Opt_def - X
+is equivalent to
+.BR "groff \-X" .
+It displays the
+.I groff intermediate output
+with
+.BR gxditview .
+As the quality is relatively bad this option is deprecated; use
+.Opt_long X
+instead because the
+.I \%x\~mode
+uses an
+.IR X *
+device for a better display.
+.
+.
+.Opt_def - Z -- intermediate-output -- ditroff
+Switch into
+.I \%groff\~mode
+and format the input with the
+.I \%groff intermediate output
+without postprocessing; see
+.BR \%groff_out (@MAN5EXT@).
+This is equivalent to option
+.Opt_long ditroff
+of
+.IR \%man ,
+which can be used as well.
.
.
.P
-The following modes do not use the
-.I groffer
-viewing features.
+All other
+.B \%groff
+options are supported by
+.BR \%groffer ,
+but they are just transparently transferred to
+.B \%groff
+without any intervention.
.
-They are only interesting for advanced applications.
+The options that are not explicitly handled by
+.B \%groffer
+are transparently passed to
+.BR \%groff .
+.
+Therefore these transparent options are not documented here, but in
+.BR \%groff (@MAN1EXT@).
+Due to the automatism in
+.BR \%groffer ,
+none of these
+.B \%groff
+options should be needed, except for advanced usage.
.
.
-.TP
-.Header_CB groff
-Generate device output with plain
+.\" --------------------------------------------------------------------
+.SS "Options for man\~pages"
+.\" --------------------------------------------------------------------
+.
+.Opt_def -- apropos
+Start the
+.BR \%apropos (1)
+command or facility of
+.BR \%man (1)
+for searching the
+.I \%filespec
+arguments within all
+.I \%man\~page
+descriptions.
+.
+Each
+.I \%filespec
+argument is taken for search as it is; section specific parts are not
+handled, such that
+.B 7 groff
+searches for the two arguments
+.B 7
+and
+.B groff
+with a large result; for the
+.I \%filespec
+.B groff.7
+nothing will be found.
+.
+The display differs from the
+.B \%apropos
+program by the following concepts:
+.RS
+.Topic
+construct a
+.I \%groff
+frame to the output of
+.BR \%apropos ,
+.Topic
+each
+.I \%filespec
+argument is searched on its own.
+.Topic
+the restriction by
+.Opt_long sections
+is handled as well,
+.Topic
+wildcard characters are allowed and handled without a further option.
+.RE
+.
+.
+.Opt_def -- apropos\-data
+Show only the
+.B \%apropos
+descriptions for data documents, these are the
+.BR \%man (7)
+sections 4, 5, and 7.
+.
+Direct section declarations are ignored, wildcards are accepted.
+.
+.
+.Opt_def -- apropos\-devel
+Show only the
+.B \%apropos
+descriptions for development documents, these are the
+.BR man (7)
+sections 2, 3, and 9.
+.
+Direct section declarations are ignored, wildcards are accepted.
+.
+.
+.Opt_def -- apropos\-progs
+Show only the
+.B \%apropos
+descriptions for documents on programs, these are the
+.BR \%man (7)
+sections 1, 6, and 8.
+.
+Direct section declarations are ignored, wildcards are accepted.
+.
+.
+.Opt_def -- whatis
+For each
+.I \%filespec
+argument search all
+.I \%man\~pages
+and display their description \[em] or say that it is not a
+.IR \%man\~page .
+This differs from
+.IR man 's
+.B whatis
+output by the following concepts
+.RS
+.Topic
+each retrieved file name is added,
+.Topic
+local files are handled as well,
+.Topic
+the display is framed by a
.I groff
-without using the special viewing features of
-.IR groffer .
-If no device was specified by option
-.Opt_short T
+output format,
+.Topic
+wildcard characters are allowed without a further option.
+.RE
+.
+.
+.P
+The following two options were added to
+.B \%groffer
+for choosing whether the file name arguments are interpreted as names
+for local files or as a search pattern for
+.IR \%man\~pages .
+.
+The default is looking up for local files.
+.
+.
+.Opt_def -- man
+Check the non-option command line arguments
+.nh
+.RI ( filespecs )
+.hy
+first on being
+.IR \%man\~pages ,
+then whether they represent an existing file.
+.
+By default, a
+.I \%filespec
+is first tested whether it is an existing file.
+.
+.
+.Opt_def -- no-man -- local-file
+Do not check for
+.IR \%man\~pages .
+.
+.Opt_long local-file
+is the corresponding
+.B man
+option.
+.
+.
+.Opt_def -- no-special
+Disable former calls of
+.Opt_long all ,
+.Opt_long apropos* ,
+and
+.Opt_long whatis .
+.
+.
+.\" --------------------------------------------------------------------
+.SS "Long options taken over from GNU man"
+.\" --------------------------------------------------------------------
+.
+The long options of
+.B \%groffer
+were synchronized with the long options of \f[CR]GNU\f[]
+.BR man .
+.
+All long options of \f[CR]GNU\f[]
+.B man
+are recognized, but not all of these options are important to
+.BR \%groffer ,
+so most of them are just ignored.
+.
+.
+.P
+In the following, the
+.B man
+options that have a special meaning for
+.B \%groffer
+are documented.
+.
+.
+.P
+The full set of long and short options of the \f[CR]GNU\f[]
+.B man
+program can be passed via the environment variable
+.Env_var $MANOPT ;
+see
+.BR \%man (1)
+if your system has \f[CR]GNU\f[]
+.B man
+installed.
+.
+.
+.Opt_def -- all
+In searching
+.IR \%man\~pages ,
+retrieve all suitable documents instead of only one.
+.
+.
+.Opt_def - 7 -- ascii
+In
+.IR \%text\~modes ,
+display ASCII translation of special characters for critical environment.
+.
+This is equivalent to
+.BR "groff -mtty_char" ;
+see
+.BR groff_tmac (@MAN5EXT@).
+.
+.
+.Opt_def -- ditroff
+Eqivalent to
+.B \%groffer
+.Opt_short Z .
+.
+.
+.Opt_def -- extension suffix
+Restrict
+.I \%man\~page
+search to file names that have
+.I \%suffix
+appended to their section element.
+.
+For example, in the file name
+.I \%/usr/share/man/man3/terminfo.3ncurses.gz
the
-.I groff
-default
-.B ps
-is assumed.
+.I \%man\~page
+extension is
+.IR \%ncurses .
.
.
-.TP
-.Header_CB source
-Display source code; same as
-.Opt_short Q .
+.Opt_def -- locale language
.
+Set the language for
+.IR \%man\~pages .
.
-.RE
+This has the same effect, but overwrites
+.Env_var $LANG
+.
+.
+.Opt_def -- location
+Print the location of the retrieved files to standard error.
.
.
.Opt_def -- no-location
-Do not display the location of retireved files; this resets a former
+Do not display the location of retrieved files; this resets a former
call to
.Opt_long location .
.
+This was added by
+.BR \%groffer .
+.
+.
+.Opt_def -- manpath "'dir1:dir2:\*[Ellipsis]'"
+Use the specified search path for retrieving
+.I \%man\~pages
+instead of the program defaults.
.
-.Opt_def -- no-man
-Do not check for man\~pages.
+If the argument is set to the empty string "" the search for
+.I \%man\~page
+is disabled.
.
.
.Opt_def -- pager
-Set the pager program in tty mode; default is
-.IR less .
+Set the pager program in
+.IR \%tty\~mode ;
+default is
+.BR \%less .
+This is equivalent to
+.Opt_long tty\-viewer .
.
.
-.Opt_def -- pdf
-Choose pdf mode (Portable Document Format).
+.Opt_def -- sections "'sec1:sec2:\*[Ellipsis]'"
+Restrict searching for
+.I \%man\~pages
+to the given
+.IR sections ,
+a colon-separated list.
.
-By default, the input is formatted by groff using the Postscript
-device, then it is transformed into the PDF file format using
-.BR gs (1)
-(this is quite slow), and finally displayed either with the
-.BR xpdf (1)
-or the
-.BR acroread (1)
-program; this can be configured with option
-.Opt_long viewer-pdf .
.
-PDF has a big advantage because the text is displayed graphically and
-is searchable nevertheless; but as thtransformation into pdf takes a
-considerable amount of time, the pdf mode is not suitable as a default
-device for the auto mode.
+.Opt_def -- systems "'sys1,sys2,\*[Ellipsis]'"
+Search for
+.I \%man\~pages
+for the given operating systems; the argument
+.I \%systems
+is a comma-separated list.
.
-The only device that is compatible to this mode is
-.IR ps ,
-which is also the default when no device is specified.
.
+.Opt_def -- where
+Eqivalent to
+.Opt_long location .
.
-.Opt_def -- pdf-viewer prog
-Set the viewer program for
-.I pdf
-mode.
.
-This can be a file name or a program to be searched in
-.Env_var $PATH .
+.\" --------------------------------------------------------------------
+.SS "X\~\%Window\~\%Toolkit Options"
+.\" --------------------------------------------------------------------
.
-In each case, arguments can be provided additionally.
+The following long options were adapted from the corresponding
+\%\f[CR]X\~\Window\~Toolkit\f[] options.
.
+.B \%groffer
+will pass them to the actual viewer program if it is an
+\%\f[CR]X\~Window\f[] program.
.
-.Opt_def -- ps
-Choose ps mode (Postscript).
+Otherwise these options are ignored.
.
-By default, the formatted input is displayed with the
-.BR ghostview (@MAN1EXT@)
-program; this can be configured with option
-.Opt_long viewer-ps .
.
-The only device that is compatible to this mode is
-.IR ps ,
-which is also the default when no device is specified.
+.P
+Unfortunately these options use the old style of a single minus for
+long options.
.
+For
+.B \%groffer
+that was changed to the standard with using a double minus for long
+options, for example,
+.B \%groffer
+uses the option
+.Opt_long font
+for the \%\f[CR]X\~Window\f[] option
+.Opt_short font .
.
-.Opt_def -- ps-viewer prog
-Set the viewer program for
-.I ps
-mode.
.
-This can be a file name or a program to be searched in
-.Env_var $PATH .
+.P
+See
+.BR \%X (1),
+.BR \%X (7),
+and the documentation on the \%\f[CR]X\~Window\~Toolkit\f[] options
+for more details on these options and their arguments.
.
-Common Postscript viewers inlude
-.BR gv (1),
-.BR ghostview (1),
-and
-.BR gs (1),
.
-In each case, arguments can be provided additionally.
+.Opt_def -- background color
+Set the background color of the viewer window.
+.
+.
+.Opt_def -- bd pixels
+Specifies the color of the border surrounding the viewer window.
+.
+.
+.Opt_def -- bg color
+This is equivalent to
+.Opt_long background .
+.
+.
+.Opt_def -- bw pixels
+Specifies the width in pixels of the border surrounding the viewer
+window.
+.
+.
+.Opt_def -- display X-display
+Set the \%\f[CR]X\~Window\f[] display on which the viewer program
+shall be started, see the \%\f[CR]X\~Window\f[] documentation for the
+syntax of the argument.
+.
+.
+.Opt_def -- foreground color
+Set the foreground color of the viewer window.
+.
+.
+.Opt_def -- fg color
+This is equivalent to
+.Opt_short foreground .
+.
+.
+.Opt_def -- font font_name
+Set the font used by the viewer window.
+.
+The argument is an \%\f[CR]X\~Window\f[] font name.
+.
+.
+.Opt_def -- ft font_name
+This is equivalent to
+.Opt_long ft .
+.
+.
+.Opt_def -- geometry size_pos
+Set the geometry of the display window, that means its size and its
+starting position.
+.
+See
+.BR \%X (7)
+for the syntax of the argument.
.
.
.Opt_def -- resolution value
-Set X resolution in dpi (dots per inch) in some viewer programs.
+Set \%\f[CR]X\~Window\f[] resolution in dpi (dots per inch) in some
+viewer programs.
.
The only supported dpi values are
.B 75
and
.BR 100 .
-This is an adaption of the X Toolkit option
-.Opt_short resolution .
+.
+Actually, the default resolution for
+.B \%groffer
+is set to
+.BR 75\~dpi .
+The resolution also sets the default device in
+.IR "mode x" .
.
.
.Opt_def -- rv
Reverse foreground and background color of the viewer window.
.
-This is an adaption of the X Toolkit option
-.Opt_short rv .
-This feature is not available in all viewer programs.
-.
.
-.Opt_def -- sections
-Restrict searching for man pages to the given
-.IR sections ,
-a colon-separated list.
+.Opt_def -- title "'some text'"
+Set the title for the viewer window.
.
.
-.Opt_def -- shell "shell_program"
-Specify the shell under which the groffer script should be run.
+.Opt_def -- xrm "'resource'"
+Set \f[CR]\%X\~Window\f[] resource.
.
-The script first tests whether this option is set (either within
-.Env_var $GROFF_OPT
-or as a command line option); if so, the script is rerun under the
-shell program specified with the option argument.
.
+.\" --------------------------------------------------------------------
+.SS "Filespec Arguments"
+.\" --------------------------------------------------------------------
.
-.Opt_def -- source
-Equivalent to
-.Opt_short Q .
+A
+.I \%filespec
+parameter is an argument that is not an option or option argument.
.
+It means an input source.
.
-.Opt_def -- systems
-Search for man pages for the given operating systems; the argument
-.I systems
-is a comma-separated list.
+In
+.BR \%groffer ,
+.I \%filespec
+parameters are a file name or a template for searching
+.IR \%man\~pages .
.
+These input sources are collected and composed into a single output
+file such as
+.B \%groff
+does.
.
-.Opt_def -- title "'some text'"
-Set the title for the viewer window.
.
-This feature is not available in all viewer programs.
+.P
+The strange \%\f[CR]POSIX\f[] behavior to regard all arguments behind
+the first non-option argument as
+.I \%filespec
+arguments is ignored.
.
+The \f[CR]GNU\f[] behavior to recognize options even when mixed with
+.I \%filespec
+arguments is used througout.
.
-.Opt_def -- to-postproc opt_or_arg
-Eqivalent to
-.Opt_short P .
+But, as usual, the double minus argument
+.Opt_long
+ends the option handling and interprets all following arguments as
+.I \%filespec
+arguments; so the \%\f[CR]POSIX\f[] behavior can be easily adopted.
.
.
-.Opt_def -- troff-device
-Eqivalent to
-.Opt_short T .
-This option is only kept for compatibility with GNU
-.BR man (1).
+.P
+For the following, it is necessary to know that on each system the
+.I \%man\~pages
+are sorted according to their content into several sections.
.
+The
+.I classical man sections
+have a single-character name, either a digit from
+.B 1
+to
+.B 9
+or one of the characters
+.B n
+or
+.BR o .
.
-.Opt_def -- tty
-Choose tty display mode, that means displaying in a text pager even
-when in X; eqivalent to
-.Opt_long mode\~tty .
+In the following, a stand-alone character
+.I s
+stands for a
+.IR "classical man section" .
+The internal precedence of
+.B \%man
+for searching
+.I \%man\~pages
+with the same name within several sections goes according to the
+classical single-character sequence.
.
+On some systems, this single character can be extended by a following
+string.
.
-.Opt_def -- version
-Eqivalent to
-.Opt_short v .
+But the special
+.B \%groffer
+.I \%man\~page
+facility is based on the classical single character sections.
.
.
-.Opt_def -- whatis
-Instead of displaying the content, get the one-liner description from
-the retrieved man page files \[em] or say that it is not a man page.
+.P
+Each
+.I \%filespec
+parameter can have one of the following forms in decreasing sequence.
.
.
-.Opt_def -- where
-Eqivalent to
-.Opt_long location .
+.Topic
+No
+.I \%filespec
+parameters means that
+.B \%groffer
+waits for standard input.
.
+The minus option
+.Opt_short ""
+stands for standard input, too; it can occur several times.
.
-.Opt_def -- www
-Choose www mode (html), display in a web browser program, which can be
-specified with option
-.Opt_long www-viewer .
-By default, the existence of a sequence of standard web browsers is
-tested, starting with
-.BR mozilla (1)
-and
-.BR netscape (1)
.
+.Topic
+Next a
+.I \%filespec
+is tested whether it is the path name of an existing file.
.
-.Opt_def -- www-viewer prog
-Set the web browser program for viewing in
-.I www
-mode.
+Otherwise it is assumed to be a searching pattern for a
+.IR \%man\~page .
.
-Each program that accepts html input and allows the
-.BI file://localhost/ dir / file
-syntax on the command line is suitable; it can be the path name of an
-executable file or a program in
-.Env_var $PATH .
.
-In each case, arguments can be provided additionally.
+.Topic
+.BI \%man: name ( section )
+and
+.IB \%name ( section )
+search the \%man\~page
+.I \%name
+in \%man\~section\~\c
+.IR \%section ,
+where
+.I \%section
+can be any string, but it must exist in the
+.I \%man
+system.
.
.
-.Opt_def -- x
-Choose
-.I x
-mode (view in X roff viewer).
+.Topic
+Next some patterns based on the
+.I classical man sections
+are checked.
.
-By default, the formatted input is displayed with the
-.BR gxditview (@MAN1EXT@)
-program, being distributed together with groff, or with
-.BR xditview (1),
-which is distributed as a standard X tool.
-.
-This can be configured with option
-.Opt_long x-viewer .
-.
-The only devices (option
-.Opt_short T )
-that are compatible with this mode are
-.IR X75 ,
-.IR X100 ,
-.IR X75-12 ,
-.IR X100-12 ,
+.BI \%man: name . s
and
-.I ps
-(the default device).
+.IB \%name . s
+search for a \%man\~page
+.I \%name
+in \%man\~section
+.I s
+if
+.I s
+is a
+.I classical man section
+mentioned above.
+.
+Otherwise a
+.I \%man\~page
+named
+.IR \%name.s
+is searched in the lowest
+.B man\~section .
.
.
-.Opt_def -- x-viewer prog
-Set the viewer program for
-.I x
-mode.
+.Topic
+Now
+.BI \%man: name
+searches for a
+.I \%man\~page
+in the lowest
+.I \%man\~section
+that has a document called
+.IR \%name .
.
-Suitable viewer programs are
-.BR gxditview (@MAN1EXT@)
+.
+.Topic
+The pattern
+.I \%s\~name
+originates from a strange argument parsing of the
+.B man
+program.
+.
+If
+.I s
+is a
+.I classical man section
+interpret it as a search for a
+.I \%man\~page
+called
+.I \%name
+in man\~section
+.IR s ,
+otherwise interpret both
+.I s
and
-.BR xditview (1).
+.I \%name
+as two independent
+.I \%filespec
+arguments.
.
-But the argument can be any executable file or a program in
-.Env_var $PATH .
.
-In each case, arguments can be provided additionally.
+.Topic
+We are left with the argument
+.I \%name
+which is not an existing file.
.
+So this searches for the
+.I \%man\~page
+called
+.I \%name
+in the lowest
+.I \%man\~section
+that has a document for this name.
.
-.TP
-.Opt_--
-Signals the end of option processing; all remaining arguments are
-interpreted as
-.I filespec
-parameters.
+.
+.P
+Wildcards in
+.I \%filespec
+arguments are only accepted for
+.Opt_long apropos*
+and
+.Opt_long whatis ;
+for normal display, they are interpreted as characters.
.
.
.P
-Besides these, groffer accepts all arguments that are valid for the
-.BR groff (@MAN1EXT@)
-program.
+Several file name arguments can be supplied.
.
-All non-groffer options are sent unmodified via grog to groff.
+They are mixed by
+.B \%groff
+into a single document.
.
-Postprocessors, macro packages, compatibility with classical troff,
-and much more can be manually specified.
+Note that the set of option arguments must fit to all of these file
+arguments.
+.
+So they should have at least the same style of the
+.I \%groff
+language.
.
.
.\" --------------------------------------------------------------------
.SH "OUTPUT MODES"
.\" --------------------------------------------------------------------
.
-By default, the groffer program formats the input and then
-automatically chooses a suitable display mode, but the user can also
-choose between the following modes:
-.
-.Topic
-graphically display the formatted input with an X window program,
-including
+By default, the
+.B \%groffer
+program collects all input into a single file, formats it with the
+.B \%groff
+program for a certain device, and then chooses a suitable viewer
+program.
.
-.RS
-.Topic
-with X window roff viewers such as
-.BR gxditview (@MAN1EXT@)
-.RI ( x
-mode),
+The device and viewer process in
+.B \%groffer
+is called a
+.IR \%mode .
.
-.Topic
-in a dvi viewer program
-.RI ( dvi
-mode),
+The mode and viewer of a running
+.B \%groffer
+program is selected automatically, but the user can also choose it
+with options.
.
-.Topic
-in a Postscript viewer
-.RI ( ps
-mode),
.
-.Topic
-in a PDF viewer
-.RI ( pdf
-mode),
+The modes are selected by option the arguments of
+.Opt_long_arg mode \fIanymode .
+Additionally, each of this argument can be specified as an option of
+its own, such as
+.Opt_long \fIanymode .
+Most of these modes have a viewer program, which can be chosen by an
+option that is constructed like
+.Opt_long \fIanymode\fR\-viewer .
.
-.Topic
-in a web browser
-.RI ( www
-mode),
-.RE
.
-.Topic
-display formatted input in a pager on the text terminal
-.RI ( tty
-mode),
-.
-.Topic
-run groffer like groff, but with decompression and man\~page searching
-.RI ( groff
-mode); this includes things like generating the groff intermediate
-output.
-.
-.Topic
-stream the unformatted source code of the input onto standard output
-.RI ( source
-mode),
+.P
+Several different modes are offered, graphical modes for
+\f[CR]\%X\~Window\f[],
+.IR \%text\~modes ,
+and some direct
+.I \%groff\~modes
+for debugging and development.
.
.
.P
-By
-.IR default ,
-.I groffer
+By default,
+.B \%groffer
first tries whether
-.B x
-mode is possible, then
-.B ps
-mode, and finally
-.B tty
-mode.
+.I \%x\~mode
+is possible, then
+.IR \%ps\~mode ,
+and finally
+.IR \%tty\~mode .
.
This mode testing sequence for
-.B default
-mode can be changed by specifying a comma separated list of modes
-with the option
+.I \%auto\~mode
+can be changed by specifying a comma separated list of modes with the
+option
.Opt_long default\-modes.
.
.
.P
-The searching for man\~pages and the decompression of the input are
-active in every mode.
+The searching for
+.I \%man\~pages
+and the decompression of the input are active in every mode.
.
.
.\" --------------------------------------------------------------------
.SS "Graphical Display Modes"
.\" --------------------------------------------------------------------
.
-The graphical display modes work only in the X window environment (or
-similar implementations within other windowing environments).
+The graphical display modes work mostly in the \%\f[CR]X\~Window\f[]
+environment (or similar implementations within other windowing
+environments).
.
The environment variable
.Env_var $DISPLAY
-or the option
+and the option
.Opt_long display
-are used for specifying the X display to be used; if neither is
-specified, groffer assumes that no X is running.
+are used for specifying the \%\f[CR]X\~Window\f[] display to be used.
+.
+If this environment variable is empty
+.B \%groffer
+assumes that no \%\f[CR]X\~Window\f[] is running and changes to a
+.IR \%text\~mode .
+.
+You can change this automatic behavior by the option
+.Opt_long default\-modes .
.
.
.P
-A certain graphical display mode can be selected by one of the options
-.Opt_long dvi ,
-.Opt_long pdf ,
-.Opt_long ps ,
-.Opt_short X ,
-and
-.Opt_long www .
+Known viewers for the graphical display modes and their standard
+\%\f[CR]X\~Window\f[] viewer progams are
.
-By default, some graphical modes are tried first. If none succeeds
-groffer switches to
-.B tty
-mode.
+.Topic
+\%\f[CR]X\~Window\f[]
+.I roff
+viewers such as
+.BR \%gxditview (@MAN1EXT@)
+or
+.BR \%xditview (1)
+(in
+.IR \%x\~mode ),
.
+.Topic
+in a Postscript viewer
+.nh
+.RI ( \%ps\~mode ),
+.hy
.
-.P
-The graphical modes can be customized by options that were named
-according to the resource options in the
-.BR X (1)
-Toolkit but using a leading double minus instead of the single minus
-used by X.
+.Topic
+in a dvi viewer program
+.nh
+.RI ( \%dvi\~mode ),
+.hy
+.
+.Topic
+in a PDF viewer
+.nh
+.RI ( \%pdf\~mode ),
+.hy
.
-These include
-.Opt_long background ,
-.Opt_long foreground ,
-.Opt_long geometry ,
-.Opt_long resolution ,
-.Opt_long title ,
-.Opt_long xrm ,
-etc.
+.Topic
+in a web browser
+.nh
+.RI ( html
+or
+.IR \%www\~mode ).
+.hy
+.RE
.
.
.P
The
-.I pdf
-mode has a major advantage \[em] it is the only graphical diplay mode
-that allows to search for text within the viewer; this can be a really
+.I \%pdf\~mode
+has a major advantage \[em] it is the only graphical diplay mode that
+allows to search for text within the viewer; this can be a really
important feature.
.
-Unfortunately, it takes a long time to transform the input into the
-PDF format, so it was not chosen as the major mode.
+Unfortunately, it takes some time to transform the input into the PDF
+format, so it was not chosen as the major mode.
.
-You can change this by the options
-.Opt_long pdf
-and
-.Opt_long auto\-modes .
+.
+.P
+These graphical viewers can be customized by options of the
+\%\f[CR]X\~Window\~Toolkit\f[].
+.
+But the
+.B \%groffer
+options use a leading double minus instead of the single minus used by
+the \%\f[CR]X\~Window\~Toolkit\f[].
.
.
.\" --------------------------------------------------------------------
-.SS "Text mode"
+.SS "Text modes"
.\" --------------------------------------------------------------------
.
-If the variable
-.Env_var $DISPLAY
-is not set or empty, groffer assumes that it should produce output on
-a text terminal.
+There are two modes for text output,
+.I \%mode\~text
+for plain output without a pager and
+.I \%mode\~tty
+for a text output on a text terminal using some pager program.
.
-This mode can also be forced by option
-.Opt_long tty .
+.
+.P
+If the variable
+.Env_var \%$DISPLAY
+is not set or empty,
+.B \%groffer
+assumes that it should use
+.IR \%tty\~\%mode .
.
.
.P
-In the actual implementation, the groff output device
-.I latin1
-is chosen and the processed output is piped into a pager program.
+In the actual implementation, the
+.I groff
+output device
+.I \%latin1
+is chosen for
+.IR \%text\~modes .
.
This can be changed by specifying option
-.Opt_long tty-device .
+.Opt_short T
+or
+.Opt_long device .
.
.
.P
-The pager to be used can be specified by option
+The pager to be used can be specified by one of the options
.Opt_long pager
+and
+.Opt_long tty\-viewer ,
or by the environment variable
.Env_var $PAGER .
-If this is not set or empty the
-.BR less (1)
-program is used as the default pager.
+If all of this is not used the
+.BR \%less (1)
+program with the option
+.Opt_short r
+for correctly displaying control sequences is used as the default
+pager.
.
.
.\" --------------------------------------------------------------------
-.SS "Non-displaying Modes"
+.SS "Special Modes for Debugging and Development"
.\" --------------------------------------------------------------------
.
-There are some special modes that do not display the formatted output
-in a viewer program.
+These modes use the
+.I \%groffer
+file determination and decompression.
+.
+This is combined into a single input file that is fed directly into
+.B \%groff
+with different strategy without the
+.I \%groffer
+viewing facilities.
.
These modes are regarded as advanced, they are useful for debugging
-purposes.
+and development purposes.
.
.
-.TP
-.I source mode
-Instead of displaying the formatted output, it is also possible to
-have the roff source code streamed onto the standard output.
-.
-This mode must be requested by one of the options
+.P
+The
+.I \%source\~mode
+with option
.Opt_short Q
-or
-.Opt_long source .
-.
+and
+.Opt_long source
+just displays the decompressed input.
.
-.TP
-.I groff mode
-This mode disables the groffer viewing facilities.
.
-The input is handled as usual with decompression and man\~page
-searching, but then it is passed to groff using only the options
-provided by groff.
+.P
+The
+.I \%groff\~mode
+passes the input to
+.B \%groff
+using only some suitable options provided to
+.BR \%groffer .
.
This enables the user to save the generated output into a file or pipe
it into another program.
.
+.
+.P
+In
+.IR \%groff\~\%mode ,
+the option
+.Opt_short Z
+disables post-processing, thus producing the
+.nh
+.I groff intermediate
+.IR output .
+.hy
+.
In this mode, the input is formatted, but not postprocessed; see
-.BR groff_out (@MAN5EXT@)
+.BR \%groff_out (@MAN5EXT@)
for details.
.
-This mode is activated automatically by the three groff options
-.Opt_short V
-(print roff pipe, no formatting),
-.Opt_short X
-(display with gxditview in groff's native way, using
-.Opt_short P
-for customization), and
-.Opt_short Z
-(disable post-processing, thus producing the groff intermediate output).
+.
+.P
+All
+.B \%groff
+short options are supported by
+.BR \%groffer .
.
.
.\" --------------------------------------------------------------------
.SH "MAN\~PAGE\~SEARCHING"
.\" --------------------------------------------------------------------
.
-The default behavior of groffer is to first test whether a file
-parameter represents a local file; if it is not an existing file name,
-it is assumed to represent a name of a man\~page.
+The default behavior of
+.B \%groffer
+is to first test whether a file parameter represents a local file; if
+it is not an existing file name, it is assumed to represent a name of
+a
+.IR \%man\~page .
.
This behavior can be modified by the following options.
.
.
.TP
.Opt_long man
-forces to interpret all file parameters as filespecs for searching
-man\~pages.
+forces to interpret all file parameters as
+.I \%filespecs
+for searching
+.IR \%man\~pages .
.
.TP
.Opt_long no\-man
.TP+
.Opt_long local\-file
-disable the man searching; so only local files are displayed.
+disable the
+.I man
+searching; so only local files are displayed.
.
.
.P
-If neither a local file nor a man\~page was retrieved for some file
-parameter a warning is issued on standard error, but processing is
-continued.
+If neither a local file nor a
+.I \%man\~page
+was retrieved for some file parameter a warning is issued on standard
+error, but processing is continued.
.
.
.P
-The groffer program provides a search facility for man\~pages.
+The
+.B \%groffer
+program provides a search facility for
+.IR \%man\~pages .
.
All long options, all environment variables, and most of the
-functionality of the GNU
-.BR man (1)
+functionality of the \f[CR]GNU\f[]
+.BR \%man (1)
program were implemented.
.
-This inludes the extended file names of man\~pages, for example,
-the man\~page of
-.I groff
+This inludes the extended file names of
+.IR \%man\~pages ,
+for example, the
+.I \%man\~page
+of
+.B \%groff
in man\~section 7 may be stored under
.File_name /usr/share/man/man7/groff.7.gz ,
where
.File_name /usr/share/man/
is part of the man\~path, the subdirectory
-.I man7
+.I \%man7
and the file extension
.I .7
refer to the man\~section 7;
-.I .gz
+.I \%.gz
shows the compression of the file.
.
.
.P
The
.I cat\~pages
-(preformatted man\~pages) are intentionally excluded from the search
-because groffer is a roff program that wants to format by its own.
+(preformatted
+.IR \%man\~pages )
+are intentionally excluded from the search because
+.B \%groffer
+is a
+.I roff
+program that wants to format by its own.
.
With the excellent performance of the actual computers, the
-preformatted man\~pages aren't necessary any longer.
+preformatted
+.I \%man\~pages
+aren't necessary any longer.
.
.
.P
-The algorithm for retrieving man\~pages uses five search methods.
+The algorithm for retrieving
+\I \%man\~pages
+uses five search methods.
.
They are successively tried until a method works.
.
@@ -1901,7 +2808,9 @@ They are successively tried until a method works.
.Topic
The search path can be manually specified by using the option
.Opt_long manpath .
-An empty argument disables the man\~page searching.
+An empty argument disables the
+.I \%man\~page
+searching.
.
This overwrites the other methods.
.
@@ -1917,35 +2826,46 @@ If this is empty, the program tries to read it from the environment
variable
.Env_var $MANOPT .
.
+.
.Topic
-If this does not work, the
-.BR manpath (1)
-program for determining a path of man directories is tried.
+If this does not work a reasonable default path from
+.Env_var $PATH
+is searched for
+.IR \%man\~pages .
.
.
.Topic
-If this does not work a reasonable default path is searched for
-man\~pages.
+If this does not work, the
+.BR \%manpath (1)
+program for determining a path of
+.I man
+directories is tried.
.
.
.P
After this, the path elements for the language (locale) and operating
-system specific man\~pages are added to the man\~path; their sequence
-is determined automatically.
+system specific
+.I \%man\~pages
+are added to the
+.IR man\~path ;
+their sequence is determined automatically.
.
For example, both
-.I /usr/share/man/linux/fr
+.File_name /usr/share/man/linux/fr
and
-.I /usr/share/man/fr/linux
-for french linux man\~pages are found.
+.File_name /usr/share/man/fr/linux
+for french linux
+.I \%man\~pages
+are found.
.
The language and operating system names are determined from both
environment variables and command line options.
.
.
.P
-The locale (language) is determined like in GNU man, that is from
-highest to lowest precedence:
+The locale (language) is determined like in \f[CR]GNU\f[]
+.BR man ,
+that is from highest to lowest precedence:
.Topic
.Opt_long locale
.
@@ -1966,32 +2886,40 @@ highest to lowest precedence:
.
.
.P
-The language locale is usually specified in the POSIX 1003.1 based
-format:
+The language locale is usually specified in the
+\%\f[CR]POSIX\~1003.1\f[] based format:
.P
+.nh
\f[I]<language>\f[][\f[CB]_\f[]\f[I]<territory>\f[][\f[CB].\f[]\
\f[I]<character-set>\f[][\f[CB],\f[]\f[I]<version>\f[]]]],
+.hy
.P
but the two-letter code in
+.nh
.I <language>
+.hy
is sufficient for most purposes.
.
.
.P
-If no man\~pages for a complicated locale are found the country part
-consisting of the first two characters (without the `\f[CB]_\f[]',
-`\f[CB].\f[]', and `\f[CB],\f[]', parts) of the locale is searched as
-well.
+If no
+.I \%man\~pages
+for a complicated locale are found the country part consisting of the
+first two characters (without the `\f[CB]_\f[]', `\f[CB].\f[]', and
+`\f[CB],\f[]' parts) of the locale is searched as well.
.
.
.P
-If still not found the corresponding man\~page in the default language
-is used instead.
+If still not found the corresponding
+.I \%man\~page
+in the default language is used instead.
.
As usual, this default can be specified by one of \f[CR]C\f[] or
-\f[CR]POSIX\f[].
+\f[CR]\%POSIX\f[].
.
-The man\~pages in the default language are usually in English.
+The
+.I \%man\~pages
+in the default language are usually in English.
.
.
.P
@@ -2019,22 +2947,29 @@ Topic
.
.
.P
-When searching for man\~pages this man\~path with the additional
-language and system specific directories is used.
+When searching for
+.I \%man\~pages
+this
+.I man\~path
+with the additional language and system specific directories is used.
.
.
.P
The search can further be restricted by limiting it to certain
sections.
.
-A single section can be specified within each filespec argument,
-several sections as a colon-separated list in command line option
+A single section can be specified within each
+.I \%filespec
+argument, several sections as a colon-separated list in command line
+option
.Opt_long sections
or environment variable
.Env_var $MANSECT .
.
When no section was specified a set of standard sections is searched
-until a suitable man\~page was found.
+until a suitable
+.I \%man\~page
+was found.
.
.
.P
@@ -2049,8 +2984,10 @@ or environment variable
.
.
.P
-For further details on man\~page searching, see
-.BR man (1).
+For further details on
+.I \%man\~page
+searching, see
+.BR \%man (1).
.
.
.\" --------------------------------------------------------------------
@@ -2061,16 +2998,16 @@ The program has a decompression facility.
.
If standard input or a file that was retrieved from the command line
parameters is compressed with a format that is supported by either
-.BR gzip (1)
+.BR \%gzip (1)
or
-.BR bzip2 (1)
+.BR \%bzip2 (1)
it is decompressed on-the-fly.
.
-This includes the GNU
-.BR .gz ,
-.BR .bz2 ,
+This includes the \f[CR]GNU\f[]
+.BR \%.gz ,
+.BR \%.bz2 ,
and the traditional
-.B .Z
+.B \%.Z
compression.
.
The program displays the concatenation of all decompressed input in
@@ -2081,13 +3018,15 @@ the sequence that was specified on the command line.
.SH "ENVIRONMENT"
.\" --------------------------------------------------------------------
.
-The groffer programs supports many system variables, most of them by
-courtesy of other programs.
+The
+.B \%groffer
+program supports many system variables, most of them by courtesy of
+other programs.
.
All environment variables of
-.BR groff (@MAN1EXT@)
-and GNU
-.BR man (1)
+.BR \%groff (@MAN1EXT@)
+and \f[CR]GNU\f[]
+.BR \%man (1)
and some standard system variables are honored.
.
.
@@ -2097,42 +3036,53 @@ and some standard system variables are honored.
.
.TP
.Env_var $GROFFER_OPT
-Store options for a run of groffer.
+Store options for a run of
+.BR \%groffer .
.
The options specified in this variable are overridden by the options
given on the command line.
.
-The content of this variable is run through the shell builitin `eval';
+The content of this variable is run through the shell builtin `eval';
so arguments containing white-space or special shell characters should
be quoted.
.
+Do not forget to export this variable, otherwise it does not exist
+during the run of
+.BR groffer .
+.
.
.\" --------------------------------------------------------------------
.SS "System Variables"
.\" --------------------------------------------------------------------
.
-The groffer program is a shell script that is run through
-.BR /bin/sh ,
+The
+.B \%groffer
+program is a shell script that is run through
+.File_name /bin/sh ,
which can be internally linked to programs like
-.BR bash (1).
+.BR \%bash (1).
The corresponding system environment is automatically effective.
.
-The following variables have a special meaning for groffer.
+The following variables have a special meaning for
+.BR \%groffer .
.
.
.TP
.Env_var $DISPLAY
-If this variable is set this indicates that the X window system is
-running.
+If this variable is set this indicates that the \%\f[CR]X\~Window\f[]
+system is running.
.
Testing this variable decides on whether graphical or text output is
generated.
.
This variable should not be changed by the user carelessly, but it can
-be used to start the graphical groffer on a remote X terminal.
+be used to start the graphical
+.B \%groffer
+on a remote \%\f[CR]X\~Window\f[] terminal.
.
-For example, depending on your system, groffer can be started on the
-second monitor by the command
+For example, depending on your system,
+.B \%groffer
+can be started on the second monitor by the command
.Shell_cmd DISPLAY=:0.1\~groffer\~ what.ever &
.
.
@@ -2144,9 +3094,11 @@ second monitor by the command
.Env_var $LANG
If one of these variables is set (in the above sequence), its content
is interpreted as the locale, the language to be used, especially when
-retrieving man\~pages.
+retrieving
+\IR \%man\~pages .
.
A locale name is typically of the form
+.nh
.IR language [\c
.B _\c
.IR territory [\c
@@ -2154,22 +3106,21 @@ A locale name is typically of the form
.IR codeset [\c
.B @\c
.IR modifier ]]],
+.hy
where
-.I language
+.I \%language
is an ISO 639 language code,
-.I territory
+.I \%territory
is an ISO 3166 country code, and
-.I codeset
+.I \%codeset
is a character set or encoding identifier like ISO-8859-1 or UTF-8;
see
-.BR setlocale (3).
+.BR \%setlocale (3).
.
-The locale values\~\c
-.B C
-and
-.B POSIX
-stand for the default, i.e. the man\~page directories without a
-language prefix.
+The locale values \f[CR]C\f[] and \%\f[CR]POSIX\f[]
+stand for the default, i.e. the
+.I \%man\~page
+directories without a language prefix.
.
This is the same behavior as when all 3\~variables are unset.
.
@@ -2180,65 +3131,77 @@ This variable can be used to set the pager for the tty output.
.
For example, to disable the use of a pager completely set this
variable to the
-.BR cat (1)
+.BR \%cat (1)
program
.Shell_cmd PAGER=cat\~groffer\~ anything
.
.
.TP
.Env_var $PATH
-All programs within the groffer shell script are called without a
-fixed path.
+All programs within the
+.B \%groffer
+shell script are called without a fixed path.
.
Thus this environment variable determines the set of programs used
-within the run of groffer.
-.
-.
-.TP
-.Env_var $POSIXLY_CORRECT
-If set to a non-empty value this chooses the POSIX mode for option
-processing, that means that option processing will be finished as soon
-as a non-option argument is found.
-.
-Usually, you do not want to set this environment variable.
+within the run of
+.BR \%groffer .
.
.
.\" --------------------------------------------------------------------
.SS "Groff Variables"
.\" --------------------------------------------------------------------
.
-The groffer program internally calls groff, so all environment
-variables documented in
-.BR groff (@MAN1EXT@)
-are internally used within groffer as well.
-.
-The following variables have a direct meaning for the groffer program.
+The
+.B \%groffer
+program internally calls
+.BR \%groff ,
+so all environment variables documented in
+.BR \%groff (@MAN1EXT@)
+are internally used within
+.B \%groffer
+as well.
+.
+The following variable has a direct meaning for the
+.B \%groffer
+program.
.
.TP
.Env_var $GROFF_TMPDIR
If the value of this variable is an existing, writable directory,
-groffer uses it for storing its temporary files, just as groff does.
+.B \%groffer
+uses it for storing its temporary files, just as
+.B groff
+does.
.
.
.\" --------------------------------------------------------------------
.SS "Man Variables"
.\" --------------------------------------------------------------------
.
-Parts of the functionality of the man\~program were implemented in
-groffer; support for all environment variables documented in
-.BR man (1)
-was added to groffer, but the meaning was slightly modified due to the
-different approach in groffer; but the user interface is the same.
+Parts of the functionality of the
+.B man
+program were implemented in
+.BR \%groffer ;
+support for all environment variables documented in
+.BR \%man (1)
+was added to
+.BR \%groffer ,
+but the meaning was slightly modified due to the different approach in
+.BR \%groffer ;
+but the user interface is the same.
.
-The man environment variables can be overwritten by options provided
-with
+The
+.B man
+environment variables can be overwritten by options provided with
.Env_var $MANOPT ,
which in turn is overwritten by the command line.
.
.
.TP
.Env_var $EXTENSION
-Restrict the search for man\~pages to files having this extension.
+Restrict the search for
+.I \%man\~pages
+to files having this extension.
.
This is overridden by option
.Opt_long extension ;
@@ -2248,12 +3211,14 @@ see there for details.
.TP
.Env_var $MANOPT
This variable contains options as a preset for
-.BR man (1).
-As not all of these are relevant for groffer only the essential parts
-of its value are extracted.
+.BR \%man (1).
+As not all of these are relevant for
+.B \%groffer
+only the essential parts of its value are extracted.
.
The options specified in this variable overwrite the values of the
-other environment variables taht are specific to man.
+other environment variables that are specific to
+.IR man .
.
All options specified in this variable are overridden by the options
given on the command line.
@@ -2261,7 +3226,8 @@ given on the command line.
.
.TP
.Env_var $MANPATH
-If set, this variable contains the directories in which the man\~page
+If set, this variable contains the directories in which the
+.I \%man\~page
trees are stored.
.
This is overridden by option
@@ -2271,7 +3237,8 @@ This is overridden by option
.TP
.Env_var $MANSECT
If this is a colon separated list of section names, the search for
-man\~pages is restricted to those manual sections in that order.
+.I \%man\~pages
+is restricted to those manual sections in that order.
.
This is overridden by option
.Opt_long sections .
@@ -2280,7 +3247,9 @@ This is overridden by option
.TP
.Env_var $SYSTEM
If this is set to a comma separated list of names these are interpreted
-as man\~page trees for different operating systems.
+as
+.I \%man\~page
+trees for different operating systems.
.
This variable can be overwritten by option
.Opt_long systems ;
@@ -2290,36 +3259,91 @@ see there for details.
.P
The environment variable
.Env_var $MANROFFSEQ
-is ignored by groffer because the necessary preprocessors are
-determined automatically.
+is ignored by
+.B \%groffer
+because the necessary preprocessors are determined automatically.
.
.
.\" --------------------------------------------------------------------
.SH "CONFIGURATION FILES"
.\" --------------------------------------------------------------------
.
-The groffer program can be preconfigured by two configuration files.
-.
-Both of them are shell scripts that are called at the beginning of
-groffer using the `\c
-.CB .\~\c
-.IR filename '
-syntax.
+The
+.B \%groffer
+program can be preconfigured by two configuration files.
.
.
.TP
.File_name /etc/groff/groffer.conf
-System-wide configuration file for groffer.
+System-wide configuration file for
+.BR \%groffer .
.
.
.TP
.File_name $HOME/.groff/groffer.conf
-User-specific configuration file for groffer, where
+User-specific configuration file for
+.BR \%groffer ,
+where
.Env_var $HOME
denotes the user's home directory.
.
-This script is called after the system-wide configuration file to
-enable overriding by the user.
+This file is called after the system-wide configuration file to enable
+overriding by the user.
+.
+.
+.P
+The precedence of option delivery is given in the following.
+.
+The configuration file in
+.File_name /etc
+has the lowest precedence; it is overwritten by the configuration file
+in the home directory; both configuration files are overwritten by the
+environment variable
+.Env_var $GROFFER_OPT ;
+everything is overwritten by the command line.
+.
+.
+.P
+In the configuration files, arbitrary spaces are allowed at the
+beginning of each line, they are just ignored.
+.
+Apart from that, the lines of the configuration lines either start
+with a minus character, all other lines are interpreted as shell
+commands.
+.
+.
+.P
+The lines with the beginning minus are interpreted as
+.B groffer
+options.
+.
+This easily allows to set general
+.B \%groffer
+options that should be used with any call of
+.BR \%groffer .
+.
+Each line can represent a single short option, a short option cluster,
+or a long option with two minus signs, eventually with an argument.
+.
+The argument can be appended either after a space character or an
+equal sign
+.RB ` = '.
+The argument can be surrounded by quotes, but this is not necessary.
+.
+The options from these lines are collected and prepended to the
+existing value of
+.Env_var $GROFFER_OPT
+at the end of each configuration file.
+.
+.
+.P
+After the transformation of the minus lines, the configuration files
+have been transferred into a shell script that is called within
+.B \%groffer
+using the `\c
+.CB \.\~\c
+.IR \%filename '
+shell syntax.
.
.
.P
@@ -2327,123 +3351,238 @@ It makes sense to use these configuration files for the following
tasks:
.
.Topic
-Preset environment variables recognized by groffer; preferably a
-variable should only be set when it is unset in order not to override
-a user-provided value.
+Preset command line options, such as choosing a
+.I \%mode
+or a viewer.
+.
+These are written into lines starting with a single or double minus
+sign, followed by the option name.
.
.Topic
-Preset command line options by prepending them to
-.Env_var $GROFFER_OPT ;
-prepending should be preferred to appending and setting in order not
-to delete the environment variable provided by the
+Preset environment variables recognized by
+.BR \%groffer ;
+but do not forget to export them.
.
.Topic
-Write a function for calling a viewer program for a special
-.I mode
-and feed this name into its corresponding
+You can also write a shell function for calling, for example a viewer
+program for some
+.IR \%mode .
+Such a function can be fed into a corresponding
.Opt_long \f[I]mode\f[]\-viewer
option.
.
-Note that the name of such a function must coincide with some existing
-program in the system path
-.Env_var $PATH
-in order to be recognized by groffer.
+.Topic
+Enter
+.Opt_long shell
+to specify a shell for the run of
+.File_name groffer2.sh .
+Some shells run much faster than the standard shell.
.
.
.P
-As an example, consider the following configuration file.
+As an example, consider the following configuration file in
+.File_name ~/.groff/groffer.conf ,
+say.
.
.P
.ft CR
.nh
.nf
-#! /bin/sh
-# ~/.groff/groffer.conf
+# groffer configuration file
+#
+# groffer options that are used in each call of groffer
+\-\-shell=ksh
+\-\-foreground=DarkBlue
+\-\-resolution=100
+\-\-x\-viewer='gxditview \-geometry 900x1200'
+#
+# some shell commands
if test "$DISPLAY" = ""; then
- DISPLAY='localhost:0.0';
-fi;
-GROFF_OPT="--resolution=100 $GROFF_OPT";
-gxditview()
-{
- /usr/local/bin/gxditview --fg DarkBlue "$@";
-}
-GROFF_OPT="--x-viewer gxditview $GROFF_OPT";
+ export DISPLAY='localhost:0.0'
+fi
+date >>~/mygroffer.log
.fi
.hy
.ft
.
.
.P
+The lines starting with
+.B #
+are command lines.
+.
+This configuration sets four
+.B \%groffer
+options (the lines starting with `\-') and runs two shell commands (the
+rest of the script).
+.
This has the following effects:
+.
+.
.Topic
-allows to start groffer in a graphical mode (here on first running X
-display by
-.IR localhost:0.0 )
-even from a text terminal (empty
-.Env_var $DISPLAY );
+Use
+.B ksh
+as the shell to run the
+.B \%groffer
+script; if it works it should be faster than the usual
+.BR sh .
+.
+.
.Topic
-all graphical modes use a resolution of
-.I 100 dpi
-where applicable;
+Use a text color of
+.B \%DarkBlue
+in all viewers that support this, such as
+.BR \%gxditview .
+.
+.
.Topic
-the
-.BR gxditview (@MAN1EXT@)
-program is told to use
-.I DarkBlue
-as the text color by defining a shell function with the program's name
+Use a resolution of
+.B 100\~dpi
+in all viewers that support this, such as
+.BR \%gxditview .
+.
+By this, the default device in
+.I x mode
+is set to
+.BR X100 .
+.
+.
.Topic
-force
-.I gxditview
-to be used in X mode by option
-.Opt_long x\­viewer .
+Force
+.BR \%gxditview (@MAN1EXT@)
+as the
+.I \%x-mode
+viewer using the geometry option for setting the width to
+.B 900\~dpi
+and the height to
+.BR 1200\~dpi .
+This geometry is suitable for a resolution of
+.BR 100\~dpi .
.
.
-.P
-These configurations can be overridden by command line options and by
-environment variable
-.Env_var $GROFFER_OPT .
+.Topic
+If the environment variable
+.Env_var $DISPLAY
+is empty set it to
+.IR localhost:0.0 .
+.
+That allows to start
+.B \%groffer
+in the standard \%\f[CR]X\~Window\f[] display, even when the program
+is called from a text console.
+.
+.
+.Topic
+Just for fun, the date of each
+.B \%groffer
+start is written to the file
+.File_name mygroffer.log
+in the home directory.
.
.
.\" --------------------------------------------------------------------
.SH "EXAMPLES"
.\" --------------------------------------------------------------------
.
-The usage of groffer is very easy.
+The usage of
+.B \%groffer
+is very easy.
.
-Usually, it is just called with a file name or man\~page.
+Usually, it is just called with a file name or
+.IR \%man\~page .
.
-The following examples, however, show that groffer has much more fancy
-capabilities.
+The following examples, however, show that
+.B \%groffer
+has much more fancy capabilities.
.
.
.TP
.Shell_cmd "groffer\~/usr/local/share/doc/groff/meintro.ms.gz"
Decompress, format and display the compressed file
-.I meintro.ms.gz
+.File_name meintro.ms.gz
in the directory
-.IR /usr/local/share/doc/groff ,
-using a default graphical viewer when in X window, or the
-.BR less (1)
-pager program when not in X.
+.File_name /usr/local/share/doc/groff ,
+using the standard viewer
+.B \%gxditview
+as graphical viewer when in \%\f[CR]X\~Window\f[], or the
+.BR \%less (1)
+pager program when not in \%\f[CR]X\~Window\f[].
+.
+.
+.TP
+.Shell_cmd "groffer\~groff"
+If the file
+.File_name \%./groff
+exists use it as input.
+.
+Otherwise interpret the argument as a search for the
+.I \%man\~page
+named
+.B \%groff
+in the smallest possible
+.IR \%man\~section ,
+being section 1 in this case.
+.
+.
+.TP
+.Shell_cmd "groffer\~man:groff"
+search for the
+.I \%man\~page
+of
+.B \%groff
+even when the file
+.File_name ./groff
+exists.
+.
+.
+.TP
+.Shell_cmd "groffer\~groff.7"
+.TP+
+.Shell_cmd "groffer\~7\~groff"
+search the
+.I \%man\~page
+of
+.B \%groff
+in
+.I \%man\~section
+.BR 7 .
+This section search works only for a digit or a single character from
+a small set.
.
.
.TP
-.Shell_cmd "groffer\~groff.7\~groff\~\[cq]troff(1)\[cq]\~man:roff"
+.Shell_cmd "groffer\~fb.modes"
+If the file
+.File_name ./fb.modes
+does not exist interpret this as a search for the
+.I \%man\~page
+of
+.BR fb.modes .
+As the extension
+.I \%modes
+is not a single character in classical section style the argument is
+not split to a search for
+.BR fb .
+.
+.
+.TP
+.Shell_cmd "groffer\~groff\~\[cq]troff(1)\[cq]\~man:roff"
.
The arguments that are not existing files are looked-up as the
-following man\~pages:
-.I groff
-(in man\~section\~7),
-.I groff
-(automatic search, should be found in man\~section\~1),
-.I troff
+following
+.IR \%man\~pages :
+.B \%groff
+(automatic search, should be found in \fIman\fP\~section\~1),
+.B \%troff
(in section\~1),
and
-.I roff
+.B \%roff
(in the section with the lowest number, being\~7 in this case).
.
The quotes around
+.nh
.I \[cq]troff(1)\[cq]
+.hy
are necessary because the paranthesis are special shell characters;
escaping them with a backslash character
.I \[rs](
@@ -2455,46 +3594,56 @@ The formatted files are concatenated and displayed in one piece.
.
.
.TP
-.Shell_cmd "LANG=de\~groffer\~--man\~--www\~--www-viever=netscape\~ls"
+.Shell_cmd "LANG=de\~groffer\~--man\~--www\~--www-viever=galeon\~ls"
.
-Retrieve the German man\~page (language
+Retrieve the German
+.I \%man\~page
+(language
.IR de )
for the
.B ls
-program (the English version is used if there is no German version),
-decompress it, format it into the html format (www mode) and view the
-result in the default web browser
-.I netscape .
+program, decompress it, format it to
+.I \%html
+format
+.nh
+.RI ( \%www\~mode )
+.hy
+and view the result in the web browser
+.BR \%galeon .
The option
.Opt_long man
-guarantees that the man\~page is retrieved, even when a local file
-.I ls
+guarantees that the
+.I \%man\~page
+is retrieved, even when a local file
+.File_name \%ls
exists in the actual directory.
.
.
.TP
-.Shell_cmd "groffer\~-Q\~'man:roff(7)'"
+.Shell_cmd "groffer\~--source\~'man:roff(7)'"
.
-Get the man\~page called
-.I roff
-in man\~section 7 and print its unformatted content (source code
-because of option
-.Opt_short Q )
-on standard output.
+Get the
+.I \%man\~page
+called
+.I \%roff
+in \fIman\fP\~section 7, decompress it, and print its unformatted
+content, its source code.
.
.
.TP
.Shell_cmd "cat\~file.gz\~|\~groffer\~-Z\~-mfoo"
.
-Decompress the standard input, switch to
-.I groff
-using macro package
-.I foo
-(groff option
-.Opt_short m ) in non-postprocessing mode (groff option
-.Opt_short Z );
-this produces the groff intermediate output, see
-.BR groff_out (@MAN7EXT@).
+Decompress the standard input, send this to
+.I \%groff intermediate output mode
+without post-processing
+.RB ( groff
+option
+.Opt_short Z ),
+using macro package by
+.I \%foo
+.RB ( groff
+option
+.Opt_short m ) .
.
.
.TP
@@ -2511,79 +3660,121 @@ bold font, using color yellow on red background.
.\" --------------------------------------------------------------------
.
The
-.B groffer
-shell script is compatible to both POSIX and GNU.
+.B \%groffer
+program consists of two shell scripts.
.
-POSIX compatibility refers to
-.B IEEE P1003.2/D11.2
-of September 1991, a very early version of this standard.
.
-The script uses only a quite restricted set of shell language elements
-and shell builtins, common to all POSIX versions; the only external
-program used is `sed', again only the most basic POSIX features of
-`sed' are used.
+.P
+The starting script is the file
+.File_name \%groffer
+that is installed in a
+.File_name bin
+directory.
+.
+It is generated from the source file
+.File_name \%groffer.sh .
.
-The groffer script should work on most actual free and commercial
-operating systems.
+It is just a short starting script without any functions such that it
+can run on very poor shells.
.
.
.P
-The groffer program provides its own parser for command line options;
-it can handle option arguments and file names containing white space
-and a large set of special characters.
+The main part of the
+.B \%groffer
+program is the file
+.File_name groffer2.sh
+that is installed in the
+.I groff
+library directory.
+.
+This script can be run under a different shell by using the
+.B \%groffer
+option
+.Opt_long shell .
.
.
.P
-The groffer shell script was tested with the following common
-implementations of the POSIX shell:
-.BR ash (1),
-.BR bash (1),
-.BR ksh (1),
-POSIX
-.BR sh (1),
-and others.
+Both scripts are compatible with both
+\f[CR]GNU\f[] and \%\f[CR]POSIX\f[].
.
-Free POSIX compatible shells and shell utilities for most operating
-systems are available at the
-.URL http://\:www.gnu.org/software/ "GNU software archive" .
+\%\f[CR]POSIX\f[] compatibility refers to
+\%\f[CR]IEEE\~P1003.2/D11.2\f[] of September 1991, a very early
+version of the \%\f[CR]POSIX\f[] standard that is still freely
+available in the internet at
+.URL http://\:www.funet.fi/\:pub/\:doc/\:posix/\:p1003.2/\:d11.2/\:all \
+"\%POSIX\~P1003.2\~draft\~11.2" .
.
.
.P
-The best performance was obtained with the
-.I ash
-shell; so groffer tries to run under
-.I ash
-whenever possible.
+Only a restricted set of shell language elements and shell builtins is
+used to achieve even compatibility with some Bourne shells that are
+not fully \%\f[CR]POSIX\f[] compatible.
+.
+The
+.B \%groffer
+shell scripts were tested on many shells, including the following
+Bourne shells:
+.BR \%ash (1),
+.BR \%bash (1),
+.BR \%dash (1),
+.BR \%ksh (1),
+.BR \%pdksh (1),
+.BR \%posh (1),
+and
+.BR \%zsh (1).
+So it should work on most actual free and commercial operating
+systems.
.
-If not available the shell under which the script was started in the
-first place is used instead.
.
-This can be modified by the option
+.P
+The shell for the run of
+.File_name groffer2.sh
+can be chosen by the option
+.Opt_long shell
+on the command line or the environment variable
+.Env_var $GROFF_OPT .
+If you want to add it to one of the
+.B \%groffer
+configuration files you must write a line starting with
.Opt_long shell .
.
.
.P
-The groffer program provides its own parser for command line arguments
-that is compatible to both POSIX
-.BR getopts (1)
-and GNU
-.BR getopt (1).
+The
+.B \%groffer
+program provides its own parser for command line arguments that is
+compatible to both \%\f[CR]POSIX\f[]
+.BR \%getopts (1)
+and \%\f[CR]GNU\f[]
+.BR \%getopt (1).
+It can handle option arguments and file names containing white space
+and a large set of special characters.
+.
+The following standard types of options are supported.
.
-The following usual types of options are supported.
+.
+.Topic
+The option consisiting of a single minus
+.Opt_short
+refers to standard input.
.
.
.Topic
-A single minus always refers to single character options, for example,
+A single minus followed by characters refers to a single character
+option or a combination thereof; for example, the
+.B \%groffer
+short option combination
.Opt_short Qmfoo
is equivalent to
-.Opt_short Q\~\-m\~foo.
+.Opt_short Q\~\-m\~foo .
.
.
.Topic
-Long options that means option with names longer than one character
-are always prededed by a double minus; an option argument can either
-go to the next command line argument or be appended with an equal sign
-to the argument; for example,
+Long options are options with names longer than one character; they
+are always preceded by a double minus.
+.
+An option argument can either go to the next command line argument or
+be appended with an equal sign to the argument; for example,
.Opt_alt -- long=arg
is equivalent to
.Opt_alt -- long\~arg .
@@ -2593,144 +3784,232 @@ is equivalent to
An argument of
.Opt_--
ends option parsing; all further command line arguments are
-interpreted as filespec arguments.
+interpreted as
+.I \%filespec
+parameters, i.e. file names or constructs for searching
+.IR \%man\~pages ).
.
.
.Topic
-By default, all command line arguments that are neither options nor
-option arguments are interpreted as filespec parameters and stored
-until option parsing has finished.
+All command line arguments that are neither options nor option
+arguments are interpreted as
+.I \%filespec
+parameters and stored until option parsing has finished.
.
For example, the command line
.Shell_cmd "groffer file1 -a -o arg file2"
-is, by default, equivalent to
+is equivalent to
.Shell_cmd "groffer -a -o arg -- file1 file2"
.
.
.P
-This behavior can be changed by setting the environment variable
-.Env_var $POSIXLY_CORRECT
-to a non-empty value; in this case, option processing is stopped as
-soon as the first non-option argument is found.
+The free mixing of options and
+.I \%filespec
+parameters follows the GNU principle.
.
-For example, in posixly correct mode, the command line
-.Shell_cmd "groffer file1 -a -o arg file 2"
-is equivalent to
-.Shell_cmd "groffer -- file1 -a -o arg file 2"
-As this leads to unwanted behavior in most cases, most people do not
-want to set
-.Env_var $POSIXLY_CORRECT .
+That does not fulfill the strange option behavior of \%\f[CR]POSIX\f[]
+that ends option processing as soon as the first non-option argument
+has been reached.
+.
+The end of option processing can be forced by the option
+.RB ` \-\- '
+anyway.
+.
+.
+.\" --------------------------------------------------------------------
+.SH "BUGS"
+.\" --------------------------------------------------------------------
+.
+Report bugs to the
+.MTO bug-groff@gnu.org "bug-groff mailing list" .
+.
+Include a complete, self-contained example that will allow the bug to
+be reproduced, and say which version of
+.B \%groffer
+you are using.
+.
+.
+.P
+You can also use the
+.MTO groff@gnu.org "groff mailing list" ,
+but you must first subscribe to this list.
+.
+You can do that by visiting the
+.URL http://\:lists.gnu.org/\:mailman/\:listinfo/\:groff \
+"groff mailing list web page" .
+.
+.
+.P
+See
+.BR \%groff (@MAN1EXT@)
+for information on availability.
.
.
.\" --------------------------------------------------------------------
.SH "SEE ALSO"
.\" --------------------------------------------------------------------
.
+.P
+.BR \%groff (@MAN1EXT@),
+.BR \%@g@troff (@MAN1EXT@)
+.RS
+Details on the options and environment variables available in
+.BR \%groff ;
+all of them can be used with
+.BR \%groffer .
+.RE
+.
+.
.TP
-.BR groff (@MAN1EXT@)
-.TP+
-.BR troff (@MAN1EXT@)
-Details on the options and environment variables available in groff;
-all of them can be used with groffer.
+.BR \%groff (@MAN7EXT@)
+Documentation of the
+.I \%groff
+language.
.
.
.TP
-.BR grog (@MAN1EXT@)
-Internally, groffer tries to guess the groff command line options from
-the input using this program.
+.BR \%grog (@MAN1EXT@)
+Internally,
+.B \%groffer
+tries to guess the
+.B \%groff
+command line options from the input using this program.
.
.
.TP
.BR groff_out (@MAN5EXT@)
-Documentation on the groff intermediate output (ditroff output).
+Documentation on the
+.I \%groff intermediate output
+.nh
+.RI ( ditroff
+output).
+.hy
.
.
.TP
-.BR xdvi (1)
-.TP+
-.BR dvilx (1)
-Viewers for groffer's
-.I dvi
-mode.
+.BR groff_tmac (@MAN5EXT@)
+Documentation on the
+.I \%groff
+macro files.
.
.
.TP
-.BR gv (1)
-.TP+
-.BR ghostview (1)
-Viewers for groffer's
-.I ps
-mode.
+.BR \%man (1)
+The standard program to display
+.IR \%man\~pages .
+.
+The information there is only useful if it is the
+.I \%man\~page
+for GNU
+.BR man .
+Then it documents the options and environment variables that are
+supported by
+.BR \%groffer .
.
.
-.TP+
-.BR gs (1)
-Transformer from
-.I ps
-to
-.IR pdf ;
-and a
-.I ps
-viewer.
+.P
+.BR \%ash (1),
+.BR \%bash (1),
+.BR \%dash (1),
+.BR \%ksh (1),
+.BR \%pdksh (1),
+.BR \%posh (1),
+.BR \%sh (1),
+.BR \%zsh (1)
+.RS
+Bourne shells that were tested with
+.BR \%groffer .
+.RE
.
.
-.TP
-.BR xpdf (1)
+.P
+.BR \%gxditview (@MAN1EXT@),
+.BR \%xditview (1x)
+.RS
Viewers for
-.I pdf
-files.
+.BR \%groffer 's
+.IR \%x\~mode .
+.RE
.
.
-.TP
-.BR gxditview (@MAN1EXT@)
-.TP+
-.BR xditview (1x)
-Viewers for groffer's
-.I x
-mode.
+.P
+.BR \%kghostview (1),
+.BR \%ggv (1),
+.BR \%gv (1),
+.BR \%ghostview (1),
+.BR \%gs (1)
+.RS
+Viewers for
+.BR \%groffer 's
+.IR \%ps\~mode .
+.RE
.
.
-.TP
-.BR gzip (1)
-.TP+
-.BR bzip2 (1)
-The decompression programs supported by groffer.
+.P
+.BR \%kghostview (1),
+.BR \%ggv (1),
+.BR \%xpdf (1),
+.BR \%acroread (1),
+.BR \%kpdf (1)
+.RS
+Viewers for
+.BR \%groffer 's
+.IR \%pdf\~mode .
+.RE
.
.
-.TP
-.BR man (1)
-The standard program to diplay man\~pages.
+.P
+.BR \%kdvi (1),
+.BR \%xdvi (1),
+.BR \%dvilx (1)
+.RS
+Viewers for
+.BR \%groffer 's
+.IR \%dvi\~mode .
+.RE
.
-The information there is only useful if it is the man\~page for
-.IR "GNU\~man" .
-Then it documents the options and environment variables that are
-supported by groffer.
.
+.P
+.BR \%konqueror (1),
+.BR \%mozilla (1),
+.BR \%lynx (1)
+.RS
+Web-browsers for
+.BR \%groffer 's
+.I \%html
+or
+.IR \%www\~mode .
+.RE
.
-.\" --------------------------------------------------------------------
-.SH "AUTHOR"
-.\" --------------------------------------------------------------------
.
-Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+.TP
+.BR \%less (1)
+Standard pager program for the
+.I \%tty\~mode .
+.
.
.P
-This document is distributed under the terms of the FDL (GNU Free
-Documentation License) version 1.1 or later.
+.BR \%gzip (1),
+.BR \%bzip2 (1)
+.RS
+The decompression programs supported by
+.BR \%groffer .
+.RE
.
-You should have received a copy of the FDL on your system, it is also
-available on-line at the
-.URL http://\:www.gnu.org/\:copyleft/\:fdl.html "GNU copyleft site" .
.
-.P
-This document is part of
-.IR groff ,
-the GNU roff distribution.
+.\" --------------------------------------------------------------------
+.SH "AUTHOR"
+.\" --------------------------------------------------------------------
+.author
.
-It was written by
-.MTO bwarken@mayn.de "Bernd Warken" .
+.
+.\" --------------------------------------------------------------------
+.SH "COPYING"
+.\" --------------------------------------------------------------------
+.copyleft
.
.
-\" --------------------------------------------------------------------
+.\" --------------------------------------------------------------------
.\" Emacs settings
.\" --------------------------------------------------------------------
.
diff --git a/contrib/groff/contrib/groffer/groffer.sh b/contrib/groff/contrib/groffer/groffer.sh
index 4e7332c0648b..1cb55c72c9ca 100644
--- a/contrib/groff/contrib/groffer/groffer.sh
+++ b/contrib/groff/contrib/groffer/groffer.sh
@@ -1,4467 +1,299 @@
-#!/bin/sh
+#! /bin/sh
# groffer - display groff files
# Source file position: <groff-source>/contrib/groffer/groffer.sh
-# Copyright (C) 2001,2002,2003 Free Software Foundation, Inc.
-# Written by Bernd Warken <bwarken@mayn.de>
+# Copyright (C) 2001,2002,2003,2004,2005
+# Free Software Foundation, Inc.
+# Written by Bernd Warken
-# This file is part of groff.
+# This file is part of `groffer', which is part of `groff' version
+# @VERSION@. See $_GROFF_VERSION.
-# groff is free software; you can redistribute it and/or modify it
+# `groff' is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
-# groff is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-# License for more details.
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with groff; see the file COPYING. If not, write to the
-# Free Software Foundation, 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
-
-export _PROGRAM_NAME;
-export _PROGRAM_VERSION;
-export _LAST_UPDATE;
-
-_PROGRAM_NAME='groffer';
-_PROGRAM_VERSION='0.9.4';
-_LAST_UPDATE='22 Jan 2003';
-
-# This program is installed with groff version @VERSION@.
-
-########################################################################
-# Determine the shell under which to run this script;
-# if `ash' is available restart the script using `ash';
-# otherwise just go on.
-
-if test "${_groffer_run}" != 'second'; then
- # only reached during the first run of the script
-
- export GROFFER_OPT;
- export _groffer_run;
- export _this;
-
- _this="@BINDIR@/${_PROGRAM_NAME}";
-
- ###########################
- # _get_opt_shell ("$@")
- #
- # Determine whether `--shell' was specified in $GROFF_OPT or in $*;
- # if so echo its argument.
- #
- _get_opt_shell()
- {
- local i;
- local _sh;
- case " ${GROFFER_OPT} $*" in
- *\ --shell\ *|*\ --shell=*)
- (
- eval set -- "${GROFFER_OPT}" '"$@"';
- _sh='';
- for i in "$@"; do
- case "$1" in
- --shell)
- if test "$#" -ge 2; then
- _sh="$2";
- shift;
- fi;
- ;;
- --shell=?*)
- # delete up to first `=' character
- _sh="$(echo -n "$1" | sed -e 's/^[^=]*=//')";
- ;;
- esac;
- shift;
- done;
- echo -n "${_sh}";
- )
- ;;
- esac;
- }
-
-
- ###########################
- # _test_on_shell (<name>)
- #
- # Test whether <name> is a shell program of Bourne type (POSIX sh).
- #
- _test_on_shell()
- {
- if test "$#" -le 0 || test "$1" = ''; then
- return 1;
- fi;
- # do not quote $1 to allow arguments
- test "$($1 -c 's=ok; echo -n "$s"' 2>/dev/null)" = 'ok';
- }
-
- # do the shell determination
- _shell="$(_get_opt_shell "$@")";
- if test "${_shell}" = ''; then
- _shell='ash';
- fi;
- if _test_on_shell "${_shell}"; then
- _groffer_run='second';
- # do not quote $_shell to allow arguments
- exec ${_shell} "${_this}" "$@";
- exit;
- fi;
-
- # clean-up of shell determination
- unset _shell;
- unset _this;
- unset _groffer_run;
- _get_opt_shell()
- {
- return 0;
- }
- _test_on_shell()
- {
- return 0;
- }
-
-fi;
-
-
-########################################################################
-# diagnostic messages
-#
-export _DEBUG;
-_DEBUG='no'; # disable debugging information
-#_DEBUG='yes'; # enable debugging information
-
-export _DEBUG_LM;
-_DEBUG_LM='no'; # disable landmark messages
-#_DEBUG_LM='yes'; # enable landmark messages
-
-
-########################################################################
-# Description
-########################################################################
-
-# Display groff files and man pages on X or tty, even when compressed.
-
-
-### Usage
-
-# Input comes from either standard input or command line parameters
-# that represent either names of exisiting roff files or standardized
-# specifications for man pages. All of these can be compressed in a
-# format that is decompressible by `gzip'.
-
-# The following displaying modes are available:
-# - Display formatted input with the X roff viewer `gxditview',
-# - with a Prostcript viewer,
-# - with a dvi viewer,
-# - with a web browser.
-# - Display formatted input in a text terminal using a text device.
-# - Generate output for some groff device on stdout without a viewer.
-# - Output only the source code without any groff processing.
-# - Generate the troff intermediate output on standard output
-# without groff postprocessing.
-# By default, the program tries to display with `gxditview' (1); if
-# this does not work, text display (2) is used.
-
-
-### Error handling
-
-# Error handling and exit behavior is complicated by the fact that
-# `exit' can only escape from the current shell; trouble occurs in
-# subshells. This was solved by sending kill signals, see
-# $_PROCESS_ID and error().
-
-
-### Compatibility
-
-# This shell script is compatible to the both the GNU and the POSIX
-# shell and utilities. Care was taken to restrict the programming
-# technics used here in order to achieve POSIX compatibility as far
-# back as POSIX P1003.2 Draft 11.2 of September 1991.
-
-# The only non-builtin used here is POSIX `sed'. This script was
-# tested under `bash', `ash', and `ksh'. The speed under `ash' is
-# more than double when compared to the larger shells.
-
-# This script provides its own option parser. It is compatible to the
-# usual GNU style command line (option clusters, long options, mixing
-# of options and non-option file names), except that it is not
-# possible to abbreviate long option names.
-
-# The mixing of options and file names can be prohibited by setting
-# the environment variable `$POSIXLY_CORRECT' to a non-empty value.
-# This enables the rather wicked POSIX behavior to terminate option
-# parsing when the first non-option command line argument is found.
-
-
-########################################################################
-# Survey of functions defined in this document
-########################################################################
-
-# The elements specified within paranthesis `(<>)' give hints to what
-# the arguments are meant to be; the argument names are irrelevant.
-# <>? 0 or 1
-# <>* arbitrarily many such arguments, incl. none
-# <>+ one or more such arguments
-# <> exactly 1
-
-# A function that starts with an underscore `_' is an internal
-# function for some function. The internal functions are defined just
-# after their corresponding function; they are not mentioned in the
-# following.
-
-# abort (text>*)
-# base_name (path)
-# catz (<file>)
-# clean_up ()
-# diag (text>*)
-# dirname_append (<path> [<dir...>])
-# dirname_chop (<path>)
-# do_filearg (<filearg>)
-# do_nothing ()
-# echo2 (<text>*)
-# echo2n (<text>*)
-# error (<text>*)
-# get_first_essential (<arg>*)
-# is_dir (<name>)
-# is_empty (<string>)
-# is_equal (<string1> <string2>)
-# is_file (<name>)
-# is_not_empty (<string>)
-# is_not_equal (<string1> <string2>)
-# is_not_file (<name>)
-# is_not_prog (<name>)
-# is_prog (<name>)
-# is_yes (<string>)
-# leave ()
-# landmark (<text>)
-# list_append (<list> <element>...)
-# list_check (<list>)
-# list_from_args (<arg>...)
-# list_from_cmdline (<s_n> <s_a> <l_n> <l_n> [<cmdline_arg>...])
-# list_from_split (<string> <separator>)
-# list_has (<list> <element>)
-# list_has_not (<list> <element>)
-# list_length (<list>)
-# main_*(), see after the functions
-# man_do_filespec (<filespec>)
-# man_setup ()
-# man_register_file (<file> [<name> [<section>]])
-# man_search_section (<name> <section>)
-# man_set()
-# manpath_add_lang(<path> <language>)
-# manpath_add_system()
-# manpath_from_path ()
-# normalize_args (<shortopts> <longopts> <arg>*)
-# path_chop (<path>)
-# path_clean (<path>)
-# path_contains (<path> <dir>)
-# path_not_contains (<path> <dir>)
-# path_split (<path>)
-# register_file (<filename>)
-# register_title (<filespec>)
-# reset ()
-# save_stdin ()
-# string_contains (<string> <part>)
-# string_not_contains (<string> <part>)
-# tmp_cat ()
-# tmp_create (<suffix>?)
-# to_tmp (<filename>)
-# trap_clean ()
-# trap_set (<functionname>)
-# usage ()
-# version ()
-# warning (<string>)
-# whatis (<filename>)
-# where (<program>)
-
-
-########################################################################
-# Environment Variables
-########################################################################
-
-# Environment variables that exist only for this file start with an
-# underscore letter. Global variables to this file are written in
-# upper case letters, e.g. $_GLOBAL_VARIABLE; temporary variables
-# start with an underline and use only lower case letters and
-# underlines, e.g. $_local_variable .
-
-# [A-Z]* system variables, e.g. $MANPATH
-# _[A-Z_]* global file variables, e.g. $_MAN_PATH
-# _[a-z_]* temporary variables, e.g. $_manpath
-
-# Due to incompatibilities of the `ash' shell, the name of loop
-# variables in `for' must be single character
-# [a-z] local loop variables, e.g. $i
-
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
########################################################################
-# External environment variables
-# If these variables are exported here then the `ash' shell coughs
-# when calling `groff' in `main_display()'.
+_PROGRAM_VERSION='0.9.22';
+_LAST_UPDATE='22 August 2005';
-if test "${GROFFER_EXPORT_EXTERNALS}" = 'yes'; then
-
- # external system environment variables that are explicitly used
- export DISPLAY; # Presets the X display.
- export LANG; # For language specific man pages.
- export LC_ALL; # For language specific man pages.
- export LC_MESSAGES; # For language specific man pages.
- export PAGER; # Paging program for tty mode.
- export PATH; # Path for the programs called (: list).
-
- # groffer native environment variables
- export GROFFER_OPT # preset options for groffer.
-
- # all groff environment variables are used, see groff(1)
- export GROFF_BIN_PATH; # Path for all groff programs.
- export GROFF_COMMAND_PREFIX; # '' (normally) or 'g' (several troffs).
- export GROFF_FONT_PATH; # Path to non-default groff fonts.
- export GROFF_TMAC_PATH; # Path to non-default groff macro files.
- export GROFF_TMPDIR; # Directory for groff temporary files.
- export GROFF_TYPESETTER; # Preset default device.
-
- # all GNU man environment variables are used, see man(1).
- export MANOPT; # Preset options for man pages.
- export MANPATH; # Search path for man pages (: list).
- export MANROFFSEQ; # Ignored because of grog guessing.
- export MANSECT; # Search man pages only in sections (:).
- export SYSTEM; # Man pages for different OS's (, list).
+export _PROGRAM_VERSION;
+export _LAST_UPDATE;
-fi;
+export GROFFER_OPT; # option environment for groffer
-
-########################################################################
-# read-only variables (global to this file)
-########################################################################
+export _CONF_FILE_ETC; # configuration file in /etc
+export _CONF_FILE_HOME; # configuration file in $HOME
+export _CONF_FILES; # configuration files
+_CONF_FILE_ETC='/etc/groff/groffer.conf';
+_CONF_FILE_HOME="${HOME}/.groff/groffer.conf";
+_CONF_FILES="${_CONF_FILE_ETC} ${_CONF_FILE_HOME}";
# characters
-export _BQUOTE;
-export _BSLASH;
-export _DQUOTE;
-export _NEWLINE;
-export _LBRACK;
-export _LPAR;
-export _RBRACK;
-export _RPAR;
-export _SPACE;
-export _SQUOTE;
+export _AT;
+export _SP;
+export _SQ;
export _TAB;
-_BQUOTE='`';
-_BSLASH='\';
-_DQUOTE='"';
-_NEWLINE='
-';
-_LBRACK='[';
-_LPAR='(';
-_RBRACK=']';
-_RPAR=')';
-_SPACE=' ';
-_SQUOTE="'";
+_AT='@';
+_SP=' ';
+_SQ="'";
_TAB=' ';
-# function return values; `0' means ok; other values are error codes
-export _ALL_EXIT;
-export _BAD;
export _ERROR;
-export _GOOD;
-export _NO;
-export _OK;
-export _YES;
-
-_GOOD='0'; # return ok
-_BAD='1'; # return negatively, error code `1'
_ERROR='7'; # for syntax errors; no `-1' in `ash'
-_ALL_EXIT="${_GOOD} ${_BAD} ${_ERROR}"; # all exit codes (for `trap_set')
-
-_NO="${_BAD}";
-_YES="${_GOOD}";
-_OK="${_GOOD}";
-
-# quasi-functions, call with `eval'
-export return_ok;
-export return_good;
-export return_bad;
-export return_yes;
-export return_no;
-export return_error;
-return_ok="func_pop; return ${_OK}";
-return_good="func_pop; return ${_GOOD}";
-return_bad="func_pop; return ${_BAD}";
-return_yes="func_pop; return ${_YES}";
-return_no="func_pop; return ${_NO}";
-return_error="func_pop; return ${_ERROR}";
-
-
-export _CONFFILES;
-_CONFFILES="/etc/groff/groffer.conf ${HOME}/.groff/groffer.conf";
-
-export _DEFAULT_MODES;
-_DEFAULT_MODES='ps,x,tty';
-export _DEFAULT_RESOLUTION;
-_DEFAULT_RESOLUTION='100';
-
-export _DEFAULT_TTY_DEVICE;
-_DEFAULT_TTY_DEVICE='latin1';
-
-# _VIEWER_* viewer programs for different modes (only X is necessary)
-# _VIEWER_* a comma-separated list of viewer programs (with options)
-export _VIEWER_DVI; # viewer program for dvi mode
-export _VIEWER_PS; # viewer program for ps mode
-export _VIEWER_WWW_X; # viewer program for www mode in X
-export _VIEWER_WWW_TTY; # viewer program for www mode in tty
-_VIEWER_DVI='xdvi,dvilx';
-_VIEWER_PDF='xpdf,acroread';
-_VIEWER_PS='gv,ghostview,gs_x11,gs';
-_VIEWER_WWW='mozilla,netscape,opera,amaya,arena';
-_VIEWER_X='gxditview,xditview';
-
-# Search automatically in standard sections `1' to `8', and in the
-# traditional sections `9', `n', and `o'. On many systems, there
-# exist even more sections, mostly containing a set of man pages
-# special to a specific program package. These aren't searched for
-# automatically, but must be specified on the command line.
-export _MAN_AUTO_SEC;
-_MAN_AUTO_SEC="'1' '2' '3' '4' '5' '6' '7' '8' '9' 'n' 'o'"
-
-export _PROCESS_ID; # for shutting down the program
-_PROCESS_ID="$$";
-
-
-############ the command line options of the involved programs
-#
-# The naming scheme for the options environment names is
-# $_OPTS_<prog>_<length>[_<argspec>]
-#
-# <prog>: program name GROFFER, GROFF, or CMDLINE (for all
-# command line options)
-# <length>: LONG (long options) or SHORT (single character options)
-# <argspec>: ARG for options with argument, NA for no argument;
-# without _<argspec> both the ones with and without arg.
-#
-# Each option that takes an argument must be specified with a
-# trailing : (colon).
-
-# exports
-export _OPTS_GROFFER_SHORT_NA;
-export _OPTS_GROFFER_SHORT_ARG;
-export _OPTS_GROFFER_LONG_NA;
-export _OPTS_GROFFER_LONG_ARG;
-export _OPTS_GROFF_SHORT_NA;
-export _OPTS_GROFF_SHORT_ARG;
-export _OPTS_GROFF_LONG_NA;
-export _OPTS_GROFF_LONG_ARG;
-export _OPTS_MAN_SHORT_ARG;
-export _OPTS_MAN_SHORT_NA;
-export _OPTS_MAN_LONG_ARG;
-export _OPTS_MAN_LONG_NA;
-export _OPTS_GROFFER_LONG;
-export _OPTS_GROFFER_SHORT;
-export _OPTS_GROFF_LONG;
-export _OPTS_GROFF_SHORT;
-export _OPTS_CMDLINE_SHORT_NA;
-export _OPTS_CMDLINE_SHORT_ARG;
-export _OPTS_CMDLINE_SHORT;
-export _OPTS_CMDLINE_LONG_NA;
-export _OPTS_CMDLINE_LONG_ARG;
-export _OPTS_CMDLINE_LONG;
-
-
-###### native groffer options
-
-_OPTS_GROFFER_SHORT_NA="'h' 'Q' 'v' 'V' 'X' 'Z'";
-_OPTS_GROFFER_SHORT_ARG="'T'";
-
-_OPTS_GROFFER_LONG_NA="'all' 'apropos' 'ascii' 'auto' 'default' 'dvi' \
-'groff' 'help' 'intermediate-output' 'local-file' 'location' 'man' \
-'no-location' 'no-man' 'pdf' 'ps' 'rv' 'source' 'tty' 'tty-device' \
-'version' 'whatis' 'where' 'www' 'x'";
-
-_OPTS_GROFFER_LONG_ARG="'background' 'bd' 'bg' 'bw' 'default-modes' \
-'device' 'display' 'dvi-viewer' 'extension' 'fg' 'fn' 'font' \
-'foreground' 'geometry' 'locale' 'manpath' 'mode' 'pager' \
-'pdf-viewer' 'ps-viewer' 'resolution' 'sections' 'shell' \
-'systems' 'title' 'troff-device' 'www-viewer' 'xrm' 'x-viewer'";
-
-##### options inhereted from groff
+# @...@ constructs
-_OPTS_GROFF_SHORT_NA="'a' 'b' 'c' 'C' 'e' 'E' 'g' 'G' 'i' 'l' 'N' 'p' \
-'R' 's' 'S' 't' 'U' 'V' 'z'";
-_OPTS_GROFF_SHORT_ARG="'d' 'f' 'F' 'I' 'L' 'm' 'M' 'n' 'o' 'P' 'r' \
-'w' 'W'";
-_OPTS_GROFF_LONG_NA="";
-_OPTS_GROFF_LONG_ARG="";
-
-###### man options (for parsing $MANOPT only)
-
-_OPTS_MAN_SHORT_NA="'7' 'a' 'c' 'd' 'D' 'f' 'h' 'k' 'l' 't' 'u' \
-'V' 'w' 'Z'";
-_OPTS_MAN_SHORT_ARG="'e' 'L' 'm' 'M' 'p' 'P' 'r' 'S' 'T'";
-
-_OPTS_MAN_LONG_NA="'all' 'ascii' 'apropos' 'catman' 'debug' 'default' \
-'ditroff' 'help' 'local-file' 'location' 'troff' 'update' 'version' \
-'whatis' 'where'";
-
-_OPTS_MAN_LONG_ARG="'extension' 'locale' 'manpath' \
-'pager' 'preprocessor' 'prompt' 'sections' 'systems' 'troff-device'";
-
-###### collections of options
-
-# groffer
-
-_OPTS_GROFFER_LONG="${_OPTS_GROFFER_LONG_ARG} ${_OPTS_GROFFER_LONG_NA}";
-_OPTS_GROFFER_SHORT=\
-"${_OPTS_GROFFER_SHORT_ARG} ${_OPTS_GROFFER_SHORT_NA}";
-
-# groff
-
-_OPTS_GROFF_LONG="${_OPTS_GROFF_LONG_ARG} ${_OPTS_GROFF_LONG_NA}";
-_OPTS_GROFF_SHORT="${_OPTS_GROFF_SHORT_ARG} ${_OPTS_GROFF_SHORT_NA}";
-
-# all command line options
-
-_OPTS_CMDLINE_SHORT_NA="\
-${_OPTS_GROFFER_SHORT_NA} ${_OPTS_GROFF_SHORT_NA}";
-_OPTS_CMDLINE_SHORT_ARG="\
-${_OPTS_GROFFER_SHORT_ARG} ${_OPTS_GROFF_SHORT_ARG}";
-_OPTS_CMDLINE_SHORT="${_OPTS_GROFFER_SHORT} ${_OPTS_GROFF_SHORT}";
-
-_OPTS_CMDLINE_LONG_NA="${_OPTS_GROFFER_LONG_NA} \
-${_OPTS_GROFF_LONG_NA} ${_OPTS_MAN_LONG_NA}";
-_OPTS_CMDLINE_LONG_ARG="${_OPTS_GROFFER_LONG_ARG} \
-${_OPTS_GROFF_LONG_ARG} ${_OPTS_MAN_LONG_ARG}";
-_OPTS_CMDLINE_LONG="${_OPTS_GROFFER_LONG} ${_OPTS_GROFF_LONG}";
-
-
-########################################################################
-# read-write variables (global to this file)
-########################################################################
-
-export _ADDOPTS_GROFF; # Transp. options for groff (`eval').
-export _ADDOPTS_POST; # Transp. options postproc (`eval').
-export _ADDOPTS_X; # Transp. options X postproc (`eval').
-export _DEFAULT_MODES; # Set default modes.
-export _DISPLAY_MODE; # Display mode.
-export _DISPLAY_PROG; # Viewer program to be used for display.
-export _DISPLAY_ARGS; # X resources for the viewer program.
-export _FILEARGS; # Stores filespec parameters.
-export _FUNC_STACK; # Store debugging information.
-export _REGISTERED_TITLE; # Processed file names.
-# _HAS_* from availability tests
-export _HAS_COMPRESSION; # `yes' if compression is available
-export _HAS_OPTS_GNU; # `yes' if GNU `getopt' is available
-export _HAS_OPTS_POSIX; # `yes' if POSIX `getopts' is available
-# _MAN_* finally used configuration of man searching
-export _MAN_ALL; # search all man pages per filespec
-export _MAN_ENABLE; # enable search for man pages
-export _MAN_EXT; # extension for man pages
-export _MAN_FORCE; # force file parameter to be man pages
-export _MAN_IS_SETUP; # setup man variables only once
-export _MAN_LANG; # language for man pages
-export _MAN_LANG_DONE; # language dirs added to man path
-export _MAN_PATH; # search path for man pages
-export _MAN_SEC; # sections for man pages; sep. `:'
-export _MAN_SEC_DONE; # sections added to man path
-export _MAN_SYS; # system names for man pages; sep. `,'
-export _MAN_SYS; # system names added to man path
-# _MANOPT_* as parsed from $MANOPT
-export _MANOPT_ALL; # $MANOPT --all
-export _MANOPT_EXTENSION; # $MANOPT --extension
-export _MANOPT_LANG; # $MANOPT --locale
-export _MANOPT_PATH; # $MANOPT --manpath
-export _MANOPT_PAGER; # $MANOPT --pager
-export _MANOPT_SEC; # $MANOPT --sections
-export _MANOPT_SYS; # $MANOPT --systems
-# _OPT_* as parsed from groffer command line
-export _OPT_ALL; # display all suitable man pages.
-export _OPT_APROPOS; # branch to `apropos' program.
-export _OPT_BD; # set border color in some modes.
-export _OPT_BG; # set background color in some modes.
-export _OPT_BW; # set border width in some modes.
-export _OPT_DEBUG; # print debugging information on stderr.
-export _OPT_DEFAULT_MODES; # `,'-list of modes when no mode given.
-export _OPT_DEVICE; # device option.
-export _OPT_DISPLAY; # set X display.
-export _OPT_FG; # set foreground color in some modes.
-export _OPT_FN; # set font in some modes.
-export _OPT_GEOMETRY; # set size and position of viewer in X.
-export _OPT_LANG; # set language for man pages
-export _OPT_LOCATION; # print processed file names to stderr
-export _OPT_MODE; # values: X, tty, Q, Z, ""
-export _OPT_MANPATH; # manual setting of path for man-pages
-export _OPT_PAGER; # specify paging program for tty mode
-export _OPT_RESOLUTION; # set X resolution in dpi
-export _OPT_RV; # reverse fore- and background colors.
-export _OPT_SECTIONS; # sections for man page search
-export _OPT_SYSTEMS; # man pages of different OS's
-export _OPT_TITLE; # title for gxditview window
-export _OPT_TTY_DEVICE; # set device for tty mode.
-export _OPT_V; # groff option -V.
-export _OPT_VIEWER_DVI; # viewer program for dvi mode
-export _OPT_VIEWER_PDF; # viewer program for pdf mode
-export _OPT_VIEWER_PS; # viewer program for ps mode
-export _OPT_VIEWER_WWW; # viewer program for www mode
-export _OPT_VIEWER_X; # viewer program for x mode
-export _OPT_WHATIS; # print the one-liner man info
-export _OPT_X; # groff option -X.
-export _OPT_XRM; # specify X resource.
-export _OPT_Z; # groff option -Z.
-# _TMP_* temporary files
-export _TMP_DIR; # groff directory for temporary files
-export _TMP_DIR_SUB; # groffer directory for temporary files
-export _TMP_CAT; # stores concatenation of everything
-export _TMP_STDIN; # stores stdin, if any
-
-# these variables are preset in section `Preset' after the rudim. test
-
-
-########################################################################
-# Test of rudimentary shell functionality
-########################################################################
-
-
-########################################################################
-# Test of `test'.
-#
-test "a" = "a" || exit 1;
-
-
-########################################################################
-# Test of `echo' and the `$()' construct.
-#
-echo -n '' >/dev/null || exit "${_ERROR}";
-if test "$(echo -n 'te' && echo -n '' && echo -n 'st')" != "test"; then
- exit "${_ERROR}";
+export _GROFF_VERSION
+_GROFF_VERSION='@VERSION@';
+if test _@VERSION@_ = _${_AT}VERSION${_AT}_
+then
+ _GROFF_VERSION='1.19.2';
fi;
-
-########################################################################
-# Test of function definitions.
-#
-_t_e_s_t_f_u_n_c_()
-{
- return "${_OK}";
-}
-
-if _t_e_s_t_f_u_n_c_ 2>/dev/null; then
- :
+export _AT_BINDIR_AT;
+export _AT_G_AT;
+export _AT_LIBDIR_AT;
+export _GROFFER_LIBDIR;
+if test _@BINDIR@_ = _${_AT}BINDIR${_AT}_
+then
+ # script before `make'
+ _AT_BINDIR_AT='.';
+ _AT_G_AT='';
+ _AT_LIBDIR_AT='';
+ _GROFFER_LIBDIR='.';
else
- echo 'shell does not support function definitions.' >&2;
- exit "${_ERROR}";
+ _AT_BINDIR_AT='@BINDIR@';
+ _AT_G_AT='@g@';
+ _AT_LIBDIR_AT='@libdir@';
+ _GROFFER_LIBDIR="${_AT_LIBDIR_AT}"'/groff/groffer';
fi;
-
-########################################################################
-# Preset and reset of read-write global variables
-########################################################################
-
-
-# For variables that can be reset by option `--default', see reset().
-
-_FILEARGS='';
-
-# _HAS_* from availability tests
-_HAS_COMPRESSION='';
-_HAS_OPTS_GNU='';
-_HAS_OPTS_POSIX='';
-
-# _TMP_* temporary files
-_TMP_DIR='';
-_TMP_DIR_SUB='';
-_TMP_CAT='';
-_TMP_STDIN='';
-
-
-########################################################################
-# reset ()
-#
-# Reset the variables that can be affected by options to their default.
-#
-reset()
-{
- if test "$#" -ne 0; then
- error "reset() does not have arguments.";
- fi;
-
- _ADDOPTS_GROFF='';
- _ADDOPTS_POST='';
- _ADDOPTS_X='';
- _DISPLAY_ARGS='';
- _DISPLAY_MODE='';
- _DISPLAY_PROG='';
- _REGISTERED_TITLE='';
-
- # _MAN_* finally used configuration of man searching
- _MAN_ALL='no';
- _MAN_ENABLE='yes'; # do search for man-pages
- _MAN_EXT='';
- _MAN_FORCE='no'; # first local file, then search man page
- _MAN_IS_SETUP='no';
- _MAN_LANG='';
- _MAN_LANG_DONE='no';
- _MAN_PATH='';
- _MAN_SEC='';
- _MAN_SEC_DONE='no';
- _MAN_SYS='';
- _MAN_SYS_DONE='no';
-
- # _MANOPT_* as parsed from $MANOPT
- _MANOPT_ALL='no';
- _MANOPT_EXTENSION='';
- _MANOPT_LANG='';
- _MANOPT_PATH='';
- _MANOPT_PAGER='';
- _MANOPT_SEC='';
- _MANOPT_SYS='';
-
- # _OPT_* as parsed from groffer command line
- _OPT_ALL='no';
- _OPT_APROPOS='no';
- _OPT_BD='';
- _OPT_BG='';
- _OPT_BW='';
- _OPT_DEBUG='no';
- _OPT_DEFAULT_MODES='';
- _OPT_DEVICE='';
- _OPT_DISPLAY='';
- _OPT_FG='';
- _OPT_FN='';
- _OPT_GEOMETRY='';
- _OPT_LANG='';
- _OPT_LOCATION='no';
- _OPT_MODE='';
- _OPT_MANPATH='';
- _OPT_PAGER='';
- _OPT_RESOLUTION='';
- _OPT_RV='';
- _OPT_SECTIONS='';
- _OPT_SYSTEMS='';
- _OPT_TITLE='';
- _OPT_TTY_DEVICE='';
- _OPT_V='no';
- _OPT_VIEWER_DVI='';
- _OPT_VIEWER_PDF='';
- _OPT_VIEWER_PS='';
- _OPT_VIEWER_WWW='';
- _OPT_VIEWER_X='';
- _OPT_WHATIS='no';
- _OPT_X='no';
- _OPT_XRM='';
- _OPT_Z='no';
-
-}
-
-reset;
-
-
-########################################################################
-# Functions for error handling and debugging
-########################################################################
-
-
-##############
-# landmark (<text>)
-#
-# Print <text> to standard error as a debugging aid.
-#
-# Globals: $_DEBUG_LM
-#
-landmark()
-{
- if test "${_DEBUG_LM}" = 'yes'; then
- echo ">>> $*" >&2;
- fi;
-}
-
-landmark "1: debugging functions";
-
-
-##############
-# clean_up ()
-#
-# Clean up at exit.
-#
-clean_up()
-{
- if test -d "${_TMP_DIR}"; then
- rm -f "${_TMP_DIR}"/*;
- rmdir "${_TMP_DIR}";
- fi;
-}
-
-
-##############
-# echo2 (<text>*)
-#
-# Output to stderr.
-#
-# Arguments : arbitrary text.
-#
-echo2()
-{
- echo "$*" >&2;
-}
-
-
-##############
-# echo2n (<text>*)
-#
-# Output to stderr.
-#
-# Arguments : arbitrary text.
-#
-echo2n()
-{
- echo -n "$*" >&2;
-}
-
-
-#############
-# diag (text>*)
-#
-# Output a diagnostic message to stderr
-#
-diag()
-{
- echo2 '>>>>>'"$*";
-}
-
-
-#############
-# error (<text>*)
-#
-# Print an error message to standard error; exit with an error condition
-#
-error()
-{
- local i;
- local _code;
- _code="${_ERROR}";
- case "$#" in
- 0) true; ;;
- 1) echo2 'groffer error: '"$1"; ;;
- 2)
- echo2 'groffer error: '"$1";
- _code="$2";
- ;;
- *) echo2 'groffer error: wrong number of arguments in error().'; ;;
- esac;
- if test "${_DEBUG}" = 'yes'; then
- func_stack_dump;
- fi;
- clean_up;
- kill "${_PROCESS_ID}" >/dev/null 2>&1;
- kill -9 "${_PROCESS_ID}" >/dev/null 2>&1;
- exit "${_code}";
-}
-
-
-#############
-# abort (<text>*)
-#
-# Terminate program with error condition
-#
-abort()
-{
- error "Program aborted.";
+export _GROFFER_SH; # file name of this shell script
+case "$0" in
+*groffer*)
+ _GROFFER_SH="$0";
+ # was: _GROFFER_SH="${_AT_BINDIR_AT}/groffer";
+ ;;
+*)
+ echo 'The groffer script should be started directly.' >&2
exit 1;
-}
-
-
-#############
-# func_check (<func_name> <rel_op> <nr_args> "$@")
-#
-# Check number of arguments and register to _FUNC_STACK.
-#
-# Arguments: >=3
-# <func_name>: name of the calling function.
-# <rel_op>: a relational operator: = != < > <= >=
-# <nr_args>: number of arguments to be checked against <operator>
-# "$@": the arguments of the calling function.
-#
-func_check()
-{
- local _comp;
- local _fname;
- local _nargs;
- local _op;
- local _s;
- if test "$#" -lt 3; then
- error 'func_check() needs at least 3 arguments.';
- fi;
- _fname="$1";
- case "$3" in
- 1)
- _nargs="$3";
- _s='';
- ;;
- 0|[2-9])
- _nargs="$3";
- _s='s';
- ;;
- *)
- error "func_check(): third argument must be a digit.";
- ;;
- esac;
- case "$2" in
- '='|'-eq')
- _op='-eq';
- _comp='exactly';
- ;;
- '>='|'-ge')
- _op='-ge';
- _comp='at least';
- ;;
- '<='|'-le')
- _op='-le';
- _comp='at most';
- ;;
- '<'|'-lt')
- _op='-lt';
- _comp='less than';
- ;;
- '>'|'-gt')
- _op='-gt';
- _comp='more than';
- ;;
- '!='|'-ne')
- _op='-ne';
- _comp='not';
- ;;
- *)
- error \
- 'func_check(): second argument is not a relational operator.';
- ;;
- esac;
- shift 3;
- if test "$#" "${_op}" "${_nargs}"; then
- do_nothing;
- else
- error \
- "${_fname}"'() needs '"${_comp} ${_nargs}"' argument'"${_s}"'.';
- fi;
- if test "${_DEBUG}" = 'yes'; then
- func_push "${_fname} $*";
- fi;
-}
-
-
-#############
-# func_pop ()
-#
-# Retrieve the top element from the stack.
-#
-# The stack elements are separated by `!'; the popped element is
-# identical to the original element, except that all `!' characters
-# were removed.
-#
-# Arguments: 1
-#
-func_pop()
-{
- if test "${_DEBUG}" = 'yes'; then
- if test "$#" -ne 0; then
- error 'func_pop() does not have arguments.';
- fi;
- case "${_FUNC_STACK}" in
- '')
- error 'func_pop(): stack is empty.';
- ;;
- *!*)
- # split at first bang `!'.
- _FUNC_STACK="$(echo -n ${_FUNC_STACK} \
- | sed -e 's/^[^!]*!//')";
- ;;
- *)
- _FUNC_STACK='';
- ;;
- esac;
- fi;
-}
-
-
-#############
-# func_push (<element>)
-#
-# Store another element to stack.
-#
-# The stack elements are separated by `!'; if <element> contains a `!'
-# it is removed first.
-#
-# Arguments: 1
-#
-func_push()
-{
- local _element;
- if test "${_DEBUG}" = 'yes'; then
- if test "$#" -ne 1; then
- error 'func_push() needs 1 argument.';
- fi;
- case "$1" in
- *'!'*)
- # remove all bangs `!'.
- _element="$(echo -n "$1" | sed -e 's/!//g')";
- ;;
- *)
- _element="$1";
- ;;
- esac;
- if test "${_FUNC_STACK}" = ''; then
- _FUNC_STACK="${_element}";
- else
- _FUNC_STACK="${_element}!${_FUNC_STACK}";
- fi;
- fi;
-}
-
-
-#############
-# func_stack_dump ()
-#
-# Print the content of the stack. Ignore the arguments.
-#
-func_stack_dump()
-{
- diag 'call stack:';
- case "${_FUNC_STACK}" in
- *!*)
- _rest="${_FUNC_STACK}";
- while test "${_rest}" != ''; do
- # get part before the first bang `!'.
- diag "$(echo -n "${_rest}" | sed -e 's/!.*$//')";
- # delete part before and including the first bang `!'.
- _rest="$(echo -n "${_rest}" | sed -e 's/^[^!]*!//')";
- done;
- ;;
- *)
- diag "${_FUNC_STACK}";
- ;;
- esac;
-}
-
-
-########################################################################
-# System Test
-########################################################################
-
-landmark "2: system test";
-
-# Test the availability of the system utilities used in this script.
-
-
-########################################################################
-# Test of `true'.
-#
-if true >/dev/null 2>&1; then
- true;
-else
- true()
- {
- return "${_GOOD}";
- }
-
- false()
- {
- return "${_BAD}";
- }
-fi;
-
-
-########################################################################
-# Test of `unset'.
-#
-_test='test';
-if unset _test >/dev/null 2>&1 && test "${_test}" = ''; then
- true;
-else
- unset()
- {
- for v in "$@"; do
- eval "$v"='';
- done;
- }
-fi;
-unset _test;
+ ;;
+esac;
-########################################################################
-# Test of builtin `local'
-#
-
-_t_e_s_t_f_u_n_c_()
-{
- local _test >/dev/null 2>&1 || return "${_BAD}";
-}
+export _GROFFER2_SH; # file name of the script that follows up
+_GROFFER2_SH="${_GROFFER_LIBDIR}"/groffer2.sh;
-if _t_e_s_t_f_u_n_c_; then
- :
+export _NULL_DEV;
+if test -c /dev/null
+then
+ _NULL_DEV="/dev/null";
else
- local()
- {
- if test "$1" != ''; then
- error "overriding global variable \`$1' with local value.";
- fi;
- }
+ _NULL_DEV="NUL";
fi;
-########################################################################
-# Test of global setting in functions
-#
-_global='outside';
-_clobber='outside';
-
-_t_e_s_t_f_u_n_c_()
-{
- local _clobber;
- _global='inside';
- _clobber='inside';
-}
-
-_t_e_s_t_f_u_n_c_;
-if test "${_global}" != 'inside' || test "${_clobber}" != 'outside';
+# Test of the `$()' construct.
+if test _"$(echo "$(echo 'test')")"_ \
+ != _test_
then
- error "Cannot assign to global variables from within functions.";
+ echo 'The "$()" construct did not work.' >&2;
+ exit "${_ERROR}";
fi;
-unset _global;
-unset _clobber;
-
-
-########################################################################
-# Test of function `sed'.
-#
-if test "$(echo xTesTx \
- | sed -e 's/^.\([Tt]e*x*sTT*\).*$/\1/' \
- | sed -e '\|T|s||t|g')" != 'test';
+# Test of sed program
+if test _"$(echo red | sed -e 's/r/s/')"_ != _sed_
then
- error 'Test of "sed" command failed.';
-fi;
-
-
-########################################################################
-# Test of function `cat'.
-#
-if test "$(echo test | cat)" != "test"; then
- error 'Test of "cat" command failed.';
-fi;
-
-
-########################################################################
-# Test for compression.
-#
-if test "$(echo 'test' | gzip -c -d -f - 2>/dev/null)" = 'test'; then
- _HAS_COMPRESSION='yes';
- if echo 'test' | bzip2 -c 2>/dev/null | bzip2 -t 2>/dev/null \
- && test "$(echo 'test' | bzip2 -c 2>/dev/null \
- | bzip2 -d -c 2>/dev/null)" \
- = 'test'; then
- _HAS_BZIP='yes';
- else
- _HAS_BZIP='no';
- fi;
-else
- _HAS_COMPRESSION='no';
- _HAS_BZIP='no';
-fi;
-
-
-########################################################################
-_t_e_s_t_f_u_n_c_()
-{
- :
-}
-
-
-########################################################################
-# Definition of normal Functions
-########################################################################
-landmark "3: functions";
-
-########################################################################
-# abort (<text>*)
-#
-# Unconditionally terminate the program with error code;
-# useful for debugging.
-#
-# defined above
-
-
-########################################################################
-# base_name (<path>)
-#
-# Get the file name part of <path>, i.e. delete everything up to last
-# `/' from the beginning of <path>.
-#
-# Arguments : 1
-# Output : the file name part (without slashes)
-#
-base_name()
-{
- func_check base_name = 1 "$@";
- case "$1" in
- */)
- do_nothing;
- ;;
- */*)
- # delete everything before and including the last slash `/'.
- echo -n "$1" | sed -e '\|^.*//*\([^/]*\)$|s||\1|';
- ;;
- *)
- echo -n "$1";
- ;;
- esac;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# catz (<file>)
-#
-# Decompress if possible or just print <file> to standard output.
-#
-# gzip, bzip2, and .Z decompression is supported.
-#
-# Arguments: 1, a file name.
-# Output: the content of <file>, possibly decompressed.
-#
-if test "${_HAS_COMPRESSION}" = 'yes'; then
- catz()
- {
- func_check catz = 1 "$@";
- case "$1" in
- '')
- error 'catz(): empty file name';
- ;;
- '-')
- error 'catz(): for standard input use save_stdin()';
- ;;
- esac;
- if is_yes "${_HAS_BZIP}"; then
- if bzip2 -t "$1" 2>/dev/null; then
- bzip2 -c -d "$1" 2>/dev/null;
- eval "${return_ok}";
- fi;
- fi;
- gzip -c -d -f "$1" 2>/dev/null;
- eval "${return_ok}";
- }
-else
- catz()
- {
- func_check catz = 1 "$@";
- cat "$1";
- eval "${return_ok}";
- }
+ echo 'The sed program did not work.' >&2;
+ exit "${_ERROR}";
fi;
-########################################################################
-# clean_up ()
-#
-# Do the final cleaning up before exiting; used by the trap calls.
-#
-# defined above
-
-
-########################################################################
-# diag (<text>*)
-#
-# Print marked message to standard error; useful for debugging.
-#
-# defined above
-
-
-########################################################################
-landmark '4: dirname()*';
-########################################################################
-
-#######################################################################
-# dirname_append (<dir> <name>)
-#
-# Append `name' to `dir' with clean handling of `/'.
-#
-# Arguments : 2
-# Output : the generated new directory name <dir>/<name>
-#
-dirname_append()
-{
- func_check dirname_append = 2 "$@";
- local _res;
- if is_empty "$1"; then
- error "dir_append(): first argument is empty.";
- fi;
- if is_empty "$2"; then
- echo -n "$1";
- else
- dirname_chop "$1"/"$2";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# dirname_chop (<name>)
-#
-# Remove unnecessary slashes from directory name.
-#
-# Argument: 1, a directory name.
-# Output: path without double, or trailing slashes.
-#
-dirname_chop()
-{
- func_check dirname_chop = 1 "$@";
- local _arg;
- local _res;
- local _sep;
- # replace all multiple slashes by a single slash `/'.
- _res="$(echo -n "$1" | sed -e '\|///*|s||/|g')";
- case "${_res}" in
- ?*/)
- # remove trailing slash '/';
- echo -n "${_res}" | sed -e '\|/$|s|||';
- ;;
- *) echo -n "${_res}"; ;;
- esac;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# do_filearg (<filearg>)
-#
-# Append the file, man-page, or standard input corresponding to the
-# argument to the temporary file. If this is compressed in the gzip
-# or Z format it is decompressed. A title element is generated.
-#
-# Argument either:
-# - name of an existing files.
-# - `-' to represent standard input (several times allowed).
-# - `man:name.(section)' the man-page for `name' in `section'.
-# - `man:name.section' the man-page for `name' in `section'.
-# - `man:name' the man-page for `name' in the lowest `section'.
-# - `name.section' the man-page for `name' in `section'.
-# - `name' the man-page for `name' in the lowest `section'.
-# Globals :
-# $_TMP_STDIN, $_MAN_ENABLE, $_MAN_IS_SETUP, $_OPT_MAN
-#
-# Output : none
-# Return : $_GOOD if found, ${_BAD} otherwise.
-#
-do_filearg()
-{
- func_check do_filearg = 1 "$@";
- local _filespec;
- local i;
- _filespec="$1";
- # store sequence into positional parameters
- case "${_filespec}" in
- '')
- eval "${return_good}";
- ;;
- '-')
- register_file '-';
- eval "${return_good}";
- ;;
- */*) # with directory part; so no man search
- set -- 'File';
- ;;
- *)
- if is_yes "${_MAN_ENABLE}"; then
- if is_yes "${_MAN_FORCE}"; then
- set -- 'Manpage' 'File';
- else
- set -- 'File' 'Manpage';
- fi;
+########################### configuration
+
+# read and transform the configuration files, execute the arising commands
+for f in "${_CONF_FILE_HOME}" "${_CONF_FILE_ETC}"
+do
+ if test -f "$f"
+ then
+ o=""; # $o means groffer option
+ # use "" quotes because of ksh and posh
+ eval "$(cat "$f" | sed -n -e '
+# Ignore comments
+/^['"${_SP}${_TAB}"']*#/d
+# Delete leading and final space
+s/^['"${_SP}${_TAB}"']*//
+s/['"${_SP}${_TAB}"']*$//
+# Print all shell commands
+/^[^-]/p
+# Replace empty arguments
+s/^\(-[^ ]*\)=$/o="${o} \1 '"${_SQ}${_SQ}"'"/p
+# Replace division between option and argument by single space
+s/[='"${_SP}${_TAB}"']['"${_SP}${_TAB}"']*/'"${_SP}"'/
+# Handle lines without spaces
+s/^\(-[^'"${_SP}"']*\)$/o="${o} \1"/p
+# Print options that have their argument encircled with single quotes
+/^-[^ ]* '"${_SQ}"'.*'"${_SQ}"'$/s/^.*$/o="${o} &"/p
+# Replace encircled double quotes by single quotes and print the result
+s/^\(-[^ ]*\) "\(.*\)"$/o="${o} \1 '"${_SQ}"'\2'"${_SQ}"'"/p
+# Encircle the remaining arguments with single quotes
+s/^\(-[^ ]*\) \(.*\)$/o="${o} \1 '"${_SQ}"'\2'"${_SQ}"'"/p
+')"
+ if test _"${o}"_ != __
+ then
+ if test _"{GROFFER_OPT}"_ = __
+ then
+ GROFFER_OPT="${o}";
else
- set -- 'File';
+ GROFFER_OPT="${o} ${GROFFER_OPT}";
fi;
- ;;
- esac;
- for i in "$@"; do
- case "$i" in
- File)
- if test -f "${_filespec}"; then
- if test -r "${_filespec}"; then
- register_file "${_filespec}";
- eval "${return_good}";
- else
- echo2 "could not read \`${_filespec}'";
- eval "${return_bad}";
- fi;
- else
- continue;
- fi;
- ;;
- Manpage) # parse filespec as man page
- if is_not_yes "${_MAN_IS_SETUP}"; then
- man_setup;
- fi;
- if man_do_filespec "${_filespec}"; then
- eval "${return_good}";
- else
- continue;
- fi;
- ;;
- esac;
- done;
- eval "${return_bad}";
-} # do_filearg()
-
-
-########################################################################
-# do_nothing ()
-#
-# Dummy function.
-#
-do_nothing()
-{
- return "${_OK}";
-}
-
-
-########################################################################
-# echo2 (<text>*)
-#
-# Print to standard error with final line break.
-#
-# defined above
-
-
-########################################################################
-# echo2n (<text>*)
-#
-# Print to standard error without final line break.
-#
-# defined above
-
-
-########################################################################
-# error (<text>*)
-#
-# Print error message and exit with error code.
-#
-# defined above
-
-
-########################################################################
-# func_check (<func_name> <rel_op> <nr_args> "$@")
-#
-# Check number of arguments and register to _FUNC_STACK.
-#
-# Arguments: >=3
-# <func_name>: name of the calling function.
-# <rel_op>: a relational operator: = != < > <= >=
-# <nr_args>: number of arguments to be checked against <operator>
-# "$@": the arguments of the calling function.
-#
-# defined above
-
-#########################################################################
-# func_pop ()
-#
-# Delete the top element from the function call stack.
-#
-# defined above
-
-
-########################################################################
-# func_push (<element>)
-#
-# Store another element to function call stack.
-#
-# defined above
-
-
-########################################################################
-# func_stack_dump ()
-#
-# Print the content of the stack.
-#
-# defined above
-
-
-########################################################################
-# get_first_essential (<arg>*)
-#
-# Retrieve first non-empty argument.
-#
-# Return : `1' if all arguments are empty, `0' if found.
-# Output : the retrieved non-empty argument.
-#
-get_first_essential()
-{
- func_check get_first_essential '>=' 0 "$@";
- local i;
- if test "$#" -eq 0; then
- eval "${return_ok}";
- fi;
- for i in "$@"; do
- if is_not_empty "$i"; then
- echo -n "$i";
- eval "${return_ok}";
fi;
- done;
- eval "${return_bad}";
-}
-
-
-########################################################################
-landmark '5: is_*()';
-########################################################################
-
-########################################################################
-# is_dir (<name>)
-#
-# Test whether `name' is a directory.
-#
-# Arguments : 1
-# Return : `0' if arg1 is a directory, `1' otherwise.
-#
-is_dir()
-{
- func_check is_dir = 1 "$@";
- if is_not_empty "$1" && test -d "$1" && test -r "$1"; then
- eval "${return_yes}";
- else
- eval "${return_no}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# is_empty (<string>)
-#
-# Test whether `string' is empty.
-#
-# Arguments : <=1
-# Return : `0' if arg1 is empty or does not exist, `1' otherwise.
-#
-is_empty()
-{
- func_check is_empty = 1 "$@";
- if test -z "$1"; then
- eval "${return_yes}";
- else
- eval "${return_no}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# is_equal (<string1> <string2>)
-#
-# Test whether `string1' is equal to <string2>.
-#
-# Arguments : 2
-# Return : `0' both arguments are equal strings, `1' otherwise.
-#
-is_equal()
-{
- func_check is_equal = 2 "$@";
- if test "$1" = "$2"; then
- eval "${return_yes}";
- else
- eval "${return_no}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# is_file (<name>)
-#
-# Test whether `name' is a readable file.
-#
-# Arguments : 1
-# Return : `0' if arg1 is a readable file, `1' otherwise.
-#
-is_file()
-{
- func_check is_file = 1 "$@";
- if is_not_empty "$1" && test -f "$1" && test -r "$1"; then
- eval "${return_yes}";
- else
- eval "${return_no}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# is_not_dir (<name>)
-#
-# Test whether `name' is not a readable directory.
-#
-# Arguments : 1
-# Return : `0' if arg1 is a directory, `1' otherwise.
-#
-is_not_dir()
-{
- func_check is_not_dir = 1 "$@";
- if is_dir "$1"; then
- eval "${return_no}";
- else
- eval "${return_yes}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# is_not_empty (<string>)
-#
-# Test whether `string' is not empty.
-#
-# Arguments : <=1
-# Return : `0' if arg1 exists and is not empty, `1' otherwise.
-#
-is_not_empty()
-{
- func_check is_not_empty = 1 "$@";
- if is_empty "$1"; then
- eval "${return_no}";
- else
- eval "${return_yes}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# is_not_equal (<string1> <string2>)
-#
-# Test whether `string1' and <string2> differ.
-#
-# Arguments : 2
-#
-is_not_equal()
-{
- func_check is_not_equal = 2 "$@";
- if is_equal "$1" "$2"; then
- eval "${return_no}";
- else
- eval "${return_yes}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# is_not_file (<filename>)
-#
-# Test whether `name' is a not readable file.
-#
-# Arguments : >=1 (empty allowed), more args are ignored
-#
-is_not_file()
-{
- func_check is_not_file '>=' 1 "$@";
- if is_file "$1"; then
- eval "${return_no}";
- else
- eval "${return_yes}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# is_not_prog (<name>)
-#
-# Verify that arg is a not program in $PATH.
-#
-# Arguments : >=1 (empty allowed)
-# more args are ignored, this allows to specify progs with arguments
-#
-is_not_prog()
-{
- func_check is_not_prog '>=' 1 "$@";
- if where "$1" >/dev/null; then
- eval "${return_no}";
- else
- eval "${return_yes}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# is_not_yes (<string>)
-#
-# Test whether `string' is not "yes".
-#
-# Arguments : 1
-#
-is_not_yes()
-{
- func_check is_not_yes = 1 "$@";
- if test "$1" = 'yes'; then
- eval "${return_no}";
- else
- eval "${return_yes}";
fi;
- eval "${return_ok}";
-}
+done;
-
-########################################################################
-# is_prog (<name>)
-#
-# Determine whether arg is a program in $PATH
-#
-# Arguments : >=1 (empty allowed)
-# more args are ignored, this allows to specify progs with arguments
-#
-is_prog()
-{
- func_check is_prog '>=' 1 "$@";
- if where "$1" >/dev/null; then
- eval "${return_yes}";
- else
- eval "${return_no}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# is_yes (<string>)
-#
-# Test whether `string' has value "yes".
-#
-# Arguments : <=1
-# Return : `0' if arg1 is `yes', `1' otherwise.
-#
-is_yes()
-{
- func_check is_yes = 1 "$@";
- if test "$1" = 'yes'; then
- eval "${return_yes}";
- else
- eval "${return_no}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# landmark ()
-#
-# Print debugging information on standard error if $_DEBUG_LM is `yes'.
-#
-# Globals: $_DEBUG_LM
-#
-# Defined in section `Debugging functions'.
-
-
-########################################################################
-# leave ()
-#
-# Clean exit without an error.
-#
-leave()
-{
- clean_up;
- exit "${_OK}";
-}
-
-
-########################################################################
-landmark '6: list_*()';
-########################################################################
-
-########################################################################
-# list_append (<list> <element>...)
-#
-# Arguments: >=2
-# <list>: a space-separated list of single-quoted elements.
-# <element>: some sequence of characters.
-# Output:
-# if <list> is empty: "'<element>' '...'"
-# otherwise: "<list> '<element>' ..."
-#
-list_append()
-{
- func_check list_append '>=' 2 "$@";
- local _element;
- local _res;
- _res="$1";
+# integrate $GROFFER_OPT into the command line; it isn't needed any more
+if test _"${GROFFER_OPT}"_ != __
+then
+ eval set x "${GROFFER_OPT}" '"$@"';
shift;
- for s in "$@"; do
- case "$s" in
- *\'*)
- # escape each single quote by replacing each "'" (squote)
- # by "'\''" (squote bslash squote squote);
- # note that the backslash must be doubled for `sed'.
- _element="$(echo -n "$s" | sed -e 's/'"${_SQUOTE}"'/&\\&&/g')";
- ;;
- *)
- _element="$s";
- ;;
- esac;
- _res="${_res} '${_element}'";
- done;
- echo -n "${_res}";
- eval "${return_ok}";
-}
-
-
-########################################################################
-# list_check (<list>)
-#
-# Check whether <list> is a space-separated list of '-quoted elements.
-#
-# If the test fails an error is raised.
-# If the test succeeds the argument is echoed.
-#
-# Testing criteria:
-# A list has the form "'first' 'second' '...' 'last'".
-# So it has a leading and a final quote and the elements are separated
-# by "' '" constructs. If these are all removed there should not be
-# any single-quotes left. Watch out for escaped single quotes; they
-# have the form '\'' (sq bs sq sq).
-#
-# Arguments: 1
-# Output: the argument <list> unchanged, it the check succeeded.
-#
-list_check()
-{
- func_check list_check = 1 "$@";
- local _list;
- if is_empty "$1"; then
- eval "${return_ok}";
- fi;
- case "$1" in
- \'*\') _list="$1"; ;;
- *)
- error "list_check() bad list: $1"
- ;;
- esac;
- # Remove leading single quote,
- # remove final single quote,
- # remove escaped single quotes (squote bslash squote squote)
- # [note that `sed' doubles the backslash (bslash bslash)],
- # remove field separators (squote space squote).
- _list="$(echo -n "${_list}" \
- | sed -e 's/^'"${_SQUOTE}"'//' \
- | sed -e 's/'"${_SQUOTE}"'$//' \
- | sed -e \
- 's/'"${_SQUOTE}${_BSLASH}${_BSLASH}${_SQUOTE}${_SQUOTE}"'//g' \
- | sed -e 's/'"${_SQUOTE}${_SPACE}${_SPACE}"'*'"${_SQUOTE}"'//g')";
- case "${_list}" in
- *\'*) # criterium fails if squote is left
- error 'list_check() bad list: '"${_list}";
- ;;
- esac;
- echo -n "$1";
- eval "${return_ok}";
-}
-
-
-########################################################################
-# list_element_from_arg (<arg>)
-#
-# Arguments: 1
-# <arg>: some sequence of characters (also single quotes allowed).
-# Output: the list element generated from <arg>.
-#
-list_element_from_arg()
-{
- func_check list_element_from_arg = 1 "$@";
- local _res;
- echo -n "'";
- # replace each single quote "'" by "'\''".
- echo -n "$1" | sed -e 's/'\''/&\\&&/g'; # ' for emacs
- echo -n "'";
- eval "${return_ok}";
-}
-
-
-########################################################################
-# list_from_args (<arg>...)
-#
-# Generate a space-separated list of single-quoted elements from args.
-#
-# Arguments:
-# <arg>: some sequence of characters.
-# Output: "'<arg>' '...'"
-#
-list_from_args()
-{
- func_check list_from_args '>=' 1 "$@";
- local _list;
- _list="";
- for s in "$@"; do
- _list="$(list_append "${_list}" "$s")";
- done;
- echo -n "${_list}";
- eval "${return_ok}";
-}
+ GROFFER_OPT='';
+fi;
-########################################################################
-# list_from_cmdline (<s_n> <s_a> <l_n> <l_a> [<cmdline_arg>...])
-#
-# Transform command line arguments into a normalized form.
-#
-# Options, option arguments, and file parameters are identified and
-# output each as a single-quoted argument of its own. Options and
-# file parameters are separated by a '--' argument.
-#
-# Arguments: >=4
-# <s_n>: space-separated list of short options without an arg.
-# <s_a>: space-separated list of short options that have an arg.
-# <l_n>: space-separated list of long options without an arg.
-# <l_a>: space-separated list of long options that have an arg.
-# <cmdline_arg>...: the arguments from the command line (by "$@").
-#
-# Globals: $POSIXLY_CORRECT (only kept for compatibility).
-#
-# Output: ['-[-]opt' ['optarg']]... '--' ['filename']...
-#
-# Example:
-# list_normalize 'a b' 'c' '' 'long' -a f1 -bcarg --long=larg f2
-# will result in printing:
-# '-a' '-b' '-c' 'arg' '--long' 'larg' '--' 'f1' 'f2'
-# If $POSIXLY_CORRECT is not empty, the result will be:
-# '-a' '--' 'f1' '-bcarg' '--long=larg' 'f2'
-#
-# Rationale:
-# In POSIX, the first non-option ends the option processing.
-# In GNU mode (default), non-options are sorted behind the options.
-#
-# Use this function only in the following way:
-# eval set -- "$(args_norm '...' '...' '...' '...' "$@")";
-# while test "$1" != '--'; do
-# case "$1" in
-# ...
-# esac;
-# shift;
-# done;
-# shift; #skip '--'
-# # all positional parameters ("$@") left are file name parameters.
-#
-list_from_cmdline()
-{
- func_check list_from_cmdline '>=' 4 "$@";
- local _fparams;
- local _fn;
- local _result;
- local _long_a;
- local _long_n;
- local _short_a;
- local _short_n;
- _short_n="$(list_check "$1")"; # short options, no argument
- _short_a="$(list_check "$2")"; # short options with argument
- _long_n="$(list_check "$3")"; # long options, no argument
- _long_a="$(list_check "$4")"; # long options with argument
- shift 4;
- _fn='list_from_cmdline():'; # for error messages
- if test "$#" -eq 0; then
- echo -n "'--'";
- eval "${return_ok}";
- fi;
- _fparams='';
- _result='';
- while test "$#" -ge 1; do
- _arg="$1";
- shift;
- case "$_arg" in
- --) break; ;;
- --?*)
- # delete leading '--';
- _opt="$(echo -n "${_arg}" | sed -e 's/^..//')";
- if list_has "${_long_n}" "${_opt}"; then
- # long option, no argument
- _result="$(list_append "${_result}" "--${_opt}")";
- continue;
- fi;
- if list_has "${_long_a}" "${_opt}"; then
- # long option with argument
- _result="$(list_append "${_result}" "--${_opt}")";
- if test "$#" -le 0; then
- error "${_fn} no argument for option --${_opt}."
- fi;
- _result="$(list_append "${_result}" "$1")";
+########################### Determine the shell
+
+export _SHELL;
+
+# use "``" instead of "$()" for using the case ")" construct
+# do not use "" quotes because of ksh
+_SHELL=`
+ # $x means list.
+ # $s means shell.
+ # The command line arguments are taken over.
+ # Shifting herein does not have an effect outside.
+ export x;
+ case " $*" in
+ *\ --sh*) # abbreviation for --shell
+ x='';
+ s='';
+ # determine all --shell arguments, store them in $x in reverse order
+ while test $# != 0
+ do
+ case "$1" in
+ --shell|--sh|--she|--shel)
+ if test "$#" -ge 2
+ then
+ s="$2";
shift;
- continue;
fi;
- # test on `--opt=arg'
- if string_contains "${_opt}" '='; then
- # extract option by deleting from the first '=' to the end
- _lopt="$(echo -n "${_opt}" | sed -e 's/=.*$//')";
- if list_has "${_long_a}" "${_lopt}"; then
- # get the option argument by deleting up to first `='
- _optarg="$(echo -n "${_opt}" | sed -e 's/^[^=]*=//')";
- _result="$(list_append "${_result}" \
- "--${_lopt}" "${_optarg}")";
- continue;
- fi;
- fi;
- error "${_fn} --${_opt} is not an option."
;;
- -?*) # short option (cluster)
- # delete leading `-';
- _rest="$(echo -n "${_arg}" | sed -e 's/^.//')";
- while is_not_empty "${_rest}"; do
- # get next short option from cluster (first char of $_rest)
- _optchar="$(echo -n "${_rest}" | sed -e 's/^\(.\).*$/\1/')";
- # remove first character from ${_rest};
- _rest="$(echo -n "${_rest}" | sed -e 's/^.//')";
- if list_has "${_short_n}" "${_optchar}"; then
- _result="$(list_append "${_result}" "-${_optchar}")";
- continue;
- elif list_has "${_short_a}" "${_optchar}"; then
- # remove leading character
- case "${_optchar}" in
- /)
- _rest="$(echo -n "${_rest}" | sed -e '\|^.|s|||')";
- ;;
- ?)
- _rest="$(echo -n "${_rest}" | sed -e 's/^.//')";
- ;;
- ??*)
- error "${_fn} several chars parsed for short option."
- ;;
- esac;
- if is_empty "${_rest}"; then
- if test "$#" -ge 1; then
- _result="$(list_append "${_result}" \
- "-${_optchar}" "$1")";
- shift;
- continue;
- else
- error \
- "${_fn}"' no argument for option -'"${_optchar}."
- fi;
- else # rest is the argument
- _result="$(list_append "${_result}" \
- "-${_optchar}" "${_rest}")";
- _rest='';
- continue;
- fi;
- else
- error "${_fn} unknown option -${_optchar}."
- fi;
- done;
+ --shell=*|--sh=*|--she=*|--shel=*)
+ # delete up to first "=" character
+ s="$(echo x"$1" | sed -e 's/^x[^=]*=//')";
;;
*)
- # Here, $_arg is not an option, so a file parameter.
- # When $POSIXLY_CORRECT is set this ends option parsing;
- # otherwise, the argument is stored as a file parameter and
- # option processing is continued.
- _fparams="$(list_append "${_fparams}" "${_arg}")";
- if is_not_empty "$POSIXLY_CORRECT"; then
- break;
- fi;
- ;;
- esac;
- done;
- _result="$(list_append "${_result}" '--')";
- if is_not_empty "${_fparams}"; then
- _result="${_result} ${_fparams}";
- fi;
- if test "$#" -gt 0; then
- _result="$(list_append "${_result}" "$@")";
- fi;
- echo -n "$_result";
- eval "${return_ok}";
-} # list_from_cmdline()
-
-
-########################################################################
-# list_from_lists (<list1> <list2>...)
-#
-# Generate a list from the concatenation of the lists in the arguments.
-#
-# Arguments: >=2
-# <list*>: string of space-separated single-quoted elements.
-# Output: "'<element1_of_list1>' ..."
-#
-list_from_lists()
-{
- func_check list_from_lists '>=' 2 "$@";
- _list='';
- echo -n "$*";
- eval "${return_ok}";
-}
-
-########################################################################
-# list_from_split (<string> <separator>)
-#
-# In <string> escape white space and replace each <separator> by space.
-#
-# Arguments: 2: a <string> that is to be split into parts divided by
-# <separator>
-# Output: the resulting string
-#
-list_from_split()
-{
- func_check list_from_split = 2 "$@";
- local _s;
-
- # precede each space or tab by a backslash `\' (doubled for `sed')
- _s="$(echo -n "$1" | sed -e 's/\(['"${_SPACE}${_TAB}"']\)/\\\1/g')";
-
- # replace split character of string by the list separator ` ' (space).
- case "$2" in
- /) # cannot use normal `sed' separator
- echo -n "${_s}" | sed -e '\|'"$2"'|s|| |g';
- ;;
- ?) # use normal `sed' separator
- echo -n "${_s}" | sed -e 's/'"$2"'/ /g';
- ;;
- ??*)
- error 'list_from_split(): separator must be a single character.';
- ;;
- esac;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# list_has (<list> <element>)
-#
-# Arguments: 2
-# <list>: a space-separated list of single-quoted elements.
-# <element>: some sequence of characters.
-# Output:
-# if <list> is empty: "'<element>' '...'"
-# otherwise: "<list> '<element>' ..."
-#
-list_has()
-{
- func_check list_has = 2 "$@";
- if is_empty "$1"; then
- eval "${return_no}";
- fi;
- _list="$1";
- _element="$2";
- case "$2" in
- \'*\') _element="$2"; ;;
- *) _element="'$2'"; ;;
- esac;
- if string_contains "${_list}" "${_element}"; then
- eval "${return_yes}";
- else
- eval "${return_no}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# list_has_not (<list> <element>)
-#
-# Arguments: 2
-# <list>: a space-separated list of single-quoted elements.
-# <element>: some sequence of characters.
-# Output:
-# if <list> is empty: "'<element>' '...'"
-# otherwise: "<list> '<element>' ..."
-#
-list_has_not()
-{
- func_check list_has_not = 2 "$@";
- if is_empty "$1"; then
- eval "${return_yes}";
- fi;
- _list="$1";
- _element="$2";
- case "$2" in
- \'*\') _element="$2"; ;;
- *) _element="'$2'"; ;;
- esac;
- if string_contains "${_list}" "${_element}"; then
- eval "${return_no}";
- else
- eval "${return_yes}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# list_length (<list>)
-#
-# Arguments: 1
-# <list>: a space-separated list of single-quoted elements.
-# Output: the number of elements in <list>
-#
-list_length()
-{
- func_check list_length = 1 "$@";
- eval set -- "$1";
- echo -n "$#";
- eval "${return_ok}";
-}
-
-
-########################################################################
-# list_prepend (<list> <element>...)
-#
-# Insert new <element> at the beginning of <list>
-#
-# Arguments: >=2
-# <list>: a space-separated list of single-quoted elements.
-# <element>: some sequence of characters.
-# Output:
-# if <list> is empty: "'<element>' ..."
-# otherwise: "'<element>' ... <list>"
-#
-list_prepend()
-{
- func_check list_prepend '>=' 2 "$@";
- local _res;
- _res="$1";
- shift;
- for s in "$@"; do
- # escape single quotes in list style (squote bslash squote squote).
- _element="$(echo -n "$s" | sed -e 's/'\''/&\\&&/g')";
- _res="'${_element}' ${_res}";
- done;
- echo -n "${_res}";
- eval "${return_ok}";
-}
-
-
-########################################################################
-landmark '7: man_*()';
-########################################################################
-
-########################################################################
-# man_do_filespec (<filespec>)
-#
-# Print suitable man page(s) for filespec to $_TMP_CAT.
-#
-# Arguments : 2
-# <filespec>: argument of the form `man:name.section', `man:name',
-# `man:name(section)', `name.section', `name'.
-#
-# Globals : $_OPT_ALL
-#
-# Output : none.
-# Return : `0' if man page was found, `1' else.
-#
-# Only called from do_fileargs(), checks on $MANPATH and
-# $_MAN_ENABLE are assumed.
-#
-man_do_filespec()
-{
- func_check man_do_filespec = 1 "$@";
- local _got_one;
- local _name;
- local _prevsec;
- local _res;
- local _section;
- local _spec;
- local _string;
- local s;
- if is_empty "${_MAN_PATH}"; then
- eval "${return_bad}";
- fi;
- if is_empty "$1"; then
- eval "${return_bad}";
- fi;
- _spec="$1";
- _name='';
- _section='';
- case "${_spec}" in
- */*) # not a man spec when it contains '/'
- eval "${return_bad}";
- ;;
- man:?*\(?*\)) # man:name(section)
- _name="$(echo -n "${_spec}" \
- | sed -e 's/^man:\(..*\)(\(..*\))$/\1/')";
- _section="$(echo -n "${_spec}" \
- | sed -e 's/^man:\(..*\)(\(..*\))$/\2/')";
- ;;
- man:?*.?*) # man:name.section
- _name="$(echo -n "${_spec}" \
- | sed -e 's/^man:\(..*\)\.\(..*\)$/\1/')";
- _section="$(echo -n "${_spec}" \
- | sed -e 's/^man:\(..*\)\.\(..*\)$/\2/')";
- ;;
- man:?*) # man:name
- _name="$(echo -n "${_spec}" | sed -e 's/^man://')";
- ;;
- ?*\(?*\)) # name(section)
- _name="$(echo -n "${_spec}" \
- | sed -e 's/^\(..*\)(\(..*\))$/\1/')";
- _section="$(echo -n "${_spec}" \
- | sed -e 's/^\(..*\)(\(..*\))$/\2/')";
- ;;
- ?*.?*) # name.section
- _name="$(echo -n "${_spec}" \
- | sed -e 's/^\(..*\)\.\(..*\)$/\1/')";
- _section="$(echo -n "${_spec}" \
- | sed -e 's/^\(..*\)\.\(..*\)$/\2/')";
- ;;
- ?*)
- _name="${_filespec}";
- ;;
- esac;
- if is_empty "${_name}"; then
- eval "${return_bad}";
- fi;
- _got_one='no';
- if is_empty "${_section}"; then
- eval set -- "${_MAN_AUTO_SEC}";
- for s in "$@"; do
- if man_search_section "${_name}" "$s"; then # found
- if is_yes "${_MAN_ALL}"; then
- _got_one='yes';
- else
- eval "${return_good}";
- fi;
+ shift;
+ continue;
+ esac;
+ if test _"${x}"_ = __
+ then
+ x="'${s}'";
+ else
+ x="'${s}' ${x}";
fi;
+ shift;
done;
- else
- if man_search_section "${_name}" "${_section}"; then
- eval "${return_good}";
- else
- eval "${return_bad}";
- fi;
- fi;
- if is_yes "${_MAN_ALL}" && is_yes "${_got_one}"; then
- eval "${return_good}";
- fi;
- eval "${return_bad}";
-} # man_do_filespec()
-
-########################################################################
-# man_register_file (<file> <name> [<section>])
-#
-# Write a found man page file and register the title element.
-#
-# Arguments: 1, 2, or 3; maybe empty
-# Output: none
-#
-man_register_file()
-{
- func_check man_register_file '>=' 2 "$@";
- case "$#" in
- 2|3) do_nothing; ;;
- *)
- error "man_register_file() expects 2 or 3 arguments.";
- ;;
- esac;
- if is_empty "$1"; then
- error 'man_register_file(): file name is empty';
- fi;
- to_tmp "$1";
- case "$#" in
- 2)
- register_title "man:$2";
- eval "${return_ok}";
- ;;
- 3)
- register_title "$2($3)";
- eval "${return_ok}";
- ;;
- esac;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# man_search_section (<name> <section>)
-#
-# Retrieve man pages.
-#
-# Arguments : 2
-# Globals : $_MAN_PATH, $_MAN_EXT
-# Return : 0 if found, 1 otherwise
-#
-man_search_section()
-{
- func_check man_search_section = 2 "$@";
- local _dir;
- local _ext;
- local _got_one;
- local _name;
- local _prefix
- local _section;
- local d;
- local f;
- if is_empty "${_MAN_PATH}"; then
- eval "${return_bad}";
- fi;
- if is_empty "$1"; then
- eval "${return_bad}";
- fi;
- if is_empty "$2"; then
- eval "${return_bad}";
- fi;
- _name="$1";
- _section="$2";
- eval set -- "$(path_split "${_MAN_PATH}")";
- _got_one='no';
- if is_empty "${_MAN_EXT}"; then
- for d in "$@"; do
- _dir="$(dirname_append "$d" "man${_section}")";
- if is_dir "${_dir}"; then
- _prefix="$(dirname_append "${_dir}" "${_name}.${_section}")";
- for f in $(echo -n ${_prefix}*); do
- if is_file "$f"; then
- if is_yes "${_got_one}"; then
- register_file "$f";
- elif is_yes "${_MAN_ALL}"; then
- man_register_file "$f" "${_name}";
- else
- man_register_file "$f" "${_name}" "${_section}";
- eval "${return_good}";
- fi;
- _got_one='yes';
- fi;
- done;
- fi;
- done;
- else
- _ext="${_MAN_EXT}";
- # check for directory name having trailing extension
- for d in "$@"; do
- _dir="$(dirname_append $d man${_section}${_ext})";
- if is_dir "${_dir}"; then
- _prefix="$(dirname_append "${_dir}" "${_name}.${_section}")";
- for f in ${_prefix}*; do
- if is_file "$f"; then
- if is_yes "${_got_one}"; then
- register_file "$f";
- elif is_yes "${_MAN_ALL}"; then
- man_register_file "$f" "${_name}";
- else
- man_register_file "$f" "${_name}" "${_section}";
- eval "${return_good}";
- fi;
- _got_one='yes';
- fi;
- done;
- fi;
- done;
- # check for files with extension in directories without extension
- for d in "$@"; do
- _dir="$(dirname_append "$d" "man${_section}")";
- if is_dir "${_dir}"; then
- _prefix="$(dirname_append "${_dir}" \
- "${_name}.${_section}${_ext}")";
- for f in ${_prefix}*; do
- if is_file "$f"; then
- if is_yes "${_got_one}"; then
- register_file "$f";
- elif is_yes "${_MAN_ALL}"; then
- man_register_file "$f" "${_name}";
+ # from all possible shells in $x determine the first being a shell
+ # or being empty
+ s="$(
+ # "" quotes because of posh
+ eval set x "${x}";
+ shift;
+ if test $# != 0
+ then
+ for i
+ do
+ if test _"$i"_ = __
+ then
+ # use the empty argument as the default shell
+ echo empty;
+ break;
+ else
+ # test $i on being a shell program;
+ # use this kind of quoting for posh
+ if test _"$(eval "$i -c 'echo ok'" 2>${_NULL_DEV})"_ = _ok_ >&2
+ then
+ # shell found
+ cat <<EOF
+${i}
+EOF
+ break;
else
- man_register_file "$f" "${_name}" "${_section}";
- eval "${return_good}";
+ # if not being a shell go on searching
+ continue;
fi;
- _got_one='yes';
fi;
done;
fi;
- done;
- fi;
- if is_yes "${_MAN_ALL}" && is_yes "${_got_one}"; then
- eval "${return_good}";
- fi;
- eval "${return_bad}";
-} # man_search_section()
-
-
-########################################################################
-# man_setup ()
-#
-# Setup the variables $_MAN_* needed for man page searching.
-#
-# Globals:
-# in: $_OPT_*, $_MANOPT_*, $LANG, $LC_MESSAGES, $LC_ALL,
-# $MANPATH, $MANROFFSEQ, $MANSEC, $PAGER, $SYSTEM, $MANOPT.
-# out: $_MAN_PATH, $_MAN_LANG, $_MAN_SYS, $_MAN_LANG, $_MAN_LANG2,
-# $_MAN_SEC, $_MAN_ALL
-# in/out: $_MAN_ENABLE
-#
-# The precedence for the variables related to `man' is that of GNU
-# `man', i.e.
-#
-# $LANG; overridden by
-# $LC_MESSAGES; overridden by
-# $LC_ALL; this has the same precedence as
-# $MANPATH, $MANROFFSEQ, $MANSEC, $PAGER, $SYSTEM; overridden by
-# $MANOPT; overridden by
-# the groffer command line options.
-#
-man_setup()
-{
- func_check main_man_setup = 0 "$@";
- local _lang;
-
- if is_yes "${_MAN_IS_SETUP}"; then
- eval "${return_ok}";
- fi;
- _MAN_IS_SETUP='yes';
-
- if is_not_yes "${_MAN_ENABLE}"; then
- eval "${return_ok}";
- fi;
-
- # determine basic path for man pages
- _MAN_PATH="$(get_first_essential \
- "${_OPT_MANPATH}" "${_MANOPT_PATH}" "${MANPATH}")";
- if is_empty "${_MAN_PATH}"; then
- if is_prog 'manpath'; then
- _MAN_PATH="$(manpath 2>/dev/null)"; # not always available
+ )";
+ if test _"${s}"_ != __
+ then
+ cat <<EOF
+${s}
+EOF
fi;
- fi;
- if is_empty "${_MAN_PATH}"; then
- manpath_set_from_path;
- else
- _MAN_PATH="$(path_clean "${_MAN_PATH}")";
- fi;
- if is_empty "${_MAN_PATH}"; then
- _MAN_ENABLE="no";
- eval "${return_ok}";
- fi;
-
- _MAN_ALL="$(get_first_essential "${_OPT_ALL}" "${_MANOPT_ALL}")";
- if is_empty "${_MAN_ALL}"; then
- _MAN_ALL='no';
- fi;
-
- _MAN_SYS="$(get_first_essential \
- "${_OPT_SYSTEMS}" "${_MANOPT_SYS}" "${SYSTEM}")";
- _lang="$(get_first_essential \
- "${_OPT_LANG}" "${LC_ALL}" "${LC_MESSAGES}" "${LANG}")";
- case "${_lang}" in
- C|POSIX)
- _MAN_LANG="";
- _MAN_LANG2="";
- ;;
- ?)
- _MAN_LANG="${_lang}";
- _MAN_LANG2="";
- ;;
- *)
- _MAN_LANG="${_lang}";
- # get first two characters of $_lang
- _MAN_LANG2="$(echo -n "${_lang}" | sed -e 's/^\(..\).*$/\1/')";
- ;;
+ ;;
esac;
- # from now on, use only $_LANG, forget about $_OPT_LANG, $LC_*.
-
- manpath_add_lang_sys; # this is very slow
-
- _MAN_SEC="$(get_first_essential \
- "${_OPT_SECT}" "${_MANOPT_SEC}" "${MANSEC}")";
- if is_empty "${_MAN_PATH}"; then
- _MAN_ENABLE="no";
- eval "${return_ok}";
- fi;
-
- _MAN_EXT="$(get_first_essential \
- "${_OPT_EXTENSION}" "${_MANOPT_EXTENSION}")";
- eval "${return_ok}";
-} # man_setup()
-
-
-########################################################################
-landmark '8: manpath_*()';
-########################################################################
-
-########################################################################
-# manpath_add_lang_sys ()
-#
-# Add language and operating system specific directories to man path.
-#
-# Arguments : 0
-# Output : none
-# Globals:
-# in: $_MAN_SYS: has the form `os1,os2,...', a comma separated
-# list of names of operating systems.
-# $_MAN_LANG and $_MAN_LANG2: each a single name
-# in/out: $_MAN_PATH: has the form `dir1:dir2:...', a colon
-# separated list of directories.
-#
-manpath_add_lang_sys()
-{
- func_check manpath_add_lang_sys = 0 "$@";
- local p;
- local _mp;
- if is_empty "${_MAN_PATH}"; then
- eval "${return_ok}";
- fi;
- # twice test both sys and lang
- eval set -- "$(path_split "${_MAN_PATH}")";
- _mp='';
- for p in "$@"; do # loop on man path directories
- _mp="$(_manpath_add_lang_sys_single "${_mp}" "$p")";
- done;
- eval set -- "$(path_split "${_mp}")";
- for p in "$@"; do # loop on man path directories
- _mp="$(_manpath_add_lang_sys_single "${_mp}" "$p")";
- done;
- _MAN_PATH="$(path_chop "${_mp}")";
- eval "${return_ok}";
-}
-
-
-_manpath_add_lang_sys_single()
-{
- # To the directory in $1 append existing sys/lang subdirectories
- # Function is necessary to split the OS list.
- #
- # globals: in: $_MAN_SYS, $_MAN_LANG, $_MAN_LANG2
- # argument: 2: `man_path' and `dir'
- # output: colon-separated path of the retrieved subdirectories
- #
- local d;
-# if test "$#" -ne 2; then
-# error "manpath_add_system_single() needs 2 arguments.";
-# fi;
- _res="$1";
- _parent="$2";
- eval set -- "$(list_from_split "${_MAN_SYS}" ',')";
- for d in "$@" "${_MAN_LANG}" "${_MAN_LANG2}"; do
- _dir="$(dirname_append "${_parent}" "$d")";
- if path_not_contains "${_res}" "${_dir}" && is_dir "${_dir}"; then
- _res="${_res}:${_dir}";
- fi;
- done;
- if path_not_contains "${_res}" "${_parent}"; then
- _res="${_res}:${_parent}";
- fi;
- path_chop "${_res}";
-}
-
-# end manpath_add_lang_sys ()
-
-
-########################################################################
-# manpath_set_from_path ()
-#
-# Determine basic search path for man pages from $PATH.
-#
-# Return: `0' if a valid man path was retrieved.
-# Output: none
-# Globals:
-# in: $PATH
-# out: $_MAN_PATH
-#
-manpath_set_from_path()
-{
- func_check manpath_set_from_path = 0 "$@";
- local _base;
- local _mandir;
- local _manpath;
- local d;
- local e;
- _manpath='';
-
- # get a basic man path from $PATH
- if is_not_empty "${PATH}"; then
- eval set -- "$(path_split "${PATH}")";
- for d in "$@"; do
- # delete the final `/bin' part
- _base="$(echo -n "$d" | sed -e '\|//*bin/*$|s|||')";
- for e in /share/man /man; do
- _mandir="${_base}$e";
- if test -d "${_mandir}" && test -r "${_mandir}"; then
- _manpath="${_manpath}:${_mandir}";
- fi;
- done;
- done;
- fi;
-
- # append some default directories
- for d in /usr/local/share/man /usr/local/man \
- /usr/share/man /usr/man \
- /usr/X11R6/man /usr/openwin/man \
- /opt/share/man /opt/man \
- /opt/gnome/man /opt/kde/man; do
- if path_not_contains "${_manpath}" "$d" && is_dir "$d"; then
- _manpath="${_manpath}:$d";
- fi;
- done;
-
- _MAN_PATH="${_manpath}";
- eval "${return_ok}";
-} # manpath_set_from_path()
-
-
-########################################################################
-landmark '9: path_*()';
-########################################################################
-
-########################################################################
-# path_chop (<path>)
-#
-# Remove unnecessary colons from path.
-#
-# Argument: 1, a colon separated path.
-# Output: path without leading, double, or trailing colons.
-#
-path_chop()
-{
- func_check path_chop = 1 "$@";
- local _res;
+`
- # replace multiple colons by a single colon `:'
- # remove leading and trailing colons
- echo -n "$1" | sed -e 's/:::*/:/g' |
- sed -e 's/^:*//' |
- sed -e 's/:*$//';
- eval "${return_ok}";
-}
+########################### test fast shells for automatic run
-
-########################################################################
-# path_clean (<path>)
-#
-# Remove non-existing directories from a colon-separated list.
-#
-# Argument: 1, a colon separated path.
-# Output: colon-separated list of existing directories.
-#
-path_clean()
-{
- func_check path_clean = 1 "$@";
- local _arg;
- local _dir;
- local _res;
- local i;
- if test "$#" -ne 1; then
- error 'path_clean() needs 1 argument.';
- fi;
- _arg="$1";
- eval set -- "$(path_split "${_arg}")";
- _res="";
- for i in "$@"; do
- if is_not_empty "$i" \
- && path_not_contains "${_res}" "$i" \
- && is_dir "$i";
+if test _"${_SHELL}"_ = __
+then
+ for s in ksh ash dash pdksh zsh posh
+ do
+ if test _"$(eval "$s -c 'echo ok'" 2>${_NULL_DEV})"_ = _ok_ >&2
then
- case "$i" in
- ?*/) _res="${_res}$(dirname_chop "$i")"; ;;
- *) _res="${_res}:$i";
- esac;
+ _SHELL="$s";
+ break;
fi;
done;
- if path_chop "${_res}"; then
- eval "${return_ok}";
- else
- eval "${return_badk}";
- fi;
-}
-
-
-########################################################################
-# path_contains (<path> <dir>)
-#-
-# Test whether `dir' is contained in `path', a list separated by `:'.
-#
-# Arguments : 2 arguments.
-# Return : `0' if arg2 is substring of arg1, `1' otherwise.
-#
-path_contains()
-{
- func_check path_contains = 2 "$@";
- case ":$1:" in
- *":$2:"*)
- eval "${return_yes}";
- ;;
- *)
- eval "${return_no}";
- ;;
- esac;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# path_not_contains (<path> <dir>)
-#-
-# Test whether `dir' is not contained in colon separated `path'.
-#
-# Arguments : 2 arguments.
-#
-path_not_contains()
-{
- func_check path_not_contains = 2 "$@";
- if path_contains "$1" "$2"; then
- eval "${return_no}";
- else
- eval "${return_yes}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# path_split (<path>)
-#
-# In `path' escape white space and replace each colon by a space.
-#
-# Arguments: 1: a colon-separated path
-# Output: the resulting list, process with `eval set --'
-#
-path_split()
-{
- func_check path_split = 1 "$@";
- list_from_split "$1" ':';
- eval "${return_ok}";
-}
-
-
-########################################################################
-# reset ()
-#
-# Reset the variables that can be affected by options to their default.
-#
-#
-# Defined in section `Preset' after the rudimentary shell tests.
-
-
-########################################################################
-landmark '10: register_*()';
-########################################################################
-
-########################################################################
-# register_file (<filename>)
-#
-# Write a found file and register the title element.
-#
-# Arguments: 1: a file name
-# Output: none
-#
-register_file()
-{
- func_check register_file = 1 "$@";
- if is_empty "$1"; then
- error 'register_file(): file name is empty';
- fi;
- if is_equal "$1" '-'; then
- to_tmp "${_TMP_STDIN}";
- register_title '-';
- else
- to_tmp "$1";
- register_title "$(base_name "$1")";
- fi;
- eval "${return_ok}";
-}
+fi;
-########################################################################
-# register_title (<filespec>)
-#
-# Create title element from <filespec> and append to $_REGISTERED_TITLE
-#
-# Globals: $_REGISTERED_TITLE (rw)
-#
-register_title()
-{
- func_check register_title = 1 "$@";
- local _title;
- if is_empty "$1"; then
- eval "${return_ok}";
- fi;
- _title="$(base_name "$1")"; # remove directory part
-
- # remove extension `.gz'
- _title="$(echo -n "${_title}" | sed -e 's/\.gz$//')";
- # remove extension `.Z'
- _title="$(echo -n "${_title}" | sed -e 's/\.Z$//')";
-
- if is_empty "${_title}"; then
- eval "${return_ok}";
- fi;
- _REGISTERED_TITLE="${_REGISTERED_TITLE} ${_title}";
- eval "${return_ok}";
-}
+########################### start groffer2.sh
+if test _"${_SHELL}"_ = _empty_
+then
+ _SHELL='';
+fi;
-########################################################################
-# save_stdin ()
-#
-# Store standard input to temporary file (with decompression).
-#
-if test "${_HAS_COMPRESSION}" = 'yes'; then
- save_stdin()
- {
- local _f;
- func_check save_stdin = 0 "$@";
- _f="${_TMP_DIR}"/INPUT;
- cat >"${_f}";
- catz "${_f}" >"${_TMP_STDIN}";
- rm -f "${_f}";
- eval "${return_ok}";
- }
+if test _"${_SHELL}"_ = __
+then
+ # no shell found, so start groffer2.sh normally
+ eval exec "'${_GROFFER2_SH}'" '"$@"';
+ exit;
else
- save_stdin()
- {
- func_check save_stdin = 0 "$@";
- cat >"${_TMP_STDIN}";
- eval "${return_ok}";
- }
+ # start groffer2.sh with the found $_SHELL
+ # do not quote $_SHELL to allow arguments
+ eval exec "${_SHELL} '${_GROFFER2_SH}'" '"$@"';
+ exit;
fi;
-
-
-########################################################################
-landmark '11: stack_*()';
-########################################################################
-
-########################################################################
-# string_contains (<string> <part>)
-#
-# Test whether `part' is contained in `string'.
-#
-# Arguments : 2 text arguments.
-# Return : `0' if arg2 is substring of arg1, `1' otherwise.
-#
-string_contains()
-{
- func_check string_contains = 2 "$@";
- case "$1" in
- *"$2"*)
- eval "${return_yes}";
- ;;
- *)
- eval "${return_no}";
- ;;
- esac;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# string_not_contains (<string> <part>)
-#
-# Test whether `part' is not substring of `string'.
-#
-# Arguments : 2 text arguments.
-# Return : `0' if arg2 is substring of arg1, `1' otherwise.
-#
-string_not_contains()
-{
- func_check string_not_contains = 2 "$@";
- if string_contains "$1" "$2"; then
- eval "${return_no}";
- else
- eval "${return_yes}";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-landmark '12: tmp_*()';
-########################################################################
-
-########################################################################
-# tmp_cat ()
-#
-# output the temporary cat file (the concatenation of all input)
-#
-tmp_cat()
-{
- cat "${_TMP_CAT}";
-}
-
-
-########################################################################
-# tmp_create (<suffix>?)
-#
-# create temporary file
-#
-# It's safe to use the shell process ID together with a suffix to
-# have multiple temporary files.
-#
-# Output : name of created file
-#
-tmp_create()
-{
- func_check tmp_create '<=' 1 "$@";
- local _tmp;
- _tmp="${_TMP_DIR}/$1";
- echo -n >"${_tmp}";
- echo -n "${_tmp}"; # output file name
- eval "${return_ok}";
-}
-
-
-########################################################################
-# to_tmp (<filename>)
-#
-# print file (decompressed) to the temporary cat file
-#
-to_tmp()
-{
- func_check to_tmp = 1 "$@";
- if is_file "$1"; then
- if is_yes "${_OPT_LOCATION}"; then
- echo2 "$1";
- fi;
- if is_yes "${_OPT_WHATIS}"; then
- what_is "$1" >>"${_TMP_CAT}";
- else
- catz "$1" >>"${_TMP_CAT}";
- fi;
- else
- error "to_tmp(): could not read file \`$1'.";
- fi;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# trap_clean ()
-#
-# disable trap on all exit codes ($_ALL_EXIT)
-#
-# Arguments: 0
-# Globals: $_ALL_EXIT
-#
-trap_clean()
-{
- func_check trap_clean = 0 "$@";
- local i;
- for i in ${_ALL_EXIT}; do
- trap "" "$i" 2>/dev/null || true;
- done;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# trap_set (<functionname>)
-#
-# call function on all exit codes ($_ALL_EXIT)
-#
-# Arguments: 1 (name of a shell function)
-# Globals: $_ALL_EXIT
-#
-trap_set()
-{
- func_check trap_set = 1 "$@";
- local i;
- for i in ${_ALL_EXIT}; do
- trap "$1" "$i" 2>/dev/null || true;
- done;
- eval "${return_ok}";
-}
-
-
-########################################################################
-# usage ()
-#
-# print usage information to stderr
-#
-usage()
-{
- func_check usage = 0 "$@";
- echo2;
- version;
- cat >&2 <<EOF
-Copyright (C) 2001 Free Software Foundation, Inc.
-This is free software licensed under the GNU General Public License.
-
-EOF
-
- echo2 "Usage: ${_PROGRAM_NAME} [option]... [filespec]...";
-
- cat >&2 <<EOF
-
-where "filespec" is one of
- "filename" name of a readable file
- "-" for standard input
- "man:name.n" man page "name" in section "n"
- "man:name" man page "name" in first section found
- "name.n" man page "name" in section "n"
- "name" man page "name" in first section found
-and some more (see groffer(1) for details).
-
-Display roff files, standard input, and/or Unix manual pages with
-in a X window viewer or in a text pager.
-"-" stands for including standard input.
-"manpage" is the name of a man page, "x" its section.
-All input is decompressed on-the-fly (by gzip).
-
--h --help print this usage message.
--Q --source output as roff source.
--T --device=name pass to groff using output device "name".
--v --version print version information.
-
-All other short options are interpreted as "groff" formatting
-parameters and are transferred unmodified. The following groff
-options imply groff mode (groffer viewing disabled):
-
--X display with "gxditview" using groff -X.
--V display the groff execution pipe instead of formatting.
--Z --ditroff --intermediate-output
- generate groff intermediate output without
- post-processing and viewing like groff -Z.
-
-The most important long options are
-
---auto-modes=mode1,mode2,...
- set sequence of automatically tried modes.
---bg set background color (not for all modes).
---default reset effects of option processing so far.
---display set the X device when displaying in X.
---dpi=res set resolution to "res" ("75" (default) or "100").
---dvi display in a viewer for TeX device independent format.
---dvi-viewer choose the viewer program for dvi mode.
---extension=ext restrict man pages to section suffix.
---fg set foreground color (not for all modes).
---geometry=geom set the window size and position when displaying in X.
---groff process like groff, disable viewing features.
---local-file same as --no-man.
---locale=lang preset the language for man pages.
---location print file locations additionally to standard error.
---man check file parameters first whether they are man pages.
---mode=auto|dvi|groff|pdf|ps|source|tty|www|x
- choose display mode.
---no-location disable former call to "--location".
---no-man disable man-page facility.
---pager=program preset the paging program for tty mode.
---pdf display in a PDF viewer.
---pdf-viewer choose the viewer program for pdf mode.
---ps display in a Postscript viewer.
---ps-viewer choose the viewer program for ps mode.
---shell specify shell under which to run this program.
---systems=os1,os2,...
- search man pages for different operating systems.
---title='text' set the title of the viewer window (not in all modes.
---tty force paging on text terminal even when in X.
---www display in a web browser.
---www-viewer choose the web browser for www mode.
---x display in an X roff viewer.
---x-viewer choose viewer program for x mode.
---xrm='resource' set X resouce.
-
-EOF
- eval "${return_ok}";
-}
-
-
-########################################################################
-# version ()
-#
-# print version information to stderr
-#
-version()
-{
- echo2 "${_PROGRAM_NAME} ${_PROGRAM_VERSION} of ${_LAST_UPDATE}";
- # also display groff's version, but not the called subprograms
- groff -v 2>&1 | sed -e '/^ *$/q' | sed -e '1s/^/is part of /' >&2;
-}
-
-
-########################################################################
-# warning (<string>)
-#
-# Print warning to stderr
-#
-warning()
-{
- echo2 "warning: $*";
-}
-
-
-########################################################################
-# what_is (<filename>)
-#
-# Interpret <filename> as a man page and display its `whatis'
-# information as a fragment written in the groff language.
-#
-what_is()
-{
- func_check what_is = 1 "$@";
- local _res;
- local _dot;
- if is_not_file "$1"; then
- error "what_is(): argument is not a readable file."
- fi;
- _dot='^\.['"${_SPACE}${_TAB}"']*';
- echo '.br';
- echo "$1: ";
- echo '.br';
- echo -n ' ';
- # grep the line containing `.TH' macro, if any
- _res="$(catz "$1" | sed -e '/'"${_dot}"'TH /p
-d')";
- if is_not_empty "${_res}"; then # traditional man style
- # get the text between the first and the second `.SH' macro, by
- # - delete up to first .SH;
- # - of this, print everything up to next .SH, and delete the rest;
- # - of this, delete the final .SH line;
- catz "$1" | sed -e '1,/'"${_dot}"'SH/d' \
- | sed -e '1,/'"${_dot}"'SH/p
-d' \
- | sed -e '/'"${_dot}"'SH/d';
- eval "${return_ok}";
- fi;
- # grep the line containing `.Dd' macro, if any
- _res="$(catz "$1" | sed -e '/'"${_dot}"'Dd /p
-d')";
- if is_not_empty "${_res}"; then # BSD doc style
- # get the text between the first and the second `.Nd' macro, by
- # - delete up to first .Nd;
- # - of this, print everything up to next .Nd, and delete the rest;
- # - of this, delete the final .Nd line;
- catz "$1" | sed -e '1,/'"${_dot}"'Nd/d' \
- | sed -e '1,/'"${_dot}"'Nd/p
-d' \
- | sed -e '/'"${_dot}"'Nd/d';
- eval "${return_ok}";
- fi;
- echo 'is not a man page.';
- eval "${return_bad}";
-}
-
-
-########################################################################
-# where (<program>)
-#
-# Output path of a program if in $PATH.
-#
-# Arguments : >=1 (empty allowed)
-# more args are ignored, this allows to specify progs with arguments
-# Return : `0' if arg1 is a program in $PATH, `1' otherwise.
-#
-where()
-{
- func_check where '>=' 1 "$@";
- local _file;
- local _arg;
- local p;
- _arg="$1";
- if is_empty "${_arg}"; then
- eval "${return_bad}";
- fi;
- case "${_arg}" in
- /*)
- if test -f "${_arg}" && test -x "${_arg}"; then
- eval "${return_ok}";
- else
- eval "${return_bad}";
- fi;
- ;;
- esac;
- eval set -- "$(path_split "${PATH}")";
- for p in "$@"; do
- case "$p" in
- */) _file=$p${_arg}; ;;
- *) _file=$p/${_arg}; ;;
- esac;
- if test -f "${_file}" && test -x "${_file}"; then
- echo -n "${_file}";
- eval "${return_ok}";
- fi;
- done;
- eval "${return_bad}";
-}
-
-
-########################################################################
-# main
-########################################################################
-
-# The main area contains the following parts:
-# - main_init(): initialize temporary files and set exit trap
-# - parse $MANOPT
-# - main_parse_args(): argument parsing
-# - determine display mode
-# - process filespec arguments
-# - setup X resources
-# - do the displaying
-
-# These parts are implemented as functions, being defined below in the
-# sequence they are called in the main() function.
-
-
-#######################################################################
-# main_init ()
-#
-# set exit trap and create temporary files
-#
-# Globals: $_TMP_CAT, $_TMP_STDIN
-#
-landmark '13: main_init()';
-main_init()
-{
- func_check main_init = 0 "$@";
- # call clean_up() on any signal
- trap_set clean_up;
-
- for f in ${_CONFFILES}; do
- if is_file "$f"; then
- . "$f";
- fi;
- done;
-
- # determine temporary directory
- umask 000;
- _TMP_DIR='';
- for d in "${GROFF_TMPDIR}" "${TMPDIR}" "${TMP}" "${TEMP}" \
- "${TEMPDIR}" "${HOME}"'/tmp' '/tmp' "${HOME}" '.';
- do
- if test "$d" != ""; then
- if test -d "$d" && test -r "$d" && test -w "$d"; then
- _TMP_DIR="${d}/${_PROGRAM_NAME}${_PROCESS_ID}";
- if test -d "${_TMP_DIR}"; then
- rm -f "${_TMP_DIR}"/*;
- break;
- else
- mkdir "${_TMP_DIR}";
- if test ! -d "${_TMP_DIR}"; then
- _TMP_DIR='';
- continue;
- fi;
- break;
- fi;
- fi;
- if test ! -w "${_TMP_DIR}"; then
- _TMP_DIR='';
- continue;
- fi;
- fi;
- done;
- unset d;
- if test "${_TMP_DIR}" = ''; then
- error "Couldn't create a directory for storing temporary files.";
- fi;
-
- _TMP_CAT="$(tmp_create groffer_cat)";
- _TMP_STDIN="$(tmp_create groffer_input)";
- eval "${return_ok}";
-} # main_init()
-
-
-########################################################################
-# main_parse_MANOPT ()
-#
-# Parse $MANOPT to retrieve man options, but only if it is a non-empty
-# string; found man arguments can be overwritten by the command line.
-#
-# Globals:
-# in: $MANOPT, $_OPTS_MAN_*
-# out: $_MANOPT_*
-# in/out: $GROFFER_OPT
-#
-landmark '14: main_parse_MANOPT()';
-main_parse_MANOPT()
-{
- func_check main_parse_MANOPT = 0 "$@";
- local _opt;
- local _list;
- _list='';
- if test "${MANOPT}" != ''; then
- MANOPT="$(echo -n "${MANOPT}" | \
- sed -e 's/^'"${_SPACE}${_SPACE}"'*//')";
- fi;
- if test "${MANOPT}" = ''; then
- eval "${return_ok}";
- fi;
- # add arguments in $MANOPT by mapping them to groffer options
- eval set -- "$(list_from_cmdline \
- "${_OPTS_MAN_SHORT_NA}" "${_OPTS_MAN_SHORT_ARG}" \
- "${_OPTS_MAN_LONG_NA}" "${_OPTS_MAN_LONG_ARG}" \
- "${MANOPT}")";
- until test "$#" -le 0 || is_equal "$1" '--'; do
- _opt="$1";
- shift;
- case "${_opt}" in
- -7|--ascii)
- _list="$(list_append "${_list}" '--ascii')";
- ;;
- -a|--all)
- _list="$(list_append "${_list}" '--all')";
- ;;
- -c|--catman)
- do_nothing;
- shift;
- ;;
- -d|--debug)
- _list="$(list_append "${_list}" '--debug')";
- ;;
- -D|--default)
- # undo all man options so far
- _list='';
- ;;
- -e|--extension)
- _list="$(list_append "${_list}" '--extension')";
- shift;
- ;;
- -f|--whatis)
- _list="$(list_append "${_list}" '--whatis')";
- shift;
- ;;
- -h|--help)
- do_nothing;
- shift;
- ;;
- -k|--apropos)
- _list="$(list_append "${_list}" '--apropos')";
- shift;
- ;;
- -l|--local-file)
- _list="$(list_append "${_list}" '--local-file')";
- ;;
- -L|--locale)
- _list="$(list_append "${_list}" '--locale' "$1")";
- shift;
- ;;
- -m|--systems)
- _list="$(list_append "${_list}" '--systems' "$1")";
- shift;
- ;;
- -M|--manpath)
- _list="$(list_append "${_list}" '--manpath' "$1")";
- shift;
- ;;
- -p|--preprocessor)
- do_nothing;
- shift;
- ;;
- -P|--pager)
- _list="$(list_append "${_list}" '--pager' "$1")";
- shift;
- ;;
- -r|--prompt)
- do_nothing;
- shift;
- ;;
- -S|--sections)
- _list="$(list_append "${_list}" '--sections' "$1")";
- shift;
- ;;
- -t|--troff)
- do_nothing;
- shift;
- ;;
- -T|--device)
- _list="$(list_append "${_list}" '-T' "$1")";
- shift;
- ;;
- -u|--update)
- do_nothing;
- shift;
- ;;
- -V|--version)
- do_nothing;
- ;;
- -w|--where|--location)
- _list="$(list_append "${_list}" '--location')";
- ;;
- -Z|--ditroff)
- _list="$(list_append "${_list}" '-Z' "$1")";
- shift;
- ;;
- # ignore all other options
- esac;
- done;
- GROFFER_OPT="$(list_from_lists "${_list}" "${GROFFER_OPT}")";
- eval "${return_ok}";
-} # main_parse_MANOPT()
-
-
-########################################################################
-# main_parse_args (<command_line_args>*)
-#
-# Parse arguments; process options and filespec parameters
-#
-# Arguments: pass the command line arguments unaltered.
-# Globals:
-# in: $_OPTS_*
-# out: $_OPT_*, $_ADDOPTS, $_FILEARGS
-#
-landmark '15: main_parse_args()';
-main_parse_args()
-{
- func_check main_parse_args '>=' 0 "$@";
- local _arg;
- local _code;
- local _dpi;
- local _longopt;
- local _mode;
- local _opt;
- local _optchar;
- local _optarg;
- local _opts;
- local _string;
-
- eval set -- "${GROFFER_OPT}" '"$@"';
-
- eval set -- "$(list_from_cmdline \
- "$_OPTS_CMDLINE_SHORT_NA" "$_OPTS_CMDLINE_SHORT_ARG" \
- "$_OPTS_CMDLINE_LONG_NA" "$_OPTS_CMDLINE_LONG_ARG" \
- "$@")";
-
-# By the call of `eval', unnecessary quoting was removed. So the
-# positional shell parameters ($1, $2, ...) are now guaranteed to
-# represent an option or an argument to the previous option, if any;
-# then a `--' argument for separating options and
-# parameters; followed by the filespec parameters if any.
-
-# Note, the existence of arguments to options has already been checked.
-# So a check for `$#' or `--' should not be done for arguments.
-
- until test "$#" -le 0 || is_equal "$1" '--'; do
- _opt="$1"; # $_opt is fed into the option handler
- shift;
- case "${_opt}" in
- -h|--help)
- usage;
- leave;
- ;;
- -Q|--source) # output source code (`Quellcode').
- _OPT_MODE='source';
- ;;
- -T|--device|--troff-device)
- # device; arg
- _OPT_DEVICE="$1";
- shift;
- ;;
- -v|--version)
- version;
- leave;
- ;;
- -V)
- _OPT_V='yes';
- ;;
- -X)
- _OPT_X='yes';
- ;;
- -Z|--ditroff|--intermediate-output)
- # groff intermediate output
- _OPT_Z='yes';
- ;;
- -?)
- # delete leading `-'
- _optchar="$(echo -n "${_opt}" | sed -e 's/^.//')";
- if list_has "${_OPTS_GROFF_SHORT_NA}" "${_optchar}";
- then
- _ADDOPTS_GROFF="$(list_append "${_ADDOPTS_GROFF}" \
- "${_opt}")";
- elif list_has "${_OPTS_GROFF_SHORT_ARG}" "${_optchar}";
- then
- _ADDOPTS_GROFF="$(list_append "${_ADDOPTS_GROFF}" \
- "${_opt}" "$1")";
- shift;
- else
- error "Unknown option : \`$1'";
- fi;
- ;;
- --all)
- _OPT_ALL="yes";
- ;;
- --ascii)
- _ADDOPTS_GROFF="$(list_append "${_ADDOPTS_GROFF}" \
- '-mtty-char')";
- ;;
- --apropos)
- _OPT_APROPOS="yes";
- ;;
- --auto) # the default automatic mode
- _mode='';
- ;;
- --bd) # border color for viewers, arg;
- _OPT_BD="$1";
- shift;
- ;;
- --bg|--backgroud) # background color for viewers, arg;
- _OPT_BG="$1";
- shift;
- ;;
- --bw) # border width for viewers, arg;
- _OPT_BW="$1";
- shift;
- ;;
- --default) # reset variables to default
- reset;
- ;;
- --default-modes) # sequence of modes in auto mode; arg
- _OPT_DEFAULT_MODES="$1";
- shift;
- ;;
- --debug) # sequence of modes in auto mode; arg
- _OPT_DEBUG='yes';
- ;;
- --display) # set X display, arg
- _OPT_DISPLAY="$1";
- shift;
- ;;
- --dvi)
- _OPT_MODE='dvi';
- ;;
- --dvi-viewer) # viewer program for dvi mode; arg
- _OPT_VIEWER_DVI="$1";
- shift;
- ;;
- --extension) # the extension for man pages, arg
- _OPT_EXTENSION="$1";
- shift;
- ;;
- --fg|--foreground) # foreground color for viewers, arg;
- _OPT_FG="$1";
- shift;
- ;;
- --fn|--font) # set font for viewers, arg;
- _OPT_FN="$1";
- shift;
- ;;
- --geometry) # window geometry for viewers, arg;
- _OPT_GEOMETRY="$1";
- shift;
- ;;
- --groff)
- _OPT_MODE='groff';
- ;;
- --locale) # set language for man pages, arg
- # argument is xx[_territory[.codeset[@modifier]]] (ISO 639,...)
- _OPT_LANG="$1";
- shift;
- ;;
- --local-file) # force local files; same as `--no-man'
- _MAN_FORCE='no';
- _MAN_ENABLE='no';
- ;;
- --location|--where) # print file locations to stderr
- _OPT_LOCATION='yes';
- ;;
- --man) # force all file params to be man pages
- _MAN_ENABLE='yes';
- _MAN_FORCE='yes';
- ;;
- --manpath) # specify search path for man pages, arg
- # arg is colon-separated list of directories
- _OPT_MANPATH="$1";
- shift;
- ;;
- --mode) # display mode
- _arg="$1";
- shift;
- case "${_arg}" in
- auto|'') # the default automatic mode
- _mode='';
- ;;
- groff) # pass input to plain groff
- _mode='groff';
- ;;
- dvi) # display with xdvi viewer
- _mode='dvi';
- ;;
- pdf) # display with PDF viewer
- _mode='pdf';
- ;;
- ps) # display with Postscript viewer
- _mode='ps';
- ;;
- X|x) # output on X roff viewer
- _mode='x';
- ;;
- tty) # output on terminal
- _mode='tty';
- ;;
- Q|source) # display source code
- _mode="source";
- ;;
- *)
- error "unknown mode ${_arg}";
- ;;
- esac;
- _OPT_MODE="${_mode}";
- ;;
- --no-location) # disable former call to `--location'
- _OPT_LOCATION='yes';
- ;;
- --no-man) # disable search for man pages
- # the same as --local-file
- _MAN_FORCE="no";
- _MAN_ENABLE="no";
- ;;
- --pager) # set paging program for tty mode, arg
- _OPT_PAGER="$1";
- shift;
- ;;
- --pdf)
- _OPT_MODE='pdf';
- ;;
- --pdf-viewer) # viewer program for ps mode; arg
- _OPT_VIEWER_PDF="$1";
- shift;
- ;;
- --ps)
- _OPT_MODE='ps';
- ;;
- --ps-viewer) # viewer program for ps mode; arg
- _OPT_VIEWER_PS="$1";
- shift;
- ;;
- --resolution) # set resolution for X devices, arg
- _arg="$1";
- shift;
- case "${_arg}" in
- 75|75dpi)
- _dpi=75;
- ;;
- 100|100dpi)
- _dpi=100;
- ;;
- *)
- error "only resoutions of 75 or 100 dpi are supported";
- ;;
- esac;
- _OPT_RESOLUTION="${_dpi}";
- ;;
- --rv)
- _OPT_RV='yes';
- ;;
- --sections) # specify sections for man pages, arg
- # arg is colon-separated list of section names
- _OPT_SECTIONS="$1";
- shift;
- ;;
- --shell)
- shift;
- ;;
- --systems) # man pages for different OS's, arg
- # argument is a comma-separated list
- _OPT_SYSTEMS="$1";
- shift;
- ;;
- --title) # title for X viewers; arg
- _OPT_TITLE="$1";
- shift;
- ;;
- --tty)
- _OPT_MODE="tty";
- ;;
- --tty-device) # device for tty mode; arg
- _OPT_TTY_DEVICE="$1";
- shift;
- ;;
- --whatis)
- _OPT_WHATIS='yes';
- ;;
- --www) # display with web browser
- _OPT_MODE='www';
- ;;
- --www-viewer) # viewer program for www mode; arg
- _OPT_VIEWER_WWW="$1";
- shift;
- ;;
- --x)
- _OPT_MODE='x';
- ;;
- --xrm) # pass X resource string, arg;
- _OPT_XRM="$(list_append "${_OPT_XRM}" "$1")";
- shift;
- ;;
- --x-viewer) # viewer program for x mode; arg
- _OPT_VIEWER_X="$1";
- shift;
- ;;
- *)
- error 'error on argument parsing : '"\`$*'";
- ;;
- esac;
- done;
- shift; # remove `--' argument
-
- if test "${_DEBUG}" != 'yes'; then
- if test "${_OPT_DEBUG}" = 'yes'; then
- _DEBUG='yes';
- fi;
- fi;
-
- # Remaining arguments are file names (filespecs).
- # Save them to list $_FILEARGS
- if test "$#" -eq 0; then # use "-" for standard input
- set -- '-';
- fi;
- _FILEARGS="$(list_from_args "$@")";
- if list_has "$_FILEARGS" '-'; then
- save_stdin;
- fi;
- # $_FILEARGS must be retrieved with `eval set -- "$_FILEARGS"'
- eval "${return_ok}";
-} # main_parse_args()
-
-
-########################################################################
-# main_set_mode ()
-#
-# Determine the display mode.
-#
-# Globals:
-# in: $DISPLAY, $_OPT_MODE, $_OPT_DEVICE
-# out: $_DISPLAY_MODE
-#
-
-# _get_first_prog (<proglist>)
-#
-# Retrieve first argument that represents an existing program in $PATH.
-# Local function for main_set_mode().
-#
-# Arguments: 1; a comma-separated list of commands (with options),
-# like $_VIEWER_*.
-#
-# Return : `1' if none found, `0' if found.
-# Output : the argument that succeded.
-#
-landmark '16: main_set_mode()';
-main_set_mode()
-{
- func_check main_set_mode = 0 "$@";
- local m;
- local _modes;
- local _viewer;
- local _viewers;
-
- # handle apropos
- if is_yes "${_OPT_APROPOS}"; then
- apropos "$@";
- _code="$?";
- clean_up;
- exit "${_code}";
- fi;
-
- # set display
- if is_not_empty "${_OPT_DISPLAY}"; then
- DISPLAY="${_OPT_DISPLAY}";
- fi;
-
- if is_yes "${_OPT_V}"; then
- _DISPLAY_MODE='groff';
- _ADDOPTS_GROFF="$(list_append "${_ADDOPTS_GROFF}" '-V')";
- fi;
- if is_yes "${_OPT_X}"; then
- _DISPLAY_MODE='groff';
- _ADDOPTS_GROFF="$(list_append "${_ADDOPTS_GROFF}" '-X')";
- fi;
- if is_yes "${_OPT_Z}"; then
- _DISPLAY_MODE='groff';
- _ADDOPTS_GROFF="$(list_append "${_ADDOPTS_GROFF}" '-Z')";
- fi;
- if is_equal "${_OPT_MODE}" 'groff'; then
- _DISPLAY_MODE='groff';
- fi;
- if is_equal "${_DISPLAY_MODE}" 'groff'; then
- eval "${return_ok}";
- fi;
-
- if is_equal "${_OPT_MODE}" 'source'; then
- _DISPLAY_MODE='source';
- eval "${return_ok}";
- fi;
-
- case "${_OPT_MODE}" in
- '') # automatic mode
- case "${_OPT_DEVICE}" in
- X*)
- if is_empty "${DISPLAY}"; then
- error "no X display found for device ${_OPT_DEVICE}";
- fi;
- _DISPLAY_MODE='x';
- eval "${return_ok}";
- ;;
- ascii|cp1047|latin1|utf8)
- _DISPLAY_MODE='tty';
- eval "${return_ok}";
- ;;
- esac;
- if is_empty "${DISPLAY}"; then
- _DISPLAY_MODE='tty';
- eval "${return_ok}";
- fi;
-
- if is_empty "${_OPT_DEFAULT_MODES}"; then
- _modes="${_DEFAULT_MODES}";
- else
- _modes="${_OPT_DEFAULT_MODES}";
- fi;
- ;;
- tty)
- _DISPLAY_MODE='tty';
- eval "${return_ok}";
- ;;
- *) # display mode was given
- if is_empty "${DISPLAY}"; then
- error "you must be in X Window for ${_OPT_MODE} mode.";
- fi;
- _modes="${_OPT_MODE}";
- ;;
- esac;
-
- # only viewer modes are left
- eval set -- "$(list_from_split "${_modes}" ',')";
- while test "$#" -gt 0; do
- m="$1";
- shift;
- case "$m" in
- tty)
- _DISPLAY_MODE='tty';
- eval "${return_ok}";
- ;;
- x)
- if is_not_empty "${_OPT_VIEWER_X}"; then
- _viewers="${_OPT_VIEWER_X}";
- else
- _viewers="${_VIEWER_X}";
- fi;
- _viewer="$(_get_first_prog "${_viewers}")";
- if test "$?" -ne 0; then
- continue;
- fi;
- _DISPLAY_PROG="${_viewer}";
- _DISPLAY_MODE='x';
- eval "${return_ok}";
- ;;
- dvi)
- if is_not_empty "${_OPT_VIEWER_DVI}"; then
- _viewers="${_OPT_VIEWER_DVI}";
- else
- _viewers="${_VIEWER_DVI}";
- fi;
- _viewer="$(_get_first_prog "${_viewers}")";
- if test "$?" -ne 0; then
- continue;
- fi;
- _DISPLAY_PROG="${_viewer}";
- _DISPLAY_MODE="dvi";
- eval "${return_ok}";
- ;;
- pdf)
- if is_not_empty "${_OPT_VIEWER_PDF}"; then
- _viewers="${_OPT_VIEWER_PDF}";
- else
- _viewers="${_VIEWER_PDF}";
- fi;
- _viewer="$(_get_first_prog "${_viewers}")";
- if test "$?" -ne 0; then
- continue;
- fi;
- _DISPLAY_PROG="${_viewer}";
- _DISPLAY_MODE="pdf";
- eval "${return_ok}";
- ;;
- ps)
- if is_not_empty "${_OPT_VIEWER_PS}"; then
- _viewers="${_OPT_VIEWER_PS}";
- else
- _viewers="${_VIEWER_PS}";
- fi;
- _viewer="$(_get_first_prog "${_viewers}")";
- if test "$?" -ne 0; then
- continue;
- fi;
- _DISPLAY_PROG="${_viewer}";
- _DISPLAY_MODE="ps";
- eval "${return_ok}";
- ;;
- www)
- if is_not_empty "${_OPT_VIEWER_WWW}"; then
- _viewers="${_OPT_VIEWER_WWW}";
- else
- _viewers="${_VIEWER_WWW}";
- fi;
- _viewer="$(_get_first_prog "${_viewers}")";
- if test "$?" -ne 0; then
- continue;
- fi;
- _DISPLAY_PROG="${_viewer}";
- _DISPLAY_MODE="www";
- eval "${return_ok}";
- ;;
- esac;
- done;
- error "no suitable display mode found.";
-}
-
-_get_first_prog()
-{
- local i;
- if test "$#" -eq 0; then
- error "_get_first_prog() needs 1 argument.";
- fi;
- if is_empty "$1"; then
- return "${_BAD}";
- fi;
- eval set -- "$(list_from_split "$1" ',')";
- for i in "$@"; do
- if is_empty "$i"; then
- continue;
- fi;
- if is_prog "$(get_first_essential $i)"; then
- echo -n "$i";
- return "${_GOOD}";
- fi;
- done;
- return "${_BAD}";
-} # main_set_mode()
-
-
-#######################################################################
-# main_do_fileargs ()
-#
-# Process filespec arguments in $_FILEARGS.
-#
-# Globals:
-# in: $_FILEARGS (process with `eval set -- "$_FILEARGS"')
-#
-landmark '17: main_do_fileargs()';
-main_do_fileargs()
-{
- func_check main_do_fileargs = 0 "$@";
- local _exitcode;
- local _filespec;
- local _name;
- _exitcode="${_BAD}";
- eval set -- "${_FILEARGS}";
- unset _FILEARGS;
- # temporary storage of all input to $_TMP_CAT
- while test "$#" -ge 2; do
- # test for `s name' arguments, with `s' a 1-char standard section
- _filespec="$1";
- shift;
- case "${_filespec}" in
- '')
- continue;
- ;;
- '-')
- if register_file '-'; then
- _exitcode="${_GOOD}";
- fi;
- continue;
- ;;
- ?)
- if list_has_not "${_MAN_AUTO_SEC}" "${_filespec}"; then
- if do_filearg "${_filespec}"; then
- _exitcode="${_GOOD}";
- fi;
- continue;
- fi;
- _name="$1";
- case "${_name}" in
- */*|man:*|*\(*\)|*."${_filespec}")
- if do_filearg "${_filespec}"; then
- _exitcode="${_GOOD}";
- fi;
- continue;
- ;;
- esac;
- if do_filearg "man:${_name}(${_filespec})"; then
- _exitcode="${_GOOD}";
- shift;
- continue;
- else
- if do_filearg "${_filespec}"; then
- _exitcode="${_GOOD}";
- fi;
- continue;
- fi;
- ;;
- *)
- if do_filearg "${_filespec}"; then
- _exitcode="${_GOOD}";
- fi;
- continue;
- ;;
- esac;
- done; # end of `s name' test
- while test "$#" -gt 0; do
- _filespec="$1";
- shift;
- if do_filearg "${_filespec}"; then
- _exitcode="${_GOOD}";
- fi;
- done;
- rm -f "${_TMP_STDIN}";
- if is_equal "${_exitcode}" "${_BAD}"; then
- eval "${return_bad}";
- fi;
- eval "${return_ok}";
-} # main_do_fileargs()
-
-
-########################################################################
-# main_set_resources ()
-#
-# Determine options for setting X resources with $_DISPLAY_PROG.
-#
-landmark '18: main_set_resources()';
-main_set_resources()
-{
- func_check main_set_resources = 0 "$@";
- local _prog; # viewer program
- local _rl; # resource list
- _rl='';
- if is_empty "${_DISPLAY_PROG}"; then
- eval "${return_ok}";
- fi;
- set -- ${_DISPLAY_PROG};
- _prog="$(base_name "$1")";
- if is_not_empty "${_OPT_BD}"; then
- case "${_prog}" in
- ghostview|gv|gxditview|xditview|xdvi)
- _rl="$(list_append "$_rl" '-bd' "${_OPT_BD}")";
- ;;
- esac;
- fi;
- if is_not_empty "${_OPT_BG}"; then
- case "${_prog}" in
- ghostview|gv|gxditview|xditview|xdvi)
- _rl="$(list_append "$_rl" '-bg' "${_OPT_BG}")";
- ;;
- xpdf)
- _rl="$(list_append "$_rl" '-papercolor' "${_OPT_BG}")";
- ;;
- esac;
- fi;
- if is_not_empty "${_OPT_BW}"; then
- case "${_prog}" in
- ghostview|gv|gxditview|xditview|xdvi)
- _rl="$(list_append "$_rl" '-bw' "${_OPT_BW}")";
- ;;
- esac;
- fi;
- if is_not_empty "${_OPT_FG}"; then
- case "${_prog}" in
- ghostview|gv|gxditview|xditview|xdvi)
- _rl="$(list_append "$_rl" '-fg' "${_OPT_FG}")";
- ;;
- esac;
- fi;
- if is_not_empty "${_OPT_FN}"; then
- case "${_prog}" in
- ghostview|gv|gxditview|xditview|xdvi)
- _rl="$(list_append "$_rl" '-fn' "${_OPT_FN}")";
- ;;
- esac;
- fi;
- if is_not_empty "${_OPT_GEOMETRY}"; then
- case "${_prog}" in
- ghostview|gv|gxditview|xditview|xdvi|xpdf)
- _rl="$(list_append "$_rl" '-geometry' "${_OPT_GEOMETRY}")";
- ;;
- esac;
- fi;
- if is_empty "${_OPT_RESOLUTION}"; then
- case "${_prog}" in
- gxditview|xditview)
- _rl="$(list_append "$_rl" \
- '-resolution' "${_DEFAULT_RESOLUTION}")";
- ;;
- xpdf)
- case "${_DEFAULT_RESOLUTION}" in
- 75)
- _rl="$(list_append "$_rl" '-z' '2')";
- ;;
- 100)
- _rl="$(list_append "$_rl" '-z' '3')";
- ;;
- esac;
- ;;
- esac;
- else
- case "${_prog}" in
- ghostview|gv|gxditview|xditview|xdvi)
- _rl="$(list_append "$_rl" '-resolution' "${_OPT_RESOLUTION}")";
- ;;
- xpdf)
- case "${_OPT_RESOLUTION}" in
- 75)
- _rl="$(list_append "$_rl" '-z' '2')";
- ;;
- 100)
- _rl="$(list_append "$_rl" '-z' '3')";
- ;;
- esac;
- ;;
- esac;
- fi;
- if is_not_empty "${_OPT_RV}"; then
- case "${_prog}" in
- ghostview|gv|gxditview|xditview|xdvi)
- _rl="$(list_append "$_rl" '-rv')";
- ;;
- esac;
- fi;
- if is_not_empty "${_OPT_XRM}"; then
- case "${_prog}" in
- ghostview|gv|gxditview|xditview|xdvi|xpdf)
- eval set -- "{$_OPT_XRM}";
- for i in "$@"; do
- _rl="$(list_append "$_rl" '-xrm' "$i")";
- done;
- ;;
- esac;
- fi;
- _title="$(get_first_essential \
- "${_OPT_TITLE}" "${_REGISTERED_TITLE}")";
- if is_not_empty "${_title}"; then
- case "${_prog}" in
- gxditview|xditview)
- _rl="$(list_append "$_rl" '-title' "${_title}")";
- ;;
- esac;
- fi;
- _DISPLAY_ARGS="${_rl}";
- eval "${return_ok}";
-} # main_set_resources
-
-
-########################################################################
-# main_display ()
-#
-# Do the actual display of the whole thing.
-#
-# Globals:
-# in: $_DISPLAY_MODE, $_OPT_DEVICE,
-# $_ADDOPTS_GROFF, $_ADDOPTS_POST, $_ADDOPTS_X,
-# $_REGISTERED_TITLE, $_TMP_CAT,
-# $_OPT_PAGER $PAGER $_MANOPT_PAGER
-#
-landmark '19: main_display()';
-main_display()
-{
- func_check main_display = 0 "$@";
- local p;
- local _addopts;
- local _device;
- local _groggy;
- local _modefile;
- local _options;
- local _pager;
- local _title;
- export _addopts;
- export _groggy;
- export _modefile;
-
- # Some display programs have trouble with empty input.
- # This is avoided by feeding a space character in this case.
- # Test on non-empty file by tracking a line with at least 1 character.
- if is_empty "$(tmp_cat | sed -e '/./q')"; then
- echo ' ' > "${_TMP_CAT}";
- fi;
-
- case "${_DISPLAY_MODE}" in
- groff)
- _ADDOPTS_GROFF="${_ADDOPTS_GROFF} ${_ADDOPTS_POST}";
- if is_not_empty "${_OPT_DEVICE}"; then
- _ADDOPTS_GROFF="${_ADDOPTS_GROFF} -T${_OPT_DEVICE}";
- fi;
- _groggy="$(tmp_cat | eval grog "${_options}")";
- trap_clean;
- # start a new shell program to get another process ID.
- sh -c '
- set -e;
- _PROCESS_ID="$$";
- _modefile="${_TMP_DIR}/${_PROGRAM_NAME}${_PROCESS_ID}";
- rm -f "${_modefile}";
- mv "${_TMP_CAT}" "${_modefile}";
- rm -f "${_TMP_CAT}";
- cat "${_modefile}" | \
- (
- clean_up()
- {
- rm -f "${_modefile}";
- }
- trap clean_up 0 2>/dev/null || true;
- eval "${_groggy}" "${_ADDOPTS_GROFF}";
- ) &'
- ;;
- tty)
- case "${_OPT_DEVICE}" in
- '')
- _device="$(get_first_essential \
- "${_OPT_TTY_DEVICE}" "${_DEFAULT_TTY_DEVICE}")";
- ;;
- ascii|cp1047|latin1|utf8)
- _device="${_OPT_DEVICE}";
- ;;
- *)
- warning \
- "wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
- ;;
- esac;
- _addopts="${_ADDOPTS_GROFF} ${_ADDOPTS_POST}";
- _groggy="$(tmp_cat | grog -T${_device})";
- _pager='';
- for p in "${_OPT_PAGER}" "${PAGER}" "${_MANOPT_PAGER}" \
- 'less' 'more' 'cat'; do
- if is_prog "$p"; then
- _pager="$p";
- break;
- fi;
- done;
- if is_empty "${_pager}"; then
- error 'no pager program found for tty mode';
- fi;
- tmp_cat | eval "${_groggy}" "${_addopts}" | \
- eval "${_pager}";
- clean_up;
- ;;
-
- #### viewer modes
-
- dvi)
- case "${_OPT_DEVICE}" in
- ''|dvi) do_nothing; ;;
- *)
- warning \
- "wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
- ;;
- esac;
- _groggy="$(tmp_cat | grog -Tdvi)";
- _do_display;
- ;;
- pdf)
- case "${_OPT_DEVICE}" in
- ''|ps)
- do_nothing;
- ;;
- *)
- warning \
- "wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
- ;;
- esac;
- _groggy="$(tmp_cat | grog -Tps)";
- trap_clean;
- # start a new shell program to get another process ID.
- sh -c '
- set -e;
- _PROCESS_ID="$$";
- _psfile="${_TMP_DIR}/${_PROGRAM_NAME}${_PROCESS_ID}";
- _modefile="${_TMP_DIR}/${_PROGRAM_NAME}${_PROCESS_ID}.pdf";
- rm -f "${_psfile}";
- rm -f "${_modefile}";
- cat "${_TMP_CAT}" | \
- eval "${_groggy}" "${_ADDOPTS_GROFF}" > "${_psfile}";
- gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
- -sOutputFile="${_modefile}" -c save pop -f "${_psfile}";
- rm -f "${_psfile}";
- rm -f "${_TMP_CAT}";
- (
- clean_up()
- {
- rm -f "${_modefile}";
- }
- trap clean_up 0 2>/dev/null || true;
- eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "${_modefile}";
- ) &'
- ;;
- ps)
- case "${_OPT_DEVICE}" in
- ''|ps)
- do_nothing;
- ;;
- *)
- warning \
- "wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
- ;;
- esac;
- _groggy="$(tmp_cat | grog -Tps)";
- _do_display;
- ;;
- source)
- tmp_cat;
- clean_up;
- ;;
- www)
- case "${_OPT_DEVICE}" in
- ''|html) do_nothing; ;;
- *)
- warning \
- "wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
- ;;
- esac;
- _groggy="$(tmp_cat | grog -Thtml)";
- _do_display;
- ;;
- x)
- case "${_OPT_DEVICE}" in
- '')
- _groggy="$(tmp_cat | grog -Z)";
- ;;
- X*|ps)
- _groggy="$(tmp_cat | grog -T"${_OPT_DEVICE}" -Z)";
- ;;
- *)
- warning \
- "wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
- _groggy="$(tmp_cat | grog -Z)";
- ;;
- esac;
- _do_display;
- ;;
- *)
- error "unknown mode \`${_DISPLAY_MODE}'";
- ;;
- esac;
- eval "${return_ok}";
-} # main_display()
-
-_do_display()
-{
- trap_clean;
- # start a new shell program for another process ID and better
- # cleaning-up of the temporary files.
- sh -c '
- set -e;
- _PROCESS_ID="$$";
- _modefile="${_TMP_DIR}/${_PROGRAM_NAME}${_PROCESS_ID}";
- rm -f "${_modefile}";
- cat "${_TMP_CAT}" | \
- eval "${_groggy}" "${_ADDOPTS_GROFF}" > "${_modefile}";
- rm -f "${_TMP_CAT}";
- (
- clean_up()
- {
- if test -d "${_TMP_DIR}"; then
- rm -f "${_TMP_DIR}"/*;
- rmdir "${_TMP_DIR}";
- fi;
- }
- trap clean_up 0 2>/dev/null || true;
- eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "${_modefile}";
- ) &'
-}
-
-
-########################################################################
-# main (<command_line_args>*)
-#
-# The main function for groffer.
-#
-# Arguments:
-#
-main()
-{
- func_check main '>=' 0 "$@";
- # Do not change the sequence of the following functions!
- main_init;
- main_parse_MANOPT;
- main_parse_args "$@";
- main_set_mode;
- main_do_fileargs;
- main_set_resources;
- main_display;
- eval "${return_ok}";
-}
-
-landmark '20: end of function definitions';
-
-########################################################################
-
-main "$@";
diff --git a/contrib/groff/contrib/groffer/groffer2.sh b/contrib/groff/contrib/groffer/groffer2.sh
new file mode 100644
index 000000000000..60ca91130f6f
--- /dev/null
+++ b/contrib/groff/contrib/groffer/groffer2.sh
@@ -0,0 +1,5854 @@
+#! /bin/sh
+
+# groffer - display groff files
+
+# Source file position: <groff-source>/contrib/groffer/groffer2.sh
+# Installed position: <prefix>/lib/groff/groffer/groffer2.sh
+
+# This file should not be run independently. It is called by
+# `groffer.sh' in the source or by the installed `groffer' program.
+
+# Copyright (C) 2001,2002,2003,2004,2005
+# Free Software Foundation, Inc.
+# Written by Bernd Warken
+
+# Last update: 22 August 2005
+
+# This file is part of `groffer', which is part of `groff'.
+
+# `groff' is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# `groff' is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with `groff'; see the files COPYING and LICENSE in the top
+# directory of the `groff' source. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+
+########################################################################
+# Test of rudimentary shell functionality
+########################################################################
+
+
+########################################################################
+# Test of `unset'
+#
+export _UNSET;
+export _foo;
+_foo=bar;
+_res="$(unset _foo 2>&1)";
+if unset _foo >${_NULL_DEV} 2>&1 && \
+ test _"${_res}"_ = __ && test _"${_foo}"_ = __
+then
+ _UNSET='unset';
+ eval "${_UNSET}" _foo;
+ eval "${_UNSET}" _res;
+else
+ _UNSET=':';
+fi;
+
+
+########################################################################
+# Test of `test'.
+#
+if test a = a && test a != b && test -f "${_GROFFER_SH}"
+then
+ :;
+else
+ echo '"test" did not work.' >&2;
+ exit "${_ERROR}";
+fi;
+
+
+########################################################################
+# Test of `echo' and the `$()' construct.
+#
+if echo '' >${_NULL_DEV}
+then
+ :;
+else
+ echo '"echo" did not work.' >&2;
+ exit "${_ERROR}";
+fi;
+if test _"$(t1="$(echo te)" &&
+ t2="$(echo '')" &&
+ t3="$(echo 'st')" &&
+ echo "${t1}${t2}${t3}")"_ \
+ != _test_
+then
+ echo 'The "$()" construct did not work' >&2;
+ exit "${_ERROR}";
+fi;
+
+
+########################################################################
+# Test of sed program; test in groffer.sh is not valid here.
+#
+if test _"$(echo red | sed -e 's/r/s/')"_ != _sed_
+then
+ echo 'The sed program did not work.' >&2;
+ exit "${_ERROR}";
+fi;
+
+
+########################################################################
+# Test of function definitions.
+#
+_t_e_s_t_f_u_n_c_()
+{
+ return 0;
+}
+
+if _t_e_s_t_f_u_n_c_ 2>${_NULL_DEV}
+then
+ :;
+else
+ echo 'Shell '"${_SHELL}"' does not support function definitions.' >&2;
+ exit "${_ERROR}";
+fi;
+
+
+########################################################################
+# debug - diagnostic messages
+########################################################################
+
+export _DEBUG_STACKS;
+_DEBUG_STACKS='no'; # disable stack output in each function
+#_DEBUG_STACKS='yes'; # enable stack output in each function
+
+export _DEBUG_LM;
+_DEBUG_LM='no'; # disable landmark messages
+#_DEBUG_LM='yes'; # enable landmark messages
+
+export _DEBUG_KEEP_FILES;
+_DEBUG_KEEP_FILES='no' # disable file keeping in temporary dir
+#_DEBUG_KEEP_FILES='yes' # enable file keeping in temporary dir
+
+export _DEBUG_PRINT_PARAMS;
+_DEBUG_PRINT_PARAMS='no'; # disable printing of all parameters
+#_DEBUG_PRINT_PARAMS='yes'; # enable printing of all parameters
+
+export _DEBUG_PRINT_SHELL;
+_DEBUG_PRINT_SHELL='no'; # disable printing of the shell name
+#_DEBUG_PRINT_SHELL='yes'; # enable printing of the shell name
+
+export _DEBUG_PRINT_TMPDIR;
+_DEBUG_PRINT_TMPDIR='no'; # disable printing of the temporary dir
+#_DEBUG_PRINT_TMPDIR='yes'; # enable printing of the temporary dir
+
+export _DEBUG_USER_WITH_STACK;
+_DEBUG_USER_WITH_STACK='no'; # disable stack dump in error_user()
+#_DEBUG_USER_WITH_STACK='yes'; # enable stack dump in error_user()
+
+# determine all --debug* options
+case " $*" in
+*\ --debug*)
+ case " $* " in
+ *' --debug '*)
+ # _DEBUG_STACKS='yes';
+ # _DEBUG_LM='yes';
+ _DEBUG_KEEP_FILES='yes';
+ _DEBUG_PRINT_PARAMS='yes';
+ _DEBUG_PRINT_SHELL='yes';
+ _DEBUG_PRINT_TMPDIR='yes';
+ _DEBUG_USER_WITH_STACK='yes';
+ ;;
+ esac;
+ d=' --debug-all --debug-keep --debug-lm --debug-params --debug-shell '\
+'--debug-stacks --debug-tmpdir --debug-user ';
+ for i
+ do
+ case "$i" in
+ --debug-s)
+ echo 'The abbreviation --debug-s has multiple options: '\
+'--debug-shell and --debug-stacks.' >&2
+ exit "${_ERROR}";
+ ;;
+ esac;
+ case "$d" in
+ *\ ${i}*)
+ # extract whole word of abbreviation $i
+ s="$(cat <<EOF | sed -n -e 's/^.* \('"$i"'[^ ]*\) .*/\1/p'
+$d
+EOF
+)"
+ case "$s" in
+ '') continue; ;;
+ --debug-all)
+ _DEBUG_STACKS='yes';
+ _DEBUG_LM='yes';
+ _DEBUG_KEEP_FILES='yes';
+ _DEBUG_PRINT_PARAMS='yes';
+ _DEBUG_PRINT_SHELL='yes';
+ _DEBUG_PRINT_TMPDIR='yes';
+ _DEBUG_USER_WITH_STACK='yes';
+ ;;
+ --debug-keep)
+ _DEBUG_PRINT_TMPDIR='yes';
+ _DEBUG_KEEP_FILES='yes';
+ ;;
+ --debug-lm)
+ _DEBUG_LM='yes';
+ ;;
+ --debug-params)
+ _DEBUG_PRINT_PARAMS='yes';
+ ;;
+ --debug-shell)
+ _DEBUG_PRINT_SHELL='yes';
+ ;;
+ --debug-stacks)
+ _DEBUG_STACKS='yes';
+ ;;
+ --debug-tmpdir)
+ _DEBUG_PRINT_TMPDIR='yes';
+ ;;
+ --debug-user)
+ _DEBUG_USER_WITH_STACK='yes';
+ ;;
+ esac;
+ ;;
+ esac;
+ done
+ ;;
+esac;
+
+if test _"${_DEBUG_PRINT_PARAMS}"_ = _yes_
+then
+ echo "parameters: $@" >&2;
+fi;
+
+if test _"${_DEBUG_PRINT_SHELL}"_ = _yes_
+then
+ if test _"${_SHELL}"_ = __
+ then
+ if test _"${POSIXLY_CORRECT}"_ = _y_
+ then
+ echo 'shell: bash as /bin/sh (none specified)' >&2;
+ else
+ echo 'shell: /bin/sh (none specified)' >&2;
+ fi;
+ else
+ echo "shell: ${_SHELL}" >&2;
+ fi;
+fi;
+
+
+########################################################################
+# Environment Variables
+########################################################################
+
+# Environment variables that exist only for this file start with an
+# underscore letter. Global variables to this file are written in
+# upper case letters, e.g. $_GLOBAL_VARIABLE; temporary variables
+# start with an underline and use only lower case letters and
+# underlines, e.g. $_local_variable .
+
+# [A-Z]* system variables, e.g. $MANPATH
+# _[A-Z_]* global file variables, e.g. $_MAN_PATH
+# _[a-z_]* temporary variables, e.g. $_manpath
+
+# Due to incompatibilities of the `ash' shell, the name of loop
+# variables in `for' must be single character
+# [a-z] local loop variables, e.g. $i
+
+
+########################################################################
+# read-only variables (global to this file)
+########################################################################
+
+# function return values; `0' means ok; other values are error codes
+export _ALL_EXIT;
+export _BAD;
+export _GOOD;
+export _NO;
+export _OK;
+export _YES;
+
+_GOOD='0'; # return ok
+_BAD='1'; # return negatively, error code `1'
+# $_ERROR was already defined as `7' in groffer.sh.
+
+_NO="${_BAD}";
+_YES="${_GOOD}";
+_OK="${_GOOD}";
+
+# quasi-functions, call with `eval', e.g `eval "${return_ok}"'
+export return_ok;
+export return_good;
+export return_bad;
+export return_yes;
+export return_no;
+export return_error;
+export return_var;
+return_ok="func_pop; return ${_OK}";
+return_good="func_pop; return ${_GOOD}";
+return_bad="func_pop; return ${_BAD}";
+return_yes="func_pop; return ${_YES}";
+return_no="func_pop; return ${_NO}";
+return_error="func_pop; return ${_ERROR}";
+return_var="func_pop; return"; # add number, e.g. `eval "${return_var} $n'
+
+
+export _DEFAULT_MODES;
+_DEFAULT_MODES='x,ps,tty';
+export _DEFAULT_RESOLUTION;
+_DEFAULT_RESOLUTION='75';
+
+export _DEFAULT_TTY_DEVICE;
+_DEFAULT_TTY_DEVICE='latin1';
+
+# _VIEWER_* viewer programs for different modes (only X is necessary)
+# _VIEWER_* a comma-separated list of viewer programs (with options)
+export _VIEWER_DVI; # viewer program for dvi mode
+export _VIEWER_HTML_TTY; # viewer program for html mode in tty
+export _VIEWER_HTML_X; # viewer program for html mode in X
+export _VIEWER_PDF; # viewer program for pdf mode
+export _VIEWER_PS; # viewer program for ps mode
+export _VIEWER_X; # viewer program for X mode
+_VIEWER_DVI='kdvi,xdvi,dvilx';
+_VIEWER_HTML_TTY='lynx';
+_VIEWER_HTML_X='konqueror,mozilla,netscape,galeon,opera,amaya,arena';
+_VIEWER_PDF='kghostview --scale 1.45,ggv,xpdf,acroread,kpdf';
+_VIEWER_PS='kghostview --scale 1.45,ggv,gv,ghostview,gs_x11,gs';
+_VIEWER_X='gxditview,xditview';
+
+# Search automatically in standard sections `1' to `8', and in the
+# traditional sections `9', `n', and `o'. On many systems, there
+# exist even more sections, mostly containing a set of man pages
+# special to a specific program package. These aren't searched for
+# automatically, but must be specified on the command line.
+export _MAN_AUTO_SEC_LIST;
+_MAN_AUTO_SEC_LIST="'1' '2' '3' '4' '5' '6' '7' '8' '9' 'n' 'o'";
+export _MAN_AUTO_SEC_CHARS;
+_MAN_AUTO_SEC_CHARS='[123456789no]';
+
+export _SPACE_SED;
+_SPACE_SED='['"${_SP}${_TAB}"']';
+
+export _SPACE_CASE;
+_SPACE_CASE='[\'"${_SP}"'\'"${_TAB}"']';
+
+export _PROCESS_ID; # for shutting down the program
+_PROCESS_ID="$$";
+
+
+############ the command line options of the involved programs
+#
+# The naming scheme for the options environment names is
+# $_OPTS_<prog>_<length>[_<argspec>]
+#
+# <prog>: program name GROFFER, GROFF, or CMDLINE (for all
+# command line options)
+# <length>: LONG (long options) or SHORT (single character options)
+# <argspec>: ARG for options with argument, NA for no argument;
+# without _<argspec> both the ones with and without arg.
+#
+# Each option that takes an argument must be specified with a
+# trailing : (colon).
+
+# exports
+export _OPTS_GROFFER_SHORT_NA;
+export _OPTS_GROFFER_SHORT_ARG;
+export _OPTS_GROFFER_LONG_NA;
+export _OPTS_GROFFER_LONG_ARG;
+export _OPTS_GROFF_SHORT_NA;
+export _OPTS_GROFF_SHORT_ARG;
+export _OPTS_GROFF_LONG_NA;
+export _OPTS_GROFF_LONG_ARG;
+export _OPTS_X_SHORT_ARG;
+export _OPTS_X_SHORT_NA;
+export _OPTS_X_LONG_ARG;
+export _OPTS_X_LONG_NA;
+export _OPTS_MAN_SHORT_ARG;
+export _OPTS_MAN_SHORT_NA;
+export _OPTS_MAN_LONG_ARG;
+export _OPTS_MAN_LONG_NA;
+export _OPTS_MANOPT_SHORT_ARG;
+export _OPTS_MANOPT_SHORT_NA;
+export _OPTS_MANOPT_LONG_ARG;
+export _OPTS_MANOPT_LONG_NA;
+export _OPTS_CMDLINE_SHORT_NA;
+export _OPTS_CMDLINE_SHORT_ARG;
+export _OPTS_CMDLINE_LONG_NA;
+export _OPTS_CMDLINE_LONG_ARG;
+
+###### groffer native options
+
+_OPTS_GROFFER_SHORT_NA="'h' 'Q' 'v' 'V' 'X' 'Z'";
+_OPTS_GROFFER_SHORT_ARG="'T'";
+
+_OPTS_GROFFER_LONG_NA="'auto' \
+'apropos' 'apropos-data' 'apropos-devel' 'apropos-progs' \
+'debug' 'debug-all' 'debug-keep' 'debug-lm' 'debug-params' 'debug-shell' \
+'debug-stacks' 'debug-tmpdir' 'debug-user' 'default' 'do-nothing' 'dvi' \
+'groff' 'help' 'intermediate-output' 'html' 'man' \
+'no-location' 'no-man' 'no-special' 'pdf' 'ps' 'rv' 'source' \
+'text' 'text-device' \
+'tty' 'tty-device' 'version' 'whatis' 'where' 'www' 'x' 'X'";
+
+_OPTS_GROFFER_LONG_ARG="\
+'default-modes' 'device' 'dvi-viewer' 'dvi-viewer-tty' 'extension' 'fg' \
+'fn' 'font' 'foreground' 'html-viewer' 'html-viewer-tty' 'mode' \
+'pdf-viewer' 'pdf-viewer-tty' 'print' 'ps-viewer' 'ps-viewer-tty' 'shell' \
+'title' 'tty-viewer' 'tty-viewer-tty' 'www-viewer' 'www-viewer-tty' \
+'x-viewer' 'x-viewer-tty' 'X-viewer' 'X-viewer-tty'";
+
+##### groffer options inhereted from groff
+
+_OPTS_GROFF_SHORT_NA="'a' 'b' 'c' 'C' 'e' 'E' 'g' 'G' 'i' 'l' 'N' 'p' \
+'R' 's' 'S' 't' 'U' 'z'";
+_OPTS_GROFF_SHORT_ARG="'d' 'f' 'F' 'I' 'L' 'm' 'M' 'n' 'o' 'P' 'r' \
+'w' 'W'";
+_OPTS_GROFF_LONG_NA="";
+_OPTS_GROFF_LONG_ARG="";
+
+##### groffer options inhereted from the X Window toolkit
+
+_OPTS_X_SHORT_NA="";
+_OPTS_X_SHORT_ARG="";
+
+_OPTS_X_LONG_NA="'iconic' 'rv'";
+
+_OPTS_X_LONG_ARG="'background' 'bd' 'bg' 'bordercolor' 'borderwidth' \
+'bw' 'display' 'fg' 'fn' 'font' 'foreground' 'ft' 'geometry' \
+'resolution' 'title' 'xrm'";
+
+###### groffer options inherited from man
+
+_OPTS_MAN_SHORT_NA="";
+_OPTS_MAN_SHORT_ARG="";
+
+_OPTS_MAN_LONG_NA="'all' 'ascii' 'catman' 'ditroff' \
+'local-file' 'location' 'troff' 'update'";
+
+_OPTS_MAN_LONG_ARG="'locale' 'manpath' \
+'pager' 'preprocessor' 'prompt' 'sections' 'systems' 'troff-device'";
+
+###### additional options for parsing $MANOPT only
+
+_OPTS_MANOPT_SHORT_NA="'7' 'a' 'c' 'd' 'D' 'f' 'h' 'k' 'l' 't' 'u' \
+'V' 'w' 'Z'";
+_OPTS_MANOPT_SHORT_ARG="'e' 'L' 'm' 'M' 'p' 'P' 'r' 'S' 'T'";
+
+_OPTS_MANOPT_LONG_NA="${_OPTS_MAN_LONG_NA} \
+'apropos' 'debug' 'default' 'help' 'html' 'ignore-case' 'location-cat' \
+'match-case' 'troff' 'update' 'version' 'whatis' 'where' 'where-cat'";
+
+_OPTS_MANOPT_LONG_ARG="${_OPTS_MAN_LONG_NA} \
+'config_file' 'encoding' 'extension' 'locale'";
+
+###### collections of command line options
+
+_OPTS_CMDLINE_SHORT_NA="${_OPTS_GROFFER_SHORT_NA} \
+${_OPTS_GROFF_SHORT_NA} ${_OPTS_X_SHORT_NA} ${_OPTS_MAN_SHORT_NA}";
+_OPTS_CMDLINE_SHORT_ARG="${_OPTS_GROFFER_SHORT_ARG} \
+${_OPTS_GROFF_SHORT_ARG} ${_OPTS_X_SHORT_ARG} ${_OPTS_MAN_SHORT_ARG}";
+
+_OPTS_CMDLINE_LONG_NA="${_OPTS_GROFFER_LONG_NA} \
+${_OPTS_GROFF_LONG_NA} ${_OPTS_X_LONG_NA} ${_OPTS_MAN_LONG_NA}";
+_OPTS_CMDLINE_LONG_ARG="${_OPTS_GROFFER_LONG_ARG} \
+${_OPTS_GROFF_LONG_ARG} ${_OPTS_MAN_LONG_ARG} ${_OPTS_X_LONG_ARG}";
+
+
+########################################################################
+# read-write variables (global to this file)
+########################################################################
+
+export _ALL_PARAMS; # All options and file name parameters
+export _ADDOPTS_GROFF; # Transp. options for groff (`eval').
+export _ADDOPTS_POST; # Transp. options postproc (`eval').
+export _ADDOPTS_X; # Transp. options X postproc (`eval').
+export _APROPOS_PROG; # Program to run apropos.
+export _APROPOS_SECTIONS; # Sections for different --apropos-*.
+export _DEFAULT_MODES; # Set default modes.
+export _DISPLAY_MODE; # Display mode.
+export _DISPLAY_PROG; # Viewer program to be used for display.
+export _DISPLAY_ARGS; # X resources for the viewer program.
+export _FILEARGS; # Stores filespec parameters.
+export _FILESPEC_ARG; # Stores the actual filespec parameter.
+export _FUNC_STACK; # Store debugging information.
+export _REGISTERED_TITLE; # Processed file names.
+# _HAS_* from availability tests
+export _HAS_COMPRESSION; # `yes' if gzip compression is available
+export _HAS_BZIP; # `yes' if bzip2 compression is available
+# _MAN_* finally used configuration of man searching
+export _MAN_ALL; # search all man pages per filespec
+export _MAN_ENABLE; # enable search for man pages
+export _MAN_EXT; # extension for man pages
+export _MAN_FORCE; # force file parameter to be man pages
+export _MAN_IS_SETUP; # setup man variables only once
+export _MAN_LANG; # language for man pages
+export _MAN_LANG2; # language for man pages
+export _MAN_LANG_DONE; # language dirs added to man path
+export _MAN_PATH; # search path for man pages
+export _MAN_SEC; # sections for man pages; sep. `:'
+export _MAN_SEC_DONE; # sections added to man path
+export _MAN_SYS; # system names for man pages; sep. `,'
+export _MAN_SYS; # system names added to man path
+# _MANOPT_* as parsed from $MANOPT
+export _MANOPT_ALL; # $MANOPT --all
+export _MANOPT_EXTENSION; # $MANOPT --extension
+export _MANOPT_LANG; # $MANOPT --locale
+export _MANOPT_PATH; # $MANOPT --manpath
+export _MANOPT_PAGER; # $MANOPT --pager
+export _MANOPT_SEC; # $MANOPT --sections
+export _MANOPT_SYS; # $MANOPT --systems
+# _OPT_* as parsed from groffer command line
+export _OPT_ALL; # display all suitable man pages.
+export _OPT_APROPOS; # call `apropos' program.
+export _OPT_BD; # set border color in some modes.
+export _OPT_BG; # set background color in some modes.
+export _OPT_BW; # set border width in some modes.
+export _OPT_DEFAULT_MODES; # `,'-list of modes when no mode given.
+export _OPT_DEVICE; # device option.
+export _OPT_DO_NOTHING; # do nothing in main_display().
+export _OPT_DISPLAY; # set X display.
+export _OPT_FG; # set foreground color in some modes.
+export _OPT_FN; # set font in some modes.
+export _OPT_GEOMETRY; # set size and position of viewer in X.
+export _OPT_ICONIC; # -iconic option for X viewers.
+export _OPT_LANG; # set language for man pages
+export _OPT_LOCATION; # print processed file names to stderr
+export _OPT_MODE; # values: X, tty, Q, Z, ""
+export _OPT_MANPATH; # manual setting of path for man-pages
+export _OPT_PAGER; # specify paging program for tty mode
+export _OPT_RESOLUTION; # set X resolution in dpi
+export _OPT_RV; # reverse fore- and background colors.
+export _OPT_SECTIONS; # sections for man page search
+export _OPT_SYSTEMS; # man pages of different OS's
+export _OPT_TITLE; # title for gxditview window
+export _OPT_TEXT_DEVICE; # set device for tty mode.
+export _OPT_V; # groff option -V.
+export _OPT_VIEWER_DVI; # viewer program for dvi mode
+export _OPT_VIEWER_PDF; # viewer program for pdf mode
+export _OPT_VIEWER_PS; # viewer program for ps mode
+export _OPT_VIEWER_HTML; # viewer program for html mode
+export _OPT_VIEWER_X; # viewer program for x mode
+export _OPT_WHATIS; # print the man description
+export _OPT_XRM; # specify X resource.
+export _OPT_Z; # groff option -Z.
+export _OUTPUT_FILE_NAME; # output generated, see main_set_res..()
+export _VIEWER_TERMINAL; # viewer options for terminal (--*-viewer-tty)
+# _TMP_* temporary directory and files
+export _TMP_DIR; # groffer directory for temporary files
+export _TMP_CAT; # stores concatenation of everything
+export _TMP_STDIN; # stores stdin, if any
+
+# these variables are preset in section `Preset' after the rudim. test
+
+
+########################################################################
+# Preset and reset of read-write global variables
+########################################################################
+
+
+export _START_DIR; # directory at start time of the script
+_START_DIR="$(pwd)";
+
+# For variables that can be reset by option `--default', see reset().
+
+_FILEARGS='';
+
+# _HAS_* from availability tests
+_HAS_COMPRESSION='';
+_HAS_BZIP='';
+
+# _TMP_* temporary files
+_TMP_DIR='';
+_TMP_CAT='';
+_TMP_CONF='';
+_TMP_STDIN='';
+
+
+########################################################################
+# reset ()
+#
+# Reset the variables that can be affected by options to their default.
+#
+reset()
+{
+ if test "$#" -ne 0
+ then
+ error "reset() does not have arguments.";
+ fi;
+
+ _ADDOPTS_GROFF='';
+ _ADDOPTS_POST='';
+ _ADDOPTS_X='';
+ _APROPOS_PROG='';
+ _APROPOS_SECTIONS='';
+ _DISPLAY_ARGS='';
+ _DISPLAY_MODE='';
+ _DISPLAY_PROG='';
+ _REGISTERED_TITLE='';
+
+ # _MAN_* finally used configuration of man searching
+ _MAN_ALL='no';
+ _MAN_ENABLE='yes'; # do search for man-pages
+ _MAN_EXT='';
+ _MAN_FORCE='no'; # first local file, then search man page
+ _MAN_IS_SETUP='no';
+ _MAN_LANG='';
+ _MAN_LANG2='';
+ _MAN_PATH='';
+ _MAN_SEC='';
+ _MAN_SEC_DONE='no';
+ _MAN_SYS='';
+ _MAN_SYS_DONE='no';
+
+ # _MANOPT_* as parsed from $MANOPT
+ _MANOPT_ALL='no';
+ _MANOPT_EXTENSION='';
+ _MANOPT_LANG='';
+ _MANOPT_PATH='';
+ _MANOPT_PAGER='';
+ _MANOPT_SEC='';
+ _MANOPT_SYS='';
+
+ # _OPT_* as parsed from groffer command line
+ _OPT_ALL='no';
+ _OPT_APROPOS='no';
+ _OPT_BD='';
+ _OPT_BG='';
+ _OPT_BW='';
+ _OPT_DEFAULT_MODES='';
+ _OPT_DEVICE='';
+ _OPT_DISPLAY='';
+ _OPT_DO_NOTHING='no';
+ _OPT_FG='';
+ _OPT_FN='';
+ _OPT_GEOMETRY='';
+ _OPT_ICONIC='no';
+ _OPT_LANG='';
+ _OPT_LOCATION='no';
+ _OPT_MODE='';
+ _OPT_MANPATH='';
+ _OPT_PAGER='';
+ _OPT_RESOLUTION='';
+ _OPT_RV='no';
+ _OPT_SECTIONS='';
+ _OPT_SYSTEMS='';
+ _OPT_TITLE='';
+ _OPT_TEXT_DEVICE='';
+ _OPT_V='no';
+ _OPT_VIEWER_DVI='';
+ _OPT_VIEWER_PDF='';
+ _OPT_VIEWER_PS='';
+ _OPT_VIEWER_HTML='';
+ _OPT_VIEWER_X='';
+ _OPT_WHATIS='no';
+ _OPT_XRM='';
+ _OPT_Z='no';
+ _VIEWER_TERMINAL='no';
+}
+
+reset;
+
+
+########################################################################
+# Functions for error handling and debugging
+########################################################################
+
+
+##############
+# echo1 (<text>*)
+#
+# Output to stdout.
+#
+# Arguments : arbitrary text including `-'.
+#
+echo1()
+{
+ cat <<EOF
+$@
+EOF
+}
+
+
+##############
+# echo2 (<text>*)
+#
+# Output to stderr.
+#
+# Arguments : arbitrary text.
+#
+echo2()
+{
+ cat >&2 <<EOF
+$@
+EOF
+}
+
+
+##############
+# landmark (<text>)
+#
+# Print <text> to standard error as a debugging aid.
+#
+# Globals: $_DEBUG_LM
+#
+landmark()
+{
+ if test _"${_DEBUG_LM}"_ = _yes_
+ then
+ echo2 "LM: $*";
+ fi;
+}
+
+landmark "1: debugging functions";
+
+
+##############
+# clean_up ()
+#
+# Clean up at exit.
+#
+clean_up()
+{
+ cd "${_START_DIR}" >"${_NULL_DEV}" 2>&1;
+ if test _${_DEBUG_KEEP_FILES}_ = _yes_
+ then
+ echo2 "Kept temporary directory ${_TMP_DIR}."
+ else
+ if test _"${_TMP_DIR}"_ != __
+ then
+ if test -d "${_TMP_DIR}" || test -f "${_TMP_DIR}"
+ then
+ rm -f -r "${_TMP_DIR}" >${_NULL_DEV} 2>&1;
+ fi;
+ fi;
+ fi;
+}
+
+
+#############
+# diag (text>*)
+#
+# Output a diagnostic message to stderr
+#
+diag()
+{
+ echo2 '>>>>>'"$*";
+}
+
+
+#############
+# error (<text>*)
+#
+# Print an error message to standard error, print the function stack,
+# exit with an error condition. The argument should contain the name
+# of the function from which it was called. This is for system errors.
+#
+error()
+{
+ case "$#" in
+ 1) echo2 'groffer error: '"$1"; ;;
+ *) echo2 'groffer error: wrong number of arguments in error().'; ;;
+ esac;
+ func_stack_dump;
+ if test _"${_TMP_DIR}"_ != __ && test -d "${_TMP_DIR}"
+ then
+ : >"${_TMP_DIR}"/,error;
+ fi;
+ exit "${_ERROR}";
+}
+
+
+#############
+# error_user (<text>*)
+#
+# Print an error message to standard error; exit with an error condition.
+# The error is supposed to be produce by the user. So the funtion stack
+# is omitted.
+#
+error_user()
+{
+ case "$#" in
+ 1)
+ echo2 'groffer error: '"$1";
+ ;;
+ *)
+ echo2 'groffer error: wrong number of arguments in error_user().';
+ ;;
+ esac;
+ if test _"${_DEBUG_USER_WITH_STACK}"_ = _yes_
+ then
+ func_stack_dump;
+ fi;
+ if test _"${_TMP_DIR}"_ != __ && test -d "${_TMP_DIR}"
+ then
+ : >"${_TMP_DIR}"/,error;
+ fi;
+ exit "${_ERROR}";
+}
+
+
+#############
+# exit_test ()
+#
+# Test whether the former command ended with error(). Exit again.
+#
+# Globals: $_ERROR
+#
+exit_test()
+{
+ if test "$?" = "${_ERROR}"
+ then
+ exit ${_ERROR};
+ fi;
+ if test _"${_TMP_DIR}"_ != __ && test -f "${_TMP_DIR}"/,error
+ then
+ exit ${_ERROR};
+ fi;
+}
+
+
+#############
+# func_check (<func_name> <rel_op> <nr_args> "$@")
+#
+# Check number of arguments and register to _FUNC_STACK.
+#
+# Arguments: >=3
+# <func_name>: name of the calling function.
+# <rel_op>: a relational operator: = != < > <= >=
+# <nr_args>: number of arguments to be checked against <operator>
+# "$@": the arguments of the calling function.
+#
+# Variable prefix: fc
+#
+func_check()
+{
+ if test "$#" -lt 3
+ then
+ error 'func_check() needs at least 3 arguments.';
+ fi;
+ fc_fname="$1";
+ case "$3" in
+ 1)
+ fc_nargs="$3";
+ fc_s='';
+ ;;
+ 0|[2-9])
+ fc_nargs="$3";
+ fc_s='s';
+ ;;
+ *)
+ error "func_check(): third argument must be a digit.";
+ ;;
+ esac;
+ case "$2" in
+ '='|'-eq')
+ fc_op='-eq';
+ fc_comp='exactly';
+ ;;
+ '>='|'-ge')
+ fc_op='-ge';
+ fc_comp='at least';
+ ;;
+ '<='|'-le')
+ fc_op='-le';
+ fc_comp='at most';
+ ;;
+ '<'|'-lt')
+ fc_op='-lt';
+ fc_comp='less than';
+ ;;
+ '>'|'-gt')
+ fc_op='-gt';
+ fc_comp='more than';
+ ;;
+ '!='|'-ne')
+ fc_op='-ne';
+ fc_comp='not';
+ ;;
+ *)
+ error \
+ 'func_check(): second argument is not a relational operator.';
+ ;;
+ esac;
+ shift;
+ shift;
+ shift;
+ if test "$#" "${fc_op}" "${fc_nargs}"
+ then
+ do_nothing;
+ else
+ error "func_check(): \
+${fc_fname}"'() needs '"${fc_comp} ${fc_nargs}"' argument'"${fc_s}"'.';
+ fi;
+ func_push "${fc_fname}";
+ if test _"${_DEBUG_STACKS}"_ = _yes_
+ then
+ echo2 '+++ '"${fc_fname} $@";
+ echo2 '>>> '"${_FUNC_STACK}";
+ fi;
+ eval ${_UNSET} fc_comp;
+ eval ${_UNSET} fc_fname;
+ eval ${_UNSET} fc_nargs;
+ eval ${_UNSET} fc_op;
+ eval ${_UNSET} fc_s;
+}
+
+
+#############
+# func_pop ()
+#
+# Retrieve the top element from the stack.
+#
+# The stack elements are separated by `!'; the popped element is
+# identical to the original element, except that all `!' characters
+# were removed.
+#
+# Arguments: 1
+#
+func_pop()
+{
+ if test "$#" -ne 0
+ then
+ error 'func_pop() does not have arguments.';
+ fi;
+ case "${_FUNC_STACK}" in
+ '')
+ if test _"${_DEBUG_STACKS}"_ = _yes_
+ then
+ error 'func_pop(): stack is empty.';
+ fi;
+ ;;
+ *!*)
+ # split at first bang `!'.
+ _FUNC_STACK="$(echo1 "${_FUNC_STACK}" | sed -e 's/^[^!]*!//')";
+ exit_test;
+ ;;
+ *)
+ _FUNC_STACK='';
+ ;;
+ esac;
+ if test _"${_DEBUG_STACKS}"_ = _yes_
+ then
+ echo2 '<<< '"${_FUNC_STACK}";
+ fi;
+}
+
+
+#############
+# func_push (<element>)
+#
+# Store another element to stack.
+#
+# The stack elements are separated by `!'; if <element> contains a `!'
+# it is removed first.
+#
+# Arguments: 1
+#
+# Variable prefix: fp
+#
+func_push()
+{
+ if test "$#" -ne 1
+ then
+ error 'func_push() needs 1 argument.';
+ fi;
+ case "$1" in
+ *'!'*)
+ # remove all bangs `!'.
+ fp_element="$(echo1 "$1" | sed -e 's/!//g')";
+ exit_test;
+ ;;
+ *)
+ fp_element="$1";
+ ;;
+ esac;
+ if test _"${_FUNC_STACK}"_ = __
+ then
+ _FUNC_STACK="${fp_element}";
+ else
+ _FUNC_STACK="${fp_element}!${_FUNC_STACK}";
+ fi;
+ eval ${_UNSET} fp_element;
+}
+
+
+#############
+# func_stack_dump ()
+#
+# Print the content of the stack. Ignore the arguments.
+#
+func_stack_dump()
+{
+ diag 'call stack: '"${_FUNC_STACK}";
+}
+
+
+########################################################################
+# System Test
+########################################################################
+
+landmark "2: system test";
+
+# Test the availability of the system utilities used in this script.
+
+
+########################################################################
+# Test of function `sed'.
+#
+
+if test _"$(echo xTesTx \
+ | sed -e 's/^.\([Tt]e*x*sTT*\).*$/\1/' \
+ | sed -e 's|T|t|g')"_ != _test_
+then
+ error 'Test of "sed" command failed.';
+fi;
+
+
+########################################################################
+# Test of function `cat'.
+#
+if test _"$(echo test | cat)"_ != _test_
+then
+ error 'Test of "cat" command failed.';
+fi;
+
+
+########################################################################
+# Test for compression.
+#
+if test _"$(echo 'test' | gzip -c -d -f - 2>${_NULL_DEV})"_ = _test_
+then
+ _HAS_COMPRESSION='yes';
+ if echo1 'test' | bzip2 -c 2>${_NULL_DEV} | bzip2 -t 2>${_NULL_DEV} \
+ && test _"$(echo 'test' | bzip2 -c 2>${_NULL_DEV} \
+ | bzip2 -d -c 2>${_NULL_DEV})"_ \
+ = _test_
+ then
+ _HAS_BZIP='yes';
+ else
+ _HAS_BZIP='no';
+ fi;
+else
+ _HAS_COMPRESSION='no';
+ _HAS_BZIP='no';
+fi;
+
+
+########################################################################
+# Definition of normal Functions in alphabetical order
+########################################################################
+landmark "3: functions";
+
+########################################################################
+# apropos_filespec ()
+#
+# Setup for the --apropos* options
+#
+apropos_filespec()
+{
+
+ func_check apropos_filespec '=' 0 "$@";
+ if obj _OPT_APROPOS is_yes
+ then
+ eval to_tmp_line \
+ "'.SH $(echo1 "${_FILESPEC_ARG}" | sed 's/[^\\]-/\\-/g')'";
+ exit_test;
+ if obj _APROPOS_PROG is_empty
+ then
+ error 'apropos_filespec: apropos_setup() must be run first.';
+ fi;
+ if obj _APROPOS_SECTIONS is_empty
+ then
+ if obj _OPT_SECTIONS is_empty
+ then
+ s='^.*(.*).*$';
+ else
+ s='^.*(['"$(echo1 "${_OPT_SECTIONS}" | sed -e 's/://g')"']';
+ fi;
+ else
+ s='^.*(['"${_APROPOS_SECTIONS}"']';
+ fi;
+ eval "${_APROPOS_PROG}" "'${_FILESPEC_ARG}'" | \
+ sed -n -e '
+/^'"${_FILESPEC_ARG}"': /p
+/'"$s"'/p
+' | \
+ sort |\
+ sed -e '
+s/^\(.* (..*)\) *- *\(.*\)$/\.br\n\.TP 15\n\.BR \1\n\2/
+' >>"${_TMP_CAT}";
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# apropos_setup ()
+#
+# Setup for the --apropos* options
+#
+apropos_setup()
+{
+ func_check apropos_setup '=' 0 "$@";
+ if obj _OPT_APROPOS is_yes
+ then
+ if is_prog apropos
+ then
+ _APROPOS_PROG='apropos';
+ elif is_prog man
+ then
+ if man --apropos man >${_NULL_DEV} 2>${_NULL_DEV}
+ then
+ _APROPOS_PROG='man --apropos';
+ elif man -k man >${_NULL_DEV} 2>${_NULL_DEV}
+ then
+ _APROPOS_PROG='man -k';
+ fi;
+ fi;
+ if obj _APROPOS_PROG is_empty
+ then
+ error 'apropos_setup: no apropos program available.';
+ fi;
+ to_tmp_line '.TH GROFFER APROPOS';
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# base_name (<path>)
+#
+# Get the file name part of <path>, i.e. delete everything up to last
+# `/' from the beginning of <path>. Remove final slashes, too, to get a
+# non-empty output.
+#
+# Arguments : 1
+# Output : the file name part (without slashes)
+#
+# Variable prefix: bn
+#
+base_name()
+{
+ func_check base_name = 1 "$@";
+ bn_name="$1";
+ case "${bn_name}" in
+ */)
+ # delete all final slashes
+ bn_name="$(echo1 "${bn_name}" | sed -e 's|//*$||')";
+ exit_test;
+ ;;
+ esac;
+ case "${bn_name}" in
+ /|'')
+ eval ${_UNSET} bn_name;
+ eval "${return_bad}";
+ ;;
+ */*)
+ # delete everything before and including the last slash `/'.
+ echo1 "${bn_name}" | sed -e 's|^.*//*\([^/]*\)$|\1|';
+ ;;
+ *)
+ obj bn_name echo1;
+ ;;
+ esac;
+ eval ${_UNSET} bn_name;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# cat_z (<file>)
+#
+# Decompress if possible or just print <file> to standard output.
+#
+# gzip, bzip2, and .Z decompression is supported.
+#
+# Arguments: 1, a file name.
+# Output: the content of <file>, possibly decompressed.
+#
+if test _"${_HAS_COMPRESSION}"_ = _yes_
+then
+ cat_z()
+ {
+ func_check cat_z = 1 "$@";
+ case "$1" in
+ '')
+ error 'cat_z(): empty file name';
+ ;;
+ '-')
+ error 'cat_z(): for standard input use save_stdin()';
+ ;;
+ esac;
+ if obj _HAS_BZIP is_yes
+ then
+ if bzip2 -t "$1" 2>${_NULL_DEV}
+ then
+ bzip2 -c -d "$1" 2>${_NULL_DEV};
+ eval "${return_ok}";
+ fi;
+ fi;
+ gzip -c -d -f "$1" 2>${_NULL_DEV};
+ eval "${return_ok}";
+ }
+else
+ cat_z()
+ {
+ func_check cat_z = 1 "$@";
+ cat "$1";
+ eval "${return_ok}";
+ }
+fi;
+
+
+########################################################################
+# clean_up ()
+#
+# Do the final cleaning up before exiting; used by the trap calls.
+#
+# defined above
+
+
+########################################################################
+# diag (<text>*)
+#
+# Print marked message to standard error; useful for debugging.
+#
+# defined above
+
+
+########################################################################
+landmark '4: dirname()*';
+########################################################################
+
+#######################################################################
+# dirname_append (<dir> <name>)
+#
+# Append `name' to `dir' with clean handling of `/'.
+#
+# Arguments : 2
+# Output : the generated new directory name <dir>/<name>
+#
+dirname_append()
+{
+ func_check dirname_append = 2 "$@";
+ if is_empty "$1"
+ then
+ error "dir_append(): first argument is empty.";
+ fi;
+ if is_empty "$2"
+ then
+ echo1 "$1";
+ else
+ dirname_chop "$1"/"$2";
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# dirname_chop (<name>)
+#
+# Remove unnecessary slashes from directory name.
+#
+# Argument: 1, a directory name.
+# Output: path without double, or trailing slashes.
+#
+# Variable prefix: dc
+#
+dirname_chop()
+{
+ func_check dirname_chop = 1 "$@";
+ # replace all multiple slashes by a single slash `/'.
+ dc_res="$(echo1 "$1" | sed -e 's|///*|/|g')";
+ exit_test;
+ case "${dc_res}" in
+ ?*/)
+ # remove trailing slash '/';
+ echo1 "${dc_res}" | sed -e 's|/$||';
+ ;;
+ *)
+ obj dc_res echo1
+ ;;
+ esac;
+ eval ${_UNSET} dc_res;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# do_filearg (<filearg>)
+#
+# Append the file, man-page, or standard input corresponding to the
+# argument to the temporary file. If this is compressed in the gzip
+# or Z format it is decompressed. A title element is generated.
+#
+# Argument either:
+# - name of an existing file.
+# - `-' to represent standard input (several times allowed).
+# - `man:name.(section)' the man-page for `name' in `section'.
+# - `man:name.section' the man-page for `name' in `section'.
+# - `man:name' the man-page for `name' in the lowest `section'.
+# - `name.section' the man-page for `name' in `section'.
+# - `name' the man-page for `name' in the lowest `section'.
+# Globals :
+# $_TMP_STDIN, $_MAN_ENABLE, $_MAN_IS_SETUP, $_OPT_MAN
+#
+# Output : none
+# Return : $_GOOD if found, ${_BAD} otherwise.
+#
+# Variable prefix: df
+#
+do_filearg()
+{
+ func_check do_filearg = 1 "$@";
+ df_filespec="$1";
+ # store sequence into positional parameters
+ case "${df_filespec}" in
+ '')
+ eval ${_UNSET} df_filespec;
+ eval "${return_good}";
+ ;;
+ '-')
+ register_file '-';
+ eval ${_UNSET} df_filespec;
+ eval "${return_good}";
+ ;;
+ */*) # with directory part; so no man search
+ set 'File';
+ ;;
+ *)
+ if obj _MAN_ENABLE is_yes
+ then
+ if obj _MAN_FORCE is_yes
+ then
+ set 'Manpage' 'File';
+ else
+ set 'File' 'Manpage';
+ fi;
+ else
+ set 'File';
+ fi;
+ ;;
+ esac;
+ for i
+ do
+ case "$i" in
+ File)
+ if test -f "${df_filespec}"
+ then
+ if test -r "${df_filespec}"
+ then
+ register_file "${df_filespec}";
+ eval ${_UNSET} df_filespec;
+ eval ${_UNSET} df_no_man;
+ eval "${return_good}";
+ else
+ echo2 "could not read \`${df_filespec}'";
+ eval ${_UNSET} df_filespec;
+ eval ${_UNSET} df_no_man;
+ eval "${return_bad}";
+ fi;
+ else
+ if obj df_no_man is_not_empty
+ then
+ if obj _OPT_WHATIS is_yes
+ then
+ to_tmp_line "This is neither a file nor a man page."
+ else
+ echo2 "\`${df_filespec}' is neither a file nor a man page."
+ fi;
+ fi;
+ df_no_file=yes;
+ continue;
+ fi;
+ ;;
+ Manpage) # parse filespec as man page
+ if obj _MAN_IS_SETUP is_not_yes
+ then
+ man_setup;
+ fi;
+ if man_do_filespec "${df_filespec}"
+ then
+ eval ${_UNSET} df_filespec;
+ eval ${_UNSET} df_no_file;
+ eval "${return_good}";
+ else
+ if obj df_no_file is_not_empty
+ then
+ if obj _OPT_WHATIS is_yes
+ then
+ to_tmp_line "This is neither a file nor a man page."
+ else
+ echo2 "\`${df_filespec}' is neither a file nor a man page."
+ fi;
+ fi;
+ df_no_man=yes;
+ continue;
+ fi;
+ ;;
+ esac;
+ done;
+ eval ${_UNSET} df_filespec;
+ eval ${_UNSET} df_no_file;
+ eval ${_UNSET} df_no_man;
+ eval "${return_bad}";
+} # do_filearg()
+
+
+########################################################################
+# do_nothing ()
+#
+# Dummy function.
+#
+do_nothing()
+{
+ eval return "${_OK}";
+}
+
+
+########################################################################
+# echo2 (<text>*)
+#
+# Print to standard error with final line break.
+#
+# defined above
+
+
+########################################################################
+# error (<text>*)
+#
+# Print error message and exit with error code.
+#
+# defined above
+
+
+########################################################################
+# exit_test ()
+#
+# Test whether the former command ended with error(). Exit again.
+#
+# defined above
+
+
+########################################################################
+# func_check (<func_name> <rel_op> <nr_args> "$@")
+#
+# Check number of arguments and register to _FUNC_STACK.
+#
+# Arguments: >=3
+# <func_name>: name of the calling function.
+# <rel_op>: a relational operator: = != < > <= >=
+# <nr_args>: number of arguments to be checked against <operator>
+# "$@": the arguments of the calling function.
+#
+# defined above
+
+#########################################################################
+# func_pop ()
+#
+# Delete the top element from the function call stack.
+#
+# defined above
+
+
+########################################################################
+# func_push (<element>)
+#
+# Store another element to function call stack.
+#
+# defined above
+
+
+########################################################################
+# func_stack_dump ()
+#
+# Print the content of the stack.
+#
+# defined above
+
+
+########################################################################
+# get_first_essential (<arg>*)
+#
+# Retrieve first non-empty argument.
+#
+# Return : `1' if all arguments are empty, `0' if found.
+# Output : the retrieved non-empty argument.
+#
+# Variable prefix: gfe
+#
+get_first_essential()
+{
+ func_check get_first_essential '>=' 0 "$@";
+ if is_equal "$#" 0
+ then
+ eval "${return_ok}";
+ fi;
+ for i
+ do
+ gfe_var="$i";
+ if obj gfe_var is_not_empty
+ then
+ obj gfe_var echo1;
+ eval ${_UNSET} gfe_var;
+ eval "${return_ok}";
+ fi;
+ done;
+ eval ${_UNSET} gfe_var;
+ eval "${return_bad}";
+}
+
+
+########################################################################
+landmark '5: is_*()';
+########################################################################
+
+########################################################################
+# is_dir (<name>)
+#
+# Test whether `name' is a directory.
+#
+# Arguments : 1
+# Return : `0' if arg1 is a directory, `1' otherwise.
+#
+is_dir()
+{
+ func_check is_dir '=' 1 "$@";
+ if test _"$1"_ != __ && test -d "$1" && test -r "$1"
+ then
+ eval "${return_yes}";
+ fi;
+ eval "${return_no}";
+}
+
+
+########################################################################
+# is_empty (<string>)
+#
+# Test whether `string' is empty.
+#
+# Arguments : <=1
+# Return : `0' if arg1 is empty or does not exist, `1' otherwise.
+#
+is_empty()
+{
+ func_check is_empty '=' 1 "$@";
+ if test _"$1"_ = __
+ then
+ eval "${return_yes}";
+ fi;
+ eval "${return_no}";
+}
+
+
+########################################################################
+# is_equal (<string1> <string2>)
+#
+# Test whether `string1' is equal to <string2>.
+#
+# Arguments : 2
+# Return : `0' both arguments are equal strings, `1' otherwise.
+#
+is_equal()
+{
+ func_check is_equal '=' 2 "$@";
+ if test _"$1"_ = _"$2"_
+ then
+ eval "${return_yes}";
+ fi;
+ eval "${return_no}";
+}
+
+
+########################################################################
+# is_existing (<name>)
+#
+# Test whether `name' is an existing file or directory. Solaris 2.5 does
+# not have `test -e'.
+#
+# Arguments : 1
+# Return : `0' if arg1 exists, `1' otherwise.
+#
+is_existing()
+{
+ func_check is_existing '=' 1 "$@";
+ if test _"$1"_ = __
+ then
+ eval "${return_no}";
+ fi;
+ if test -f "$1" || test -d "$1" || test -c "$1"
+ then
+ eval "${return_yes}";
+ fi;
+ eval "${return_no}";
+}
+
+
+########################################################################
+# is_file (<name>)
+#
+# Test whether `name' is a readable file.
+#
+# Arguments : 1
+# Return : `0' if arg1 is a readable file, `1' otherwise.
+#
+is_file()
+{
+ func_check is_file '=' 1 "$@";
+ if is_not_empty "$1" && test -f "$1" && test -r "$1"
+ then
+ eval "${return_yes}";
+ fi;
+ eval "${return_no}";
+}
+
+
+########################################################################
+# is_non_empty_file (<file_name>)
+#
+# Test whether `file_name' is a non-empty existing file.
+#
+# Arguments : <=1
+# Return :
+# `0' if arg1 is a non-empty existing file
+# `1' otherwise
+#
+is_non_empty_file()
+{
+ func_check is_non_empty_file '=' 1 "$@";
+ if is_file "$1" && test -s "$1"
+ then
+ eval "${return_yes}";
+ fi;
+ eval "${return_no}";
+}
+
+
+########################################################################
+# is_not_dir (<name>)
+#
+# Test whether `name' is not a readable directory.
+#
+# Arguments : 1
+# Return : `0' if arg1 is a directory, `1' otherwise.
+#
+is_not_dir()
+{
+ func_check is_not_dir '=' 1 "$@";
+ if is_dir "$1"
+ then
+ eval "${return_no}";
+ fi;
+ eval "${return_yes}";
+}
+
+
+########################################################################
+# is_not_empty (<string>)
+#
+# Test whether `string' is not empty.
+#
+# Arguments : <=1
+# Return : `0' if arg1 exists and is not empty, `1' otherwise.
+#
+is_not_empty()
+{
+ func_check is_not_empty '=' 1 "$@";
+ if is_empty "$1"
+ then
+ eval "${return_no}";
+ fi;
+ eval "${return_yes}";
+}
+
+
+########################################################################
+# is_not_equal (<string1> <string2>)
+#
+# Test whether `string1' differs from `string2'.
+#
+# Arguments : 2
+#
+is_not_equal()
+{
+ func_check is_not_equal '=' 2 "$@";
+ if is_equal "$1" "$2"
+ then
+ eval "${return_no}";
+ fi
+ eval "${return_yes}";
+}
+
+
+########################################################################
+# is_not_file (<filename>)
+#
+# Test whether `name' is a not readable file.
+#
+# Arguments : 1 (empty allowed)
+#
+is_not_file()
+{
+ func_check is_not_file '=' 1 "$@";
+ if is_file "$1"
+ then
+ eval "${return_no}";
+ fi;
+ eval "${return_yes}";
+}
+
+
+########################################################################
+# is_not_prog ([<name> [<arg>*]])
+#
+# Verify that arg is a not program in $PATH.
+#
+# Arguments : >=0 (empty allowed)
+# more args are ignored, this allows to specify progs with arguments
+#
+is_not_prog()
+{
+ func_check is_not_prog '>=' 0 "$@";
+ case "$#" in
+ 0)
+ eval "${return_yes}";
+ ;;
+ *)
+ if where_is "$1" >${_NULL_DEV}
+ then
+ eval "${return_no}";
+ fi;
+ ;;
+ esac
+ eval "${return_yes}";
+}
+
+
+########################################################################
+# is_not_writable (<name>)
+#
+# Test whether `name' is a not a writable file or directory.
+#
+# Arguments : >=1 (empty allowed), more args are ignored
+#
+is_not_writable()
+{
+ func_check is_not_writable '>=' 1 "$@";
+ if is_writable "$1"
+ then
+ eval "${return_no}";
+ fi;
+ eval "${return_yes}";
+}
+
+
+########################################################################
+# is_not_X ()
+#
+# Test whether not running in X Window by checking $DISPLAY
+#
+is_not_X()
+{
+ func_check is_X '=' 0 "$@";
+ if obj DISPLAY is_empty
+ then
+ eval "${return_yes}";
+ fi;
+ eval "${return_no}";
+}
+
+
+########################################################################
+# is_not_yes (<string>)
+#
+# Test whether `string' is not "yes".
+#
+# Arguments : 1
+#
+is_not_yes()
+{
+ func_check is_not_yes = 1 "$@";
+ if is_yes "$1"
+ then
+ eval "${return_no}";
+ fi;
+ eval "${return_yes}";
+}
+
+
+########################################################################
+# is_prog ([<name> [<arg>*]])
+#
+# Determine whether <name> is a program in $PATH
+#
+# Arguments : >=0 (empty allowed)
+# <arg>* are ignored, this allows to specify progs with arguments.
+#
+is_prog()
+{
+ func_check is_prog '>=' 0 "$@";
+ case "$#" in
+ 0)
+ eval "${return_no}";
+ ;;
+ *)
+ if where_is "$1" >${_NULL_DEV}
+ then
+ eval "${return_yes}";
+ fi;
+ ;;
+ esac
+ eval "${return_no}";
+}
+
+
+########################################################################
+# is_writable (<name>)
+#
+# Test whether `name' is a writable file or directory.
+#
+# Arguments : >=1 (empty allowed), more args are ignored
+#
+is_writable()
+{
+ func_check is_writable '>=' 1 "$@";
+ if test _"$1"_ = __
+ then
+ eval "${return_no}";
+ fi;
+ if test -r "$1"
+ then
+ if test -w "$1"
+ then
+ eval "${return_yes}";
+ fi;
+ fi;
+ eval "${return_no}";
+}
+
+
+########################################################################
+# is_X ()
+#
+# Test whether running in X Window by checking $DISPLAY
+#
+is_X()
+{
+ func_check is_X '=' 0 "$@";
+ if obj DISPLAY is_not_empty
+ then
+ eval "${return_yes}";
+ fi;
+ eval "${return_no}";
+}
+
+
+########################################################################
+# is_yes (<string>)
+#
+# Test whether `string' has value "yes".
+#
+# Return : `0' if arg1 is `yes', `1' otherwise.
+#
+is_yes()
+{
+ func_check is_yes '=' 1 "$@";
+ if is_equal "$1" 'yes'
+ then
+ eval "${return_yes}";
+ fi;
+ eval "${return_no}";
+}
+
+
+########################################################################
+# landmark ()
+#
+# Print debugging information on standard error if $_DEBUG_LM is `yes'.
+#
+# Globals: $_DEBUG_LM
+#
+# Defined in section `Debugging functions'.
+
+
+########################################################################
+# leave ([<code>])
+#
+# Clean exit without an error or with <code>.
+#
+leave()
+{
+ clean_up;
+ if test $# = 0
+ then
+ exit "${_OK}";
+ else
+ exit "$1";
+ fi;
+}
+
+
+########################################################################
+landmark '6: list_*()';
+########################################################################
+#
+# `list' is an object class that represents an array or list. Its
+# data consists of space-separated single-quoted elements. So a list
+# has the form "'first' 'second' '...' 'last'". See list_append() for
+# more details on the list structure. The array elements of `list'
+# can be get by `eval set x "$list"; shift`.
+
+
+########################################################################
+# list_append (<list> <element>...)
+#
+# Arguments: >=2
+# <list>: a variable name for a list of single-quoted elements
+# <element>: some sequence of characters.
+# Output: none, but $<list> is set to
+# if <list> is empty: "'<element>' '...'"
+# otherwise: "$list '<element>' ..."
+#
+# Variable prefix: la
+#
+list_append()
+{
+ func_check list_append '>=' 2 "$@";
+ la_name="$1";
+ eval la_list='"${'$1'}"';
+ shift;
+ for s
+ do
+ la_s="$s";
+ case "${la_s}" in
+ *\'*)
+ # escape each single quote by replacing each
+ # "'" (squote) by "'\''" (squote bslash squote squote);
+ # note that the backslash must be doubled in the following `sed'
+ la_element="$(echo1 "${la_s}" | sed -e 's/'"${_SQ}"'/&\\&&/g')";
+ exit_test;
+ ;;
+ '')
+ la_element="";
+ ;;
+ *)
+ la_element="${la_s}";
+ ;;
+ esac;
+ if obj la_list is_empty
+ then
+ la_list="'${la_element}'";
+ else
+ la_list="${la_list} '${la_element}'";
+ fi;
+ done;
+ eval "${la_name}"='"${la_list}"';
+ eval ${_UNSET} la_element;
+ eval ${_UNSET} la_list;
+ eval ${_UNSET} la_name;
+ eval ${_UNSET} la_s;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# list_from_cmdline (<pre_name_of_opt_lists> [<cmdline_arg>...])
+#
+# Transform command line arguments into a normalized form.
+#
+# Options, option arguments, and file parameters are identified and
+# output each as a single-quoted argument of its own. Options and
+# file parameters are separated by a '--' argument.
+#
+# Arguments: >=1
+# <pre_name>: common part of a set of 4 environment variable names:
+# $<pre_name>_SHORT_NA: list of short options without an arg.
+# $<pre_name>_SHORT_ARG: list of short options that have an arg.
+# $<pre_name>_LONG_NA: list of long options without an arg.
+# $<pre_name>_LONG_ARG: list of long options that have an arg.
+# <cmdline_arg>...: the arguments from a command line, such as "$@",
+# the content of a variable, or direct arguments.
+#
+# Output: ['-[-]opt' ['optarg']]... '--' ['filename']...
+#
+# Example:
+# list_from_cmdline PRE 'a b' 'c' '' 'long' -a f1 -bcarg --long=larg f2
+# If $PRE_SHORT_NA, $PRE_SHORT_ARG, $PRE_LONG_NA, and $PRE_LONG_ARG are
+# none-empty option lists, this will result in printing:
+# '-a' '-b' '-c' 'arg' '--long' 'larg' '--' 'f1' 'f2'
+#
+# Use this function in the following way:
+# eval set x "$(args_norm PRE_NAME "$@")";
+# shift;
+# while test "$1" != '--'; do
+# case "$1" in
+# ...
+# esac;
+# shift;
+# done;
+# shift; #skip '--'
+# # all positional parameters ("$@") left are file name parameters.
+#
+# Variable prefix: lfc
+#
+list_from_cmdline()
+{
+ func_check list_from_cmdline '>=' 1 "$@";
+ lfc_short_n="$(obj_data "$1"_SHORT_NA)"; # short options, no argument
+ lfc_short_a="$(obj_data "$1"_SHORT_ARG)"; # short options, with argument
+ lfc_long_n="$(obj_data "$1"_LONG_NA)"; # long options, no argument
+ lfc_long_a="$(obj_data "$1"_LONG_ARG)"; # long options, with argument
+ exit_test;
+ if obj lfc_short_n is_empty
+ then
+ error 'list_from_cmdline(): no $'"$1"'_SHORT_NA options.';
+ fi;
+ if obj lfc_short_a is_empty
+ then
+ error 'list_from_cmdline(): no $'"$1"'_SHORT_ARG options.';
+ fi;
+ if obj lfc_long_n is_empty
+ then
+ error 'list_from_cmdline(): no $'"$1"'_LONG_NA options.';
+ fi;
+ if obj lfc_long_a is_empty
+ then
+ error 'list_from_cmdline(): no $'"$1"'_LONG_ARG options.';
+ fi;
+
+ shift;
+ if is_equal "$#" 0
+ then
+ echo1 --
+ eval ${_UNSET} lfc_fparams;
+ eval ${_UNSET} lfc_short_a;
+ eval ${_UNSET} lfc_short_n;
+ eval ${_UNSET} lfc_long_a;
+ eval ${_UNSET} lfc_long_n;
+ eval ${_UNSET} lfc_result;
+ eval "${return_ok}";
+ fi;
+
+ lfc_fparams='';
+ lfc_result='';
+ while test "$#" -ge 1
+ do
+ lfc_arg="$1";
+ shift;
+ case "${lfc_arg}" in
+ --) break; ;;
+ --*=*)
+ # delete leading '--';
+ lfc_abbrev="$(echo1 "${lfc_arg}" | sed -e 's/^--//')";
+ lfc_with_equal="${lfc_abbrev}";
+ # extract option by deleting from the first '=' to the end
+ lfc_abbrev="$(echo1 "${lfc_with_equal}" | \
+ sed -e 's/^\([^=]*\)=.*$/\1/')";
+ lfc_opt="$(list_single_from_abbrev lfc_long_a "${lfc_abbrev}")";
+ exit_test;
+ if obj lfc_opt is_empty
+ then
+ error_user "--${lfc_abbrev} is not an option.";
+ else
+ # get the option argument by deleting up to first `='
+ lfc_optarg="$(echo1 "${lfc_with_equal}" | sed -e 's/^[^=]*=//')";
+ exit_test;
+ list_append lfc_result "--${lfc_opt}" "${lfc_optarg}";
+ continue;
+ fi;
+ ;;
+ --*)
+ # delete leading '--';
+ lfc_abbrev="$(echo1 "${lfc_arg}" | sed -e 's/^--//')";
+ if list_has lfc_long_n "${lfc_abbrev}"
+ then
+ lfc_opt="${lfc_abbrev}";
+ else
+ exit_test;
+ lfc_opt="$(list_single_from_abbrev lfc_long_n "${lfc_abbrev}")";
+ exit_test;
+ if obj lfc_opt is_not_empty && is_not_equal "$#" 0
+ then
+ a="$(list_single_from_abbrev lfc_long_a "${lfc_abbrev}")";
+ exit_test;
+ if obj a is_not_empty
+ then
+ error_user "The abbreviation ${lfc_arg} \
+has multiple options: --${lfc_opt} and --${a}.";
+ fi;
+ fi;
+ fi;
+ if obj lfc_opt is_not_empty
+ then
+ # long option, no argument
+ list_append lfc_result "--${lfc_opt}";
+ continue;
+ fi;
+ lfc_opt="$(list_single_from_abbrev lfc_long_a "${lfc_abbrev}")";
+ exit_test;
+ if obj lfc_opt is_not_empty
+ then
+ # long option with argument
+ if test "$#" -le 0
+ then
+ error_user "no argument for option --${lfc_opt}."
+ fi;
+ list_append lfc_result "--${lfc_opt}" "$1";
+ shift;
+ continue;
+ fi;
+ error_user "${lfc_arg} is not an option.";
+ ;;
+ -?*) # short option (cluster)
+ # delete leading `-';
+ lfc_rest="$(echo1 "${lfc_arg}" | sed -e 's/^-//')";
+ exit_test;
+ while obj lfc_rest is_not_empty
+ do
+ # get next short option from cluster (first char of $lfc_rest)
+ lfc_optchar="$(echo1 "${lfc_rest}" | sed -e 's/^\(.\).*$/\1/')";
+ # remove first character from ${lfc_rest};
+ lfc_rest="$(echo1 "${lfc_rest}" | sed -e 's/^.//')";
+ exit_test;
+ if list_has lfc_short_n "${lfc_optchar}"
+ then
+ list_append lfc_result "-${lfc_optchar}";
+ continue;
+ elif list_has lfc_short_a "${lfc_optchar}"
+ then
+ if obj lfc_rest is_empty
+ then
+ if test "$#" -ge 1
+ then
+ list_append lfc_result "-${lfc_optchar}" "$1";
+ shift;
+ continue;
+ else
+ error_user "no argument for option -${lfc_optchar}.";
+ fi;
+ else # rest is the argument
+ list_append lfc_result "-${lfc_optchar}" "${lfc_rest}";
+ lfc_rest='';
+ continue;
+ fi;
+ else
+ error_user "unknown option -${lfc_optchar}.";
+ fi;
+ done;
+ ;;
+ *)
+ # Here, $lfc_arg is not an option, so a file parameter.
+ list_append lfc_fparams "${lfc_arg}";
+
+ # Ignore the strange POSIX option handling to end option
+ # parsing after the first file name argument. To reuse it, do
+ # a `break' here if $POSIXLY_CORRECT of `bash' is not empty.
+ # When `bash' is called as `sh' $POSIXLY_CORRECT is set
+ # automatically to `y'.
+ ;;
+ esac;
+ done;
+ list_append lfc_result '--';
+ if obj lfc_fparams is_not_empty
+ then
+ lfc_result="${lfc_result} ${lfc_fparams}";
+ fi;
+ if test "$#" -gt 0
+ then
+ list_append lfc_result "$@";
+ fi;
+ obj lfc_result echo1;
+ eval ${_UNSET} lfc_abbrev;
+ eval ${_UNSET} lfc_fparams;
+ eval ${_UNSET} lfc_short_a;
+ eval ${_UNSET} lfc_short_n;
+ eval ${_UNSET} lfc_long_a;
+ eval ${_UNSET} lfc_long_n;
+ eval ${_UNSET} lfc_result;
+ eval ${_UNSET} lfc_arg;
+ eval ${_UNSET} lfc_opt;
+ eval ${_UNSET} lfc_opt_arg;
+ eval ${_UNSET} lfc_opt_char;
+ eval ${_UNSET} lfc_with_equal;
+ eval ${_UNSET} lfc_rest;
+ eval "${return_ok}";
+} # list_from_cmdline()
+
+
+########################################################################
+# list_from_split (<string> <separator>)
+#
+# In <string>, escape all white space characters and replace each
+# <separator> by space.
+#
+# Arguments: 2: a <string> that is to be split into parts divided by
+# <separator>
+# Output: the resulting list string
+#
+# Variable prefix: lfs
+#
+list_from_split()
+{
+ func_check list_from_split = 2 "$@";
+
+ # precede each space or tab by a backslash `\' (doubled for `sed')
+ lfs_s="$(echo1 "$1" | sed -e 's/\('"${_SPACE_SED}"'\)/\\\1/g')";
+ exit_test;
+
+ # replace split character of string by the list separator ` ' (space).
+ case "$2" in
+ /) # cannot use normal `sed' separator
+ echo1 "${lfs_s}" | sed -e 's|'"$2"'| |g';
+ ;;
+ ?) # use normal `sed' separator
+ echo1 "${lfs_s}" | sed -e 's/'"$2"'/ /g';
+ ;;
+ ??*)
+ error 'list_from_split(): separator must be a single character.';
+ ;;
+ esac;
+ eval ${_UNSET} lfs_s;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# list_get (<list>)
+#
+# Check whether <list> is a space-separated list of '-quoted elements.
+#
+# If the test fails an error is raised.
+# If the test succeeds the argument is echoed.
+#
+# Testing criteria:
+# A list has the form "'first' 'second' '...' 'last'". So it has a
+# leading and a final quote and the elements are separated by "' '"
+# constructs. If these are all removed there should not be any
+# unescaped single-quotes left. Watch out for escaped single
+# quotes; they have the form '\'' (sq bs sq sq).
+
+# Arguments: 1
+# Output: the argument <list> unchanged, if the check succeeded.
+#
+# Variable prefix: lg
+#
+list_get()
+{
+ func_check list_get = 1 "$@";
+ eval lg_list='"${'$1'}"';
+ # remove leading and final space characters
+ lg_list="$(echo1 "${lg_list}" | sed -e '
+s/^'"${_SPACE_SED}"'*//
+s/'"${_SPACE_SED}"'*$//
+')";
+ exit_test;
+ case "${lg_list}" in
+ '')
+ eval ${_UNSET} lg_list;
+ eval "${return_ok}";
+ ;;
+ \'*\')
+ obj lg_list echo1;
+ eval ${_UNSET} lg_list;
+ eval "${return_ok}";
+ ;;
+ *)
+ error "list_get(): bad list: $1"
+ ;;
+ esac;
+ eval ${_UNSET} lg_list;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# list_has (<var_name> <element>)
+#
+# Test whether the list <var_name> has the element <element>.
+#
+# Arguments: 2
+# <var_name>: a variable name for a list of single-quoted elements
+# <element>: some sequence of characters.
+#
+# Variable prefix: lh
+#
+list_has()
+{
+ func_check list_has = 2 "$@";
+ eval lh_list='"${'$1'}"';
+ if obj lh_list is_empty
+ then
+ eval "${_UNSET}" lh_list;
+ eval "${return_no}";
+ fi;
+ case "$2" in
+ \'*\') lh_element=" $2 "; ;;
+ *) lh_element=" '$2' "; ;;
+ esac;
+ if string_contains " ${lh_list} " "${lh_element}"
+ then
+ eval "${_UNSET}" lh_list;
+ eval "${_UNSET}" lh_element;
+ eval "${return_yes}";
+ else
+ eval "${_UNSET}" lh_list;
+ eval "${_UNSET}" lh_element;
+ eval "${return_no}";
+ fi;
+}
+
+
+########################################################################
+# list_has_abbrev (<var_name> <abbrev>)
+#
+# Test whether the list <var_name> has an element starting with <abbrev>.
+#
+# Arguments: 2
+# <var_name>: a variable name for a list of single-quoted elements
+# <abbrev>: some sequence of characters.
+#
+# Variable prefix: lha
+#
+list_has_abbrev()
+{
+ func_check list_has_abbrev = 2 "$@";
+ eval lha_list='"${'$1'}"';
+ if obj lha_list is_empty
+ then
+ eval "${_UNSET}" lha_list;
+ eval "${return_no}";
+ fi;
+ case "$2" in
+ \'*)
+ lha_element="$(echo1 "$2" | sed -e 's/'"${_SQ}"'$//')";
+ exit_test;
+ ;;
+ *) lha_element="'$2"; ;;
+ esac;
+ if string_contains " ${lha_list}" " ${lha_element}"
+ then
+ eval "${_UNSET}" lha_list;
+ eval "${_UNSET}" lha_element;
+ eval "${return_yes}";
+ else
+ eval "${_UNSET}" lha_list;
+ eval "${_UNSET}" lha_element;
+ eval "${return_no}";
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# list_has_not (<list> <element>)
+#
+# Test whether <list> has no <element>.
+#
+# Arguments: 2
+# <list>: a space-separated list of single-quoted elements.
+# <element>: some sequence of characters.
+#
+# Variable prefix: lhn
+#
+list_has_not()
+{
+ func_check list_has_not = 2 "$@";
+ eval lhn_list='"${'$1'}"';
+ if obj lhn_list is_empty
+ then
+ eval "${_UNSET}" lhn_list;
+ eval "${return_yes}";
+ fi;
+ case "$2" in
+ \'*\') lhn_element=" $2 "; ;;
+ *) lhn_element=" '$2' "; ;;
+ esac;
+ if string_contains " ${lhn_list} " "${lhn_element}"
+ then
+ eval "${_UNSET}" lhn_list;
+ eval "${_UNSET}" lhn_element;
+ eval "${return_no}";
+ else
+ eval "${_UNSET}" lhn_list;
+ eval "${_UNSET}" lhn_element;
+ eval "${return_yes}";
+ fi;
+}
+
+
+########################################################################
+# list_single_from_abbrev (<list> <abbrev>)
+#
+# Check whether the list has an element starting with <abbrev>. If
+# there are more than a single element an error is created.
+#
+# Arguments: 2
+# <list>: a variable name for a list of single-quoted elements
+# <abbrev>: some sequence of characters.
+#
+# Output: the found element.
+#
+# Variable prefix: lsfa
+#
+list_single_from_abbrev()
+{
+ func_check list_single_from_abbrev = 2 "$@";
+ eval lsfa_list='"${'$1'}"';
+ if obj lsfa_list is_empty
+ then
+ eval "${_UNSET}" lsfa_list;
+ eval "${return_no}";
+ fi;
+ lsfa_abbrev="$2";
+ if list_has lsfa_list "${lsfa_abbrev}"
+ then
+ obj lsfa_abbrev echo1;
+ eval "${_UNSET}" lsfa_abbrev;
+ eval "${_UNSET}" lsfa_list;
+ eval "${return_yes}";
+ fi;
+ if list_has_abbrev lsfa_list "${lsfa_abbrev}"
+ then
+ lsfa_element='';
+ eval set x "${lsfa_list}";
+ shift;
+ for i
+ do
+ case "$i" in
+ ${lsfa_abbrev}*)
+ if obj lsfa_element is_not_empty
+ then
+ error_user "The abbreviation --${lsfa_abbrev} \
+has multiple options: --${lsfa_element} and --${i}.";
+ fi;
+ lsfa_element="$i";
+ ;;
+ esac;
+ done;
+ obj lsfa_element echo1;
+ eval "${_UNSET}" lsfa_abbrev;
+ eval "${_UNSET}" lsfa_element;
+ eval "${_UNSET}" lsfa_list;
+ eval "${return_yes}";
+ else
+ eval "${_UNSET}" lsfa_abbrev;
+ eval "${_UNSET}" lsfa_element;
+ eval "${_UNSET}" lsfa_list;
+ eval "${return_no}";
+ fi;
+}
+
+
+########################################################################
+landmark '7: man_*()';
+########################################################################
+
+########################################################################
+# man_do_filespec (<filespec>)
+#
+# Print suitable man page(s) for filespec to $_TMP_CAT.
+#
+# Arguments : 2
+# <filespec>: argument of the form `man:name.section', `man:name',
+# `man:name(section)', `name.section', `name'.
+#
+# Globals : $_OPT_ALL
+#
+# Output : none.
+# Return : `0' if man page was found, `1' else.
+#
+# Only called from do_fileargs(), checks on $MANPATH and $_MAN_ENABLE
+# are assumed (see man_setup()).
+#
+# Variable prefix: mdf
+#
+man_do_filespec()
+{
+ func_check man_do_filespec = 1 "$@";
+ if obj _MAN_PATH is_empty
+ then
+ eval "${return_bad}";
+ fi;
+ if is_empty "$1"
+ then
+ eval "${return_bad}";
+ fi;
+ mdf_spec="$1";
+ mdf_name='';
+ mdf_section='';
+ case "${mdf_spec}" in
+ */*) # not a man spec with containing '/'
+ eval ${_UNSET} mdf_got_one;
+ eval ${_UNSET} mdf_name;
+ eval ${_UNSET} mdf_section;
+ eval ${_UNSET} mdf_spec;
+ eval "${return_bad}";
+ ;;
+ man:?*\(?*\)) # man:name(section)
+ mdf_name="$(echo1 "${mdf_spec}" \
+ | sed -e 's/^man:\(..*\)(\(..*\))$/\1/')";
+ mdf_section="$(echo1 "${mdf_spec}" \
+ | sed -e 's/^man:\(..*\)(\(..*\))$/\2/')";
+ exit_test;
+ ;;
+ man:?*.${_MAN_AUTO_SEC_CHARS}) # man:name.section
+ mdf_name="$(echo1 "${mdf_spec}" \
+ | sed -e 's/^man:\(..*\)\..$/\1/')";
+ mdf_section="$(echo1 "${mdf_spec}" \
+ | sed -e 's/^.*\(.\)$/\1/')";
+ exit_test;
+ ;;
+ man:?*) # man:name
+ mdf_name="$(echo1 "${mdf_spec}" | sed -e 's/^man://')";
+ exit_test;
+ ;;
+ ?*\(?*\)) # name(section)
+ mdf_name="$(echo1 "${mdf_spec}" \
+ | sed -e 's/^\(..*\)(\(..*\))$/\1/')";
+ mdf_section="$(echo1 "${mdf_spec}" \
+ | sed -e 's/^\(..*\)(\(..*\))$/\2/')";
+ exit_test;
+ ;;
+ ?*.${_MAN_AUTO_SEC_CHARS}) # name.section
+ mdf_name="$(echo1 "${mdf_spec}" \
+ | sed -e 's/^\(..*\)\..$/\1/')";
+ mdf_section="$(echo1 "${mdf_spec}" \
+ | sed -e 's/^.*\(.\)$/\1/')";
+ exit_test;
+ ;;
+ ?*)
+ mdf_name="${mdf_spec}";
+ ;;
+ esac;
+ if obj mdf_name is_empty
+ then
+ eval ${_UNSET} mdf_got_one;
+ eval ${_UNSET} mdf_name;
+ eval ${_UNSET} mdf_section;
+ eval ${_UNSET} mdf_spec;
+ eval "${return_bad}";
+ fi;
+ mdf_got_one='no';
+ if obj mdf_section is_empty
+ then
+ if obj _OPT_SECTIONS is_empty
+ then
+ eval set x "${_MAN_AUTO_SEC_LIST}";
+ else
+ # use --sections when no section is given to filespec
+ eval set x "$(echo1 "${_OPT_SECTIONS}" | sed -e 's/:/ /g')";
+ fi;
+ shift;
+ for s
+ do
+ mdf_s="$s";
+ if man_search_section "${mdf_name}" "${mdf_s}"
+ then # found
+ if obj _MAN_ALL is_yes
+ then
+ mdf_got_one='yes';
+ else
+ eval ${_UNSET} mdf_got_one;
+ eval ${_UNSET} mdf_name;
+ eval ${_UNSET} mdf_s;
+ eval ${_UNSET} mdf_section;
+ eval ${_UNSET} mdf_spec;
+ eval "${return_good}";
+ fi;
+ fi;
+ done;
+ else
+ if man_search_section "${mdf_name}" "${mdf_section}"
+ then
+ eval ${_UNSET} mdf_got_one;
+ eval ${_UNSET} mdf_name;
+ eval ${_UNSET} mdf_s;
+ eval ${_UNSET} mdf_section;
+ eval ${_UNSET} mdf_spec;
+ eval "${return_good}";
+ else
+ eval ${_UNSET} mdf_got_one;
+ eval ${_UNSET} mdf_name;
+ eval ${_UNSET} mdf_section;
+ eval ${_UNSET} mdf_spec;
+ eval "${return_bad}";
+ fi;
+ fi;
+ if obj _MAN_ALL is_yes && obj mdf_got_one is_yes
+ then
+ eval ${_UNSET} mdf_got_one;
+ eval ${_UNSET} mdf_name;
+ eval ${_UNSET} mdf_s;
+ eval ${_UNSET} mdf_section;
+ eval ${_UNSET} mdf_spec;
+ eval "${return_good}";
+ fi;
+ eval ${_UNSET} mdf_got_one;
+ eval ${_UNSET} mdf_name;
+ eval ${_UNSET} mdf_s;
+ eval ${_UNSET} mdf_section;
+ eval ${_UNSET} mdf_spec;
+ eval "${return_bad}";
+} # man_do_filespec()
+
+
+########################################################################
+# man_register_file (<file> <name> [<section>])
+#
+# Write a found man page file and register the title element.
+#
+# Arguments: 1, 2, or 3; maybe empty
+# Output: none
+#
+man_register_file()
+{
+ func_check man_register_file '>=' 2 "$@";
+ case "$#" in
+ 2|3) do_nothing; ;;
+ *)
+ error "man_register_file() expects 2 or 3 arguments.";
+ ;;
+ esac;
+ if is_empty "$1"
+ then
+ error 'man_register_file(): file name is empty';
+ fi;
+ to_tmp "$1";
+ case "$#" in
+ 2)
+ register_title "man:$2";
+ eval "${return_ok}";
+ ;;
+ 3)
+ register_title "$2.$3";
+ eval "${return_ok}";
+ ;;
+ esac;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# man_search_section (<name> <section>)
+#
+# Retrieve man pages.
+#
+# Arguments : 2
+# Globals : $_MAN_PATH, $_MAN_EXT
+# Return : 0 if found, 1 otherwise
+#
+# Variable prefix: mss
+#
+man_search_section()
+{
+ func_check man_search_section = 2 "$@";
+ if obj _MAN_PATH is_empty
+ then
+ eval "${return_bad}";
+ fi;
+ if is_empty "$1"
+ then
+ eval "${return_bad}";
+ fi;
+ if is_empty "$2"
+ then
+ eval "${return_bad}";
+ fi;
+ mss_name="$1";
+ mss_section="$2";
+ eval set x "$(path_split "${_MAN_PATH}")";
+ exit_test;
+ shift;
+ mss_got_one='no';
+ if obj _MAN_EXT is_empty
+ then
+ for d
+ do
+ mss_dir="$(dirname_append "$d" "man${mss_section}")";
+ exit_test;
+ if obj mss_dir is_dir
+ then
+ mss_prefix="$(\
+ dirname_append "${mss_dir}" "${mss_name}.${mss_section}")";
+ if obj _OPT_WHATIS is_yes
+ then
+ mss_files="$(eval ls "${mss_prefix}"'*' 2>${_NULL_DEV} |
+ sed -e '\| found|s|.*||'
+ )";
+ else
+ mss_files="$(eval ls "'${mss_prefix}'"'*' 2>${_NULL_DEV} |
+ sed -e '\| found|s|.*||'
+ )";
+ fi;
+ exit_test;
+ if obj mss_files is_not_empty
+ then
+ # for f in $mss_files
+ for f in $(eval set x ${mss_files}; shift; echo1 "$@")
+ do
+ exit_test;
+ mss_f="$f";
+ if obj mss_f is_file
+ then
+ if is_yes "${mss_got_one}"
+ then
+ register_file "${mss_f}";
+ elif obj _MAN_ALL is_yes
+ then
+ man_register_file "${mss_f}" "${mss_name}";
+ else
+ man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
+ eval ${_UNSET} mss_dir;
+ eval ${_UNSET} mss_ext;
+ eval ${_UNSET} mss_f;
+ eval ${_UNSET} mss_files;
+ eval ${_UNSET} mss_got_one;
+ eval ${_UNSET} mss_name;
+ eval ${_UNSET} mss_prefix;
+ eval ${_UNSET} mss_section;
+ eval "${return_good}";
+ fi;
+ mss_got_one='yes';
+ fi;
+ done;
+ fi;
+ fi;
+ done;
+ else
+ mss_ext="${_MAN_EXT}";
+ # check for directory name having trailing extension
+ for d
+ do
+ mss_dir="$(dirname_append $d man${mss_section}${mss_ext})";
+ exit_test;
+ if obj mss_dir is_dir
+ then
+ mss_prefix=\
+ "$(dirname_append "${mss_dir}" "${mss_name}.${mss_section}")";
+ mss_files="$( eval ls "${mss_prefix}"'*' 2>${_NULL_DEV} |
+ sed -e '\|not found|s|.*||'
+ )";
+ exit_test;
+ if obj mss_files is_not_empty
+ then
+ # for f in $mss_files
+ for f in $(eval set x ${mss_files}; shift; echo1 "$@")
+ do
+ mss_f="$f";
+ if obj mss_f is_file
+ then
+ if is_yes "${mss_got_one}"
+ then
+ register_file "${mss_f}";
+ elif obj _MAN_ALL is_yes
+ then
+ man_register_file "${mss_f}" "${mss_name}";
+ else
+ man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
+ eval ${_UNSET} mss_dir;
+ eval ${_UNSET} mss_ext;
+ eval ${_UNSET} mss_f;
+ eval ${_UNSET} mss_files;
+ eval ${_UNSET} mss_got_one;
+ eval ${_UNSET} mss_name;
+ eval ${_UNSET} mss_prefix;
+ eval ${_UNSET} mss_section;
+ eval "${return_good}";
+ fi;
+ mss_got_one='yes';
+ fi;
+ done;
+ fi;
+ fi;
+ done;
+ # check for files with extension in directories without extension
+ for d
+ do
+ mss_dir="$(dirname_append "$d" "man${mss_section}")";
+ exit_test;
+ if obj mss_dir is_dir
+ then
+ mss_prefix="$(dirname_append "${mss_dir}" \
+ "${mss_name}.${mss_section}${mss_ext}")";
+ mss_files="$(eval ls "${mss_prefix}"'*' 2>${_NULL_DEV} |
+ sed -e '\|not found|s|.*||'
+ )";
+ exit_test;
+ if obj mss_files is_not_empty
+ then
+ # for f in $mss_files
+ for f in $(eval set x ${mss_files}; shift; echo1 "$@")
+ do
+ mss_f="$f";
+ if obj mss_f is_file
+ then
+ if is_yes "${mss_got_one}"
+ then
+ register_file "${mss_f}";
+ elif obj _MAN_ALL is_yes
+ then
+ man_register_file "${mss_f}" "${mss_name}";
+ else
+ man_register_file "${mss_f}" "${mss_name}" "${mss_section}";
+ eval ${_UNSET} mss_dir;
+ eval ${_UNSET} mss_ext;
+ eval ${_UNSET} mss_f;
+ eval ${_UNSET} mss_files;
+ eval ${_UNSET} mss_got_one;
+ eval ${_UNSET} mss_name;
+ eval ${_UNSET} mss_prefix;
+ eval ${_UNSET} mss_section;
+ eval "${return_good}";
+ fi;
+ mss_got_one='yes';
+ fi;
+ done;
+ fi;
+ fi;
+ done;
+ fi;
+ if obj _MAN_ALL is_yes && is_yes "${mss_got_one}"
+ then
+ eval ${_UNSET} mss_dir;
+ eval ${_UNSET} mss_ext;
+ eval ${_UNSET} mss_f;
+ eval ${_UNSET} mss_files;
+ eval ${_UNSET} mss_got_one;
+ eval ${_UNSET} mss_name;
+ eval ${_UNSET} mss_prefix;
+ eval ${_UNSET} mss_section;
+ eval "${return_good}";
+ fi;
+ eval ${_UNSET} mss_dir;
+ eval ${_UNSET} mss_ext;
+ eval ${_UNSET} mss_f;
+ eval ${_UNSET} mss_files;
+ eval ${_UNSET} mss_got_one;
+ eval ${_UNSET} mss_name;
+ eval ${_UNSET} mss_prefix;
+ eval ${_UNSET} mss_section;
+ eval "${return_bad}";
+} # man_search_section()
+
+
+########################################################################
+# man_setup ()
+#
+# Setup the variables $_MAN_* needed for man page searching.
+#
+# Globals:
+# in: $_OPT_*, $_MANOPT_*, $LANG, $LC_MESSAGES, $LC_ALL,
+# $MANPATH, $MANROFFSEQ, $MANSEC, $PAGER, $SYSTEM, $MANOPT.
+# out: $_MAN_PATH, $_MAN_LANG, $_MAN_SYS, $_MAN_LANG, $_MAN_LANG2,
+# $_MAN_SEC, $_MAN_ALL
+# in/out: $_MAN_ENABLE
+#
+# The precedence for the variables related to `man' is that of GNU
+# `man', i.e.
+#
+# $LANG; overridden by
+# $LC_MESSAGES; overridden by
+# $LC_ALL; this has the same precedence as
+# $MANPATH, $MANROFFSEQ, $MANSEC, $PAGER, $SYSTEM; overridden by
+# $MANOPT; overridden by
+# the groffer command line options.
+#
+# Variable prefix: ms
+#
+man_setup()
+{
+ func_check main_man_setup = 0 "$@";
+
+ if obj _MAN_IS_SETUP is_yes
+ then
+ eval "${return_ok}";
+ fi;
+ _MAN_IS_SETUP='yes';
+
+ if obj _MAN_ENABLE is_not_yes
+ then
+ eval "${return_ok}";
+ fi;
+
+ # determine basic path for man pages
+ _MAN_PATH="$(get_first_essential \
+ "${_OPT_MANPATH}" "${_MANOPT_PATH}" "${MANPATH}")";
+ exit_test;
+ if obj _MAN_PATH is_empty
+ then
+ manpath_set_from_path;
+ else
+ _MAN_PATH="$(path_clean "${_MAN_PATH}")";
+ exit_test;
+ fi;
+ if obj _MAN_PATH is_empty
+ then
+ if is_prog 'manpath'
+ then
+ _MAN_PATH="$(manpath 2>${_NULL_DEV})"; # not always available
+ exit_test;
+ fi;
+ fi;
+ if obj _MAN_PATH is_empty
+ then
+ _MAN_ENABLE="no";
+ eval "${return_ok}";
+ fi;
+
+ _MAN_ALL="$(get_first_essential "${_OPT_ALL}" "${_MANOPT_ALL}")";
+ exit_test;
+ if obj _MAN_ALL is_empty
+ then
+ _MAN_ALL='no';
+ fi;
+
+ _MAN_SYS="$(get_first_essential \
+ "${_OPT_SYSTEMS}" "${_MANOPT_SYS}" "${SYSTEM}")";
+ ms_lang="$(get_first_essential \
+ "${_OPT_LANG}" "${LC_ALL}" "${LC_MESSAGES}" "${LANG}")";
+ exit_test;
+ case "${ms_lang}" in
+ C|POSIX)
+ _MAN_LANG="";
+ _MAN_LANG2="";
+ ;;
+ ?)
+ _MAN_LANG="${ms_lang}";
+ _MAN_LANG2="";
+ ;;
+ *)
+ _MAN_LANG="${ms_lang}";
+ # get first two characters of $ms_lang
+ _MAN_LANG2="$(echo1 "${ms_lang}" | sed -e 's/^\(..\).*$/\1/')";
+ exit_test;
+ ;;
+ esac;
+ # from now on, use only $_LANG, forget about $_OPT_LANG, $LC_*.
+
+ manpath_add_lang_sys; # this is very slow
+
+ _MAN_SEC="$(get_first_essential \
+ "${_OPT_SECT}" "${_MANOPT_SEC}" "${MANSEC}")";
+ exit_test;
+ if obj _MAN_PATH is_empty
+ then
+ _MAN_ENABLE="no";
+ eval ${_UNSET} ms_lang;
+ eval "${return_ok}";
+ fi;
+
+ _MAN_EXT="$(get_first_essential \
+ "${_OPT_EXTENSION}" "${_MANOPT_EXTENSION}")";
+ exit_test;
+ eval ${_UNSET} ms_lang;
+ eval "${return_ok}";
+} # man_setup()
+
+
+########################################################################
+landmark '8: manpath_*()';
+########################################################################
+
+########################################################################
+# manpath_add_lang_sys ()
+#
+# Add language and operating system specific directories to man path.
+#
+# Arguments : 0
+# Output : none
+# Globals:
+# in: $_MAN_SYS: has the form `os1,os2,...', a comma separated
+# list of names of operating systems.
+# $_MAN_LANG and $_MAN_LANG2: each a single name
+# in/out: $_MAN_PATH: has the form `dir1:dir2:...', a colon
+# separated list of directories.
+#
+# Variable prefix: mals
+#
+manpath_add_lang_sys()
+{
+ func_check manpath_add_lang_sys = 0 "$@";
+ if obj _MAN_PATH is_empty
+ then
+ eval "${return_ok}";
+ fi;
+ # twice test both sys and lang
+ eval set x "$(path_split "${_MAN_PATH}")";
+ shift;
+ exit_test;
+ mals_mp='';
+ for p
+ do # loop on man path directories
+ mals_mp="$(_manpath_add_lang_sys_single "${mals_mp}" "$p")";
+ exit_test;
+ done;
+ eval set x "$(path_split "${mals_mp}")";
+ shift;
+ exit_test;
+ for p
+ do # loop on man path directories
+ mals_mp="$(_manpath_add_lang_sys_single "${mals_mp}" "$p")";
+ exit_test;
+ done;
+ _MAN_PATH="$(path_chop "${mals_mp}")";
+ exit_test;
+ eval ${_UNSET} mals_mp;
+ eval "${return_ok}";
+}
+
+
+# To the directory in $1 append existing sys/lang subdirectories
+# Function is necessary to split the OS list.
+#
+# globals: in: $_MAN_SYS, $_MAN_LANG, $_MAN_LANG2
+# argument: 2: `man_path' and `dir'
+# output: colon-separated path of the retrieved subdirectories
+#
+# Variable prefix: _mals
+#
+_manpath_add_lang_sys_single()
+{
+ func_check _manpath_add_lang_sys_single = 2 "$@";
+ _mals_res="$1";
+ _mals_parent="$2";
+ eval set x "$(list_from_split "${_MAN_SYS}" ',')";
+ shift;
+ exit_test;
+ for d in "$@" "${_MAN_LANG}" "${_MAN_LANG2}"
+ do
+ _mals_dir="$(dirname_append "${_mals_parent}" "$d")";
+ exit_test;
+ if obj _mals_res path_not_contains "${_mals_dir}" && \
+ obj _mals_dir is_dir
+ then
+ _mals_res="${_mals_res}:${_mals_dir}";
+ fi;
+ done;
+ if path_not_contains "${_mals_res}" "${_mals_parent}"
+ then
+ _mals_res="${_mals_res}:${_mals_parent}";
+ fi;
+ path_chop "${_mals_res}";
+ eval ${_UNSET} _mals_dir;
+ eval ${_UNSET} _mals_parent;
+ eval ${_UNSET} _mals_res;
+ eval "${return_ok}";
+}
+
+# end manpath_add_lang_sys ()
+
+
+########################################################################
+# manpath_set_from_path ()
+#
+# Determine basic search path for man pages from $PATH.
+#
+# Return: `0' if a valid man path was retrieved.
+# Output: none
+# Globals:
+# in: $PATH
+# out: $_MAN_PATH
+#
+# Variable prefix: msfp
+#
+manpath_set_from_path()
+{
+ func_check manpath_set_from_path = 0 "$@";
+
+ msfp_manpath='';
+
+ # get a basic man path from $PATH
+ if obj PATH is_not_empty
+ then
+ eval set x "$(path_split "${PATH}")";
+ shift;
+ exit_test;
+ for d
+ do
+ # delete the final `/bin' part
+ msfp_base="$(echo1 "$d" | sed -e 's|//*bin/*$||')";
+ exit_test;
+ for e in /share/man /man
+ do
+ msfp_mandir="${msfp_base}$e";
+ if test -d "${msfp_mandir}" && test -r "${msfp_mandir}"
+ then
+ msfp_manpath="${msfp_manpath}:${msfp_mandir}";
+ fi;
+ done;
+ done;
+ fi;
+
+ # append some default directories
+ for d in /usr/local/share/man /usr/local/man \
+ /usr/share/man /usr/man \
+ /usr/X11R6/man /usr/openwin/man \
+ /opt/share/man /opt/man \
+ /opt/gnome/man /opt/kde/man
+ do
+ msfp_d="$d";
+ if obj msfp_manpath path_not_contains "${msfp_d}" && obj mfsp_d is_dir
+ then
+ msfp_manpath="${msfp_manpath}:${mfsp_d}";
+ fi;
+ done;
+
+ _MAN_PATH="${msfp_manpath}";
+ eval ${_UNSET} msfp_base;
+ eval ${_UNSET} msfp_d;
+ eval ${_UNSET} msfp_mandir;
+ eval ${_UNSET} msfp_manpath;
+ eval "${return_ok}";
+} # manpath_set_from_path()
+
+
+########################################################################
+landmark '9: obj_*()';
+########################################################################
+
+########################################################################
+# obj (<object> <call_name> <arg>...)
+#
+# This works like a method (object function) call for an object.
+# Run "<call_name> $<object> <arg> ...".
+#
+# The first argument represents an object whose data is given as first
+# argument to <call_name>().
+#
+# Argument: >=2
+# <object>: variable name
+# <call_name>: a program or function name
+#
+# Variable prefix: o
+#
+obj()
+{
+ func_check obj '>=' 2 "$@";
+ eval o_arg1='"${'$1'}"';
+ if is_empty "$2"
+ then
+ error "obj(): function name is empty."
+ else
+ o_func="$2";
+ fi;
+ shift;
+ shift;
+ eval "${o_func}"' "${o_arg1}" "$@"';
+ n="$?";
+ eval ${_UNSET} o_arg1;
+ eval ${_UNSET} o_func;
+ eval "${return_var} $n";
+} # obj()
+
+
+########################################################################
+# obj_data (<object>)
+#
+# Print the data of <object>, i.e. the content of $<object>.
+# For possible later extensions.
+#
+# Arguments: 1
+# <object>: a variable name
+# Output: the data of <object>
+#
+# Variable prefix: od
+#
+obj_data()
+{
+ func_check obj '=' 1 "$@";
+ if is_empty "$1"
+ then
+ error "obj_data(): object name is empty."
+ fi;
+ eval od_res='"${'$1'}"';
+ obj od_res echo1;
+ eval ${_UNSET} od_res;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# obj_from_output (<object> <call_name> <arg>...)
+#
+# Run '$<object>="$(<call_name> <arg>...)"' to set the result of a
+# function call to a global variable.
+#
+# Arguments: >=2
+# <object>: a variable name
+# <call_name>: the name of a function or program
+# <arg>: optional argument to <call_name>
+# Output: none
+#
+# Variable prefix: ofo
+#
+obj_from_output()
+{
+ func_check obj_from_output '>=' 2 "$@";
+ if is_empty "$1"
+ then
+ error "res(): variable name is empty.";
+ elif is_empty "$2"
+ then
+ error "res(): function name is empty."
+ else
+ ofo_result_name="$1";
+ fi;
+ shift;
+ eval "${ofo_result_name}"'="$('"$@"')"';
+ exit_test;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# obj_set (<object> <data>)
+#
+# Set the data of <object>, i.e. call "$<object>=<data>".
+#
+# Arguments: 2
+# <object>: a variable name
+# <data>: a string
+# Output:: none
+#
+obj_set()
+{
+ func_check obj_set '=' 2 "$@";
+ if is_empty "$1"
+ then
+ error "obj_set(): object name is empty."
+ fi;
+ eval "$1"='"$2"';
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# path_chop (<path>)
+#
+# Remove unnecessary colons from path.
+#
+# Argument: 1, a colon separated path.
+# Output: path without leading, double, or trailing colons.
+#
+path_chop()
+{
+ func_check path_chop = 1 "$@";
+
+ # replace multiple colons by a single colon `:'
+ # remove leading and trailing colons
+ echo1 "$1" | sed -e '
+s/^:*//
+s/:::*/:/g
+s/:*$//
+';
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# path_clean (<path>)
+#
+# Remove non-existing directories from a colon-separated list.
+#
+# Argument: 1, a colon separated path.
+# Output: colon-separated list of existing directories.
+#
+# Variable prefix: pc
+#
+path_clean()
+{
+ func_check path_clean = 1 "$@";
+ if is_not_equal "$#" 1
+ then
+ error 'path_clean() needs 1 argument.';
+ fi;
+ pc_arg="$1";
+ eval set x "$(path_split "${pc_arg}")";
+ exit_test;
+ shift;
+ pc_res="";
+ for i
+ do
+ pc_i="$i";
+ if obj pc_i is_not_empty \
+ && obj pc_res path_not_contains "${pc_i}" \
+ && obj pc_i is_dir
+ then
+ case "${pc_i}" in
+ ?*/)
+ pc_res="${pc_res}$(dirname_chop "${pc_i}")";
+ exit_test;
+ ;;
+ *)
+ pc_res="${pc_res}:${pc_i}";
+ exit_test;
+ ;;
+ esac;
+ fi;
+ done;
+ eval ${_UNSET} pc_arg;
+ eval ${_UNSET} pc_i;
+ eval ${_UNSET} pc_res;
+ if path_chop "${pc_res}"
+ then
+ eval "${return_ok}";
+ else
+ eval "${return_bad}";
+ fi;
+}
+
+
+########################################################################
+# path_contains (<path> <dir>)
+#-
+# Test whether `dir' is contained in `path', a list separated by `:'.
+#
+# Arguments : 2 arguments.
+# Return : `0' if arg2 is substring of arg1, `1' otherwise.
+#
+path_contains()
+{
+ func_check path_contains = 2 "$@";
+ case ":$1:" in
+ *":$2:"*)
+ eval "${return_yes}";
+ ;;
+ *)
+ eval "${return_no}";
+ ;;
+ esac;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# path_not_contains (<path> <dir>)
+#
+# Test whether `dir' is not contained in colon separated `path'.
+#
+# Arguments : 2 arguments.
+#
+path_not_contains()
+{
+ func_check path_not_contains = 2 "$@";
+ if path_contains "$1" "$2"
+ then
+ eval "${return_no}";
+ else
+ eval "${return_yes}";
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# path_split (<path>)
+#
+# In `path' escape white space and replace each colon by a space.
+#
+# Arguments: 1: a colon-separated path
+# Output: the resulting list, process with `eval set'
+#
+path_split()
+{
+ func_check path_split = 1 "$@";
+ list_from_split "$1" ':';
+ eval "${return_ok}";
+}
+
+
+########################################################################
+landmark '10: register_*()';
+########################################################################
+
+########################################################################
+# register_file (<filename>)
+#
+# Write a found file and register the title element.
+#
+# Arguments: 1: a file name
+# Output: none
+#
+register_file()
+{
+ func_check register_file = 1 "$@";
+ if is_empty "$1"
+ then
+ error 'register_file(): file name is empty';
+ fi;
+ if is_equal "$1" '-'
+ then
+ to_tmp "${_TMP_STDIN}";
+ register_title 'stdin';
+ else
+ to_tmp "$1";
+ register_title "$(base_name "$1")";
+ exit_test;
+ fi;
+ eval "${return_ok}";
+} # register_file()
+
+
+########################################################################
+# register_title (<filespec>)
+#
+# Create title element from <filespec> and append to $_REGISTERED_TITLE
+#
+# Globals: $_REGISTERED_TITLE (rw)
+#
+# Variable prefix: rt
+#
+register_title()
+{
+ func_check register_title '=' 1 "$@";
+ if is_empty "$1"
+ then
+ eval "${return_ok}";
+ fi;
+
+ case "${_REGISTERED_TITLE}" in
+ *\ *\ *\ *)
+ eval "${return_ok}";
+ ;;
+ esac;
+
+ # remove directory part
+ rt_title="$(base_name "$1")";
+ # replace space characters by `_'
+ rt_title="$(echo1 "${rt_title}" | sed -e 's/[ ]/_/g')";
+ # remove extension `.bz2'
+ rt_title="$(echo1 "${rt_title}" | sed -e 's/\.bz2$//')";
+ # remove extension `.gz'
+ rt_title="$(echo1 "${rt_title}" | sed -e 's/\.gz$//')";
+ # remove extension `.Z'
+ rt_title="$(echo1 "${rt_title}" | sed -e 's/\.Z$//')";
+ exit_test;
+
+ if obj rt_title is_empty
+ then
+ eval ${_UNSET} rt_title;
+ eval "${return_ok}";
+ fi;
+ if obj _REGISTERED_TITLE is_empty
+ then
+ _REGISTERED_TITLE="${rt_title}";
+ else
+ _REGISTERED_TITLE="${_REGISTERED_TITLE} ${rt_title}";
+ fi;
+ eval ${_UNSET} rt_title;
+ eval "${return_ok}";
+} # register_title()
+
+
+########################################################################
+# reset ()
+#
+# Reset the variables that can be affected by options to their default.
+#
+#
+# Defined in section `Preset' after the rudimentary shell tests.
+
+
+########################################################################
+# rm_file (<file_name>)
+#
+# Remove file if $_DEBUG_KEEP_FILES allows it.
+#
+# Globals: $_DEBUG_KEEP_FILES
+#
+rm_file()
+{
+ func_check rm_file '=' 1 "$@";
+ if is_file "$1"
+ then
+ rm -f "$1" >${_NULL_DEV} 2>&1;
+ fi;
+ if is_existing "$1"
+ then
+ eval "${return_bad}";
+ else
+ eval "${return_good}";
+ fi;
+}
+
+
+########################################################################
+# rm_file_with_debug (<file_name>)
+#
+# Remove file if $_DEBUG_KEEP_FILES allows it.
+#
+# Globals: $_DEBUG_KEEP_FILES
+#
+rm_file_with_debug()
+{
+ func_check rm_file_with_debug '=' 1 "$@";
+ if obj _DEBUG_KEEP_FILES is_not_yes
+ then
+ if is_file "$1"
+ then
+ rm -f "$1" >${_NULL_DEV} 2>&1;
+ fi;
+ fi;
+ if is_existing "$1"
+ then
+ eval "${return_bad}";
+ else
+ eval "${return_good}";
+ fi;
+}
+
+
+########################################################################
+# rm_tree (<dir_name>)
+#
+# Remove file if $_DEBUG_KEEP_FILES allows it.
+#
+# Globals: $_DEBUG_KEEP_FILES
+#
+rm_tree()
+{
+ func_check rm_tree '=' 1 "$@";
+ if is_existing "$1"
+ then
+ rm -f -r "$1" >${_NULL_DEV} 2>&1;
+ fi;
+ if is_existing "$1"
+ then
+ eval "${return_bad}";
+ else
+ eval "${return_good}";
+ fi;
+}
+
+
+########################################################################
+# save_stdin ()
+#
+# Store standard input to temporary file (with decompression).
+#
+# Variable prefix: ss
+#
+if obj _HAS_COMPRESSION is_yes
+then
+ save_stdin()
+ {
+ func_check save_stdin '=' 0 "$@";
+ ss_f="${_TMP_DIR}"/INPUT;
+ cat >"${ss_f}";
+ cat_z "${ss_f}" >"${_TMP_STDIN}";
+ rm_file "${ss_f}";
+ eval ${_UNSET} ss_f;
+ eval "${return_ok}";
+ }
+else
+ save_stdin()
+ {
+ func_check save_stdin = 0 "$@";
+ cat >"${_TMP_STDIN}";
+ eval "${return_ok}";
+ }
+fi;
+
+
+########################################################################
+# special_filespec ()
+#
+# Handle special modes like whatis and apropos.
+#
+special_filespec()
+{
+ func_check special_setup '=' 0 "$@";
+ if obj _OPT_APROPOS is_yes
+ then
+ if obj _OPT_WHATIS is_yes
+ then
+ error \
+ 'special_setup: $_OPT_APROPOS and $_OPT_WHATIS are both "yes"';
+ fi;
+ apropos_filespec;
+ eval "${return_ok}";
+ fi;
+ if obj _OPT_WHATIS is_yes
+ then
+ whatis_filespec;
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# special_setup ()
+#
+# Handle special modes like whatis and apropos.
+#
+special_setup()
+{
+ func_check special_setup '=' 0 "$@";
+ if obj _OPT_APROPOS is_yes
+ then
+ if obj _OPT_WHATIS is_yes
+ then
+ error \
+ 'special_setup: $_OPT_APROPOS and $_OPT_WHATIS are both "yes"';
+ fi;
+ apropos_setup;
+ eval "${return_ok}";
+ fi;
+ if obj _OPT_WHATIS is_yes
+ then
+ whatis_header;
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+landmark '11: stack_*()';
+########################################################################
+
+########################################################################
+# string_contains (<string> <part>)
+#
+# Test whether `part' is contained in `string'.
+#
+# Arguments : 2 text arguments.
+# Return : `0' if arg2 is substring of arg1, `1' otherwise.
+#
+string_contains()
+{
+ func_check string_contains '=' 2 "$@";
+ case "$1" in
+ *"$2"*)
+ eval "${return_yes}";
+ ;;
+ *)
+ eval "${return_no}";
+ ;;
+ esac;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# string_not_contains (<string> <part>)
+#
+# Test whether `part' is not substring of `string'.
+#
+# Arguments : 2 text arguments.
+# Return : `0' if arg2 is substring of arg1, `1' otherwise.
+#
+string_not_contains()
+{
+ func_check string_not_contains '=' 2 "$@";
+ if string_contains "$1" "$2"
+ then
+ eval "${return_no}";
+ else
+ eval "${return_yes}";
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+landmark '12: tmp_*()';
+########################################################################
+
+########################################################################
+# tmp_cat ()
+#
+# output the temporary cat file (the concatenation of all input)
+#
+tmp_cat()
+{
+ func_check tmp_cat '=' 0 "$@";
+ cat "${_TMP_CAT}";
+ eval "${return_var}" "$?";
+}
+
+
+########################################################################
+# tmp_create (<suffix>?)
+#
+# Create temporary file.
+#
+# It's safe to use the shell process ID together with a suffix to
+# have multiple temporary files.
+#
+# Globals: $_TMP_DIR
+#
+# Output : name of created file
+#
+# Variable prefix: tc
+#
+tmp_create()
+{
+ func_check tmp_create '<=' 1 "$@";
+ # the output file does not have `,' as first character, so these are
+ # different names from the output file.
+ tc_tmp="${_TMP_DIR}/,$1";
+ : >"${tc_tmp}"
+ obj tc_tmp echo1;
+ eval ${_UNSET} tc_tmp;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# to_tmp (<filename>)
+#
+# print file (decompressed) to the temporary cat file
+#
+to_tmp()
+{
+ func_check to_tmp '=' 1 "$@";
+ if obj _TMP_CAT is_empty
+ then
+ error 'to_tmp_line: $_TMP_CAT is not yet set';
+ fi;
+ if is_file "$1"
+ then
+ if obj _OPT_LOCATION is_yes
+ then
+ echo2 "$1";
+ fi;
+ if obj _OPT_WHATIS is_yes
+ then
+ whatis_filename "$1" >>"${_TMP_CAT}";
+ else
+ cat_z "$1" >>"${_TMP_CAT}";
+ fi;
+ else
+ error "to_tmp(): could not read file \`$1'.";
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# to_tmp_line ([<text>])
+#
+# print line to the temporary cat file
+#
+to_tmp_line()
+{
+ func_check to_tmp '>=' 0 "$@";
+ if obj _TMP_CAT is_empty
+ then
+ error 'to_tmp_line: $_TMP_CAT is not yet set';
+ fi;
+ echo1 "$*" >>"${_TMP_CAT}";
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# trap_set
+#
+# call function on signal 0
+#
+trap_set()
+{
+ func_check trap_set '=' 0 "$@";
+ trap 'clean_up' 0 2>${_NULL_DEV} || :;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# trap_unset ()
+#
+# disable trap on signal 0.
+#
+trap_unset()
+{
+ func_check trap_unset '=' 0 "$@";
+ trap '' 0 2>${_NULL_DEV} || :;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# usage ()
+#
+# print usage information to stderr; for groffer option --help.
+#
+usage()
+{
+ func_check usage = 0 "$@";
+ echo;
+ version;
+ echo1 'Usage: groffer [option]... [filespec]...';
+ cat <<EOF
+
+Display roff files, standard input, and/or Unix manual pages with a X
+Window viewer or in several text modes. All input is decompressed
+on-the-fly with all formats that gzip can handle.
+
+"filespec" is one of
+ "filename" name of a readable file
+ "-" for standard input
+ "man:name.n" man page "name" in section "n"
+ "man:name" man page "name" in first section found
+ "name.n" man page "name" in section "n"
+ "name" man page "name" in first section found
+and some more (see groffer(1) for details).
+
+-h --help print this usage message.
+-Q --source output as roff source.
+-T --device=name pass to groff using output device "name".
+-v --version print version information.
+-V display the groff execution pipe instead of formatting.
+-X display with "gxditview" using groff -X.
+-Z --ditroff --intermediate-output
+ generate groff intermediate output without
+ post-processing and viewing, like groff -Z.
+All other short options are interpreted as "groff" formatting options.
+
+The most important groffer long options are
+
+--apropos=name start man's "apropos" program for "name".
+--apropos-data=name
+ "apropos" for "name" in man's data sections 4, 5, 7.
+--apropos-devel=name
+ "apropos" for "name" in development sections 2, 3, 9.
+--apropos-progs=name
+ "apropos" for "name" in man's program sections 1, 6, 8.
+--auto choose mode automatically from the default mode list.
+--default reset all options to the default value.
+--default-modes=mode1,mode2,...
+ set sequence of automatically tried modes.
+--dvi display in a viewer for TeX device independent format.
+--dvi-viewer=prog choose the viewer program for dvi mode.
+--groff process like groff, disable viewing features.
+--help display this helping output.
+--html display in a web browser.
+--html-viewer=program
+ choose the web browser for html mode.
+--man check file parameters first whether they are man pages.
+--mode=auto|dvi|groff|html|pdf|ps|source|text|tty|www|x|X
+ choose display mode.
+--no-man disable man-page facility.
+--no-special disable --all, --apropos*, and --whatis
+--pager=program preset the paging program for tty mode.
+--pdf display in a PDF viewer.
+--pdf-viewer=prog choose the viewer program for pdf mode.
+--ps display in a Postscript viewer.
+--ps-viewer=prog choose the viewer program for ps mode.
+--shell=program specify a shell under which to run groffer2.sh.
+--text output in a text device without a pager.
+--tty display with a pager on text terminal even when in X.
+--tty-viewer=prog select a pager for tty mode; same as --pager.
+--whatis display the file name and description of man pages
+--www same as --html.
+--www-viewer=prog same as --html-viewer
+--x --X display with "gxditview" using an X* device.
+--x-viewer=prog choose viewer program for x mode (X mode).
+--X-viewer=prog same as "--xviewer".
+
+Development options that are not useful for normal usage:
+--debug, --debug-all, --debug-keep, --debug-lm, --debug-params,
+--debug-shell, --debug-stacks, --debug-tmpdir, --debug-user,
+--do-nothing, --print=text
+
+Viewer programs for the different modes that run on the terminal:
+--dvi-viewer-tty=prog, --html-viewer-tty=prog, --pdf-viewer-tty=prog,
+--ps-viewer-tty=prog, --tty-viewer-tty, --X-viewer-tty=prog,
+--x-viewer-tty=prog, --www-viewer-tty=prog
+
+The usual X Windows toolkit options transformed into GNU long options:
+--background=color, --bd=size, --bg=color, --bordercolor=color,
+--borderwidth=size, --bw=size, --display=Xdisplay, --fg=color,
+--fn=font, --font=font, --foreground=color, --geometry=geom, --iconic,
+--resolution=dpi, --rv, --title=text, --xrm=resource
+
+Long options of GNU "man":
+--all, --ascii, --ditroff, --extension=suffix, --locale=language,
+--local-file=name, --location, --manpath=dir1:dir2:...,
+--sections=s1:s2:..., --systems=s1,s2,..., --where, ...
+
+EOF
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# version ()
+#
+# print version information to stderr
+#
+version()
+{
+ func_check version = 0 "$@";
+ echo1 "groffer ${_PROGRAM_VERSION} of ${_LAST_UPDATE}";
+ # also display groff's version, but not the called subprograms
+ groff -v 2>&1 | sed -e '/^ *$/q' | sed -e '1s/^/is part of /';
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# warning (<string>)
+#
+# Print warning to stderr
+#
+warning()
+{
+ echo2 "warning: $*";
+}
+
+
+########################################################################
+# whatis_filename (<filename>)
+#
+# Interpret <filename> as a man page and display its `whatis'
+# information as a fragment written in the groff language.
+#
+# Variable prefix: wf
+#
+whatis_filename()
+{
+ func_check whatis_filename = 1 "$@";
+ wf_arg="$1";
+ if obj wf_arg is_not_file
+ then
+ error "whatis_filename(): argument is not a readable file."
+ fi;
+ wf_dot='^\.'"${_SPACE_SED}"'*';
+ if obj _FILESPEC_ARG is_equal '-'
+ then
+ wf_arg='stdin';
+ fi;
+ cat <<EOF
+\f[CR]${wf_arg}\f[]:
+.br
+EOF
+
+ # get the parts of the file name
+ wf_name="$(base_name $1)";
+ wf_section="$(echo1 $1 | sed -n -e '
+s|^.*/man\('"${_MAN_AUTO_SEC_CHARS}"'\).*$|\1|p
+')";
+ if obj wf_section is_not_empty
+ then
+ case "${wf_name}" in
+ *.${wf_section}*)
+ s='yes';
+ ;;
+ *)
+ s='';
+ wf_section='';
+ ;;
+ esac
+ if obj s is_yes
+ then
+ wf_name="$(echo1 ${wf_name} | sed -e '
+s/^\(.*\)\.'${wf_section}'.*$/\1/
+')";
+ fi;
+ fi;
+
+ # traditional man style; grep the line containing `.TH' macro, if any
+ wf_res="$(cat_z "$1" | sed -e '
+/'"${wf_dot}"'TH /p
+d
+')";
+ exit_test;
+ if obj wf_res is_not_empty
+ then # traditional man style
+ # get the first line after the first `.SH' macro, by
+ # - delete up to first .SH;
+ # - print all lines before the next .SH;
+ # - quit.
+ wf_res="$(cat_z "$1" | sed -n -e '
+1,/'"${wf_dot}"'SH/d
+/'"${wf_dot}"'SH/q
+p
+')";
+
+ if obj wf_section is_not_empty
+ then
+ case "${wf_res}" in
+ ${wf_name}${_SPACE_CASE}*-${_SPACE_CASE}*)
+ s='yes';
+ ;;
+ *)
+ s='';
+ ;;
+ esac;
+ if obj s is_yes
+ then
+ wf_res="$(obj wf_res echo1 | sed -e '
+s/^'"${wf_name}${_SPACE_SED}"'[^-]*-'"${_SPACE_SED}"'*\(.*\)$/'"${wf_name}"' ('"${wf_section}"') \\[em] \1/
+')";
+ fi;
+ fi;
+ obj wf_res echo1;
+ echo;
+ eval ${_UNSET} wf_arg;
+ eval ${_UNSET} wf_dot;
+ eval ${_UNSET} wf_name;
+ eval ${_UNSET} wf_res;
+ eval ${_UNSET} wf_section;
+ eval "${return_ok}";
+ fi;
+
+ # mdoc style (BSD doc); grep the line containing `.Nd' macro, if any
+ wf_res="$(cat_z "$1" | sed -n -e '/'"${wf_dot}"'Nd /s///p')";
+ exit_test;
+ if obj wf_res is_not_empty
+ then # BSD doc style
+ if obj wf_section is_not_empty
+ then
+ wf_res="$(obj wf_res echo1 | sed -n -e '
+s/^\(.*\)$/'"${wf_name}"' ('"${wf_section}"') \\[em] \1/p
+')";
+ fi;
+ obj wf_res echo1;
+ echo;
+ eval ${_UNSET} wf_arg;
+ eval ${_UNSET} wf_dot;
+ eval ${_UNSET} wf_name;
+ eval ${_UNSET} wf_res;
+ eval ${_UNSET} wf_section;
+ eval "${return_ok}";
+ fi;
+ echo1 'is not a man page';
+ echo;
+ eval ${_UNSET} wf_arg;
+ eval ${_UNSET} wf_dot;
+ eval ${_UNSET} wf_name;
+ eval ${_UNSET} wf_res;
+ eval ${_UNSET} wf_section;
+ eval "${return_bad}";
+}
+
+
+########################################################################
+# whatis_filespec ()
+#
+# Print the filespec name as .SH to the temporary cat file.
+#
+whatis_filespec()
+{
+ func_check whatis_filespec '=' 0 "$@";
+ if obj _OPT_WHATIS is_yes
+ then
+ eval to_tmp_line \
+ "'.SH $(echo1 "${_FILESPEC_ARG}" | sed 's/[^\\]-/\\-/g')'";
+ exit_test;
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# whatis_header ()
+#
+# Print the whatis header to the temporary cat file.
+#
+whatis_header()
+{
+ func_check whatis_header '=' 0 "$@";
+ if obj _OPT_WHATIS is_yes
+ then
+ to_tmp_line '.TH GROFFER WHATIS';
+ fi;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+# where_is (<program>)
+#
+# Output path of a program if in $PATH.
+#
+# Arguments : >=1 (empty allowed)
+# more args are ignored, this allows to specify progs with arguments
+# Return : `0' if arg1 is a program in $PATH, `1' otherwise.
+#
+# Variable prefix: w
+#
+where_is()
+{
+ func_check where_is '>=' 1 "$@";
+ w_arg="$1";
+ if obj w_arg is_empty
+ then
+ eval ${_UNSET} w_arg;
+ eval "${return_bad}";
+ fi;
+ case "${w_arg}" in
+ /*)
+ eval ${_UNSET} w_arg;
+ eval ${_UNSET} w_file;
+ if test -f "${w_arg}" && test -x "${w_arg}"
+ then
+ eval "${return_ok}";
+ else
+ eval "${return_bad}";
+ fi;
+ ;;
+ esac;
+ eval set x "$(path_split "${PATH}")";
+ exit_test;
+ shift;
+ for p
+ do
+ case "$p" in
+ */) w_file=${p}${w_arg}; ;;
+ *) w_file=${p}/${w_arg}; ;;
+ esac;
+ if test -f "${w_file}" && test -x "${w_file}"
+ then
+ obj w_file echo1;
+ eval ${_UNSET} w_arg;
+ eval ${_UNSET} w_file;
+ eval "${return_ok}";
+ fi;
+ done;
+ eval ${_UNSET} w_arg;
+ eval ${_UNSET} w_file;
+ eval "${return_bad}";
+}
+
+
+########################################################################
+# main* Functions
+########################################################################
+
+# The main area contains the following parts:
+# - main_init(): initialize temporary files and set exit trap
+# - main_parse_MANOPT(): parse $MANOPT
+# - main_parse_args(): argument parsing
+# - main_set_mode (): determine the display mode
+# - main_do_fileargs(): process filespec arguments
+# - main_set_resources(): setup X resources
+# - main_display(): do the displaying
+# - main(): the main function that calls all main_*()
+
+
+#######################################################################
+# main_init ()
+#
+# set exit trap and create temporary files
+#
+# Globals: $_TMP_DIR, $_TMP_CAT, $_TMP_STDIN
+#
+# Variable prefix: mi
+#
+main_init()
+{
+ func_check main_init = 0 "$@";
+ # call clean_up() on shell termination.
+ trap_set;
+
+ # create temporary directory
+ umask 0022;
+ _TMP_DIR='';
+ for d in "${GROFF_TMPDIR}" "${TMPDIR}" "${TMP}" "${TEMP}" \
+ "${TEMPDIR}" "${HOME}"'/tmp' '/tmp' "${HOME}" '.'
+ do
+ mi_dir="$d";
+ if obj mi_dir is_empty || obj mi_dir is_not_dir || \
+ obj mi_dir is_not_writable
+ then
+ continue;
+ fi;
+
+ case "${mi_dir}" in
+ */)
+ _TMP_DIR="${mi_dir}";
+ ;;
+ *)
+ _TMP_DIR="${mi_dir}"'/';
+ ;;
+ esac;
+ _TMP_DIR="${_TMP_DIR}groffer${_PROCESS_ID}";
+ if obj _TMP_DIR rm_tree
+ then
+ :
+ else
+ mi_tdir_="${_TMP_DIR}"_;
+ mi_n=1;
+ mi_tdir_n="${mi_tdir_}${mi_n}";
+ while obj mi_tdir_n is_existing
+ do
+ if obj mi_tdir_n rm_tree
+ then
+ # directory could not be removed
+ mi_n="$(expr "${mi_n}" + 1)";
+ mi_tdir_n="${mi_tdir_}${mi_n}";
+ continue;
+ fi;
+ done;
+ _TMP_DIR="${mi_tdir_n}";
+ fi;
+ eval mkdir "${_TMP_DIR}";
+ if is_not_equal "$?" 0
+ then
+ obj _TMP_DIR rm_tree;
+ _TMP_DIR='';
+ continue;
+ fi;
+ if obj _TMP_DIR is_dir && obj _TMP_DIR is_writable
+ then
+ # $_TMP_DIR can now be used as temporary directory
+ break;
+ fi;
+ obj _TMP_DIR rm_tree;
+ _TMP_DIR='';
+ continue;
+ done;
+ if obj _TMP_DIR is_empty
+ then
+ error "main_init: \
+Couldn't create a directory for storing temporary files.";
+ fi;
+ if obj _DEBUG_PRINT_TMPDIR is_yes
+ then
+ echo2 "temporary directory: ${_TMP_DIR}";
+ fi;
+
+ _TMP_CAT="$(tmp_create groffer_cat)";
+ _TMP_STDIN="$(tmp_create groffer_input)";
+ exit_test;
+
+ eval ${_UNSET} mi_dir;
+ eval ${_UNSET} mi_n;
+ eval ${_UNSET} mi_tdir_;
+ eval ${_UNSET} mi_tdir_n;
+ eval "${return_ok}";
+} # main_init()
+
+
+########################################################################
+# main_parse_MANOPT ()
+#
+# Parse $MANOPT to retrieve man options, but only if it is a non-empty
+# string; found man arguments can be overwritten by the command line.
+#
+# Globals:
+# in: $MANOPT, $_OPTS_MANOPT_*
+# out: $_MANOPT_*
+#
+# Variable prefix: mpm
+#
+main_parse_MANOPT()
+{
+ func_check main_parse_MANOPT = 0 "$@";
+
+ if obj MANOPT is_not_empty
+ then
+ # Delete leading and final spaces
+ MANOPT="$(echo1 "${MANOPT}" | sed -e '
+s/^'"${_SPACE_SED}"'*//
+s/'"${_SPACE_SED}"'*$//
+')";
+ exit_test;
+ fi;
+ if obj MANOPT is_empty
+ then
+ eval "${return_ok}";
+ fi;
+
+ mpm_list='';
+ # add arguments in $MANOPT by mapping them to groffer options
+ eval set x "$(list_from_cmdline _OPTS_MANOPT "${MANOPT}")";
+ exit_test;
+ shift;
+ until test "$#" -le 0 || is_equal "$1" '--'
+ do
+ mpm_opt="$1";
+ shift;
+ case "${mpm_opt}" in
+ -7|--ascii)
+ list_append mpm_list '--ascii';
+ ;;
+ -a|--all)
+ list_append mpm_list '--all';
+ ;;
+ -c|--catman)
+ do_nothing;
+ shift;
+ ;;
+ -d|--debug)
+ do_nothing;
+ ;;
+ -D|--default)
+ # undo all man options so far
+ mpm_list='';
+ ;;
+ -e|--extension)
+ list_append mpm_list '--extension';
+ shift;
+ ;;
+ -f|--whatis)
+ list_append mpm_list '--whatis';
+ shift;
+ ;;
+ -h|--help)
+ do_nothing;
+ shift;
+ ;;
+ -k|--apropos)
+ # groffer's --apropos takes an argument, but man's does not, so
+ do_nothing;
+ ;;
+ -l|--local-file)
+ do_nothing;
+ ;;
+ -L|--locale)
+ list_append mpm_list '--locale' "$1";
+ shift;
+ ;;
+ -m|--systems)
+ list_append mpm_list '--systems' "$1";
+ shift;
+ ;;
+ -M|--manpath)
+ list_append mpm_list '--manpath' "$1";
+ shift;
+ ;;
+ -p|--preprocessor)
+ do_nothing;
+ shift;
+ ;;
+ -P|--pager)
+ list_append mpm_list '--pager' "$1";
+ shift;
+ ;;
+ -r|--prompt)
+ do_nothing;
+ shift;
+ ;;
+ -S|--sections)
+ list_append mpm_list '--sections' "$1";
+ shift;
+ ;;
+ -t|--troff)
+ do_nothing;
+ shift;
+ ;;
+ -T|--device)
+ list_append mpm_list '-T' "$1";
+ shift;
+ ;;
+ -u|--update)
+ do_nothing;
+ shift;
+ ;;
+ -V|--version)
+ do_nothing;
+ ;;
+ -w|--where|--location)
+ list_append mpm_list '--location';
+ ;;
+ -Z|--ditroff)
+ do_nothing;
+ ;;
+ # ignore all other options
+ esac;
+ done;
+
+ # prepend $mpm_list to the command line
+ if obj mpm_list is_not_empty
+ then
+ eval set x "${mpm_list}" '"$@"';
+ shift;
+ fi;
+
+ eval ${_UNSET} mpm_list;
+ eval ${_UNSET} mpm_opt;
+ eval "${return_ok}";
+} # main_parse_MANOPT()
+
+
+########################################################################
+# main_parse_args (<command_line_args>*)
+#
+# Parse arguments; process options and filespec parameters
+#
+# Arguments: pass the command line arguments unaltered.
+# Globals:
+# in: $_OPTS_*
+# out: $_OPT_*, $_ADDOPTS, $_FILEARGS
+#
+# Variable prefix: mpa
+#
+main_parse_args()
+{
+ func_check main_parse_args '>=' 0 "$@";
+ _ALL_PARAMS="$(list_from_cmdline _OPTS_CMDLINE "$@")";
+ exit_test;
+ if obj _DEBUG_PRINT_PARAMS is_yes
+ then
+ echo2 "parameters: ${_ALL_PARAMS}";
+ fi;
+ eval set x "${_ALL_PARAMS}";
+ shift;
+
+ # By the call of `eval', unnecessary quoting was removed. So the
+ # positional shell parameters ($1, $2, ...) are now guaranteed to
+ # represent an option or an argument to the previous option, if any;
+ # then a `--' argument for separating options and
+ # parameters; followed by the filespec parameters if any.
+
+ # Note, the existence of arguments to options has already been checked.
+ # So a check for `$#' or `--' should not be done for arguments.
+
+ until test "$#" -le 0 || is_equal "$1" '--'
+ do
+ mpa_opt="$1"; # $mpa_opt is fed into the option handler
+ shift;
+ case "${mpa_opt}" in
+ -h|--help)
+ usage;
+ leave;
+ ;;
+ -Q|--source) # output source code (`Quellcode').
+ _OPT_MODE='source';
+ ;;
+ -T|--device|--troff-device) # device; arg
+ _OPT_DEVICE="$1";
+ _check_device_with_mode;
+ shift;
+ ;;
+ -v|--version)
+ version;
+ leave;
+ ;;
+ -V)
+ _OPT_V='yes';
+ ;;
+ -Z|--ditroff|--intermediate-output) # groff intermediate output
+ _OPT_Z='yes';
+ ;;
+ -X)
+ if is_X
+ then
+ _OPT_MODE=X;
+ fi;
+ ;;
+ -?)
+ # delete leading `-'
+ mpa_optchar="$(echo1 "${mpa_opt}" | sed -e 's/^-//')";
+ exit_test;
+ if list_has _OPTS_GROFF_SHORT_NA "${mpa_optchar}"
+ then
+ list_append _ADDOPTS_GROFF "${mpa_opt}";
+ elif list_has _OPTS_GROFF_SHORT_ARG "${mpa_optchar}"
+ then
+ list_append _ADDOPTS_GROFF "${mpa_opt}" "$1";
+ shift;
+ else
+ error "main_parse_args(): Unknown option : \`$1'";
+ fi;
+ ;;
+ --all)
+ _OPT_ALL='yes';
+ ;;
+ --apropos) # run `apropos'
+ _OPT_APROPOS='yes';
+ _APROPOS_SECTIONS='';
+ _OPT_WHATIS='no';
+ ;;
+ --apropos-data) # run `apropos' for data sections
+ _OPT_APROPOS='yes';
+ _APROPOS_SECTIONS='457';
+ _OPT_WHATIS='no';
+ ;;
+ --apropos-devel) # run `apropos' for development sections
+ _OPT_APROPOS='yes';
+ _APROPOS_SECTIONS='239';
+ _OPT_WHATIS='no';
+ ;;
+ --apropos-progs) # run `apropos' for program sections
+ _OPT_APROPOS='yes';
+ _APROPOS_SECTIONS='168';
+ _OPT_WHATIS='no';
+ ;;
+ --ascii)
+ list_append _ADDOPTS_GROFF '-mtty-char';
+ if obj _OPT_MODE is_empty
+ then
+ _OPT_MODE='text';
+ fi;
+ ;;
+ --auto) # the default automatic mode
+ _OPT_MODE='';
+ ;;
+ --bd) # border color for viewers, arg;
+ _OPT_BD="$1";
+ shift;
+ ;;
+ --bg|--backgroud) # background color for viewers, arg;
+ _OPT_BG="$1";
+ shift;
+ ;;
+ --bw) # border width for viewers, arg;
+ _OPT_BW="$1";
+ shift;
+ ;;
+ --debug|--debug-all|--debug-keep|--debug-lm|--debug-params|\
+--debug-shell|--debug-stacks|--debug-tmpdir|--debug-user)
+ # debug is handled at the beginning
+ :;
+ ;;
+ --default) # reset variables to default
+ reset;
+ ;;
+ --default-modes) # sequence of modes in auto mode; arg
+ _OPT_DEFAULT_MODES="$1";
+ shift;
+ ;;
+ --display) # set X display, arg
+ _OPT_DISPLAY="$1";
+ shift;
+ ;;
+ --do-nothing)
+ _OPT_DO_NOTHING='yes';
+ ;;
+ --dvi)
+ if is_X
+ then
+ _OPT_MODE='dvi';
+ fi;
+ ;;
+ --dvi-viewer) # viewer program for dvi mode; arg
+ _VIEWER_TERMINAL='no';
+ _OPT_VIEWER_DVI="$1";
+ shift;
+ ;;
+ --dvi-viewer-tty) # viewer program for dvi mode in tty; arg
+ _VIEWER_TERMINAL='yes';
+ _OPT_VIEWER_DVI="$1";
+ shift;
+ ;;
+ --extension) # the extension for man pages, arg
+ _OPT_EXTENSION="$1";
+ shift;
+ ;;
+ --fg|--foreground) # foreground color for viewers, arg;
+ _OPT_FG="$1";
+ shift;
+ ;;
+ --fn|--font) # set font for viewers, arg;
+ _OPT_FN="$1";
+ shift;
+ ;;
+ --geometry) # window geometry for viewers, arg;
+ _OPT_GEOMETRY="$1";
+ shift;
+ ;;
+ --groff)
+ _OPT_MODE='groff';
+ ;;
+ --html|--www) # display with web browser
+ _OPT_MODE=html;
+ ;;
+ --html-viewer|--www-viewer) # viewer program for html mode; arg
+ _VIEWER_TERMINAL='no';
+ _OPT_VIEWER_HTML="$1";
+ shift;
+ ;;
+ --html-viewer-tty|--www-viewer-tty) # viewer for html mode in tty; arg
+ _VIEWER_TERMINAL='yes';
+ _OPT_VIEWER_HTML="$1";
+ shift;
+ ;;
+ --iconic) # start viewers as icons
+ _OPT_ICONIC='yes';
+ ;;
+ --locale) # set language for man pages, arg
+ # argument is xx[_territory[.codeset[@modifier]]] (ISO 639,...)
+ _OPT_LANG="$1";
+ shift;
+ ;;
+ --local-file) # force local files; same as `--no-man'
+ _MAN_FORCE='no';
+ _MAN_ENABLE='no';
+ ;;
+ --location|--where) # print file locations to stderr
+ _OPT_LOCATION='yes';
+ ;;
+ --man) # force all file params to be man pages
+ _MAN_ENABLE='yes';
+ _MAN_FORCE='yes';
+ ;;
+ --manpath) # specify search path for man pages, arg
+ # arg is colon-separated list of directories
+ _OPT_MANPATH="$1";
+ shift;
+ ;;
+ --mode) # display mode
+ mpa_arg="$1";
+ shift;
+ case "${mpa_arg}" in
+ auto|'') # search mode automatically among default
+ _OPT_MODE='';
+ ;;
+ groff) # pass input to plain groff
+ _OPT_MODE='groff';
+ ;;
+ html|www) # display with a web browser
+ _OPT_MODE='html';
+ ;;
+ dvi) # display with xdvi viewer
+ if is_X
+ then
+ _OPT_MODE='dvi';
+ fi;
+ ;;
+ pdf) # display with PDF viewer
+ if is_X
+ then
+ _OPT_MODE='pdf';
+ fi;
+ ;;
+ ps) # display with Postscript viewer
+ if is_X
+ then
+ _OPT_MODE='ps';
+ fi;
+ ;;
+ text) # output on terminal
+ _OPT_MODE='text';
+ ;;
+ tty) # output on terminal
+ _OPT_MODE='tty';
+ ;;
+ X|x) # output on X roff viewer
+ if is_X
+ then
+ _OPT_MODE='x';
+ fi;
+ ;;
+ Q|source) # display source code
+ _OPT_MODE="source";
+ ;;
+ *)
+ error "main_parse_args(): unknown mode ${mpa_arg}";
+ ;;
+ esac;
+ ;;
+ --no-location) # disable former call to `--location'
+ _OPT_LOCATION='yes';
+ ;;
+ --no-man) # disable search for man pages
+ # the same as --local-file
+ _MAN_FORCE='no';
+ _MAN_ENABLE='no';
+ ;;
+ --no-special) # disable some special former calls
+ _OPT_ALL='no'
+ _OPT_APROPOS='no'
+ _OPT_WHATIS='no'
+ ;;
+ --pager|--tty-viewer|--tty-viewer-tty)
+ # set paging program for tty mode, arg
+ _VIEWER_TERMINAL='yes';
+ _OPT_PAGER="$1";
+ shift;
+ ;;
+ --pdf)
+ if is_X
+ then
+ _OPT_MODE='pdf';
+ fi;
+ ;;
+ --pdf-viewer) # viewer program for ps mode; arg
+ _VIEWER_TERMINAL='no';
+ _OPT_VIEWER_PDF="$1";
+ shift;
+ ;;
+ --pdf-viewer-tty) # viewer program for ps mode in tty; arg
+ _VIEWER_TERMINAL='yes';
+ _OPT_VIEWER_PDF="$1";
+ shift;
+ ;;
+ --print) # for argument test
+ echo2 "$1";
+ shift;
+ ;;
+ --ps)
+ if is_X
+ then
+ _OPT_MODE='ps';
+ fi;
+ ;;
+ --ps-viewer) # viewer program for ps mode; arg
+ _VIEWER_TERMINAL='no';
+ _OPT_VIEWER_PS="$1";
+ shift;
+ ;;
+ --ps-viewer-tty) # viewer program for ps mode in tty; arg
+ _VIEWER_TERMINAL='yes';
+ _OPT_VIEWER_PS="$1";
+ shift;
+ ;;
+ --resolution) # set resolution for X devices, arg
+ mpa_arg="$1";
+ shift;
+ case "${mpa_arg}" in
+ 75|75dpi)
+ mpa_dpi=75;
+ ;;
+ 100|100dpi)
+ mpa_dpi=100;
+ ;;
+ *)
+ error "main_parse_args(): \
+only resoutions of 75 or 100 dpi are supported";
+ ;;
+ esac;
+ _OPT_RESOLUTION="${mpa_dpi}";
+ ;;
+ --rv)
+ _OPT_RV='yes';
+ ;;
+ --sections) # specify sections for man pages, arg
+ # arg is colon-separated list of section names
+ _OPT_SECTIONS="$1";
+ shift;
+ ;;
+ --shell)
+ # already done during the first run; so ignore the argument
+ shift;
+ ;;
+ --systems) # man pages for different OS's, arg
+ # argument is a comma-separated list
+ _OPT_SYSTEMS="$1";
+ shift;
+ ;;
+ --text) # text mode without pager
+ _OPT_MODE=text;
+ ;;
+ --title) # title for X viewers; arg
+ _OPT_TITLE="$1";
+ shift;
+ ;;
+ --tty) # tty mode, text with pager
+ _OPT_MODE=tty;
+ ;;
+ --text-device|--tty-device) # device for tty mode; arg
+ _OPT_TEXT_DEVICE="$1";
+ shift;
+ ;;
+ --whatis)
+ _OPT_WHATIS='yes';
+ _OPT_ALL='yes';
+ _OPT_APROPOS='no';
+ ;;
+ --X|--x)
+ if is_X
+ then
+ _OPT_MODE=x;
+ fi;
+ ;;
+ --xrm) # pass X resource string, arg;
+ list_append _OPT_XRM "$1";
+ shift;
+ ;;
+ --x-viewer|--X-viewer) # viewer program for x mode; arg
+ _VIEWER_TERMINAL='no';
+ _OPT_VIEWER_X="$1";
+ shift;
+ ;;
+ --x-viewer-tty|--X-viewer-tty) # viewer program for x mode in tty; arg
+ _VIEWER_TERMINAL='yes';
+ _OPT_VIEWER_X="$1";
+ shift;
+ ;;
+ *)
+ error 'main_parse_args(): error on argument parsing : '"\`$*'";
+ ;;
+ esac;
+ done;
+ shift; # remove `--' argument
+
+ if obj _OPT_DO_NOTHING is_yes
+ then
+ leave;
+ fi;
+
+ # Remaining arguments are file names (filespecs).
+ # Save them to list $_FILEARGS
+ if is_equal "$#" 0
+ then # use "-" for standard input
+ set x '-';
+ shift;
+ fi;
+ _FILEARGS='';
+ list_append _FILEARGS "$@";
+ if list_has _FILEARGS '-'
+ then
+ save_stdin;
+ fi;
+ # $_FILEARGS must be retrieved with `eval set x "$_FILEARGS"; shift;'
+ eval ${_UNSET} mpa_arg;
+ eval ${_UNSET} mpa_dpi;
+ eval ${_UNSET} mpa_opt;
+ eval ${_UNSET} mpa_optchar;
+ eval "${return_ok}";
+} # main_parse_args()
+
+
+# Called from main_parse_args() because double `case' is not possible.
+# Globals: $_OPT_DEVICE, $_OPT_MODE
+_check_device_with_mode()
+{
+ func_check _check_device_with_mode = 0 "$@";
+ case "${_OPT_DEVICE}" in
+ dvi)
+ _OPT_MODE=dvi;
+ eval "${return_ok}";
+ ;;
+ html)
+ _OPT_MODE=html;
+ eval "${return_ok}";
+ ;;
+ lbp|lj4)
+ _OPT_MODE=groff;
+ eval "${return_ok}";
+ ;;
+ ps)
+ _OPT_MODE=ps;
+ eval "${return_ok}";
+ ;;
+ ascii|cp1047|latin1|utf8)
+ if obj _OPT_MODE is_not_equal text
+ then
+ _OPT_MODE=tty; # default text mode
+ fi;
+ eval "${return_ok}";
+ ;;
+ X*)
+ _OPT_MODE=x;
+ eval "${return_ok}";
+ ;;
+ *) # unknown device, go to groff mode
+ _OPT_MODE=groff;
+ eval "${return_ok}";
+ ;;
+ esac;
+ eval "${return_error}";
+} # _check_device_with_mode() of main_parse_args()
+
+
+########################################################################
+# main_set_mode ()
+#
+# Determine the display mode.
+#
+# Globals:
+# in: $DISPLAY, $_OPT_MODE, $_OPT_DEVICE
+# out: $_DISPLAY_MODE
+#
+# Variable prefix: msm
+#
+main_set_mode()
+{
+ func_check main_set_mode = 0 "$@";
+
+ # set display
+ if obj _OPT_DISPLAY is_not_empty
+ then
+ DISPLAY="${_OPT_DISPLAY}";
+ fi;
+
+ if obj _OPT_V is_yes
+ then
+ list_append _ADDOPTS_GROFF '-V';
+ fi;
+ if obj _OPT_Z is_yes
+ then
+ _DISPLAY_MODE='groff';
+ list_append _ADDOPTS_GROFF '-Z';
+ fi;
+ if obj _OPT_MODE is_equal 'groff'
+ then
+ _DISPLAY_MODE='groff';
+ fi;
+ if obj _DISPLAY_MODE is_equal 'groff'
+ then
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ fi;
+
+ if obj _OPT_MODE is_equal 'source'
+ then
+ _DISPLAY_MODE='source';
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ fi;
+
+ case "${_OPT_MODE}" in
+ '') # automatic mode
+ case "${_OPT_DEVICE}" in
+ X*)
+ if is_not_X
+ then
+ error_user "no X display found for device ${_OPT_DEVICE}";
+ fi;
+ _DISPLAY_MODE='x';
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ ascii|cp1047|latin1|utf8)
+ if obj _DISPLAY_MODE is_not_equal 'text'
+ then
+ _DISPLAY_MODE='tty';
+ fi;
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ esac;
+ if is_not_X
+ then
+ _DISPLAY_MODE='tty';
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ fi;
+
+ if obj _OPT_DEFAULT_MODES is_empty
+ then
+ msm_modes="${_DEFAULT_MODES}";
+ else
+ msm_modes="${_OPT_DEFAULT_MODES}";
+ fi;
+ ;;
+ text)
+ _DISPLAY_MODE='text';
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ tty)
+ _DISPLAY_MODE='tty';
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ html)
+ _DISPLAY_MODE='html';
+ msm_modes="${_OPT_MODE}";
+ ;;
+ *) # display mode was given
+ if is_not_X
+ then
+ error_user "You must be in X Window for ${_OPT_MODE} mode.";
+ fi;
+ msm_modes="${_OPT_MODE}";
+ ;;
+ esac;
+
+ # only viewer modes are left
+ eval set x "$(list_from_split "${msm_modes}" ',')";
+ exit_test;
+ shift;
+ while test "$#" -gt 0
+ do
+ m="$1";
+ shift;
+ case "$m" in
+ dvi)
+ if obj _OPT_VIEWER_DVI is_not_empty
+ then
+ msm_viewer="${_OPT_VIEWER_DVI}";
+ else
+ msm_viewer="$(_get_first_prog "$_VIEWER_DVI}")";
+ exit_test;
+ fi;
+ if obj msm_viewer is_empty
+ then
+ error 'No viewer for dvi mode available.';
+ fi;
+ if is_not_equal "$?" 0
+ then
+ continue;
+ fi;
+ _DISPLAY_PROG="${msm_viewer}";
+ _DISPLAY_MODE="dvi";
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ html)
+ if obj _OPT_VIEWER_HTML is_not_empty
+ then
+ msm_viewer="${_OPT_VIEWER_HTML}";
+ else
+ if is_X
+ then
+ msm_viewers="${_VIEWER_HTML_X}";
+ else
+ msm_viewers="${_VIEWER_HTML_TTY}";
+ fi;
+ msm_viewer="$(_get_first_prog "${msm_viewers}")";
+ exit_test;
+ fi;
+ if obj msm_viewer is_empty
+ then
+ error 'No viewer for html mode available.';
+ fi;
+ if is_not_equal "$?" 0
+ then
+ continue;
+ fi;
+ _DISPLAY_PROG="${msm_viewer}";
+ _DISPLAY_MODE=html;
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ pdf)
+ if obj _OPT_VIEWER_PDF is_not_empty
+ then
+ msm_viewer="${_OPT_VIEWER_PDF}";
+ else
+ msm_viewer="$(_get_first_prog "${_VIEWER_PDF}")";
+ exit_test;
+ fi;
+ if obj msm_viewer is_empty
+ then
+ error 'No viewer for pdf mode available.';
+ fi;
+ if is_not_equal "$?" 0
+ then
+ continue;
+ fi;
+ _DISPLAY_PROG="${msm_viewer}";
+ _DISPLAY_MODE="pdf";
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ ps)
+ if obj _OPT_VIEWER_PS is_not_empty
+ then
+ msm_viewer="${_OPT_VIEWER_PS}";
+ else
+ msm_viewer="$(_get_first_prog "${_VIEWER_PS}")";
+ exit_test;
+ fi;
+ if obj msm_viewer is_empty
+ then
+ error 'No viewer for ps mode available.';
+ fi;
+ if is_not_equal "$?" 0
+ then
+ continue;
+ fi;
+ _DISPLAY_PROG="${msm_viewer}";
+ _DISPLAY_MODE="ps";
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ text)
+ _DISPLAY_MODE='text';
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ tty)
+ _DISPLAY_MODE='tty';
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ x)
+ if obj _OPT_VIEWER_X is_not_empty
+ then
+ msm_viewer="${_OPT_VIEWER_X}";
+ else
+ msm_viewer="$(_get_first_prog "${_VIEWER_X}")";
+ exit_test;
+ fi;
+ if obj msm_viewer is_empty
+ then
+ error 'No viewer for x mode available.';
+ fi;
+ if is_not_equal "$?" 0
+ then
+ continue;
+ fi;
+ _DISPLAY_PROG="${msm_viewer}";
+ _DISPLAY_MODE='x';
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ X)
+ _DISPLAY_MODE='X';
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ eval "${return_ok}";
+ ;;
+ esac;
+ done;
+ eval ${_UNSET} msm_modes;
+ eval ${_UNSET} msm_viewer;
+ eval ${_UNSET} msm_viewers;
+ error_user "No suitable display mode found.";
+} # main_set_mode()
+
+
+# _get_first_prog (<proglist>)
+#
+# Retrieve first argument that represents an existing program in $PATH.
+# Local function for main_set_mode().
+#
+# Arguments: 1; a comma-separated list of commands (with options),
+# like $_VIEWER_*.
+#
+# Return : `1' if none found, `0' if found.
+# Output : the argument that succeded.
+#
+# Variable prefix: _gfp
+#
+_get_first_prog()
+{
+ if is_equal "$#" 0
+ then
+ error "_get_first_prog() needs 1 argument.";
+ fi;
+ if is_empty "$1"
+ then
+ return "${_BAD}";
+ fi;
+ eval set x "$(list_from_split "$1" ',')";
+ exit_test;
+ shift;
+ for i
+ do
+ _gfp_i="$i";
+ if obj _gfp_i is_empty
+ then
+ continue;
+ fi;
+ if eval is_prog "$(get_first_essential ${_gfp_i})"
+ then
+ exit_test;
+ obj _gfp_i echo1;
+ eval ${_UNSET} _gfp_i;
+ return "${_GOOD}";
+ fi;
+ done;
+ eval ${_UNSET} _gfp_i;
+ return "${_BAD}";
+} # _get_first_prog() of main_set_mode()
+
+
+#######################################################################
+# main_do_fileargs ()
+#
+# Process filespec arguments in $_FILEARGS.
+#
+# Globals:
+# in: $_FILEARGS (process with `eval set x "$_FILEARGS"; shift;')
+#
+# Variable prefix: mdfa
+#
+main_do_fileargs()
+{
+ func_check main_do_fileargs = 0 "$@";
+ special_setup;
+ eval set x "${_FILEARGS}";
+ shift;
+ eval ${_UNSET} _FILEARGS;
+ # temporary storage of all input to $_TMP_CAT
+ while test "$#" -ge 2
+ do
+ # test for `s name' arguments, with `s' a 1-char standard section
+ mdfa_filespec="$1";
+ _FILESPEC_ARG="$1";
+ shift;
+ case "${mdfa_filespec}" in
+ '')
+ continue;
+ ;;
+ '-')
+ special_filespec;
+ if obj _OPT_APROPOS is_yes
+ then
+ continue;
+ fi;
+ register_file '-'
+ continue;
+ ;;
+ ?)
+ if obj _OPT_APROPOS is_yes
+ then
+ special_filespec;
+ continue;
+ fi;
+ if list_has_not _MAN_AUTO_SEC_LIST "${mdfa_filespec}"
+ then
+ special_filespec;
+ do_filearg "${mdfa_filespec}"
+ continue;
+ fi;
+ mdfa_name="$1";
+ _FILESPEC_ARG="${_FILESPEC_ARG} $1";
+ special_filespec;
+ case "${mdfa_name}" in
+ */*|man:*|*\(*\)|*."${mdfa_filespec}")
+ do_filearg "${mdfa_filespec}"
+ continue;
+ ;;
+ esac;
+ shift;
+ if do_filearg "man:${mdfa_name}(${mdfa_filespec})"
+ then
+ continue;
+ else
+ do_filearg "${mdfa_filespec}"
+ continue;
+ fi;
+ ;;
+ *)
+ special_filespec;
+ if obj _OPT_APROPOS is_yes
+ then
+ continue;
+ fi;
+ do_filearg "${mdfa_filespec}"
+ continue;
+ ;;
+ esac;
+ done; # end of `s name' test
+ while test "$#" -gt 0
+ do
+ mdfa_filespec="$1";
+ _FILESPEC_ARG="$1";
+ shift;
+ special_filespec;
+ if obj _OPT_APROPOS is_yes
+ then
+ continue;
+ fi;
+ do_filearg "${mdfa_filespec}"
+ done;
+ obj _TMP_STDIN rm_file_with_debug;
+ eval ${_UNSET} mdfa_filespec;
+ eval ${_UNSET} mdfa_name;
+ eval "${return_ok}";
+} # main_do_fileargs()
+
+
+########################################################################
+# main_set_resources ()
+#
+# Determine options for setting X resources with $_DISPLAY_PROG.
+#
+# Globals: $_DISPLAY_PROG, $_OUTPUT_FILE_NAME
+#
+# Variable prefix: msr
+#
+main_set_resources()
+{
+ func_check main_set_resources = 0 "$@";
+ # $msr_prog viewer program
+ # $msr_rl resource list
+ msr_title="$(get_first_essential \
+ "${_OPT_TITLE}" "${_REGISTERED_TITLE}")";
+ exit_test;
+ _OUTPUT_FILE_NAME='';
+ eval set x "${msr_title}";
+ shift;
+ until is_equal "$#" 0
+ do
+ msr_n="$1";
+ case "${msr_n}" in
+ '')
+ continue;
+ ;;
+ ,*)
+ msr_n="$(echo1 "$1" | sed -e 's/^,,*//')";
+ exit_test;
+ ;;
+ esac
+ if obj msr_n is_empty
+ then
+ continue;
+ fi;
+ if obj _OUTPUT_FILE_NAME is_not_empty
+ then
+ _OUTPUT_FILE_NAME="${_OUTPUT_FILE_NAME}"',';
+ fi;
+ _OUTPUT_FILE_NAME="${_OUTPUT_FILE_NAME}${msr_n}";
+ shift;
+ done;
+ case "${_OUTPUT_FILE_NAME}" in
+ '')
+ _OUTPUT_FILE_NAME='-';
+ ;;
+ ,*)
+ error "main_set_resources(): ${_OUTPUT_FILE_NAME} starts with a comma.";
+ ;;
+ esac;
+ _OUTPUT_FILE_NAME="${_TMP_DIR}/${_OUTPUT_FILE_NAME}";
+
+ if obj _DISPLAY_PROG is_empty
+ then # for example, for groff mode
+ _DISPLAY_ARGS='';
+ eval ${_UNSET} msr_n;
+ eval ${_UNSET} msr_prog;
+ eval ${_UNSET} msr_rl;
+ eval ${_UNSET} msr_title;
+ eval "${return_ok}";
+ fi;
+
+ eval set x "${_DISPLAY_PROG}";
+ shift;
+ msr_prog="$(base_name "$1")";
+ exit_test;
+ shift;
+ if test $# != 0
+ then
+ if obj _DISPLAY_PROG is_empty
+ then
+ _DISPLAY_ARGS="$*";
+ else
+ _DISPLAY_ARGS="$* ${_DISPLAY_ARGS}";
+ fi;
+ fi;
+ msr_rl='';
+ if obj _OPT_BD is_not_empty
+ then
+ case "${msr_prog}" in
+ ghostview|gv|gxditview|xditview|xdvi)
+ list_append msr_rl '-bd' "${_OPT_BD}";
+ ;;
+ esac;
+ fi;
+ if obj _OPT_BG is_not_empty
+ then
+ case "${msr_prog}" in
+ ghostview|gv|gxditview|xditview|xdvi)
+ list_append msr_rl '-bg' "${_OPT_BG}";
+ ;;
+ kghostview)
+ list_append msr_rl '--bg' "${_OPT_BG}";
+ ;;
+ xpdf)
+ list_append msr_rl '-papercolor' "${_OPT_BG}";
+ ;;
+ esac;
+ fi;
+ if obj _OPT_BW is_not_empty
+ then
+ case "${msr_prog}" in
+ ghostview|gv|gxditview|xditview|xdvi)
+ _list_append msr_rl '-bw' "${_OPT_BW}";
+ ;;
+ esac;
+ fi;
+ if obj _OPT_FG is_not_empty
+ then
+ case "${msr_prog}" in
+ ghostview|gv|gxditview|xditview|xdvi)
+ list_append msr_rl '-fg' "${_OPT_FG}";
+ ;;
+ kghostview)
+ list_append msr_rl '--fg' "${_OPT_FG}";
+ ;;
+ esac;
+ fi;
+ if is_not_empty "${_OPT_FN}"
+ then
+ case "${msr_prog}" in
+ ghostview|gv|gxditview|xditview|xdvi)
+ list_append msr_rl '-fn' "${_OPT_FN}";
+ ;;
+ kghostview)
+ list_append msr_rl '--fn' "${_OPT_FN}";
+ ;;
+ esac;
+ fi;
+ if is_not_empty "${_OPT_GEOMETRY}"
+ then
+ case "${msr_prog}" in
+ ghostview|gv|gxditview|xditview|xdvi|xpdf)
+ list_append msr_rl '-geometry' "${_OPT_GEOMETRY}";
+ ;;
+ kghostview)
+ list_append msr_rl '--geometry' "${_OPT_GEOMETRY}";
+ ;;
+ esac;
+ fi;
+ if is_empty "${_OPT_RESOLUTION}"
+ then
+ _OPT_RESOLUTION="${_DEFAULT_RESOLUTION}";
+ case "${msr_prog}" in
+ gxditview|xditview)
+ list_append msr_rl '-resolution' "${_DEFAULT_RESOLUTION}";
+ ;;
+ xpdf)
+ case "${_DEFAULT_RESOLUTION}" in
+ 75)
+ # 72dpi is '100'
+ list_append msr_rl '-z' '104';
+ ;;
+ 100)
+ list_append msr_rl '-z' '139';
+ ;;
+ esac;
+ ;;
+ esac;
+ else
+ case "${msr_prog}" in
+ ghostview|gv|gxditview|xditview|xdvi)
+ list_append msr_rl '-resolution' "${_OPT_RESOLUTION}";
+ ;;
+ xpdf)
+ case "${_OPT_RESOLUTION}" in
+ 75)
+ list_append msr_rl '-z' '104';
+ # '100' corresponds to 72dpi
+ ;;
+ 100)
+ list_append msr_rl '-z' '139';
+ ;;
+ esac;
+ ;;
+ esac;
+ fi;
+ if is_yes "${_OPT_ICONIC}"
+ then
+ case "${msr_prog}" in
+ ghostview|gv|gxditview|xditview|xdvi)
+ list_append msr_rl '-iconic';
+ ;;
+ esac;
+ fi;
+ if is_yes "${_OPT_RV}"
+ then
+ case "${msr_prog}" in
+ ghostview|gv|gxditview|xditview|xdvi)
+ list_append msr_rl '-rv';
+ ;;
+ esac;
+ fi;
+ if is_not_empty "${_OPT_XRM}"
+ then
+ case "${msr_prog}" in
+ ghostview|gv|gxditview|xditview|xdvi|xpdf)
+ eval set x "${_OPT_XRM}";
+ shift;
+ for i
+ do
+ list_append msr_rl '-xrm' "$i";
+ done;
+ ;;
+ esac;
+ fi;
+ if is_not_empty "${msr_title}"
+ then
+ case "${msr_prog}" in
+ gxditview|xditview)
+ list_append msr_rl '-title' "${msr_title}";
+ ;;
+ esac;
+ fi;
+ _DISPLAY_ARGS="${msr_rl}";
+ eval ${_UNSET} msr_n;
+ eval ${_UNSET} msr_prog;
+ eval ${_UNSET} msr_rl;
+ eval ${_UNSET} msr_title;
+ eval "${return_ok}";
+} # main_set_resources
+
+
+########################################################################
+# main_display ()
+#
+# Do the actual display of the whole thing.
+#
+# Globals:
+# in: $_DISPLAY_MODE, $_OPT_DEVICE,
+# $_ADDOPTS_GROFF, $_ADDOPTS_POST, $_ADDOPTS_X,
+# $_TMP_CAT, $_OPT_PAGER, $PAGER, $_MANOPT_PAGER,
+# $_OUTPUT_FILE_NAME
+#
+# Variable prefix: md
+#
+main_display()
+{
+ func_check main_display = 0 "$@";
+
+ export md_addopts;
+ export md_groggy;
+ export md_modefile;
+
+ if obj _TMP_CAT is_non_empty_file
+ then
+ md_modefile="${_OUTPUT_FILE_NAME}";
+ else
+ echo2 'groffer: empty input.';
+ clean_up;
+ eval ${_UNSET} md_modefile;
+ eval "${return_ok}";
+ fi;
+
+ # go to the temporary directory to be able to access internal data files
+ cd "${_TMP_DIR}" >"${_NULL_DEV}" 2>&1;
+
+ case "${_DISPLAY_MODE}" in
+ groff)
+ _ADDOPTS_GROFF="${_ADDOPTS_GROFF} ${_ADDOPTS_POST}";
+ if obj _OPT_DEVICE is_not_empty
+ then
+ _ADDOPTS_GROFF="${_ADDOPTS_GROFF} -T${_OPT_DEVICE}";
+ fi;
+ md_groggy="$(tmp_cat | eval grog "${md_options}")";
+ exit_test;
+ _do_opt_V;
+
+ obj md_modefile rm_file;
+ mv "${_TMP_CAT}" "${md_modefile}";
+ trap_unset;
+ cat "${md_modefile}" | \
+ {
+ trap_set;
+ eval "${md_groggy}" "${_ADDOPTS_GROFF}";
+ } &
+ ;;
+ text|tty)
+ case "${_OPT_DEVICE}" in
+ '')
+ md_device="$(get_first_essential \
+ "${_OPT_TEXT_DEVICE}" "${_DEFAULT_TTY_DEVICE}")";
+ exit_test;
+ ;;
+ ascii|cp1047|latin1|utf8)
+ md_device="${_OPT_DEVICE}";
+ ;;
+ *)
+ warning "main_display(): \
+wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
+ ;;
+ esac;
+ md_addopts="${_ADDOPTS_GROFF} ${_ADDOPTS_POST}";
+ md_groggy="$(tmp_cat | grog -T${md_device})";
+ exit_test;
+ if obj _DISPLAY_MODE is_equal 'text'
+ then
+ _do_opt_V;
+ tmp_cat | eval "${md_groggy}" "${md_addopts}";
+ else
+ md_pager='';
+ for p in "${_OPT_PAGER}" "${PAGER}" "${_MANOPT_PAGER}" \
+ 'less -r -R' 'more' 'pager' 'cat'
+ do
+ md_p="$p";
+ if eval is_prog ${md_p}
+ then # no "" for is_prog() allows args for $p
+ md_pager="${md_p}";
+ break;
+ fi;
+ done;
+ if obj md_pager is_empty
+ then
+ error 'main_display(): no pager program found for tty mode';
+ fi;
+ _do_opt_V;
+ tmp_cat | eval "${md_groggy}" "${md_addopts}" | \
+ eval "${md_pager}";
+ fi;
+ clean_up;
+ ;;
+ source)
+ tmp_cat;
+ clean_up;
+ ;;
+
+ #### viewer modes
+
+ dvi)
+ case "${_OPT_DEVICE}" in
+ ''|dvi) do_nothing; ;;
+ *)
+ warning "main_display(): \
+wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}"
+ ;;
+ esac;
+ md_modefile="${md_modefile}".dvi;
+ md_groggy="$(tmp_cat | grog -Tdvi)";
+ exit_test;
+ _do_display;
+ ;;
+ html)
+ case "${_OPT_DEVICE}" in
+ ''|html) do_nothing; ;;
+ *)
+ warning "main_display(): \
+wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
+ ;;
+ esac;
+ md_modefile="${md_modefile}".html;
+ md_groggy="$(tmp_cat | grog -Thtml)";
+ exit_test;
+ _do_display;
+ ;;
+ pdf)
+ case "${_OPT_DEVICE}" in
+ ''|ps)
+ do_nothing;
+ ;;
+ *)
+ warning "main_display(): \
+wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
+ ;;
+ esac;
+ md_groggy="$(tmp_cat | grog -Tps)";
+ exit_test;
+ _do_display _make_pdf;
+ ;;
+ ps)
+ case "${_OPT_DEVICE}" in
+ ''|ps)
+ do_nothing;
+ ;;
+ *)
+ warning "main_display(): \
+wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
+ ;;
+ esac;
+ md_modefile="${md_modefile}".ps;
+ md_groggy="$(tmp_cat | grog -Tps)";
+ exit_test;
+ _do_display;
+ ;;
+ x)
+ case "${_OPT_DEVICE}" in
+ X*)
+ md_device="${_OPT_DEVICE}"
+ ;;
+ *)
+ case "${_OPT_RESOLUTION}" in
+ 100)
+ md_device='X100';
+ if obj _OPT_GEOMETRY is_empty
+ then
+ case "${_DISPLAY_PROG}" in
+ gxditview|xditview)
+ # add width of 800dpi for resolution of 100dpi to the args
+ list_append _DISPLAY_ARGS '-geometry' '800';
+ ;;
+ esac;
+ fi;
+ ;;
+ *)
+ md_device='X75-12';
+ ;;
+ esac
+ esac;
+ md_groggy="$(tmp_cat | grog -T${md_device} -Z)";
+ exit_test;
+ _do_display;
+ ;;
+ X)
+ case "${_OPT_DEVICE}" in
+ '')
+ md_groggy="$(tmp_cat | grog -X)";
+ exit_test;
+ ;;
+ X*|dvi|html|lbp|lj4|ps)
+ # these devices work with
+ md_groggy="$(tmp_cat | grog -T"${_OPT_DEVICE}" -X)";
+ exit_test;
+ ;;
+ *)
+ warning "main_display(): \
+wrong device for ${_DISPLAY_MODE} mode: ${_OPT_DEVICE}";
+ md_groggy="$(tmp_cat | grog -Z)";
+ exit_test;
+ ;;
+ esac;
+ _do_display;
+ ;;
+ *)
+ error "main_display(): unknown mode \`${_DISPLAY_MODE}'";
+ ;;
+ esac;
+ eval ${_UNSET} md_addopts;
+ eval ${_UNSET} md_device;
+ eval ${_UNSET} md_groggy;
+ eval ${_UNSET} md_modefile;
+ eval ${_UNSET} md_options;
+ eval ${_UNSET} md_p;
+ eval ${_UNSET} md_pager;
+ eval "${return_ok}";
+} # main_display()
+
+
+########################
+# _do_display ([<prog>])
+#
+# Perform the generation of the output and view the result. If an
+# argument is given interpret it as a function name that is called in
+# the midst (actually only for `pdf').
+#
+# Globals: $md_modefile, $md_groggy (from main_display())
+#
+_do_display()
+{
+ func_check _do_display '>=' 0 "$@";
+ _do_opt_V;
+ if obj _DISPLAY_PROG is_empty
+ then
+ trap_unset;
+ {
+ trap_set;
+ eval "${md_groggy}" "${_ADDOPTS_GROFF}" "${_TMP_CAT}";
+ } &
+ else
+ obj md_modefile rm_file;
+ cat "${_TMP_CAT}" | \
+ eval "${md_groggy}" "${_ADDOPTS_GROFF}" > "${md_modefile}";
+ if is_not_empty "$1"
+ then
+ eval "$1";
+ fi;
+ obj _TMP_CAT rm_file_with_debug;
+ if obj _VIEWER_TERMINAL is_yes # for programs that run on tty
+ then
+ eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "\"${md_modefile}\"";
+ else
+ case "${_DISPLAY_PROG}" in
+# lynx\ *|less\ *|more\ *) # programs known to run on the terminal
+# eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "\"${md_modefile}\"";
+# ;;
+ *)
+ trap_unset;
+ {
+ trap_set;
+ eval "${_DISPLAY_PROG}" ${_DISPLAY_ARGS} "\"${md_modefile}\"";
+ } &
+ ;;
+ esac;
+ fi;
+ fi;
+ eval "${return_ok}";
+} # _do_display() of main_display()
+
+
+#############
+# _do_opt_V ()
+#
+# Check on option `-V'; if set print the corresponding output and leave.
+#
+# Globals: $_ALL_PARAMS, $_ADDOPTS_GROFF, $_DISPLAY_MODE, $_DISPLAY_PROG,
+# $_DISPLAY_ARGS, $md_groggy, $md_modefile
+#
+# Variable prefix: _doV
+#
+_do_opt_V()
+{
+ func_check _do_opt_V '=' 0 "$@";
+ if obj _OPT_V is_yes
+ then
+ _OPT_V='no';
+ echo1 "Parameters: ${_ALL_PARAMS}";
+ echo1 "Display mode: ${_DISPLAY_MODE}";
+ echo1 "Output file: ${md_modefile}";
+ echo1 "Display prog: ${_DISPLAY_PROG} ${_DISPLAY_ARGS}";
+ a="$(eval echo1 "'${_ADDOPTS_GROFF}'")";
+ exit_test;
+ echo1 "Output of grog: ${md_groggy} $a";
+ _doV_res="$(eval "${md_groggy}" "${_ADDOPTS_GROFF}")";
+ exit_test;
+ echo1 "groff -V: ${_doV_res}"
+ leave;
+ fi;
+ eval "${return_ok}";
+} # _do_opt_V() of main_display()
+
+
+##############
+# _make_pdf ()
+#
+# Transform to pdf format; for pdf mode in _do_display().
+#
+# Globals: $md_modefile (from main_display())
+#
+# Variable prefix: _mp
+#
+_make_pdf()
+{
+ func_check _do_display '=' 0 "$@";
+ _mp_psfile="${md_modefile}";
+ md_modefile="${md_modefile}.pdf";
+ obj md_modefile rm_file;
+ if gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
+ -sOutputFile="${md_modefile}" -c save pop -f "${_mp_psfile}"
+ then
+ :;
+ else
+ error '_make_pdf: could not transform into pdf format.';
+ fi;
+ obj _mp_psfile rm_file_with_debug;
+ eval ${_UNSET} _mp_psfile;
+ eval "${return_ok}";
+} # _make_pdf() of main_display()
+
+
+########################################################################
+# main (<command_line_args>*)
+#
+# The main function for groffer.
+#
+# Arguments:
+#
+main()
+{
+ func_check main '>=' 0 "$@";
+ # Do not change the sequence of the following functions!
+ landmark '13: main_init()';
+ main_init;
+ landmark '14: main_parse_MANOPT()';
+ main_parse_MANOPT;
+ landmark '15: main_parse_args()';
+ main_parse_args "$@";
+ landmark '16: main_set_mode()';
+ main_set_mode;
+ landmark '17: main_do_fileargs()';
+ main_do_fileargs;
+ landmark '18: main_set_resources()';
+ main_set_resources;
+ landmark '19: main_display()';
+ main_display;
+ eval "${return_ok}";
+}
+
+
+########################################################################
+
+main "$@";
diff --git a/contrib/groff/contrib/mm/ChangeLog b/contrib/groff/contrib/mm/ChangeLog
index d678fe8331fe..c1f8985693c1 100644
--- a/contrib/groff/contrib/mm/ChangeLog
+++ b/contrib/groff/contrib/mm/ChangeLog
@@ -1,3 +1,37 @@
+Thu May 26 08:23:40 2005 Werner LEMBERG <wl@gnu.org>
+
+ * m.tmac: Load devtag.tmac.
+
+Wed Mar 16 06:56:02 2005 Larry Kollar <kollar@alltel.net>
+
+ Add rudimentary support for grohtml.
+
+ * m.tmac (H): Call DEVTAG-NH and DEVTAG-EO-H.
+ (pg@enable-trap, pg@header): Do nothing for devhtml.
+
+Sun Mar 7 16:34:46 2004 Jeff Conrad <jeff_conrad@msn.com>
+
+ * m.tmac (S): Improve debug message.
+
+Wed Mar 05:38:57 2004 Joergen Haegg <jh@axis.com>
+
+ * Changed default value for Hy in manual to 0
+ * Check Hy at each new page
+
+Mon Mar 1 22:16:38 2004 Jeff Conrad <jeff_conrad@msn.com>
+
+ * m.tmac (S): Fix scaling indicator for vertical spacing.
+
+Tue Nov 05:14:45 2003 Joergen Haegg <jh@axis.com>
+
+ * another patch from ulrich lauther to fix the
+ TOC up to 14 heading levels.
+
+Mon Oct 13:48:25 2003 Joergen Haegg <jh@axis.com>
+
+ * problem with more than 7 levels of headings fixed with
+ patch from ulrich lauther.
+
Wed Apr 06:42:35 2003 Joergen Haegg <jh@axis.com>
* the footer was not adjusted by VM due to a missing
diff --git a/contrib/groff/contrib/mm/groff_mm.man b/contrib/groff/contrib/mm/groff_mm.man
index 8229f23cd8b7..bd5223d47764 100644
--- a/contrib/groff/contrib/mm/groff_mm.man
+++ b/contrib/groff/contrib/mm/groff_mm.man
@@ -1,5 +1,5 @@
.\"
-.\" $Id: groff_mm.man,v 2.9 2003/03/19 22:05:11 wlemb Exp $
+.\" $Id: groff_mm.man,v 2.13 2004/07/03 12:46:56 wlemb Exp $
.\"
.de T2
.if t .ne 2v
@@ -7,12 +7,14 @@
\\$1
.sp -1
..
+.
.de T3
.if t .ne 2v
.ti -.5i
\fB\\$1\fP
.br
..
+.
.TH GROFF_MM @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
.SH NAME
groff_mm \- groff mm macros
@@ -612,7 +614,7 @@ See \fBINITR\fP.
.TP
.B "H level [heading-text [heading-suffix]]"
Numbered section heading.
-Section headers can have a level between 1 and 7, level 1 is the
+Section headers can have a level between 1 and 14, level 1 is the
top level.
The text is given in \fIheading-text\fP, and must be
surrounded by double quotes if it contains spaces.
@@ -679,8 +681,8 @@ is centerered.
The font of each heading level is controlled by string \fBHF\fP.
It contains a fontnumber or fontname for each level.
Default
-is \fB2\ 2\ 2\ 2\ 2\ 2\ 2\fP (all headings in italic).
-Could also be written as \fBI\ I\ I\ I\ I\ I\ I\fP.
+is \fB2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\ 2\fP (all headings in italic).
+Could also be written as \fBI\ I\ I\ I\ I\ I\ I\ I\ I\ I\ I\ I\ I\ I\fP.
Note that some other implementations use \fB3\ 3\ 2\ 2\ 2\ 2\ 2\fP as the
default value.
All omitted values are presumed to be a 1.
@@ -690,7 +692,7 @@ All omitted values are presumed to be a 1.
String \fBHP\fP controls the pointsize of each heading, in the
same way as \fBHF\fP controls the font.
A value of 0 selects the default point size.
-Default value is \fB0\ 0\ 0\ 0\ 0\ 0\ 0\fP.
+Default value is \fB0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\fP.
Beware that only the
point size changes, not the vertical size.
That can be controlled by the user specified macro \fBHX\fP and/or
@@ -698,7 +700,7 @@ That can be controlled by the user specified macro \fBHX\fP and/or
.sp
\fBHeading counters\fP
.br
-Seven number registers, named \fBH1\fP thru \fBH7\fP contains
+Fourteen number registers, named \fBH1\fP thru \fBH14\fP contains
the counter for each heading level.
The values are printed using arabic numerals, this can be changed
with the macro \fBHM\fP (see below).
@@ -771,7 +773,7 @@ Resets to the default if called without argument.
Hyphenation can be turned off by setting number
register \fBHy\fP to 0 in the beginning of the file.
.TP
-.B "HM [arg1 [arg2 [... [arg7]]]]"
+.B "HM [arg1 [arg2 [... [arg14]]]]"
Heading mark style.
Controls the type of marking for printing of the heading counters.
Default is 1 for all levels.
@@ -1276,7 +1278,7 @@ the header in letters or other special texts.
This macro must be used before any text to inhibit the pageheader
on the first page.
.TP
-.B PIC [-L] [-C] [-R] [-I n] filename [width [height]]
+.B "PIC [-L] [-C] [-R] [-I n] filename [width [height]]"
\fBPIC\fP includes a Postscript file in the document.
The macro depends on \fBmmroff\fP and \fBINITR\fP.
\fB-L\fP, \fB-C\fP, \fB-R\fP and \fB-I n\fP adjusts the picture
@@ -1803,7 +1805,7 @@ No output will occur if \fBAph\fP is zero, but there will always
be an appendix-entry in the 'List of contents'.
.TP
.B Cl
-Contents level [0:7], contents saved if heading level <= Cl, default 2.
+Contents level [0:14], contents saved if heading level <= Cl, default 2.
.TP
.B Cp
Eject page between LIST OF XXXX if Cp == 0, default 0.
@@ -1850,10 +1852,10 @@ just before the page break.
Useful in user defined header macros.
.TP
.B Hb
-Heading break level [0:7], default\ 2.
+Heading break level [0:14], default\ 2.
.TP
.B Hc
-Heading centering level, [0:7].
+Heading centering level, [0:14].
Default\ 0.
.TP
.B Hi
@@ -1885,7 +1887,7 @@ is less than or equal to \fBHps\fP.
Value is in units, normally\ 1.
.TP
.B Hs
-Heading space level [0:7], default\ 2.
+Heading space level [0:14], default\ 2.
.TP
.B Hss
This is the number of lines that follows \fB.H\fP when the heading-level
@@ -1902,7 +1904,7 @@ Heading numbering type, default 0.
Unnumbered heading level, default 2.
.TP
.B Hy
-Hyphenation in body, default 1.
+Hyphenation in body, default 0.
.br
0\ ->\ no hyphenation
.br
diff --git a/contrib/groff/contrib/mm/m.tmac b/contrib/groff/contrib/mm/m.tmac
index f78519105981..db52e93deb7a 100644
--- a/contrib/groff/contrib/mm/m.tmac
+++ b/contrib/groff/contrib/mm/m.tmac
@@ -3,11 +3,12 @@
.ds RE \\$2
..
.\"
-.\" $Id: m.tmac,v 2.18 2003/04/02 04:44:59 jhaegg Exp $
-.@revision $Revision: 2.18 $
+.\" $Id: m.tmac,v 2.26 2005/05/26 06:28:38 wl Exp $
+.@revision $Revision: 2.26 $
.ig
-Copyright (C) 1991-2000 Free Software Foundation, Inc.
+Copyright (C) 1991-2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
mgm is written by Jörgen Hägg <jh@axis.com>
mgm is free software; you can redistribute it and/or modify it under
@@ -36,8 +37,9 @@ Index array!index
.do if d PH .nx
.if \n(.C .ab The groff mm macros do not work in compatibility mode.
.if (\n[.warn] == 65543) .warn
+.mso devtag.tmac
.\" ######## init #######
-.\" Contents level [0:7], contents saved if heading level <= Cl
+.\" Contents level [0:14], contents saved if heading level <= Cl
.nr Cl 2
.\" Eject page between LIST OF XXXX if Cp == 0
.nr Cp 0
@@ -66,20 +68,27 @@ Index array!index
.nr H5 0 1
.nr H6 0 1
.nr H7 0 1
-.\" Heading break level [0:7]
+.nr H8 0 1
+.nr H9 0 1
+.nr H10 0 1
+.nr H11 0 1
+.nr H12 0 1
+.nr H13 0 1
+.nr H14 0 1
+.\" Heading break level [0:14]
.nr Hb 2
-.\" heading centering level, [0:7]
+.\" heading centering level, [0:14]
.nr Hc 0
.\" header format
-.ds HF 2 2 2 2 2 2 2
+.ds HF 2 2 2 2 2 2 2 2 2 2 2 2 2 2
.\" heading temp. indent [0:2]
.\" 0 -> 0 indent, left margin
.\" 1 -> indent to right , like .P 1
.\" 2 -> indent to line up with text part of preceding heading
.nr Hi 1
.\" header pointsize
-.ds HP 0 0 0 0 0 0 0
-.\" heading space level [0:7]
+.ds HP 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+.\" heading space level [0:14]
.nr Hs 2
.\" heading numbering type
.\" 0 -> multiple (1.1.1 ...)
@@ -637,15 +646,21 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if !'\\*[misc*b]'C' \{\
. ie '\\*[misc*b]'P' .vs \\n[misc*S-vs]u
. el \{\
-. ie '\\*[misc*b]'D' .vs \\n[.ps]u+2p
+. ie '\\*[misc*b]'D' .vs \\n[.ps]s+2p
. el .vs \\*[misc*b]
. if \\n[D]>2 .tm S: .vs \\*[misc*b]
. \}
.\}
.nr @ps \\n[.ps]
+.nr @psu \\n[.ps]s
.nr @vs \\n[.v]
+.nr @vsp \\n[.v]u/1p
+.nr @res 1i
.\"
-.if \\n[D]>1 .tm S(\\$*): ma:\\*[misc*a], mb:\\*[misc*b] => ps:\\n[@ps]u, vs:\\n[@vs]u
+.if \\n[D]>1 \{\
+. tmc "S(\\$*): ma:\\*[misc*a], mb:\\*[misc*b]
+. tm1 " => ps:\\n[.s]p (\\n[@psu]u), vs:\\n[@vsp]p (\\n[@vs]u) (res:\\n[@res])
+.\}
.nr misc*S-ps \\n[misc*S-ps1]
.nr misc*S-vs \\n[misc*S-vs1]
.nr misc*S-ps1 \\n[@ps]
@@ -930,7 +945,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"
.\" clear lower counters
.nr hd*i 1 1
-.while \\n+[hd*i]<8 .if \\n[hd*level]<\\n[hd*i] .nr H\\n[hd*i] 0 1
+.while \\n+[hd*i]<15 .if \\n[hd*level]<\\n[hd*i] .nr H\\n[hd*i] 0 1
.\"
.\" save last text for use in TP
.if \\n[hd*level]=1 .ds H1txt \\$2\\$3
@@ -962,7 +977,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if \\n[hd*level]>1 .as hd*mark \\n[H2]
.\"
.nr hd*i 2 1
-.while \\n+[hd*i]<8 .if \\n[hd*level]>(\\n[hd*i]-1) .as hd*mark .\\n[H\\n[hd*i]]
+.while \\n+[hd*i]<15 .if \\n[hd*level]>(\\n[hd*i]-1) .as hd*mark .\\n[H\\n[hd*i]]
.if \\n[Ht] .ds hd*mark \\n[H\\n[hd*level]].
.\"
.\" special case, no dot after level one heading if not H1dot true
@@ -1025,6 +1040,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"---------- user macro HY -------------
.\" user macro to reset indents
.if d HY .HY \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
+.DEVTAG-NH \\n[hd*level] \" HTML: mark beginning of heading
.\"--------------------------------------
.nr hd*mark-size \w@\\*[hd*mark]@
.if (\\n[hd*level]<=\\n[Hc])&\\n[hd*htype] .ce\" center if level<=Hc
@@ -1072,11 +1088,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.nr hd*last-pos \\n[nl]
.nr hd*last-hsize \\n[.k]
.nr par@ind-flag 0
+.DEVTAG-EO-H \" HTML: end of heading
..
.\"--------
.de HM
.nr hd*i 0 1
-.while \\n+[hd*i]<8 .af H\\n[hd*i] \\$[\\n[hd*i]] 1
+.while \\n+[hd*i]<15 .af H\\n[hd*i] \\$[\\n[hd*i]] 1
..
.\"----------------------
.\" set page-nr, called from header
@@ -1134,9 +1151,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if \\n[D]>2 .tm pg*last-pos \\n[@pl]u-(\\n[pg*block-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u+\\n[pg*extra-footer-size]u) = \\n[pg*last-pos]
..
.de pg@enable-trap
+.\" Disable in HTML mode
+.if !'\*[.T]'html' \{\
.wh \\n[pg*foot-trap]u pg@footer
.if \\n[D]>2 .tm pg@enable-trap .t=\\n[.t] nl=\\n[nl]
.if \\n[D]>2 .ptr
+.\}
..
.de pg@disable-trap
.ch pg@footer
@@ -1185,7 +1205,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"------------------------------------------------------------
.\" HEADER
.de pg@header
+.\" Disable in HTML mode
+.if !'\*[.T]'html' \{\
.if \\n[D]>1 .tm Page# \\n[%] (\\n[.F]:\\n[c.])
+.\" check if Hy has been changed
+.ie \\n[Hy] 'hy 14
+.el 'nh
.if \\n[Idxf] \{\
.tl '<pagenr\ \\n[%]>'''
.\}
@@ -1241,6 +1266,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\}
.if \\n[pg*top-enabled]<0 .nr pg*top-enabled 1
.nr hd*cur-bline \\n[nl] \" .H needs to know if output has occured
+.\}
..
.\"---------------------------------------------------------
.\" FOOTER
@@ -2426,8 +2452,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" .toc@read-Ci lev1 lev2 lev3 lev4 ... lev7
.de toc@read-Ci
.nr toc*i 0 1
-.while \\n+[toc*i]<8 \{\
-. nr toc*hl!\\n[toc*i] \\$\\n[toc*i]
+.while \\n+[toc*i]<15 \{\
+. nr toc*hl!\\n[toc*i] \\$[\\n[toc*i]]
.\}
..
.\"-----------
@@ -2883,7 +2909,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\}
.\" clear lower counters
.nr app*i 1 1
-.while \\n+[app*i]<8 .nr H\\n[app*i] 0 1
+.while \\n+[app*i]<15 .nr H\\n[app*i] 0 1
..
.\"------------
.de app@index
diff --git a/contrib/groff/contrib/mm/mmroff.pl b/contrib/groff/contrib/mm/mmroff.pl
index 155550bf97ea..f61daa102bcf 100755
--- a/contrib/groff/contrib/mm/mmroff.pl
+++ b/contrib/groff/contrib/mm/mmroff.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#! /usr/bin/perl
use strict;
# runs groff in safe mode, that seems to be the default
diff --git a/contrib/groff/contrib/mom/BUGS b/contrib/groff/contrib/mom/BUGS
index a96c0619251e..33765ba0140f 100644
--- a/contrib/groff/contrib/mom/BUGS
+++ b/contrib/groff/contrib/mom/BUGS
@@ -2,15 +2,238 @@ Assume that anything that doesn't work or behaves oddly is a bug.
The documentation should be taken as the authoritative source for
how things ought to be.
-Post to the groff mailing list (groff@ffii.org) with bug reports,
-questions and suggestions, or contact me directly at:
+Post to the groff mailing list with bug reports, questions and
+suggestions, or contact me directly at:
- df191@ncf.ca
+ peter@faustus.dyn.ca
+ or
+ ptpi@golden.net
+
+If writing me directly, please include the word "groff" or "mom" in
+the Subject line or you risk my spam filters nuking your message.
+Also, please--no html email. That, too, gets nuked.
--Peter Schaffter
========================================================================
+Version 1.3
+===========
+
+Persistent error in html coding of docs (<nobr> tag).
+---Fixed---
+
+Version 1.2-f
+============
+
+Multiple line subheads near page bottom sometimes printing one line
+of subhead at page bottom, and subsequent lines on next page.
+---Fixed---
+
+Post-quote spacing still wonky when paragraph spacing is turned on.
+---Fixed--- (for good would be nice)
+
+RULE not always resetting quad and quad value.
+---Fixed---
+
+Version 1.2-e
+=============
+
+Some string definitions in om.tmac had superfluous spaces after
+them (e.g. $COVERTITLE).
+---Fixed---
+
+Spacing under quotes not correct when paragraph spacing is turned
+on.
+---Fixed---
+
+
+First word of last line before footnotes is getting chopped.
+---Fixed---
+
+Version 1.2-d
+=============
+
+HEADER_FAMILY not changing header family.
+---Fixed---
+
+FAMILY, after COLLATE, not changing the family of all and every
+page element or tag.
+---Fixed---
+
+Heads and subheads at the start of docs are printing one line lower
+than they should.
+---Fixed---
+
+Gaps are appearing at the bottom of pages when there's a linebreak
+followed by a subhead.
+---Fixed---
+
+When LS is invoked after a single text line at the top of a page
+containing a T_MARGIN (set with T_MARGIN or PAGE), mom is performing
+spacing adjustments as if the first line doesn't exist.
+---Fixed---
+
+Changes made to ALD and LS in version 1.2-c should not apply when
+the document processing macros are used. There is a significant
+conflict with the internal use of ALD when the docheader is only
+one line long (as, for example, when DOCTYPE is CHAPTER).
+---Fixed, pending discovery of further conflicts---
+
+Version 1.2-c
+=============
+
+Deferred footnotes not always being output, and groff complains
+"ending diversion FN_OVERFLOW on exit."
+---Fixed---
+
+First .LS call after a top margin has been set (with .T_MARGIN
+or .PAGE) causing mom to move off the top margin baseline. Also,
+there are conflicts between ALD, LS and T_MARGIN.
+---Fixed---
+
+DROPCAP not properly restoring a running \*[COND] or \*[EXT] after
+COND or EXT are given as arguments to DROPCAP.
+---Fixed---
+
+Version 1.2
+===========
+
+.PAD not co-operating with mom's fontstyles, esp. when a full
+family+fontstyle is given to .FT.
+---Fixed---
+
+.DROPCAP -- ditto the above.
+---Fixed---
+
+Version 1.1.9
+=============
+
+Footnote markers not resetting properly on new pages when COLUMNS
+is enabled.
+---Fixed---
+
+When overflowed footnote material is the only footnote material on
+the page or in the column, no footnotes are output.
+---Fixed---
+
+The AUTOLEAD used in FOOTNOTE not being disabled after FOOTNOTES
+are output, or after PROCESS_FN_LEFTOVER/PROCESS_FN_IN_DIVER.
+---Fixed---
+
+COL_NEXT and COL_BREAK, when invoked during the last column on a
+page, are overprinting the last column instead of breaking to a new
+page when there are footnotes in the column.
+---Fixed---
+
+BR_AT_LINE_KERN not "break-and-spreading" text when used in
+justified copy.
+---Fixed---
+
+Version 1.1.8
+=============
+
+BLOCKQUOTE_FAMILY not changing blockquote family.
+---Fixed---
+
+FOOTNOTE, whether in column mode or not, was using
+#FN_COUNT_FOR_COLS for all footnote markers and handling.
+---Fixed---
+
+Deferred footnotes that occured on the second to last page of
+documents not printing.
+---Fixed---
+
+Version 1.1.7-a
+===============
+
+Suite number in DOCTYPE LETTER not printing.
+---Fixed---
+
+Footer elements not always vertically aligning.
+---Fixed---
+
+Footer rule gap not always correctly observed.
+---Fixed---
+
+Page numbering, when at top of page, not always falling on
+HDRFTR_MARGIN.
+---Fixed---
+
+Default page numbering style for COPYSTYLE draft is DIGIT instead
+of roman.
+---Fixed---
+
+Hyphens around page numbering when style is DIGIT, ROMAN or ALPHA
+not vertically centered.
+---Fixed---
+
+EXT arg not working with DROPCAP.
+---Fixed---
+
+DOC_QUAD not automatically set immediately after START
+---Fixed--
+
+Tabs behaving erratically during document processing.
+---Fixed---
+
+Version 1.1.7
+=============
+
+When DOCHEADER OFF <distance> is given, if <distance> falls short
+of the top margin of running text, <distance> is not respected and
+bottom margin falls low.
+---Fixed---
+
+
+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
+===============
+
+In document processing mode, docs that use *none* of the
+docprocessing tags being ignored.
+---Fixed---
+
+Version 1.1.6-b
+===============
+
+String tabs not picking up #L_MARGIN when #L_MARGIN not explicitly
+set with L_MARGIN, PAPER or PAGE.
+---Fixed---
+
+Infinite loop when B_MARGIN is set lower than FOOTER_MARGIN during
+doc processing.
+---Fixed---
+
+Version 1.1.6-a
+===============
+
+Mom partially broken when run with groff 1.19.1. Don't know yet
+what this is, whether bad coding in mom, or a problem with 1.19.1.
+Only solution for now: run mom 1.1.6 with groff 1.18.
+----Fixed---
+
+Top margin of endnotes pages after the first endnotes page when
+PRINTSTYLE is TYPEWRITE and endnotes single-spacing is turned on
+falling one line too high.
+---Fixed---
+
+Version 1.1.6
+=============
+
+DOCHEADER OFF (distance) not being respected.
+---Fixed---
+
+FINIS killing ENDNOTES page numbering and heads.
+---Fixed---
+
Version 1.1.5
=============
diff --git a/contrib/groff/contrib/mom/ChangeLog b/contrib/groff/contrib/mom/ChangeLog
index ce93092e8c15..d99c02399ff8 100644
--- a/contrib/groff/contrib/mom/ChangeLog
+++ b/contrib/groff/contrib/mom/ChangeLog
@@ -1,3 +1,396 @@
+*Thu Aug 11 2005
+
+o Makefile.sub (HTMLDOCFILES): Add `refer.html'
+
+*Mon Jun 20 2005
+
+o Makefile.sub (HTMLDOCFILES_, EXAMPLEFILES_, PROCESSEDEXAMPLEFILES_): New
+ variables.
+ (install_data): Install files in `mom' subdirectories.
+ Make it work actually.
+ (uninstall_sub): Updated.
+
+*Thu Jun 16 2005
+
+o Makefile.sub (install_data, uninstall_sub): Use $(exampledir) for example
+files. Reported by Keith Marshall.
+
+*Mon May 16 2005
+
+o Update groff_mom.man.
+
+*Thu May 12 2005
+
+o Added margin notes capability
+
+o Added mom-specific refer support; refer calls can be embedded in
+ running text, sent to footnotes or endnotes, or collected for
+ output on a bibliography page; also added mom-specific refer
+ control macros
+
+o Added bibliography page capability, with full suite of control
+ macros
+
+o Added referencing of footnotes and endnotes by line number
+
+o Added capability to have footnotes run on when footnotes are
+ being referenced by line number
+
+o Added a post footnote space option, in case users want a little
+ space between their footnotes
+
+o Added ENDNOTE_MARKER_STYLE, so user can choose between endnotes
+ identified by a numerical marker in the text, or by line number
+
+o Added control macros to accommodate differing needs for endnotes
+ identified by line number
+
+o Added ENDNOTE_TITLE_SPACE, so user can control starting position
+ of the endnotes page title
+
+o Extended LIST so that it accepts lowercase alpha, uppercase roman
+ numeral and lowercase roman numeral enumerators; also added a
+ "prefix" argument (which comes *after* the separator argument)
+
+o Changed RESET_LIST so that it can reset a list to any number,
+ letter, or roman numeral, instead of just 1, a, A, I and i
+
+o Change to handling of footnote/endnote markers in text; input
+ lines before FOOTNOTE still require \c, but input line after
+ FOOTNOTE OFF must be entered as a literal continuation of the
+ line before FOOTNOTE, including any required word space or
+ punctuation (this so users can get the footnote marker in text
+ either before or after the punctuation without hassle)
+
+o Added QUOTE_AUTOLEAD and BLOCKQUOTE_AUTOLEAD, so user can have
+ quotes and blockquotes leaded differently from running text
+
+o Reworked QUOTE and BLOCKQUOTE to accommodate _AUTOLEAD control;
+ spacing above and below quotes is equalized *on a per quote
+ basis* (not completely happy with this, but at least it gives
+ users some flexibility in designing (block)quotes)
+
+*Fri Mar 18 2005
+
+o Added mom.vim to /examples
+
+*Thu Jan 20 2005
+
+o Added \*[TB+] and \*[B] to give inline functionality of .TN and
+ .EL, respectively.
+
+o Added SECTION and SECTION_CHAR as aliases of LINEBREAK and
+ LINEBREAK_CHAR
+
+o Added a NOBREAK option to PAD, so when PAD is called, it's possible
+ to instruct mom not to advance on the page.
+
+*Wed Jan 19 2005
+
+o New macro, ADD_SPACE, so that extra space can be added at the
+ top of a new page in document processing; the .ns call in HEADER
+ was making additional space impossible
+
+o Reworked handling of ALD/SPACE/SP and LS when they're used at
+ the tops of pages during pure (i.e. non-docprocessing)
+ typesetting. First lines were still wandering. Should also be
+ more intuitive: ALD after LS advances the specified distance from
+ the top baseline; LS after ALD doesn't change the position of the
+ first baseline (i.e. merely sets the lead for the text that
+ follows).
+
+*Tue Dec 14 2004
+
+o Fixed a small problem with spacing under quotes when paragraph
+ spacing is turned on.
+
+*Fri Dec 10 2004
+
+o Put all calls in VFP_CHECK inside their own environment. Without
+ the .ev call, the trap invoked VFP_CHECK was chopping off the
+ first word of the last line before footnotes.
+
+*Dec 6 2004
+
+o Small fixes to elvis_syntax.new (dealing with strings, \{\ and \}
+
+o Changed
+ . ie \\n[#START] \{\
+ . if \\n[#DOC_HEADER]=0 \{ . \}
+ . \}
+ in HEAD to
+ . ie \\n[#START] \{\
+ . if \\n[#DOC_HEADER]=0 \{ .RLD 1v \}
+ . \}
+ so that HEADs at the start of docs with no docheaders falls on
+ the correct baseline.
+
+*Dec 3 2004
+
+o Removed spurious parens from if ( \\n[#TRAP_DISTANCE] < \\n[#DOC_LEAD]*2 )
+ in SUBHEAD.
+
+*Oct 14 2004
+
+o Reworked the LL macro so that the argument can take a prepended +
+ or - sign (i.e. the argument is relative to the current line
+ length).
+
+*Oct 13 2004
+
+o Added an .if \\n(.n=0 if to the ie clause in LS that controls how mom
+ responds to initial LS invocation at page top if T_MARGIN has
+ been set. Now, if there's text on the "top" baseline, LS behaves
+ as expected when invoked afterwards.
+
+*Oct 11 2004
+
+o Added an ie !r#DOCS clause to the processing of "top baseline"
+ ALDs. ALD is used extensively (internally) in the document
+ processing macros, and does not need to check--indeed, should not
+ check--for top baseline placement prior to execution.
+
+*Sep 29 2004
+
+o Additions to elvis_syntax.new
+
+*Sep 12 2004
+
+o Small fixes to the documentation.
+
+*Aug 21 2004
+
+o Removed superfluous second arguments from strings UP, DOWN, FWD
+ and BCK
+
+*Aug 8 2004
+
+o Version changed from the 1.1.x series to 1.2. All of the
+ features I originally wanted mom to have originally have been
+ implemented, and appear to be stable.
+
+o Major overhaul to the setting of page traps and the handling of
+ footnotes, both "normal" footnotes and footnotes that occur
+ inside QUOTE, BLOCKQUOTE and EPIGRAPH.
+
+o Addtion of font "styles" to om.tmac, plus changes to the FAMILY
+ and FT macros to manage them. New section in the doc appendices
+ on adding fonts and managing the new font styles.
+
+o Mom now uses a "fallback font" whenever there's an illegal call
+ to FAMILY.
+
+o RW and EW now affect only the font in effect. A change of family
+ or font disables them.
+
+o BR_AT_LINE_KERN now properly does a .brp (spread and break) when
+ used in justified text.
+
+o NEWPAGE, which used to be an alias for .bp, has been moved into
+ its own macro, in order to make it more responsive to some unusal
+ situations.
+
+o Some changes to elvis_syn.new, including that the file extensions
+ recognized by elvis now include both .mom and .tmac. This makes
+ om.tmac much easier to read.
+
+*Jul 6 2004
+
+o FT and FAM(ILY) reworked to take advantage of if S, if F and
+ \n[.sty] additions to groff (1.19.2). Warnings are emitted if a
+ style hasn't been registered, or if a font style doesn't exist in
+ the current family. Invalid .FAM(ILY) calls now use a "fallback"
+ font" (although no warning is issued); fallback is user-settable
+
+o New macro, FALLBACK_FONT. Not only controls the fallback font
+ for invalid family calls, but also controls whether mom aborts on
+ invalid .FT calls after issuing a warning.
+
+o RW/EW now affect only the current font (or font style)
+
+o BR_AT_LINE_KERN now (properly) does a break-and-spread when text
+ is justified.
+
+o Fairly extensive list of .sty's added to om.tmac. Hopefully,
+ this will make life easier for users wishing to add new fonts
+ and/or entire new families to their groff site-font/devps
+ directory.
+
+*Jun 6 2004
+
+o Altered kerning slightly for footnote markers in text. Daggers
+ and double-daggers were getting a bit jammed
+
+*Fri Jun 4 2004
+
+o Makefile.sub (HTMLDOCFILES, EXAMPLEFILES, PROCESSEDEXAMPLEFILES): Updated.
+
+*Thu Jun 3 2004
+
+o Rewrote the routines dealing with _FAMILY, _FONT, _SIZE, _COLOR
+ and _QUAD. A single macro for each checks for the calling alias
+ (e.g. TITLE_FAMILY in _FAMILY), and performs the appropriate
+ action.
+
+o All "COLOUR" aliases of "COLOR", no matter where, have been
+ removed.
+
+o Added cover and doc cover page generation.
+
+o Added reference macros COVERTITLE, DOC_COVERTITLE, MISC and
+ COPYRIGHT (for use with covers only)
+
+o Fixed EL and TN so they don't spring page traps; in nofill modes
+ the preceding input line must be terminated by \c.
+
+o Added #T_MARGIN_LEAD_ADJ to DO_B_MARGIN, DO_T_MARGIN and NEWPAGE
+ to ensure accurate placement of first lines on new pages when
+ docprocessing is not taking place.
+
+o Made NEWPAGE it's own macro; formerly just an alias of .bp.
+
+o Made BREAKQUOTE obsolete; rewrote sections of footnote handling,
+ including adding support macros to deal with processing of
+ footnotes that were started inside quotes, blockquotes and
+ epigraphs.
+
+o Added a TERMINATE .em to docprocessing (except letters) to ensure
+ that deferred footnotes print on the last page of a doc.
+
+
+*Mar 15 2004
+
+o Added color support
+
+o Adjusted vertical placement of hyphens around page numbering
+ so that they are better centered on the height of the page
+ number.
+
+o Re-wrote portions of the document processing macros so that tabs
+ behave in a consistent and intuitive manner. Tab structures are
+ now properly preserved from page to page and column to column.
+
+*Feb 20 2004
+
+o Rewrote the macros associated with DOCTYPE LETTER so that the
+ user can enter DATE, TO and FROM in any order s/he likes. For
+ backward compatibility, if the older, fixed order (DATE-TO-FROM)
+ is used, the date goes flush right with two linespaces after
+ it, while the other fields go flush left with a single linespace
+ separating them.
+
+o Fixed handling of DOCHEADER OFF <distance> when <distance> fell
+ short of the top margin of running text (the change is actually
+ in the SHIM macro, which is called by DOCHEADER).
+
+o Added a selection of iso 639 two-letter language codes as
+ optional arguments to SMARTQUOTES, so that the use can enter
+ her/his language code to get language specific quoting styles
+
+o Changed the way the strings for \*[ST<n>], \*[ST<n>X], \*[FU<n>]
+ and \*[BU<n>] are read. Formerly, they were entered literally.
+ Now they're entered as an array.
+
+*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 <n>].
+ 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
+ \*[$REVISION], allowing for the possibility of blank entries that
+ don't mess up headers/footers with zeros if user doesn't want any
+ numbers.
+
+o Extended handling of draft and revision numbers and strings in
+ headers/footers for increased flexibility. It's possible now to
+ have just about any combo of DRAFT_STRING, DRAFT, REVISION_STRING
+ and REVISION, and have them come out in headers/footers as one
+ intuitively expects/wants.
+
+*Fri Jul 25 2003
+
+o Added a .bp after .if \\n[#START]=1 in FOOTER. Without it,
+ in document processing mode, documents that use *none* of the
+ docprocessing tags (yes, there are times when users want to do
+ this) ignored the footer trap.
+
+*Fri Jun 6 2003
+
+o Changed register #DOCHEADER_LEAD_ADJ to string
+
+*Wed May 21 2003
+
+o DOC_TITLE changed to be used exclusively with DOCTYPE DEFAULT
+
+o Fixed problem with restoration of previous doc pagenum
+ style when endnotes use a different pagenum style (set with
+ ENDNOTES_PAGENUM_STYLE)
+
+o Fixed handling of headers/footers with respect to endnotes. Now,
+ when either headers or footers are on, mom picks up the correct
+ page header/footer on the last page prior to ENDNOTES, gets the
+ pageheaders correct for endnotes pages *including the last one*,
+ and picks up correct page headers/footers for the subsequent docs
+ after COLLATE
+
+*Sat May 17 2003
+
+o Added TOC (finally) and a nearly complete set of associated
+ control macros
+
+o Added new control macros to endnotes:
+
+ ENDNOTES_STRING_CAPS - capitalize the endnotes string
+ ENDNOTES_NO_COLUMNS - allows docs in columns and endnotes not
+ ENDNOTES_PAGENUM_STYLE - set page numbering style for endnotes
+ ENDNOTES_FIRST_PAGENUMBER - set first pagenumber for endnotes
+ ENDNOTES_ALLOWS_HEADERS - page headers on endnotes pages off or on
+ ENDNOTES_NO_FIRST_PAGENUM - allows non-printing first page number when page footers are being used instead of headers
+ ENDNOTES_SINGLE_SPACE - for TYPEWRITE, if doc double-spaced
+ SUSPEND/RESTORE_PAGINATION - turns page numbering off for endnotes
+
+o Added an ADJUST option to ENDNOTE_LEAD
+
+o Added DOC_TITLE (like TITLE, but sets document-wide title for collated docs)
+
+o Added HDRFTR_CENTER_PAD, to allow adjustments to placement of
+ HDRFTR_CENTER_STRING
+
+o Added BLANKPAGE macro, to output blank pages (silently numbered)
+
+o Extensive changes to DEFAULTS, START, COLLATE, HEAD, SUBHEAD and
+ PARAHEAD because of new TOC and extended flexibility of ENDNOTES
+ page design
+
+o Fixed DOCHEADER OFF (distance), FINIS
+
+-----------------------------------------------------------------------
+
+*Sat Feb 22 2003
+
+o (Re)-fixed handling of post epigraph spacing after #START for
+ TYPEWRITE double-spaced.
+
+------------------------------------------------------------------------
+
*Sun Feb 16 2003
o Added James Ramsey's proposed CHAPTER_TITLE macro, along with his
@@ -57,6 +450,8 @@ o Changed handling of inline horizontal and vertical movements.
The older forms \*[FP#] and \*[BP#] still work (horizontals), as do
\*[ALD#] and \*[RLD#] (verticals).
+------------------------------------------------------------------------
+
*Mon Aug 19 2002
o Fixed ENDNOTES so footnotes output properly when ENDNOTES is called
@@ -72,15 +467,6 @@ o Added .nf to top of PAD, with a test beforehand for current fill
processing. Updated reserved.html to include number register
#FILL_MODE.
-*Mon Jul 29 2002
-
-o Makefile.sub (FFLAG, TFLAG): Add paths to source directories.
-
-*Wed Jul 24 2002
-
-o Makefile.sub (groff_bin_path): Don't use ' \+' but ' *' for sed.
- (GROFF): Set GROFF_COMMAND_PREFIX to empty value.
-
*Fri Jul 12 2002
o More fixes to underlining.
@@ -111,10 +497,6 @@ o Fixed the character translations for UNDERLINE so they work properly
o Expanded docprocessing.html entry "Special Note on Chapters". Tidied
up html a bit.
-*Tue Jun 18 2002
-
-o examples/macros.mom: Fix path to penguin.ps.
-
*Sat Jun 15 2002
o Small fix to PAD to make the use of inlines within the pad string
@@ -123,17 +505,17 @@ o Small fix to PAD to make the use of inlines within the pad string
o Added \*[RULE] ( = \l'\n(.lu' ) so that full measure rules (either to
full line length or within tabs) are easier to set.
-*Sat Jun 8 2002
+*Sat Jun 8 2002
o Macro .PS renamed to .PT_SIZE. Alias .TS removed.
-o .tr bits in .CAPS rewritten in the form .tr é\['E].
+o .tr bits in .CAPS rewritten in the form .tr é\[`E].
-o General cleanup of docs to reflect changes.
+o General cleanup of docs to reflect changes
-o Small changes/additions to `elvis_syntax'.
+o Small changes/additions to elvis_syn
-*Thu Jun 6 2002
+*Thu Jun 6 2002
o In DOCTYPE, in .if '\\$1'LETTER', added .FOOTER_RIGHT_SIZE +0.
Without it, the suite page was printing at the default
diff --git a/contrib/groff/contrib/mom/Makefile.sub b/contrib/groff/contrib/mom/Makefile.sub
index f066153a74f2..b71ccda3629e 100644
--- a/contrib/groff/contrib/mom/Makefile.sub
+++ b/contrib/groff/contrib/mom/Makefile.sub
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Werner Lemberg (wl@gnu.org)
#
# This file is part of groff.
@@ -15,11 +15,11 @@
#
# You should have received a copy of the GNU General Public License along
# with groff; see the file COPYING. If not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
# These may be overridden if cross-compiling.
GROFFBIN=$(top_builddir)/src/roff/groff/groff
-GROFF_BIN_PATH=`echo $(groff_bin_dirs) | sed -e 's| *|:|g'`
+GROFF_BIN_PATH=`echo $(groff_bin_dirs) | sed -e 's| *|$(SH_SEP)|g'`
groff_bin_dirs=\
$(top_builddir)/src/roff/groff \
@@ -44,6 +44,7 @@ NORMALFILES=\
HTMLDOCFILES=\
momdoc/appendices.html \
+ momdoc/color.html \
momdoc/cover.html \
momdoc/definitions.html \
momdoc/docelement.html \
@@ -53,7 +54,9 @@ HTMLDOCFILES=\
momdoc/inlines.html \
momdoc/intro.html \
momdoc/letters.html \
+ momdoc/macrolist.html \
momdoc/rectoverso.html \
+ momdoc/refer.html \
momdoc/reserved.html \
momdoc/toc.html \
momdoc/typemacdoc.html \
@@ -62,36 +65,42 @@ HTMLDOCFILES=\
EXAMPLEFILES=\
examples/letter.mom \
- examples/macros.mom \
- examples/typeset.mom \
- examples/typewrite.mom \
- examples/README.mom \
+ examples/sample_docs.mom \
+ examples/typesetting.mom \
+ examples/README.txt \
examples/elvis_syntax \
+ examples/elvis_syntax.new \
examples/penguin.ps
PROCESSEDEXAMPLEFILES=\
examples/letter.ps \
- examples/macros.ps \
- examples/typeset.ps \
- examples/typewrite.ps
+ examples/sample_docs.ps \
+ examples/typesetting.ps
+
+HTMLDOCFILES_=`echo $(HTMLDOCFILES) | sed 's|momdoc/||g'`
+EXAMPLEFILES_=`echo $(EXAMPLEFILES) | sed 's|examples/||g'`
+PROCESSEDEXAMPLEFILES_=`echo $(PROCESSEDEXAMPLEFILES) | sed 's|examples/||g'`
CLEANADD=\
penguin.ps \
- $(PROCESSEDEXAMPLEFILES)
+ $(PROCESSEDEXAMPLEFILES) \
+ examples/stamp
.SUFFIXES: .mom .ps
.mom.ps:
$(GROFF) -Tps -mom $< >$@
-all: make_examples
+all: $(PROCESSEDEXAMPLEFILES)
+
+$(PROCESSEDEXAMPLEFILES): penguin.ps examples/stamp
-.PHONY: make_examples
-make_examples: prepare_make_examples $(PROCESSEDEXAMPLEFILES)
+penguin.ps:
+ cp $(srcdir)/examples/penguin.ps .
-prepare_make_examples: examples/penguin.ps
+examples/stamp:
test -d examples || $(mkinstalldirs) examples
- test -f penguin.ps || cp $(srcdir)/examples/penguin.ps .
+ touch $@
install_data: $(NORMALFILES) $(HTMLDOCFILES) \
$(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES)
@@ -100,29 +109,30 @@ install_data: $(NORMALFILES) $(HTMLDOCFILES) \
rm -f $(tmacdir)/$$f; \
$(INSTALL_DATA) $(srcdir)/$$f $(tmacdir)/$$f; \
done
- -test -d $(htmldocdir)/momdoc || $(mkinstalldirs) $(htmldocdir)/momdoc
- for f in $(HTMLDOCFILES); do \
- rm -f $(htmldocdir)/$$f; \
- $(INSTALL_DATA) $(srcdir)/$$f $(htmldocdir)/$$f; \
+ -test -d $(htmldocdir)/mom || $(mkinstalldirs) $(htmldocdir)/mom
+ for f in $(HTMLDOCFILES_); do \
+ rm -f $(htmldocdir)/mom/$$f; \
+ $(INSTALL_DATA) $(srcdir)/momdoc/$$f $(htmldocdir)/mom/$$f; \
done
- -test -d $(exampledir) || $(mkinstalldirs) $(exampledir)
- for f in $(EXAMPLEFILES); do \
- rm -f $(exampledir)/$$f; \
- $(INSTALL_DATA) $(srcdir)/$$f $(docdir)/$$f; \
+ -test -d $(exampledir)/mom || $(mkinstalldirs) $(exampledir)/mom
+ for f in $(EXAMPLEFILES_); do \
+ rm -f $(exampledir)/mom/$$f; \
+ $(INSTALL_DATA) $(srcdir)/examples/$$f $(exampledir)/mom/$$f; \
done
- for f in $(PROCESSEDEXAMPLEFILES); do \
- rm -f $(exampledir)/$$f; \
- $(INSTALL_DATA) $$f $(docdir)/$$f; \
+ for f in $(PROCESSEDEXAMPLEFILES_); do \
+ rm -f $(exampledir)/mom/$$f; \
+ $(INSTALL_DATA) examples/$$f $(exampledir)/mom/$$f; \
done
uninstall_sub:
-for f in $(NORMALFILES); do \
rm -f $(tmacdir)/$$f; \
done
- -for f in $(HTMLDOCFILES); do \
- rm -f $(htmldocdir)/$$f; \
+ -for f in $(HTMLDOCFILES_); do \
+ rm -f $(htmldocdir)/mom/$$f; \
done
- -rmdir $(htmldocdir)/momdoc
- -for f in $(EXAMPLEFILES) $(PROCESSEDEXAMPLEFILES); do \
- rm -f $(docdir)/$$f; \
+ -rmdir $(htmldocdir)/mom
+ -for f in $(EXAMPLEFILES_) $(PROCESSEDEXAMPLEFILES_); do \
+ rm -f $(exampledir)/mom/$$f; \
done
+ -rmdir $(exampledir)/mom
diff --git a/contrib/groff/contrib/mom/NEWS b/contrib/groff/contrib/mom/NEWS
index d4ca87f7666b..2433eb001e30 100644
--- a/contrib/groff/contrib/mom/NEWS
+++ b/contrib/groff/contrib/mom/NEWS
@@ -1,3 +1,240 @@
+Release 1.3
+-----------
+
+Added line numbering capabilities, with controls.
+
+Footnotes and endnotes can now be referenced by line number.
+
+Added ability to adjust vertical position of the title that appears
+on the first endnotes page.
+
+Footnotes can run on when being referenced by line number.
+
+Footnotes now have a post-footnote spacing option, for adding
+a little space between footnotes.
+
+Extended LIST so it accepts alpha, ROMAN and roman enumerators.
+
+Added margin notes capability.
+
+Added refer support.
+
+Added bibliography page support.
+
+Added QUOTE_AUTOLEAD and BLOCKQUOTE_AUTOLEAD, so user can have
+quotes and blockquotes leaded differently from running text.
+
+Change: the input line immediately after FOOTNOTE OFF must be
+entered as a literal continuation of the line prior to FOOTNOTE,
+including any initial spaces or punctuation marks. This allows
+for hassle-free placing of footnote markers in running text either
+before or after punctuation marks.
+
+Release 1.2-f
+-------------
+
+Added ADD_SPACE, to permit users to insert space at the top of
+running text (after the first page) when using the docprocessing
+macros.
+
+Releases 1.2-a and 1.2-b
+------------------------
+
+My personal email address has changed. 1.2-a and -b have been
+updated to reflect that. Additionally, I made some small changes
+to the documentation.
+
+Release 1.2
+-----------
+
+As of 1.2, the recommended version of groff to use with mom has
+been bumped up from groff, 1.18 to groff, 1.19.2. Although mom will
+continue to work with groff, 1.18, her handling of .FAM(ILY) and .FT
+is now slightly different, therefore users of groff 1.18 may have to
+update documents created with mom so that every .FAM(ILY) request is
+followed by a .FT request before any text is input, otherwise mom
+will set the text after .FAM(ILY) in Courier (until she encounters a
+.FT request). People running groff, >= 1.19.2 don't have to worry
+about this, but I recommend that, regardless of which version you're
+running, you have a look at the document entries for FAMILY and FT
+in order to see how mom will be handling .FAMILY and .FT from now
+on.
+
+When used with groff >=1.19.2, mom now emits warnings if a style
+hasn't been registered, or if a font style doesn't exist in the
+current family. Invalid .FAM(ILY) calls now use a "fallback" font"
+(although no warning is issued). The fallback is user-settable.
+
+Mom's macro file, om.tmac, now sets up a fairly extensive list of
+font "styles," thus expanding the range of arguments that can be
+passed to .FT (formerly, just R, I, B and BI, unless users had
+already rolled their own solution to the problem of extensive type
+families containing fonts like condensed, demibold, black, light, etc).
+Users are advised to read the documentation sections on FAM(ILY),
+FT and FALLBACK_FONT, as well as the new appendix section, "Adding
+PostScript fonts to groff", for information on using mom's style
+extensions (and how to disable them, should they conflict with a
+user's present groff site-font/devps setup).
+
+A new macro, FALLBACK_FONT, has been added. It controls not only
+the fallback font for invalid .FAMILY calls, but also whether mom
+aborts on invalid .FT calls after issuing a warning, or continues
+processing using the fallback.
+
+Release 1.1.9
+-------------
+
+Added the (optional) generation of cover pages and document cover
+pages, plus a full suite of control macros for all cover page
+elements.
+
+Added new reference macros that apply to covers: COVERTITLE,
+DOC_COVERTITLE, COPYRIGHT and MISC.
+
+The need for TRAP OFF/TRAP to deal with ELs and TNs that fall at
+the bottom page has been obsoleted. However, both EL and TN, when
+invoked in any "nofill" mode (LEFT, RIGHT, CENTER, or the L | R | C
+arguments to TAB_SET or ST when no QUAD argument is given), must now
+have the input line preceding the EL or TN terminated by \c. Fill
+modes do not have this requirement, i.e. no \c is required.
+
+Footnotes that occur inside quotes, blockquotes and epigraphs now
+work just like regular footnotes, with no user intervention
+required. This obsoletes the macro BREAK_QUOTE.
+
+Removed all aliases that used the word COLOUR. Users must use
+COLOR wherever COLOR is needed. COLOUR, as a replacement/alias, is
+no longer supported.
+
+NEWPAGE, which used to be an alias of .bp, is now its own macro.
+
+Release 1.1.8
+-------------
+
+Added text color support. Users can now define or initialize a color,
+and afterwards change text color with an inline of the form
+\*[<colorname>], or with the macro .COLOR. In document processing,
+the docelement tag control macros have been expanded to include
+_COLOR, e.g. .HEAD_COLOR <predefined colorname> will colorize
+heads, PAGENUM_COLOR <predefined colorname) will colorize page
+numbering, etc.
+
+Adjusted vertical placement of hyphens around page numbering when
+PAGENUM_STYLE is DIGIT, ROMAN or ALPHA so that the hyphens appear
+properly centered on the page numbering character.
+
+Changed tab handling in document processing so that tab structures
+are preserved from page to page and column to column.
+
+Release 1.1.7-a
+---------------
+
+Increased the flexibility of SMARTQUOTES so that they handle quoting
+styles by language, entered as a 2-digit language code argument to
+SMARTQUOTES. See docs.
+
+Re-wrote the DOCTYPE LETTER macros so that DATE, TO and FROM can be
+entered in any order the user wishes, with output that matches
+input. (Should have done this in the first place.)
+
+Release 1.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 <n>].
+This brings mom's inline size change syntax into line with her other
+inlines. \*S[<n>] 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
+---------------
+
+Extended handling of draft and revision numbers and strings in
+headers/footers for increased flexibility. It's possible now to
+have just about any combo of DRAFT_STRING, DRAFT, REVISION_STRING
+and REVISION, and have them come out in headers/footers as one
+intuitively expects/wants.
+
+Also added a new set of syntax highlighting rules for the vi clone,
+elvis. Version 2-2h-beta of elvis finally made possible the
+highlighting of \*[...] inline escapes, whether or not they're
+separated from surrounding text by spaces. This is a terrific
+improvement in elvis, and makes for greatly improved readability of
+mom files.
+
+Release 1.1.6-b - 1.1.6d
+------------------------
+
+Trivial changes to documentation and some cleanups of the main
+om.tmac file, including:
+
+Added a .bp after .if \\n[#START]=1 in FOOTER. Without it,
+in document processing mode, documents that use *none* of the
+docprocessing tags (yes, there are times when users want to do
+this) ignored the footer trap.
+
+Changed register #DOCHEADER_LEAD_ADJ to string
+$DOCHEADER_LEAD_ADJ. This means that .DOCHEADER_LEAD no longer
+requires a unit of measure; points is assumed.
+
+Release 1.1.6-b
+---------------
+
+Added a SHIM macro that calculates and moves to the next "legal"
+baseline during document processing (useful if user starts playing
+around with spacing/leading on a page and needs to get the leading
+back on track).
+
+Fixed handling of DOCHEADER OFF <distance> so that the first line of
+running text falls on a "legal" baseline when <distance> is given.
+
+Release 1.1.6-a
+---------------
+
+Problem with groff 1.19.1 fixed by Werner (.return handled arguments
+incorrectly).
+
+Fixed handling of page numbering style restoration in endnotes, so
+that (collated) docs have the correct page numbering style when the
+style has been changed for endnotes (with ENDNOTES_PAGENUM_STYLE).
+
+DOC_TITLE has been made for use exclusively with DOCTYPE DEFAULT.
+
+Fixed handling of headers/footers with respect to endnotes. Now,
+when either headers or footers are on, mom picks up the correct
+page header/footer on the last page prior to ENDNOTES, gets the
+pageheaders correct for endnotes pages *including the last one*, and
+picks up correct page headers/footers for the subsequent docs after
+COLLATE.
+
+
+Release 1.1.6
+-------------
+
+BAD NEWS: mom appears to be crippled in some areas when run with
+groff 1.19.1. Pending a solution, mom must be run with groff 1.18
+
+***NEW***
+
+Added TOC capabilities.
+
+Extended range of endnotes control macros. See the documentation
+on endnotes control macros.
+
+Added a new DOC_TITLE macro, to deal with collated documents that
+have an overall title, while each doc has its own separate doc
+title (from TITLE).
+
+
Release 1.1.5
-------------
diff --git a/contrib/groff/contrib/mom/TODO b/contrib/groff/contrib/mom/TODO
index c5f15413db6b..1297bbd6a5bb 100644
--- a/contrib/groff/contrib/mom/TODO
+++ b/contrib/groff/contrib/mom/TODO
@@ -1,3 +1,20 @@
+As of version 1.2, the items on this TODO list will only be dealt
+with if users request they be implemented.
+
+UNDERLINING
+-----------
+Explore "the ultimative underline macro" for possible inclusion
+into mom.
+
+NUMBERED HEADS, SUBHEADS and PARAHEADS
+--------------------------------------
+Macros to set numbering style (roman, arabic, alpha, etc)?
+
+FOOTNOTES
+---------
+In columnar docs, maybe give user the choice of gathering all
+footnotes at the bottom of the last column?
+
CONTROL MACROS -- _INDENT
--------------
Let user be able to enter decimal fractions as the argument to _INDENT
@@ -5,17 +22,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/groff/contrib/mom/copyright b/contrib/groff/contrib/mom/copyright
index ea18d013387b..51756d000992 100644
--- a/contrib/groff/contrib/mom/copyright
+++ b/contrib/groff/contrib/mom/copyright
@@ -1,15 +1,15 @@
AUTHOR
------
-Peter Schaffter (df191@ncf.ca)
-15, chemin Brunette
-RR 2, CP 406
-Ste-Cécile-de-Masham (Québec)
+Peter Schaffter (peter@faustus.dyn.ca) (ptpi@golden.net)
+320 Gordon St.
+Fergus, Ontario
CANADA
+N1M 2W3
========================================================================
The groff macro file om.tmac and the html documentation pertaining
-to it are copyright (c) 2002 Peter Schaffter.
+to it are copyright (c) 2004, 2005 Peter Schaffter.
om.tmac is issued under the GNU General Public License, a full copy of
which can be had at
diff --git a/contrib/groff/contrib/mom/examples/README.txt b/contrib/groff/contrib/mom/examples/README.txt
new file mode 100644
index 000000000000..65188a798851
--- /dev/null
+++ b/contrib/groff/contrib/mom/examples/README.txt
@@ -0,0 +1,115 @@
+The files in this directory show mom in action.
+
+If you have downloaded and untarrred a version of mom from her
+homepage, you'll see that none of the example files come with
+corresponding PostScript (.ps) files, as they do with pre-compiled
+versions of groff, or groff built from source.
+
+I haven't included the PostScript output because I want to
+keep the mom archive as lean as possible. To view the PostScript
+output, process the files with groff and either
+
+ a) send the output to a separate file for previewing with a
+ PostScript viewer such as gv (ghostview), or
+
+ b) to your printer.
+
+Using the file sample_docs.mom as an example, you would
+accomplish a) like this:
+
+ groff -mom -Tps sample_docs.mom > sample_docs.ps
+ gv sample_docs.ps
+
+Accomplishing b) depends on your printer setup, but a fairly
+standard way to do it would be
+
+ groff -mom -Tps sample_docs.mom | lpr
+
+ or
+
+ groff -mom -Tps -l sample_docs.mom
+
+Note: I don't recommend previewing with gxditview because it doesn't
+render some of mom's effects properly.
+
+The files themselves
+--------------------
+
+All are set up for 8.5x11 inch paper (US letter).
+
+***typesetting.mom**
+
+The file, typesetting.mom, demonstrates the use of typesetting tabs,
+string tabs, line padding, multi-columns and various indent styles,
+as well as some of the refinements and fine-tuning available via
+macros and inline escapes.
+
+Because the file also demonstrates a "cutaround" using a small
+picture (of everybody's favourite mascot, Tux), the PostScript file,
+penguin.ps has been included in the directory.
+
+***sample_docs.mom***
+
+The file, sample_docs.mom, shows examples of three of the document
+styles available with the mom's document processing macros, as well
+as demonstrating the use of COLLATE.
+
+The PRINTSTYLE of this file is TYPESET, to give you an idea of mom's
+default behaviour when typesetting a document.
+
+The last sample, set in 2 columns, shows off mom's flexibility
+when it comes to designing documents.
+
+If you'd like to see how mom handles exactly the same file when the
+PRINTSTYLE is TYPEWRITE (i.e. typewritten, double-spaced), simply
+change
+
+ .PRINTSTYLE TYPESET
+
+to
+
+ .PRINTSTYLE TYPEWRITE
+
+near the top of the file.
+
+***letter.mom***
+
+This is just the tutorial example from the momdocs, ready for
+previewing.
+
+***elvis_syntax.new***
+
+For those who use the vi clone, elvis, you can paste this file into
+your elvis.syn. Provided your mom documents have the extension
+.mom, they'll come out with colorized syntax highlighting. The
+rules 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 decides to send me syntax highlighting
+rules for emacs. :)
+
+***mom.vim***
+
+Christian V. J. Brüssow has kindly contributed a set of mom syntax
+highlighting rules for use with vim. Copy the file to your
+~/.vim/syntax directory, then, if your vim isn't already set up to
+do so, enable mom syntax highlighting with
+
+ :syntax enable
+
+or
+
+ :syntax on
+
+Please note: I don't use vim, so I won't be making changes to this
+file myself. Christian Brüssow is the maintainer of the ruleset,
+which is available on the Web at
+
+ http://www.cvjb.de/comp/vim/mom.vim
+
+Contact Christian (cvjb@cvjb.de) if you have any suggestions or
+requests.
diff --git a/contrib/groff/contrib/mom/examples/elvis_syntax b/contrib/groff/contrib/mom/examples/elvis_syntax
index 02b91a48b1b8..64fbb3b06de2 100644
--- a/contrib/groff/contrib/mom/examples/elvis_syntax
+++ b/contrib/groff/contrib/mom/examples/elvis_syntax
@@ -1,130 +1,90 @@
#Mom
language mom
-extension .mom
-startword .\
-inword _(
-keyword .ALD .ALIAS .ALWAYS_FULLSPACE_QUOTES .ATTRIBUTE_STRING
-keyword .AUTHOR .AUTHOR_FAMILY .AUTHOR_FONT .AUTHOR_SIZE .AUTOLEAD
-keyword .BLOCKQUOTE .BLOCKQUOTE_FAMILY .BLOCKQUOTE_FONT .BLOCKQUOTE_QUAD .BLOCKQUOTE_SIZE
-keyword .B_MARGIN .BR .BR_AT_LINE_KERN .BREAK_QUOTE
-keyword .CAPS .CENTER .CENTRE
-keyword .CHAPTER .CHAPTER_TITLE CHAPTER_STRING .CITATION .CITE .CLOSING
-keyword .COLLATE .COL_BREAK .COL_BREAK .COL_NEXT .COLUMNS
-keyword .COMMENT .CONDENSE .COPYSTYLE
-keyword .DATE .DEFAULTS
-keyword .DOC_FAM .DOC_FAMILY .DOCHEADER
-keyword .DOCHEADER_ADVANCE .DOCHEADER_LEAD
-keyword .DOC_LEAD .DOC_LEAD_ADJUST .DOC_LEFT_MARGIN .DOC_LINE_LENGTH
-keyword .DOC_LLENGTH .DOC_L_LENGTH .DOC_L_MARGIN .DOC_LMARGIN
-keyword .DOC_LS .DOC_PS .DOC_PT_SIZE .DOC_QUAD
-keyword .DOC_RIGHT_MARGIN .DOC_R_MARGIN .DOC_RMARGIN
-keyword .DOCTYPE .DOCTYPE_FAMILY .DOCTYPE_FONT .DOCTYPE_SIZE
-keyword .DRAFT .DRAFT_STRING .DRAFT_WITH_PAGENUMBER
-keyword .DROPCAP .DROPCAP_ADJUST .DROPCAP_FAMILY .DROPCAP_FONT .DROPCAP_GUTTER .DROPCAP_OFF
-keyword .EL
-keyword .ENDNOTE .ENDNOTES
-keyword .ENDNOTE_FAMILY .ENDNOTE_FONT .ENDNOTE_PT_SIZE .ENDNOTE_LEAD .ENDNOTE_QUAD
-keyword .ENDNOTE_STRING .ENDNOTE_STRING_FAMILY .ENDNOTE_STRING_FONT .ENDNOTE_STRING_SIZE
-keyword .ENDNOTE_STRING_QUAD .ENDNOTE_STRING_UNDERSCORE
-keyword .ENDNOTE_TITLE .ENDNOTE_TITLE_FAMILY .ENDNOTE_TITLE_FONT .ENDNOTE_TITLE_SIZE
-keyword .ENDNOTE_TITLE_QUAD .ENDNOTE_TITLE_UNDERSCORE
-keyword .ENDNOTE_NUMBER_FAMILY .ENDNOTE_NUMBER_FONT .ENDNOTE_NUMBER_SIZE
-keyword .ENDNOTE_NUMBERS_ALIGN_RIGHT .ENDNOTE_NUMBERS_ALIGN_LEFT
-keyword .ENDNOTE_PARA_INDENT .ENDNOTE_PARA_SPACE .ENDNOTES_FOOTER_CENTER .ENDNOTES_HEADER_CENTER
-keyword .EPIGRAPH .EPIGRAPH_AUTOLEAD .EPIGRAPH_FAMILY .EPIGRAPH_FONT
-keyword .EPIGRAPH_INDENT .EPIGRAPH_QUAD .EPIGRAPH_SIZE
-keyword .EW .EXTEND
-keyword .FAM .FAMILY
-keyword .FINIS .FINIS_STRING
-keyword .FOOTER .FOOTER_CENTER .FOOTER_CENTER_CAPS .FOOTER_CENTER_FAM .FOOTER_CENTER_FAMILY
-keyword .FOOTER_CENTER_FONT .FOOTER_CENTER_FT .FOOTER_CENTER_PS .FOOTER_CENTER_SIZE
-keyword .FOOTER_CENTRE .FOOTER_CENTRE_CAPS .FOOTER_CENTRE_FAM .FOOTER_CENTRE_FAMILY
-keyword .FOOTER_CENTRE_FT .FOOTER_CENTRE_PS .FOOTER_CENTRE_SIZE .FOOTER_FAM
-keyword .FOOTER_FAMILY .FOOTER_GAP .FOOTER_LEFT .FOOTER_LEFT_CAPS .FOOTER_LEFT_FAM
-keyword .FOOTER_LEFT_FAMILY .FOOTER_LEFT_FONT .FOOTER_LEFT_FT .FOOTER_LEFT_PS
-keyword .FOOTER_LEFT_SIZE .FOOTER_MARGIN .FOOTER_ON_FIRST_PAGE .FOOTER_PLAIN
-keyword .FOOTER_RECTO .FOOTER_RIGHT .FOOTER_RIGHT_CAPS .FOOTER_RIGHT_FAM .FOOTER_RIGHT_FAMILY
-keyword .FOOTER_RIGHT_FONT .FOOTER_RIGHT_FT .FOOTER_RIGHT_PS .FOOTER_RIGHT_SIZE
-keyword .FOOTER_RULE .FOOTER_RULE_GAP .FOOTERS .FOOTER_SIZE .FOOTER_VERSO
-keyword .FOOTNOTE .FOOTNOTE_AUTOLEAD .FOOTNOTE_FAMILY .FOOTNOTE_FONT .FOOTNOTE_MARKERS
-keyword .FOOTNOTE_MARKER_STYLE .FOOTNOTE_QUAD .FOOTNOTE_RULE .FOOTNOTE_RULE_ADJ
-keyword .FOOTNOTE_RULE_LENGTH .FOOTNOTE_SIZE
-keyword .FROM .FT
-keyword .GREETING
-keyword .HDRFTR_CENTER .HDRFTR_CENTER .HDRFTR_CENTER_CAPS .HDRFTR_CENTER_FAMILY
-keyword .HDRFTR_CENTER_FONT .HDRFTR_CENTER_SIZE .HDRFTR_FAMILY .HDRFTR_GAP
-keyword .HDRFTR_LEFT .HDRFTR_LEFT .HDRFTR_LEFT_CAPS .HDRFTR_LEFT_FAMILY
-keyword .HDRFTR_LEFT_FONT .HDRFTR_LEFT_SIZE .HDRFTR_MARGIN .HDRFTR_PLAIN
-keyword .HDRFTR_RIGHT .HDRFTR_RIGHT_CAPS .HDRFTR_RIGHT_FAMILY .HDRFTR_RIGHT_FONT
-keyword .HDRFTR_RIGHT_SIZE .HDRFTR_RULE .HDRFTR_RULE_GAP .HDRFTR_RULE_INTERNAL
-keyword .HDRFTR_RULE_INTERNAL .HDRFTR_SIZE
-keyword .HEAD .HEAD_CAPS .HEADER .HEADER_CENTER .HEADER_CENTER_CAPS
-keyword .HEADER_CENTER_FAM .HEADER_CENTER_FAMILY .HEADER_CENTER_FONT
-keyword .HEADER_CENTER_FT .HEADER_CENTER_PS .HEADER_CENTER_SIZE .HEADER_CENTRE
-keyword .HEADER_CENTRE_CAPS .HEADER_CENTRE_FAM .HEADER_CENTRE_FAMILY
-keyword .HEADER_CENTRE_FONT .HEADER_CENTRE_FT .HEADER_CENTRE_PS .HEADER_CENTRE_SIZE
-keyword .HEADER_FAM .HEADER_FAMILY .HEADER_GAP
-keyword .HEADER_LEFT .HEADER_LEFT_CAPS .HEADER_LEFT_FAM .HEADER_LEFT_FAMILY
-keyword .HEADER_LEFT_FONT .HEADER_LEFT_FT .HEADER_LEFT_PS .HEADER_LEFT_SIZE
-keyword .HEADER_MARGIN .HEADER_PLAIN
-keyword .HEADER_RECTO .HEADER_RIGHT .HEADER_RIGHT_CAPS .HEADER_RIGHT_FAM .HEADER_RIGHT_FAMILY
-keyword .HEADER_RIGHT_FONT .HEADER_RIGHT_FT .HEADER_RIGHT_PS .HEADER_RIGHT_SIZE .HEADER_VERSO
-keyword .HEADER_RULE .HEADER_RULE_GAP .HEADERS .HEADER_SIZE
-keyword .HEAD_FAMILY .HEAD_FONT .HEAD_QUAD .HEAD_SIZE .HEAD_SPACE .HEAD_UNDERLINE
-keyword .HI .HY .HYPHENATE .HYPHENATION .HY_SET
-keyword .IB .IBX .IBQ .IH .IL .ILX .ILQ
-keyword .IQ .IR .IRX .IRQ .IT .IX
-keyword .INDENT_FIRST_PARAS .ITALIC_MEANS_ITALIC
-keyword .JUSTIFY
-keyword .KERN
-keyword .LEADER_CHARACTER .LEFT .LIG .LIGATURES .LINEBREAK .LL .LL .L_MARGIN .LS
-keyword .MCO .MCR .MCX
-keyword .NEWPAGE .NEW_PAGE .NO_SUITE .NUMBER_HEADS .NUMBER_PARAHEADS .NUMBER_SUBHEADS
-keyword .PAD .PADMARKER .PAD_STRING .PAGE .PAGE_LENGTH .PAGELENGTH .PAGEWIDTH
-keyword .PAGENUM .PAGENUM_FAMILY .PAGENUM_FONT .PAGENUM_HYPHENS
-keyword .PAGENUM_ON_FIRST_PAGE .PAGENUM_POS .PAGENUM_SIZE .PAGENUM_STYLE
-keyword .PAGINATE .PAGINATION .PAPER
-keyword .PARAHEAD .PARAHEAD_FAMILY .PARAHEAD_FONT .PARAHEAD_INDENT .PARAHEAD_SIZE
-keyword .PARA_INDENT .PARA_SPACE
-keyword .PP .PP_FONT .PP_FT .PT_SIZE .PSPIC
-keyword .PRINTSTYLE
-keyword .QUAD
-keyword .QUOTE .QUOTE_FAMILY .QUOTE_FONT .QUOTE_INDENT .QUOTE_SIZE
-keyword .RECTO_VERSO
-keyword .RESET_FOOTNOTE_NUMBER .RESET_HEAD_NUMBER .RESET_PARAHEAD_NUMBER
-keyword .RESET_SUBHEAD_NUMBER
-keyword .REVISION .REVISION_STRING .RIGHT .RLD .R_MARGIN .RW
-keyword .SETBOLDER .SETSLANT .SILENT .SLANT_MEANS_SLANT .SMARTQUOTES .SP .SPACE
-keyword .SPREAD .SS .ST .START .STRING .SUBHEAD .SUBHEAD_FAMILY .SUBHEAD_FONT .SUBHEAD_SIZE
-keyword .SUBTITLE .SUBTITLE_FAMILY .SUBTITLE_FONT .SUBTITLE_SIZE
-keyword .SWITCH_FOOTERS .SWITCH_HDRFTR .SWITCH_HEADERS
-keyword .TAB_SET .TAB .TABSET .TB .TI
-keyword .TITLE .TITLE_FAMILY .TITLE_FONT .TITLE_SIZE .T_MARGIN
-keyword .TN .TO .TQ .TRAP .TYPESIZE
-keyword .UNDERLINE .UNDERLINE_ITALIC .UNDERLINE_QUOTES .UNDERLINE_SLANT
-keyword .UNDERSCORE .UNDERSCORE_2 .UNDERSCORE2
-keyword .WS
-font fixed DEFAULT CHAPTER NAMED LETTER
-font fixed TYPESET TYPEWRITE
-font fixed FINAL DRAFT
-font fixed BLOCK QUAD
-font fixed LEFT RIGHT CENTER CENTRE JUSTIFY TOP BOTTOM
-font fixed OFF QUIT END EXIT DONE NO
-font fixed PAGE NUMBER STAR
-font fixed COND EXT
-font fixed LETTER LEGAL EXECUTIVE LEDGER TABLOID QUARTO FOLIO
-font fixed 10x14 A3 A4 A5 B4 B5
-font fixed SINGLESPACE
-font fixed FACTOR
-font underlined \/ \/. \/? \/! \/, \/; \/:
-font underlined \, \,. \,? \,! \,, \,; \,:
-font underlined \\ \~ \% \0 \: \( \| \^ \& \%
-font underlined \b \c \C \d \D \e \f \f( \h \l \L \p \r \s \s+ \s- \S \u \v \w
-font fixed \(bu \(co \(ct \(de \(dg \(di \(em \(en \(mu \(pl \(rg \(sc \(sq
-font fixed \(14 \(12 \(34 \(+-
-font fixed # ' ^
-font italic "
-character \]
-comment \#
-comment \"
-comment \!
+extension .mom .tmac
+
+startword .
+color startword normal
+
+inword _.'
+color inword normal
+
+other initialpunct
+mostly normal
+
+backslash none
+
+color args like fixed
+color braces like char
+color brackets like underlined
+color chars like emphasized
+color decimals like number
+color ellipsis normal
+color escapes like keyword
+color math like cursor
+color misc like string
+color operators like string
+color parens like comment
+color reg_string like math
+color tmac_escapes like keyword
+color single_slash like char
+
+font args DA DE EN ES FR IT NL NO PT SV
+font args DEFAULT CHAPTER NAMED LETTER
+font args TYPESET TYPEWRITE
+font args FINAL DRAFT
+font args BLOCK QUAD
+font args LEFT RIGHT CENTER CENTRE JUSTIFY TOP BOTTOM L R C J
+font args OFF QUIT END EXIT DONE NO ALL
+font args PAGE NUMBER STAR
+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
+font args RGB CYM CMYK GRAY GREY
+font args COND CONDX EXT EXTX SUP SUPX CONDSUP CONDSUPX EXTSUP EXTSUPX
+font args BOLDER BOLDERX SLANT SLANTX
+font args UP DOWN BCK FWD BU BP FU FP
+font args ROM IT BD BDI PREV
+font args ST
+font args SUSPEND RESUME
+
+prefix { \{ \{\
+font braces { \{ \{\
+prefix [ ]
+font brackets [ ]
+prefix \(bu \(co \(ct \(de \(dg \(di \(em \(en \(mu \(pl \(rg \(sc \(sq \(lq \(rq
+font chars \(bu \(co \(ct \(de \(dg \(di \(em \(en \(mu \(pl \(rg \(sc \(sq \(lq \(rq
+prefix \(14 \(12 \(34 \(+-
+font chars \(14 \(12 \(34 \(+-
+prefix \fR \fB \fI \fP \f0 \f1 \f2 \f3
+font chars \fR \fB \fI \fP \f0 \f1 \f2 \f3
+prefix .0 .1 .2 .3 .4 .5 .6 .7 .8 .9
+font decimals . .0 .1 .2 .3 .4 .5 .6 .7 .8 .9
+prefix \/ \/. \/? \/! \/, \/; \/:
+font escapes \/ \/. \/? \/! \/, \/; \/:
+prefix \, \,. \,? \,! \,, \,; \,:
+font escapes \, \,. \,? \,! \,, \,; \,:
+prefix \~ \0 \: \| \^ \& \% \!
+font escapes \~ \0 \: \| \^ \& \% \!
+prefix \b \c \C \d \D \e \f \f( \h \l \L \p \r \s \s+ \s- \S \u \v \w
+font escapes \b \c \C \d \D \e \f \f( \h \l \L \p \r \s \s+ \s- \S \u \v \w
+prefix ...
+font ellipsis ...
+prefix + - * / = == < > <= >= <? >? %
+font math + - * / = == < > <= >= <? >? %
+prefix |
+font misc |
+prefix ! : &
+font operators ! : &
+prefix ( )
+font parens ( )
+prefix # * $
+font reg_string # * $
+prefix \n \* \[
+font single_slash \n \* \[
+prefix \\n \\* \\$
+font tmac_escapes \\n \\* \\$
+
+comment \#
+comment \"
diff --git a/contrib/groff/contrib/mom/examples/elvis_syntax.new b/contrib/groff/contrib/mom/examples/elvis_syntax.new
new file mode 100644
index 000000000000..d31e0c2634f0
--- /dev/null
+++ b/contrib/groff/contrib/mom/examples/elvis_syntax.new
@@ -0,0 +1,106 @@
+" Steve Kirkendall has thoughtfully reworked elvis's syntax
+" highlighting so that it now supports nroff constructs like \fBword
+" and \(emword, with \fB and \(em being highlighted while "word" is
+" not.
+"
+" There are some other enhancements as well, making it possible
+" to have any word beginning with punctuation (i.e. groff
+" requests) highlighted. I've decided to take advantage of these
+" improvements, which apply to elvis-2.2h onwards, and write a new
+" simplified set of syntax highlighting rules for mom. Just plug
+" this file at the end of /etc/elvis/elvis.syn to use them.
+"
+" If you're using an older version of elvis, stick with the
+" highlighting rules in the files elvis_syntax.
+
+#Mom
+language mom
+extension .mom .tmac
+
+startword .
+color startword normal
+
+inword _.'
+color inword normal
+
+other initialpunct
+mostly normal
+
+backslash none
+
+color args like fixed
+color braces like char
+color brackets like underlined
+color chars like emphasized
+color decimals normal
+color ellipsis normal
+color escapes like keyword
+color math like cursor
+color misc like string
+color operators like string
+color parens like comment
+color reg_string like math
+color tmac_escapes like keyword
+color single_slash like char
+
+font args DA DE EN ES FR IT NL NO PT SV
+font args DEFAULT CHAPTER NAMED LETTER
+font args TYPESET TYPEWRITE
+font args FINAL DRAFT
+font args BLOCK QUAD
+font args LEFT RIGHT CENTER CENTRE JUSTIFY TOP BOTTOM L R C J
+font args OFF QUIT END EXIT DONE NO ALL
+font args PAGE NUMBER STAR LINE
+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 ROMAN roman alpha
+font args SUSPEND RESUME
+font args RGB CYM CMYK GRAY GREY
+font args COND CONDX EXT EXTX SUP SUPX CONDSUP CONDSUPX EXTSUP EXTSUPX
+font args BOLDER BOLDERX SLANT SLANTX
+font args UP DOWN BCK FWD BU BP FU FP FN_MARK EN_MARK
+font args ROM IT BD BDI PREV
+font args ST
+
+prefix { \{ \} \{\ }
+font braces { \{ \} \{\ }
+prefix [ ]
+font brackets [ ]
+prefix \(bu \(co \(ct \(de \(dg \(di \(em \(en \(mu \(pl \(rg \(sc \(sq \(lq \(rq
+font chars \(bu \(co \(ct \(de \(dg \(di \(em \(en \(mu \(pl \(rg \(sc \(sq \(lq \(rq
+prefix \(14 \(12 \(34 \(+-
+font chars \(14 \(12 \(34 \(+-
+prefix \fR \fB \fI \fP \f0 \f1 \f2 \f3
+font chars \fR \fB \fI \fP \f0 \f1 \f2 \f3
+prefix .0 .1 .2 .3 .4 .5 .6 .7 .8 .9
+font decimals . .0 .1 .2 .3 .4 .5 .6 .7 .8 .9
+prefix \/ \/. \/? \/! \/, \/; \/:
+font escapes \/ \/. \/? \/! \/, \/; \/:
+prefix \, \,. \,? \,! \,, \,; \,:
+font escapes \, \,. \,? \,! \,, \,; \,:
+prefix \~ \0 \: \| \^ \& \% \!
+font escapes \~ \0 \: \| \^ \& \% \!
+prefix \b \c \C \d \D \e \f \f( \h \l \L \p \r \s \s+ \s- \S \u \v \w
+font escapes \b \c \C \d \D \e \f \f( \h \l \L \p \r \s \s+ \s- \S \u \v \w
+prefix ...
+font ellipsis ...
+prefix + - * / = == < > <= >= <? >? %
+font math + - * / = == < > <= >= <? >? %
+prefix |
+font misc |
+prefix ! : &
+font operators ! : &
+prefix ( )
+font parens ( )
+prefix # * $
+font reg_string # * $
+prefix \n \*
+font single_slash \n \*
+prefix \\n \\* \\$
+font tmac_escapes \\n \\* \\$
+
+character \]'
+comment \#
+comment \"
diff --git a/contrib/groff/contrib/mom/examples/sample_docs.mom b/contrib/groff/contrib/mom/examples/sample_docs.mom
new file mode 100644
index 000000000000..592c75e170ff
--- /dev/null
+++ b/contrib/groff/contrib/mom/examples/sample_docs.mom
@@ -0,0 +1,574 @@
+\# This file contains three greeked documents collated together:
+\#
+\# i) two pages of a novelist's outline
+\# ii) two pages of a chapter using COPYSTYLE DRAFT
+\# iii) three pages of an academic paper, set in two columns
+\#
+\# Mom's defaults are used throughout, except for iii), which
+\# demonstrates some of the ways you can design your own documents.
+\#
+\# Since the text throughout is greeked, and groff doesn't know how
+\# to hyphenate all that pseudo-latinate nonsense, I've inserted
+\# discretionary hyphens (\%) into a large number of the the words.
+\# Normally, this isn't necessary.
+\#
+\# The PRINTSTYLE is TYPESET. If you'd like to see what mom does
+\# with the documents when the PRINTSTYLE is TYPEWRITE, change
+\# PRINTSTYLE TYPESET, below, to PRINTSTYLE TYPEWRITE. Also, in the
+\# third example, comment out PARA_INDENT and QUOTE_INDENT (lines
+\# 332 and 333).
+\#
+\# ===================================================================
+\#
+\# First, a sample "NAMED" document--in this case, an outline.
+\# A novelist wouldn't normally write an outline with numbered heads,
+\# subheads and paraheads. I've turned the feature on merely to
+\# demonstrate it.
+\#
+\# Reference macros
+\#
+.TITLE "Lake Attica's Shores"
+.SUBTITLE "A Romance Novel"
+.AUTHOR "Rosemary Winspeare"
+.DRAFT 1 \" Ignored because COPYSTYLE is FINAL
+.REVISION 2 \" Ignored because COPYSTYLE is FINAL
+.COPYRIGHT "2004 Alma Podborski
+\#
+\# Reference macros for the document cover
+\#
+.DOC_COVERTITLE "Sample mom Documents"
+.MISC "Three types of mom documents" "assembled and collated by mom's author"
+\#
+\# Docstyle macros
+\#
+.DOCTYPE NAMED "Outline"
+.PRINTSTYLE TYPESET \" Or TYPEWRITE to preview "typewritten, double-spaced"
+\#
+.DOC_COVER COVERTITLE MISC
+.COVER TITLE AUTHOR DOCTYPE COPYRIGHT
+\#
+\# Additional setup macros
+\#
+.NUMBER_PARAHEADS
+\#
+.START
+.PP
+.PARAHEAD "A note on the setting"
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
+sed diam voluptua. Stet clita kasd gubergren, no sea takimata sanctus est.
+At vero eos et accusam et justo duo do\%lo\%re et ea rebum.
+.PP
+Stet clita kasd gubergren, no sea takimata sanctus est. Lorem ipsum
+dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
+tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat, sed diam
+voluptua.
+.PP
+Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
+ut labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua. At
+vero, eos et accusam et justo duo do\%lo\%res et ea rebum. Consetetur
+sadipscing elitr, sed diam nonumy.
+.LINEBREAK
+.PP
+.PARAHEAD "About historical personnages"
+At vero eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita
+kasd gubergren, no sea takimata sanctus est. Tempor invidunt ut
+labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua.
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
+sed diam voluptua. Consetetur sadipscing elitr, sed diam nonumy
+eirmod tempor invidunt ut labore et do\%lo\%re magna. Tempor invidunt
+ut labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua.
+.NUMBER_HEADS
+.NUMBER_SUBHEADS
+.HEAD "Part One"
+.SUBHEAD "Chapter 1"
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
+sed diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
+ali\%quyam erat, sed diam voluptua. At vero eos et accusam et
+justo duo do\%lo\%res et ea rebum.
+.PP
+At vero eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita
+kasd gubergren, no sea takimata sanctus est. Lorem ipsum dolor sit
+amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
+invidunt ut labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua.
+Stet clita kasd gubergren, no sea takimata sanctus est.
+.SUBHEAD "Chapter 2"
+.PP
+Stet clita kasd gubergren, no sea takimata sanctus est. Lorem ipsum
+dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
+tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat, sed diam
+voluptua. At vero eos et accusam et justo duo do\%lo\%res et ea rebum.
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
+sed diam nonumy eirmod tempor invidunt. Ut labore et do\%lo\%re magna
+ali\%quyam erat, sed diam voluptua at vero.
+.SUBHEAD "Chapter 3"
+.PP
+Eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita kasd
+gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
+sed diam voluptua. At vero eos et accusam et justo duo do\%lo\%res et
+ea rebum.
+.HEAD "Part Two"
+.SUBHEAD "Chapter 4"
+.PP
+Stet clita kasd gubergren, no sea takimata sanctus est
+lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
+sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
+et do\%lo\%re magna ali\%quyam erat, sed diam voluptua.
+.PP
+At vero eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita
+kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet.
+.PP
+Nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
+sed diam voluptua. At vero eos et accusam et justo duo do\%lo\%res et
+ea rebum. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
+sed diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
+ali\%quyam erat, sed diam voluptua. At vero eos et accusam et justo
+duo do\%lo\%res et ea rebum. Stet clita kasd gubergren, no sea takimata
+sanctus est lorem ipsum dolor sit amet. Consetetur sadipscing elitr,
+sed diam nonumy eirmod tempor invidunt.
+.SUBHEAD "Chapter 5"
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
+diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
+ali\%quyam erat, sed diam voluptua. At vero eos et accusam et
+justo duo do\%lo\%res et ea rebum. Stet clita kasd gubergren,
+no sea takimata sanctus est lorem ipsum dolor sit amet.
+.PP
+Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
+ut labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua. At vero
+eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita kasd
+gubergren, no sea takimata sanctus.
+.PP
+At vero eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita
+kasd gubergren. Sea takimata sanctus est lorem ipsum dolor
+sit amet. Accusam et justo duo do\%lo\%res et ea rebum
+.SPREAD
+.RIGHT
+\*[BD]\&...end of sample outline\c
+.EL
+.COLLATE
+\#
+\# The .EL after the line "...end of sample outline" ensures that
+\# mom doesn't spring the page trap, which would deposit a header at
+\# the top of the next page. COLLATE doesn't print a page header
+\# on the first page of a collated document, but if the page trap
+\# has already deposited one there, COLLATE can't undo it.
+\#
+\# Normally, this isn't necessary; here we require it because the
+\# line falls right at the bottom of the page, and would therefore
+\# normally spring the page trap. Sorry for the fussiness, but at
+\# least now you know what to do if you ever encounter the problem
+\# of a page header printing at the top of a collated document.
+\#
+\# Please notice, too, the use of "\&" before "..." Whenever an
+\# input line begins with either a period, an apostrophe or a space,
+\# you must precede it with \&, otherwise the line will disappear,
+\# even when, as here, there's an inline escape that starts the
+\# line.
+\#
+\# =====================================================================
+\#
+\# Next, two pages of a chapter, set in DRAFT style, showing
+\# the use of the EPIGRAPH BLOCK macro and the QUOTE macro.
+\#
+\# You'll notice that the starting page number of this "draft" is 1 (in
+\# roman numerals). COPYSTYLE DRAFT always numbers the first page of a
+\# document 1.
+\#
+\# Reference macros
+\#
+.TITLE "Lake Attica's Shores"
+.SUBTITLE "A Romance Novel"
+.AUTHOR "Rosemary Winspeare"
+.CHAPTER 1
+.CHAPTER_TITLE "The Bonny Blue Yonder"
+.DRAFT 1
+.REVISION 2
+.MISC "Draft 1, 2nd revision"
+\#
+\# Docstyle macros
+\#
+.DOCTYPE CHAPTER
+.COPYSTYLE DRAFT
+\#
+\# Additional style macros
+\#
+.EPIGRAPH_FONT I \" Epigraphs are normally set in roman
+.DRAFT_WITH_PAGENUMBER \" Draft/revision info usually goes in the header
+.COVER_MISC_QUAD RIGHT \" Change default position of the cover "misc" line
+\#
+.COVER CHAPTER+TITLE MISC
+\#
+.START
+.EPIGRAPH BLOCK
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
+sed diam voluptua.
+.RIGHT
+\*[ROM]\(emJoseph E. Blough
+.EPIGRAPH OFF
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
+sed diam voluptua. At vero eos et accusam et justo duo do\%lo\%res et
+ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est.
+At vero eos et accusam et justo duo do\%lo\%res et ea rebum. Lorem ipsum
+dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
+tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat, sed diam
+voluptua. At vero eos et accusam et justo duo do\%lo\%res et ea rebum.
+Stet clita kasd gubergren, no sea takimata sanctus est. At vero eos
+et accusam et justo duo do\%lo\%res et ea rebum.
+.PP
+Stet clita kasd gubergren, no sea takimata sanctus est. Lorem ipsum
+dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
+tempor invidunt.
+.PP
+"Consetetur sadipscing elitr," dixit ea.
+.PP
+"Sed diam nonumy eirmod tempor invidunt ut labore," dixit eum.
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
+sed diam voluptua. Consetetur sadipscing elitr, sed diam nonumy
+eirmod tempor invidunt ut labore et do\%lo\%re magna.
+.PP
+"Lorem ipsum dolor sit amet," dixit ea.
+.PP
+"At vero eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita
+kasd gubergren, no sea takimata sanctus est," dixit eum. "Sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
+sed diam voluptua."
+.PP
+Consetetur sadipscing elitr, sed diam nonumy eirmod tempor:
+.QUOTE
+Invidunt ut labore et do\%lo\%re
+Magna ali\%quyam erat sed diam
+Voluptua stet clita kasd gubergren
+No sea takimata sanctus est.
+.QUOTE OFF
+.PP
+Justo duo do\%lo\%res et ea rebum. Stet clita kasd gubergren, no
+sea takimata sanctus est. Lorem ipsum dolor sit amet, consetetur
+sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
+et do\%lo\%re magna ali\%quyam erat, sed diam voluptua.
+.PP
+"Stet clita kasd gubergren," dixit ea.
+.PP
+"No sea takimata sanctus est," dixit eum.
+.PP
+Nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna. Aliquyam erat
+sed diam voluptua. At vero eos et accusam et justo, duo do\%lo\%res et
+ea rebum.
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
+nonumy eirmod tempor invidunt. Ut labore et do\%lo\%re magna ali\%quyam
+erat, sed diam voluptua at vero. Stet clita kasd gubergren, no sea
+takimata sanctus est. Consetetur sadipscing elitr, sed diam nonumy
+eirmod tempor invidunt ut labore et do\%lo\%re magna.
+.PP
+Invidunt ut labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua.
+At vero eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita
+kasd gubergren, no sea takimata sanctus est. At vero eos et accusam et
+justo duo do\%lo\%res et ea rebum. Lorem ipsum dolor sit amet, consetetur
+sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
+et do\%lo\%re magna ali\%quyam erat, sed diam voluptua. At vero eos et
+accusam et justo duo do\%lo\%res et ea rebum. Stet clita kasd gubergren,
+no sea takimata sanctus est. At vero eos et accusam et justo duo
+do\%lo\%res et ea rebum.
+.RIGHT
+\*[BD]\&...end of sample chapter
+.COLLATE
+\#
+\# =====================================================================
+\#
+\# Finally, a sample academic article, set in two columns with a
+\# 1.5-pica gutter between them. This example also uses QUOTES,
+\# BLOCKQUOTES and FOOTNOTES. In addition, it's set RECTO_VERSO,
+\# with differing left and right margins that alternate from page to
+\# page. (The header also flips from right to left, which you can
+\# see on the 2nd and 3rd pages).
+\#
+\# In order to accomodate the narrow measure of the columns, there's also
+\# a demonstration of things you can change with both the typesetting
+\# macros and the document processing "control" macros.
+\#
+\# Reference macros
+\#
+.TITLE "CONTROL EQUALS CHAOS"
+.SUBTITLE "\*[ALD1]The Psychological and Auditory \
+Impact of Serial vs. Aleatoric Music\*[RLD1]"
+.AUTHOR "Joe Chang" "and" "Brad Hegel Connors"
+.COPYRIGHT "2004 J. Chang, B.H. Connors
+.MISC "Submitted June 3, 2004" "\*[IT]Piano Quarterly\*[PREV]"
+\#
+\# Docstyle macros
+\#
+.DOCTYPE DEFAULT
+.COPYSTYLE FINAL
+\#
+\# Additional style macros -- general type parameters
+\#
+.L_MARGIN 6P
+.R_MARGIN 4P+6p
+.PT_SIZE 10
+.AUTOLEAD 1.5
+\#
+\# Additional style macros -- change mom's default behaviour
+\#
+.RECTO_VERSO
+.PAGENUM 1
+.HEADER_LEFT "Chang, Connors" \" Because we have two authors
+.COLUMNS 2 1P+6p
+.SUBTITLE_SIZE +1.5
+.AUTHOR_SIZE +.5
+.DOCHEADER_LEAD +2p
+.HEADER_SIZE +1
+.PARA_INDENT 1P \" Comment this out if previewing PRINTSTYLE TYPEWRITE
+.QUOTE_INDENT 2 \" Comment this out if previewing PRINTSTYLE TYPEWRITE
+.SUBHEAD_SIZE +0
+.BLOCKQUOTE_FAMILY H
+.BLOCKQUOTE_SIZE -2
+.NUMBER_HEADS OFF \" Because we turned them on in the first example
+.NUMBER_SUBHEADS OFF \" Ibid
+\#
+.COVER TITLE AUTHOR COPYRIGHT MISC
+\#
+.START
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna. Ali\%quyam
+erat, sed diam voluptua.
+.PP
+At vero eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita
+kasd gubergren no sea takimata. Sanctus est, lorem ipsum dolor sit
+amet. Consetetur sadipscing elitr, sed diam nonumy. Eirmod tempor
+invidunt ut labore et do\%lo\%re magna ali\%quyam erat. Sed diam voluptua
+at vero eos et accusam et justo.
+\#
+.BLOCKQUOTE
+Stet clita kasd gubergren, no sea takimata sanctus est lorem.
+Ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
+eirmod tempor. Invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
+sed diam voluptua at vero. Eos et accusam et justo duo do\%lo\%res et
+ea rebum stet clita.\c
+.FOOTNOTE \" Note the use of \c, above, to keep the word and footnote marker together.
+Clita ipsum dolor sit amet, consetetur sadipscing elitr.
+.FOOTNOTE OFF
+.BLOCKQUOTE OFF
+\#
+.PP
+Duo do\%lo\%res et ea rebum, stet clita kasd gubergren. No sea takimata
+sanctus est lorem ipsum dolor sit amet, consetetur sadipscing elitr.
+Sed diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
+ali\%quyam. Erat sed diam voluptua at. Vero eos et accusam et justo
+duo do\%lo\%res et ea rebum stet. Clita kasd gubergren no sea takimata
+sanctus est.
+.PP
+Nonumy eirmod tempor invidunt, ut labore et do\%lo\%re magna ali\%quyam
+erat? At vero eos et accusam et justo duo do\%lo\%res et ea. Rebum stet
+clita kasd gubergren no sea takimata sanctus. Est lorem ipsum dolor
+sit amet. Sadipscing\c
+.FOOTNOTE
+Sadipscing diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
+ali\%quyam erat, sed diam voluptua.
+.FOOTNOTE OFF
+ elitr sed diam nonumy eirmod tempor invidunt. Ut labore et do\%lo\%re
+magna ali\%quyam erat, sed diam voluptua. At vero eos et accusam et
+justo duo do\%lo\%res et ea rebum. Stet clita kasd gubergren no sea.
+\#
+.SUBHEAD "Schoenberg\(em" "The Origins of Serial Pitch Organization"
+\#
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
+sed diam voluptua. At vero eos et accusam et justo duo do\%lo\%res et ea
+rebum. Stet clita kasd gubergren, no sea takimata sanctus est lorem.
+Ipsum dolor sit amet consetetur sadipscing. Elitr, sed diam nonumy,
+eirmod tempor invidunt ut labore et do\%lo\%re magna. Ali\%quyam erat sed
+diam voluptua, at vero eos. Et accusam et justo duo do\%lo\%res et ea
+rebum stet clita kasd gubergren lorem ipsum. Dolor sit amet
+consetetur, sadipscing elitr, sed diam. Nonumy eirmod tempor invidunt
+ut labore et do\%lo\%re. Magna ali\%quyam erat sed diam voluptua at vero.
+Eos et accusam et justo duo do\%lo\%res et ea rebum stet clita kasd.
+Gubergren no sea takimata sanctus est.
+.PP
+Amet consetetur sadipscing elitr sed diam nonumy eirmod. Tempor
+invidunt ut labore. Et dolor\%e magna ali\%quyam erat, sed diam voluptua,
+at vero. Eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita
+kasd gubergren.
+.PP
+No sea takimata\c
+.FOOTNOTE
+Takimata sadipscing elitr, sed diam nonumy eirmod tempor invidunt
+ut labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua.
+.FOOTNOTE OFF
+ sanctus est lorem. Ipsum dolor sit amet, consetetur
+sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
+et do\%lo\%re magna ali\%quyam erat, sed diam voluptua. At vero eos et
+accusam et justo duo do\%lo\%res et ea rebum amet. Consetetur sadipscing
+elitr sed diam nonumy eirmod tempor invidunt ut labore, et do\%lo\%re
+magna ali\%quyam erat. Sed diam voluptua, at vero, eos et accusam et
+justo duo do\%lo\%res et ea rebum.
+\#
+.SUBHEAD "Messiaen to Stockhausen\(em" "The Quest for Absolute Control"
+\#
+.PP
+Vero eos et accusam et justo duo do\%lo\%res et ea rebum amet:
+.QUOTE
+Eirmod tempor invidunt
+Ut labore et do\%lo\%re magna ali\%quyam erat
+Sed diam voluptua
+At vero eos et accusam et justo duo do\%lo\%res.
+.QUOTE OFF
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr
+sed diam. Nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna.
+Aliquyam erat, sed diam voluptua at vero eos et accusam. Et
+justo duo do\%lo\%res et ea rebum stet.
+.PP
+Elitr sed diam nonumy eirmod tempor. Invidunt ut labore et do\%lo\%re
+magna ali\%quyam erat sed. Diam voluptua at vero eos et accusam et
+justo duo do\%lo\%res et ea rebum.
+\#
+.BLOCKQUOTE
+Sanctus est lorem ipsum dolor sit amet, consetetur sadipscing. Elitr,
+sed diam nonumy eirmod tempor, invidunt ut labore et do\%lo\%re magna
+ali\%quyam. Erat sed diam voluptua, at vero eos et accusam et justo
+rebum amet. Consetetur sadipsc\%ing elitr sed diam nonumy eirmod
+sed diam nonumy, eirmod tempor. Invidunt tempor invidunt ut labore.\c
+.FOOTNOTE
+Labore diam nonumy eirmod tempor, invidunt ut labore et do\%lo\%re
+magna ali\%quyam. Erat sed diam voluptua, at vero eos et accusam et
+justo.
+.FOOTNOTE OFF
+ Et do\%lo\%re et magna ali\%quyam erat, sed diam voluptua, at vero.
+Eos et accusam et justo duo.
+.BLOCKQUOTE OFF
+\#
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna.
+.PP
+Nonumy eirmod tempor invidunt, ut labore et do\%lo\%re magna ali\%quyam
+erat? At vero eos et accusam et justo duo do\%lo\%res et ea. Rebum stet
+clita kasd gubergren no sea takimata sanctus. Est lorem ipsum dolor
+sit amet. Sadipscing elitr sed diam nonumy eirmod tempor invidunt.
+Ut labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua.
+At vero eos et accusam et justo duo do\%lo\%res et ea rebum.
+Stet clita kasd gubergren no sea. Ali\%quyam erat, sed diam voluptua.
+\#
+.SUBHEAD "John Cage\(em" "Leaving It All to Chance"
+\#
+.PP
+Sit amet, consetetur sadipscing elitr, sed diam nonumy. Eirmod tempor
+invidunt ut labore et do\%lo\%re magna. Ali\%quyam erat, sed diam
+voluptua at vero. Eos et accusam et justo duo dolores et ea rebum.
+Stet clita kasd gubergren, no sea taki\%mata sanctus est.
+.PP
+Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
+ut labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua. At vero
+eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita kasd
+gubergren, no sea takimata sanctus est lorem. Ipsum dolor sit amet,
+consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
+ut labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua. At vero
+eos et accusam et justo duo do\%lo\%res et ea rebum.
+.PP
+Stet clita kasd gubergren. No sea takimata sanctus est lorem ipsum
+dolor sit. Amet consetetur sadipscing elitr, sed diam nonumy eirmod
+tempor. Invidunt ut labore et do\%lo\%re magna ali\%quyam erat, sed diam
+voluptua, at vero. Eos et accusam et justo duo do\%lo\%res et ea rebum.
+Stet clita kasd gubergren, no sea takimata. Sanctus est lorem ipsum
+dolor sit amet consetetur. Sadipscing elitr sed diam nonumy eirmod
+tempor invidunt. Ut labore et do\%lo\%re magna ali\%quyam erat, sed diam
+voluptua. At vero eos et accusam et justo duo do\%lo\%res et ea rebum.
+\#
+.BLOCKQUOTE
+.PP
+Stet clita kasd gubergren no sea. Takimata sanctus est lorem ipsum
+dolor sit amet. Consetetur sadipscing elitr sed diam nonumy eirmod
+tempor invidunt ut labore et do\%lo\%re. Magna ali\%quyam\c
+.FOOTNOTE
+Aliquyam nonumy eirmod tempor invidunt ut labore.
+.FOOTNOTE OFF
+ erat, sed diam
+voluptua at vero eos et accusam. Et justo duo do\%lo\%res et ea rebum,
+stet clita kasd gubergren, no sea takimata.
+.PP
+Sanctus est lorem ipsum. Dolor sit amet consetetur sadipscing
+elitr. Sed diam nonumy eirmod tempor invidunt ut labore. Et
+do\%lo\%re magna ali\%quyam erat, sed diam voluptua. At vero eos et
+accusam et justo duo. Dolores et ea rebum stet clita kasd gubergren
+no sea.
+.PP
+Takimata lorem ipsum dolor sit amet consetetur sadipscing elitr.
+Sed diam, nonumy eirmod tempor, invidunt ut labore et do\%lo\%re magna.
+Aliquyam erat sed diam voluptua. At vero eos et accusam et
+justo.\c
+.FOOTNOTE
+Justo vero eos et accusam et justo duo.
+.FOOTNOTE OFF
+.BLOCKQUOTE OFF
+\#
+.PP
+Duo do\%lo\%res et ea rebum, stet clita kasd gubergren, no sea takimata
+sanctus. Est lorem ipsum. Dolor sit amet, consetetur sadipscing elitr,
+sed diam nonumy. Eirmod tempor invidunt ut labore et do\%lo\%re magna
+ali\%quyam erat, sed diam voluptua. At vero eos et accusam.
+.PP
+Et justo duo do\%lo\%res et ea rebum stet clita kasd. Gubergren
+no sea takimata sanctus est. Lorem ipsum dolor sit amet, consetetur
+sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore
+et dolore magna ali\%quyam erat, sed diam voluptua. At vero eos et
+accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
+no sea takimata sanctus est.
+\#
+.SUBHEAD "Beyond Cage\(em" "Catching the Midnight Train"
+\#
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Sed diam
+nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna. Ali\%quyam
+erat, sed diam voluptua.
+.PP
+At vero eos et accusam et justo duo do\%lo\%res et ea rebum. Stet clita
+kasd gubergren no sea takimata. Sanctus est, lorem ipsum dolor sit
+amet. Consetetur sadipscing elitr, sed diam nonumy. Eirmod tempor
+invidunt ut labore et do\%lo\%re magna ali\%quyam erat. Sed diam voluptua
+at vero eos et accusam et justo.
+.PP
+Duo do\%lo\%res et ea rebum, stet clita kasd gubergren. No sea takimata
+sanctus est lorem ipsum dolor sit amet, consetetur sadipscing elitr.
+Sed diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
+ali\%quyam. Erat sed diam voluptua at. Vero eos et accusam et justo
+duo do\%lo\%res et ea rebum stet. Clita kasd gubergren no sea takimata
+sanctus est.
+.PP
+Nonumy eirmod tempor invidunt, ut labore et do\%lo\%re magna ali\%quyam
+erat? At vero eos et accusam et justo duo do\%lo\%res et ea. Rebum stet
+clita kasd gubergren no sea takimata sanctus. Est lorem ipsum dolor
+sit amet. Sadipscing\c
+.FOOTNOTE
+Sadipscing diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
+ali\%quyam erat, sed diam voluptua.
+.FOOTNOTE OFF
+ elitr sed diam nonumy eirmod tempor invidunt. Ut labore et do\%lo\%re
+magna ali\%quyam erat, sed diam voluptua. At vero eos et accusam et
+justo duo do\%lo\%res et ea rebum. Stet clita kasd gubergren no sea
+takimata lorem. Ipsum dolor sit amet, consetetur sadipscing elitr.
+Sed diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna.
+Ali\%quyam erat, sed diam voluptua. At vero eos et accusam et justo
+duo do\%lo\%res et ea rebum. Stet clita kasd gubergren, no sea
+takimata sanctus est.
+.PP
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
+diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
+ali\%quyam erat, sed diam voluptua. At vero eos et accusam et justo
+duo do\%lo\%res et ea rebum. Stet clita kasd gubergren, no sea
+takimata sanctus est.
+.RIGHT
+\*[BD]\&...end of sample article\*[PREV]
+.FINIS
diff --git a/contrib/groff/contrib/mom/examples/typesetting.mom b/contrib/groff/contrib/mom/examples/typesetting.mom
new file mode 100644
index 000000000000..cd16dc380dae
--- /dev/null
+++ b/contrib/groff/contrib/mom/examples/typesetting.mom
@@ -0,0 +1,673 @@
+\# Most mom users rely on mom's document processing macros to format
+\# their work. The doc processing macros take care of all things
+\# typographic and are simple, clear and easy to learn. The kind of
+\# "by hand" typesetting this file shows off is really geared toward
+\# professional typographers. Bear in mind, though, that the full
+\# power of mom's typesetting capabilities can be brought to bear
+\# on document processing as well.
+\#
+\# Basic page setup
+\#
+.PAGE 8.5i 11i \" Printer sheet size
+.L_MARGIN 1i \" Left margin 1 inch
+.R_MARGIN 1i \" Right margin 1 inch (calculates the line length)
+\#
+\# Basic type parameters
+\#
+.FAMILY T \" Times Roman family
+.FT B \" Bold font
+.PT_SIZE 12 \" Point size
+.LS 14 \" Leading (line spacing)
+.LEFT \" Set lines flush left, nofill mode
+\#
+\# Refinements
+\#
+.HY \" Hyphenate
+.KERN \" Automatic pairwise kerning
+.LIGATURES \" Automatic ligature generation
+.SMARTQUOTES \" Enable smartquotes
+.SS 0 \" No extra space between sentences
+\#
+.ALD 1i-1v \" Advance 1 inch from top of paper to first baseline
+Example 1\*[BU 2]:
+.ALD .25v \" Advance an extra 1/4 linespace
+.UNDERSCORE 3.75p "T\*[BU 4]asting notes using padding, string tabs \
+and multi-columns"
+\#
+.SP \" Add an extra line space
+\#
+.FAM H \" Helvetica family
+.PT_SIZE 10
+.LS 11 \" New leading
+\#
+\# The following uses a combination of padding, string tabs, and the
+\# FWD escape to set up five tabs with 1-pica gutters stretched over
+\# the full line length.
+\#
+.SILENT \" Don't print the next line
+.PAD "\*[ST1]VIN#\*[ST1X]\*[FWD 1P]\*[ST2]ROBE#\*[ST2X]\*[FWD 1P]\*[ST3]NEZ#\*[ST3X]\*[FWD 1P]\*[ST4]BOUCHE#\*[ST4X]\*[FWD 1P]\*[ST5]COMMENTAIRES\*[ST5X]"
+.SILENT OFF \" Resume normal printing of text
+\#
+\# Now that the string tabs have been marked off, we "set" them.
+\#
+.ST 1 L \" First string tab flush left, nofill mode (no need for .BR's between input lines)
+.ST 2 L QUAD \" Remaining tabs are flush left/rag right, fill mode
+.ST 3 L QUAD
+.ST 4 L QUAD
+.ST 5 L QUAD
+\#
+.TAB 1 \" Call first tab
+.UNDERSCORE "VIN"
+.TN \" Move to next tab and stay on the same baseline
+.UNDERSCORE "ROBE"
+.TN \" Ibid
+.UNDERSCORE "NEZ"
+.TN \" Ibid
+.UNDERSCORE "BOUCHE"
+.TN \" Ibid
+.UNDERSCORE "COMMENTAIRES"
+.TQ \" Quit tabs
+\#
+.ALD 6p \" Advance an extra 6 points
+.FT R \" Change font to roman (medium)
+.MCO \" Turn multi-column mode on
+\#
+.TAB 1 \" Notice that this tab gets set line-for-line
+\*[IT]Peelee Island \" Set italic
+\*[PREV]Gewürztraminer \" Revert to former font (roman)
+2000
+(Canada)
+.MCR \" Return to top of column
+.TAB 2 \" Call tab 2; in multi-column mode, don't use .TN
+Jaune pâle.
+.MCR
+.TB 3 \" Notice that from here on, we use the alias TB instead of TAB
+Frais, fruité, ci\%tronné, arômes fortes de lichee et de fruits
+tropicaux.
+.MCR
+.TB 4
+Doux, fruité, bien équilibré avec une bonne acidité.
+.MCR
+.TB 5
+Bon apéro. Servir avec des plats
+.RW .1 \" Reduce Whitespace between letters to tighten this line
+indiens ou \%chinois.
+.RW 0 \" Back to normal spacing between letters
+.BR
+Excellent rapport qualité/prix.
+.MCX 8p \" Multi-column mode off; advance an extra 8 points
+.MCO \" Re-invoke multi-columns for next wine description
+.TB 1
+\*[IT]Carau Pujol
+\*[ROM]Tannat
+1995
+(Uraguay)
+.MCR
+.TB 2
+Rubis foncé, vio\%lacée, presque opaque.
+.MCR
+.TB 3
+Belles arômes de fruits foncés (prunes, cerises noires, cassis).
+Odeurs tertiares de cuir, cèdre, violets, eucalyptus, avec une trace
+exotique de Band-Aid*\*[BU 12].
+\#
+\# The \*[BU 12], above, pulls the period back so that it falls
+\# underneath the asterisk. \*[BP<n>] could have been used instead
+\# if you prefer to use points rather than kern units.
+\#
+.MCR
+.TB 4
+Très rond, tannins mûres et veloutés, avec un long finis fruité et
+doucement alcoolique.
+.MCR
+.TB 5
+Superbe\|! Une aubaine à ne pas manquer. Prêt à boire maintenant.
+.MCX 1v \" Multi-columns off; advance an extra linespace
+\#
+\# Now, an example of a hanging indent. This is excessively fussy
+\# from a typographic standpoint in that it hangs the asterisk outside
+\# the current left margin so that the text following it lines up with
+\# with the text in the tasting notes. Notice that in order to use a
+\# hanging indent, you must first set a left indent.
+\#
+.FT I \" Change font to italic
+.PT_SIZE -.5 \" Reduce point size by 1/2 point
+.LS -.5 \" Reduce leading by 1/2 point
+.JUSTIFY \" Set text justified
+\#
+\# Now, move the left margin back by the width of an asterisk plus 2 points...
+\#
+.L_MARGIN -(\w'*'+2p)
+\#
+\# ...and set a left indent equal to the width of an asterisk plus 2 points
+\#
+.IL \w'*'+2p
+\#
+\# Now, set the hanging indent equal to the left indent, effectively pulling
+\# the first line of the following text back to the new left margin.
+\# Subsequent output lines will be indented by the .IL amount.
+\# Notice that when using the \w inline escape, there's no need to append
+\# a unit of measure to it.
+\#
+.HI \w'*'+2p
+*\*[FWD 1p]The term "Band-Aid" means the slightly sweet, vaguely chemical
+smell associated with medical-grade plastics. It is often found in
+wines from terroirs in South America. Provided a wine has a sufficient
+concentration of fruit
+.RW .04 \" Kern the whole next line slightly, so "lipstick" doesn't hyphenate.
+aromas and complex tertiary characteristics, Band-Aid is a Good Thing.
+Otherwise, it smells like cheap lipstick.
+.RW 0 \" Reset kerning to 0
+\#
+\# Notice, above, that although the values for IL and HI are the width
+\# of an asterisk plus 2 points, when setting the first line of text
+\# (the one with the asterisk at the beginning), we put only 1 point of
+\# space after the *. This is to compensate for the fact that in the
+\# italic font, the letter T doesn't align visually with the rest of
+\# the text. As already noted, this is an extremely fussy example. :)
+\#
+.IQ CLEAR \" Cancel and clear stored indent values
+.L_MARGIN 1i \" Reset left margin to its original value.
+\#
+.ALD 2P \" Add 2-picas extra space before next example
+\#
+.FAM T
+.FT B
+.PT_SIZE 12
+.LS 14
+\#
+Example 2:
+.ALD .25v
+\#
+.COMMENT \" COMMENT lets you enter comments without using \# or \"
+In the next line, because the string to be underscored must be
+enclosed in double-quotes, you can't use the double-quote character
+itself around the word "Massaging". We circumvent this by using the
+groff inline escapes \(lq and \(rq (leftquote and rightquote).
+.COMMENT OFF \" Remember to turn COMMENT off!
+\#
+.UNDERSCORE 3.75p "\(lqMassaging\(rq \*[BCK 1p]a passage of rag right text"
+.SP \" Add an extra linespace
+\#
+.PT_SIZE 12.5
+.LS 14
+.PT_SIZE -1 \" Reduce point size by 1 point
+Passage using groff spacing defaults
+\#
+.ALD .5v \" Add an extra 1/2 line space
+\#
+.PT_SIZE +1 \" Restore point size
+.QUAD LEFT \" Set quad left, fill mode
+.IB 3P \" Indent 3 picas from both the left and right margins
+.FT R
+The thousand injuries of Fortunato I had borne as I best could;
+but when he ventured upon insult, I vowed revenge. You, who so well
+know the nature of my soul, will not suppose, however, that I gave
+utterance to a threat. \*[IT]At length\*[PREV] I would be
+avenged; this was a point definitively settled\(embut the very
+definitiveness with which it was resolved, precluded the idea of
+risk. I must not only punish, but punish with impunity. A
+wrong is unredressed when retribution overtakes its redresser.
+It is equally unredressed when the avenger fails to make himself
+felt as such to him who has done the wrong.
+.ALD 6p
+\#
+\# The next line is set quad right, nofill mode, 1/2 point smaller
+\# than the preceding text (using the \*[SIZE <n>] inline escape.
+\#
+.RIGHT
+\*[SIZE -.5]\(emEdgar Allen Poe, \*[IT]The Cask of Amontillado\*[PREV]\*[SIZE +.5]
+.SP \" Extra linespace
+.IBQ \" Disable "indent both"
+\#
+\# The passage above, while acceptable in a longer document, exhibits a
+\# few typographic flaws. The shape of the right margin rag exhibits
+\# a decidedly "rounded" appearance. The word "I" stands alone at the
+\# end of the third line. The space between the 1st and 2nd sentences
+\# ("...revenge. You...") is too large, owing to the letter "Y" that
+\# begins the 2nd sentence. The spacing between "A wrong..." (line 6)
+\# is equally too large because of the way "A" and "w" fit together.
+\# The em-dash before Edgar isn't vertically centered with the letter "E".
+\# And so on. The most important correction below is fixing the rag
+\# so that longer and shorter lines alternate. This is accomplished by
+\# manually breaking lines and then slightly lengthening and shortening
+\# them until a pleasing rag is achieved. The remainder of the little
+\# flaws are fixed with inline escapes.
+\#
+.FT B
+.PT_SIZE -1
+.LEFT
+The same passage, \*[BU 4]"massaged"
+\#
+.ALD .5v
+\#
+.FT R
+.PT_SIZE +1
+.QUAD LEFT
+.HY OFF \" Turn automatic hyphenation off
+.BR_AT_LINE_KERN \" Automatically insert a line break (.BR) with each invocation of .RW and .EW
+.WS +1 \" Increase word space slightly
+.IB \" Turn "indent both" back on; values are the same as before
+\#
+The thousand injuries of Fortunato I had borne as I best could; but
+when he ventured upon insult, I \*[BU 2]vowed revenge. \*[BU 4]Y\*[BU 6]ou,
+\*[BU 4]who so \*[BU 2]well know the nature
+.EW .2
+of my soul, \*[BU 2]will not suppose, however, that I gave utterance to
+a threat. \*[IT]At
+.EW .2
+length\*[PREV] I would be avenged; this was a point definitively
+settled\(embut the
+.EW .2
+v\*[BU 1]ery definitiveness with which it was resolved, precluded the idea
+of risk.
+.EW 0
+I must not only punish, but punish with impunity. A \*[BCK 1p]wrong is
+unredressed
+.EW .1
+when retribution overtakes its redresser. It is equally unredressed
+when the
+.RW .1
+avenger fails to make himself felt as such to him \*[BU 2]who has done
+the wrong.
+.RW 0 \" Restore normal kerning
+.WS +0 \" Restore normal wordspacing
+.ALD 6p
+.PT_SIZE -.5
+.RIGHT
+\*[UP 1.5p]\(em\*[DOWN 1.5p]\*[BCK 1p]Edgar \*[BCK 1p]Allen Poe, \*[IT]The Cask of Amontillado\*[PREV]
+.IQ CLEAR \" Cancel and clear stored values of all indents
+\#
+\#
+.NEWPAGE \" Start a new page
+.T_MARGIN 1i \" Set top margin to 1i (approx. equivalent to .ALD 1i-1v above)
+\#
+.FAM T
+.FT B
+.PT_SIZE 12
+.LS 14
+.LEFT
+\#
+Example 3:
+.ALD .25v
+.UNDERSCORE 3.75p "A \*[BU 2]recipe for enumerated lists using indents"
+.SP .5v \" Add an extra half line space
+.FAM N \" New Century Schoolbook family
+.FT R
+.PT_SIZE 11
+.LS 13
+.HY \" Turn hyphenation back on
+.JUSTIFY \" Justify text
+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
+.IL \w'\0.\0' \" Establish a left indent equal to the width of 2 figure spaces plus a period.
+.HI \w'\0.\0' \" Establish a hanging indent equal to the size of the left indent.
+.ALD 6p
+\#
+\#
+1.\0This is the first item in the list. N\*[BU 2]otice how the first line
+"hangs" back from the remaining text, which is otherwise
+indented by the width of by two figure-spaces (digit-width
+spaces) and a period.
+.BR
+.HI \" Notice that HI doesn't require an argument once the value's been set
+.ALD 6p
+2.\0This is the second item in the list. As with the above item,
+notice the use of the \*[BU 8]\\0 escape sequence in the input text. It's
+there to ensure that the space after the number/period combination
+always remains the same (i.e. doesn't stretch when the line is
+justified). That way, the text of each item always lines up perfectly.
+\#
+.COMMENT
+Now we're going to set a bullet-point list, indented from the text
+above by 1 pica. IL arguments are always added to whatever value
+is in already effect for IL, hence all we have to do is tell mom to
+indent (from the current left indent) 1 pica plus the width of the
+bullet character ( \(bu ). \*[FWD 3p] puts three points of space after
+the bullet so that the bullet and the text are visually separated.
+.COMMENT OFF
+\#
+\#
+.IL 1P+\w'\(bu\*[FWD 3p]'
+\#
+\# Hanging indents are always relative to the current left indent.
+\# The additional 1-pica indent, above, already having been taken
+\# care of, we only want to hang the first lines of bullet list items
+\# back by the width of the bullet character plus its 3 extra
+\# points of space.
+\#
+.ALD 6p
+.HI \w'\(bu\*[FWD 3p]'
+\*[DOWN 1p]\(bu\*[UP 1p]\*[FWD 3p]This is the first line of a sublist with bullets.
+N\*[BU 2]otice how the first line (the one with the bullet) is indented
+exactly one pica from the text of the list item above it, while the
+remaining lines align with the left indent we set above.
+.ALD 6p
+.HI
+\*[DOWN 1p]\(bu\*[UP 1p]\*[FWD 3p]This is the second item of the sublist with bullets. \*[BU 4]We
+could go on indefinitely, but let's go back to the top level (numbered)
+list...
+\#
+\# The easiest way to return to a previous indent value is by subtraction.
+\# The argument to IL, above, was 1P+\w'\(bu\*[FWD 3p]', so we just reverse
+\# it by putting a minus sign in front. The parentheses are required
+\# for groff to evaluate the expression properly.
+\#
+.IL -(1P+\w'\(bu\*[FWD 3p]')
+.HI \w'\0.\0' \" Reset hanging indent for use with numbered items.
+.ALD 6p
+3.\0...and here we are.
+.HI \" Again, notice that once HI has been set, you don't have to keep passing it an argument.
+.ALD 6p
+4.\0In order not to make the example too long, we'll stop here.
+.IQ CLEAR \" Don't forget to cancel and/or clear indents!
+\#
+.FAM T
+.FT B
+.PT_SIZE 12
+.LS 14
+.LEFT
+.SP
+\#
+Example 4:
+.ALD .25v
+.UNDERSCORE 3.75p "A \*[BU 2]recipe for nested lists using string tabs"
+.SP .5v
+.FAM N
+.FT R
+.PT_SIZE 11
+.LS 13
+.JUSTIFY
+Although setting up string tabs is a bit more complex than setting
+up indents, it's \*[BU 3]well worth the effort, especially for nested lists.
+.ALD 6p
+\#
+.COMMENT
+The PAD line, below, sets up two string tabs. The first (ST1)
+is exactly the length of two figure spaces and a period. The
+second (ST2) is simply "the remainder of the line."
+.COMMENT OFF
+\#
+.SILENT \" Don't print any of this
+.PAD "\*[ST1]\0.\0\*[ST1X]\*[ST2]#\*[ST2X]"
+.ST 1 L \" String tabs must be "set" after being marked off in a line
+.ST 2 J \" ST 1 will be set flush left, nofill; ST 2 will be justified.
+.SILENT OFF \" Restore printing
+\#
+.TB 1
+1.
+.TN \" Use .TN here so text stays on the same baseline as the number in tab 1
+This is the first item in the list. N\*[BU 2]otice how, just as in Example 3,
+the first line hangs back from the remaining text, which is otherwise
+indented.
+.ALD 6p
+.TB 1
+2.
+.TN
+This is the second item in the list. N\*[BU 2]otice that when setting "lists"
+with tabs, there's no need to use the \*[BU 8]\\0 escape sequence after
+the number/period combination in the input text.
+.ALD 6p
+\#
+.COMMENT
+Now, set up the indented bullet-point sublist. The PAD line
+says: move forward 12 points (1 pica), then mark off a string
+tab (ST3) that's the length of the bullet character; move foward
+another three points, then make the next string tab (ST4) the
+length of remainder of the line.
+.COMMENT OFF
+\#
+.SILENT
+.PAD "\*[FWD 12p]\*[ST3]\(bu\*[ST3X]\*[FWD 3p]\*[ST4]#\*[ST4X]"
+.ST 3 L
+.ST 4 J
+.SILENT OFF
+.ALD 6p
+.TB 3
+\*[DOWN 1p]\(bu\*[UP 1p]
+.TN
+This is the first line of a sublist with bullets. N\*[BU 2]otice how the
+bullets and the text line up exactly the same as in Example 3.
+.ALD 6p
+.TB 3
+\*[DOWN 1p]\(bu\*[UP 1p]
+.TN
+This is the second item of the sublist with bullets. For the fun of
+it, lets add in an
+.SPREAD
+en-dashed sub-sublist.
+.BR \" We're in a fill mode right now, so you *must* terminate the line with BR
+\#
+.SILENT
+.PAD "\*[FWD 12p]\*[ST5]\(en\*[ST5X]\*[FWD 4p]\*[ST6]#\*[ST6X]"
+.ST 5 L
+.ST 6 J
+.SILENT OFF
+.ALD 6p
+.TB 5
+\*[UP .75p]\(en\*[DOWN .75p]
+.TN
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
+nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
+sed diam voluptua.
+.ALD 6p
+.TB 5
+\*[UP .75p]\(en\*[DOWN .75p]
+.TN
+At \*[BU 3]vero eos et accusam et justo duo dolores et ea rebum. Stet clita
+kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet.
+.ALD 6p
+.TB 1
+3.
+.TN
+And here we are, back at the top-level numbered list with a minimum
+of muss and fuss,
+.ALD 6p
+.TB 1
+4.
+.TN
+Generally speaking, once you get the hang of string tabs and the
+\*[BD]PAD\*[PREV] macro, you'll find setting up complex nested lists
+(or anything similar to them) easier than with hanging indents.
+.TQ
+\#
+.NEWPAGE
+.FAM T
+.FT B
+.PT_SIZE 12
+.LS 14
+.LEFT
+\#
+Example 5:
+.ALD .25v
+.UNDERSCORE 3.75p "Word spacing"
+.ALD 8p
+.FAM P \" Palatino family
+.PT_SIZE 11
+.LS 14
+\#
+\# The "label" lines for the following are set in Helvetica bold, one
+\# point smaller than the examples themselves. This demonstrates the
+\# use of the groff inline escape \f[...] to change both family and
+\# font inline. It also shows using the mom inline \*S[...], which is
+\# an alternate form of the inline, \*[SIZE <n>]
+\#
+\f[HB]\*S[-1]Normal word spacing\*S[+1]\*[PREV]
+.FT R
+N\*[BU 1]o\*[BU 1]w \*[BU 1]is the time for all good men to come to the aid of the party.
+.ALD 4p
+\f[HB]\*S[-1]Word spacing adjusted by \*[UP 1p]\*[BU 3]+\*[DOWN 1p]\*[BU 1]2\*S[+1]\*[PREV]
+.FT R
+.WS +2
+N\*[BU 1]o\*[BU 1]w \*[BU 1]is the time for all good men to come to the aid of the party.
+.WS +0
+.ALD 4p
+\f[HB]\*S[-1]Word spacing adjusted by \*[UP 1p]\*[BU 3]+\*[DOWN 1p]4\*S[+1]\*[PREV]
+.FT R
+.WS +4
+N\*[BU 1]o\*[BU 1]w \*[BU 1]is the time for all good men to come to the aid of the party.
+.WS +0
+.ALD 4p
+\f[HB]\*S[-1]Word spacing adjusted by \*[UP 1p]\*[BU 3]+\*[DOWN 1p]6\*S[+1]\*[PREV]
+.FT R
+.WS +6
+N\*[BU 1]o\*[BU 1]w \*[BU 1]is the time for all good men to come to the aid of the party.
+.WS +0
+.SP 1.5v
+\#
+.FAM T
+.FT B
+.PT_SIZE 12
+.LS 14
+\#
+.LEFT
+Example 6:
+.ALD .25v
+.UNDERSCORE 3.75p "Line kerning"
+.ALD 8p
+.FAM P \" Palatino family
+.FT R
+.PT_SIZE 11
+.LS 15
+\#
+\# Here, we set up some tabs so the examples can go into facing columns.
+\#
+.TAB_SET 1 0 19.5P L
+.TAB_SET 2 19.5P 19.5P L
+\#
+.MCO \" Turn multi-columns on
+.TB 1
+\f[HB]\*S[-1]Unkerned line\*S[+1]\*[PREV]
+.FT R
+"But this is \*[IT]important!\/"\*[PREV]she exclaimed.
+.ALD 4p
+\f[HB]\*S[-1]Line "tightened" \(en .RW .1\*S[+1]\*[PREV]
+.RW .1
+"But this is \*[IT]important!\/"\*[PREV]she exclaimed.
+.ALD 4p
+\#
+\# In the next line, notice that because it uses a different family
+\# (Helvetica instead of Palatino), the RW macro doesn't affect it.
+\#
+\f[HB]\*S[-1]Line "tightened" \(en .RW .2\*S[+1]\*[PREV]
+.RW .2
+"But this is \*[IT]important!\/"\*[PREV]she exclaimed.
+.ALD 4p
+\f[HB]\*S[-1]Line "tightened" \(en .RW .3\*S[+1]\*[PREV]
+.RW .3
+"But this is \*[IT]important!\/"\*[PREV]she exclaimed.
+.MCR
+.TB 2
+\f[HB]\*S[-1]Unkerned line\*S[+1]\*[PREV]
+"But this is \*[IT]important!\/"\*[PREV]she exclaimed.
+.ALD 4p
+\f[HB]\*S[-1]Line "loosened" \(en .EW .1\*S[+1]\*[PREV]
+.EW .1
+"But this is \*[IT]important!\/"\*[PREV]she exclaimed.
+.ALD 4p
+\f[HB]\*S[-1]Line "loosened" \(en .EW .2\*S[+1]\*[PREV]
+.EW .2
+"But this is \*[IT]important!\/"\*[PREV]she exclaimed.
+.ALD 4p
+\f[HB]\*S[-1]Line "loosened" \(en .EW .3\*S[+1]\*[PREV]
+.EW .3
+"But this is \*[IT]important!\/"\*[PREV]she exclaimed.
+.MCX 1.5v
+\#
+.FAM T
+.FT B
+.PT_SIZE 12
+.LS 14
+.LEFT
+\#
+Example 7:
+.ALD .25v
+.UNDERSCORE 3.75p "Cutaround using left\*[FU 2]/right indents, multi columns \
+and a dropcap"
+.SP
+\#
+.FT R
+.PT_SIZE 11
+.LS 12
+.BR_AT_LINE_KERN OFF \" In justified text, it's best to have this OFF
+\#
+.TAB_SET 1 0 18.5P J
+.TAB_SET 2 20.5P 18.5P J
+.MCO
+.ALD 5P+9p
+\#
+\# The little picture of tux.
+\#
+.PSPIC penguin.ps
+.MCR
+.TAB 1
+.XCOLOR red \" Initialize the X11 color, red
+.DROPCAP_COLOR red
+.DROPCAP_FONT B
+.DROPCAP L 3 COND 80 \" i.e. the letter L dropped 3 lines, condensed to 80% of its normal width
+.EW .2
+orem ipsum dolor sit amet, consetetur sa\%dip\%scing elitr, sed diam
+nonumy eir\%mod tempor invidunt ut labore et dolore magna aliquyam erat,
+sed diam voluptua.
+.EW 0
+.TI 1P
+At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
+kasd gubergren, no sea taki-
+.SPREAD \" Force justify preceding line before starting indent
+.IR 3.5P
+kimata sanctus est lorem ipsum dolor sit amet.
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
+nonumy eirmod tempor.
+.EW .2
+.TI
+Invidunt ut labore et dolore magna ali\%qu\%yam erat, sed diam voluptua.
+At
+.EW 0
+vero eos et accusam et justo duo dolores et ea rebum.
+.TI
+Stet clita kasd gubergren, no sea ta-
+.SPREAD \" Force justify preceding line before quitting indent
+.IRQ
+kimata sanctus est lorem ipsum dolor sit amet. Lorem ipsum dolor
+sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
+in\%vi\%dunt ut labore et dolore magna aliquyam erat. Sed diam voluptua,
+at vero eos et accusam et justo duo
+.SPREAD
+.EW .3
+dolores et ea rebum. Stet clita no kasd guber-
+.SPREAD
+.MCR
+.TB 2
+gren, no sea takimata sanctus est lorem ipsum
+.EW 0
+dolor sit amet. Consetetur sadipscing elitr, sed diam nonumy eirmod
+tempor invidunt ut labore et dolore.
+.TI
+Magna aliquyam erat, sed diam voluptua, at vero eos et accusam.
+Et justo duo dolores et ea
+.SPREAD
+.IL 3.5P
+rebum, stet clita kasd gubergren. No sea
+takimata sanctus est, lorem ipsum dolor sit amet.
+.TI
+Sit amet, consetetur sadipscing elitr, sed diam. Nonumy eirmod tempor
+in\%vi-
+.EW .3
+dunt ut labore et dolore magna. Ali-
+.EW 0
+quyam erat sed diam voluptua.
+At vero eos et accusam et justo duo dolores et ea rebum stet.
+.ILQ
+.TI
+Dolores et ea rebum stet clita kasd gubergren, no sea takimata
+sanctus. Sadipscing elitr sed diam, nonumy eirmod tempor, invidunt
+ut labore et dolore magna aliquyam erat. Sed diam voluptua, at vero
+eos et accusam et justo duo dolores et ea rebum.
diff --git a/contrib/groff/contrib/mom/groff_mom.man b/contrib/groff/contrib/mom/groff_mom.man
index dea6a91d147e..b82fcad71898 100644
--- a/contrib/groff/contrib/mom/groff_mom.man
+++ b/contrib/groff/contrib/mom/groff_mom.man
@@ -1,7 +1,7 @@
.ig
This file is part of groff, the GNU roff type-setting system.
-Copyright (C) 2002 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
written by Werner Lemberg <wl@gnu.org>
Permission is granted to copy, distribute and/or modify this document
@@ -14,6 +14,9 @@ A copy of the Free Documentation License is included as a file called
FDL in the main directory of the groff source package.
..
.
+.do nr groff_mom_C \n[.C]
+.cp 0
+.
.mso www.tmac
.
.de TQ
@@ -85,10 +88,13 @@ mom comes with her own (very) complete documentation in HTML format.
.
.B mom
was written by
-.MTO df191@ncf.ca "Peter Schaffter" .
+.MTO peter@faustus.dyn.ca "Peter Schaffter" .
Please send bug reports to the
.MTO bug-groff@gnu.org "groff bug mailing list"
-or directly to the author.
+or directly to the author, either at the address above or to
+.MTO ptpi@golden.net "" .
+.
+.cp \n[groff_mom_C]
.
.\" Local Variables:
.\" mode: nroff
diff --git a/contrib/groff/contrib/mom/momdoc/appendices.html b/contrib/groff/contrib/mom/momdoc/appendices.html
index 64d3b8f54c37..6b5b63fcd610 100644
--- a/contrib/groff/contrib/mom/momdoc/appendices.html
+++ b/contrib/groff/contrib/mom/momdoc/appendices.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -7,8 +8,10 @@
<!====================================================================>
-<a href="typemacdoc.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="reserved.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="macrolist.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
+<p>
<a name="TOP"></a>
<a name="APPENDICES">
@@ -17,9 +20,13 @@
<ul>
<li><a href="#MOREDOC">Further notes on this documentation</a>
+ <li><a href="#FONTS">Adding PostScript fonts to groff</a>
+ <ul>
+ <li><a href="#HOWTO">How to create a PostScript font for use with groff</a>
+ </ul>
<li><a href="#CODENOTES">Some reflections on mom, with an apology</a>
- <li><a href="reserved.html">List of reserved words</a>
<li><a href="#CONTACT">Contact the author</a>
+ <li><a href="reserved.html">List of reserved words</a>
</ul>
<a name="MOREDOC">
@@ -58,30 +65,517 @@ basic (text only) html. I may have written <strong>mom</strong>,
but I still regularly call on her documentation. Elvis, with its
html capabilities, lets me write and format <strong>mom</strong>
documents AND peruse her documentation, clicking on links as
-necessary, without ever leaveing the comfy confines of my
+necessary, without ever leaving the comfy confines of my
text editor.
<p>
Not everyone, of course, uses an editor with html capabilities.
For them, firing up a browser is obviously necessary for reading
<strong>mom</strong>'s documentation. Browsers being what they are,
and not everyone on the globe having the cash for muscle machines
-to run Galeon, or Konqueror, or Mozilla, or Netscape, their browser
-needs to be one that's fast and light -- Lynx, in other words.
+to run Galeon, or Konqueror or Mozilla, their browser
+needs to be fast and light--and probably &quot;text-only&quot;.
<p>
Some <strong>mom</strong> users may notice the absence of graphics,
-frames, and (for the most part) tables in this documentation.
-The reason is simple: Lynx. People who, for whatever reason (choice
-or necessity), use Lynx to read the documentation must be able to make
-sense of it. All of it. Graphical examples of <strong>mom</strong>
-in action might have made some parts of the documenation easier to
-write, but would have excluded Lynx-only users. And it goes
-without saying that the documentation looks fine if you're
-reading it in a graphical browser.
+frames, and (for the most part) tables in this documentation. The
+reason is simple: text-only browsers. People who, for whatever
+reason (choice or necessity), use lynx, or links or w3m to read
+the documentation must be able to make sense of it. All of it.
+Graphical examples of <strong>mom</strong> in action might have made
+some parts of the documentation easier to write, but would have
+excluded text-only browser users. And it goes without saying that
+the documentation looks fine if you're reading it in a graphical
+browser.
<br>
<hr>
<!=====================================================================>
+<a name="FONTS">
+ <h2><u>Adding PostScript fonts to groff</u></h2>
+</a>
+
+<a name="SMALL_NOTE"></a>
+<em><strong>Small note:</strong> the term &lt;prefix&gt; in this
+section refers to the directory in which groff is installed,
+typically something like /usr/share/groff/&lt;version#&gt;
+(for distro-specific, pre-compiled groff packages) or
+/usr/local/share/groff/&lt;version#&gt; (if you've built groff
+from source).</em>
+<p>
+Groff comes with a small library of PostScript
+<a href="definitions.html#TERMS_FAMILY">families</a>
+(see the
+<a href="typesetting.html#FAMILY">FAMILY</a>
+macro for a list). The families have four
+<a href="definitions.html#TERMS_FONT">fonts</a>
+associated with them. These fonts are a combination of
+<a href="definitions.html#TERMS_WEIGHT">weight</a>
+and
+<a href="definitions.html#TERMS_SHAPE">shape</a>:
+<br>
+<ul>
+ <li><strong>R</strong> (Roman, usually Medium weight),
+ <li><strong>I</strong> (Italic, usually Medium weight),
+ <li><strong>B</strong> (Bold, usually Roman shape) and
+ <li><strong>BI</strong> (Bold Italic).
+</ul>
+<p>
+If you do a lot of document processing or typesetting with
+<strong>mom</strong>, you'll find, sooner or later, that these
+families and their associated fonts aren't sufficient. You'll want
+to supplement them, either with more fonts for the families already
+provided--"Damn! I need Helvetica Bold Condensed Italic!"--or with
+entire new families.
+<p>
+Without going into the gory details (yet), while it's true that
+adding fonts to groff is a relatively straightforward
+process, extending existing families or adding new ones requires
+some planning.
+<p>
+The traditional approach to extending groff families has been
+to create new families for non-default weights and
+shapes (e.g. Light, which is a weight; Condensed, which is a
+shape), then to associate them with groff's predefined <strong>R,
+I, B</strong> and <strong>BI</strong> font styles. An example
+of this can be seen in the groff PostScript font library itself
+(&lt;prefix&gt;/font/devps/): there's one &quot;family&quot; for
+Helvetica (HR, HI, HB, HBI) and another for Helvetica Narrow (HNR,
+HNI, HNB, HNBI).
+<p>
+The difficulty with this approach is that typographers
+tend to think of &quot;families&quot; as referring to the
+entire set of font weights and shapes associated with a
+particular family name. For example, when a typesetter says
+&quot;the Helvetica family&quot;, s/he is including the <a
+href="definitions.html#TERMS_WEIGHT">weights</a> Helvetica Thin,
+Helvetic Light, Helvetica Regular, Helvetica Bold, Helvetica Heavy,
+etc, and all their associated
+<a href="definitions.html#TERMS_SHAPE">shapes</a>
+(Roman,
+Italic, Condensed, Narrow, Extended, Outline, etc).
+<p>
+Thus, intuitively, when a typesetter gives <strong>mom</strong> a
+<kbd>.FAM(ILY)</kbd> directive, s/he reasonably expects that any
+subsequent <kbd>.FT</kbd> directive will access the desired font
+from the Helvetica family--without the need to state explicitly both
+family and font to <kbd>.FT</kbd>, as it is explained one can do in
+the
+<a href="typesetting.html#FAMILY">FAMILY</a>
+and
+<a href="typesetting.html#FONT">FT</a>
+sections of these documents.
+<p>
+If one had, say, the fonts, Helvetica Light Roman
+and Helvetica Light Italic as well as Helvetica Light Condensed
+Roman and Helvetica Light Condensed Italic, the traditional
+approach would require two &quot;partial&quot; families: HLR/HLI and
+HLCDR/HLCDI. Accessing these family/font combos
+routinely throughout a document would then require
+changing family (with <kbd>.FAM(ILY)</kbd>) and selecting the
+desired font (with <kbd>.FT R</kbd> or <kbd>.FT I</kbd>), or
+passing <kbd>.FT</kbd> the lengthy family+fontname (.e.g. <kbd>.FT
+HLCDI</kbd>).
+<p>
+Fortunately, groff provides a mechanism whereby it's possible to
+extend the basic <strong>R, I, B</strong> and <strong>BI</strong>
+fonts (&quot;styles&quot; in groff-speak) so that one can, in
+fact, create extensive type families, and access all the fonts
+in them with <kbd>.ft</kbd> (groff) or <kbd>.FT</kbd> (mom).
+<p>
+<strong>mom</strong> uses this mechanism to offer, in addition to
+groff's default PostScript font styles, the following:
+<p>
+<a name="STYLE_EXTENSIONS"></a>
+<pre>
+Mom's extensions to groff's basic font styles
+=============================================
+
+ L = Light Roman
+ LI = Light Italic
+ LCD = Light Condensed Roman
+ LCDI = Light Condensed Italic
+ LEX = Light Extended Roman
+ LEXI = Light Extended Italic
+ CD = Medium/Book Condensed Roman
+ CDI = Medium/Book Condensed Italic
+ EX = Medium/Book Extended Roman
+ EXI = Medium/Book Extended Italic
+ DB = DemiBold Roman
+ DBI = DemiBold Italic
+ BCD = Bold Condensed Roman
+ BCDI = Bold Condensed Italic
+ BEX = Bold Extended Roman
+ BEXI = Bold Extended Italic
+ HV = Heavy Roman
+ HVI = Heavy Italic
+ HVCD = Heavy Condensed Roman
+ HVCDI = Heavy Condensed Italic
+ HVEX = Heavy Extended Roman
+ HVEXI = Heavy Extended Italic
+ BL = Black Roman
+ BLI = Black Italic
+ BLCD = Black Condensed Roman
+ BLCDI = Black Condensed Italic
+ BLEX = Black Extended Roman
+ BLEXI = Black Extended Italic
+ UBL = Ultra-Black Roman
+ UBLI = Ultra-Black Italic
+</pre>
+
+Thus, with <strong>mom</strong>, if you've installed, say, some
+extra Helvetica fonts and named them according to the convention FS
+(where &quot;F&quot; means family and &quot;S&quot; means font
+style), once having entered
+<p>
+<pre>
+ .FAMILY H
+ or
+ .FAM H
+</pre>
+
+you can access any of those Helvetica fonts simply by
+passing the correct argument from the list above to
+<a href="typesetting.html#FONT">FT</a>.
+<p>
+For example, if you were working in Medium Roman (<kbd>.FT R</kbd>)
+and you needed Medium Condensed Italic for a while (assuming it's
+installed), you'd just type
+<p>
+<pre>
+ .FT CDI
+</pre>
+
+to access the Medium Condensed Italic font from the Helvetica
+family.
+<p>
+<strong>Mom</strong>'s list of font styles doesn't pretend to
+be exhaustive, but rather tries to cover the basic weight/shape
+combinations likely to be found in any reasonably complete type
+family.
+<p>
+The actual extension names are arbitrary and can be used in a
+flexible manner. For example, if you create a family that has a
+DemiBold font (DB) but no Bold font (B), you might find it more
+convenient to give the DemiBold font the extension &quot;B&quot;.
+Equally, if the family has an ExtraBold font, you might find it more
+convenient to use the extension &quot;HV&quot; (Heavy).
+<a name="REGISTER_STYLE"></a>
+<p>
+However, you may, at needs, want to add to <strong>mom</strong>'s
+list of font styles. You can do this by editing the file, om.tmac.
+Near the top, you'll see lines of the form
+<p>
+<pre>
+ .sty \n[.fp] L \" Light Roman
+ .sty \n[.fp] LI \" Light Italic
+ .sty \n[.fp] LCD \" Light Condensed Roman
+</pre>
+
+Simply add your new font style by imitating what you see and
+plugging in your new font style (having, of course, first created the
+font, correctly named, in groff's PostScript font directory; see
+<a href="#HOWTO">How to create a PostScript font for use with groff</a>).
+<p>
+For example, if you already have some fonts from the Univers
+family installed and have called the family UN, you might decide at
+some point to add the Bold Outline font (UNBO). In which case,
+you'd add
+<p>
+<pre>
+ .sty \n[.fp] BO \" Bold Outline
+</pre>
+
+to the <kbd>.sty \n[.fp] &lt;font style&gt;</kbd> list in om.tmac.
+<p>
+Be careful, though, that any styles you add do not conflict
+with <strong><u>family</u></strong> names that already exist.
+&quot;C&quot;, for example, conflicts with the Courier family
+(CR, CI, CB, CI). Were you to create a font style &quot;C&quot;,
+thinking that <kbd>.FT C</kbd> would give you access to font style
+once you'd given a <kbd>.FAM(ILY)</kbd> directive, you'd get a nasty
+surprise: your type would come out in Courier Roman!
+<p>
+<strong>VERY IMPORTANT NOTE: mom</strong>'s font extensions are
+not &quot;user-space&quot; controllable via a macro. If you've
+been using groff for a long time, and have already rolled your own
+solution to adding PostScript families, fonts, weights, shapes, etc. to
+groff, you may find that <strong>mom</strong>'s font extensions
+conflict with your own scheme. Should that be the case, comment out
+the <kbd>.sty \n[.fp] &lt;font style&gt;</kbd> lines found near the
+top of the om.tmac file.
+
+<a name="HOWTO"><h3><u>How to create a PostScript font for use with groff</u></h3></a>
+These instructions aren't meant to cover all possibilities, merely
+to present one way of making PostScript families/fonts available to
+groff and <strong>mom</strong>.
+<p>
+GNU/Linux distributions being what they are, directory locations may
+differ and the presence of some executables can't be guaranteed.
+I run a Debian system. The instructions reflect that. Users of
+other distros will have to interpret them according to the way their
+distro operates.
+<p>
+What you need before you start:
+<br>
+<ul>
+ <li>groff, version 1.18 or higher
+ <br>
+ (Debian package: groff)
+ <li>a full installation of gs and associated tools
+ <br>
+ (Debian package: gs or gs-gpl)
+ <li>a library of gs fonts
+ <br>
+ (Debian package: gsfonts)
+ <li>a utility for converting TrueType fonts to Type1 fonts
+ <br>
+ (Debian package: ttf2pt1)
+ <li>a font manager
+ <br>
+ (Debian packages: defoma, psfontmgr, dfontmgr)
+ <li>perl
+ <br>
+ (Debian package: perl)
+</ul>
+<br>
+A reasonably complete installation of any major GNU/Linux distro
+should already have these on your system, except perhaps for the
+utility to convert TrueType fonts to Type1 fonts.
+<p>
+Initial preparation (you only have to do this once):
+<br>
+<ol>
+ <li>If you don't already have one, create a directory in your
+ home directory to hold new fonts. Any directory name will do.
+ I use ~/Fonts, with subdirectories for Type1, TrueType and Groff
+ fonts.
+<a name="SITE-FONT"></a>
+ <li>Locate the groff directory, site-font. The exact location is
+ difficult to predict, owing to differences between distros
+ and whether you're using a pre-packaged groff or have built
+ it from source. Some typical locations are
+ <br>
+ <ul>
+ <li>/usr/share/groff,
+ <li>/usr/local/share/groff
+ <li>/etc/groff
+ </ul>
+ <p>
+ If you can't find the site-font directory, locate
+ groff's site-tmac directory, and, as root, create site-font
+ in the same directory as the one that holds site-tmac.
+ E.g., if you find site-tmac in /usr/share/groff, create
+ site-font in /usr/share/groff.
+ <li>Locate the file <kbd>&lt;prefix&gt;/font/devps/generate/textmap</kbd>
+ and symlink it to <kbd>textmap</kbd> in the directory that
+ contains your personal collection of PostScript fonts. (See the
+ <a href="#SMALL_NOTE">Small Note</a>,
+ above, for the meaning of &lt;prefix&gt;). On my system,
+ at the time of writing, &lt;prefix&gt; is
+ /usr/local/share/groff/1.19.2/, therefore, I symlink it in
+ ~/Fonts/Type1 with
+ <br>
+ <pre>
+ln -s /usr/local/share/groff/1.19.2/font/devps/generate/textmap textmap
+ </pre>
+ <li>Locate the file &lt;prefix&gt;/font/devps/text.enc and
+ symlink it to <kbd>text.enc</kbd> in your personal font
+ directory. On my system, in ~/Fonts/Type1
+ <pre>
+ln -s /usr/local/share/groff/1.19.2/font/devps/text.enc text.enc
+ </pre>
+ <li>Make sure you know which directory/ies holds your gs fonts.
+ You'll need the information later. On a Debian box, some
+ typical locations are
+ <br>
+ <ul>
+ <li>/usr/lib/ghostscript/fonts
+ <li>/usr/share/ghostscript/fonts
+ <li>/usr/share/fonts/type1/gsfonts
+ </ul>
+</ol>
+<br>
+Font creation/installation:
+<br>
+<ol>
+ <li>Acquire the font in either Type1 (.pfb) or TrueType
+ (.ttf) format.
+ <li>Place the font in your personal font directory; for me,
+ that's ~/Fonts/Type1 or ~/Fonts/TrueType.
+ <li>In your personal font directory, run one of the following:
+ <br>
+ <ul>
+ <li>For Type1 fonts
+ <br>
+ <ul>
+ <li><kbd>getafm fontfilename.pfb | gsnd - > fontfilename.afm</kbd>
+ <br>
+ For Type1 fonts, this will generate something called
+ an .afm (Adobe Font Metrics) file, which is
+ required to create PostScript fonts for groff.
+ </ul>
+ <li>For TrueType fonts
+ <br>
+ <ul>
+ <li><kbd>ttf2pt1 \-b fontfilename.ttf</kbd>
+ <br>
+ For TrueType fonts, this will generate a PostScript
+ .pfb file as well as an .afm file.
+ </ul>
+ </ul>
+ <li>Still in your personal font directory, run
+ <br>
+ <ul>
+ <li><kbd>afmtodit -e text.enc fontfilename.afm textmap GROFF_FONTNAME</kbd>
+ </ul>
+ <p>
+ Q: <em>How do I choose a GROFF_FONTNAME?</em>
+ <p>
+ A: Start by considering the
+ <a href="definitions.html#TERMS_FAMILY">family</a>
+ to which the font belongs. If you're adding to a family that
+ already exists in groff's &lt;prefix&gt;/font/devps
+ directory, that will be the first part of the font name.
+ (See
+ <a href="typesetting.html#FAMILY">here</a>
+ for a list of families already installed, along with their groff
+ names.) Add to that name the appropriate weight/style extension,
+ listed
+ <a href="#STYLE_EXTENSIONS">here</a>.
+ <p>
+ For example, if you're adding Helvetica Light Roman, your
+ GROFF_FONTNAME would be <strong>HL</strong>. If you're
+ adding Helvetica Light Italic, your GROFF_FONTNAME would be
+ <strong>HLI</strong>.
+ <p>
+ If you're adding a font not already in groff's PostScript
+ families, first choose a meaningful name for the
+ <a name="definitions.html#TERMS_FAMILY">family</a>
+ to which the font belongs. The name can be anything you like. If,
+ for example, the family is Garamond, you could choose GARAMOND,
+ GARA, GD, or even just plain G as the family name. Then tack on the
+ appropriate style/weight extension. Thus, if you were installing
+ Garamond Bold Condensed Italic and had chosen <strong>GD</strong>
+ as the family name for Garamond, your GROFF_FONTNAME would be
+ <strong>GDBCDI</strong>.
+ <p>
+ In <strong>mom</strong>, you can then access the Garamond
+ family with <kbd>.FAM GD</kbd>, and the Bold Condensed
+ Italic font wth <kbd>.FT BCDI</kbd>.
+ <p>
+ <strong>Note:</strong> The family name need not be in upper
+ case, and there's no limit to the length of the name.
+ &quot;Garamond&quot;, for example, could be the name you
+ give the Garamond family. In fact, you might find it
+ preferable, since a) you wouldn't have to remember how
+ you'd named the family, and b) should you be scanning
+ your
+ <a href="#SITE-FONT">site-font directory</a>,
+ something like GaramondBCDI will be more meaningful than,
+ say, GDBCDI.
+ <li>Copy or move GROFF_FONTNAME to your
+ <a href="#SITE-FONT">site-font directory</a>,
+ or change to the site-font directory and make a symlink to
+ GROFF_FONTNAME in your personal directory.
+ <li>Copy or move the .pfb file to the directory that
+ holds your gs fonts, or change to that directory and make a
+ symlink to the .pfb file in your personal directory.
+ <li>Do whatever your system or distro requires in order to
+ register the new PostScript font (the .pfb file). On a
+ Debian system, as root, you can run dfontmgr for a
+ graphical interface that will take care of registering the
+ font.
+</ol>
+<p>
+Written out in full, adding fonts looks like a lot of work. It
+isn't. Basically, it's just:
+<br>
+<ul>
+ <li>acquire the font
+ <li>generate an .afm file for the font
+ <li>create the groff font
+ <li>put the groff font in &lt;prefix&gt;/font/devps
+ <li>make sure gs knows about the font
+</ul>
+<br>
+After you've done it a couple of times, it all makes sense, and is
+really quite easy. Not to mention that once you understand the
+process, you can write a bash script to automate the process.
+Here's an example, which you can adapt to your own needs. The
+script requires an argument (the .pfb filename), then prompts for
+the GROFF_FONTNAME.
+<p>
+<pre>
+#! /bin/bash
+
+# A script for installing Type1 fonts.
+#
+# Builds .afm files from .pfb files, generates a groff font from the
+# .afm file, makes a symlink in /usr/lib/ghostscript/font/ to the
+# .pfb file, and a symlink in site-font to the groff font
+
+# .pfb filename, stripped of .pfb extension
+FONT=`basename $1 .pfb`
+
+# Directory holding my personal collection of type1 fonts
+FONTDIR="$HOME/Fonts/Type1"
+
+# Directory holding system ghostscript fonts
+GS_FONTDIR="/usr/lib/ghostscript/fonts"
+
+# Location of site-font/devps
+GROFF_SITE_FONTDIR="/usr/local/share/groff/site-font/devps"
+
+# Personal groff fonts directory
+GROFF_FONTS="$HOME/Fonts/Groff"
+
+# Symlinks to textmap and text.enc
+TEXTMAP="$FONTDIR/textmap"
+TEXTENC="$FONTDIR/text.enc"
+
+if [ ! `pwd` = "$FONTDIR" ] ; then
+ echo "Changing into $FONTDIR directory.."
+ cd $FONTDIR
+ sleep 1
+else
+ sleep 1
+fi
+
+echo -n "Groff name for this font: "
+read FONTNAME
+sleep 1
+
+echo "Getting .afm.."
+getafm $FONT.pfb | gsnd - > $FONT.afm
+sleep 1
+
+echo "Creating $FONTNAME.."
+afmtodit -e $TEXTENC $FONTDIR/$FONT.afm $TEXTMAP $FONTNAME
+mv -i $FONTNAME $GROFF_FONTS
+sudo ln -s $GROFF_FONTS/$FONTNAME $GROFF_SITE_FONTDIR/$FONTNAME
+sleep 1
+
+echo "Linking $FONT in $GS_FONTDIR.."
+cd $GS_FONTDIR
+sudo ln -s $FONTDIR/$FONT.afm $FONT.afm
+sudo ln -s $FONTDIR/$FONT.pfb $FONT.pfb
+sleep 1
+
+# This next bit is Debian specific. If you're not running a
+# Debian system, replace it with whatever your distro requires
+# in order to register Type1 fonts.
+
+if [ !`pidof -x /usr/bin/dfontmgr` ] ; then
+ echo "I will now run dfontmgr so you can register the font."
+ exec sudo dfontmgr &
+else
+ echo "You may now register the font with dfontmgr."
+fi
+</pre>
+<hr>
+
+<!=====================================================================>
+
<a name="CODENOTES">
<h2><u>Some reflections on mom</u></h2>
</a>
@@ -99,12 +593,14 @@ scratching a personal itch, then <strong>mom</strong> can truly be
called open source, even if, a mere humble set of macros standing on
the shoulders of a giant named troff, she isn't programming at all.
<p>
-As a writer living in a perpeptual state of penury, all the computers
+As a writer living in a perpetual state of penury, all the computers
I've ever owned have been hand-me-downs -- several generations
out-of-date and &quot;resource challenged&quot;. Disk space has
always been an issue, as has processor speed and available RAM.
-One of the reasons I run Linux is that it has helped enormously to
-get the most out of my poor little boxes.
+One of the reasons I run GNU/Linux is that it has helped enormously
+to get the most out of my poor little boxes. (It has been pointed
+out to me that NetBSD might be an even better choice of operating
+systems for computers with limited resources.)
<p>
In Linux-land, the choice of typesetting systems basically comes down
to groff or TeX. Both are wonderful -- monumental achievements if you
@@ -122,7 +618,7 @@ However, groff has always had a liability: it's incredibly geeky.
Owing to its very long history, it -- and its &quot;power users&quot;
-- have remained stuck in a time warp. Most common macro packages
still look as they did in those decades when memory was exorbitantly
-expensive, and every byte mattered. Documentation -- not always
+expensive and every byte mattered. Documentation -- not always
easy to find -- is written as if all readers are computer whizzes,
or at least have a university degree in one of the higher sciences.
<p>
@@ -132,6 +628,13 @@ ambiguity of groff's documentation. Making sense of certain primitives
has often involved days of testing, interpreting the documentation
instead of just using the primitive.
<p>
+(ADDENDUM to the previous two paragraphs: A tremendous amount of
+effort has gone into creating a groff manual that can be read with
+"info," as well as creating truly useful man pages. The info
+manual is clear and well-written, so my comments are actually out
+of date. I leave them in for the benefit of groff newbies, who may
+still find the documents a bit intimidating.)
+<p>
For some time now, groff users and macro writers have had the
option to use &quot;long&quot; names, yet have mostly chosen not to.
With long names, it's possible to create macro sets that are humanly
@@ -145,15 +648,11 @@ newbies and old hands alike.
and a host of other groff goodies that have become part of the
whole groff picture under the unflagging guidance of groff's current
maintainer, Werner Lemberg. Nearly every macro, number register and
-string is &quot;recognisable&quot; simply by its name. The file is
+string is &quot;recognizable&quot; simply by its name. The file is
heavily commented. A consistent, if idiosyncratic, indenting style
is used as well, significantly improving readability. Anyone
wanting to futz around with <strong>mom</strong>'s macros should be
able to do so with a minimum of head scratching.
-<p>
-To all you groff-jocks out there who love the aracana of
-groff-as-it-used-to-be, I apologise. To everyone else, I simply say:
-Welcome, and enjoy.
<br>
<hr>
@@ -171,14 +670,22 @@ groff mailing list at
(subscription information available
<a href="http://ffii.org/mailman/listinfo/groff/">here</a>)
or contact me, Peter Schaffter, directly at
-<p>
-<address align="center">
- <a href="mailto:df191@ncf.ca">df191@ncf.ca</a>
-</address>
+<i>&#112;&#101;&#116;&#101;&#114;&#64;&#102;&#97;&#117;&#115;&#116;&#117;&#115;&#46;&#100;&#121;&#110;&#46;&#99;&#97;</i>
+or
+<i>&#112;&#116;&#112;&#105;&#64;&#103;&#111;&#108;&#100;&#101;&#110;&#46;&#110;&#101;&#116;</i>.
<p>
+Please include the word &quot;mom&quot; or &quot;groff&quot; in the
+Subject: line of any message sent to my personal address, or you
+risk the wrath of my implacable spam filters. :)
+<p>
+If you want to visit <strong>mom</strong>'s homepage, you'll find
+it
+<a href="http://faustus.dyn.ca/mom/mom.html">here</a>.
+<p>
<hr>
-<a href="typemacdoc.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="reserved.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="macrolist.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="#TOP">Top</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
</body>
diff --git a/contrib/groff/contrib/mom/momdoc/color.html b/contrib/groff/contrib/mom/momdoc/color.html
new file mode 100644
index 000000000000..a6badbc4ba20
--- /dev/null
+++ b/contrib/groff/contrib/mom/momdoc/color.html
@@ -0,0 +1,338 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<title>Mom -- Colour</title>
+</head>
+<body bgcolor="#dfdfdf">
+
+<!====================================================================>
+
+<a href="docprocessing.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="inlines.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="toc.html">Back to Table of Contents</a>
+
+<a name="TOP"></a>
+<h1 align="center">
+ <a name="COLOR_INTRO"><u>Coloured text</u></a>
+</h1>
+<p>
+<a href="#INTRO_COLOR">Introduction to coloured text</a>
+<br>
+<a href="#MACROS_COLOR">Index of colour macros</a>
+<p>
+
+<a name="INTRO_COLOR">
+ <h2><u>Introduction to coloured text</u></h2>
+</a>
+
+<strong>Mom</strong>'s support for coloured text is straightforward.
+You begin by telling <strong>mom</strong> about the colours you want
+with
+<a href="#NEWCOLOR">NEWCOLOR</a>
+or
+<a href="#XCOLOR">XCOLOR</a>.
+Afterward, any time you want text to be coloured, you either colour
+it with an
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
+that contains the colour name (e.g. <kbd>\*[red]</kbd> or
+<kbd>\*[blue]</kbd>) or invoke the macro,
+<a href="#COLOR">COLOR</a>,
+with the name of the colour you want.
+<a name="COLOR_EXAMPLE"></a>
+<p>
+For example, say you want to have the name &quot;Jack&quot; in the
+sentence &quot;All work and no play makes Jack a dull boy&quot;
+appear in yellow. You'd begin by telling <strong>mom</strong> about
+the colour, yellow. There are two ways of doing this; see
+<a href="#NEWCOLOR">NEWCOLOR</a>
+and
+<a href="#XCOLOR">XCOLOR</a>
+for a full explanation of the difference between the two. If you
+use <strong>XCOLOR</strong>, you'd enter this:
+<p>
+<pre>
+ .XCOLOR yellow
+</pre>
+
+If you use <strong>NEWCOLOR</strong>, you might enter
+<p>
+<pre>
+ .NEWCOLOR yellow RGB #FFFF00
+</pre>
+
+<a name="COLOR_EXAMPLE2"></a>
+After &quot;defining&quot; (or &quot;initializing&quot;) the colour
+&quot;yellow&quot;, you'd colourize the name, Jack, either with an
+inline escape
+<p>
+<pre>
+ All work and no play makes \*[yellow]Jack\*[black] a dull boy.
+</pre>
+
+or with the <strong>COLOR</strong> macro
+<p>
+<pre>
+ All work and no play makes
+ .COLOR yellow
+ Jack
+ .COLOR black
+ a dull boy.
+</pre>
+
+Notice, in both examples, that a) you have to set the colour back to
+black after &quot;Jack&quot;, and b) you don't have to define or
+intialize the colour, black. <strong>Mom</strong> predefines
+&quot;black&quot;, &quot;BLACK&quot;, &quot;white&quot; and
+&quot;WHITE&quot; for you.
+<p>
+For information on using colour during
+<a href="docprocessing.html#INTRO_MACROS_DOCPROCESSING">document processing</a>,
+see
+<a href="docprocessing.html#COLOR">Colour support in document processing</a>.
+<p>
+<strong>Please note: Mom</strong>'s colour support is for text only.
+She doesn't support &quot;fill&quot; (or &quot;background&quot;)
+colour for drawn objects. Please also note that if you're
+accustomed to using groff's <kbd>.defcolor</kbd> to define colours,
+and groff's inline <kbd>\m[&lt;colorname&gt;]</kbd> to call them, you may
+continue to do so without confusing <strong>mom</strong>.
+
+<p>
+<a name="MACROS_COLOR"><h3><u>Index of colour macros</u></h3></a>
+<ul>
+ <li><a href="#NEWCOLOR">NEWCOLOR</a>
+ <li><a href="#XCOLOR">XCOLOR</a>
+ <li><a href="#COLOR">COLOR</a>
+ <li><a href="#COLOR_INLINE">\*[&lt;colorname&gt;]</a> inline escape
+</ul>
+<p>
+
+<!---NEWCOLOR--->
+
+<hr width="66%" align="left">
+<a name="NEWCOLOR"><h3><u>Creating (initializing) a colour with NEWCOLOR</u></h3></a>
+<br>
+<nobr>Macro: <strong>NEWCOLOR</strong> &lt;colour name&gt; [&lt;colour scheme&gt;] &lt;colour components&gt;</nobr>
+
+<p>
+<strong>NEWCOLOR</strong> lets you create a colour, rather like an
+artist mixing paint on a palette. The colour isn't used
+immediately; <strong>NEWCOLOR</strong> merely tells
+<strong>mom</strong> how to mix the colour when you need it. If
+you haven't invoked <strong>NEWCOLOR</strong> (or
+<a href="#XCOLOR">XCOLOR</a>),
+<strong>mom</strong> doesn't have a clue what you mean when you
+reference a colour (with
+<a href="#COLOR">COLOR</a>
+or
+<a href="#COLOR_INLINE">\*[&lt;color name&gt;]</a>).
+<p>
+The first argument to <strong>NEWCOLOR</strong> is a name for your
+colour. It can be anything you like--provided it's just one word
+long--and can be caps, lower case, or any combination of the two.
+<p>
+The second argument, which is entirely optional, is the &quot;colour
+scheme&quot; you want <strong>mom</strong> to use when mixing the
+colour. Valid arguments are <strong>RGB</strong> (3 components,
+red green blue), <strong>CYM</strong> (3 components cyan yellow
+magenta), <strong>CMYK</strong> (4 components cyan magenta yellow
+black) or <strong>GRAY</strong> (1 component). If you omit the
+second argument, <strong>mom</strong> assumes you want RGB.
+<p>
+The final argument is the components of your colour. This can be
+hexadecimal string starting with a pound sign (#) (for colour values
+in the 0-255 range) or two pound signs (##) (for colour values
+in the 0-65535 range), or it can be a series of decimal digits,
+separated by spaces, one digit per component, with the argument
+enclosed in double quotes. (If this is all gibberish to you, see
+<a href="#COLOR_TIP">Tips for newbies</a>.)
+<p>
+Thus, to tell <strong>mom</strong> about a colour named
+&quot;YELLOW&quot;, you could enter one of the following:
+<p>
+<pre>
+ .NEWCOLOR YELLOW #FFFF00 \"or ##FFFFFFFF0000 or "1 1 0"
+ .NEWCOLOR YELLOW RGB #FFFF00 \"or ##FFFFFFFF0000 or "1 1 0"
+ .NEWCOLOR YELLOW CYM #00FF00 \"or ##0000FFFF0000 or "0 1 0"
+ .NEWCOLOR YELLOW CYMK #00FF0000 \"or ##0000FFFF00000000 or "1 1 0"
+</pre>
+
+After you've told <strong>mom</strong> about a colour, you can then get
+her to set text in that colour either with the inline escape
+<a href="#COLOR_INLINE">\*[&lt;colorname&gt;]</a>
+or the macro
+<a href="#COLOR">COLOR</a>.
+(See the
+<a href="#COLOR_EXAMPLE">example</a>,
+above.)
+<br>
+<h3><u>Tips for newbies</u></h3>
+Colour manipulation can be tremendously confusing if you don't have
+a background in graphic arts or computing. My advice, if color
+intimidates you, is to stick to using <strong>mom</strong>'s
+default RGB colour scheme, and to fire up a color chooser that
+gives you the RGB values you want for the colour you select. Plug
+those values into the components argument to
+<strong>NEWCOLOR</strong>, and you'll get the colour you want.
+Both the KDE and gnome desktops have colour selectors that provide
+you with the shorter RGB hexadecimal string. If you're not running
+KDE or gnome, the X utility, xcolorsel, provides you with a similar
+functionality, although it only provides RGB values for 256
+pre-defined colours. If you use xcolorsel, be sure to click the
+button &quot;Display format&quot; and select &quot;8 bit truncated
+rgb&quot;.
+<p>
+Alternatively, you can use <strong>mom</strong>'s simpler
+<a href="#XCOLOR">XCOLOR</a>
+macro to initialize one of the 256 pre-defined X colours by
+supplying the name of the color as an argument.
+<br>
+
+<!---XCOLOR--->
+
+<hr width="33%" align="left">
+<a name="XCOLOR"><h3><u>Initializing a colour with XCOLOR</u></h3>
+<br>
+<nobr>Macro: <strong>XCOLOR</strong> &lt;X color name&gt; [&lt;alias&gt;]</nobr>
+<br>
+<em>*&lt;X color name&gt; must be all one word, all lower case.
+<br>
+(See
+<a href="#XCOLOR_NAMES">Finding X color names</a>
+for how to get a list of valid colour names.)
+</em>
+<p>
+<strong>XCOLOR</strong> is similar to <strong>NEWCOLOR</strong> in
+that it tells <strong>mom</strong> to initialize a colour, but it's
+easier to use. All you have to do is pass it, as an argument, the
+legal name of one of the 256 pre-defined X colours. The name must
+be all one word, and, breaking with <strong>mom</strong> policy, it
+must be entered in lower case.
+<p>
+For example, if you want to intialize the X colour, coral, all you
+have to do is enter
+<br>
+<pre>
+ .XCOLOR coral
+</pre>
+
+Afterwards
+<p>
+<pre>
+ .COLOR coral
+</pre>
+
+will colourize subsequent text coral until you instruct
+<strong>mom</strong> to return to black, or some other pre-defined
+initialized colour. (The
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
+<kbd>\*[coral]</kbd> will equally colourize text coral after you've
+initialized the colour with <strong>XCOLOR</strong>.)
+<p>
+The downside of <strong>XCOLOR</strong> is that you can't create
+custom colours. This restriction, however, is mitigated by the
+fact that for many users, 256 colours is more than enough to play
+around with.
+<p>
+While some X colours have fanciful names (peachpuff, papayawhip,
+thistle, snow), many are self-explanatory and self-descriptive in
+ordinary colour terms. &quot;blue&quot; is pure (rgb) blue,
+&quot;green&quot; is pure (rgb) green, and so on. Furthermore, for
+many X colors, there exist four variants, each representing
+increasingly darker shades of the same colour. For example,
+&quot;blue&quot; (and &quot;blue1&quot;) are the brightest forms of
+(rgb) blue; &quot;blue2&quot;, &quot;blue3&quot; and &quot;blue4&quot;
+are increasingly darker shades of the same blue. For that reason,
+you may find <strong>XCOLOR</strong> is a better choice than
+<strong>NEWCOLOR</strong> when it comes to initializing common
+colors.
+<p>
+The whimsical nature of X colour names sometimes makes for names
+that are long to type in, e.g. &quot;mediumspringgreen&quot;.
+The optional second argument to <strong>XCOLOR</strong> allows you
+to come up with more convenient name by which to reference the
+colour. For example, you could enter
+<p>
+<pre>
+ .XCOLOR mediumspringgreen mygreen
+ or
+ .XCOLOR mediumspringgreen MYGREEN
+</pre>
+
+so that whenever you want text mediumspringgreen-ed, you can use
+either <kbd>.COLOR mygreen</kbd> (or <kbd>.COLOR MYGREEN</kbd>) or
+the inline escape <kbd>\*[mygreen]</kbd> (or
+<kbd>\*[MYGREEN]</kbd>.)
+<p>
+<a name="XCOLOR_NAMES"><h3><u>Finding X color names</u></h3></a>
+<br>
+There are two ways of finding the names of the pre-defined X
+colours. One is to consult the file, rgb.txt, included with
+all X11 installations. The location of the file on a Debian
+GNU/Linux distribution is typically /etc/X11/rgb.txt. Other
+distributions and other X installations may have the file in
+another location. The file lists the colour names, but doesn't
+show you what the colours actually look like.
+<p>
+A better way to get the colour names, as well as to see what the
+colours look like, is to fire up a colour chooser (like xcolorsel)
+that both lists the colour names and shows a swatch of the colour
+as well.
+<p>
+Whichever method you use to find X color names, remember that the
+names, passed as arguments to <strong>XCOLOR</strong>, <em>must</em>
+be all one word, all in lower case.
+<br>
+
+<!---COLOR--->
+
+<hr width="33%" align="left">
+<a name="COLOR"><h3><u>Invoking a color</u></h3>
+<br>
+<nobr>Macro: <strong>COLOR</strong> &lt;colorname&gt;</nobr>
+<br>
+<a name="COLOR_INLINE">Inline: <strong>\*[&lt;colorname&gt;]</strong></a>
+<p>
+<a name="COLOR_INLINE"></a>
+Once you've told <strong>mom</strong> about a colour (via
+<strong>NEWCOLOR</strong> or <strong>XCOLOR</strong>), you use either
+the macro, <strong>COLOR</strong>, or the
+<a href="definitions.html#TERMS_INLINES">inline escape</a>,
+<kbd>\*[&lt;colorname&gt;]</kbd>, to cause <strong>mom</strong> to
+set subsequent text in that colour. See the
+<a href="#COLOR_EXAMPLE2">example</a>,
+above, which shows both in action.
+<p>
+<strong>NOTE:</strong> You can use the
+<kbd>\*[&lt;colorname&gt;]</kbd> inline escape in any
+<a href="docprocessing.html#TOP">document processing</a>
+macro that takes a
+<a href="definitions.html#TERMS_STRINGARGUMENT">string argument</a>.
+However, you must remember to reset the colour at the end of the
+argument (typically with <kbd>\*[black]</kbd>) unless you want all
+subsequent invocations of that particular macro to be colourized.
+<p>
+Furthermore, if you use <kbd>\*[&lt;colorname&gt;]</kbd> in the
+string argument passed to
+<a href="docelement.html#HEAD">.HEAD</a>,
+<a href="docelement.html#SUBHEAD">.SUBHEAD</a>
+or
+<a href="docelement.html#PARAHEAD">.PARAHEAD</a>,
+and you've requested that any of these types of heads be numbered,
+the numbers themselves will not be coloured, only the text you
+passed the macro. If you wish the numbers to be colourized as
+well, you must explicitly tell <strong>mom</strong> that you wish
+all of the head(s), subhead(s) or parahead(s), including the
+numbers, colourized by invoking the appropriate
+<a href="docelement.html#DOCELEMENT_CONTROL">control macro</a>.
+
+<br>
+
+<hr>
+<a href="docprocessing.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="inlines.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="#TOP">Top</a>&nbsp;&nbsp;
+<a href="toc.html">Back to Table of Contents</a>
+</body>
+</html>
diff --git a/contrib/groff/contrib/mom/momdoc/cover.html b/contrib/groff/contrib/mom/momdoc/cover.html
index 11b6a8545821..2566547cb511 100644
--- a/contrib/groff/contrib/mom/momdoc/cover.html
+++ b/contrib/groff/contrib/mom/momdoc/cover.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -7,41 +8,503 @@
<!====================================================================>
-<a href="letters.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="refer.html#TOP">Next</a>&nbsp;&nbsp;
<a href="rectoverso.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
+<p>
-<a name="TOP"></a>
-<a name="COVER">
- <h2 align="center"><u>CREATING A COVER PAGE</u></h2>
+<a name="TOP">
+<h1 align="center"><u>CREATING A COVER PAGE</u></h1>
</a>
+<ul>
+ <li><a href="#COVER_INTRO">Introduction to cover pages</a>
+ <ul>
+ <li><a href="#PLEASE">Important note -- please read</a>
+ <li><a href="#DESC">Description of what mom does on cover pages</a>
+ <li><a href="#PAGINATION">A note on headers/footers and pagination</a>
+ <li><a href="#DESIGN">What to do if you want to design your
+ own cover pages</a>
+ </ul>
+ <li><a href="#COVER">The cover and document cover macros</a>
+ <ul>
+ <li><a href="#COVER">COVER/DOC_COVER</a>
+ <ul>
+ <li><a href="#REQUIRED">The required argument</a>
+ <li><a href="#CHAPTER">How the CHAPTER argument and friends work</a>
+ <li><a href="#OPTIONAL">The optional arguments</a>
+ <li><a href="#DOCTYPE">What the DOCTYPE argument means</a>
+ </ul>
+ </ul>
+ <li><a href="#ON_OFF">Enabling/disabling automatic generation of cover pages</a>
+ <li><a href="#COVER_CONTROL">Control macros--changing the
+ defaults for covers and document covers</a>
+</ul>
+
+<a name="COVER_INTRO"><h2><u>Introduction to cover pages</u></h2></a>
+<p>
+As of version 1.19 of <strong>mom</strong>, you can now have cover
+pages generated automatically.
+<p>
+Though identical in treatment, <strong>mom</strong> provides two
+kinds of cover pages: section cover pages (which I shall refer to
+simply as &quot;cover pages&quot;) and document cover pages
+(&quot;doc covers&quot;).
+<p>
+A document cover page
+(<a href="#DOC_COVER">doc cover</a>)
+is what you'd most likely use at the start of a <a
+href="rectoverso.html#COLLATE_INTRO">collated</a> document, where
+you might want the name of the complete document, the author(s) and
+the copyright line to appear. Another place you might use a doc
+cover is for a novel, where you want the title of the novel, not
+the chapter title or chapter number, as the first cover page.
+<p>
+A section
+<a href="#COVER">cover</a>
+page is what you'd use for cover pages that separate sections of a
+collated document. A section cover page (but not a doc cover page)
+in a collated document could, for example, simply read &quot;PART
+I&quot;.
<p>
-At present, <strong>mom</strong> provides no mechanism for
-automatically generating cover pages. It's a situation not likely
-to change, given that what's needed on document covers changes from
-document to document, both in terms of style and content. And,
-more often than not, what goes on covers is matter of personal taste.
+In non-collated documents (say, an essay) you can use either a
+section cover or a doc cover to generate a cover sheet.
+<p>
+In addition, nothing prevents you from generating both a doc cover
+page and a section cover page for every document in a collated
+document. Or you can selectively disable the automatic generation
+of either doc covers or section covers in a collated document,
+on-the-fly.
+<p>
+<a name="PLEASE"><strong>Important note:</strong></a>
+automatic generation of cover or doc cover pages after the first
+one(s) only takes place if you are working with collated documents.
+<strong>Mom</strong> provides no mechanism for saying &quot;print
+a section cover here even though I'm still working on the same
+(non-collated) document.&quot;
+
+<a name="DESC"><h3><u>Description of what mom does on cover pages</u></h3></a>
+
+By default, <strong>mom</strong> typesets cover (and doc cover)
+pages identically to
+<a href="definitions.html#TERMS_DOCHEADER">docheaders</a>
+(see
+<a href="docprocessing.html#DOCHEADER_CONTROL">How to change the look of docheaders</a>
+for a description of what a docheader looks like). The only
+differences are
+<br>
+<ul>
+ <li>the position on the page where the information is output
+ <li>the (optional) addition of copyright and miscellaneous
+ information
+ <li>there's no running text underneath
+</ul>
+
<p>
-If you want a document to begin with a cover page, typeset the cover
-(using the
-<a href="typesetting.html#MACROS_TYPESETTING">typesetting macros</a>).
-At the end, invoke
+You tell <strong>mom</strong> what you want to appear on the cover
+pages through the arguments you pass to
+<a href="#COVER">COVER</a>
+and/or
+<a href="#COVER">DOC_COVER</a>.
+Provided you have already given <strong>mom</strong> the
+appropriate references macro (e.g.
+<a href="docprocessing.html#TITLE">TITLE</a>
+or
+<a href="docprocessing.html#AUTHOR">AUTHOR</a>),
+she will output cover (and doc cover) pages identically to how she
+would output docheaders containing the same information.
+<p>
+By default, <strong>mom</strong> starts cover (and doc cover) pages
+one-third of the way down the page. This can be changed through
+the use of the control macros
+<a href="#COVER_CONTROL_INDEX">COVER_ADVANCE/DOC_COVER_ADVANCE</a>.
+<p>
+If you request copyright information (and have already given
+<strong>mom</strong> the reference macro,
+<a href="docprocessing.html#COPYRIGHT">COPYRIGHT</a>),
+she sets it, by default, in a smaller
+<a href="definitions.html#TERMS_PS">point size</a>
+in the bottom right hand corner of the cover (or doc cover) page.
+The default point size and the position can be controlled
+with
+<a href="#COVER_CONTROL_INDEX">COVER_COPYRIGHT_SIZE/DOC_COVER_COPYRIGHT_SIZE</a>
+and
+<a href="#COVER_CONTROL_INDEX">COVER_COPYRIGHT_QUAD/DOC_COVER_COPYRIGHT_QUAD</a>.
+<p>
+Similarly, if you request miscellaneous information (and have already given
+<strong>mom</strong> the reference macro,
+<a href="docprocessing.html#MISC">MISC</a>),
+she sets it, by default, in a smaller point size in the bottom left
+hand corner of the cover (or doc cover) page. The default point
+size is dependent on
+<strong>COVER_COPYRIGHT_SIZE/DOC_COVER_COPYRIGHT_SIZE</strong>,
+but the position can be controlled with
+<a href="#COVER_CONTROL_INDEX">COVER_MISC_QUAD/DOC_COVER_MISC_QUAD</a>.
+
+<a name="PAGINATION"></a>
+<p>
+<strong>NOTE: mom</strong> does not set any
+<a href="definitions.html#TERMS_HEADER">headers</a>
+or
+<a href="definitions.html#TERMS_FOOTER">footers</a>
+on cover pages. Neither does she set any page numbers. From the
+point of pagination, cover (and doc cover) pages are considered
+&quot;null&quot; pages; if you wish them to be included in the
+pagination scheme (even though no page numbers appear), you must
+set the page number of each first page following a
+<a href="rectoverso.html#COLLATE">COLLATE</a>
+manually with
+<a href="headfootpage.html#PAGENUMBER">PAGENUMBER</a>.
+
+<a name="DESIGN"></a>
+<p>
+Finally, if you want to design your own cover page(s), you can
+always typeset them (using the
+<a href="typesetting.html#MACROS_TYPESETTING">typesetting macros</a>),
+invoke
<a href="typesetting.html#NEWPAGE">NEWPAGE</a>,
-then set up your document <em>in full</em> (see
+set up your document <em>in full</em> (see
<a href="docprocessing.html#DOCPROCESSING_TUT">Tutorial -- Setting up a mom document</a>),
-invoking
-<a href="docprocessing.html#START">START</a>
-as usual once you're done. The cover page (and any typesetting
-commands on it) will have no effect on <strong>mom</strong>'s
-processing of the document itself, the first page of which, moreover,
-will be numbered &quot;1&quot; unless you instruct her otherwise
-with
+and lastly invoke
+<a href="docprocessing.html#START">START</a>.
+The cover page (and any typesetting commands on it) will have no
+effect on <strong>mom</strong>'s processing of the document itself,
+the first page of which, moreover, will be numbered &quot;1&quot;
+unless you instruct her otherwise with
<a href="headfootpage.html#PAGENUMBER">PAGENUMBER</a>.
+<p>
+
+<!---COVER--->
+
+<hr width="66%" align="left">
+<p>
+<a name="COVER"></a>
+ Macro: <strong>COVER</strong>
+ <br>
+ Macro: <strong>DOC_COVER</strong>
+ <br>
+ Required argument: <nobr>TITLE | DOCTITLE | COVERTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE</nobr>
+ <br>
+ Optional arguments: <nobr>[ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC ]</nobr>
+ <p>
+ <em>*Note: these macros should be placed in the
+ &quot;style-sheet&quot; section of your document setup (see the
+ <a href="docprocessing.html#DOCPROCESSING_TUT">Tutorial -- Setting up a mom document</a>),
+ i.e. after PRINTSTYLE (and/or DOCTYPE and/or COPYSTYLE), but
+ before START.</em>
+
+</a>
+<p>
+<strong>COVER</strong> and <strong>DOC_COVER</strong> behave
+identically. The reason <strong>mom</strong> provides two macros
+for automatic cover page generation is so that you can have two
+different kinds of covers with different information on each.
+<p>
+Imagine, for a moment, you've written a document comprised of three
+sections. When you
+<a href="rectoverso.html#COLLATE">COLLATE</a>
+the document for output, you could use <strong>DOC_COVER</strong>
+to generate a cover page that contained the name of the entire
+document, your (the author's) name, and perhaps the copyright date.
+Subsequently, you could use <strong>COVER</strong>, after each
+<strong>COLLATE</strong> but before each
+<a href="docprocessing.html#START">START</a>,
+to generate a cover page (or cover &quot;sheet&quot;, if you prefer)
+containing just the name of the section.
+<br>
+
+<a name="REQUIRED"><h3><u>The required argument</u></h3></a>
+
+Both <strong>COVER</strong> and <strong>DOC_COVER</strong>, whenever
+invoked, require a first argument, as listed above. This first argument
+will become the first bit of information <strong>mom</strong>
+prints on the cover (or doc cover) page (i.e. it will be the
+&quot;title&quot;).
+<p>
+In order for the information to appear, you must, of course, first
+have given <strong>mom</strong> the appropriate
+<a href="docprocessing.html#REFERENCE_MACROS">reference macro</a>.
+A list of arguments with their equivalent reference macros follows.
+<br>
+
+<dl>
+<dt>TITLE
+<dd>-means the argument you gave to
+<a href="docprocessing.html#TITLE">TITLE</a>
+<dt>DOCTITLE
+<dd>-means the argument you gave to
+<a href="docprocessing.html#DOCTITLE">DOCTITLE</a>
+<dt>COVERTITLE
+<dd>-means the argument you gave to
+<a href="docprocessing.html#COVERTITLE">COVERTITLE</a>
+or
+<a href="docprocessing.html#DOC_COVERTITLE">DOC_COVERTITLE</a>
+<dt>CHAPTER, CHAPTER_TITLE, CHAPTER+TITLE
+<dd>-see below (How the CHAPTER argument and friends work)
+</dl>
+<br>
+
+<a name="CHAPTER"><h3><u>How the CHAPTER argument and friends work</u></h3></a>
+
+<kbd>CHAPTER</kbd>, by itself, will print the <a
+href="docprocessing.html#CHAPTER_STRING">CHAPTER_STRING</a> as well
+as the chapter number that you gave to
+<a href="docprocessing.html#CHAPTER">CHAPTER</a>.
+For example, assuming a vanilla setup for your chapter
+<p>
+<pre>
+ \# Reference macros
+ .CHAPTER 1
+ .CHAPTER_TITLE "The Bonny Blue Yonder"
+ &lt;other stuff&gt;
+ .COVER CHAPTER \" (or .DOC_COVER CHAPTER)
+ .START
+</pre>
+
+will simply print
+<p>
+<pre>
+ Chapter 1
+</pre>
+
+<kbd>CHAPTER_TITLE</kbd> will print the chapter title you
+gave to
+<a href="docprocessing.html#CHAPTER_TITLE">CHAPTER_TITLE</a>.
+For example, assuming a vanilla setup for your chapter
+<p>
+<pre>
+ \# Reference macros
+ .CHAPTER 1
+ .CHAPTER_TITLE "The Bonny Blue Yonder"
+ &lt;other stuff&gt;
+ .COVER CHAPTER_TITLE \" (or .DOC_COVER CHAPTER_TITLE)
+ .START
+</pre>
+
+will simply print
+<p>
+<pre>
+ The Bonny Blue Yonder
+</pre>
+
+<p>
+<kbd>CHAPTER+TITLE</kbd> will print <strong>both</strong> the
+chapter string + number AND the chapter title. For example,
+assuming a vanilla setup for your chapter
+<p>
+<pre>
+ \# Reference macros
+ .CHAPTER 1
+ .CHAPTER_TITLE "The Bonny Blue Yonder"
+ &lt;other stuff&gt;
+ .COVER CHAPTER+TITLE \" (or .DOC_COVER CHAPTER+TITLE)
+ .START
+</pre>
+
+will print
+<p>
+<pre>
+ Chapter 1
+ The Bonny Blue Yonder
+</pre>
+
+<a name="OPTIONAL"><h3><u>The optional arguments</u></h3></a>
+
+The remainder of the arguments to <strong>COVER</strong> and
+<strong>DOC_COVER</strong> are optional. They refer specifically
+to the information you gave the
+<a href="docprocessing.html#REFERENCE_MACROS">reference macros</a>
+bearing the same name as the arguments.
+<p>
+You may enter as many or as few as you would like to see on your
+cover (or doc cover) page. The only hitch is--PAY ATTENTION,
+CLASS!--they must be entered in the order given above. For
+example, if you want <kbd>TITLE</kbd>, <kbd>AUTHOR</kbd>,
+<kbd>COPYRIGHT</kbd> and <kbd>MISC</kbd>
+<p>
+<pre>
+ .COVER TITLE AUTHOR COPYRIGHT MISC
+</pre>
+
+is correct, while
+<p>
+<pre>
+ .COVER TITLE AUTHOR MISC COPYRIGHT
+</pre>
+
+is not.
+<br>
+
+<a name="DOCTYPE"><h3><u>What the DOCTYPE argument means</u></h3></a>
+
+When you pass <strong>COVER</strong> or <strong>DOC_COVER</strong>
+the argument, <kbd>DOCTYPE</kbd>, it refers to the argument you
+gave to
+<a href="docprocessing.html#DOCTYPE">DOCTYPE</a>&nbsp;<kbd>NAMED</kbd>.
+For example, if, in your
+<a href="docprocessing.html#DOCSTYLE_MACROS">docstyle macros</a>
+you gave a
+<p>
+<pre>
+ .DOCTYPE NAMED "Abstract"
+</pre>
+
+the argument, <kbd>DOCTYPE</kbd>, in the <strong>COVER</strong> or
+<strong>DOC_COVER</strong> macros, would mean that you wanted the
+word, Abstract, to appear on the cover (or doc cover), just as it
+would in the
+<a href="docprocessing.html#DOCHEADER">docheader</a>.
+<br>
+
+<!---ENABLING/DISABLING--->
+
+<hr width="66%" align="left">
+<p>
+<a name="ON_OFF"></a>
+ <nobr>Macro: <strong>COVERS</strong> &lt;toggle&gt;</nobr>
+ <br>
+ <nobr>Macro: <strong>DOC_COVERS</strong> &lt;toggle&gt;</nobr>
+</a>
+<p>
+By default, if you give <strong>mom</strong> a
+<a href="#COVER">COVER</a>
+or
+<a href="#DOC_COVER">DOC_COVER</a>
+macro, she will print it. In a document that contains sections,
+articles or chapters formerly treated as &quot;one-off's&quot; but
+now being
+<a href="rectoverso.html#COLLATE_INTRO">collated</a>,
+such behaviour may not be desirable.
+<p>
+<strong>Mom</strong> lets you selectively enable or disable the
+generation of covers and/or doc covers with the toggle macros
+<strong>COVERS</strong> and <strong>DOC_COVERS</strong>. Because
+they're toggle macros, simply invoking them by themselves enables
+automatic cover (or doc cover) generation, while invoking them
+with any argument at all (<strong>OFF, QUIT, X</strong>, etc)
+disables cover (or doc cover) generation.
+<p>
+<strong>NOTE:</strong> You must place these macros prior to any
+instance of
+<a href="docprocessing.html#START">START</a>. Since they're
+&quot;on&quot; by default, there's no need to use them if you want
+covers. However, if you don't, especially in the kind of scenario
+described above, the best place to put them (most likely with an
+<strong>OFF, NO, X</strong>, etc. argument), is immediately after the
+first invocation of <strong>START</strong>. By doing so, you ensure
+they precede all subsequent instances of <strong>START</strong>.
+<p>
+
+<hr>
+<p>
+<a name="COVER_CONTROL"><h3><u>Control macros--changing the defaults for covers and document covers</u></h3></a>
+The default typographic appearance of the items on a cover (or doc
+cover) page is identical to that of the items in a
+<a href="definitions.html#TERMS_DOCHEADER">docheader</a>.
+(See
+<a href="docprocessing.html#DOCHEADER_CONTROL">How to change the look of docheaders</a>
+for a description of the defaults.)
+<p>
+<a href="docprocessing.html#COPYRIGHT">COPYRIGHT</a>
+and
+<a href="docprocessing.html#MISC">MISC</a>,
+which do not appear in docheaders, have the following default
+characteristics:
+<br>
+<ol>
+ <li>The copyright line is set in the bottom right hand corner
+ of the page, 2
+ <a href="definitions.html#TERMS_PS">point sizes</a>
+ smaller than the size of
+ <a href="definitions.html#TERMS_RUNNING">running text</a>
+ <li>The &quot;misc&quot; line is set in the bottom left hand
+ corner of the page, in the same family, font and point size
+ as the copyright line.
+</ol>
+<p>
+With the exception of the copyright and &quot;misc&quot; lines, the
+defaults for the entirety of cover (and doc cover) pages, and all
+the elements thereon, can be changed with control macros whose
+behaviour and arguments are identical to
+<a href="docprocessing.html#DOCHEADER_CONTROL_INDEX">the control macros used for docheaders</a>.
+The only difference is the name by which you invoke the control
+macro(s).
+<p>
+The complete list of cover (and doc cover) page control macros
+follows; please refer to the
+<a href="docprocessing.html#DOCHEADER_CONTROL_INDEX">docheader control macros index</a>
+in order to understand how to use them.
+<p>
+<a name="COVER_CONTROL_INDEX"><h3><u>Index of cover and doc cover control macros</u></h3></a>
+<pre>
+<a name="COVER_ADVANCE">.COVER_ADVANCE .DOC_COVER_ADVANCE</a> -+
+<a name="COVER_FAMILY">.COVER_FAMILY .DOC_COVER_FAMILY</a> | like DOCHEADER_
+<a name="COVER_LEAD">.COVER_LEAD .DOC_COVER_LEAD</a> -+
+
+.COVER_TITLE_FAMILY .DOC_COVER_TITLE_FAMILY -+
+.COVER_TITLE_FONT .DOC_COVER_TITLE_FONT | like
+.COVER_TITLE_COLOR .DOC_COVER_TITLE_COLOR | TITLE_
+.COVER_TITLE_SIZE .DOC_COVER_TITLE_SIZE -+
+
+.COVER_CHAPTER_TITLE_FAMILY .DOC_COVER_CHAPTER_TITLE_FAMILY -+
+.COVER_CHAPTER_TITLE_FONT .DOC_COVER_CHAPTER_TITLE_FONT | like
+.COVER_CHAPTER_TITLE_COLOR .DOC_COVER_CHAPTER_TITLE_COLOR | CHAPTER_TITLE_
+.COVER_CHAPTER_TITLE_SIZE .DOC_COVER_CHAPTER_TITLE_SIZE -+
+
+.COVER_SUBTITLE_FAMILY .DOC_COVER_SUBTITLE_FAMILY -+
+.COVER_SUBTITLE_FONT .DOC_COVER_SUBTITLE_FONT | like
+.COVER_SUBTITLE_COLOR .DOC_COVER_SUBTITLE_COLOR | SUBTITLE_
+.COVER_SUBTITLE_SIZE .DOC_COVER_AUTHOR_SIZE -+
+
+.COVER_ATTRIBUTE_COLOR .DOC_COVER_ATTRIBUTE_COLOR - like ATTRIBUTE_COLOR
+ - the macro, .ATTRIBUTE_STRING, controls the attribution string
+ for both docheaders and cover pages; cover pages have no
+ separate ATTRIBUTE_STRING macro
+
+.COVER_AUTHOR_FAMILY .DOC_COVER_AUTHOR_FAMILY -+
+.COVER_AUTHOR_FONT .DOC_COVER_AUTHOR_FONT | like
+.COVER_AUTHOR_COLOR .DOC_COVER_AUTHOR_COLOR | AUTHOR_
+.COVER_AUTHOR_SIZE .DOC_COVER_AUTHOR_SIZE -+
+
+.COVER_DOCTYPE_FAMILY .DOC_COVER_DOCTYPE_FAMILY -+
+.COVER_DOCTYPE_FONT .DOC_COVER_DOCTYPE_FONT | like
+.COVER_DOCTYPE_COLOR .DOC_COVER_DOCTYPE_COLOR | DOCTYPE_
+.COVER_DOCTYPE_SIZE .DOC_COVER_DOCTYPE_SIZE -+
+
+.COVER_COPYRIGHT_FAMILY .DOC_COVER_COPYRIGHT_FAMILY -+
+.COVER_COPYRIGHT_FONT .DOC_COVER_COPYRIGHT_FONT | like any
+.COVER_COPYRIGHT_COLOR .DOC_COVER_COPYRIGHT_COLOR | of the above
+.COVER_COPYRIGHT_SIZE .DOC_COVER_COPYRIGHT_SIZE -+
+.COVER_COPYRIGHT_QUAD .DOC_COVER_COPYRIGHT_QUAD
+ - the copyright quad can be either L (left) or R (right); default is left
+
+.COVER_MISC_COLOR .DOC_COVER_MISC_COLOR - like any of the above _COLOR
+.COVER_MISC_QUAD .DOC_COVER_MISC_QUAD
+ - the misc quad can be either L (left) or R (right); default is right
+</pre>
+
+<strong>Note: COVER_MISC</strong> and
+<strong>DOC_COVER_MISC</strong> have only two control macros,
+<strong>_COLOR</strong> and <strong>_QUAD</strong>. The
+family, font and size of the <kbd>MISC</kbd> argument to
+<strong>COVER</strong> or <strong>DOC_COVER</strong> are always the
+same as for <kbd>COPYRIGHT</kbd>. Should you wish the family, font
+or size to be different from <kbd>COPYRIGHT</kbd>, I suggest setting
+the type specs for <kbd>COPYRIGHT</kbd> to the ones you want for
+<kbd>MISC</kbd>, then altering them for <kbd>COPYRIGHT</kbd> using
+<a href="inlines.html#INDEX_INLINES">inline escapes</a>
+in the
+<a href="definitions.html#TERMS_STRINGARGUMENT">string argument</a>
+you pass to the macro,
+<a href="docprocessing.html#COPYRIGHT">COPYRIGHT</a>. (Of course,
+you could always do the reverse, but if you pass several arguments
+to
+<a href="docprocessing.html#MISC">MISC</a>,
+it's more likely you want to get <strong>MISC</strong> right first.)
<p>
<hr>
-<a href="letters.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="refer.html#TOP">Next</a>&nbsp;&nbsp;
<a href="rectoverso.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="#TOP">Top</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
diff --git a/contrib/groff/contrib/mom/momdoc/definitions.html b/contrib/groff/contrib/mom/momdoc/definitions.html
index be393156ecab..80542afa0395 100644
--- a/contrib/groff/contrib/mom/momdoc/definitions.html
+++ b/contrib/groff/contrib/mom/momdoc/definitions.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -10,7 +11,7 @@
<a href="using.html#TOP">Next</a>&nbsp;&nbsp;
<a href="intro.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
-
+<p>
<a name="TOP"></a>
<a name="TERMS">
<h1 align="center"><u>DEFINITIONS OF TERMS USED IN THIS MANUAL</u></h1>
@@ -26,9 +27,8 @@ I use a number of typesetting-specific and groff-specific terms
throughout this documentation, as well as a few terms that apply
to <strong>mom</strong> herself. To make life easier, I'll explain
them here. Refer back to this section should you encounter a word
-or concept you're not familiar with. Words in these definitions that
-are defined elsewhere in this section are marked with asterisks.
-<br>
+or concept you're not familiar with.
+<p>
<hr>
<a name="TERMS_TYPESETTING">
@@ -61,14 +61,16 @@ are defined elsewhere in this section are marked with asterisks.
<li><a href="#TERMS_PS">Point Size</a>
<li><a href="#TERMS_QUAD">Quad</a>
<li><a href="#TERMS_RAG">Rag</a>
+ <li><a href="#TERMS_SHAPE">Shape</a>
<li><a href="#TERMS_SOLID">Solid/set solid</a>
<li><a href="#TERMS_TRACKKERNING">Track kerning/Line kerning</a>
<li><a href="#TERMS_UNBREAKABLESPACE">Unbreakable space</a>
+ <li><a href="#TERMS_WEIGHT">Weight</a>
<li><a href="#TERMS_WORDSPACE">Word space</a>
<li><a href="#TERMS_XHEIGHT">x-height</a>
</ul>
-<dl>
+<dl>
<dt><a name="TERMS_ASCENDER"><em>Ascender</em></a>
<dd>The portion of a letter that extends above the bowl. For example,
the letters a, c, and e have no ascenders. The letters b, d, and h
@@ -79,8 +81,9 @@ do.
bowls of lower case letters rest.
<dt><a name="TERMS_BALLOTBOX"><em>Ballot box</em></a>
-<dd>An unfilled square, usually <strong>*cap-height</strong> in size,
-typically placed beside items in a checklist.
+<dd>An unfilled square, usually
+<a href="#TERMS_CAPHEIGHT">cap-height</a>
+in size, typically placed beside items in a checklist.
<dt><a name="TERMS_BULLET"><em>Bullet</em></a>
<dd>A small, filled circle typically found beside items or points in
@@ -88,12 +91,14 @@ a list.
<dt><a name="TERMS_CAPHEIGHT"><em>Cap-height</em></a>
<dd>The height of the tallest capital letter in a given
-<strong>*font</strong> at the current <strong>*point
-size</strong>.
+<a href="#TERMS_FONT">font</a>
+at the current
+<a href="#TERMS_PS">point size</a>.
<dt><a name="TERMS_DESCENDER"><em>Descender</em></a>
<dd>The portion of a letter that extends beneath the
-<strong>*baseline</strong> (j, q, y are letters with descenders).
+<a href="#TERMS_BASELINE">baseline</a>
+(j, q, y are letters with descenders).
<dt><a name="TERMS_DISCRETIONARYHYPHEN"><em>Discretionary hyphen</em></a>
<dd>A symbol inserted between two syllables of a word that indicates to a
@@ -121,25 +126,30 @@ letter until the bottom of the drop cap is reached, at which
point text reverts to the left margin.
<dt><a name="TERMS_EM"><em>Em/en</em></a>
-<dd>A relative measurement equal to the width of the letter M at a
-given <strong>*point size</strong> in a given <strong>*font</strong>.
+<dd>An em is a relative measurement equal to the width of the
+letter M at a given
+<a href="#TERMS_PS">point size</a>
+in a given
+<a href="#TERMS_FONT">font</a>.
Since most Ms are designed square, an em is usually (but sometimes
-erroneously) considered to be the same size as the current point size
-(i.e. if the point size of the type is 12, one em equals 12 points).
-An en is equal to the width of a letter N (historically 2/3 of an em,
-although groff treats an en as 1/2 of an em). Typically, ems and
-ens are used to measure indents, or to define the length of dashes
-(long hyphens).
+erroneously) considered to be the same size as the current point
+size (i.e. if the point size of the type is 12, one em equals 12
+points). An en is equal to the width of a letter N (historically
+2/3 of an em, although groff treats an en as 1/2 of an em).
+Typically, ems and ens are used to measure indents, or to define the
+length of dashes (long hyphens).
<dt><a name="TERMS_FAMILY"><em>Family</em></a>
<dd>The collective name by which a collection of
-<strong>*fonts</strong> are known, e.g. Helvetica, Times Roman,
-Garamond.
+<a href="#TERMS_FONT">fonts</a>
+are known, e.g. Helvetica, Times Roman, Garamond.
<dt><a name="TERMS_FIGURESPACE"><em>Figure space/Digit space</em></a>
-<dd>A <strong>*fixed width space</strong> that has the width of one digit. Used for
-aligning numerals in, say, columns or numbered lists. In groff,
-the figure space is entered with
+<dd>A
+<a href="#TERMS_FIXEDWIDTHSPACE">fixed width space</a>
+that has the width of one digit. Used for aligning numerals in,
+say, columns or numbered lists. In groff, the figure space is
+entered with
<p>
<pre>
\0
@@ -148,9 +158,11 @@ the figure space is entered with
(backslash followed by a zero).
<dt><a name="TERMS_FIXEDWIDTHSPACE"><em>Fixed width space</em></a>
-<dd>Equal to <strong>*word space</strong>, but does not expand or
-contract when text is <strong>*justified</strong>. In groff, fixed
-width space is entered with
+<dd>Equal to
+<a href="#TERMS_WORDSPACE">word space</a>,
+but does not expand or contract when text is
+<a href="#TERMS_JUST">justified</a>.
+In groff, fixed width space is entered with
<p>
<pre>
\&lt;space&gt;
@@ -159,17 +171,25 @@ width space is entered with
where &lt;space&gt; means "hit the spacebar on your keyboard."
<dt><a name="TERMS_FONT"><em>Font</em></a>
-<dd>The specific style of type within a <strong>*family</strong>,
-e.g. roman, italic. Groff understands four fonts within any given
-family: roman, italic, bold, and bold italic.
+<dd>The specific
+<a href="#TERMS_WEIGHT">weight</a>
+and
+<a href="#TERMS_SHAPE">shape</a>
+of type within a
+<a href="#TERMS_FAMILY">family</a>,
+e.g. light, medium, bold (which are weights), and roman, italic,
+condensed (which are shapes). By default, groff knows of four fonts
+within its default set of families: R (medium roman), I (medium
+italic), B (bold roman) and BI (bold italic).
<dt><a name="TERMS_FORCE"><em>Force justify
</em></a>
-<dd>Sometimes, in <strong>*justified</strong> text, a line needs to be
-broken short of the right margin. Force justifying means telling a
-typesetting program (like groff) that you want the line broken early
-AND that you want the line's word spacing stretched to force the line
-flush with the right margin.
+<dd>Sometimes, in
+<a href="#TERMS_JUST">justified</a>
+text, a line needs to be broken short of the right margin. Force
+justifying means telling a typesetting program (like groff) that you
+want the line broken early AND that you want the line's word spacing
+stretched to force the line flush with the right margin.
<dt><a name="TERMS_GUTTER"><em>Gutter</em></a>
<dd>The vertical whitespace separating columns of type.
@@ -179,7 +199,8 @@ flush with the right margin.
right margins. Justification is the act of making both margins flush.
Some people use the terms "left justified" and "right justified"
to mean type where only the left (or right) margins align. I don't.
-See <strong>*quad</strong>.
+See
+<a href="#TERMS_QUAD">quad</a>.
<dt><a name="TERMS_KERN"><em>Kerning</em></a>
<dd>Moving pairs of letters closer together to remove excess
@@ -187,7 +208,7 @@ whitespace between them. In the days before phototypesetting,
type was set from small, rectangular blocks of wood or metal, each
block having exactly one letter. Because the edge of each block
determined the edge of each letter, certain letter combinations (TA,
-for example) didn't fit together well and had to be morticed by hand
+for example) didn't fit together well and had to be mortised by hand
to bring them visually closer. Modern typesetting systems usually
take care of kerning automatically, but they're far from perfect.
Professional typesetters still devote a lot of time to fitting letters
@@ -195,31 +216,37 @@ and punctuation together properly.
<dt><a name="TERMS_KERNUNIT"><em>Kern Units</em></a>
<dd>A relative distance equal to 1/36 of the current
-<strong>*point size</strong>. Used between individual letters
-for <strong>*kerning</strong>. Different typesetting systems use
-different values (1/54 is popular), and sometimes call kern units by
-a different name.
+<a href="#TERMS_PS">point size</a>.
+Used between individual letters
+for
+<a href="#TERMS_KERN">kerning</a>.
+Different typesetting systems use different values (1/54 is
+popular), and sometimes call kern units by a different name.
<p>
<strong>Experts:
<br></strong>A kern unit has nothing to do with groff
machine units.
<dt><a name="TERMS_LEADING"><em>Lead/leading</em></a>
-<dd>The distance from the <strong>*baseline</strong> of one line of
-type to the line of type immediately beneath it. Pronounced "ledding."
-Also called line spacing. Usually measured in <strong>*points</strong>.
+<dd>The distance from the
+<a href="#TERMS_BASELINE">baseline</a>
+of one line of type to the line of type immediately beneath it.
+Pronounced "ledding." Also called line spacing. Usually measured
+in
+<a href="#TERMS_PICASPOINTS">points</a>.
<p>
<em>In case you're interested...</em> In previous centuries,
-lines of type were separated by thin strips of -- you guessed it
--- lead. Lines of type that had no lead between them were said to
+lines of type were separated by thin strips of--you guessed
+it--lead. Lines of type that had no lead between them were said to
be &quot;set solid.&quot; Once you began separating them with strips
of lead, they were said to be &quot;leaded&quot;, and the spacing was
-expressed in terms of the number of <strong>*points</strong> of lead.
-For this reason, &quot;leading&quot; and &quot;line spacing&quot;
-aren't, historically speaking, synonymous. If type was set 10 on 12,
-for example, the leading was 2 points, not 12. Nowadays, however,
-the two terms are used interchangeably to mean the distance from
-baseline to baseline.
+expressed in terms of the number of
+<a href="#TERMS_PICASPOINTS">points</a>
+of lead. For this reason, &quot;leading&quot; and &quot;line
+spacing&quot; aren't, historically speaking, synonymous. If type
+was set 10 on 12, for example, the leading was 2 points, not 12.
+Nowadays, however, the two terms are used interchangeably to mean
+the distance from baseline to baseline.
<dt><a name="TERMS_LEADER"><em>Leaders</em></a>
<dd>Single characters used to fill lines, usually to their end.
@@ -247,29 +274,60 @@ have always used their own system of measurement for weight (carats),
typographers have always used their own system of measurement for type.
<dt><a name="TERMS_PS"><em>Point Size</em></a>
-<dd>The nominal size of type, measured in <strong>*points</strong>,
-from the bottom of the longest <strong>*descender</strong> to the top
-of the highest <strong>*ascender</strong>. In reality, type is always
-fractionally smaller than its point size.
+<dd>The nominal size of type, measured in
+<a href="#TERMS_PICASPOINTS">points</a>
+from the bottom of the longest
+<a href="#TERMS_DESCENDER">descender</a>
+to the top of the highest
+<a href="#TERMS_ASCENDER">ascender</a>.
+In reality, type is always fractionally smaller than its point size.
<dt><a name="TERMS_QUAD"><em>Quad</em></a>
<dd>When only one margin of type is flush, lines of type are quadded in
the direction of the flush margin. Therefore, quad left means the
left margin is flush, the right isn't. Quad right means the right
-margin is flush, the left isn't. Quad center means neither the left
+margin is flush, the left isn't. Quad centre means neither the left
nor the right margin is flush; rather, lines of type are quadded on
-both sides so that type appears centered on the page.
+both sides so that type appears centred on the page.
<dt><a name="TERMS_RAG"><em>Rag</em></a>
<dd>Describes a margin that isn't flush. Rag right means the right
margin isn't flush. Rag left means the left margin isn't flush.
The expression "flush left/rag right" is sometimes used to describe
-type that is <strong>*quadded</strong> left.
+type that is
+<a href="#TERMS_QUAD">quadded</a>
+left.
+
+<dt><a name="TERMS_SHAPE"><em>Shape</em></a>
+<dd>The degree of slant and/or the width of characters.
+(Technically speaking, this is not a proper typesetting term;
+however, it may help clarify some concepts presented in these
+documents.)
+<p>
+Some typical shapes are:
+<ul>
+ <li>&quot;Roman&quot;, which has no slant, and has letterforms of
+ average width
+ <li>&quot;Italic&quot;, which is slanted, and has letterforms
+ of average width
+ <li>&quot;Condensed&quot;, which has no slant, but has
+ letterforms narrower than the average represented by Roman
+ <li>&quot;Condensed Italic&quot;, which is slanted, with letterforms narrower
+ than average
+</ul>
+The term
+<a href="#TERMS_FONT">font</a>,
+as it is used in these documents, refers to a combination of
+<a href="#TERMS_WEIGHT">weight</a>
+and shape.
<dt><a name="TERMS_SOLID"><em>Solid/set solid</em></a>
-<dd>When no <strong>*lead</strong> is added between lines of type
-(i.e. the <strong>*point size</strong> and linespacing are the
-same), the lines are said to be &quot;set solid.&quot;
+<dd>When no
+<a href="#TERMS_LEADING">lead</a>
+is added between lines of type (i.e. the
+<a href="#TERMS_PS">point size</a>
+and linespacing are the same), the lines are said to be &quot;set
+solid.&quot;
<dt><a name="TERMS_TRACKKERNING"><em>Track kerning/Line kerning</em></a>
<dd>Sometimes, it's advantageous to increase or decrease the amount of
@@ -279,10 +337,13 @@ The correct term is letter spacing, but track kerning and line kerning
(and sometimes, just "kerning") have come to mean the same thing.
<dt><a name="TERMS_UNBREAKABLESPACE"><em>Unbreakable space</em></a>
-<dd>Equal to <strong>*word space</strong>, however words separated by
-an unbreakable space will always be kept together on the same line.
-Expands and contracts like word space. Useful for proper names, which
-should never be broken. In groff, unbreakable space is entered with
+<dd>Equal to
+<a href="#TERMS_WORDSPACE">word space</a>,
+however words separated by an unbreakable space will always be kept
+together on the same line. Expands and contracts like word space.
+Useful for proper names, which one should, whenever possible, avoid
+splitting onto two lines. In groff, unbreakable space is entered
+with
<p>
<pre>
\~
@@ -290,16 +351,26 @@ should never be broken. In groff, unbreakable space is entered with
(backslash followed by a tilde).
+<dt><a name="TERMS_WEIGHT"><em>Weight</em></a>
+<dd>The thickness of the strokes of letterforms. Medium and Book
+have average thicknesses and are the weights used for most of the
+text in books, magazines, newspapers, etc. Light has strokes
+slightly thinner than Medium or Book, but is still acceptable for
+most text. Semibold, Bold, Heavy and Black all have strokes of
+increasing thickness, making them suitable for heads, subheads,
+headlines and the like.
+
<dt><a name="TERMS_WORDSPACE"><em>Word space</em></a>
<dd>The amount of whitespace between words. When text is
-<strong>*justified</strong>, word space expands or contracts to make
-the margins flush.
+<a href="#TERMS_JUST">justified</a>,
+word space expands or contracts to make the margins flush.
<dt><a name="TERMS_XHEIGHT"><em>x-height</em></a>
<dd>The height of a lower case letter x in a given font at a given
point size. Generally used to mean the average height of the bowl
of lower case letters.
</dl>
+<p>
<hr>
<a name="TERMS_GROFF">
@@ -326,20 +397,23 @@ of lower case letters.
<dl>
<dt><a name="TERMS_ALIAS"><em>Alias</em></a>
-<dd>A <strong>*macro</strong> invoked by a name different from its
-&quot;official&quot; name. For example, the official name of the
-macro to change <strong>*family</strong> is <strong>FAMILY</strong>.
-Its alias is <strong>FAM</strong>. Aliases may be created for any
-macro (via the
+<dd>A
+<a href="#TERMS_MACROS">macro</a>
+invoked by a name different from its &quot;official&quot;
+name. For example, the official name of the macro to change
+<a href="#TERMS_FAMILY">family</a>
+is <strong>FAMILY</strong>. Its alias is
+<strong>FAM</strong>. Aliases may be created for any macro (via the
<a href="goodies.html#ALIAS">ALIAS</a>
macro) provided the alias uses a name not already taken
by the <strong>mom</strong> macros or one of the groff
-<strong>*primitives</strong>. For a complete list of alias names
-you must not use, see the
+<a href="#TERMS_PRIMITIVES">primitives</a>.
+For a complete list of words or names you must not use, see the
<a href="reserved.html#RESERVED">list of reserved words</a>.
<dt><a name="TERMS_ARGUMENTS"><em>Arguments</em></a>
-<dd>Parameters or information needed by a <strong>*macro</strong>
+<dd>Parameters or information needed by a
+<a href="#TERMS_MACROS">macro</a>
to do its job. For example, in the macro
<p>
<pre>
@@ -356,32 +430,42 @@ LEFT is the argument. Arguments are separated from macros by spaces.
Some macros require several arguments; each is separated by a space.
<dt><a name="TERMS_COMMENTLINES"><em>Comment Lines</em></a>
-<dd><strong>*Input lines</strong> introduced with the comment character
+<dd><a href="#TERMS_INPUTLINE">Input lines</a>
+introduced with the comment character
<p>
<pre>
\#
</pre>
-When processing output, groff silently ignores everything on the
-line after the comment character.
+When processing output, groff silently ignores everything on a
+line that begins with the comment character.
<dt><a name="TERMS_CONTROLLINES"><em>Control Lines</em></a>
<dd>Instructions to groff that appear on a line by themselves,
which means that &quot;control lines&quot; are either
-<strong>*macros</strong> or <strong>*groff primitives</strong>.
+<a href="#TERMS_MACROS">macros</a>
+or groff
+<a href="#TERMS_PRIMITIVES">primitives</a>.
Control lines begin with a period or, occasionally, an apostrophe.
<dt><a name="TERMS_FILLED"><em>Filled lines/fill mode</em></a>
-<dd>Automatic <strong>*justification</strong> or
-<strong>*quadding</strong>. In fill mode, the ends of lines as they
-appear in your text editor are ignored. Instead, words from adjoining
-<strong>*input lines</strong> are added one at a time to the output
-line until no more words fit. Then, depending whether text is to
-be <strong>*justified</strong> or <strong>*quadded</strong> (left,
-right, or center), and depending on whether automatic hyphenation
-is turned on, groff attempts to hyphenate the last word, or, barring
-that, spreads and breaks the line (when justification is turned on) or
-breaks and quads the line (when quadding is turned on).
+<dd>Automatic
+<a href="#TERMS_JUST">justification</a>
+or
+<a href="#TERMS_QUAD">quadding</a>.
+In fill mode, the ends of lines as they appear in your text editor
+are ignored. Instead, words from adjoining
+<a href="#TERMS_INPUTLINE">input lines</a>
+are added one at a time to the output line until no more words fit.
+Then, depending whether text is to be
+<a href="#TERMS_JUST">justified</a>
+or
+<a href="#TERMS_QUAD">quadded</a>
+(left, right, or centre), and depending on whether automatic
+hyphenation is turned on, groff attempts to hyphenate the last word,
+or, barring that, spreads and breaks the line (when justification
+is turned on) or breaks and quads the line (when quadding is turned
+on).
<p>
<a name="TERMS_NOFILL"></a>
Nofill mode (non-filled text) means that groff respects the ends
@@ -389,25 +473,30 @@ of lines as they appear in your text editor.
<dt><a name="TERMS_INLINES"><em>Inline escapes</em></a>
<dd>Instructions issued to groff that appear as part of an
-<strong>*input line</strong> (as opposed to <strong>*macros</strong>,
-which must appear on a line by themselves). Inline escapes are always
-introduced by the backslash character. For example,
+<a href="#TERMS_INPUTLINE">input line</a>
+(as opposed to
+<a href="#TERMS_MACROS">macros</a>,
+which must appear on a line by themselves). Inline escapes are
+always introduced by the backslash character. For example,
<p>
<pre>
A line of text with the word T\*[BU 2]oronto in it
</pre>
contains the inline escape \*[BU 2] (which means &quot;move the letter
-'o' 2 <strong>*kern units</strong> closer to the letter 'T'&quot;).
+'o' 2
+<a href="#TERMS_KERNUNIT">kern units</a>
+closer to the letter 'T'&quot;).
<p>
<strong>Mom</strong>'s inline escapes always take the form
<strong>\*[</strong><i>ESCAPE</i><strong>]</strong>, where <i>ESCAPE</i>
is composed of capital letters, sometimes followed immediately
-by a digit, sometimes followed by a space and a <strong>*numeric
-argument</strong>. <strong>Groff</strong>'s escapes begin with the
-backslash character but typically have no star and are in lower case.
-For example, the <strong>mom</strong> escapes to move forward 6 points
-on a line are either
+by a digit, sometimes followed by a space and a
+<a href="#TERMS_NUMERICARGUMENT">numeric argument</a>.
+<strong>Groff</strong>'s escapes begin with the backslash character
+but typically have no star and are in lower case. For example, the
+<strong>mom</strong> escapes to move forward 6 points on a line are
+either
<p>
<pre>
\*[FP6]&nbsp;&nbsp;or&nbsp;&nbsp;\*[FWD 6p]
@@ -426,20 +515,26 @@ while the <strong>groff</strong> escape for the same thing is
<dd>Instructions embedded in a document that determine how groff processes
the text for output. <strong>mom</strong>'s macros always begin with a
period, on a line by themselves, and must be typed in capital letters.
-Typically, macros contain complex commands issued to groff -- behind
-the scenes -- via groff <strong>*primitives</strong>.
+Typically, macros contain complex commands issued to groff--behind
+the scenes--via groff
+<a href="#TERMS_PRIMITIVES">primitives</a>.
<dt><a name="TERMS_UNITS"><em>Machine units</em></a>
-<dd>A machine unit is 1/1000 of a <strong>*point</strong> when the
-groff device is ps. (&quot;ps&quot; means &quot;PostScript&quot; --
-the default device for which groff prepares output, and the device for
-which <strong>mom</strong> was specifically designed.)
+<dd>A machine unit is 1/1000 of a
+<a href="#TERMS_PICASPOINTS">point</a>
+when the groff device is ps. (&quot;ps&quot; means
+&quot;PostScript&quot;--the default device for which groff
+prepares output, and the device for which <strong>mom</strong> was
+specifically designed.)
<dt><a name="TERMS_NUMERICARGUMENT"><em>Numeric argument</em></a>
-<dd>An <strong>*argument</strong> that has the form of a digit.
-Numeric arguments can be built out of arithmetic expressions using
-+, -, *, and / for plus, minus, times, and divided-by respectively.
-If a numeric argument requires a <strong>*unit of measure</strong>,
+<dd>An
+<a href="#TERMS_ARGUMENT">argument</a>
+that has the form of a digit. Numeric arguments can be built out
+of arithmetic expressions using +, -, *, and / for plus, minus,
+times, and divided-by respectively. If a numeric argument requires
+a
+<a href="#TERMS_UNITOFMEASURE">unit of measure</a>,
a unit of measure must be appended to <em>every</em> digit in the
argument. For example:
<p>
@@ -461,9 +556,12 @@ or minus sign when using <strong>mom</strong>'s macros is slim.
native command language, and out of which macros are built.
<dt><a name="TERMS_STRINGARGUMENT"><em>String Argument</em></a>
-<dd>Technically, any <strong>*argument</strong> that is not numeric.
-In this documentation, string argument means an argument that requires
-the user to input text. For example, in the <strong>*macro</strong>
+<dd>Technically, any
+<a href="#TERMS_ARGUMENTS">argument</a>
+that is not numeric. In this documentation, string argument means
+an argument that requires the user to input text. For example, in
+the
+<a href="#TERMS_MACROS">macro</a>
<p>
<pre>
.TITLE "My Pulitzer Novel"
@@ -473,21 +571,22 @@ the user to input text. For example, in the <strong>*macro</strong>
<p>
Because string arguments must be enclosed by double-quotes, you can't
use double-quotes as part of the string argument. If you need
-double-quotes to be part of a string argument, use the <strong>*inline
-escapes</strong> <strong> \(lq</strong> and <strong>\(rq</strong>
-(leftquote and rightquote respectively) in place of the double-quote
-character (").
+double-quotes to be part of a string argument, use the
+<a href="#TERMS_INLINES">inline escapes</a>
+<strong>\(lq</strong> and <strong>\(rq</strong> (leftquote and rightquote
+respectively) in place of the double-quote character (").
<dt><a name="TERMS_UNITOFMEASURE"><em>Unit of measure</em></a>
-<dd>The single letter after a <strong>*numeric argument</strong>
+<dd>The single letter after a
+<a href="#TERMS_NUMERICARGUMENT">numeric argument</a>
that tells <strong>mom</strong> what measurement scale the argument
-should use. Commonly valid units are:
+should use. Common valid units are:
<p>
<table valign="baseline" summary="unitsofmeasure">
<tr><td><strong>i</strong><td> = <td>inches
<tr><td><strong>p</strong><td> = <td>points
<tr><td><strong>P</strong><td> = <td>picas
-<tr><td><strong>c</strong><td> = <td>centimeters
+<tr><td><strong>c</strong><td> = <td>centimetres
<tr><td><strong>m</strong><td> = <td>ems
<tr><td><strong>n</strong><td> = <td>ens
<tr><td><strong>v</strong><td> = <td>the current leading (line space)</td></tr>
@@ -510,7 +609,8 @@ that set the size or measure of something MUST be given a unit of
measure. <strong>mom</strong>'s macros do not have default units
of measure. There are a couple of exceptions, the most notable of
which are <strong>PT_SIZE</strong> and <strong>LS</strong>. Both use
-<strong>*points</strong> as the default unit of measure, which means
+<a href="#TERMS_PICASPOINTS">points</a>
+as the default unit of measure, which means
you don't have to append &quot;p&quot; to their argument.
<p>
You can enter decimal values for any unit of measure. Different units
@@ -523,10 +623,15 @@ and 5 points. If you want 12 picas and 5 points, you have to
enter the measure as 12P+5p.
<dt><a name="TERMS_ZEROWIDTHCHARACTER"><em>Zero-width character</em></a>
-<dd>The <strong>*inline escape</strong> that allows you to print a
-literal period, apostrophe and, if <strong>*output lines</strong>
-are <strong>*filled</strong>, a space that falls at the beginning of
-an <strong>*input line</strong>. It looks like this:
+<dd>The
+<a href="#TERMS_INLINES">inline escape</a>
+that allows you to print a literal period, apostrophe and, if
+<a href="#TERMS_OUTPUTLINE">output lines</a>
+are
+<a href="#TERMS_FILLED">filled</a>,
+a space that falls at the beginning of an
+<a href="#TERMS_INPUTLINE">input line</a>.
+It looks like this:
<p>
<pre>
\&amp;
@@ -535,15 +640,17 @@ an <strong>*input line</strong>. It looks like this:
(backslash followed by an ampersand).
<p>
Normally, groff interprets a period (or an apostrophe) at the beginning
-of an input line as meaning that what follows is a <strong>*control
-line</strong>. In fill modes, groff treats a space at the beginning
-of an input line as meaning &quot;start a new line and put a space
-at the beginning of it.&quot; If you want groff to interpret periods
-and apostrophes at the beginning of input lines literally (ie. print
+of an input line as meaning that what follows is a
+<a href="#TERMS_CONTROLLINES">control line</a>.
+In fill modes, groff treats a space at the beginning of an input
+line as meaning &quot;start a new line and put a space at the
+beginning of it.&quot; If you want groff to interpret periods and
+apostrophes at the beginning of input lines literally (i.e. print
them), or spaces at the beginning of input lines as just garden
variety word spaces, you must start the line with the zero-width
character.
</dl>
+<p>
<hr>
<a name="TERMS_MOM">
@@ -567,16 +674,19 @@ character.
</ul>
<dl>
<dt><a name="TERMS_BLOCKQUOTE"><em>Blockquote</em></a>
-<dd>Cited material other than <strong>*quotes</strong>.
+<dd>Cited material other than
+<a href="#TERMS_QUOTE">quotes</a>.
Typically set at a smaller point size than paragraph text, indented
from the left and right margins. Blockquotes are
-<strong>*filled</strong>.
+<a href="#TERMS_FILLED">filled</a>.
<dt><a name="TERMS_CONTROLMACRO"><em>Control macro</em></a>
<dd>Macros used in
<a href="docprocessing.html#DOCPROCESSING">document processing</a>
to control/alter the appearance of document elements (e.g. heads,
-quotes, footnotes, <strong>*headers</strong>, etc.).
+quotes, footnotes,
+<a href="#TERMS_HEADER">headers</a>,
+etc.).
<dt><a name="TERMS_DOCHEADER"><em>Document header/docheader</em></a>
<dd>Document information (title, subtitle, author, etc) output
@@ -590,7 +700,7 @@ beginning of a chapter, story, or other document.
<dd>Document information (frequently author and title) output in
the bottom margin of pages <em>after</em> page one. Not to be
confused with footnotes, which are considered part of
-<strong>*running text</strong>.
+<a href="#TERMS_RUNNING">running text</a>.
<dt><a name="TERMS_HEAD"><em>Head</em></a>
<dd>A title that introduces a major section of a document.
@@ -600,20 +710,23 @@ confused with footnotes, which are considered part of
the top margin of pages <em>after</em> page one.
<p>
<strong>NOTE:</strong> In terms of content and style, headers and
-<strong>*footers</strong> are the same; they differ only in their
-placement on the page. In most places in this documentation,
-references to the content or style of headers applies equally to
-footers.
+<a href="#TERMS_FOOTER">footers</a>
+are the same; they differ only in their placement on the page. In
+most places in this documentation, references to the content or
+style of headers applies equally to footers.
<dt><a name="TERMS_LINEBREAK"><em>Linebreak/author linebreak</em></a>
-<dd>A horizontal gap in <strong>*running text</strong>, frequently
-set off by typographic symbols such as asterisks or daggers. Used to
-indicate a shift in the content of a document (e.g. a scene change in a
-short story).
+<dd>A horizontal gap in
+<a href="#TERMS_RUNNING">running text</a>,
+frequently set off by typographic symbols such as asterisks or
+daggers. Used to indicate a shift in the content of a document
+(e.g. a scene change in a short story). Also commonly called a
+scene break or a section break.
<dt><a name="TERMS_PARAHEAD"><em>Paragraph head</em></a>
<dd>A title joined to the body of a paragraph; hierarchically one
-level beneath <strong>*subheads</strong>.
+level beneath
+<a href="#TERMS_SUBHEAD">subheads</a>.
<dt><a name="TERMS_QUOTE"><em>Quote</em></a>
<dd>A quote, to <strong>mom</strong>, is a line-for-line setting
@@ -625,14 +738,16 @@ with quotes.
<dt><a name="TERMS_RUNNING"><em>Running text</em></a>
<dd>In a document formatted with <strong>mom</strong>, running
text means text that forms the body of the document, including
-elements such as heads and subheads. <strong>*Docheaders,
-*headers, *footers</strong> and page numbers are NOT part of
-running text.
+elements such as heads and subheads.
+<a href="#TERMS_DOCHEADER">Docheaders</a>,
+<a href="#TERMS_HEADER">headers</a>,
+<a href="#TERMS_FOOTER">footers</a>
+and page numbers are NOT part of running text.
<dt><a name="TERMS_SUBHEAD"><em>Subhead</em></a>
<dd>A title used to introduce secondary sections of a document;
hierarchically one level beneath sections introduced by
-<strong>*heads</strong>.
+<a href="#TERMS_HEAD">heads</a>.
<dt><a name="TERMS_TOGGLE"><em>Toggle</em></a>
<dd>A macro or tag that, when invoked without an argument,
diff --git a/contrib/groff/contrib/mom/momdoc/docelement.html b/contrib/groff/contrib/mom/momdoc/docelement.html
index e1db2ab8b919..13a1e0eeeb10 100644
--- a/contrib/groff/contrib/mom/momdoc/docelement.html
+++ b/contrib/groff/contrib/mom/momdoc/docelement.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -10,10 +11,10 @@
<a href="headfootpage.html#TOP">Next</a>&nbsp;&nbsp;
<a href="docprocessing.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
-
+<p>
<a name="TOP"></a>
<a name="DOCELEMENT">
- <h2 align="center"><u>THE DOCUMENT ELEMENT TAGS</u></h2>
+ <h1 align="center"><u>THE DOCUMENT ELEMENT TAGS</u></h1>
</a>
<ul>
@@ -54,16 +55,17 @@ she does things. This is usually done prior to
but can, in fact, be done at any time in the course of a document.
Any change to a tag's style affects all subsequent invocations of
the tag.
+<p>
<a name="DOCELEMENT_CONTROL"><h3><u>Control macros -- changing defaults</u></h3></a>
<p>
The control macros for document processing tags let you
&quot;design&quot; the look of all the parts of your documents --
-should you wish. At a bare minimum, all tags have macros to
-change <strong>mom</strong>'s defaults for family, font
-and point size. Where appropriate, there are macros to control
-leading, indents and quad as well.
+should you wish. At a bare minimum, all tags have macros to change
+<strong>mom</strong>'s defaults for family, font, point size and
+colour. Where appropriate, there are macros to control leading,
+indents and quad as well.
<p>
In addition, many tags have special macros to control features that
are pertinent to those tags alone. Have a look at the section dealing
@@ -88,8 +90,8 @@ Equally,
can be used in tags that take
<a href="definitions.html#TERMS_STRINGARGUMENT">string arguments.</a>
<p>
-<strong>IMPORTANT NOTE:</strong> The family, font, point size and
-leading control macros have no effect in
+<strong>IMPORTANT NOTE:</strong> The family, font, point size,
+colour and leading control macros have no effect in
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>,
which sets EVERYTHING in Courier roman, 12/24 (i.e. 12-point type on
a linespace of 24 points).
@@ -101,7 +103,7 @@ unless a default for <strong>TYPEWRITE</strong> is also given.
<p>
<strong>A WORD OF ADVICE:</strong> Get familiar with
<strong>mom</strong> at her default settings before exploring the
-control macros. Put her through her paces. She how she behaves.
+control macros. Put her through her paces. See how she behaves.
Get to know what she feels like and how she looks, both in your text
editor and on the printed page. Then, if you don't like something,
use this documentation to find the precise macro you need to change it.
@@ -109,6 +111,7 @@ There are tons of control macros. Reading up on them and trying to
remember them all might lead you to think that <strong>mom</strong>
is complex and unwieldy, which is not only untrue, but would offend
her mightily.
+<p>
<a name="CONTROL_MACRO_ARGS"><h3><u>Arguments to the control macros</u></h3></a>
@@ -137,6 +140,22 @@ There's no need for a
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
with the <strong>_SIZE</strong> control macros; points is assumed.
+<h3>Colour</h3>
+Control macros that end in <strong>_COLOR</strong> take as their
+argument a colour name pre-defined (or &quot;initialized&quot;)
+with
+<a href="color.html#NEWCOLOR">NEWCOLOR</a>
+or
+<a href="color.html#XCOLOR">XCOLOR</a>.
+For example, if you want your heads to be red, once you've defined
+or initialized the color, red,
+<p>
+<pre>
+ .HEAD_COLOR red
+</pre>
+
+will turn your heads red.
+
<h3>Lead/linespacing</h3>
Control macros that end in <strong>_AUTOLEAD</strong> take the
same argument as
@@ -158,7 +177,7 @@ one point greater than the footnote's point size), do
.FOOTNOTE_AUTOLEAD 1
</pre>
-<a name="CONTROL_INDENTS"><h3>Indents</h3></a>
+<h3><a name="CONTROL_INDENTS">Indents</a></h3>
Except for <strong>PARA_INDENT</strong>, the argument to the control
macros that end
in <strong>_INDENT</strong> is always a single digit (whole numbers
@@ -172,7 +191,8 @@ correct indent for a particular tag.
Control macros that end in <strong>_QUAD</strong> take the same
arguments as
<a href="typesetting.html#QUAD">QUAD</a>.
-
+<p>
+<hr>
<a name="INDEX_DOCELEMENT"><h3><u>Document element tags list</u></h3></a>
<ul>
@@ -201,10 +221,11 @@ arguments as
<li><a href="#PARAHEAD">PARAHEAD</a>
<li><a href="#PARAHEAD_CONTROL">Parahead control</a>
</ul>
- <li><a href="#LINEBREAK_INTRO">Linebreaks (author linebreaks)</a>
+ <li><a href="#LINEBREAK_INTRO">Linebreaks (author linebreaks, section breaks)</a>
<ul>
<li><a href="#LINEBREAK">LINEBREAK</a>
<li><a href="#LINEBREAK_CHAR">Linebreak character</a>
+ <li><a href="#LINEBREAK_COLOR">Linebreak colour</a>
</ul>
<li><a href="#QUOTE_INTRO">Quotes (line for line)</a>
<ul>
@@ -216,6 +237,19 @@ arguments as
<li><a href="#BLOCKQUOTE">BLOCKQUOTE</a>
<li><a href="#BLOCKQUOTE_CONTROL">Blockquote control</a>
</ul>
+ <li><a href="#LIST_INTRO">Nested lists</a>
+ <ul>
+ <li><a href="#LIST">LIST</a>
+ <ul>
+ <li><a href="#ITEM">ITEM</a>
+ </ul>
+ <li><a href="#LIST_CONTROL">List control</a>
+ </ul>
+ <li><a href="#NUMBER_LINES_INTRO">Line numbering</a>
+ <ul>
+ <li><a href="#NUMBER_LINES">NUMBER_LINES</a>
+ <li><a href="#NUMBER_LINES_CONTROL">Control macros</a> (for QUOTE and BLOCKQUOTE)
+ </ul>
<li><a href="#FOOTNOTE_INTRO">Footnotes</a>
<ul>
<li><a href="#FOOTNOTE">FOOTNOTE</a>
@@ -226,10 +260,33 @@ arguments as
<li><a href="#ENDNOTE">ENDNOTE</a>
<li><a href="#ENDNOTE_CONTROL">Endnote control</a>
</ul>
+ <li><a href="#MARGIN_NOTES_INTRO">Margin notes</a>
+ <ul>
+ <li><a href="#MN_INIT">MN_INIT</a> -- initialize margin notes
+ <li><a href="#MN">MN</a> -- start and end a margin note
+ </ul>
+ <li><a href="refer.html#TOP">Bibliographies and references</a>
+ <ul>
+ <li><a href="refer.html#REF">REF</a>
+ <li><a href="refer.html#ENDNOTE_REFS">ENDNOTE_REFS</a>
+ <li><a href="refer.html#FOOTNOTE_REFS">FOOTNOTE_REFS</a>
+ <li><a href="refer.html#BRACKET_REFS">Embedded references</a>
+ <li><a href="refer.html#BIBLIOGRAPHY">BIBLIOGRAPHY</a>
+ <li><a href="refer.html#BIBLIOGRAPHY_TYPE">BIBLIOGRAPHY_TYPE</a>
+ </ul>
+ <li><a href="#BLANK_PAGE_TITLE">Blank pages</a>
+ <li><a href="#TOC_INTRO">Table of contents</a>
+ <ul>
+ <li><a href="#TOC">TOC</a>
+ <li><a href="#TOC_CONTROL">Table of contents control</a>
+ </ul>
<li><a href="#FINIS_INTRO">Document termination</a>
<ul>
- <li><a href="#FINIS">FINIS</a>
- <li><a href="#FINIS_STRING">Finis control</a> -- changing the FINIS string
+ <li><a href="#FINIS">FINIS (Document termination)</a>
+ </ul>
+ <ul>
+ <li><a href="#FINIS_STRING">Changing the FINIS string</a>
+ <li><a href="#FINIS_COLOR">Changing the FINIS colour</a>
</ul>
</ul>
<hr>
@@ -244,24 +301,24 @@ arguments as
</ul>
<p>
<a href="definitions.html#TERMS_EPIGRAPH">Epigraphs</a>
-color, flavour, or comment on the document they precede. Typically,
-they are centered at the top of a document's first page (underneath the
+colour, flavour, or comment on the document they precede. Typically,
+they are centred at the top of a document's first page (underneath the
title) and set in a smaller point size than that of paragraph text.
<p>
-By default, <strong>mom</strong> sets epigraphs centered and
+By default, <strong>mom</strong> sets epigraphs centred and
<a href="definitions.html#TERMS_NOFILL">unfilled</a>;
this lets you input them on a line for line basis. This behaviour
can be changed to accomodate
<a href="definitions.html#TERMS_FILLED">filled</a>
epigraph &quot;blocks.&quot;
-<br>
+<p>
<!---EPIGRAPH--->
<hr width="66%" align="left">
<p>
<a name="EPIGRAPH">
- Macro: <strong>EPIGRAPH</strong> <var>&lt;toggle&gt; | [ BLOCK ]</var></a>
+ <nobr>Macro: <strong>EPIGRAPH</strong> &lt;toggle&gt; | [ BLOCK ]</a></nobr>
</a>
<p>
@@ -298,6 +355,7 @@ want quotes or cited text, use
<a href="#QUOTE">QUOTE</a>
or
<a href="#BLOCKQUOTE">BLOCKQUOTE</a>.
+<p>
<a name="EPIGRAPH_CONTROL"><h3><u>Epigraph control macros</u></h3></a>
<p>
@@ -308,6 +366,7 @@ See
.EPIGRAPH_FAMILY default = prevailing document family; default is Times Roman
.EPIGRAPH_FONT default = roman
.EPIGRAPH_SIZE default = -1.5 (points)
+.EPIGRAPH_COLOR default = black
.EPIGRAPH_AUTOLEAD default = 2 points
(The next two apply to &quot;block&quot; style epigraphs only)
@@ -337,7 +396,7 @@ and indent appropriate to where you are in your document are taken
care of automatically.
<p>
By default, <strong>mom</strong> does not indent the first paragraph
-of a document, nor paragraphs that fall imediately after
+of a document, nor paragraphs that fall immediately after
<a href="#HEAD_INTRO">heads</a>
or
<a href="#SUBHEAD_INTRO">subheads</a>.
@@ -361,7 +420,7 @@ will break these one-liners -- if they fall at the bottom of the page
-- to a new page, which is not what you want.
<p>
<strong>TIP:</strong> The last thing you want while you're writing
-and editing drafts of a document (particulary stories and chapters)
+and editing drafts of a document (particularly stories and chapters)
is a text file cluttered up with <strong>PP</strong>'s. The visual
interruption in the flow of text is a serious obstacle to creativity
and critiquing.
@@ -385,7 +444,7 @@ that blank lines should be interpreted as <strong>PP</strong>'s.
.blm PP
</pre>
tells groff that all blank lines are really the macro <strong>PP</strong>.
-<br>
+<p>
<!---PP--->
@@ -416,14 +475,16 @@ element tags.
<ol>
<li><a href="#PP_FAMILY">Family control</a>
<li><a href="#PP_FONT">Font control</a>
+ <li><a href="#PP_COLOR">Paragraph colour</a>
<li><a href="#PP_LEADING">Leading/linespacing control</a>
<li><a href="#PP_JUST_QUAD">Justification/quad control</a>
<li><a href="#PARA_INDENT">First-line indent control</a>
- <li><a href="#PARA_INDENT_FIRST">Intitial paragraphs indent control</a>
+ <li><a href="#PARA_INDENT_FIRST">Initial paragraphs indent control</a>
<li><a href="#PP_SPACE">Paragraph spacing control</a>
</ol>
<a name="PP_FAMILY"><h3><u>1. Family</u></h3></a>
+<p>
The paragraph
<a href="definitions.html#TERMS_FAMILY">family</a>
is set with
@@ -442,8 +503,10 @@ to differ from the prevailing document family.
<p>
<strong>Mom</strong>'s default paragraph (and document) family
is Times Roman.
+<p>
<a name="PP_FONT"><h3><u>2. Font -- PP_FONT</u></h3></a>
+<p>
To change the
<a href="definitions.html#TERMS_FONT">font</a>
used in regular text paragraphs, use <code>.PP_FONT</code>,
@@ -460,8 +523,60 @@ remain at their default setting (medium roman) unless you change them
with the appropriate control macros.
<p>
<strong>Mom</strong>'s default paragraph font is medium roman.
+<p>
+
+<a name="PP_COLOR"><h3><u>3. Paragraph colour</u></h3></a>
+<p>
+<strong>Mom</strong> has no special control macro for colourizing
+paragraphs. If you wish a colourized paragraph, you must use the
+macro,
+<a href="color.html#COLOR">COLOR</a>,
+or the
+<a href="definitions.html#TERMS_INLINE">inline escape</a>,
+<a href="color.html#COLOR_INLINE">\*[&lt;colorname&gt;]</a>,
+<em>after</em> <strong>.PP</strong>. The colour must be one
+pre-defined (or &quot;initialized&quot;) with
+<a href="color.html#NEWCOLOR">NEWCOLOR</a>
+or
+<a href="color.html#XCOLOR">XCOLOR</a>.
+<p>
+Please note that unless you change the colour back to it's default
+(usually black) at the end of the paragraph, all subsequent
+paragraphs will be set in the new colour, although most other
+elements of your document will continue to be set in the default
+colour (usually black).
+<p>
+For example, assuming you have defined the colour, blue,
+<p>
+<pre>
+ .PP
+ .COLOR blue
+ &lt;first paragraph&gt;
+ .HEAD "Monty Python"
+ .SUBHEAD "The Origins of Spam"
+ .PP
+ &lt;second paragraph&gt;
+</pre>
-<a name="PP_LEADING"><h3><u>3.Leading</u></h3></a>
+the first paragraph will be blue, the head and subhead will be in
+the document's default colour (usually black), and the second
+paragraph will be in blue.
+<p>
+The one document element that is affected by changing the colour
+of paragraphs are
+<a href="#PARAHEAD">paraheads</a>,
+since they are attached directly to the body of paragraphs. In
+other words, if you change the colour of a paragraph and do not
+reset the paragraph colour back to its default, subsequent paraheads
+will appear in the same colour as your paragraphs unless you have
+explicitly told <strong>mom</strong> you want a pre-defined (or
+&quot;initialized&quot;) color (usually black) for your paraheads.
+<p>
+See the footnote to
+<a href="#PARAHEAD_COLOR">.PARAHEAD_COLOR</a>.
+
+<a name="PP_LEADING"><h3><u>4. Leading</u></h3></a>
+<p>
The paragraph
<a href="definitions.html#TERMS_LEADING">leading</a>
is set with
@@ -483,19 +598,25 @@ EVERY paragraph whose leading you wish to change.
<strong>HYPER-IMPORTANT NOTE:</strong> It is extremely unwise to change
paragraph leading with <strong>LS</strong>, as it will, in all cases,
screw up <strong>mom</strong>'s ability to balance the bottom margin
-of pages.
+of pages. Should you absolutely need to change paragraph leading
+with <strong>LS</strong>, and subsequently want <strong>mom</strong>
+to get back on the right leading track, use the
+<a href="docprocessing.html#SHIM">SHIM</a>
+macro.
<p>
<strong>Mom</strong>'s default paragraph leading (document leading)
is 16 points, adjusted to fill the page.
+<p>
-<a name="PP_JUST_QUAD"><h3><u>4. Justification/quad</u></h3></a>
+<a name="PP_JUST_QUAD"><h3><u>5. Justification/quad</u></h3></a>
+<p>
The justification/quad-direction of regular text paragraphs (i.e.
<a href="definitions.html#TERMS_JUST">justified</a>,
or
<a href="definitions.html#TERMS_FILLED">filled</a>
and
<a href="definitions.html#TERMS_QUAD">quadded</a>
-left/right/center) is set with
+left/right/centre) is set with
<a href="typesetting.html#JUSTIFY">JUSTIFY</a>
or
<a href="typesetting.html#QUAD">QUAD</a>
@@ -524,12 +645,17 @@ Only the paragraph in question gets justified or quadded
differently; subsequent paragraphs remain unaffected.
<p>
<strong>Mom</strong>'s default justification/quad-direction for
-paragraphs is justified for
-<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE_TYPESET</a>
-and quad left for
-<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE_TYPEWRITE</a>.
-
-<a name="PARA_INDENT"><h3><u>5. First-line indent -- PARA_INDENT</u></h3></a>
+paragraphs is
+<br>
+<ul>
+ <li>justified, for
+ <a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE_TYPESET</a>
+ <li>quad left, for
+ <a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE_TYPEWRITE</a>
+</ul>
+<p>
+<a name="PARA_INDENT"><h3><u>6. First-line indent -- PARA_INDENT</u></h3></a>
+<p>
The first-line indent of paragraphs is controlled by
<strong>PARA_INDENT</strong>, which takes one argument: the size
of the indent. <strong>PARA_INDENT</strong> may be used before
@@ -551,7 +677,7 @@ paragraphs, <strong>PARA_INDENT</strong> also affects
<a href="#QUOTE_INTRO">quotes</a>
and
<a href="#BLOCKQUOTE_INTRO">blockquotes</a>,
-whose overal indenting from the left and (where applicable) right
+whose overall indenting from the left and (where applicable) right
margins is relative to <strong>PARA_INDENT</strong>. Furthermore, the
first-line indent of paragraphs within these document elements (as well
as footnotes) is also relative to <strong>PARA_INDENT</strong> (always
@@ -562,8 +688,10 @@ ems for
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE_TYPESET</a>
and 3 picas (1/2 inch) for
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE_TYPEWRITE</a>.
+<p>
-<a name="PARA_INDENT_FIRST"><h3><u>6. Indenting initial paragraphs -- INDENT_FIRST_PARAS</u></h3></a>
+<a name="PARA_INDENT_FIRST"><h3><u>7. Indenting initial paragraphs -- INDENT_FIRST_PARAS</u></h3></a>
+<p>
By default, <strong>mom</strong> does not indent the first paragraph
of a document, nor the first paragraph after a head or
subhead, nor the first paragraphs of
@@ -582,8 +710,10 @@ before or after
passing it any argument (<strong>OFF, QUIT, Q, X</strong>...) cancels
its effect, meaning that first paragraphs will once again NOT be
indented.
+<p>
-<a name="PP_SPACE"><h3><u>7. Spacing paragraphs -- PARA_SPACE</u></h3></a>
+<a name="PP_SPACE"><h3><u>8. Spacing paragraphs -- PARA_SPACE</u></h3></a>
+<p>
By default, <strong>mom</strong> does not insert a blank line
between paragraphs. If you would like her to do so, invoke the
macro <code>.PARA_SPACE</code> with no argument, either
@@ -593,6 +723,27 @@ before or after
it any argument (<strong>OFF, QUIT, Q, X</strong>...) cancels its
effect, meaning that paragraphs will once again NOT be separated by
a blank line.
+<p>
+<strong>NOTE:</strong> If <strong>PARA_SPACE</strong> is on,
+<strong>mom</strong> spaces only those paragraphs that come after
+an &quot;initial&quot; paragraph. Initial paragraphs are those
+that come immediately after the
+<a href="definitions.html#TERMS_DOCHEADER">docheader</a>,
+<a href="#EPIGRAPH_INTRO">epigraphs</a>,
+<a href="#HEAD_INTRO">heads</a>,
+<a href="#SUBHEAD_INTRO">subheads</a>
+and
+<a href="#LINEBREAK_INTRO">linebreaks</a>.
+(The first paragraph after these document elements requires no
+blank line to separate it from other paragraphs.)
+<p>
+Sometimes, you can be fairly deep into a document before using
+<strong>.PP</strong> for the first time, and when you do, because
+<strong>mom</strong> is still waiting for that &quot;initial&quot;
+paragraph, she doesn't space it with a blank line, even though
+you expect her to. The simple workaround for this is to invoke
+<strong>.PP</strong> <em>twice</em> (in succession) at the point you
+expect the blank line to appear.
<br>
<hr>
@@ -613,21 +764,21 @@ hierarchically in numbered
and
<a href="#PARAHEAD_INTRO">paraheads</a>.
<p>
-By default, heads are centered on the page, underlined,
+By default, heads are centred on the page, underlined,
all in caps. A double linespace precedes each head. In <a
href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPESET</a>, heads
are bold, slightly larger than paragraph text.
<p>
If these defaults don't suit you, you can change them with the
head control macros.
-<br>
+<p>
<!---HEAD--->
<hr width="66%" align="left">
<p>
<a name="HEAD">
- Macro: <strong>HEAD</strong> <var>&quot;&lt;text of head&gt;&quot; [ &quot;&lt;2nd line&gt;&quot; [ &quot;&lt;3rd line&gt;&quot; ... ] ]</var>
+ <nobr>Macro: <strong>HEAD</strong> &quot;&lt;text of head&gt;&quot; [ &quot;&lt;2nd line&gt;&quot; [ &quot;&lt;3rd line&gt;&quot; ... ] ]</nobr>
</a>
<p>
@@ -639,6 +790,33 @@ head, simply surround each line with double-quotes.
and <strong>mom</strong> is unable to fit the head <em>plus at least
one line of text underneath it</em>, she will set the head at the
top of the next page.
+<p>
+<strong>ADDITIONAL NOTE:</strong> If an
+<a href="definitions.html#TERMS_INPUTLINE">input line</a>
+in a head (i.e. one of the lines surrounded by double-quotes) has
+to be broken by <strong>mom</strong> in order to fit the current
+line-length (say, a narrow column measure), the head underline
+(underscore) will not behave. You'll recognize the problem as soon
+as you preview your document. If you encounter a head that
+misbehaves with respect to underlining, the solution is to
+supply each line <em>as you want it</em> as a separate argument
+(surrounded by double-quotes) to the <strong>HEAD</strong> macro.
+<p>
+For example, if <strong>mom</strong> breaks
+<pre>
+ .HEAD "This is a very, very, very long head"
+</pre>
+into
+<pre>
+ This is a very, very, very
+ long head
+</pre>
+
+you'll see the misbehaving underscore and should change the
+argument to <strong>HEAD</strong> to
+<pre>
+ .HEAD "This is a very, very very" "long head"
+</pre>
<a name="HEAD_CONTROL"><h3><u>Head control macros</u></h3></a>
<p>
@@ -648,7 +826,7 @@ underlining, and so on. Check them out if you're unhappy with
<strong>mom</strong>'s defaults.
<p>
<ol>
- <li><a href="#HEAD_GENERAL">Family/font/size/quad</a>
+ <li><a href="#HEAD_GENERAL">Family/font/size/colour/quad</a>
<li><a href="#HEAD_CAPS">Caps</a>
<li><a href="#HEAD_SPACE">Pre-head space</a>
<li><a href="#HEAD_UNDERLINE">Underlining</a>
@@ -657,7 +835,7 @@ underlining, and so on. Check them out if you're unhappy with
<li><a href="#HEAD_INLINES">Vertical inline escapes inside heads</a>
</ol>
<p>
-<a name="HEAD_GENERAL"><h3><u>1. Family/font/size/quad</u></h3></a>
+<a name="HEAD_GENERAL"><h3><u>1. Family/font/size/colour/quad</u></h3></a>
<p>
See
<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
@@ -666,10 +844,12 @@ See
.HEAD_FAMILY default = prevailing document family; default is Times Roman
.HEAD_FONT default = bold
.HEAD_SIZE default = +1 (point)
+.HEAD_COLOR default = black
.HEAD_QUAD default = CENTER
</pre>
<a name="HEAD_CAPS"><h3><u>2. Capitalizing heads -- HEAD_CAPS</u></h3></a>
+<p>
By default, <strong>mom</strong> sets heads in caps, regardless
of the
<a href="definitions.html#TERMS_STRINGARGUMENT">string(s)</a>
@@ -685,8 +865,10 @@ To change this behaviour, do
any argument you like instead of <strong>OFF</strong> (<strong>END,
QUIT, Q, X</strong>...). To turn <strong>HEAD_CAPS</strong> back on,
simply invoke it without an argument.
+<p>
<a name="HEAD_SPACE"><h3><u>3. Space before heads -- HEAD_SPACE</u></h3></a>
+<p>
By default, <strong>mom</strong> deposits 2 blank lines prior to every
head. If you'd prefer just a single blank line, do
<p>
@@ -698,8 +880,10 @@ head. If you'd prefer just a single blank line, do
any argument you like instead of <strong>OFF</strong> (<strong>END,
QUIT, Q, X</strong>...). To restore the space before heads to 2
blank lines, invoke <strong>HEAD_SPACE</strong> without an argument.
+<p>
<a name="HEAD_UNDERLINE"><h3><u>4. Underlining heads -- HEAD_UNDERLINE</u></h3></a>
+<p>
By default, <strong>mom</strong> underlines heads. To change this
behaviour, do
<p>
@@ -711,8 +895,10 @@ behaviour, do
use any argument you like instead of <strong>OFF</strong> (<strong>END,
QUIT, Q, X</strong>...). To restore underlining of heads, invoke
<strong>HEAD_UNDERLINE</strong> without an argument.
+<p>
<a name="NUMBER_HEADS"><h3><u>5. Number heads -- NUMBER_HEADS</u></h3></a>
+<p>
If you'd like your heads numbered, simply invoke
<strong>NUMBER_HEADS</strong> with no argument. <strong>Mom</strong>
will number all subsequent heads automatically (in ascending order,
@@ -729,8 +915,10 @@ Should you wish to stop head numbering, invoke
<strong>NUMBER_HEADS</strong> with any argument (<strong>OFF, QUIT,
END, X</strong>...). Head numbering will cease, and the head number
will not be included in the numbering of subheads and/or paraheads.
+<p>
<a name="RESET_HEAD_NUMBER"><h3><u>6. Reset head numbering -- RESET_HEAD_NUMBER</u></h3></a>
+<p>
Should you wish to reset the head number to &quot;1&quot;, invoke
<strong>RESET_HEAD_NUMBER</strong> with no argument. If, for some
reason, you want <strong>mom</strong> to use a head number that is not
@@ -743,8 +931,10 @@ the next in ascending order (i.e. the last head number + 1), invoke
Your next head will be numbered &quot;6&quot; and subsequent heads will
be numbered in ascending order from &quot;6&quot;.
+<p>
<a name="HEAD_INLINES"><h3><u>7. Vertical inline escapes inside heads</u></h3></a>
+<p>
If you need to adjust the
<a href="definitions.html#TERMS_BASELINE">baseline</a>
position of a head (e.g. the head falls at the top of a column and
@@ -755,17 +945,17 @@ to line up with the ascenders of
in other columns), you can embed a vertical motion
<a href="definitions.html#TERMS_INLINES">inline escape</a>
(either
-<a href="inlines.html#INLINE_VERTICAL_MOM">mom's</a>
+<a href="inlines.html#INLINE_VERTICAL_MOM">mom</a>'s
or
-<a href="inlines.html#INLINE_VERTICAL_GROFF">groff's</a>
+<a href="inlines.html#INLINE_VERTICAL_GROFF">groff</a>'s
in the string(s) you pass to <strong>HEAD</strong>
<p>
For example,
<p>
<pre>
.HEAD "\[ALD3]Text of head"
- or
- .HEAD "\[DOWN 3p]Text of head"
+ or
+ .HEAD "\[DOWN 3p]Text of head"
</pre>
will lower the baseline of the head by three points. Note that
@@ -776,14 +966,9 @@ the escape in the string for each line, like this:
<p>
<pre>
.HEAD "\[ALD3]First line" "\[ALD3]Next line"
- or
- .HEAD "\[DOWN 3p]First line" "\[DOWN 3p]Next line"
+ or
+ .HEAD "\[DOWN 3p]First line" "\[DOWN 3p]Next line"
</pre>
-
-
-
-
-<br>
<hr>
<!====================================================================>
@@ -811,14 +996,14 @@ document structuring.
<p>
If these defaults don't suit you, you can change them with the
subhead control macros.
-<br>
+<p>
<!---SUBHEAD--->
<hr width="66%" align="left">
<p>
<a name="SUBHEAD">
- Macro: <strong>SUBHEAD</strong> <var>&quot;&lt;text of subhead&gt;&quot; [ &quot;&lt;2nd line&gt;&quot; [ &quot;&lt;3rd line&gt;&quot; ... ] ]</var>
+ <nobr>Macro: <strong>SUBHEAD</strong> &quot;&lt;text of subhead&gt;&quot; [ &quot;&lt;2nd line&gt;&quot; [ &quot;&lt;3rd line&gt;&quot; ... ] ]</nobr>
</a>
<p>
The argument to <strong>SUBHEAD</strong> is the text of the subhead,
@@ -836,7 +1021,7 @@ In addition to the usual family/font/size/quad control
macros, there are macros to manage subhead numbering.
<p>
<ol>
- <li><a href="#SUBHEAD_GENERAL">Family/font/size/quad</a>
+ <li><a href="#SUBHEAD_GENERAL">Family/font/size/colour/quad</a>
<li><a href="#NUMBER_SUBHEADS">Numbering</a>
<li><a href="#RESET_SUBHEAD_NUMBER">Reset subhead numbering</a>
<li><a href="#SUBHEAD_INLINES">Vertical inline escapes inside subheads</a>
@@ -851,10 +1036,12 @@ See
.SUBHEAD_FAMILY default = prevailing document family; default is Times Roman
.SUBHEAD_FONT default = bold
.SUBHEAD_SIZE default = +.5 (point)
+.SUBHEAD_COLOR default = black
.SUBHEAD_QUAD default = LEFT
</pre>
<a name="NUMBER_SUBHEADS"><h3><u>2. Number subheads -- NUMBER_SUBHEADS</u></h3></a>
+<p>
If you'd like your subheads numbered, simply invoke
<strong>.NUMBER_SUBHEADS</strong> with no argument.
<strong>Mom</strong> will number all subsequent subheads automatically
@@ -869,8 +1056,10 @@ Should you wish to stop subhead numbering, invoke
<strong>NUMBER_SUBHEADS</strong> with any argument (<strong>OFF, QUIT,
END, X</strong>...). Subhead numbering will cease, and the subhead
number will not be included in the numbering of paraheads.
+<p>
<a name="RESET_SUBHEAD_NUMBER"><h3><u>3. Reset head numbering -- RESET_SUBHEAD_NUMBER</u></h3></a>
+<p>
Should you wish to reset the subhead number to &quot;1&quot;, invoke
<strong>RESET_SUBHEAD_NUMBER</strong> with no argument. If, for some
reason, you want <strong>mom</strong> to use a subhead number that is not
@@ -888,9 +1077,7 @@ subheads will be numbered in ascending order from &quot;4&quot;.
See
<a href="#HEAD_INLINES">Vertical inline escapes inside heads</a>.
The information there applies equally to subheads.
-
-
-<br>
+<p>
<hr>
<!====================================================================>
@@ -917,14 +1104,14 @@ they are underlined.
<p>
If these defaults don't suit you, you can change them with the
parahead control macros.
-<br>
+<p>
<!---PARAHEAD--->
<hr width="66%" align="left">
<p>
<a name="PARAHEAD">
- Macro: <strong>PARAHEAD</strong> <var>&quot;&lt;text of parahead&gt;&quot;</var>
+ <nobr>Macro: <strong>PARAHEAD</strong> &quot;&lt;text of parahead&gt;&quot;</nobr>
</a>
<p>
<strong>PARAHEAD</strong> must come AFTER
@@ -937,20 +1124,21 @@ only one argument (see
<a href="#HEAD">HEAD</a>
and
<a href="#SUBHEAD">SUBHEAD</a>).
+<p>
<a name="PARAHEAD_CONTROL"><h3><u>Parahead control macros</u></h3></a>
<p>
-In addition to the family/font/size/indent control macros, there are
-macros to manage parahead numbering.
+In addition to the family/font/size/colour/indent control macros,
+there are macros to manage parahead numbering.
<p>
<ol>
- <li><a href="#PARAHEAD_GENERAL">Family/font/size</a>
+ <li><a href="#PARAHEAD_GENERAL">Family/font/size/color</a>
<li><a href="#PARAHEAD_INDENT">Indent</a>
<li><a href="#NUMBER_PARAHEADS">Numbering</a>
<li><a href="#RESET_PARAHEAD_NUMBER">Reset parahead numbering</a>
</ol>
<p>
-<a name="PARAHEAD_GENERAL"><h3><u>1. Family/font/size</u></h3></a>
+<a name="PARAHEAD_GENERAL"><h3><u>1. Family/font/size/colour</u></h3></a>
<p>
See
<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
@@ -959,9 +1147,18 @@ See
.PARAHEAD_FAMILY default = prevailing document family; default is Times Roman
.PARAHEAD_FONT default = bold italic
.PARAHEAD_SIZE default = +.5 (point)
+<a name="PARAHEAD_COLOR">.PARAHEAD_COLOR default = black*</a>
+
+*If you colourize paragraph text, paraheads will appear in the same
+colour as the text unless you explicitly tell mom to colour them
+otherwise by invoking .PARAHEAD_COLOR. If you do want paraheads
+that are coloured the same as paragraph text, it's generally a good
+idea to invoke .PARAHEAD_COLOR anyway (with the same colour used
+for paragraph text), just to let mom know.
</pre>
<a name="PARAHEAD_INDENT"><h3><u>2. Indent</u></h3></a>
+<p>
Unlike other control macros that end in
<a href="#CONTROL_INDENTS"><strong>_INDENT</strong></a>,
the argument to the macro that controls indenting of paragraph heads
@@ -989,8 +1186,10 @@ paragraphs&quot;, as defined in
are not indented unless you turn
<a href="#INDENT_FIRST_PARAS">INDENT_FIRST_PARAS</a>
on.
+<p>
<a name="NUMBER_PARAHEADS"><h3><u>3. Number paraheads -- NUMBER_PARAHEADS</u></h3></a>
+<p>
If you'd like your paraheads numbered, simply invoke
<strong>.NUMBER_PARAHEADS</strong> with no argument.
<strong>Mom</strong> will number all subsequent paraheads automatically
@@ -1006,8 +1205,10 @@ parahead number (separated by a period [dot]).
Should you wish to stop parahead numbering, invoke
<strong>NUMBER_PARAHEADS</strong> with any argument (<strong>OFF,
QUIT, END, X</strong>...). Parahead numbering will cease.
+<p>
<a name="RESET_PARAHEAD_NUMBER"><h3><u>4. Reset head numbering -- RESET_PARAHEAD_NUMBER</u></h3></a>
+<p>
Should you wish to reset the parahead number to &quot;1&quot;, invoke
<strong>RESET_PARAHEAD_NUMBER</strong> with no argument. If, for some
reason, you want <strong>mom</strong> to use a parahead number that is not
@@ -1020,7 +1221,7 @@ the next in ascending order (i.e. the last parahead number + 1), invoke
Your next parahead will be numbered &quot;7&quot; and subsequent
paraheads will be numbered in ascending order from &quot;7&quot;.
-<br>
+<p>
<hr>
<!====================================================================>
@@ -1033,10 +1234,10 @@ paraheads will be numbered in ascending order from &quot;7&quot;.
<p>
By default, <strong>mom</strong> marks
<a href="definitions.html#TERMS_LINEBREAK">author linebreaks</a>
-with three centered asterisks. You can change this behaviour
+with three centred asterisks. You can change this behaviour
with the linebreak character
<a href="definitions.html#TERMS_CONTROLMACRO">control macro</a>.
-<br>
+<p>
<!---LINEBREAK--->
@@ -1045,6 +1246,8 @@ with the linebreak character
<a name="LINEBREAK">
Macro: <strong>LINEBREAK</strong>
</a>
+<br>
+Alias: <strong>SECTION</strong>
<p>
<strong>LINEBREAK</strong> takes no arguments. Simply invoke it
@@ -1057,12 +1260,13 @@ macro.
<h3><u>Linebreak character control macro</u></h3>
<p>
<a name="LINEBREAK_CHAR">
- Macro: <strong>LINEBREAK_CHAR</strong> <var>[ &lt;character&gt; ] [ &lt;iterations&gt; [ &lt;vertical adjustment&gt; ] ]</var>
+ <nobr>Macro: <strong>LINEBREAK_CHAR</strong> [ &lt;character&gt; ] [ &lt;iterations&gt; [ &lt;vertical adjustment&gt; ] ]</nobr>
</a>
<br>
+Alias: <strong>SECTION_CHAR</strong>
+<br>
<em>*The third optional argument requires a
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>.
-
<p>
<strong>LINEBREAK_CHAR</strong> determines what <strong>mom</strong>
prints when <strong>LINEBREAK</strong> is invoked. It takes 3
@@ -1074,12 +1278,13 @@ The first argument is any legal groff character (e.g. <kbd>*</kbd>
[an asterisk], <kbd>\(dg</kbd> [a dagger], <kbd>\f(ZD\N'141\fP</kbd>
[an arbitrary character from Zapf Dingbats], <kbd>\l'4P'</kbd>
[a 4-pica long rule]). <strong>Mom</strong> sets the character
-centered on the current line length.
+centred on the current line length. (See &quot;man groff_char&quot;
+for a list of all legal groff characters.)
<p>
The second argument is the number of times to repeat the character.
<p>
The third argument is a +|- value by which to raise (+) or lower (-)
-the character in order to make it appear visually centered between
+the character in order to make it appear visually centred between
sections of text. This lets you make vertical adjustments
to characters that don't sit on the
<a href="definitions.html#TERMS_BASELINE">baseline</a>
@@ -1101,6 +1306,16 @@ position (for
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPESET</a>;
the vertical adjustment is -2 points for
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>).
+
+<h3><u>Linebreak colour control macro</u></h3>
+<p>
+<a name="LINEBREAK_COLOR">
+ <nobr>Macro: <strong>LINEBREAK_COLOR</strong> &lt;color name&gt;</nobr>
+</a>
+<p>
+To change the colour of the linebreak character(s), simply invoke
+<strong>LINBREAK_COLOR</strong> with the name of a pre-defined (or
+&quot;initialized&quot;) colour.
<br>
<hr>
@@ -1131,9 +1346,13 @@ or underlined
<a href="docprocessing.html#PRINTSTYLE">(PRINTSTYLE TYPEWRITE)</a>,
indented from the left margin. Obviously, she's thinking
&quot;quotes from poetry or song lyrics&quot;, but with the
-quote control macros you can change her defaults so
-<strong>QUOTE</strong> serves other needs, e.g. entering snippets of
-programming code, command line instructions, and so on.
+<a href="#QUOTE_CONTROL">quote control macros</a>
+you can change her defaults so <strong>QUOTE</strong> serves other
+needs, e.g. entering verbatim snippets of programming code, command
+line instructions, and so on. (See the
+<a href="#QUOTE_TIP">tip</a>
+below for suggestions about including programming code snippets in
+documents.)
<p>
<a name="QUOTE_SPACING"></a>
Besides indenting quotes, <strong>mom</strong> further sets them
@@ -1158,14 +1377,84 @@ and
<a href="#BLOCKQUOTE">BLOCKQUOTE</a>,
as does the control macro
<a href="#QUOTE_INDENT">QUOTE_INDENT</a>.
-<br>
+<p>
+<strong>Version 1.3: mom</strong>'s handling of the vertical
+whitespace around quotes has changed slightly. In versions prior
+to 1.3, it was not possible to alter the
+<a href="definitions.html#TERMS_LEADING">leading</a>
+of quotes and blockquotes (which was the same as the document
+leading), ensuring that the vertical whitespace remained consistent,
+as described above. In 1.3 and later, it is possible to change the
+leading of quotes and blockquote via
+the <strong>QUOTE_AUTOLEAD</strong> and
+<strong>BLOCKQUOTE_AUTOLEAD</strong>macro. Now, if your quote
+(or blockquote) leading differs from the document leading,
+<strong>mom</strong> attempts to observe the same rules for vertical
+whitespace outlined above; however, she will also insert a small,
+flexible amount of extra whitespace around the quotes to make sure
+the whitespace is equal, top and bottom. Since she does this on a
+quote by quote basis, rather than by figuring out how much extra
+whitespace is needed to adjust <em>all</em> quotes on a page,
+the spacing around multiple quotes on the same page will differ
+slightly, although each will be balanced between lines of normal
+<a href="definitions.html#TERMS_RUNNING">running text</a>,
+top and bottom. (The inability to scan an entire page and insert
+equalized whitespace at marked places is a limitation of groff,
+which, by and large, works in a linear, line by line fashion.)
+If you don't provide <strong>mom</strong> with a
+<strong>QUOTE_AUTOLEAD</strong>, quotes are leaded at the default
+for normal running text, meaning that multiple quotes on the same
+page are all spaced identically.
+<p>
+<a name="QUOTE_TIP"><strong>TIP:</strong></a>
+If you want to include snippets of programming code in
+<strong>mom</strong> documents, you may come acropper of the fact
+that groff (and <strong>mom</strong>'s) escape character is the
+backslash. In order for <strong>mom</strong> not to interpret
+backslashes that occur in code snippets as escapes, you have to
+tell <strong>mom</strong> 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
+<strong>ESC_CHAR</strong>, like this:
+<p>
+<pre>
+ .ESC_CHAR c
+</pre>
+
+where &quot;c&quot;, 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
+<strong>.ESC_CHAR</strong> by itself (i.e. with no argument).
+<p>
+Because <strong>mom</strong>, by default, sets the text after
+<strong>.QUOTE</strong> in italic (for <strong>PRINTSTYLE
+TYPESET</strong>) or underlined (for <strong>PRINTSTYLE
+TYPEWRITE</strong>), you'll want to change that behaviour as
+well. Therefore, a recipe for setting verbatim code snippets using
+<strong>QUOTE</strong> could be (assuming you want a fixed width
+font like Courier):
+<p>
+<pre>
+ \# 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 ^
+ &lt;code snippet&gt;
+ .ESC_CHAR \" Restore escape character to \
+ .QUOTE OFF
+
+</pre>
<!---QUOTE--->
<hr width="66%" align="left">
<p>
<a name="QUOTE">
- Macro: <strong>QUOTE</strong> <var>toggle</var>
+ <nobr>Macro: <strong>QUOTE</strong> toggle</nobr>
</a>
<p>
@@ -1186,27 +1475,30 @@ argument (e.g. OFF, END, X, Q...) to turn it off. Example:
<a name="QUOTE_CONTROL"><h3><u>Quote control macros</u></h3></a>
<ol>
- <li><a href="#QUOTE_GENERAL">Family/font/size/indent</a>
+ <li><a href="#QUOTE_GENERAL">Family/font/size/leading/colour/indent</a>
<li><a href="#ALWAYS_FULLSPACE_QUOTES">Spacing above and below (typeset only)</a>
<li><a href="#UNDERLINE_QUOTES">Underline quotes (typewrite only)</a>
<li><a href="#BREAK_QUOTE">Manually break a footnoted quote that crosses pages/columns</a>
</ol>
<p>
-<a name="QUOTE_GENERAL"><h3><u>1. Family/font/size/indent</u></h3></a>
+<a name="QUOTE_GENERAL"><h3><u>1. Family/font/size/colour/indent</u></h3></a>
<p>
See
<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
<p>
<pre>
-.QUOTE_FAMILY default = prevailing document family; default is Times Roman
-.QUOTE_FONT default = italic
-.QUOTE_SIZE default = 0 (i.e. same size as paragraph text)
-<a name="QUOTE_INDENT">.QUOTE_INDENT default = paragraph indent x 3 (typeset); x 2 (typewrite)</a>
- (note that this macro also sets the indents (left and right)
- for blockquotes)
+.QUOTE_FAMILY default = prevailing document family; default is Times Roman
+.QUOTE_FONT default = italic; underlined in TYPEWRITE
+.QUOTE_SIZE default = +0 (i.e. same size as paragraph text)
+.QUOTE_AUTOLEAD default = none; leading of quotes is the same as paragraphs
+.QUOTE_COLOR default = black
+<a name="QUOTE_INDENT">.QUOTE_INDENT default = paragraph indent x 3 (typeset); x 2 (typewrite)</a>
+ (note that this macro also sets the indents (left and right)
+ for blockquotes)
</pre>
<a name="ALWAYS_FULLSPACE_QUOTES"><h3><u>2. Spacing above and below -- ALWAYS_FULLSPACE_QUOTES (typeset only)</u></h3></a>
+<p>
If you'd like <strong>mom</strong> always to put a full linespace above
and below quotes, invoke <strong>.ALWAYS_FULLSPACE_QUOTES</strong>
with no argument. If you wish to restore <strong>mom</strong>'s
@@ -1218,8 +1510,10 @@ X</strong>...)
<strong>NOTE:</strong> This macro also sets <strong>mom</strong>'s
spacing policy for
<a href="#BLOCKQUOTE_INTRO">blockquotes</a>.
+<p>
<a name="UNDERLINE_QUOTES"><h3><u>3. Underlining -- UNDERLINE_QUOTES (typewrite only)</u></h3></a>
+<p>
By default in
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>,
<strong>mom</strong> underlines quotes. If you'd rather she didn't,
@@ -1237,8 +1531,20 @@ of italics by default in <strong>PRINTSTYLE TYPEWRITE</strong>,
you must also make sure that <strong>ITALIC_MEANS_ITALIC</strong>
is enabled (see
<a href="docprocessing.html#TYPEWRITE_CONTROL">PRINTSTYLE TYPEWRITE control macros</a>).
+<p>
<a name="BREAK_QUOTE"><h3><u>4. Manually break a footnoted quote -- BREAK_QUOTE</u></h3></a>
+<p>
+<strong>NOTE:</strong> <em>As of version 1.1.9, the macro</em>
+<strong>BREAK_QUOTE</strong> <em>has become obsolete (or, at least,
+should have become obsolete.) It remains here for backward
+compatibility with documents created prior to 1.1.9, and just in
+case, despite my efforts to make it obsolete, you still encounter the
+problem it's supposed to fix. Should you find yourself having to
+use</em> <strong>BREAK_QUOTE</strong> <em>while running</em> <strong>mom</strong>
+1.1.9 <em>or higher, please notify me immediately.</em>
+
+<p>
Exceptionally, a quote or blockquote containing a footnote may cross
a page or column. When this happens, the footnote marker may not be
correct for its position relative to other footnotes on the page, and
@@ -1252,7 +1558,7 @@ will be marked correctly and appear on the correct page.
<strong>BREAK_QUOTE</strong> may be used with both quotes and
blockquotes, and hence is aliased as <strong>BREAK_BLOCKQUOTE,
BREAK_CITATION</strong> and <strong>BREAK_CITE</strong>.
-<br>
+<p>
<hr>
<!====================================================================>
@@ -1281,24 +1587,16 @@ Besides indenting blockquotes, <strong>mom</strong> further sets them
off from running text with a small amount of vertical whitespace top
and bottom. (See
<a href="#QUOTE_SPACING">above</a>
-for a complete explanation of how this is managed, and how to control it.)
-<p>
-You may notice that <strong>BLOCKQUOTE</strong> has no macro to
-control
-<a href="definitions.html#TERMS_LEADING">leading</a>,
-although you can change the point size. There are Very Good
-Reasons for this. If you can't live with the limitation, change
-the leading of blockquotes (after invoking the tag) with
-<a href="typesetting.html#LS">LS</a>,
-but know that there will be Bottom Margin Consequences.
-<br>
+for a complete explanation of how this is managed, and how to control it.
+Be sure to read the section <strong>Version 1.3</strong>.)
+<p>
<!---BLOCKQUOTE--->
<hr width="66%" align="left">
<p>
<a name="BLOCKQUOTE">
- Macro: <strong>BLOCKQUOTE</strong> <var>toggle</var>
+ <nobr>Macro: <strong>BLOCKQUOTE</strong> toggle</nobr>
<br>
Aliases: <strong>CITE, CITATION</strong>
</a>
@@ -1326,31 +1624,35 @@ with
<p>
<strong>NOTE:</strong> The aliases <strong>CITE</strong>
and <strong>CITATION</strong> may be used in place of the
-<strong>BLOCKQUOTE</strong> tag, but &quot;CITE&quot; and
-&quot;CITATION&quot; must not be used to replace &quot;BLOCKQUOTE&quot;
-in any of the tag's control macros.
+<strong>BLOCKQUOTE</strong> tag, as well as in any of the control
+macros that begin with <strong>BLOCKQUOTE_</strong> or end with
+<strong>_BLOCKQUOTE</strong>.
<a name="BLOCKQUOTE_CONTROL"><h3><u>Blockquote control macros</u></h3></a>
<ol>
- <li><a href="#BLOCKQUOTE_GENERAL">Family/font/size/indent</a>
+ <li><a href="#BLOCKQUOTE_GENERAL">Family/font/size/leading/colour/quad/indent</a>
<li><a href="#ALWAYS_FULLSPACE_QUOTES">Spacing above and below (typeset only)</a>
<li><a href="#BREAK_QUOTE">Manually break a footnoted blockquote that crosses pages/columns</a>
</ol>
<p>
-<a name="BLOCKQUOTE_GENERAL"><h3><u>1. Family/font/size/indent</u></h3></a>
+<a name="BLOCKQUOTE_GENERAL"><h3><u>1. Family/font/size/colour/quad/indent</u></h3></a>
<p>
See
<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
<p>
<pre>
-.BLOCKQUOTE_FAMILY default = prevailing document family; default is Times Roman
-.BLOCKQUOTE_FONT default = italic
-.BLOCKQUOTE_SIZE default = -1 (point)
-.QUOTE_INDENT default = paragraph indent x 3 (typeset); x 2 (typewrite)</a>
- (note that this macro also sets the left indent for quotes)
+.BLOCKQUOTE_FAMILY default = prevailing document family; default is Times Roman
+.BLOCKQUOTE_FONT default = roman
+.BLOCKQUOTE_SIZE default = -1 (point)
+.BLOCKQUOTE_AUTOLEAD default = none; leading of blockquotes is the same as paragraphs
+.BLOCKQUOTE_COLOR default = black
+.BLOCKQUOTE_QUAD default = left
+.BLOCKQUOTE_INDENT default = paragraph indent x 3 (typeset); x 2 (typewrite)</a>
+ (note that this macro also sets the left indent for quotes)
</pre>
<a name="ALWAYS_FULLSPACE_QUOTES"><h3><u>2. Spacing above and below -- ALWAYS_FULLSPACE_QUOTES (typeset only)</u></h3></a>
+<p>
If you'd like <strong>mom</strong> always to put a full linespace above
and below blockquotes, invoke <strong>.ALWAYS_FULLSPACE_QUOTES</strong>
with no argument. If you wish to restore <strong>mom</strong>'s
@@ -1362,7 +1664,880 @@ X</strong>...).
<strong>NOTE:</strong> This macro also sets <strong>mom</strong>'s
spacing policy for
<a href="#QUOTE_INTRO">quotes</a>.
+<p>
+<hr>
+
+<!====================================================================>
+
+<a name="LIST_INTRO"><h2><u>Nested lists</u></h2></a>
+<ul>
+ <li><a href="#LIST">Tag: LIST</a>
+ <li><a href="#ITEM">Tag: ITEM</a>
+ <li><a href="#LIST_CONTROL">LIST control macros</a>
+</ul>
+<p>
+Lists are points or items of interest or importance that are
+separated from
+<a href="definitions.html#TERMS_RUNNING">running text</a>
+by enumerators. Some typical enumerators are
+<a href="definitions.html#TERMS_EM">en-dashes</a>,
+<a href="definitions.html#TERMS_BULLET">bullets</a>,
+digits and letters.
+<p>
+Setting lists with <strong>mom</strong> is easy. First, you
+initialize a list with the <strong>LIST</strong> macro. Then, for
+every item in the list, you invoke the macro, <strong>ITEM</strong>,
+followed by the text of the item. When a list is finished, you
+exit the list with <strong>LIST OFF</strong> (or
+<strong>QUIT</strong>, <strong>END</strong>, <strong>BACK</strong>,
+etc.)
+<p>
+By default <strong>mom</strong> starts each list with the enumerator
+flush with the left margin of running text that comes before it,
+like this:
+<p>
+<pre>
+ 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
+</pre>
+
+In other words, <strong>mom</strong> does not, by default, indent
+entire lists. Indenting a list is controlled by the macro,
+<a href="#SHIFT_LIST">SHIFT_LIST</a>.
+(This is a design decision; there are too many instances where a
+default indent is not desirable.) Equally, <strong>mom</strong>
+does not add any extra space above or below lists.
+<p>
+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
+<strong>LIST OFF</strong> (you may prefer to use <strong>LIST
+BACK</strong>) takes you back to the previous depth (or
+level) of list, with that list's enumerator and indent intact. The
+final <strong>LIST OFF</strong> exits lists completely and returns
+you to the left margin of running text.
+<p>
+Finally, lists can be used in documents created with either the
+document processing macros or just the typesetting macros.
+<p>
+
+<!---LIST--->
+
+<hr width="66%" align="left">
+<p>
+<a name="LIST">
+ <nobr>Macro: <strong>LIST</strong> [ BULLET | DASH | DIGIT | ALPHA | alpha | ROMAN&lt;n&gt; | roman&lt;n&gt; | USER &lt;string&gt;] [ &lt;separator&gt; | &lt;user-defined enumerator&gt; ] [ &lt;prefix&gt; ] [ &lt;off&gt; ]</a></nobr>
+<p>
+Invoked by itself (i.e. with no argument), <strong>LIST</strong>
+initializes a list (with bullets as the default enumerator).
+Afterwards, each block of input text preceded by
+<a href="#ITEM">.ITEM</a>,
+on a line by itself, is treated as a list item.
+<p>
+<strong>NOTE:</strong> Every time you invoke <strong>LIST</strong>
+to start a list (as opposed to
+<a href="#LIST_EXIT">exiting one</a>),
+you must supply an enumerator (and optionally, a separator) for the
+list, unless you want <strong>mom</strong>'s default enumerator,
+which is a bullet. Within nested lists, <strong>mom</strong>
+stores the enumerator, separator and indent for any list you return
+<em>backwards</em> to (i.e. with <strong>LIST OFF</strong>), but
+does not store any information for lists you move <em>forward</em>
+to.
+<br>
+
+<h3><u>The first argument--enumerator style</u></h3>
+<p>
+The optional arguments <strong>BULLET</strong>,
+<strong>DASH</strong>, <strong>DIGIT</strong> (for
+Arabic numerals), <strong>ALPHA</strong> (for uppercase
+letters), <strong>alpha</strong> (for lowercase letters),
+<strong>ROMAN&lt;n&gt;</strong> (for uppercase roman numerals),
+<strong>roman&lt;n&gt;</strong> (for lowercase roman numerals) tell
+<strong>mom</strong> what kind of enumerator to use for a given
+list.
+<p>
+The arguments, <strong>ROMAN&lt;n&gt;</strong> and
+<strong>roman&lt;n&gt;</strong>, are special. You must append to
+them a digit (arabic, e.g. "1" or "9" or "17") saying how many items
+a particular roman-numeralled <strong>LIST</strong> is going to
+have. <strong>Mom</strong> requires this information in order to
+align roman numerals sensibly, and will abort--with a message--if
+you don't provide it.
+<p>
+A roman-numeralled list containing, say, five items, would be set
+up like this:
+<p>
+<pre>
+ .LIST roman5 producing i) Item 1.
+ .ITEM ii) Item 2.
+ Item 1. iii) Item 3.
+ .ITEM iv) Item 4.
+ Item 2. v) Item 5.
+ .ITEM
+ Item 3
+ .ITEM
+ Item 4
+ .ITEM
+ Item 5
+</pre>
+
+<p>
+The argument, <strong>USER</strong>, lets you make up your own
+enumerator, and must be followed by a second argument: what you'd
+like the enumerator to look like. For example, if you want a list
+enumerated with
+<strong>=&gt;</strong>,
+<p>
+<pre>
+ .LIST USER =&gt;
+ .ITEM
+ A list item
+</pre>
+
+will produce
+<p>
+<pre>
+ =&gt; A list item
+</pre>
+
+<strong>Please note:</strong> if the argument to
+<strong>USER</strong> contains spaces, you must enclose the argument
+in double quotes.
+
+<br>
+
+<h3><u>The second argument--separator style</u></h3>
+<p>
+If you choose <strong>DIGIT</strong>, <strong>ALPHA</strong>,
+<strong>alpha</strong>, <strong>ROMAN&lt;n&gt;</strong>, or
+<strong>roman&lt;n&gt;</strong>, you may enter the optional
+argument, <strong>separator</strong>, to say what kind of separator
+you want after the enumerator. The separator can be anything you
+like. The default for <strong>DIGIT</strong> is a period (dot),
+like this:
+<p>
+<pre>
+ 1. A list item
+</pre>
+
+The default separator for <strong>ALPHA</strong>,
+<strong>alpha</strong>, <strong>ROMAN&lt;n&gt;</strong> and
+<strong>roman&lt;n&gt;</strong> is a right parenthesis, like this:
+<p>
+<pre>
+ a) An alpha-ed list item
+ b) A second alpha-ed list item
+
+ or
+
+ i) A roman-ed list item
+ ii) A second roman-ed item
+</pre>
+
+If you'd prefer, say, digits with right-parenthesis separators
+instead of the default period, you'd do
+<p>
+<pre>
+ .LIST DIGIT )
+ .ITEM
+ A numberd list item
+</pre>
+
+which would produce
+<p>
+<pre>
+ 1) A numbered list item
+</pre>
+
+<strong>Please note: BULLET</strong>, <strong>DASH</strong> and
+<strong>USER</strong> do not take a separator.
+<br>
+
+<h3><u>The third argument--prefix style</u></h3>
+<p>
+Additionally, you may give a prefix (i.e. a character that comes
+<em>before</em> the enumerator) when your enumerator style for a
+particular list is <strong>DIGIT</strong>, <strong>ALPHA</strong>,
+<strong>alpha</strong>, <strong>ROMAN&lt;n&gt;</strong>
+or <strong>roman&lt;n&gt;</strong>. In the arguments to
+<strong>LIST</strong>, the prefix comes <em>after</em> the
+separator, which may seem counter-intuitive, so please be careful.
+<p>
+A prefix can be anything you like. Most likely, you'll want some
+kind of open-bracket, such as a left parenthesis. If, for example,
+you want a <strong>DIGIT</strong> list with the numbers enclosed in
+parentheses, you'd enter
+<p>
+<pre>
+ .LIST DIGIT ) (
+ .ITEM
+ The first item on the list.
+ .ITEM
+ The second item on the list.
+</pre>
+
+which would produce
+<p>
+<pre>
+ (1) The first item on the list.
+ (2) The second item on the list.
+</pre>
+
+<strong>Please note: BULLET</strong>, <strong>DASH</strong> and
+<strong>USER</strong> do not take a prefix.
+<br>
+
+<a name="LIST_EXIT"></a>
+<h3><u>Exiting lists--.LIST OFF/BACK or .QUIT_LISTS</u></h3>
+<p>
+Any single argument to <strong>LIST</strong> other
+than <strong>BULLET</strong>, <strong>DASH</strong>,
+<strong>DIGIT</strong>, <strong>ALPHA</strong>,
+<strong>alpha</strong>, <strong>ROMAN&lt;n&gt;</strong>,
+<strong>roman&lt;n&gt;</strong> or <strong>USER</strong> (e.g.
+<strong>LIST</strong> <kbd>OFF</kbd> or <strong>LIST</strong>
+<kbd>BACK</kbd>) takes you out of the current list.
+<p>
+If you are at the first list-level (or "list-depth"),
+<strong>mom</strong> returns you to the left margin of running text.
+Any indents that were in effect prior to setting the list are fully
+restored.
+<p>
+If you are in a nested list, <strong>mom</strong> moves you
+<em>back one list-level</em> (i.e. does not take you out of the
+list structure) and restores the enumerator, separator and indent
+appropriate to that level.
+<p>
+Each invocation of <strong>LIST</strong> should be be matched by
+a corresponding <strong>LIST OFF</strong> in order to fully exit
+lists. For example,
+<p>
+<pre>
+ 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.
+</pre>
+
+is created like this:
+<p>
+<pre>
+ 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.
+</pre>
+
+Alternatively, you may use the single-purpose macro,
+<strong>QUIT_LISTS</strong>, to get yourself out of a list
+structure. In the example above, the two <kbd>.LIST OFF</kbd>
+lines could be replaced with a single <kbd>.QUIT_LISTS</kbd>.
+<p>
+
+<hr width="33%" align="left">
+<p>
+<a name="ITEM">
+ Macro: <strong>ITEM</strong>
+<p>
+After you've initialized a list with
+<a href="#LIST">LIST</a>,
+precede each item you want in the list with <strong>ITEM</strong>.
+<strong>Mom</strong> takes care of everything else with respect to
+setting the item appropriate to the list you're in.
+<p>
+In document processing, it is legal to have list items that contain
+multiple paragraphs. Simply issue a
+<a href="#PP">PP</a>
+request for each paragraph <em>following</em> the first item.
+I.e., don't do this:
+<p>
+<pre>
+ .ITEM
+ .PP
+ Some text...
+ .PP
+ A second paragraph of text
+</pre>
+
+but rather
+<p>
+<pre>
+ .ITEM
+ Some text...
+ .PP
+ A second paragraph of text
+</pre>
+<hr width="33%" align="left">
+
+<a name="LIST_CONTROL"><h3><u>List control macros</u></h3></a>
+<ol>
+ <li><a href="#SHIFT_LIST">Indenting lists (SHIFT_LIST)</a>
+ <li><a href="#RESET_LIST">Resetting an initialized list's enumerator (RESET_LIST)</a>
+ <li><a href="#PAD_LIST_DIGITS">Padding digit enumerators (PAD_LIST_DIGITS)</a>
+</ol>
+
+<a name="SHIFT_LIST"><h3><u>1. Indenting lists -- SHIFT_LIST</u></h3></a>
+<p>
+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
+<strong>SHIFT_LIST</strong> immediately after
+<a href="#LIST">LIST</a>.
+<strong>SHIFT_LIST</strong> takes just one argument: the amount by
+which you want the list shifted to the right. The argument requires
+a
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>,
+<p>
+<strong>SHIFT_LIST</strong> applies <em>only</em> to the list you
+just initialized with <strong>LIST</strong>. It does not carry
+over from one invocation of <strong>LIST</strong> to the next.
+However, the indent remains in effect when you <em>return</em> to a
+list level in a nested list.
+<p>
+For example, if you want a 2-level list, with each list indented to
+the right by 18
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>,
+<p>
+<pre>
+ 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.
+</pre>
+
+produces (approximately)
+<p>
+<pre>
+ 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.
+</pre>
+
+<a name="RESET_LIST"><h3><u>2. Resetting an initialized list's enumerator -- RESET_LIST</u></h3></a>
+<p>
+In nested lists, if your choice of list enumerator for a given
+level of list is <strong>DIGIT</strong>, <strong>ALPHA</strong>,
+<strong>alpha</strong>, <strong>ROMAN</strong> or
+<strong>roman</strong>, you may sometimes want to reset the list's
+enumerator when you return to that list. Consider the following:
+<p>
+<pre>
+ 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
+</pre>
+
+Normally, within a nested list, when you return to an
+incrementally-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 &quot;2. Feed
+the cat&quot; would be c), d) and e). The solution, in such a case,
+is simply to reset the enumerator --before <strong>ITEM</strong>!--
+with the macro, <strong>RESET_LIST</strong>.
+<p>
+By default, with no argument, <strong>RESET_LIST</strong> resets the
+enumerator to 1, A, a, I or i depending on the style of enumerator.
+You may, if you wish, pass <strong>RESET_LISTS</strong> a numeric
+argument representing the starting enumerator for the reset (if
+different from "1"), although I can't at present think of a use for
+this feature.
+<p>
+<a name="PAD_LIST_DIGITS"><h3><u>3. Padding digit enumerators (PAD_LIST_DIGITS)</a></u></h3></a>
+<p>
+<strong><u>Arabic digits</u></strong>
+<p>
+When your choice of enumerators is <strong>DIGIT</strong> AND the
+number of items in the list exceeds nine (9), you have to make a
+design decision: should <strong>mom</strong> leave room for the
+extra numeral in two-numeral digits to the right or the left of
+the single-numeral digits?
+<p>
+If you want the extra space to the right, invoke the macro,
+<strong>.PAD_LIST_DIGITS</strong> (with no argument), after
+<strong>LIST</strong> and before <strong>ITEM</strong>. This will
+produce something like
+<p>
+<pre>
+ 8. List item
+ 9. List item
+ 10. List item
+</pre>
+
+If you want the extra space to the left, invoke
+<strong>PAD_LIST_DIGITS</strong> with the single argument,
+<strong>LEFT</strong>, which will produce
+<p>
+<pre>
+ 8. List item
+ 9. List item
+ 10. List item
+</pre>
+
+Of course, if the number of items in the list is less than ten
+(10), there's no need for <strong>PAD_LIST_DIGITS</strong>.
+<p>
+<strong><u>Roman numerals</u></strong>
+<p>
+By default, <strong>mom</strong> sets roman numerals in lists flush
+left. The <strong>&lt;n&gt;</strong> argument appended to
+<strong>ROMAN&lt;n&gt;</strong> or <strong>roman&lt;n&gt;</strong>
+allows her to calculate how much space to put after each numeral in
+order to ensure that the text of items lines up properly.
+<p>
+If you'd like the roman numerals to line up flush right (i.e. be
+padded "left"), simply invoke <strong>PAD_LIST_DIGITS</strong>
+<kbd>LEFT</kbd> after <strong>LIST</strong> <kbd>ROMAN&lt;n&gt;</kbd>
+or <strong>LIST</strong> <kbd>roman&lt;n&gt;</kbd> amd before
+<strong>ITEM</strong>.
+<p>
+<hr>
+
+<!---LINE NUMBERING--->
+
+<a name="NUMBER_LINES_INTRO"><h2><u>Line numbering</u></h2></a>
+<ul>
+ <li><a href="#NUMBER_LINES">Macro: NUMBER_LINES</a>
+ <li><a href="#NUMBER_LINES_CONTROL">Control macros</a> (for quotes and blockquotes)
+</ul>
+
+<p>
+<strong>Mom</strong>'s line-numbering capabilities are not as flexible
+as most of her other document processing macros. The reason is
+that groff's underlying line-numbering
+<a href="definitions.html#TERMS_PRIMITIVEX">primitive</a>,
+<kbd>.nm</kbd>, is, well...primtive. It is not possible, for
+example, to select a particular family or font for use exclusively
+with line numbers. Nor is it possible to set the
+<a href="definitions.html#TERMS_GUTTER">gutter</a>
+using any
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
+other than the
+<a href="definitions.html#TERMS_FIGURESPACE">figure space</a>.
+<p>
+That said, when you turn line-numbering on, <strong>mom</strong>,
+by default
+<br>
+<a name="NUMBER_LINES_DEFAULTS"></a>
+<ul>
+ <li>numbers every line of paragraph text; line-numbering is
+ suspended for all other document processing tags (like
+ docheaders, epigraphs, heads, subheads, etc.) and special
+ pages (covers, endotes, bibliographies, etc.); be aware,
+ though, that if you turn
+ <a href="definitions.html#TERMS_DOCHEADER">docheaders</a>
+ off (with
+ <a href="docprocessing.html#DOCHEADER">DOCHEADER</a> <strong>OFF</strong>)
+ and create your own docheader, <strong>mom</strong>
+ <em>will</em> line-number your custom docheader
+ <li>doesn't touch your line length; line numbers are hung
+ outside your current left margin (as set with
+ <a href="typesetting.html#L_MARGIN">L_MARGIN</a>,
+ <a href="typesetting.html#PAGE">PAGE</a>
+ or
+ <a href="docprocessing.html#DOC_LEFT_MARGIN">DOC_LEFT_MARGIN</a>),
+ regardless of any indents that may be active
+ <li>separates line numbers from running text by two
+ <a href="definitions.html#TERMS_FIGURESPACE">figure spaces</a>.
+</ul>
+<p>
+Line numbering may be enabled and disabled for
+<a href="#QUOTE">QUOTE</a>
+and/or
+<a href="#BLOCKQUOTE">BLOCKQUOTE</a>
+in one of three styles. See
+<a href="#NUMBER_LINES_CONTROL">Line numbering control macros for quotes and blockquotes</a>.
+<p>
+The first time you invoke
+<a href="#NUMBER_LINES">NUMBER_LINES</a>
+you must, at a minimum, tell it what line number you want the
+<em>next</em>
+<a href="definitions.html#TERMS_OUTPUTLINE">output line</a>
+to have. Optional arguments allow you to state which lines should
+be numbered (e.g. every five or every ten lines), and the gutter to
+place between line numbers and
+<a href="definitions.html#TERMS_RUNNING">running text</a>.
+<p>
+Subsequently, you can turn line-numbering off, either permanently,
+or resume it later at a place of your choosing. When you
+resume line-numbering, the line numbers pick up where you left off.
+<p>
+
+<!---NUMBER_LINES--->
+
+<hr width="66%" align="left">
+<p>
+<nobr>
+<a name="NUMBER_LINES">
+ <nobr>Macro: <strong>NUMBER_LINES</strong> &lt;start number&gt; [ &lt;which lines to number&gt; [ &lt;gutter&gt; ] ]</nobr>
+ <br>
+ <nobr>Macro: <strong>NUMBER_LINES</strong> &lt;anything&gt; | RESUME</nobr>
+ <br>
+</a>
+</nobr>
+
+<p>
+<strong>NUMBER_LINES</strong> does what it says: prints line
+numbers, to the left of
+<a href="definitions.html#TERMS_OUTPUTLINE">output lines</a>
+of paragraph text. One of the chief reasons for wanting numbered
+lines is in order to identify footnotes or endnotes by line number
+instead of by a marker in the text. (See
+<a href="#FOOTNOTE_LINENUMBERS">.FOOTNOTE_MARKER_STYLE LINE</a>
+for instructions on line-numbered footnotes, and
+<a href="#ENDNOTE_MARKER_STYLE">.ENDNOTE_MARKER_STYLE</a>
+for instructions on line-numbered endnotes.)
+<p>
+Every time you invoke <strong>NUMBER_LINES</strong>, unless you are
+using the arguments <strong>OFF</strong> (<strong>QUIT</strong>,
+<strong>END</strong>, <strong>X</strong>, etc.) or
+<strong>RESUME</strong> you must, at a minimum, pass it one
+argument, namely the number (digit) you want the <em>next</em>
+<a href="definitions.html#TERMS_OUTPUTLINE">output line</a>
+to have. For example,
+<pre>
+ .NUMBER_LINES 3
+</pre>
+
+will prepend the number, 3, to the next output line.
+<p>
+Normally, of course, you will number lines of text starting at 1.
+All you have to do in that case is ensure that
+<pre>
+ .NUMBER_LINES 1
+</pre>
+
+precedes your first line of input text, which will also be the
+first line of output text.
+<p>
+You can alter <strong>mom</strong>'s default line numbering
+behaviour (see
+<a href="#NUMBER_LINES_DEFAULT">above</a>)
+with the optional arguments <strong>&lt;which lines to
+number&gt;</strong> and <strong>&lt;gutter&gt;</strong>.
+<p>
+<strong>&lt;which lines to number&gt;</strong> instructs
+<strong>NUMBER_LINES</strong> to number only certain lines, e.g.
+every two lines or every five lines. If you want, say, only every
+five lines to have a prepended number, you'd do
+<pre>
+ .NUMBER_LINES 1 5
+</pre>
+
+<strong>GOTCHA!</strong> The argument to <strong>&lt;which
+lines to number&gt;</strong> only numbers those lines that are
+multiples of the argument. Hence, in the above example, line
+number "1" will <em>not</em> be numbered, since "1" is not a
+multiple of "5".
+<p>
+If you wanted line number "1" to be numbered, you'd have to invoke
+<kbd>.NUMBER_LINES 1 1</kbd> before the first output line, then
+study your <em>output</em> copy and determine where best to insert
+the following in your <em>input</em> copy:
+<pre>
+ .NUMBER_LINES \n(ln 5
+</pre>
+
+(The escape, <kbd>\n(ln</kbd>, ensures that
+<strong>NUMBER_LINES</strong> automatically supplies the correct
+value for the first argument, <strong>&lt;start
+number&gt;</strong>.)
+<p>
+Following this recipe, line number 1 will be numbered; subsequently,
+only line numbers that are multiples of 5 will be numbered. A
+little experimentation may be required to determine the best place
+for it.
+<p>
+The optional argument, <strong>&lt;gutter&gt;</strong>, tells
+<strong>mom</strong> how much space to put between the line numbers
+and the running text.
+<p>
+<strong>Note</strong>: when giving a value for
+<strong>&lt;gutter&gt;</strong>, you cannot skip the
+<strong>&lt;which lines to number&gt;</strong> argument. Either
+fill in the desired value, or use two double-quotes
+(<strong>""</strong>) to have <strong>mom</strong> use the value
+formerly in effect.
+<p>
+<strong>&lt;gutter&gt;</strong> does not require (or even accept) a
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>.
+The argument you pass to it is the number of
+<a href="definitions.html#TERMS_FIGURESPACE">figure spaces</a>
+you want between line numbers and running text.
+<strong>Mom</strong>'s default gutter is two figure spaces. If
+you'd like a wider gutter, say, four figures spaces, you'd do
+<pre>
+ .NUMBER_LINES 1 1 4
+ |
+ +-- Notice you *must* supply a value
+ for the 2nd argument in order to supply
+ a value for the 3rd.
+</pre>
+
+<p>
+After you've set up line-numbering, <strong>NUMBER_LINES</strong>
+can be used to control line numbering.
<br>
+<h3><u>Line-numbering control</u></h3>
+<p>
+<strong>NUMBER_LINES OFF</strong> (or <strong>END, QUIT, X,</strong> etc.)
+turns line-numbering off.
+<p>
+Sometimes, you merely want to suspend line-numbering. In that case,
+turn line numbering off with <strong>NUMBER_LINES OFF</strong>.
+Later, when you want it to resume, enter
+<pre>
+ .NUMBER_LINES RESUME
+</pre>
+
+Line numbering will resume exactly where it left off. If this is
+not what you want--say you want to reset the line number to "1"--simply
+invoke <strong>NUMBER_LINES</strong> with whatever arguments
+are needed for the desired result.
+<p>
+<strong>Extra Notes:</strong>
+<br>
+<ol>
+ <li>In document processing, you may invoke <strong>NUMBER_LINES</strong>
+ either before or after <strong>START</strong>.
+ <strong>Mom</strong> doesn't care.
+ <li>If you're collating documents with
+ <a href="rectoverso.html#COLLATE">COLLATE</a>,
+ you should re-invoke, at a minimum, <kbd>.NUMBER_LINES
+ 1</kbd> for each collated document, in order to ensure that
+ each begins with the number "1" prepended to the first line
+ (unless, of course, that is not what you want).
+ <li>Occasionally, you may want to change the current gutter
+ between line numbers and running text without knowing
+ what the next output line number should be. Since
+ <strong>NUMBER_LINES</strong> requires this number
+ as its first argument, in such instances, pass
+ <strong>NUMBER_LINES</strong> as its first argument the
+ escape <kbd>\n(ln</kbd>.
+ <p>
+ For example, if you were numbering every 5 lines with a
+ gutter of 2 (figure spaces) and you needed to change the
+ gutter to 4 (figures spaces),
+ <p>
+ <kbd>&nbsp;&nbsp;&nbsp;&nbsp;.NUMBER_LINES \n(ln 5 4</kbd>
+ <p>
+ would do the trick.
+ <li>If you're using margin notes in a document, be sure to set
+ the gutter for margin notes wide enough to allow room for
+ the line numbers.
+ <li><strong>Mom</strong> (groff, actually), only numbers lines
+ <em>to the left of text</em>. For aesthetic reason,
+ therefore, the use of line numbering when setting a document
+ in columns is discouraged. However, should you wish to
+ number lines when setting in columns, make sure the
+ <a href="definitions.html#TERMS_GUTTER">gutter(s)</a>
+ between columns is wide enough to leave room for the
+ numbers.
+</ol>
+<hr width="33%" align="left">
+
+<a name="NUMBER_LINES_CONTROL"><h3><u>Line numbering control macros for QUOTE and BLOCKQUOTE</u></h3></a>
+<ol>
+ <li><a href="#NUMBER_QUOTE_LINES">NUMBER_QUOTE_LINES</a>
+ <li><a href="#NUMBER_BLOCKQUOTE_LINES">NUMBER_BLOCKQUOTE_LINES</a>
+ <li><a href="#NUMBER_LINES_QUOTES">Setting up line numbering in quotes and blockquotes on a case by case basis</a>
+</ol>
+
+<a name="NUMBER_QUOTE_LINES"><h3><u>1. NUMBER_QUOTE_LINES</u></h3></a>
+<p>
+If you'd like <strong>mom</strong> to number lines of output text
+in a
+<a href="#QUOTE">QUOTE</a>
+as part of the same order and sequence as paragraph text, simply
+invoke <strong>NUMBER_QUOTE_LINES</strong> by itself.
+<p>
+There is a catch with numbering quotes, though. Owing to groff's
+restriction of accepting only the figure space as the line number
+gutter's unit of measure, it is not possible for line numbers
+in quotes to hang outside a document's overall left margin and
+be reliably flush with the line numbers of paragraph text.
+Conseqently, line numbers in quotes hang to the left of the quote,
+separated from the quote by the <strong>&lt;gutter&gt;</strong>
+argument.
+<p>
+If you'd like to change the gutter for quotes line-numbered in
+this way, invoke <strong>NUMBER_QUOTE_LINES</strong> with a digit
+representing the number of
+<a href="definitions.html#TERMS_FIGURESPACE">figure spaces</a>
+you'd like between the line numbers and the quoted text, like this:
+<pre>
+ .NUMBER_QUOTE_LINES 1
+</pre>
+
+With the above, line numbers in quotes (and only quotes) will have
+a gutter of 1 figure space.
+<p>
+If you are using "line numbering style" for footnotes
+(<a href="#FOOTNOTE_MARKER_STYLE">FOOTNOTE_MARKER_STYLE</a> <strong>LINE</strong>),
+you may not wish to have quotes <em>visibly</em> line-numbered, but
+still want to embed footnotes inside quotes. In order to do that,
+<strong>mom</strong> allows you to say <strong>NUMBER_QUOTE_LINES
+SILENT</strong>.
+<p>
+When you invoke <strong>NUMBER_QUOTE_LINES</strong>
+<kbd>SILENT</kbd>, <strong>mom</strong> continues to increment line
+numbers while quotes are being output, but they won't appear in the
+output copy. (Compare this with <strong>mom</strong>'s default
+behaviour of <em>suspending</em> incrementing of line numbers
+during the output of quotes.) This allows you to embed
+line-numbered footnotes inside quotes and have the line number
+"label" in the footnote come out sensibly.
+<p>
+Once having turned <strong>NUMBER_QUOTE_LINES</strong> on, you
+may disable it with <strong>NUMBER_QUOTE_LINES OFF</strong> (or
+<strong>QUIT</strong>, <strong>END</strong>, <strong>X</strong>,
+etc).
+<p>
+
+<a name="NUMBER_BLOCKQUOTE_LINES"><h3><u>2. NUMBER_BLOCKQUOTE_LINES</u></h3></a>
+<p>
+If you'd like <strong>mom</strong> to number lines of output text
+in a
+<a href="#QUOTE">BLOCKQUOTE</a>
+as part of the same order and sequence as paragraph text, simply
+invoke <strong>NUMBER_BLOCKQUOTE_LINES</strong> by itself.
+<p>
+There is a catch with numbering blockquotes, though. Owing to
+groff's restriction of accepting only the figure space as the
+line number gutter's unit of measure, it is not possible for line
+numbers in blockquotes to hang outside a document's overall left
+margin and be reliably flush with the line numbers of paragraph
+text. Conseqently, line numbers in blockquotes hang to the
+left of the blockquote, separated from the blockquote by the
+<strong>&lt;gutter&gt;</strong> argument.
+<p>
+If you'd like to change the gutter for blockquotes line-numbered in
+this way, invoke <strong>NUMBER_BLOCKQUOTE_LINES</strong> with a digit
+representing the number of
+<a href="definitions.html#TERMS_FIGURESPACE">figure spaces</a>
+you'd like between the line numbers and the blockquoted text, like
+this:
+<pre>
+ .NUMBER_BLOCKQUOTE_LINES 1
+</pre>
+
+With the above, line numbers in blockquotes (and only blockquotes)
+will have a gutter of 1 figure space.
+<p>
+If you are using "line numbering style" for footnotes
+(<a href="#FOOTNOTE_MARKER_STYLE">FOOTNOTE_MARKER_STYLE</a> <strong>LINE</strong>),
+you may not wish to have blockquotes <em>visibly</em> line-numbered,
+but still want to embed footnotes inside blockquotes. In
+order to do that, <strong>mom</strong> allows you to say
+<strong>NUMBER_BLOCKQUOTE_LINES SILENT</strong>.
+<p>
+When you invoke <strong>NUMBER_BLOCKQUOTE_LINES</strong>
+<kbd>SILENT</kbd>, <strong>mom</strong> continues to increment line
+numbers while blockquotes are being output, but they won't appear in
+the output copy. (Compare this with <strong>mom</strong>'s default
+behaviour of <em>suspending</em> incrementing of line numbers during
+the output of blockquotes.) This allows you to embed line-numbered
+footnotes inside blockquotes and have the line number "label" in the
+footnote come out sensibly.
+<p>
+Once having turned <strong>NUMBER_BLOCKQUOTE_LINES</strong> on, you
+may disable it with <strong>NUMBER_BLOCKQUOTE_LINES OFF</strong> (or
+<strong>QUIT</strong>, <strong>END</strong>, <strong>X</strong>,
+etc).
+<p>
+
+<a name="NUMBER_LINES_QUOTES"><h3><u>3. Setting up line numbering in quotes and blockquotes on a case by case basis</u></h3></a>
+<p>
+Sometimes, you may want quotes or blockquotes to have a different
+line numbering scheme from the one used in the rest of the
+document. Or, you may want line numbering enabled only inside a
+particular quote or blockquote. A common reason for this would be
+if you were using the
+<a href="#QUOTE">QUOTE</a>
+macro to insert lines of programming code into a document. (See
+<a href="#QUOTE_TIP">here</a>
+for suggestions about including programming code snippets in
+documents.)
+<p>
+To enable line numbering within quotes or blockquotes on a case by
+case basis, simply invoke <strong>NUMBER_LINES</strong>, with the
+arguments you need, immediately after entering <strong>QUOTE</strong>
+or <strong>BLOCKQUOTE</strong>. (<strong>NUMBER_QUOTE_LINES</strong>
+and/or <strong>NUMBER_BLOCKQUOTE_LINES</strong> should be turned
+off if you're doing this.) The quote or blockquote will then be
+line-numbered according to your specifications: the starting line
+number of the quote or blockquote will be the one you give as a
+first argument to <strong>NUMBER_LINES</strong>; which lines to
+number will be the value you pass to <strong>&lt;which lines to
+number&gt;</strong> (defaults to "1"); line numbers will hang
+to the left of the quote or blockquote, separated from the quote or
+blockquote by <strong>&lt;gutter&gt;</strong> (defaults to "2").
+<p>
+As soon as <strong>QUOTE</strong> or <strong>BLOCKQUOTE</strong> is
+turned off, line numbering ceases, not only with respect to
+subsequent paragraph text (if they are not being line-numbered),
+but also for any subsequent invocation of <strong>QUOTE</strong> or
+<strong>BLOCKQUOTE</strong>. In other words, you must re-enable
+quote or blockquote line-numbering inside every instance of
+<strong>QUOTE</strong> or <strong>BLOCKQUOTE</strong> when
+line-numbering either of them on a case by case basis.
+<p>
<hr>
<!====================================================================>
@@ -1370,6 +2545,9 @@ spacing policy for
<a name="FOOTNOTE_INTRO"><h2><u>Footnotes</u></h2></a>
<ul>
<li><a href="#FOOTNOTE_BEHAVIOUR">Footnote behaviour</a>
+ <ul>
+ <li><a href="#FN_AND_PUNCT">Footnote markers and punctuation in the running text</a>
+ </ul>
<li><a href="#FOOTNOTE">Tag: FOOTNOTE</a>
<li><a href="#FOOTNOTE_CONTROL">FOOTNOTE control macros</a>
</ul>
@@ -1384,51 +2562,106 @@ You just type, for example
.FOOTNOTE
&lt;footnote about who the hell is Schelling&gt;
.FOOTNOTE OFF
- were generally the points of discussion presenting the most
+ were generally the points of discussion presenting the most
of beauty to the imaginative Morella.
</pre>
-and be done with it. (Note the obligatory use of the
-<strong>\c</strong>
-<a href="definitions.html#TERMS_INLINES">inline escape</a>.)
-<strong>Mom</strong> takes care of everything:
-putting footnote markers in the body of the document, keeping track
-of how many footnotes are on the page, identifying the footnotes
-themeselves appropriately, balancing them properly with the botton
-margin, deferring footnotes that don't fit on the page... Even if
-you're using
+and be done with it.
+<p>
+(Note the obligatory use of the <strong>\c</strong>
+<a href="definitions.html#TERMS_INLINES">inline escape</a>.
+It is required when your
+<a href="#FOOTNOTE_MARKER_STYLE">FOOTNOTE_MARKER_STYLE</a>
+is either <strong>STAR</strong> [star/dagger footnotes] or
+<strong>NUMBER</strong> [superscript numbers]; it is NOT to be used
+when the <strong>FOOTNOTE_MARKER_STYLE</strong> is
+<strong>LINE</strong>, or when footnote markers have been disabled
+with
+<a href="#FOOTNOTE_MARKERS">.FOOTNOTE_MARKERS</a>
+<strong>OFF</strong>.)
+<p>
+<strong>***Version 1.3 change***</strong>
+<p>
+As of version 1.3, the manner of entering the line
+<em>after</em> <strong>.FOOTNOTE OFF</strong> has changed
+to accommodate users' differing wishes with respect to
+the order of punctuation and footnote markers. The
+correct way to enter the line after <strong>.FOOTNOTE
+OFF</strong>--<strong><em><u>ONLY</u></em></strong> if your
+<a href="#FOOTNOTE_MARKER_STYLE">FOOTNOTE_MARKER_STYLE</a> is
+<strong>STAR</strong> or <strong>NUMBER</strong>--is to input
+it as if it's literally a continuation of the line before
+<strong>.FOOTNOTE</strong>, and therefore begins with either a space
+or a punctuation mark, as in the two following examples.
+<p>
+<pre>
+ Example 1 Example 2
+ --------- ---------
+
+ A line of text,\c A line of text\c
+ .FOOTNOTE .FOOTNOTE
+ A footnote line. A footnote line.
+ .FOOTNOTE OFF .FOOTNOTE OFF
+ broken up with a comma. , broken up with a comma.
+
+ (last line begins with (last line begins with
+ a literal space) the comma and a space)
+</pre>
+
+If your <strong>FOOTNOTE_MARKER_STYLE</strong> is line, none of
+this is a concern.
+<p>
+<strong>***End of version 1.3 change***</strong>
+<p>
+After you invoke <strong>FOOTNOTE</strong>, <strong>mom</strong>
+takes care of everything: putting footnote markers in the body of
+the document, keeping track of how many footnotes are on the page,
+identifying the footnotes themselves appropriately, balancing them
+properly with the bottom margin, deferring footnotes that don't fit
+on the page... Even if you're using
<a href="columns.html#COLUMNS">COLUMNS</a>,
<strong>mom</strong> knows what to do, and Does The Right Thing.
<p>
Footnotes can be sly little beasts, though. If you're writing a
document that's footnote-heavy, you might want to read the following.
+<p>
<a name="FOOTNOTE_BEHAVIOUR"><h3><u>Footnote behaviour</u></h3></a>
<p>
-By default, <strong>mom</strong> marks footnotes with
-alternating stars (asterisks) and daggers. The first footnote
-gets a star, the second a dagger, the third two stars,
-the fourth two daggers, etc. If you prefer numbered footnotes, rest
-assured <strong>mom</strong> is happy to oblige.
+By default, <strong>mom</strong> marks footnotes with alternating
+stars (asterisks), daggers, and double-daggers. The first footnote
+gets a star, the second a dagger, the third a double-dagger, the
+fourth two stars, the fifth two daggers, etc. If you prefer
+numbered footnotes, rest assured <strong>mom</strong> is happy to
+oblige.
<p>
A small amount of vertical whitespace and a short horizontal rule
separate footnotes from the document body. The amount of whitespace
varies slightly from page to page depending on the number of lines
-in the footnotes. <strong>Mom</strong> tries for a nice balance
+in the footnotes. <strong>Mom</strong> tries for a nice balance
between too little whitespace and too much, but when push comes to
-shove, she'll opt for ample over cramped. The last lines of footnotes
-are always flush with the document's bottom margin.
+shove, she'll usually opt for ample over cramped. The last lines of
+footnotes are always flush with the document's bottom margin.
+<a name="FOOTNOTE_RULES"></a>
<p>
If <strong>mom</strong> sees that a portion of a footnote cannot
be fit on its page, she carries that portion over to the next
-page. If an entire footnote can't be fitted on its page (i.e.
+page. If an entire footnote can't be fit on its page (i.e.
<strong>FOOTNOTE</strong> has been called too close to the bottom),
she defers the footnote to the next page, but sets it with the
appropriate marker from the previous page.
<p>
+When footnotes occur within cited text, for example a
+<a href="#QUOTE">QUOTE</a>
+or a
+<a href="#BLOCKQUOTE">BLOCKQUOTE</a>,
+<strong>mom</strong> will usually opt for deferring the footnote
+over to the next page if it allows her to complete the cited text
+on one page.
+<p>
In the unfortunate happenstance that a deferred footnote is the
only footnote on its page (i.e. it's marked in the document body with
-a star) and the page it's deferred has its own footnotes,
+a star) and the page it's deferred to has its own footnotes,
<strong>mom</strong> separates the deferred footnote from the page's
proper footnote(s) with a blank line. This avoids the confusion that
might result from readers seeing two footnote entries on the same page
@@ -1437,32 +2670,102 @@ numbered footnotes that begin at 1 on every page). The blank line
makes it clear that the first footnote entry belongs to the previous
page.
<p>
-In the circumstance where a deferred footnote is not the only one on
-its page, and is consequently marked by something other than a single
-star, there's no confusion and <strong>mom</strong> doesn't bother
-with the blank line. (By convention, the first footnote on a page is
-always marked with a single star, so if readers see, say, a dagger or two
-stars marking the first footnote entry, they'll know the entry belongs
-to the previous page).
+In the circumstance where a deferred footnote is not the only one
+on its page, and is consequently marked by something other than a
+single star, there's no confusion and <strong>mom</strong> doesn't
+bother with the blank line. (By convention, the first footnote on
+a page is always marked with a single star, so if readers see, say,
+a dagger or double-dagger marking the first footnote entry, they'll
+know the entry belongs to the previous page).
+<p>
+Very exceptionally, two footnotes may have to be deferred (e.g. one
+occurs on the second to last line of a page, and another on the
+last line). In such a circumstance, <strong>mom</strong> does not
+add a blank after the second deferred footnote. If you'd like a
+blank line separating both deferred footnotes from any footnotes
+proper to the page the deferred ones were moved to, add the space
+manually by putting a
+<a href="typesetting.html#SPACE">.SPACE</a>
+command at the end of the footnote text, before
+<strong>FOOTNOTE OFF</strong> (or <strong>FOOTNOTE X, QUIT,
+EXIT, etc...</strong>).
<p>
Obviously, deferred footnotes aren't an issue if you request numbered
footnotes that increase incrementally throughout the whole document --
yet another convenience <strong>mom</strong> has thought of.
<p>
-Exceptionally, you may encounter problems with footnotes inside
-quotes and blockquotes that cross a page or column. See
-<a href="#BREAK_QUOTE">BREAK_QUOTE</a>
+While <strong>mom</strong>'s handling of footnotes is
+sophisticated, and tries to take nearly every imaginable situation
+under which they might occur into account, some situations are
+simply impossible from a typographic standpoint. For example, if
+you have a
+<a href="#HEAD">HEAD</a>
+near the bottom of the page AND that page has some footnotes on it,
+<strong>mom</strong> may simply not have room to set any text under
+the head (normally, she insists on having room for at least one line
+of text beneath a head). In such an instance, <strong>mom</strong>
+will either set the head, with nothing under it but footnotes,
+or transfer the head to the next page. Either way, you'll have a
+gaping hole at the bottom of the page. It's a sort of typographic
+Catch-22, and can only be resolved by you, the writer or formatter
+of the document, adjusting the type on the offending page so as to
+circumvent the problem.
+<p>
+<strong>NOTE:</strong> Exceptionally, you may encounter problems with footnotes inside
+quotes and blockquotes that cross a page or column. See <a
+href="#BREAK_QUOTE">BREAK_QUOTE</a>
for a solution.
-<br>
+<p>
+
+<h3><u><a name="FN_AND_PUNCT">Footnote markers and punctuation in the running text</a></u></h3>
+
+<p>
+As of version 1.3, the manner of entering the line <em>after</em>
+<strong>.FOOTNOTE OFF</strong> has changed. The correct way to
+enter the line after <strong>.FOOTNOTE OFF</strong> now is to
+input it as if it's literally a continuation of the line before
+<strong>.FOOTNOTE</strong>, and therefore begins with either a space
+or a punctuation mark, as in the two following examples.
+<p>
+<pre>
+ Example 1 Example 2
+ --------- ---------
+
+ A line of text,\c A line of text\c
+ .FOOTNOTE .FOOTNOTE
+ A footnote line. A footnote line.
+ .FOOTNOTE OFF .FOOTNOTE OFF
+ broken up with a comma. , broken up with a comma.
+
+ (last line begins with (last line begins with
+ a literal space) the comma and a space)
+</pre>
+
+Care must be taken, though, if the punctuation mark that begins the
+line after <strong>FOOTNOTE OFF</strong> is a period (dot). You
+<strong><em><u>must</u></em></strong> begin such lines with
+<strong>\&.</strong>, like this:
+<p>
+<pre>
+ end of a sentence\c
+ .FOOTNOTE
+ A footnote line.
+ .FOOTNOTE OFF
+ \&. A new sentence...
+</pre>
+
+If you omit the <strong>\&.</strong>, the line will vanish!
+<p>
+
<!---FOOTNOTE--->
<hr width="66%" align="left">
<p>
<a name="FOOTNOTE">
- Macro: <strong>FOOTNOTE</strong> <var>&lt;toggle&gt; | INDENT LEFT | RIGHT | BOTH &lt;indent value&gt;</var>
+ <nobr>Tag: <strong>FOOTNOTE</strong> &lt;toggle&gt; | INDENT LEFT | RIGHT | BOTH &lt;indent value&gt;</nobr>
<br>
- <em>*See <a href="#FOOTNOTE_NOTE">HYPER-IMPORTANT NOTE</a>!!!
+ <em>*See <a href="#FOOTNOTE_NOTE">HYPER-IMPORTANT NOTE</a>!!!</em>
<br>
&lt;indent value&gt; requires a
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -1502,25 +2805,45 @@ The final word on the
that comes immediately before <strong>FOOTNOTE</strong> MUST terminate
with a
<a href="typesetting.html#JOIN">\c</a>
-inline escape. Otherwise, the footnote marker for the word won't be attached to
-it (i.e. <strong>mom</strong> will insert a word space between the word
-and the marker). See the
+inline escape if your
+<a href="#FOOTNOTE_MARKER_STYLE">FOOTNOTE_MARKER_STYLE</a>
+is either <strong>STAR</strong> or <strong>NUMBER</strong>.
+See the
<a href="#FOOTNOTE_EXAMPLE">footnote example</a>
above.
+<p>
+Additionally, the line <em>after</em> a <strong>FOOTNOTE
+OFF</strong> should be entered as if there were no interruption in
+the input text, i.e. the line should begin with a literal space or
+punctuation mark. See
+<a href="#FN_AND_PUNCT">above</a>.
+<p>
+Do NOT use the <strong>\c</strong> inline escape if your
+<strong>FOOTNOTE_MARKER_STYLE</strong> is <strong>LINE</strong>, or
+if you have disabled footnote markers with
+<a href="#FOOTNOTE_MARKERS">.FOOTNOTE_MARKERS</a>
+<strong>OFF</strong>. As well, the line after
+<strong>FOOTNOTE&nbsp;OFF</strong> should be entered normally.
<p>
<a name="FOOTNOTE_CONTROL"><h3><u>Footnote control macros</u></h3></a>
<ol>
- <li><a href="#FOOTNOTE_GENERAL">Family/font/size/lead/quad</a>
+ <li><a href="#FOOTNOTE_GENERAL">Family/font/size/colour/lead/quad</a>
<li><a href="#FOOTNOTE_MARKERS">Footnote markers</a> -- on or off
- <li><a href="#FOOTNOTE_MARKER_STYLE">Footnote marker style</a> -- star+dagger or numbered
+ <li><a href="#FOOTNOTE_MARKER_STYLE">Footnote marker style</a> -- star+dagger, numbered or by line number
+ <ul>
+ <li><a href="#FOOTNOTE_LINENUMBER_BRACKETS">FOOTNOTE_LINENUMBER_BRACKETS</a>
+ <li><a href="#FOOTNOTE_LINENUMBER_SEPARATOR">FOOTNOTE_LINENUMBER_SEPARATOR</a>
+ <li><a href="#FOOTNOTES_RUN_ON">FOOTNOTES_RUN_ON</a>--line-numbered footnotes only
+ </ul>
<li><a href="#RESET_FOOTNOTE_NUMBER">Reset footnote number</a> -- set footnote marker number to 1
+ <li><a href="#FOOTNOTE_SPACE">Inter-footnote spacing</a>
<li><a href="#FOOTNOTE_RULE">Footnote rule</a> -- on or off
<li><a href="#FOOTNOTE_RULE_LENGTH">Footnote rule length</a> -- length of footnote separator rule
<li><a href="#FOOTNOTE_RULE_ADJ">Adjust vertical position of footnote separator rule</a>
</ol>
<p>
-<a name="FOOTNOTE_GENERAL"><h3><u>1. Family/font/size/quad/lead</u></h3></a>
+<a name="FOOTNOTE_GENERAL"><h3><u>1. Family/font/size/colour/lead/quad</u></h3></a>
<p>
See
<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
@@ -1529,11 +2852,13 @@ See
.FOOTNOTE_FAMILY default = prevailing document family; default is Times Roman
.FOOTNOTE_FONT default = roman
.FOOTNOTE_SIZE default = -2 (points)
+.FOOTNOTE_COLOR default = black
.FOOTNOTE_AUTOLEAD default = 2 points (typeset); single-spaced (typewrite)
.FOOTNOTE_QUAD default = same as paragraphs
</pre>
<a name="FOOTNOTE_MARKERS"><h3><u>2. Footnote markers -- FOOTNOTE_MARKERS</u></h3></a>
+<p>
If you don't want footnote markers, in either the body of
the document or beside footnote entries themselves, toggle
them off with <strong>.FOOTNOTE_MARKERS OFF</strong> (or
@@ -1541,8 +2866,14 @@ them off with <strong>.FOOTNOTE_MARKERS OFF</strong> (or
you'll have to roll your own. If you want them back on, invoke
<strong>.FOOTNOTE_MARKERS</strong> with no argument. Footnote markers
are on by default.
+<p>
+If <strong>FOOTNOTE_MARKERS</strong> are disabled, do NOT use the
+<strong>\c</strong> inline escape to terminate the line before
+<strong>.FOOTNOTE</strong>.
+<p>
<a name="FOOTNOTE_MARKER_STYLE"><h3><u>3. Footnote marker style -- FOOTNOTE_MARKER_STYLE</u></h3></a>
+<p>
<strong>Mom</strong> gives you two choices of footnote marker style:
star+dagger (see
<a href="#FOOTNOTE_BEHAVIOUR">footnote behaviour</a>
@@ -1557,28 +2888,137 @@ numbers, both in the document body and in the footnote entries
themselves. By default, footnote numbers increase incrementally
(prev. footnote number + 1) throughout the whole document. You can
ask <strong>mom</strong> to start each page's footnote numbers at 1
-with <strong>.RESET_FOOTNOTE_NUMBER</strong> (see below).
+with <strong>.RESET_FOOTNOTE_NUMBER</strong>
+(<a href="#RESET_FOOTNOTE_NUMBER">see below</a>.)
+<a name="FOOTNOTE_LINENUMBERS"><p></a>
+<p>
+<strong>.FOOTNOTE_MARKER_STYLE LINE</strong> lets you have
+footnotes which are identified by line number, rather than by a
+marker in the text. (Note that
+<a href="#NUMBER_LINES">NUMBER_LINES</a>
+must be enabled in order to use this marker style.)
+<p>
+With <strong>FOOTNOTE_MARKER_STYLE LINE</strong>, <strong>mom</strong>
+will identify footnotes either by single line numbers, or line
+ranges. If what you want is a single line number, you need only
+invoke <strong>.FOOTNOTE</strong>, <em>without terminating the text
+line before it with</em> <strong>\c</strong>, at the appropriate
+place in running text.
+<p>
+If you want a range of line numbers (e.g.&nbsp;[5-11]&nbsp;),
+insert, directly into the first line of the range you want, the
+<a href="definitions.html#TERMS_INLINES">inline escape</a>,
+<strong>\*[FN-MARK]</strong>. For the terminating line number of
+the range, you need only invoke <strong>.FOOTNOTE</strong>, (again,
+without attaching <strong>\c</strong> to the text line before it).
+<strong>Mom</strong> is smart enough to figure out that where
+<strong>FOOTNOTE</strong> was invoked represents the terminating
+line number. Range-numbered footnotes are always output on the page
+where <strong>FOOTNOTE</strong> was invoked, not the page where
+<strong>\*[FN-MARK]</strong> appears (subject, of course, to the
+rules for footnotes that fall too close to the bottom of a page, as
+outlined
+<a href="#FOOTNOTE_RULES">here</a>).
+<a name="FOOTNOTE_LINENUMBER_BRACKETS"></a>
+<p>
+<strong>Mom</strong>, by default, puts footnote line numbers inside
+square brackets. The style of the brackets may be changed with
+the macro, <strong>FOOTNOTE_LINENUMBER_BRACKETS</strong>, which
+takes one of three possible arguments: <strong>PARENS</strong>
+("round" brackets), <strong>SQUARE</strong> (the default) or
+<strong>BRACES</strong> (curly braces). If you prefer a
+shortform, the arguments, <strong>(</strong>, <strong>[</strong> or
+<strong>{</strong> may be used instead.
+<a name="FOOTNOTE_LINENUMBER_SEPARATOR"></a>
+<p>
+If you don't want the numbers enclosed in brackets, you may tell
+<strong>mom</strong> to use a "separator" instead. A common
+separator would be the colon, but it can be anything you like. The
+macro to do this is <strong>FOOTNOTE_LINENUMBER_SEPARATOR</strong>,
+which takes, as its single argument, the separator you want. For
+safety and consistency's sake, ALWAYS enclose the argument in
+double-quotes.
+<p>
+The separator can be composed of any legal groff character, or any
+combination of characters. <strong>A word of caution:</strong> when
+using a separator, <strong>mom</strong> doesn't insert a space
+after the separator. Hence, if you want the space (you probably
+do), you must make the space part of the argument you pass to
+<strong>FOOTNOTE_LINENUMBER_SEPARATOR</strong>. For example,
+to get a colon separator with a space after it, you'd do
+<p>
+<pre>
+ .FOOTNOTE_LINENUMBER_SEPARATOR ": "
+</pre>
+
+<a name="FOOTNOTES_RUN_ON"><strong><u>RUN-ON FOOTNOTES</u></strong></a>
+<p>
+Finally, if your footnote marker style is <strong>LINE</strong>, you
+may instruct <strong>mom</strong> to do "run-on style" footnotes.
+Run-on footnotes do not treat footnotes as discrete entities, i.e.
+on a line by themselves. Rather, each footnote is separated from
+the footnote before it by a space, so that the footnotes on any
+given page form a continuous block, like lines in a paragraph. The
+macro to get
+<strong>mom</strong> to run footnotes on is
+<strong>.FOOTNOTES_RUN_ON</strong>. Invoked by itself, it turns
+the feature on. Invoked with any other argument
+(<strong>OFF</strong>, <strong>NO</strong>, etc.), it turns the
+feature off. It is generally NOT a good idea to turn the feature
+on and off during the course of a single document. If you do,
+<strong>mom</strong> will issue a warning if there's going to be a
+problem. However, it is always perfectly safe to enable/disable the
+feature after
+<a href="rectoverso.html#COLLATE">COLLATE</a>.
+<p>
+The usual reason for wanting run-on footnotes is that you're
+using them to hold many, short references. (See
+<a href="refer.html#TOP">here</a>
+for instructions on using the <strong>groff</strong> program,
+<strong>refer</strong>, to set up references.)
+
+<p>
-<a name="RESET_FOOTNOTE_NUMBER"><h3><u>4. Reset footnote number -- RESET FOOTNOTE NUMBER</u></h3></a>
+<a name="RESET_FOOTNOTE_NUMBER"><h3><u>4. Reset footnote number -- RESET_FOOTNOTE_NUMBER</u></h3></a>
+<p>
<strong>.RESET_FOOTNOTE_NUMBER</strong>, by itself, resets
footnote numbering so that the next footnote you enter is
numbered 1.
<p>
<strong>.RESET_FOOTNOTE_NUMBER PAGE</strong> tells
<strong>mom</strong> to start every page's footnote numbering at 1.
+<p>
+
+<a name="FOOTNOTE_SPACE"><h3><u>5. Inter-footnote spacing -- FOOTNOTE_SPACE</u></h3></a>
+<p>
+If you'd like a little extra space between footnotes, you can have
+<strong>mom</strong> put it in for you by invoking
+<strong>.FOOTNOTE_SPACE</strong> with an argument representing the
+amount of extra space you'd like. The argument to
+<strong>FOOTNOTE_SPACE</strong> requires a
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>.
+<p>
+In the following example, footnotes will be separated from each
+other by 3
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>.
+<pre>
+ .FOOTNOTE_SPACE 3p
+</pre>
-<a name="FOOTNOTE_RULE"><h3><u>5. Footnote rule -- FOOTNOTE_RULE</u></h3></a>
+<a name="FOOTNOTE_RULE"><h3><u>6. Footnote rule -- FOOTNOTE_RULE</u></h3></a>
+<p>
If you don't want a footnote separator rule, toggle it off with
<strong>.FOOTNOTE_RULE OFF</strong> (or <strong>END,
QUIT, X</strong>...). Toggle it back on by invoking
<strong>.FOOTNOTE_RULE</strong> with no argument. The default is to
print the rule.
+<p>
-<a name="FOOTNOTE_RULE_LENGTH"><h3><u>6. Footnote rule length -- FOOTNOTE_RULE_LENGTH</u></h3></a>
+<a name="FOOTNOTE_RULE_LENGTH"><h3><u>7. Footnote rule length -- FOOTNOTE_RULE_LENGTH</u></h3></a>
+<p>
If you want to change the length of the footnote separator rule,
invoke <strong>.FOOTNOTE_RULE_LENGTH</strong> with a length, like
this,
-<p>
<pre>
.FOOTNOTE_RULE_LENGTH 1i
</pre>
@@ -1588,8 +3028,11 @@ which sets the length to 1 inch. Note that a
is required. The default is 4
<a href="definitions.html#TERMS_PICASPOINTS">picas</a>
for both
-<a href="docprocessing.html#PRINTSTYLE">printstyles</a>.
-<a name="FOOTNOTE_RULE_ADJ"><h3><u>7. Adjust vertical position of footnote separator rule -- FOOTNOTE_RULE_ADJ</u></h3></a>
+<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLES</a>.
+<p>
+
+<a name="FOOTNOTE_RULE_ADJ"><h3><u>8. Adjust vertical position of footnote separator rule -- FOOTNOTE_RULE_ADJ</u></h3></a>
+<p>
The footnote separator rule is actually a baseline rule that falls
on the
<a href="definitions.html#TERMS_BASELINE">baseline</a>
@@ -1609,7 +3052,21 @@ raises the rule by 4-1/4 points. Note that you can only raise
the rule, not lower it. A
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
is required.
-<br>
+<p>
+<strong>Tip:</strong> If your document
+<a href="definitions.html#TERMS_LEADING">leading</a>
+is 2
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>
+or less (e.g your
+<a href="definitions.html#TERMS_PS">point size</a>
+is 10 and your linespacing is 10, 11, or 12, lowering
+<strong>mom</strong>'s default footnote rule adjustment will
+almost certainly give you nicer looking results than leaving
+the adjustment at the default. Furthermore, you can invoke
+<strong>FOOTNOTE_RULE_ADJ</strong> on any page in which footnotes
+appear, or in any column, so that the placement of the footnote rule
+can be changed on-the-fly, should you wish to do so.
+<p>
<hr>
<!====================================================================>
@@ -1623,7 +3080,7 @@ is required.
</ul>
<li><a href="#ENDNOTE">Tag: ENDNOTE</a>
<li><a href="#ENDNOTES">Macro: ENDNOTES</a> -- tell <strong>mom</strong> to output endnotes
- <li><a href="#ENDNOTE_CONTROL">ENDNOTE control macros</a>
+ <li><a href="#ENDNOTE_CONTROL">ENDNOTES control macros</a>
</ul>
<p>
@@ -1641,27 +3098,66 @@ except that <kbd>.FOOTNOTE</kbd> has been replaced with
.ENDNOTE
&lt;endnote about who the hell is Schelling&gt;
.ENDNOTE OFF
- were generally the points of discussion presenting the most
+ were generally the points of discussion presenting the most
of beauty to the imaginative Morella.
</pre>
As with footnotes, note the obligatory use of the <strong>\c</strong>
-<a href="definitions.html#TERMS_INLINES">inline escape</a>.
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
+when your
+<a href="#ENDNOTE_MARKER_STYLE">ENDNOTE_MARKER_STYLE</a>
+is <strong>NUMBER</strong> (which marks endnotes references in
+<a href="definitions.html#TERMS_RUNNING">running text</a>
+with superscript numbers). When the marker style is
+<strong>LINE</strong>, you must <em>not</em> use the
+<strong>\c</strong> escape.
+<p>
+<strong>***Version 1.3 change***</strong>
+<p>
+As of version 1.3, the manner of entering the line <em>after</em>
+<strong>.ENDNOTE OFF</strong> has changed to accommodate users'
+differing wishes with respect to the order of punctuation and
+endnote markers. The correct way to enter the line after
+<strong>.ENDNOTE OFF</strong>--but <strong><em><u>NOT</u></em></strong>
+if your
+<a href="#ENDNOTE_MARKER_STYLE">ENDNOTE_MARKER_STYLE</a>
+is <strong>LINE</strong>--is to input it as if it's literally
+a continuation of the line before <strong>.ENDNOTE</strong>, and
+therefore begins with either a space or a punctuation mark, as in
+the two following examples.
+<p>
+<a name="EN_PUNCT"></a>
+<pre>
+ Example 1 Example 2
+ --------- ---------
+
+ A line of text,\c A line of text\c
+ .ENDNOTE .ENDNOTE
+ A footnote line. A footnote line.
+ .ENDNOTE OFF .ENDNOTE OFF
+ broken up with a comma. , broken up with a comma.
+
+ (last line begins with (last line begins with
+ a literal space) the comma and a space)
+</pre>
+
+<strong>***End version 1.3 change***</strong>
<p>
Endnotes differ from footnotes in two ways (other than the fact that
endnotes come at the end of a document whereas footnotes appear in the
body of the document):
<br>
<ol>
- <li>Endnotes are always numbered incrementally throughout a
- document. In other words, you don't get a choice of marker styles,
- as you do with footnotes.
+ <li>When your <strong>ENDNOTE_MARKER_STYLE</strong> is
+ <strong>NUMBER</strong>, endnotes are always numbered
+ incrementally, starting at "1".
<li>Endnotes MUST be output explicitly; <strong>mom</strong> does
not output them for you. In
<a href="rectoverso.html#COLLATE">collated</a>
documents, this allows you to choose whether you
want the endnotes to appear at the end of each chapter or
- section, or grouped together at the very end of the document.
+ article in a document, or grouped together at the very end
+ of the document.
</ol>
<p>
Within endnotes, you may use the document element tags
@@ -1682,9 +3178,10 @@ to invoking <strong>QUOTE</strong> or <strong>BLOCKQUOTE</strong>, and
undo them prior to terminating the endnote (i.e. before <strong>ENDNOTE
OFF</strong>), otherwise the changes will affect subsequent quotes and
blockquotes that appear in the document body as well.
+<p>
<a name="ENDNOTE_BEHAVIOUR"><h3><u>Endnote behaviour</u></h3></a>
-<p>
+<br>
When you output endnotes (with
<a href="#ENDNOTES">ENDNOTES</a>),
<strong>mom</strong> finishes processing the last page of your document,
@@ -1697,7 +3194,7 @@ the centre part of the
removed.
<p>
By default, <strong>mom</strong> starts the endnotes page with a
-bold, centered, double-underscored head, &quot;ENDNOTES&quot;.
+bold, centred, double-underscored head, &quot;ENDNOTES&quot;.
Underneath--flush left, bold, and underscored--she prints the document
title (or, in the case of chapters, the chapter number or title). She
then prints the endnotes. Each endnote is identified by its appropriate
@@ -1716,18 +3213,19 @@ The attentive will notice that endnotes have an awful lot of control
macros. This is because endnotes are like a mini-document unto
themselves, and therefore need not be bound by the style parameters of
the body of the document.
+<p>
<a name="ENDNOTE_SPACING">
<h3><u>A Note on Endnote Spacing</u></h3>
</a>
-<p>
+<br>
On the endnotes page(s), each new endnote is separated from the
previous endnote by a full line space. This can result in a bottom
margin that hangs, and is the one instance, other than the use of
<a href="#PP_SPACE">PARA_SPACE</a>,
where <strong>mom</strong> allows unequal bottom alignment of pages.
Should you wish to correct this, by adding or subtracting small amounts
-of space between endnotes that appear together on an endnote page, make
+of space between endnotes that appear together on an endnotes page, make
the adjustment (with
<a href="typesetting.html#ALD">ALD</a>,
<a href="typesetting.html#RLD">RLD</a>
@@ -1736,25 +3234,28 @@ or
<em>at the end of each endnote</em> (i.e. just before invoking
<a href="#ENDNOTE">ENDNOTE OFF</a>)
rather than at the top.
+<p>
<a name="ENDNOTE_COLUMNS">
<h3><u>Endnotes and columnar documents</u></h3>
</a>
-<p>
-At present, there is no way to set a document in columns (see
-<a href="docprocessing.html#COLUMNS">COLUMNS</a>)
-and then turn off column mode for endnotes. If your document is set in
-columns, your endnotes will be, too.
<br>
+Formerly (pre 1.1.6), there was no way to set a document in columns
+(see
+<a href="docprocessing.html#COLUMNS">COLUMNS</a>)
+and then turn off column mode for endnotes. As of version 1.1.6,
+you may now do so. See
+<a href="#ENDNOTES_NO_COLUMNS">ENDNOTES_NO_COLUMNS</a>.
+<p>
<hr>
<!---ENDNOTE--->
<p>
<a name="ENDNOTE">
- Macro: <strong>ENDNOTE</strong> <var>&lt;toggle&gt;</var>
+ <nobr>Macro: <strong>ENDNOTE</strong> &lt;toggle&gt;</nobr>
<br>
- <em>*See <a href="#ENDNOTE_NOTE">HYPER-IMPORTANT NOTE</a>!!!
+ <em>*See <a href="#ENDNOTE_NOTE">HYPER-IMPORTANT NOTE</a>!!!</em>
</a>
<p>
@@ -1770,23 +3271,36 @@ that you've finished the endnote.
tag. Use <strong>PP</strong> only to introduce subsequent paragraphs.
<p>
<a name="ENDNOTE_NOTE"><strong>HYPER-IMPORTANT NOTE:</strong></a>
-The final word on the
+If your
+<a href="#ENDNOTE_MARKER_STYLE">ENDNOTE_MARKER_STYLE</a>
+is <strong>NUMBER</strong> (<strong>mom</strong>'s default), the
+final word on the
<a href="definitions.html#TERMS_INPUTLINE">input line</a>
that comes immediately before <strong>ENDNOTE</strong> MUST terminate
with a
<a href="typesetting.html#JOIN">\c</a>
-inline escape. Otherwise, the endnote number for the word won't be attached to
-it (i.e. <strong>mom</strong> will insert a word space between the word
-and the number). See the
+inline escape. See the
<a href="#ENDNOTE_EXAMPLE">endnote example</a>
above.
-<br>
+<p>
+Additionally, the line <em>after</em>
+<strong>.ENDNOTE&nbsp;OFF</strong> should be entered as if there
+were no interruption in the input text, i.e. the line should begin
+with a literal space or punctuation mark. See the two
+<a href="#EN_PUNCT">examples</a>,
+above.
+<p>
+If your <strong>ENDNOTE_MARKER_STYLE</strong> is
+<strong>LINE</strong>, do NOT use the <strong>\c</strong> escape,
+and enter the line after <strong>.ENDNOTE&nbsp;OFF</strong>
+normally.
+<p>
<!---ENDNOTES--->
<hr width="66%" align="left">
<p>
-<a name="ENDNOTES">Macro: <strong>ENDNOTES</strong></a>
+<a name="ENDNOTES">Tag: <strong>ENDNOTES</strong></a>
<p>
Unlike footnotes, which <strong>mom</strong> automatically outputs at the
@@ -1810,34 +3324,58 @@ appropriately, on a separate page prior to starting the next section of
the document. Each subsequent invocation of <strong>ENDNOTES</strong>
outputs only those endnotes that <strong>mom</strong> collected
after the previous invocation.
-<br>
+<p>
<hr width="66%" align="left">
<a name="ENDNOTE_CONTROL"><h3><u>Endnote control macros</u></h3></a>
<p>
-Every time you embed an endnote in the body of a document,
-<strong>mom</strong> collects <em>and processes</em> the endnote for
-later outputting when you invoke
-<a href="#ENDNOTES">ENDNOTES</a>.
-For this reason, endnote control macros should always be invoked prior
-to the first instance of
-<a href="#ENDNOTE">ENDNOTE/ENDNOTE OFF</a>.
+<strong>VERY IMPORTANT NOTE!</strong>
<br>
+Endnote control macros must always be invoked prior to the first
+instance of
+<a href="#ENDNOTE">ENDNOTE/ENDNOTE OFF</a>.
+<p>
+When you embed endnotes in the body of a document,
+<strong>mom</strong> collects <em>and processes</em> them for later
+outputting (when you invoke
+<a href="#ENDNOTES">ENDNOTES</a>).
+By the time you do invoke <strong>ENDNOTES</strong>, it's much too
+late to change your mind about how you want them to look.
+<p>
+My advice? If you're planning to change the default appearance of
+endnotes pages, set them up prior to
+<a href="docprocessing.html#START">START</a>.
+<p>
<ol>
<li><a href="#ENDNOTES_GENERAL"><strong>General endnotes-pages style control</strong></a>
<ul>
- <li><a href="#ENDNOTE_GENERAL">Base family/font/quad for endnotes-pages</a>
+ <li><a href="#ENDNOTE_STYLE">Base family/font/quad for endnotes-pages</a>
<li><a href="#ENDNOTE_PT_SIZE">Base point size for the endnotes-pages</a>
<li><a href="#ENDNOTE_LEAD">Leading of endnotes-pages</a>
+ <li><a href="#SINGLESPACE_ENDNOTES">Singlespace endnotes (for TYPEWRITE only)</a>
<li><a href="#ENDNOTE_PARA_INDENT">Size of paragraph first line indent in multi-paragraph endnotes</a>
<li><a href="#ENDNOTE_PARA_SPACE">Inserting space between paragraphs of multi-paragraph endnotes</a>
+ <li><a href="#ENDNOTES_NO_COLUMNS">Turning off column mode during endnotes output</a>
+ <li>Pagination of endnotes:
+ <ul>
+ <li><a href="#ENDNOTES_PAGENUM_STYLE">Endnotes-pages page numbering style</a>
+ <li><a href="#ENDNOTES_FIRST_PAGENUMBER">Setting the first page number of endnotes pages</a>
+ <li><a href="#ENDNOTES_NO_FIRST_PAGENUM">Omitting a page number on the first page of endnotes</a>
+ </ul>
+ <li><a href="#SUSPEND_PAGINATION">Suspending pagination of endnotes pages</a>
</ul>
<li><a href="#ENDNOTES_HEADER_CONTROL"><strong>Endnotes-page header/footer control</strong></a>
- <li><a href="#ENDNOTES_MAIN_TITLE"><strong>Endnotes-page head control</strong></a>
+ <ul>
+ <li><a href="#ENDNOTES_MODIFY_HDRFTR">Modifying what goes in the endnotes-pages header/footer</a>
+ <li><a href="#ENDNOTES_HDRFTR_CENTER">Enabling a header/footer centre when doctype is CHAPTER</a>
+ <li><a href="#ENDNOTES_ALLOWS_HEADERS">Allow headers on endnotes-pages</a>
+ </ul>
+ <li><a href="#ENDNOTES_MAIN_TITLE"><strong>Endnotes-page head (i.e. the title at the top) control</strong></a>
<ul>
<li><a href="#ENDNOTE_STRING">Creating/modifying the endnotes-page head</a>
<li><a href="#ENDNOTE_STRING_CONTROL">Endnotes-page head control</a>
<li><a href="#ENDNOTE_STRING_UNDERSCORE">Endnotes-page head underscoring</a>
+ <li><a href="#ENDNOTE_STRING_CAPS">Endnotes-page head capitalization</a>
</ul>
<li><a href="#ENDNOTES_DOC_TITLE"><strong>Endnote document-identification title</strong></a>
<ul>
@@ -1847,6 +3385,12 @@ to the first instance of
</ul>
<li><a href="#ENDNOTES_NUMBERING"><strong>Endnotes-pages endnote numbering style</strong></a>
<ul>
+ <li><a href="#ENDNOTE_MARKER_STYLE">Endnote marker style</a>--by numbers in the text, or by line number
+ <ul>
+ <li><a href="#ENDNOTE_LINENUMBER_GAP">ENDNOTE_LINENUMBER_GAP</a>
+ <li><a href="#ENDNOTE_LINENUMBER_BRACKETS">ENDNOTE_LINENUMBER_BRACKETS</a>
+ <li><a href="#ENDNOTE_LINENUMBER_SEPARATOR">ENDNOTE_LINENUMBER_SEPARATOR</a>
+ </ul>
<li><a href="#ENDNOTE_NUMBER_CONTROL">Endnotes-pages endnote numbering style control</a>
<li><a href="#ENDNOTE_NUMBER_ALIGNMENT">Endnote numbering alignment</a>
<ul>
@@ -1859,7 +3403,7 @@ to the first instance of
<a name="ENDNOTES_GENERAL"><h2><u>1. General endnotes page style control</u></h2>
-<a name="ENDNOTE_GENERAL"><h3><u>Endnote family/font/quad</u></h3></a>
+<a name="ENDNOTE_STYLE"><h3><u>*Endnote family/font/quad</u></h3></a>
<p>
See
<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
@@ -1867,14 +3411,16 @@ See
<pre>
.ENDNOTE_FAMILY default = prevailing document family; default is Times Roman
.ENDNOTE_FONT default = roman
-.ENDNOTE_QUAD default = justified
+.ENDNOTE_QUAD* default = justified
+
+*Note: ENDNOTE_QUAD must be set to either L or J
</pre>
<!---ENDNOTE_PT_SIZE--->
-<a name="ENDNOTE_PT_SIZE"><h3><u>Endnote point size</u></h3></a>
+<a name="ENDNOTE_PT_SIZE"><h3><u>*Endnote point size</u></h3></a>
<p>
-Macro: <strong>ENDNOTE_PT_SIZE</strong> <var>&lt;base type size of endnotes&gt;</var>
+<nobr>Macro: <strong>ENDNOTE_PT_SIZE</strong> &lt;base type size of endnotes&gt;</nobr>
<p>
Unlike most other control macros that deal with size of document
@@ -1906,13 +3452,16 @@ the point size of other endnote page elements is calculated.
<p>
The default for
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPESET</a>
-is 12 points (the same default size used in the body of the document).
+is 12.5 points (the same default size used in the body of the document).
+<p>
<!---ENDNOTE_LEAD--->
-<a name="ENDNOTE_LEAD"><h3><u>Endnote lead</u></h3></a>
+<a name="ENDNOTE_LEAD"><h3><u>*Endnote lead</u></h3></a>
<p>
-Macro: <strong>ENDNOTE_LEAD</strong> <var>&lt;base leading of endnotes&gt;</var>
+<nobr>Macro: <strong>ENDNOTE_LEAD</strong> &lt;base leading of endnotes&gt; [ ADJUST ] </nobr>
+<br>
+<em>*Does not require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>; points is assumed</em>
<p>
Unlike most other control macros that deal with leading of document
@@ -1939,15 +3488,52 @@ points, whereas
sets the base leading of type on the endnotes page to 1/2 inch.
<p>
+If you want the leading of endnotes adjusted to fill the page, pass
+<strong>ENDNOTE_LEAD</strong> the optional argument
+<strong>ADJUST</strong>. (See
+<a href="docprocessing.html#DOC_LEAD_ADJUST">DOC_LEAD_ADJUST</a>
+for an explanation of leading adjustment.)
+<p>
The default for
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPESET</a>
-is 14 points.
+is 14 points, adjusted.
+<p>
+<strong>NOTE:</strong> Even if you give <strong>mom</strong> a
+<strong>DOC_LEAD_ADJUST OFF</strong> command, she will still, by
+default, adjust endnote leading. You MUST enter
+<strong>ENDNOTE_LEAD &lt;lead&gt;</strong> with no
+<strong>ADJUST</strong> argument to disable this default behaviour.
+<p>
+
+<!---SINGLESPACE_ENDNOTES--->
+
+<a name="SINGLESPACE_ENDNOTES"><h3><u>*Singlespace endnotes (TYPEWRITE only)</u></h3></a>
+<p>
+<nobr>Macro: <strong>SINGLESPACE_ENDNOTES</strong> &lt;toggle&gt;</nobr>
+
+<p>
+If your
+<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE</a>
+is <strong>TYPEWRITE</strong> and you use TYPEWRITE's default
+double-spacing, endnotes are double-spaced. If your document is
+single-spaced, endnotes are single-spaced.
+<p>
+If, for some reason, you'd prefer that endnotes be single-spaced
+in an otherwise double-spaced document (including double-spaced
+<a href="rectoverso.html#COLLATE">collated</a>
+documents), invoke <strong>SINGLESPACE_ENDNOTES</strong> with
+no argument. And if, god help you, you want to change endnote
+single-spacing back to double-spacing for different spacing of
+endnotes output at the ends of separate documents in a collated
+document, invoke <strong>SINGLESPACE_ENDNOTES</strong> with any
+argument (<strong>OFF, QUIT, Q, X</strong>...).
+<p>
<!---ENDNOTE_PARA_INDENT--->
-<a name="ENDNOTE_PARA_INDENT"><h3><u>Endnote paragraph indent</u></h3></a>
+<a name="ENDNOTE_PARA_INDENT"><h3><u>*Endnote paragraph indenting</u></h3></a>
<p>
-Macro: <strong>ENDNOTE_PARA_INDENT</strong> <var>&lt;amount to indent first line of paragraphs in endnotes&gt;</var>
+<nobr>Macro: <strong>ENDNOTE_PARA_INDENT</strong> &lt;amount to indent first line of paragraphs in endnotes&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -1969,12 +3555,13 @@ for
(the one attached immediately to the identifying endnote number) is
never indented. Only subsequent paragraphs are affected by
<strong>ENDNOTE_PARA_INDENT</strong>.
+<p>
<!---ENDNOTE_PARA_SPACE--->
-<a name="ENDNOTE_PARA_SPACE"><h3><u>Endnote paragraph spacing</u></h3></a>
+<a name="ENDNOTE_PARA_SPACE"><h3><u>*Endnote paragraph spacing</u></h3></a>
<p>
-Macro: <strong>ENDNOTE_PARA_SPACE</strong> <var>&lt;toggle&gt;</var>
+<nobr>Macro: <strong>ENDNOTE_PARA_SPACE</strong> &lt;toggle&gt;</nobr>
<p>
<strong>ENDNOTE_PARA_SPACE</strong> works exactly the same way as
@@ -1988,11 +3575,107 @@ endnotes.
<strong>NOTE:</strong> Each endnote itself is always separated from any
previous endnote by a line space. <strong>ENDNOTE_PARA_SPACE</strong>
refers only to paragraphs that appear within each discrete endnote.
+<p>
+
+<!---ENDNOTES_NO_COLUMNS--->
+
+<a name="ENDNOTES_NO_COLUMNS"><h3><u>*Turning off column mode during endnotes output</u></h3></a>
+<p>
+<nobr>Macro: <strong>ENDNOTES_NO_COLUMNS</strong> &lt;toggle&gt;</nobr>
+
+<p>
+By default, if your document is
+<a href="columns.html#COLUMNS">set in columns</a>,
+<strong>mom</strong> sets the endnotes in columns, too. However,
+if your document is set in columns and you'd like the endnotes not
+to be, just invoke <strong>ENDNOTES_NO_COLUMNS</strong> with no
+argument. The endnotes pages will be set to the full page measure
+of your document.
+<p>
+If you output endnotes at the end of each document in a
+<a href="rectoverso.html#COLLATE">collated</a>
+document set in columns, column mode will automatically
+be reinstated for each document, even with
+<strong>ENDNOTES_NO_COLUMNS</strong> turned on.
+<p>
+
+<!---ENDNOTES_PAGENUM_STYLE--->
+
+<a name="ENDNOTES_PAGENUM_STYLE"><h3><u>*Endnotes-pages page numbering style</u></h3></a>
+<p>
+<nobr>Macro: <strong>ENDNOTES_PAGENUM_STYLE</strong> DIGIT | ROMAN | roman | ALPHA | alpha</nobr>
+
+<p>
+Use this macro to set the page numbering style of endnotes pages.
+The arguments are identical to those for
+<a href="headfootpage.html#PAGENUM_STYLE">PAGENUM_STYLE</a>.
+The default is <strong>digit</strong>. You may want to change it
+to, say, <strong>alpha</strong>, which you would do with
+<p>
+<pre>
+ .ENDNOTES_PAGENUM_STYLE alpha
+</pre>
+
+<!---ENDNOTES_FIRST_PAGENUMBER--->
+
+<a name="ENDNOTES_FIRST_PAGENUMBER"><h3><u>*Setting the first page number of endnotes pages</u></h3></a>
+<p>
+<nobr>Macro: <strong>ENDNOTES_FIRST_PAGENUMBER</strong> &lt;page # that appears on page 1 of endnotes&gt;</nobr>
+
+<p>
+Use this macro with caution. If all endnotes for several
+<a href="rectoverso.html#COLLATE">collated</a>
+documents are to be output at once, i.e. not at the end of each
+separate doc, <strong>ENDNOTES_FIRST_PAGENUMBER</strong> tells
+<strong>mom</strong> what page number to put on the first page of
+the endnotes.
+<p>
+If you set <strong>ENDNOTES_FIRST_PAGENUMBER</strong> in collated
+documents where the endnotes are output after each separate doc,
+you have to reset every separate document's first page number after
+<a href="rectoverso.html#COLLATE">COLLATE</a>
+and before
+<a href="docprocessing.html#START">START</a>.
+<p>
+
+<!---ENDNOTES_NO_FIRST_PAGENUN--->
+
+<a name="ENDNOTES_NO_FIRST_PAGENUM"><h3><u>*Omitting a page number on the first page of endnotes</u></h3></a>
+<p>
+<nobr>Macro: <strong>ENDNOTES_NO_FIRST_PAGENUM</strong> &lt;toggle&gt;</nobr>
+
+<p>
+This macro is for use only if <strong>FOOTERS</strong> are on. It
+tells
+<a href="#ENDNOTES">ENDNOTES</a>
+not to print a page number on the first endnotes page.
+<strong>Mom</strong>'s default is to print the page number.
+<p>
+
+<!---SUSPEND_PAGINATION--->
+
+<a name="SUSPEND_PAGINATION"><h3><u>*Suspending pagination of endnotes pages</u></h3></a>
+<p>
+Macro: <strong>SUSPEND_PAGINATION</strong>
+<br>
+Macro: <strong>RESTORE_PAGINATION</strong>
+
+<p>
+<strong>SUSPEND_PAGINATION</strong> doesn't take an argument.
+Invoked immediately prior to
+<a href="#ENDNOTES">ENDNOTES</a>,
+it turns off endnotes pages pagination. <strong>Mom</strong>
+continues, however to increment page numbers silently.
+<p>
+To restore normal document pagination after endnotes, invoke
+<strong>RESTORE_PAGINATION</strong> (again, with no argument)
+immediately after <strong>ENDNOTES</strong>.
<a name="ENDNOTES_HEADER_CONTROL"><h2><u>2. Endnotes-page header/footer control</u></h2></a>
<p>
-If you wish to modify the header/footer that appears on endnotes
-page(s), make the changes before you invoke
+<a name="ENDNOTES_MODIFY_HDRFTR"></a>
+If you wish to modify what appears in the header/footer that appears
+on endnotes page(s), make the changes before you invoke
<a href="#ENDNOTES">ENDNOTES</a>,
not afterwards.
<p>
@@ -2007,10 +3690,27 @@ title.) In most cases, this is what you want. However, should you
the endnotes page(s) headers/footers, invoke
<a href="#ENDNOTES_HDRFTR_CENTER">ENDNOTES_HEADER_CENTER</a>
with no argument.
+<p>
+An important change you may want to make is to put the word
+&quot;Endnotes&quot; in the header/footer centre position.
+To do so, do
+<p>
+<pre>
+ .HEADER_CENTER "Endnotes"
+ or
+ .FOOTER_CENTER "Endnotes"
+</pre>
+
+prior to invoking <strong>.ENDNOTES</strong>. If your
+<a href="docprocessing.html#DOCTYPE">DOCTYPE</a>
+is <kbd>CHAPTER</kbd>, you must also invoke
+<a href="#ENDNOTES_HDRFTR_CENTER">ENDNOTES_HEADER_CENTER</a>
+for the <strong>HEADER_CENTER</strong> to appear.
+<p>
-<a name="ENDNOTES_HDRFTR_CENTER"><h3><u>Endnotes page(s) header/footer center string</u></h3></a>
+<a name="ENDNOTES_HDRFTR_CENTER"><h3><u>*Endnotes page(s) header/footer centre string</u></h3></a>
<p>
-Macro: <strong>ENDNOTES_HEADER_CENTER</strong> <var>toggle</var>
+<nobr>Macro: <strong>ENDNOTES_HEADER_CENTER</strong> toggle</nobr>
<p>
If your
@@ -2019,20 +3719,45 @@ is <kbd>CHAPTER</kbd> and you want <strong>mom</strong> to include
a centre string in the headers/footers that appear on endnotes pages,
invoke <strong>ENDNOTES_HEADER_CENTER</strong> (or
<strong>ENDNOTES_FOOTER_CENTER</strong>) with no argument.
-<strong>Mom</strong>'s default is NOT to print the center string.
+<strong>Mom</strong>'s default is NOT to print the centre string.
+<p>
+If, for some reason, having enabled the header/footer centre string
+on endnotes pages, you wish to disable it, invoke the same macro
+with any argument (<strong>OFF, QUIT, Q, X</strong>...).
+<p>
+
+<a name="ENDNOTES_ALLOWS_HEADERS"><h3><u>*Allow headers on endnotes-pages</u></h3></a>
+<p>
+<nobr>Macro: <strong>ENDNOTES_ALLOWS_HEADERS</strong> &lt;none&gt; | ALL</nobr>
+
<p>
-If, for some
-reason, having enabled the header/footer center string on endnotes
-pages, you wish to disable it, invoke the same macro with any argument
-(<strong>OFF, QUIT, Q, X</strong>...).
+By default, if <strong>HEADERS</strong> are on, <strong>mom</strong>
+prints page headers on all endnotes pages except the first. If you
+don't want her to print headers on endnotes pages, do
+<p>
+<pre>
+ .ENDNOTES_ALLOWS_HEADERS OFF
+</pre>
+
+If you want headers on every page <em>including the first</em>, do
+<p>
+<pre>
+ .ENDNOTES_ALLOWS_HEADERS ALL
+</pre>
-<a name="ENDNOTES_MAIN_TITLE"><h2><u>3. Endnotes page head control</u></h2>
+<strong>NOTE:</strong> If <strong>FOOTERS</strong> are on,
+<strong>mom</strong> prints footers on every endnotes page. This is
+a style convention. In <strong>mom</strong>, there is no such beast
+as <strong>ENDNOTES_ALLOWS_FOOTERS OFF</strong>.
+<p>
+
+<a name="ENDNOTES_MAIN_TITLE"><h2><u>3. Endnotes-page first page head (title) control</u></h2>
<!---ENDNOTE_STRING--->
-<a name="ENDNOTE_STRING"><h3><u>Endnotes-page head string</u></h3></a>
+<a name="ENDNOTE_STRING"><h3><u>*Endnotes-page first page head (title) string</u></h3></a>
<p>
-Macro: <strong>ENDNOTE_STRING</strong> <var>&quot;&lt;head to print at the top of endnotes&gt;&quot;</var>
+<nobr>Macro: <strong>ENDNOTE_STRING</strong> &quot;&lt;head to print at the top of endnotes&gt;&quot;</nobr>
<p>
By default, <strong>mom</strong> prints the word &quot;ENDNOTES&quot;
@@ -2043,28 +3768,29 @@ you don't want a head at the top of the first endnotes-page, invoke
<strong>ENDNOTE_STRING</strong> with a blank argument (either two
double-quotes side by side -- <kbd>&quot;&quot;</kbd> -- or no argument
at all).
+<p>
<!---ENDNOTE_STRING_CONTROL--->
-<a name="ENDNOTE_STRING_CONTROL"><h3><u>Endnotes-page head control</u></h3></a>
+<a name="ENDNOTE_STRING_CONTROL"><h3><u>*Endnotes-page first page head (title) control</u></h3></a>
<p>
See
<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
<p>
<pre>
.ENDNOTE_STRING_FAMILY default = prevailing document family; default is Times Roman
-.ENDNOTE_STRING_FONT* default = bold
-.ENDNOTE_STRING_SIZE default = +1
-.ENDNOTE_STRING_QUAD default = centered
+.ENDNOTE_STRING_FONT default = bold
+.ENDNOTE_STRING_SIZE* default = +1
+.ENDNOTE_STRING_QUAD default = centred
*Relative to the size of the endnotes text (set with ENDNOTE_PT_SIZE)
</pre>
<!---ENDNOTE_STRING_UNDERSCORE--->
-<a name="ENDNOTE_STRING_UNDERSCORE"><h3><u>Endnotes-page head underscoring</h3></u></a>
+<a name="ENDNOTE_STRING_UNDERSCORE"><h3><u>*Endnotes-page head (title) underscoring</h3></u></a>
<p>
-Macro: <strong>ENDNOTE_STRING_UNDERSCORE</strong> <var>toggle | 2</var>
+<nobr>Macro: <strong>ENDNOTE_STRING_UNDERSCORE</strong> toggle | 2</nobr>
<p>
Invoked by itself, <strong>ENDNOTE_STRING_UNDERSCORE</strong> will
@@ -2079,27 +3805,55 @@ head, therefore if you want no underscoring, you must insert
NONE,</kbd> etc.) into your document prior to outputting endnotes with
<a href="#ENDNOTES">ENDNOTES</a>.
+<!---ENDNOTE_STRING_CAPS--->
+
+<a name="ENDNOTE_STRING_CAPS"><h3><u>*Endnotes-page head (title) automatic capitalization</h3></u></a>
+<p>
+<nobr>Macro: <strong>ENDNOTE_STRING_CAPS</strong> toggle</nobr>
+
+<p>
+Invoked by itself, <strong>ENDNOTE_STRING_CAPS</strong> will
+automatically capitalize the endnotes-page head. Invoked with any
+other argument, the macro disables automatic capitalization of the
+head.
+<p>
+If you're generating a table of contents, you may want the
+endnotes-pages head string in caps, but the toc entry in caps/lower
+case. If the argument to
+<a href="#ENDNOTE_STRING">ENDNOTE_STRING</a>
+is in caps/lower case and <strong>ENDNOTE_STRING_CAPS</strong> is
+on, this is exactly what will happen.
+<p>
+<strong>Mom</strong>'s default is to capitalize the endnotes-pages
+head string.
+<p>
+
<!---ENDNOTE_TITLE--->
<a name="ENDNOTES_DOC_TITLE"><h2><u>4. Endnote document-identification title</u></h2>
-<a name="ENDNOTE_TITLE"><h3><u>Endnote document-identification title string</u></h3></a>
+<a name="ENDNOTE_TITLE"><h3><u>*Endnote document-identification title string</u></h3></a>
<p>
-Macro: <strong>ENDNOTE_TITLE</strong> <var>&quot;&lt;title to identify a document in endnotes&gt;&quot;</var>
+<nobr>Macro: <strong>ENDNOTE_TITLE</strong> &quot;&lt;title to identify a document in endnotes&gt;&quot;</nobr>
<p>
By default, <strong>mom</strong> identifies the document(s) to which
endnotes belong by the document title(s) given to the
<a href="docprocessing.html#TITLE">TITLE</a>
-macro. If you want her to identify the document(s) another way,
-invoke <strong>ENDNOTE_TITLE</strong> with the identifying title you
-want, surrounded by double-quotes. If you don't any identifying title,
-invoke <strong>ENDNOTE_TITLE</strong> with a blank argument (either two
-double-quotes side by side -- <kbd>&quot;&quot;</kbd> -- or no argument
-at all).
+macro. If you'd want her to identify the document(s) another way,
+just invoke <strong>ENDNOTE_TITLE</strong> with the identifying
+title you want, surrounded by double-quotes.
+<p>
+If you don't want any identifying title, invoke
+<strong>ENDNOTE_TITLE</strong> with a blank argument (either two
+double-quotes side by side -- <kbd>&quot;&quot;</kbd> -- or no
+argument at all). This is particularly useful if you have a single
+(i.e. non-collated) document and find having the document's title
+included in the endnotes redundant.
+<p>
<!---ENDNOTE_TITLE_CONTROL--->
-<a name="ENDNOTE_TITLE_CONTROL"><h3><u>Endnote document-identification title control</u></h3></a>
+<a name="ENDNOTE_TITLE_CONTROL"><h3><u>*Endnote document-identification title control</u></h3></a>
<p>
See
<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
@@ -2115,27 +3869,126 @@ See
<!---ENDNOTE_TITLE_UNDERSCORE--->
-<a name="ENDNOTE_TITLE_UNDERSCORE"><h3><u>Endnote document-identification title underscoring</h3></u></a>
+<a name="ENDNOTE_TITLE_UNDERSCORE"><h3><u>*Endnote document-identification title underscoring</h3></u></a>
<p>
-Macro: <strong>ENDNOTE_TITLE_UNDERSCORE</strong> <var>toggle</var>
+<nobr>Macro: <strong>ENDNOTE_TITLE_UNDERSCORE</strong> toggle</nobr>
<p>
-Inovked by itself, <strong>ENDNOTE_TITLE_UNDERSCORE</strong> will
-underscore the endnote document-identification title. Invoked with any
-other argument, the macro disables underscoring of the title.
+Invoked by itself, <strong>ENDNOTE_TITLE_UNDERSCORE</strong> will
+underscore the endnote document-identification title(s). Invoked with any
+other argument, the macro disables underscoring of the title(s).
<p>
<strong>Mom</strong>'s default is to underscore the document-identification title, therefore if you want no underscoring, you must
insert <kbd>.ENDNOTE_TITLE_UNDERSCORE OFF</kbd> (or <kbd>QUIT, X, NO,
NONE,</kbd> etc.) into your document prior to outputting endnotes with
<a href="#ENDNOTES">ENDNOTES</a>.
-
-at all.
+<p>
<!---ENDNOTE_NUMBERING--->
<a name="ENDNOTES_NUMBERING"><h2><u>5. Endnotes-pages endnote numbering style</u></h2>
-<a name="ENDNOTE_NUMBER_CONTROL"><h3><u>Endnote numbering style control</u></h3></a>
+<a name="ENDNOTE_MARKER_STYLE"><h3><u>*Endnote marker style</u></h3></a>
+<p>
+The macro to control how endnotes are referenced is
+<strong>ENDNOTE_MARKER_STYLE</strong>.
+<p>
+By default, <strong>mom</strong> places superscript numbers in
+<a href="definitions.html#RUNNING">running text</a>
+to identify endnotes. However, if you have
+<a href="#NUMBER_LINES">line-numbering</a>
+turned on, you may instruct <strong>mom</strong> not to put
+superscript numbers in the running text, but rather to reference
+endnotes by line number. The command to do this is
+<p>
+<pre>
+ .ENDNOTE_MARKER_STYLE LINE
+</pre>
+
+With <strong>ENDNOTE_MARKER_STYLE LINE</strong>, <strong>mom</strong>
+will identify endnotes either by single line numbers, or line
+ranges. If what you want is a single line number, you need only
+invoke <strong>.ENDNOTE</strong>, <em>without terminating the text
+line before it with</em> <strong>\c</strong>, at the appropriate
+place in running text. (Should you wish to revert to
+<strong>mom</strong>'s default behaviour of placing a superscript
+number in the text to identify an endnote, you can invoke
+<strong>ENDNOTE_MARKER_STYLE</strong> with the argument,
+<strong>NUMBER</strong>. It is not advisable to switch marker
+styles within a single document, for aesthetic reasons, but there
+is nothing to prevent you from doing so.)
+<p>
+If you want a range of line numbers (e.g.&nbsp;[5-11]&nbsp;),
+insert, directly into the first line of the range you want, the
+<a href="definitions.html#TERMS_INLINES">inline escape</a>,
+<strong>\*[EN-MARK]</strong>. For the terminating line number of
+the range, you need only invoke <strong>.ENDNOTE</strong>, (again,
+without attaching <strong>\c</strong> to the text line before it).
+<strong>Mom</strong> is smart enough to figure out that where
+<strong>ENDNOTE</strong> was invoked represents the terminating
+line number.
+<a name="ENDNOTE_LINENUMBER_GAP"></a>
+<p>
+Given the impossibility of knowing, in advance, the "string length"
+of all the line numbers or ranges of line numbers that will be used
+in endnotes (the string length of 12 is two; the string length
+of 12-15 is 5), <strong>mom</strong> cannot "hang" line numbers
+and guarantee that they, and the endnote text, will align in a
+visually pleasing manner. Consequently, <strong>mom</strong> sets
+the entirety of line-numbered endnotes completely flush left,
+<strong>including the line numbers themselves</strong>. The line
+numbers (by default, enclosed in square brackets) are separated from
+the beginning of each endnote by a gap, so that a line-numbered
+endnote looks approximately like this:
+<p>
+<pre>
+ [1-2] Notwithstanding, Frye later asserts that Christianity
+ is "a ghost with the chains of a foul historical record of
+ cruelty clanking behind it."
+</pre>
+
+The default gap for <strong>PRINTSTYLE TYPESET</strong> and
+<strong>PRINSTYLE TYPEWRITE</strong> is 1.5
+<a href="definitions.html#TERMS_EM">ems</a>.
+You can change the size of the gap with the macro,
+<strong>ENDNOTE_LINENUMBER_GAP</strong>, which takes, as its single
+argument, the size of the gap. The argument requires a
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>,
+so, for example, to change the gap to 2
+<a href="definitions.html#TERMS_PICASPOINTS">picas</a>,
+you'd do
+<p>
+<pre>
+ .ENDNOTE_LINENUMBER_GAP 2P
+</pre>
+
+<a name="ENDNOTE_LINENUMBER_BRACKETS"></a>
+By default, <strong>mom</strong> puts endnote line numbers inside
+square brackets. The style of the brackets may be changed with
+the macro, <strong>ENDNOTE_LINENUMBER_BRACKETS</strong>, which
+takes one of three possible arguments: <strong>PARENS</strong>
+("round" brackets), <strong>SQUARE</strong> (the default) or
+<strong>BRACES</strong> (curly braces). If you prefer a
+shortform, the arguments, <strong>(</strong>, <strong>[</strong> or
+<strong>{</strong> may be used instead.
+<a name="ENDNOTE_LINENUMBER_SEPARATOR"></a>
+<p>
+If you don't want the numbers enclosed in brackets, you may tell
+<strong>mom</strong> to use a "separator" instead. A common
+separator would be the colon, but it can be anything you like. The
+macro to do this is <strong>ENDNOTE_LINENUMBER_SEPARATOR</strong>,
+which takes, as its single argument, the separator you want.
+(If the argument contains spaces, don't forget to enclose the
+argument in double-quotes.) The separator can be composed of
+any legal groff character, or any combination of characters.
+For example, to get a colon separator after the line number in
+line-numbered endnotes, you'd do
+<p>
+<pre>
+ .ENDNOTE_LINENUMBER_SEPARATOR :
+</pre>
+
+<a name="ENDNOTE_NUMBER_CONTROL"><h3><u>*Endnote numbering style control</u></h3></a>
<p>
See
<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
@@ -2152,7 +4005,7 @@ endnote numbers that appear in the body of the document(s).
*Relative to the size of the endnotes text (set with ENDNOTE_PT_SIZE)
</pre>
-<a name="ENDNOTE_NUMBER_ALIGNMENT"><h3><u>Endnote numbering alignment</u></h3></a>
+<a name="ENDNOTE_NUMBER_ALIGNMENT"><h3><u>*Endnote numbering alignment</u></h3></a>
<p>
By default, <strong>mom</strong> hangs the numbers on endnotes pages,
aligned right to two placeholders, producing this:
@@ -2181,7 +4034,7 @@ The macros to alter this behaviour are
<p>
<a name="ENDNOTE_NUMBERS_ALIGN_RIGHT">
- Macro: <strong>ENDNOTE_NUMBERS_ALIGN_RIGHT</strong> <var>&lt;number of placeholders&gt;</var>
+ <nobr>Macro: <strong>ENDNOTE_NUMBERS_ALIGN_RIGHT</strong> &lt;number of placeholders&gt;</nobr>
</a>
<p>
<strong>ENDNOTE_NUMBERS_ALIGN_RIGHT</strong> takes one (non-optional)
@@ -2203,7 +4056,8 @@ endnotes, you'd want to do
</pre>
to ensure that the numbers hang and are properly right-aligned.
-<br>
+<p>
+
<hr width="66%" align="left">
<!---ENDNOTE_NUMBERS_ALIGN_LEFT--->
@@ -2229,12 +4083,292 @@ comes out like this:
sed diam nonumy eirmod tempor invidunt ut labore et
dolore magna aliquyam erat, sed diam voluptua.
</pre>
+<hr>
+
+<!====================================================================>
+
+<a name="MARGIN_NOTES_INTRO"><h2><u>Margin notes</u></h2></a>
+<ul>
+ <li><a href="#MARGIN_NOTES_BEHAVIOUR">Margin notes behaviour
+ <ul>
+ <li><a href="#MARGIN_NOTES_VERTICAL">Adjusting the vertical position of margin notes</a>
+ </ul>
+ <li><a href="#MN_INIT">Macro: MN_INIT</a> -- initialize margin notes
+ <li><a href="#MN">Tag: MN</a>
+</ul>
+
+<p>
+Margin notes are short annotations that appear in either the left
+or right margin of a document. Sometimes they comment on the text.
+Sometimes they assist in following the "flow" of a document by
+summarizing the subject of a portion of text. Sometimes they're
+comments to yourself in a draft copy.
+<p>
+The margin notes macros and routines in om.tmac
+(<strong>mom</strong>) are "mommified" versions of the margin notes
+macros and routines written by Werner Lemberg and patched by Gaius
+Mulley.
+<p>
+
+<a name="MARGIN_NOTES_BEHAVIOUR"<h3><u>Margin notes behaviour</u></h3>
+<p>
+First things first: before you enter your first margin note, you
+must "initialize" margin notes with
+<a href="#MN_INIT">MN_INIT</a>.
+<strong>MN_INIT</strong> sets up the style parameters for margin
+notes, including things like
+<a href="definitions.html#TERMS_FONT">font</a>,
+<a href="definitions.html#TERMS_FAMILY">family</a>
+and
+<a href="definitions.html#TERMS_LEADING">leading</a>.
+<p>
+After initializing margin notes, you create margin notes with the
+<a href="#MN">MN</a>
+macro. Based on the argument you pass <strong>MN</strong>, your
+margin note will go in either the left or the right margin.
+<p>
+Margin notes are tricky from a typographic standpoint with respect
+to vertical placement. Since the leading of margin notes may
+differ from that of
+<a href="definitions.html#TERMS_RUNNING">running text</a>,
+it's impossible for <strong>mom</strong> to guess whether to align
+the first lines of margin notes with a document
+<a href="definitions.html#TERMS_BASELINE">baseline</a>,
+whether to align the last lines of margin notes with a document
+baseline, or whether to center them, vertically, so that neither
+first nor last line aligns with anything!
+<p>
+Given this difficulty, <strong>mom</strong> always aligns the first
+line of any margin note with a document baseline. If you want a
+different behaviour, you must adjust the position(s) of margin
+notes yourself, on a note by note basis. (See
+<a href="#MARGIN_NOTES_VERTICAL">Adjusting the vertical position of margin notes</a>.)
+<p>
+Generally speaking, <strong>mom</strong> tries to place margin
+notes at the point where you invoke the tag,
+<a href="#MN">MN</a>.
+However, in the event that a margin note runs deep, she may not
+be able to place a subsequent margin note exactly where you want.
+In such an instance, <strong>mom</strong> will "shift" the margin
+note down on the page, placing it one (margin note)
+linespace beneath the previous margin note (plus whatever vertical
+space is required to get the first line to line up with a baseline
+of running text). A warning will be issued, letting you know this
+has happened, and where.
+<p>
+Sometimes, if a margin note has to be shifted down, there simply
+isn't enough room to start the margin note on the page on which
+<strong>MN</strong> is invoked. In that case, <strong>mom</strong>
+ignores the margin note entirely and issues a warning, letting you
+know what she's done, and where.
+<p>
+In the event that a margin note, sucessfully begun on a page,
+runs past your bottom margin (or the last line before footnotes
+begin), the margin note will "flow" onto the next page. If it is a
+"left" margin note, it will continue in the left margin. If it is a
+"right" margin note, it will continue in the right margin.
+<p>
+If your document is being set in two columns, <strong>mom</strong>
+will sensibly and automatically set all margin notes pertaining
+to the left column in the left margin, and all margin notes
+pertaining to the right column in the right margin, regardless of
+the "direction" argument you give the <strong>MN</strong> tag. If
+you try to use <strong>MN</strong> in documents of more than two
+columns, <strong>mom</strong> will ignore all margin notes, and
+issue warning for each.
+<p>
+<h3><u><a name="MARGIN_NOTES_VERTICAL">Adjusting the vertical position of margin notes</a></u></h3>
+<p>
+When the
+<a href="definitions.html#TERM_LEADING">leading</a>
+of margin notes differs from the leading used throughout a document,
+you may want to adjust the vertical position of individual margin
+notes. This is most often going to be the case with margin notes
+that end near the bottom of the page, where you want the last line of
+the margin note to line up with the last line of text on the page.
+<p>
+Adjustments to the vertical position of margin notes must be done
+inside the margin note (i.e. after <strong>MN</strong>), at the
+top, before entering text. The commands to use are
+\!<a href="typesetting.html#ALD">.ALD</a>
+(to lower the margin note), and
+\!<a href="typesetting.html#RLD">.RLD</a>
+(to raise it). The <strong>\!</strong> <em>must</em> precede the
+macros, or they won't have any effect.
+
+<p>
+<hr width="66%" align="left">
+
+<!---MN_INIT--->
+
+<p>
+<a name="MN_INIT">
+ <nobr>Macro: <strong>MN_INIT</strong>&nbsp;[ ragged | symmetric ] &lt; left-width right-width gutter family+font point-size lead colour hyphenation-flags &gt;</nobr>
+</a>
+<p>
+Before you enter your first margin note, you must initialize
+all the parameters associated with margin notes with
+<strong>MN_INIT</strong>. If you forget to do so,
+<strong>mom</strong> will issue a warning and abort.
+<p>
+The argument list is quite long; an
+explanation of each argument follows. Any argument whose value you
+want to be the default must be entered as "" (i.e. two
+double-quotes with no space between them). Defaults for each
+argument are given in the explanation below.
+<p>
+<strong>[ ragged | symmetric ]</strong>
+<br>
+If the first argument is "ragged", both left and right margin notes
+will be flush left. If the first argument is "symmetric", left
+margin notes will be set flush <em>right</em>, and right margin
+notes will be set flush <em>left</em>. The effect is something
+like this:
+<p>
+<pre>
+ A left This is a meaningless batch A right
+ margin note of text whose sole purpose is margin note
+ with just to demonstrate how the sym- with just
+ a few words metric argument to MN sets left a few words
+ in it. and right margin notes. in it.
+</pre>
+
+If the argument is omitted,
+or given as "", both left and right margin notes will be set
+justified. (Justified is usually not a good idea, since the narrow
+measure of margin notes makes pleasing justification a near
+impossibility.)
+<p>
+<strong>left-width</strong>
+<br>
+The width of left margin notes. A
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
+must be appended directly onto the argument. The default is to set
+left margin notes right out to the edge of the page, which is
+almost certainly not what you want, so you should give a value for
+this argument if using left margin notes.
+<p>
+<strong>right-width</strong>
+<br>
+The width of right margin notes. A
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
+must be appended directly onto the argument. The default is to set
+right margin notes right out to the edge of the page, which is
+almost certainly not what you want, so you should give a value for
+this argument if using right margin notes.
+<p>
+<strong>gutter</strong>
+<br>
+The
+<a href="definitions.html#TERMS_GUTTER">gutter</a>
+between margin notes and
+<a href="definitions.html#TERMS_RUNNING">running text</a>.
+A
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
+must be appended directly onto the argument. The gutter applies to
+both left and right margin notes. The default is 1
+<a href="definitions.html#TERMS_EM">em</a>.
+<p>
+<strong>font</strong>
+<br>
+The family+font for margin notes. Yes, that's right: the family
+PLUS font combo. For example, if you want Times Roman Medium,
+the argument must be TR. If you want Palatino Medium Italic, the
+argument must be PI. The default is the same family+font combo used
+for a document's paragraph text.
+<p>
+<strong>lead</strong>
+<br>
+The
+<a href="definitions.html#TERMS_LEADING">leading</a>
+of margin notes. <strong>lead</strong> uses
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>
+as its unit of measure, so don't tack a unit of measure onto the
+end of the argument. The default lead is the same leading as
+is used for paragraph text (i.e. the document's base leading).
+For convenience and clarity, you may also give the word,
+<strong>DOC</strong>, to this argument, which indicates that the
+leading should be the same as the document's base leading.
+<p>
+<strong>colour</strong>
+<br>
+The colour of margin notes. The colour must be pre-initialized
+with
+<a href="color.html#NEWCOLOR">NEWCOLOR</a>
+or
+<a href="color.html#XCOLOR">XCOLOR</a>.
+The default is black.
+<p>
+<strong>hyphenation-flags</strong>
<br>
+A number telling <strong>groff</strong> how you want margin notes
+hyphenated.
+<p>
+<pre>
+ 1 = hyphenate without restrictions
+ 2 = do not hyphenate the last word on the page
+ 4 = do not hyphenate the last two characters of a word
+ 8 = do not hyphenate the first two characters of a word
+</pre>
+
+The values can be added together, so, for example, if you want
+neither the first two nor the last two characters of words
+hyphenated, the hyphenation-flag would be 12. The default value is
+14 (i.e. 2+4+8).
+
+<p>
+<hr width="66%" align="left">
+
+<!---MN_INIT--->
+
+<p>
+<a name="MN">
+ <nobr>Macro: <strong>MN</strong>&nbsp;LEFT|RIGHT | &lt;anything&gt;</nobr>
+</a>
+<p>
+Once you've initialized margin notes with
+<a href="#MN_INIT">MN_INIT</a>,
+you can enter margin notes any time you like with
+<strong>MN</strong>. An argument of <strong>LEFT</strong> will set
+a left margin note. An argument of <strong>RIGHT</strong> will set
+a right margin note.
+<p>
+Any argument, such as <strong>OFF</strong> (or
+<strong>QUIT</strong>, <strong>END</strong>, <strong>X</strong>,
+etc) exits the current margin note.
+
+<p>
<hr>
<!====================================================================>
+<a name="BLANK_PAGE_TITLE"><h2><u>Inserting a blank page into the document</u></h2></a>
+<p>
+<a name="BLANK_PAGE">
+ <nobr>Macro: <strong>BLANKPAGE</strong> &lt;# of blank pages to insert&gt;</nobr>
+</a>
+
+<p>
+This one does exactly what you'd expect -- inserts a blank page into
+the document. <strong>Mom</strong> silently increments the page
+number of every blank page and keeps track of
+<a href="rectoverso.html#RECTO_VERSO">recto/verso</a>
+stuff, but otherwise, does nothing. It's up to you, the user, to
+figure out what to do with this feature. However, it's worth
+noting that without it, inserting completely blank pages, to use
+a vernacular Québécois phrase, &quot;c'est pas évident&quot;
+(somewhere between &quot;isn't easy&quot;, &quot;isn't
+obvious&quot; and &quot;isn't fun&quot;).
+<p>
+The argument to <strong>BLANK_PAGE</strong> is the number of blank
+pages to insert. The argument is not optional, hence even if you
+only want one blank page, you have to tell <strong>mom</strong>:
+<p>
+<pre>
+ .BLANKPAGE 1
+</pre>
+
<a name="FINIS_INTRO"><h2><u>Terminate document processing</u></h2></a>
<ul>
<li><a href="#FINIS">Tag: FINIS</a>
@@ -2243,18 +4377,586 @@ comes out like this:
<p>
The use of <strong>FINIS</strong> is optional. If you invoke it
-(at the end of a document, of course), <strong>mom</strong> turns off
-<a href="definitions.html#TERMS_FOOTER">footers</a>
-(if they're on) and page numbering (if page
-numbers are at the bottom of the page) and deposits the word
-END, centered after a blank line, beneath the last
+(at the end of a document before
+<a href="#TOC">TOC</a>
+or
+<a href="#ENDNOTES">ENDNOTES</a>),
+<strong>mom</strong>
+deposits the word END, centred after a blank line, beneath the last
line of the document. END is enclosed between
<a href="definitions.html#TERMS_EM">em-dashes</a>.
<p>
+<strong>Please note</strong> that in versions of
+<strong>mom</strong> prior to 1.1.9, <strong>FINIS</strong> used to
+turn off
+<a href="definitions.html#TERMS_FOOTER">footers</a>
+(if they were on) and page numbering (if page numbers were at the
+bottom of the page). Damned if I can recall why I thought anyone
+would want this behaviour, but it has been removed.
+<p>
If you're writing in a language other than English, you can
change what <strong>mom</strong> prints for END with
the control macro <strong>FINIS_STRING</strong>.
+<p>
+<hr>
+
+<!====================================================================>
+
+<a name="TOC_INTRO"><h2><u>Table of contents</u></h2></a>
+<ul>
+ <li><a href="#TOC_BEHAVIOUR">TOC behaviour</a>
+ <li><a href="#TOC">Macro: TOC</a> -- tell <strong>mom</strong> to output a table of contents
+ <li><a href="#TOC_CONTROL">TOC control macros</a>
+</ul>
+
+<p>
+Want a table of contents for your document? Easy. Just enter
+<p>
+<pre>
+ .TOC
+</pre>
+
+as the very last macro of your document file. <strong>Mom</strong>
+will have picked up all document titles (in
+<a href="docprocessing.html#COLLATE">collated</a>
+documents), all heads, subheads, and paragraph heads, as well as any
+endnotes pages that have been output, and assigned them the
+appropriate page number (and page numbering style). Talk about a
+no-brainer!
+
+That said, tables of contents (tocs) have even more control macros
+than endnotes. As always, the reason for so many control macros is
+so that if you want to change just about any aspect of the toc's
+typographic appearance, you can. <strong>Mom</strong> is all about
+simplicity AND flexibility.
+<p>
+
+<a name="TOC_BEHAVIOUR"><h3><u>TOC behaviour</u></h3></a>
+<p>
+When you output a toc (with
+<a href="#TOC">TOC</a>),
+<strong>mom</strong> finishes processing the last page of your document,
+then breaks to a new page for printing the toc.
+<p>
+<strong>Mom</strong> follows standard typesetting conventions for
+tables of contents. To this end, if
+<a href="headfootpage.html#HEADERS">HEADERS</a>
+are on for the document, the first page of the toc has no page
+header, but does have a first page (roman numeral) number, always
+&quot;1&quot;, in the bottom margin. If
+<a href="headfootpage.html#FOOTERS">FOOTERS</a>
+are on for the document, the first page has neither a footer, nor a
+page number in the top margin. (If you absolutely must have a page
+footer on the first page of the toc, simply invoke
+<a href="headfootpage.html#FOOTER_ON_FIRST_PAGE">FOOTER_ON_FIRST_PAGE</a>
+immediately before <strong>TOC</strong>.) Subsequent toc pages have
+both page headers or footers and a page number.
+<p>
+Entries in the toc are hierarchically indented, as you would
+expect. By default, each type of entry (e.g. a head or a subhead)
+is set in a different font as well. If any of heads, subheads or
+paragraph heads are numbered in the body of the document, they are
+also numbered in the toc. Head numbering in the toc is NOT
+concatenated as it is in the body of the document, which would be
+visually redundant in a toc.
+<p>
+Tocs are never set in columns, regardless of whether the rest of
+the document is. Lastly, if
+<a href="rectoverso.html#RECTO_VERSO">recto/verso</a>
+printing is enabled, the toc respects it. This sometimes leads to
+tocs that begin with the wrong margins, but the margins can be
+corrected either by outputting a
+<a href="#BLANK_PAGE">BLANKPAGE</a>
+or by using the toc control macro
+<a href="#TOC_RV_SWITCH">TOC_RV_SWITCH</a>.
+<p>
+The overall toc
+<a href="definitions.html#TERMS_FAMILY">family</a>,
+<a href="definitions.html#TERMS_PS">point size</a>
+and
+<a href="definitions.html#TERMS_LEADING">lead</a>
+can be altered with the toc
+<a href="definitions.html#TERMS_CONTROLMACRO">control macros</a>,
+as can the family,
+<a href="definitions.html#TERMS_FONT">font</a>,
+point size and indent of each type of toc entry (i.e. title, head,
+subhead, paragraph head). Furthermore, the page numbering style
+can be changed, as can the amount of visual space reserved for toc
+entry page numbers.
+<p>
+
+<!---TOC--->
+
+<hr width="66%" align="left">
+<p>
+<a name="TOC">Macro: <strong>TOC</strong></a>
+
+<p>
+If you want a toc, just put <strong>TOC</strong> as the last macro
+in a document. <strong>Mom</strong> takes care of the rest.
+<p>
+<hr width="66%" align="left">
+
+<a name="TOC_CONTROL"><h3><u>TOC control macros</u></h3></a>
+<p>
+Toc entries are not actually processed when <strong>mom</strong>
+collects them, so you can put any toc control macros anywhere you
+like in your document. Some may prefer to place them at the top of
+the file. Others may prefer to place them just before outputting
+the toc. The choice is yours.
+<br>
+<ol>
+ <li><a href="#TOC_GENERAL"><strong>General toc page style control</strong></a>
+ <ul>
+ <li><a href="#TOC_FAMILY">Base family for toc pages</a>
+ <li><a href="#TOC_PT_SIZE">Base point size for toc pages</a>
+ <li><a href="#TOC_LEAD">Leading of toc pages</a>
+ </ul>
+ <li><a href="#TOC_PAGENUMBERING"><strong>Toc page numbering</strong></a>
+ <ul>
+ <li><a href="#PAGINATE_TOC">Turn toc pagination on or off</a>
+ <li><a href="#TOC_PAGENUM_STYLE">Toc page numbering style</a>
+ </ul>
+ <li><a href="#TOC_HEADER"><strong>Changing the toc header (title), string and style</strong></a>
+ <ul>
+ <li><a href="#TOC_HEADER_STRING">Changing the string (title)</a>
+ <li><a href="#TOC_HEADER_STYLE">Changing the string (title) style</a>
+ </ul>
+ <li><a href="#TOC_STYLE"><strong>Changing the style for toc entries</strong></a>
+ <ul>
+ <li><a href="#TOC_INDENT">The toc _INDENT control macros</a>
+ <li><a href="#TOC_TITLE">Changing the style for toc title entries</a>
+ <li><a href="#TOC_HEAD">Changing the style for toc head entries</a>
+ <li><a href="#TOC_SUBHEAD">Changing the style for toc subhead entries</a>
+ <li><a href="#TOC_PARAHEAD">Changing the style for toc paragraph head entries</a>
+ <li><a href="#TOC_PN">Changing the style for toc page number listings</a>
+ </ul>
+ <li><a href="#TOC_ADDITIONAL"><strong>Additional toc control macros</strong></a>
+ <ul>
+ <li><a href="#TOC_TITLE_ENTRY">Change the wording of a toc title entry</a>
+ <li><a href="#TOC_APPENDS_AUTHOR">Append author(s) to toc title entries</a>
+ <li><a href="#TOC_RV_SWITCH">TOC_RV_SWITCH</a>
+ <li><a href="#TOC_PADDING">TOC_PADDING</a>
+ </ul>
+</ol>
+<hr>
+
+<a name="TOC_GENERAL"><h2><u>1. General toc page style control</u></h2>
+
+<a name="TOC_FAMILY"><h3><u>*Toc family</u></h3></a>
+<p>
+See
+<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
+<p>
+Set the family of toc pages with <strong>TOC_FAMILY</strong>, which
+establishes the default family for every element of a toc page,
+including the toc title (&quot;Contents&quot;) and the page number
+in the top or bottom margin. The default is the prevailing document
+family.
+<p>
+All elements on a toc page also have their own _FAMILY
+control macros, which override the default set by
+<strong>TOC_FAMILY</strong>.
+<p>
+
+<!---TOC_PT_SIZE--->
+
+<a name="TOC_PT_SIZE"><h3><u>*Toc point size</u></h3></a>
+<p>
+<nobr>Macro: <strong>TOC_PT_SIZE</strong> &lt;base type size of the toc&gt;</nobr>
+
+<p>
+Unlike most other control macros that deal with size of document
+elements, <strong>TOC_PT_SIZE</strong> takes as its argument an
+absolute value, relative to nothing. Therefore, the argument
+represents the size of toc type in
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>,
+unless you append an alternative
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>.
+For example,
+<p>
+<pre>
+ .TOC_PT_SIZE 12
+</pre>
+
+sets the base point size of type for the toc to 12 points, whereas
+<p>
+<pre>
+ .TOC_PT_SIZE .6i
+</pre>
+
+sets the base point size of type for the toc to 1/6 of an inch.
+<p>
+The type size set with <strong>TOC_PT_SIZE</strong> forms the basis
+from which the point size of other toc page elements are calculated.
+<p>
+The default for
+<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPESET</a>
+is 12.5 points (the same default size used in the body of the
+document).
+<p>
+
+<!---TOC_LEAD--->
+
+<a name="TOC_LEAD"><h3><u>*Toc lead</u></h3></a>
+<p>
+<nobr>Macro: <strong>TOC_LEAD</strong> &lt;leading of the toc&gt; [ ADJUST ]</nobr>
<br>
+<em>*Does not require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>; points is assumed</em>
+
+<p>
+Unlike most other control macros that deal with leading of document
+elements, <strong>TOC_LEAD</strong> takes as its argument an
+absolute value, relative to nothing. Therefore, the argument
+represents the
+<a href="definitions.html#TERMS_LEADING">leading</a>
+of tocs in
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>
+unless you append an alternative
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>.
+For example,
+<p>
+<pre>
+ .TOC_LEAD 14
+</pre>
+
+sets the base leading of type on the endnotes page to 14
+points, whereas
+<p>
+<pre>
+ .TOC_LEAD .5i
+</pre>
+
+sets the base leading of type on the endnotes page to 1/2 inch.
+<p>
+If you want the leading of toc pages adjusted to fill the
+page, pass <strong>TOC_LEAD</strong> the optional argument
+<strong>ADJUST</strong>. (See
+<a href="docprocessing.html#DOC_LEAD_ADJUST">DOC_LEAD_ADJUST</a>
+for an explanation of leading adjustment.)
+<p>
+The default for
+<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPESET</a>
+is the prevailing document lead (16 by default), adjusted.
+<p>
+<strong>NOTE:</strong> Even if you give <strong>mom</strong> a
+<strong>DOC_LEAD_ADJUST OFF</strong> command, she will still, by
+default, adjust toc leading. You MUST enter
+<strong>TOC_LEAD &lt;lead&gt;</strong> with no
+<strong>ADJUST</strong> argument to disable this default behaviour.
+<p>
+<strong>ADDITIONAL NOTE:</strong> Tocs are always double-spaced in
+<strong>PRINTSTYLE TYPEWRITE</strong>, regardless of whether the
+body of the document is single-spaced.
+
+<a name="TOC_PAGENUMBERING"><h2><u>2. Toc page numbering</u></h2></a>
+<p>
+The page numbering of toc pages is controlled by the same macros
+that control
+<a href="headfootpage.html#PAGINATION">document page numbering</a>,
+except
+<a href="headfootpage.html#PAGENUM">PAGENUM</a>
+(tocs always start on page 1). The defaults are the same as the
+rest of the document.
+<p>
+If you wish to change some aspect of toc pagination, use the
+document pagination control macros immediately prior to
+<strong>.TOC</strong>.
+<p>
+A special macro,
+<a href="#TOC_PAGENUM_STYLE">TOC_PAGENUM_STYLE</a>
+controls the style of toc pages page numbers.
+<p>
+
+<hr width="33%" align="left">
+
+<!---PAGINATE_TOC--->
+
+<p>
+<a name="PAGINATE_TOC">
+ <nobr>Macro: <strong>PAGINATE_TOC</strong> &lt;toggle&gt;</nobr>
+</a>
+<p>
+By default, <strong>mom</strong> paginates the toc. If you'd like
+her not to, do
+<p>
+<pre>
+ .PAGINATE_TOC OFF
+</pre>
+
+<strong>NOTE:</strong> Simply invoking <strong>PAGINATION
+OFF</strong> or <strong>PAGINATE OFF</strong> disables toc
+pagination <em>for the first toc page only.</em> You MUST use
+<strong>.PAGINATE_TOC OFF</strong> to disable toc pagination, even
+if pagination is turned off elsewhere in your document.
+<p>
+
+<hr width="33%" align="left">
+<p>
+
+<!---TOC_PAGENUM_STYLE--->
+
+<a name="TOC_PAGENUM_STYLE">
+ <nobr>Macro: <strong>TOC_PAGENUM_STYLE</strong> &lt;DIGIT | ROMAN | roman | ALPHA | alpha&gt;</nobr>
+</a>
+<p>
+By default, <strong>mom</strong> uses roman numerals to number
+toc pages. Use <strong>TOC_PAGENUM_STYLE</strong> if you'd prefer
+something else. For example, to have standard digits instead of
+roman numerals, do the following:
+<p>
+<pre>
+ .TOC_PAGENUM_STYLE DIGIT
+</pre>
+
+<hr width="33%" align="left">
+
+<a name="TOC_HEADER"><h2><u>3. Changing the toc header (title) string and style</u></h2></a>
+<p>
+The toc header string is the title that appears at to top of the
+toc. By default, it's &quot;Contents&quot;. If you'd like
+something else, say, &quot;Table of Contents&quot;, do
+<p>
+<a name="TOC_HEADER_STRING"></a>
+<pre>
+ .TOC_HEADER_STRING "Table of Contents"
+</pre>
+
+<a name="TOC_HEADER_STYLE"></a>
+The style of the toc header (title) is managed by the usual control
+macros (see
+<a href="#CONTROL_MACRO_ARGS">arguments to the control macros</a>).
+<p>
+<pre>
+ .TOC_HEADER_FAMILY default = prevailing doc family (Times Roman in TYPEWRITE)
+ .TOC_HEADER_FONT default = bold
+ .TOC_HEADER_SIZE default = +4
+ .TOC_HEADER_QUAD default = left
+</pre>
+
+<a name="TOC_STYLE"><h2><u>4. Changing the style for toc entries</u></h2></a>
+<p>
+&quot;Toc entries&quot; refers to titles, heads, subheads and
+paragraph heads as they appear in the toc. Their style is managed
+by the usual
+<a href="definitions.html#TERMS_CONTROLMACRO">control macros</a>,
+starting with TOC_
+<p>
+
+<a name="TOC_INDENT"><h3><u>The toc _INDENT control macros</u></h3></a>
+<p>
+The toc control macros that end in _INDENT all take a single
+argument that requires a
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>.
+The argument is the distance to indent the entry, always measured
+from the left margin. For example,
+<p>
+<pre>
+ .TOC_HEAD_INDENT 2P
+</pre>
+
+indents head entries 2
+<a href="definitions.html#TERMS_PICASPOINTS">picas</a>
+from the left margin.
+<p>
+
+<a name="TOC_TITLE"><h3><u>*Changing the style for toc title entries</u></h3></a>
+<p>
+(See
+<a href="#CONTROL_MACRO_ARGS">arguments to the control macros</a>).
+<p>
+Toc title entries are the titles of documents that have been
+<a href="rectoverso.html#COLLATE">collated</a>
+together.
+<p>
+<pre>
+ .TOC_TITLE_FAMILY default = prevailing doc family (Times Roman in TYPEWRITE)
+ .TOC_TITLE_FONT default = bold italic
+ .TOC_TITLE_SIZE default = +0
+ .TOC_TITLE_INDENT default = 0 for TYPESET and TYPEWRITE
+</pre>
+
+<a name="TOC_HEAD"><h3><u>*Changing the style for toc head entries</u></h3></a>
+<p>
+(See
+<a href="#CONTROL_MACRO_ARGS">arguments to the control macros</a>).
+<p>
+Toc head entries are main heads that appear in the body of a
+document.
+<p>
+<pre>
+ .TOC_HEAD_FAMILY default = prevailing doc family (Times Roman in TYPEWRITE)
+ .TOC_HEAD_FONT default = bold
+ .TOC_HEAD_SIZE default = +.5
+ .TOC_HEAD_INDENT default = 18p for TYPESET; 2m for TYPEWRITE
+</pre>
+
+<a name="TOC_SUBHEAD"><h3><u>*Changing the style for toc subhead entries</u></h3></a>
+<p>
+(See
+<a href="#CONTROL_MACRO_ARGS">arguments to the control macros</a>).
+<p>
+Toc subhead entries are subheads that appear in the body of a
+document.
+<p>
+<pre>
+ .TOC_SUBHEAD_FAMILY default = prevailing doc family (Times Roman in TYPEWRITE)
+ .TOC_SUBHEAD_FONT default = roman
+ .TOC_SUBHEAD_SIZE default = +0
+ .TOC_SUBHEAD_INDENT default = 30p for TYPESET; 4m for TYPEWRITE
+</pre>
+
+<a name="TOC_PARAHEAD"><h3><u>*Changing the style for toc paragraph head entries</u></h3></a>
+<p>
+(See
+<a href="#CONTROL_MACRO_ARGS">arguments to the control macros</a>).
+<p>
+Toc paragraph head entries are paragraph heads that appear in the
+body of a document.
+<p>
+<pre>
+ .TOC_PARAHEAD_FAMILY default = prevailing doc family (Times Roman in TYPEWRITE)
+ .TOC_PARAHEAD_FONT default = italic
+ .TOC_PARAHEAD_SIZE default = +0
+ .TOC_PARAHEAD_INDENT default = 42p for TYPESET; 6m for TYPEWRITE
+</pre>
+
+<a name="TOC_PN"><h3><u>*Changing the style for toc paragraph page number listings</u></h3></a>
+<p>
+(See
+<a href="#CONTROL_MACRO_ARGS">arguments to the control macros</a>).
+<p>
+Toc paragraph head entries are paragraph heads that appear in the
+body of a document.
+<p>
+<pre>
+ .TOC_PN_FAMILY default = prevailing doc family (Times Roman in TYPEWRITE)
+ .TOC_PN_FONT default = roman
+ .TOC_PN_SIZE default = +0
+</pre>
+
+<a name="TOC_ADDITIONAL"><h2><u>5. Additional toc macros</u></h2></a>
+<p>
+The following macros allow you to switch page margins should
+they be incorrect for recto/verso printing, to establish how
+many placeholders to leave for page listings, and to have
+<strong>mom</strong> append author(s) to toc title entries.
+<p>
+
+<hr width="33%" align="left">
+
+<!---TOC_RV_SWITCH--->
+
+<p>
+<a name="TOC_RV_SWITCH">
+ Macro: <strong>TOC_RV_SWITCH</strong>
+</a>
+<p>
+<strong>TOC_RV_SWITCH</strong> doesn't take an argument. It simply
+instructs <strong>mom</strong> to switch the left and right margins
+of
+<a href="rectoverso.html#RECTO_VERSO">recto/verso</a>
+documents should the toc happen to begin on an even page when you
+want an odd, or vice versa.
+<p>
+The same result can be accomplished by outputting a
+<a href="#BLANK_PAGE">BLANKPAGE</a>.
+<p>
+
+<hr width="33%" align="left">
+
+<!---TOC_TITLE_ENTRY--->
+
+<p>
+<a name="TOC_TITLE_ENTRY">
+ <nobr>Macro: <strong>TOC_TITLE_ENTRY</strong> &lt;&quot;alternate wording for a title entry in the toc&quot;&gt;</nobr>
+</a>
+<p>
+In
+<a href="rectoverso.html#COLLATE">collated</a>
+documents, the title of each separate document appears in the table
+of contents. It may sometimes happen that you don't want the title
+as it appears in the toc to be the same as what appears in
+the
+<a href="definitions.html#TERMS_DOCHEADER">docheader</a>.
+You might, for example, want to shorten it. Or, in the case of
+chapters where the docheader contains both a chapter number and a
+chapter title, like this
+<p>
+<pre>
+ Chapter 6
+ Burning Bush -- Maybe God Was Right
+</pre>
+
+you might want only the chapter title, not the chapter number, to
+show up in the toc. (By default, <strong>TOC</strong> generates
+both.)
+<p>
+If you want to change the wording of a title entry in the toc,
+simply invoke <strong>TOC_TITLE_ENTRY</strong> with the desired
+wording, enclosed in double-quotes. Using the example, above,
+<p>
+<pre>
+ .CHAPTER 6
+ .CHAPTER_TITLE "Burning Bush -- Maybe God Was Right"
+ .TOC_TITLE_ENTRY "Burning Bush"
+ .DOCTYPE CHAPTER
+</pre>
+
+would identify chapter 6 in the toc simply as &quot;Burning
+Bush&quot;.
+
+<p>
+
+<hr width="33%" align="left">
+
+<!---TOC_APPENDS_AUTHOR--->
+
+<p>
+<a name="TOC_APPENDS_AUTHOR">
+ <nobr>Macro: <strong>TOC_APPENDS_AUTHOR</strong> &lt;none&gt; | &lt;&quot;name(s) of authors&quot;&gt;</nobr>
+</a>
+<p>
+In certain kinds of collated documents, different authors are
+responsible for the articles or stories contained within them. In
+such documents, you may wish to have the author or authors
+appended to the toc's title entry for each story or article.
+<p>
+If you invoke <strong>TOC_APPENDS_AUTHOR</strong> with no argument,
+<strong>mom</strong> appends the first argument you passed to
+<a href="docprocessing.html#AUTHOR">AUTHOR</a>
+to toc title entries, separated by a front-slash.
+<p>
+If you invoke <strong>TOC_APPENDS_AUTHOR</strong> with an argument
+(surrounded by double-quotes), <strong>mom</strong> will append it
+to the toc title entries instead. This is useful if you have
+multiple authors you wish to identify by last name only. For
+example, if three authors--Joe Blough, Jane Doe, and John
+Deere--are responsible for a single article
+<p>
+<pre>
+ .TOC_APPENDS_AUTHOR "Blough et al."
+</pre>
+
+would be a good way to identify them in the toc.
+<p>
+
+<hr width="33%" align="left">
+
+<!---TOC_PADDING--->
+
+<p>
+<a name="TOC_PADDING">
+ <nobr>Macro: <strong>TOC_PADDING</strong> &lt;# of placeholders to allow for page number listings&gt;</nobr>
+</a>
+<p>
+By default, <strong>mom</strong> allows room for 3 digits in the
+page number listings of tocs. If you'd like some other number of
+placeholders, say 2, do
+<p>
+<pre>
+ .TOC_PADDING 2
+</pre>
<!---FINIS--->
@@ -2266,7 +4968,11 @@ the control macro <strong>FINIS_STRING</strong>.
<p>
The use of <strong>FINIS</strong> is optional, but if you use
-it, it should be the last macro you invoke in a document. See
+it, it should be the last macro you invoke in a document (before
+<a href="#ENDNOTES">ENDNOTES</a>
+or
+<a href="#TOC">TOC</a>).
+See
<a href="#FINIS_INTRO">above</a>
for a description of how <strong>FINIS</strong> behaves.
<p>
@@ -2309,11 +5015,22 @@ a blank string, i.e.
<strong>mom</strong> will still print the em-dashes if you
invoke <strong>FINIS</strong>. This, in effect, produces a
-short, centered horizontal rule that terminates the document.
+short, centred horizontal rule that terminates the document.
(In
<a href="docprocessing.html.#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>,
it's a short, dashed line composed of four hyphens.)
+<a name="FINIS_COLOR"><h3><u>Changing the FINIS colour</u></h3></a>
+<p>
+Invoking <strong>FINIS_COLOR</strong> with a pre-defined (or
+&quot;initalized&quot;) color changes the colour of both the FINIS
+string and the em-dashes that surround it. If you use the
+<a href="definitions.html#TERMS_INLINE">inline escape</a>,
+<a href="color.html#COLOR_INLINE">\*[&lt;colorname&gt;]</a>,
+in the argument passed to <strong>FINIS</strong>, only the text
+will be in the new colour; the em-dashes will be in the default
+document colour (usually black).
+
<p>
<hr>
<a href="headfootpage.html#TOP">Next</a>&nbsp;&nbsp;
diff --git a/contrib/groff/contrib/mom/momdoc/docprocessing.html b/contrib/groff/contrib/mom/momdoc/docprocessing.html
index 04475372b5ea..6f64d68d9599 100644
--- a/contrib/groff/contrib/mom/momdoc/docprocessing.html
+++ b/contrib/groff/contrib/mom/momdoc/docprocessing.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -7,22 +8,23 @@
<!====================================================================>
-<a href="docelement.html#TOP">Next</a>&nbsp;&nbsp;
-<a href="inlines.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="typemacdoc.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="color.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
-
+<p>
<a name="TOP"></a>
<a name="DOCPROCESSING">
- <h1 align="center"><u>DOCUMENT PROCESSING WITH MOM</u>
-</h1>
+ <h1 align="center"><u>DOCUMENT PROCESSING WITH MOM</u></h1>
</a>
-
<a href="#INTRO_MACROS_DOCPROCESSING">Introduction to document processing</a>
<br>
<a href="#DEFAULTS">Some document defaults</a>
-<p>
+<br>
<a href="#LEADING_NOTE">* IMPORTANT NOTE on leading/spacing and bottom margins *</a>
-<p>
+<br>
+<a href="#SHIM">The SHIM macro</a>
+<br>
+<h3><u>Table of Contents for document processing</u></h3>
<ul>
<li><a href="#SETUP"><strong>DOCUMENT SETUP</strong></a>
<br>
@@ -32,11 +34,15 @@
<li><a href="#REFERENCE_MACROS"><strong>The Reference Macros</strong></a>
<ul>
<li><a href="#TITLE">TITLE</a>
+ <li><a href="#DOC_TITLE">DOCTITLE</a>
<li><a href="#SUBTITLE">SUBTITLE</a>
<li><a href="#AUTHOR">AUTHOR</a>
<li><a href="#CHAPTER">CHAPTER</a>
+ <li><a href="#CHAPTER_TITLE">CHAPTER_TITLE</a>
<li><a href="#DRAFT">DRAFT</a>
<li><a href="#REVISION">REVISION</a>
+ <li><a href="#COPYRIGHT">COPYRIGHT</a>
+ <li><a href="#MISC">MISC</a>
</ul>
<li><a href="#DOCSTYLE_MACROS"><strong>The Docstyle Macros</strong></a>
<ul>
@@ -48,6 +54,9 @@
<li><a href="#STYLE_BEFORE_START"><strong>Changing type/style parameters prior to START</strong></a>
<ul>
<li><a href="#TYPE_BEFORE_START">Using typesetting macros prior to START</a>
+ <ul>
+ <li><a href="#COLOR">Colour</a>
+ </ul>
<li><a href="#DOC_LEAD_ADJUST">Adjusting document leading to fill pages -- DOC_LEAD_ADJUST</a>
<li><a href="#DOCHEADER">Managing the document header</a>
<ul>
@@ -116,7 +125,7 @@
<li><a href="docelement.html#PARAHEAD">PARAHEAD</a>
<li><a href="docelement.html#PARAHEAD_CONTROL">Parahead control</a>
</ul>
- <li><a href="docelement.html#LINEBREAK_INTRO"><strong>Linebreaks (author linebreaks)</strong></a>
+ <li><a href="docelement.html#LINEBREAK_INTRO"><strong>Linebreaks (author linebreaks, also called section breaks)</strong></a>
<ul>
<li><a href="docelement.html#LINEBREAK">LINEBREAK</a>
<li><a href="docelement.html#LINEBREAK_CONTROL">Linebreak control</a>
@@ -190,7 +199,7 @@
</ul>
</ul>
- <li><a href="cover.html#COVER"><strong>CREATING A COVER PAGE</strong></a>
+ <li><a href="cover.html#TOP"><strong>CREATING A COVER PAGE</strong></a>
<br>
<li><a href="letters.html#LETTERS"><strong>WRITING LETTERS</strong></a>
<ul>
@@ -201,14 +210,15 @@
</ul>
</ul>
</ul>
+<br>
<hr>
<h2><a name="INTRO_MACROS_DOCPROCESSING"><u>Introduction to document processing</u></a></h2>
-<p>
+
As explained in
<a href="intro.html#INTRO_DOCPROCESSING">Document processing with mom</a>,
document processing uses markup tags to identify document elements
-like heads, paragraphs, and so on. The tags are, of course, macros,
+such as heads, paragraphs, and so on. The tags are, of course, macros,
but with sensible, readable names that make them easy to grasp and
easy to remember. (And don't forget: if you don't like the
&quot;official&quot; name of a tag -- too long, cumbersome
@@ -224,13 +234,13 @@ Setting up a <strong>mom</strong> doc is a simple, four-part procedure.
You begin by entering information about the document itself (title,
subtitle, author, etc.). Next, you tell <strong>mom</strong> what
kind of document you're creating (e.g. chapter, letter, abstract,
-etc...) and what kind of output you want (typeset, typewrittten,
+etc...) and what kind of output you want (typeset, typewritten,
draft-style, etc). Thirdly, you make as many or as few changes to
<strong>mom</strong>'s default behaviour as you wish. Lastly, you
invoke the
<a href="#START">START</a>
macro. Voilà! You're ready to write.
-<br>
+<p>
<hr>
@@ -248,7 +258,7 @@ documentation. Just in case, here they are.
<li>the left and right margins are 1-inch
<li>the top and bottom margins for document text are plus/minus
visually 1-inch
- <li>pages are numbered; the number appears centered, at the
+ <li>pages are numbered; the number appears centred, at the
bottom, surrounded by hyphens ( e.g. -6- )
<li>the first page of a document begins with a
<a href="definitions.html#TERMS_DOCHEADER">document header</a>
@@ -261,7 +271,7 @@ 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).
-<br>
+<p>
<hr>
<a name="LEADING_NOTE">
@@ -277,11 +287,11 @@ short).
In order to ensure even bottom margins, <strong>mom</strong>
uses the &quot;base&quot; document
<a href="definitions.html#TERMS_LEADING">leading</a>
-in effect <em>at the start of each page</em> (i.e. the leading used
-in paragraphs) to calculate the spacing of every document element.
-Prior to invoking
+in effect <em>at the start of running text on each page</em> (i.e.
+the leading used in paragraphs) to calculate the spacing of every
+document element. Prior to invoking
<a href="#START">START</a>,
-this is done with the
+this is set with the
<a href="typesetting.html#MACROS_TYPESETTING">typesetting macro</a>
<a href="typesetting.html#LEADING">LS</a>,
afterwards with the document
@@ -310,15 +320,80 @@ since &quot;v&quot; accepts decimal fractions, you can add/subtract
half linespaces and quarter linespaces with &quot;v&quot; as well,
<em>provided you compensate for the fractional linespace somewhere
else on the page</em>.
-<br>
+<p>
+If all this seems like too much work, <strong>mom</strong>
+provides a special macro to get you out of trouble if you've played
+around with leading and/or spacing. The macro is called
+<strong>SHIM</strong> (like those little pieces of wood carpenters
+use to get their work even, level and snug), and it's described
+below.
+<p>
+
+<!---SHIM--->
+
+<hr width="66%" align="left">
+<p>
+<a name="SHIM"></a>
+Macro: <strong>SHIM</strong>
+
+<p>
+<strong>SHIM</strong> doesn't take any argument. Use it whenever
+you've played around with the
+<a href="definitions.html#TERMS_LEADING">leading</a>
+or spacing on a page and you
+need to get <strong>mom</strong>'s document leading back on track.
+<p>
+For example, say you want to insert a picture into a document with
+the special groff macro, <strong>PSPIC</strong> (see the
+<strong>groff_tmac</strong> man page for usage).
+<p>
+Pictures aren't usually conveniently sized in multiples of document
+leading, which means that when you insert the picture, you disrupt
+<strong>mom</strong>'s ordered placement of baselines on the page.
+This will certainly result in a bottom margin that doesn't match the
+bottom margins of your document's other pages.
+<p>
+The solution is to insert <strong>SHIM</strong> after the picture,
+like this:
+<p>
+<pre>
+ &lt;some lines of text&gt;
+ .PSPIC &lt;full path to picture&gt;
+ .SHIM
+ &lt;more lines of text&gt;
+</pre>
+<strong>SHIM</strong> instructs <strong>mom</strong> to insert as
+much or a little space after the picture as is needed to ensure that
+the baseline of the next
+<a href="definitions.html#TERMS_OUTPUTLINE">output line</a>
+falls where <strong>mom</strong> would have put it had you not
+disrupted the normal flow of output lines with the picture.
+<p>
+And say, on previewing the above example, you find that the picture
+doesn't centre nicely between the lines of text, you can always do
+<p>
+<pre>
+ &lt;some lines of text&gt;
+ .RLD 3p
+ .PSPIC &lt;full path to picture&gt;
+ .SHIM
+ &lt;more lines of text&gt;
+</pre>
+
+to raise the picture slightly
+(<strong>R</strong>everse <strong>L</strong>ea<strong>D</strong>
+3 points; see
+<a href="typesetting.html#RLD">RLD</a>),
+and still have <strong>SHIM</strong> ensure that text underneath
+falls exactly where it's supposed to.
+<p>
<hr>
<a name="SETUP"><h2><u>Document setup</u></h2></a>
-
+<p>
<a name="DOCPROCESSING_TUT">
<h3><u>Tutorial -- Setting up a mom document</u></h3>
</a>
-<p>
There are four &quot;parts&quot; to setting up a <strong>mom</strong>
doc (three, actually, with one optional). Before we proceed, though,
be reassured that something as simple as
@@ -366,11 +441,17 @@ some reference information. The reference macros are:
<p>
<ul>
<li>TITLE
+ <li>DOCTITLE
+ <li>COVERTITLE
<li>SUBTITLE
<li>AUTHOR
<li>CHAPTER -- the chapter number
<li>DRAFT -- the draft number
<li>REVISION -- the revision number
+ <li>COPYRIGHT -- only used on cover pages
+ <li>MISC -- only used on cover pages
+ <li>COVER_TITLE -- only on cover pages; only if needed
+ <li>DOC_COVER_TITLE -- only on document cover pages; only if needed
</ul>
<p>
You can use as many or as few as you wish, although at a minimum,
@@ -440,7 +521,10 @@ here to change <strong>mom</strong>'s document defaults (paper
size, margins, family, point size, line space, rag, etc), or
any of the document processing macros that set/change/control
the appearance of document elements. Think of this as the
-&quot;style-sheet &quot; section of a document.
+&quot;style-sheet &quot; section of a document. And please note:
+you MUST give <strong>mom</strong> a
+<a href="#PRINTSTYLE">PRINTSTYLE</a>
+directive <strong>before</strong> making any such changes.
<p>
Joe Blow wants his story printed in Helvetica, 12 on 14, rag
right, with
@@ -467,7 +551,7 @@ The setup for Joe Blow's story now looks like this:
.FAMILY H
.PT_SIZE 12
.LS 14
- .QUAD LEFT \"ie. rag right
+ .QUAD LEFT \"i.e. rag right
.FOOTERS
.LINEBREAK_CHAR *
</pre>
@@ -494,7 +578,7 @@ Here's the complete setup for <em>My Pulitzer Winner</em>:
.FAMILY H
.PT_SIZE 12
.LS 14
- .QUAD LEFT \"ie. rag right
+ .QUAD LEFT \"i.e. rag right
.FOOTERS
.LINEBREAK_CHAR *
\#
@@ -548,7 +632,7 @@ number of drafts already, J. Blow may very well decide his
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.
-<br>
+<p>
<hr>
<!========================================================================>
@@ -559,31 +643,38 @@ winner again.
The reference macros give <strong>mom</strong> the information
she needs to generate
-<a href="definitions.html#TERMS_DOCHEADER">docheaders</a>
+<a href="definitions.html#TERMS_DOCHEADER">docheaders</a>,
+<a href="definitions.html#TERMS_HEADER">page headers</a>,
and
-<a href="definitions.html#TERMS_HEADER">page headers</a>. They
-must go at the top of any file that uses <strong>mom</strong>'s
+<a href="cover.html#COVER_TOP">covers</a>.
+They must go at the top of any file that uses <strong>mom</strong>'s
document processing macros.
-
+<p>
<a name="INDEX_REFERENCE">
<h3><u>Reference macros list</u></h3>
</a>
<ul>
<li><a href="#TITLE">TITLE</a>
+ <li><a href="#DOC_TITLE">DOCTITLE</a>
<li><a href="#SUBTITLE">SUBTITLE</a>
<li><a href="#AUTHOR">AUTHOR</a>
<li><a href="#CHAPTER">CHAPTER</a>
+ <li><a href="#CHAPTER_TITLE">CHAPTER_TITLE</a>
<li><a href="#DRAFT">DRAFT</a>
<li><a href="#REVISION">REVISION</a>
+ <li><a href="#COPYRIGHT">COPYRIGHT</a>
+ <li><a href="#MISC">MISC</a>
+ <li><a href="#COVERTITLE">COVERTITLE</a>
</ul>
+<br>
<!---TITLE--->
<hr width="66%" align="left">
<p>
<a name="TITLE"></a>
-Macro: <strong>TITLE</strong> <var>&quot;&lt;title&gt;&quot;</var>
+<nobr>Macro: <strong>TITLE</strong> &quot;&lt;title&gt;&quot;</nobr>
<br>
<em>*Argument must be enclosed in double-quotes</em>
@@ -605,14 +696,61 @@ the title always gets converted to caps.
<a href="#DOCTYPE">DOCTYPE</a>
is <strong>CHAPTER</strong>, <strong>TITLE</strong> should be the
title of the opus, not &quot;CHAPTER whatever&quot;.
+<p>
+
+<!---DOCTITLE--->
+
+<hr width="66%" align="left">
+<p>
+<a name="DOCTITLE"></a>
+<nobr>Macro: <strong>DOCTITLE</strong> &quot;&lt;overall document title&gt;&quot;</nobr>
<br>
+<em>*Argument must be enclosed in double-quotes</em>
+
+<p>
+<strong>NOTE:</strong> This macro should be used only if your
+<a href="#DOCTYPE">DOCTYPE</a>
+is <strong>DEFAULT</strong> (which is <strong>mom</strong>'s
+default).
+<p>
+When you're creating a single document, say, an essay or a short
+story, you have no need of this macro.
+<a href="#TITLE">TITLE</a>
+takes care of all your title needs.
+<p>
+However if you're
+<a href="rectoverso.html#COLLATE">collating</a>
+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 <strong>DOCTITLE</strong>.
+<p>
+<strong>DOCTITLE</strong> tells <strong>mom</strong> the title
+of the complete document (as opposed to the title of each article
+or entitled section).
+<p>
+The doctitle string can be caps or caps/lower-case; it's up to you.
+In
+<a href="#PRINTSTYLE">PRINTSTYLE TYPESET</a>,
+by default, the doctitle appears in the rightmost position of
+<a href="definitions.html#TERMS_HEADER">page headers</a>,
+all in caps unless you turn that feature off (see
+<a href="headfootpage.html#_CAPS">HEADER_&lt;POSITION&gt;_CAPS</a>). In
+<a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>,
+the doctitle always gets converted to caps.
+<p>
+<strong>NOTE:</strong> If your
+<a href="#DOCTYPE">DOCTYPE</a>
+is <strong>CHAPTER</strong>, you don't need
+<strong>DOCTITLE</strong>. <strong>TITLE</strong> takes care of
+everything.
+<p>
<!---SUBTITLE--->
<hr width="66%" align="left">
<p>
<a name="SUBTITLE"></a>
-Macro: <strong>SUBTITLE</strong> <var>&quot;&lt;subtitle&gt;&quot;</var>
+<nobr>Macro: <strong>SUBTITLE</strong> &quot;&lt;subtitle&gt;&quot;</nobr>
<br>
<em>*Argument must be enclosed in double-quotes</em>
@@ -621,16 +759,16 @@ The subtitle string can be caps or caps/lower-case. Since a
document's subtitle appears only in the
<a href="definitions.html#TERMS_DOCHEADER">docheader</a>,
and the title is most likely in caps, I recommend caps/lower case.
-<br>
+<p>
<!---AUTHOR--->
<hr width="66%" align="left">
<p>
<a name="AUTHOR"></a>
-Macro: <strong>AUTHOR</strong> <var>&quot;&lt;author string&gt;&quot; [ &quot;&lt;author2 string&gt;&quot; &quot;&lt;author3 string&gt;&quot; ... ]</var>
+<nobr>Macro: <strong>AUTHOR</strong> &quot;&lt;author string&gt;&quot; [ &quot;&lt;author2 string&gt;&quot; &quot;&lt;author3 string&gt;&quot; ... ]</nobr>
<br>
-<em>*Multiple arguments must be enclosed in double-quotes</em>
+<em>*Multiple arguments must all be enclosed in double-quotes</em>
<p>
Each author string can hold as many names as you like, e.g.
@@ -653,14 +791,14 @@ authors), redefine the appropriate part of the header (see
<p>
The strings can be caps or caps/lower-case. I recommend caps/lower
case.
-<br>
+<p>
<!---CHAPTER--->
<hr width="66%" align="left">
<p>
<a name="CHAPTER"></a>
-Macro: <strong>CHAPTER</strong> <var>&lt;chapter number&gt;</var>
+<nobr>Macro: <strong>CHAPTER</strong> &lt;chapter number&gt;</nobr>
<p>
The chapter number can be in any form you like -- a digit, a roman
@@ -673,15 +811,19 @@ single line
She also puts the same thing in the middle of
<a href="definitions.html#TERMS_HEADER">page headers</a>.
<p>
+Please note that if your argument to <strong>CHAPTER</strong> runs
+to more than one word, you must enclose the argument in
+double-quotes.
+<p>
If you're not using <strong>DOCTYPE CHAPTER</strong>, the macro serves
no purpose and <strong>mom</strong> ignores it.
<p>
-<a name="CHAPTER_STRING"><strong>CHAPTER_STRING<strong></a>
+<a name="CHAPTER_STRING"><strong>CHAPTER_STRING</strong></a>
<p>
If you're not writing in English, you can ask <strong>mom</strong>
-to use the word for chapter in your own language by telling
-her what it is with the <strong>CHAPTER_STRING</strong> macro,
-like this:
+to use the word for &quot;chapter&quot; in your own language by
+telling her what it is with the <strong>CHAPTER_STRING</strong>
+macro, like this:
<p>
<pre>
.CHAPTER_STRING "Chapître"
@@ -690,19 +832,21 @@ like this:
You can also use <strong>CHAPTER_STRING</strong> if you want
&quot;CHAPTER&quot; instead of &quot;Chapter&quot; in the doc- and
page-headers.
-<br>
+<p>
<!---CHAPTER_TITLE--->
<hr width="66%" align="left">
<p>
<a name="CHAPTER_TITLE"></a>
-Macro: <strong>CHAPTER_TITLE</strong> <var>&quot;&lt;chapter title&gt;&quot;</var>
+<nobr>Macro: <strong>CHAPTER_TITLE</strong> &quot;&lt;chapter title&gt;&quot;</nobr>
+<br>
+<em>*Argument must be enclosed in double-quotes</em>
<p>
If, either in addition to or instead of &quot;Chapter #&quot; appearing
at the top of chapters, you want your chapter to have a title, use
-<strong>CHAPTER_TITLE</strong> with your title enclosed in
+<strong>CHAPTER_TITLE</strong>, with your title enclosed in
double-quotes, like this:
<p>
<pre>
@@ -711,8 +855,8 @@ double-quotes, like this:
If you've used
<a href="#CHAPTER">CHAPTER</a> to give the chapter a number,
-&quot;Chapter #&quot; and the title will appear at the top of the
-chapter, like this:
+both &quot;Chapter #&quot; and the chapter title will appear at the
+top of the chapter, like this:
<p>
<pre>
Chapter 1
@@ -720,75 +864,245 @@ chapter, like this:
</pre>
In such a case, by default, only the chapter's title will appear in the
-page headers, not &quot;Chapter #&quot;.
+<a href="definitions.html#TERMS_HEADER">page headers</a>,
+not &quot;Chapter #&quot;.
<p>
If you omit <strong>CHAPTER</strong> when setting up your reference
macros, only the title will appear, both at the top of page one and in
subsequent page headers.
-<br>
+<p>
+The style of the chapter title can be altered by
+<a href="docelement.html#DOCELEMENT_CONTROL">control macros</a>,
+e.g. <strong>CHAPTER_TITLE_FAMILY</strong>,
+<strong>CHAPTER_TITLE_FONT</strong>, etc. The default family,
+font and point size are Times Roman, Bold Italic, 4 points larger
+than
+<a href="definitions.html#TERMS_RUNNING">running text</a>.
+<p>
<!---DRAFT--->
<hr width="66%" align="left">
<p>
<a name="DRAFT"></a>
-Macro: <strong>DRAFT</strong> <var>&lt;draft #&gt;</var>
+<nobr>Macro: <strong>DRAFT</strong> &lt;draft #&gt;</nobr>
<p>
<strong>DRAFT</strong> only gets used with
<a href="#COPYSTYLE">COPYSTYLE DRAFT</a>.
If the <strong>COPYSTYLE</strong> is <strong>FINAL</strong> (the
default), <strong>mom</strong> ignores <strong>DRAFT</strong>.
-<strong>DRAFT</strong> only accepts a
-<a href="definitions.html#TERMS_NUMERICARGUMENT">numeric argument</a>.
+<strong>DRAFT</strong> accepts both alphabetic and numeric
+arguments, hence it's possible to do either
<p>
-<strong>Mom</strong> prints the draft number beside the word
-&quot;Draft&quot; in the middle part of
+<pre>
+ .DRAFT 2
+ or
+ .DRAFT Two
+</pre>
+
+<strong>Mom</strong> prints the argument to <strong>.DRAFT</strong>
+(i.e. the draft number) beside the word &quot;Draft&quot; in the
+middle part of
<a href="definitions.html#TERMS_HEADER">page headers</a>.
<p>
-<a name="DRAFT_STRING"><strong>DRAFT STRING<strong></a>
+<strong>A small word of caution:</strong> If your argument to
+<strong>.DRAFT</strong> is more than one word long, you must
+enclose the argument in double-quotes.
+<p>
+You may, if you wish, invoke <strong>.DRAFT</strong> without an
+argument, in which case, no draft number will be printed beside
+&quot;Draft&quot; in headers or footers.
+<p>
+<a name="DRAFT_STRING"><strong>DRAFT_STRING</strong></a>
<p>
If you're not writing in English, you can ask <strong>mom</strong>
-to use the word for draft in your own language by telling
-her what it is with the <strong>DRAFT_STRING</strong> macro,
+to use the word for &quot;draft&quot; in your own language by
+telling her what it is with the <strong>DRAFT_STRING</strong> macro,
like this:
<p>
<pre>
.DRAFT_STRING "Jet"
</pre>
+Equally, <strong>DRAFT_STRING</strong> can be used to roll your own
+solution to something other than the word &quot;Draft.&quot; For
+example, you might want &quot;Trial run alpha-three&quot; to appear
+in the headers of a draft version. You'd accomplish this by doing
+<p>
+<pre>
+ .DRAFT alpha-three
+ .DRAFT_STRING "Trial run
+</pre>
+
+<strong>.DRAFT</strong> without an argument, above, ensures that
+only the <strong>DRAFT_STRING</strong> gets printed.
+<p>
+<strong>NOTE:</strong> If you define both a blank <strong>.DRAFT</strong>
+and a blank <strong>.DRAFT_STRING</strong>, <strong>mom</strong>
+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
+<strong>.DRAFT</strong> and <strong>.DRAFT_STRING</strong> will
+result in <strong>mom</strong> using her default, which is to print
+&quot;Draft 1&quot;.
+<p>
+
<!---REVISION--->
<hr width="66%" align="left">
<p>
<a name="REVISION"></a>
-Macro: <strong>REVISION</strong> <var>&lt;revision #&gt;</var>
+<nobr>Macro: <strong>REVISION</strong> &lt;revision #&gt;</nobr>
<p>
<strong>REVISION</strong> only gets used with
<a href="#COPYSTYLE">COPYSTYLE DRAFT</a>.
If the <strong>COPYSTYLE</strong> is <strong>FINAL</strong>
(the default), <strong>mom</strong> ignores the
-<strong>REVISION</strong> macro. <strong>REVISION</strong> only
-accepts a
-<a href="definitions.html#TERMS_NUMERICARGUMENT">numeric argument</a>.
+<strong>REVISION</strong> macro. <strong>REVISION</strong> accepts
+both alphabetic and numeric arguments, hence it's possible to do
+either
<p>
+<pre>
+ .REVISION 2
+ or
+ .REVISION Two
+</pre>
+
<strong>Mom</strong> prints the revision number beside the shortform
&quot;Rev.&quot; in the middle part of
<a href="definitions.html#TERMS_HEADER">page headers</a>.
<p>
-<a name="REVISION_STRING"><strong>REVISION STRING</strong></a>
+<strong>A small word of caution:</strong> If your argument to
+<strong>.REVISION</strong> is more than one word long, you must
+enclose the argument in double-quotes.
+<p>
+You may, if you wish, invoke <strong>.REVISION</strong> without an
+argument, in which case, no revision number will be printed beside
+&quot;Rev.&quot; in headers or footers.
+<p>
+<a name="REVISION_STRING"><strong>REVISION_STRING</strong></a>
<p>
If you're not writing in English, you can ask <strong>mom</strong>
-to use the word for revision, or a shortform therof in your own language
-by telling her what it is with the <strong>REVISION_STRING</strong>
-macro, like this:
+to use the word for &quot;revision,&quot; or a shortform
+thereof, in your own language by telling her what it is with the
+<strong>REVISION_STRING</strong> macro, like this:
<p>
<pre>
.REVISION_STRING "Rév."
</pre>
-<hr>
+Additionally, you may sometimes want to make use of
+<strong>mom</strong>'s
+<a href="#COPYSTYLE">COPYSTYLE DRAFT</a>
+but not actually require any draft information. For example, you
+might like <strong>mom</strong> to indicate only the revision number
+of your document. The way to do that is to define an empty
+<strong>.DRAFT</strong> and <strong>.DRAFT_STRING</strong> in
+addition to <strong>.REVISION</strong>, like this:
+<p>
+<pre>
+ .DRAFT
+ .DRAFT_STRING
+ .REVISION 2
+</pre>
+
+<p>
+Equally, if you want to roll your own solution to what revision
+information appears in headers, you could do something like this:
+<pre>
+ .DRAFT
+ .DRAFT_STRING
+ .REVISION "two-twenty-two"
+ .REVISION_STRING "Revision"
+</pre>
+
+<p>
+The above, naturally, has no draft information. If you want to
+roll your own <strong>.DRAFT</strong> and/or
+<strong>.DRAFT_STRING</strong> as well, simply supply arguments to
+either or both.
+<p>
+
+<!---COPYRIGHT--->
+
+<hr width="66%" align="left">
+<p>
+<a name="COPYRIGHT"></a>
+<nobr>Macro: <strong>COPYRIGHT</strong> &quot;&lt;copyright info&gt;&quot;</nobr>
+<br>
+<em>*Argument must be enclosed in double-quotes</em>
+
+<p>
+The argument passed to <strong>COPYRIGHT</strong> is only used on
+cover or doc cover pages, and then only if the argument COPYRIGHT is
+passed to
+<a href="cover.html#COVER">COVER</a>
+or
+<a href="cover.html#DOC_COVER">DOC_COVER</a>.
+Do not include the copyright symbol in the argument passed to
+<strong>COPYRIGHT</strong>; <strong>mom</strong> puts it in for
+you.
+<p>
+
+<!---MISC--->
+
+<hr width="66%" align="left">
+<p>
+<a name="MISC"></a>
+<nobr>Macro: <strong>MISC</strong> &quot;&lt;argument 1&gt;&quot; [&quot;&lt;argument 2&gt;&quot; &quot;&lt;argument 3&gt;&quot; ...]</nobr>
+<br>
+<em>*Multliple arguments must all be enclosed in double-quotes</em>
+
+<p>
+The argument(s) passed to <strong>MISC</strong> are only used on
+cover or doc cover pages, and then only if the argument MISC is
+passed to
+<a href="cover.html#COVER">COVER</a>
+or
+<a href="cover.html#DOC_COVER">DOC_COVER</a>.
+<strong>MISC</strong> can contain any information you like. Each
+argument appears on a separate line at the bottom of the cover or
+doc cover page.
+<p>
+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
+<p>
+<pre>
+ .MISC &quot;Music History 101&quot; &quot;Professor Hasbeen&quot; &quot;Dec. 24, 2006&quot;
+</pre>
+
+and the information would appear on the essay's cover page.
+<p>
+
+<!---COVER_TITLE--->
+
+<hr width="66%" align="left">
+<p>
+<a name="COVERTITLE"></a>
+<nobr>Macro: <strong>COVERTITLE</strong> &quot;&lt;user defined cover page title&gt;&quot;</nobr>
+<br>
+<nobr>Macro: <strong>DOC_COVERTITLE</strong> &quot;&lt;user defined document cover page title&gt;&quot;</nobr>
+<br>
+<em>*Argument must be enclosed in double-quotes</em>
+
+<p>
+The argument passed to <strong>COVERTITLE</strong> or
+<strong>DOC_COVERTITLE</strong> is only used on cover or doc cover
+pages, and then only if the argument COVERTITLE is passed to
+<a href="cover.html#COVER">COVER</a>
+or
+<a href="cover.html#DOC_COVER">DOC_COVER</a>.
+<p>
+The only time you require a <strong>COVERTITLE</strong> or
+<strong>DOC_COVERTITLE</strong>is when none of the required first
+arguments to <strong>COVER</strong> or <strong>DOC_COVER</strong>
+fits your needs for the title you want to appear on cover (or doc
+cover) pages.
+
+<p>
+<hr>
<!========================================================================>
<a name="DOCSTYLE_MACROS">
@@ -816,13 +1130,14 @@ draft and revision information in the headers) or a final copy.
</ul>
<li><a href="#COPYSTYLE">COPYSTYLE</a>
</ul>
+<br>
<!---DOCTYPE--->
<hr width="66%" align="left">
<p>
<a name="DOCTYPE"></a>
-Macro: <strong>DOCTYPE</strong> <var>DEFAULT | CHAPTER | NAMED &quot;&lt;name&gt;&quot; | LETTER</var>
+<nobr>Macro: <strong>DOCTYPE</strong> DEFAULT | CHAPTER | NAMED &quot;&lt;name&gt;&quot; | LETTER</nobr>
<p>
The arguments <strong>DEFAULT, CHAPTER</strong> and
<strong>NAMED</strong> tell <strong>mom</strong> what to put
@@ -831,7 +1146,7 @@ in the
and
<a href="definitions.html#TERMS_HEADER">page headers</a>.
<strong>LETTER</strong> tells her that you want to write a
-lettter.
+letter.
<p>
<strong>Mom</strong>'s default <strong>DOCTYPE</strong> is
<strong>DEFAULT</strong>. If that's what you want, you don't
@@ -844,7 +1159,7 @@ containing the title, subtitle and author information given to the
and page headers with the author and title.
(See
<a href="headfootpage.html#HEADER_STYLE">Default specs for headers</a>
-for how <strong>mom</strong>'s outputs each part of the page header.)
+for how <strong>mom</strong> outputs each part of the page header.)
<p>
<strong>CHAPTER</strong> prints &quot;Chapter #&quot; in place of a
<a href="definitions.html#TERMS_DOCHEADER">docheader</a>
@@ -854,17 +1169,18 @@ for how <strong>mom</strong>'s outputs each part of the page header.)
If you give the chapter a title with
<a href="#CHAPTER_TITLE">CHAPTER TITLE</a>,
<strong>mom</strong> prints &quot;Chapter #&quot; and the title
-underneath. If you omit the <strong>CHAPTER</strong> reference
-macro but supply a
+underneath. If you omit the
+<a href="#CHAPTER">CHAPTER</a>
+reference macro but supply a
<a href="#CHAPTER_TITLE">CHAPTER_TITLE</a>,
<strong>mom</strong> prints only the chapter title. <em>(*For
-backward compatability with pre-1.1.5 versions of</em>
+backward compatibility with pre-1.1.5 versions of</em>
<strong>mom</strong><em>, you can also supply a chapter title by
-ommitting the</em> <strong>CHAPTER</strong> <em>reference macro and
-supplying a chapter title with
-<a href="#CHAPTER_STRING">CHAPTER_STRING</a>.
+omitting the</em> <strong>CHAPTER</strong> <em>reference macro and
+supplying a chapter title with</em>
+<a href="#CHAPTER_STRING">CHAPTER_STRING</a>.)
<p>
-The page headers in <strong>DOCTYPE CHAPTER</a> contain the author,
+The page headers in <strong>DOCTYPE CHAPTER</strong> contain the author,
the title of the book (which you gave with
<a href="#TITLE">TITLE</a>),
and &quot;Chapter #&quot; (or the chapter title). See
@@ -882,22 +1198,41 @@ except that <strong>mom</strong> prints the argument to
as well as in page headers.
(See
<a href="headfootpage.html#HEADER_STYLE">Default specs for headers</a>
-for how <strong>mom</strong>'s outputs each part of the page header.)
+for how <strong>mom</strong> outputs each part of the page header.)
+<p>
+Additionally, if you wish the name of this particular kind of
+document to be coloured, you can pass <strong>DOCTYPE NAMED</strong>
+a third (optional) argument: the name of a colour pre-defined (or
+&quot;initialized&quot;) with
+<a href="color.html#NEWCOLOR">NEWCOLOR</a>
+or
+<a href="color.html#XCOLOR">XCOLOR</a>.
+For example, if you have a doctype named &quot;Warning&quot;, and
+you'd like &quot;Warning&quot; to be in red, assuming you've
+pre-defined (or &quot;initialized&quot;) the color, red, this is
+what the <strong>DOCTYPE</strong> entry would look like:
+<p>
+<pre>
+ .DOCTYPE NAME "Warning" red
+</pre>
+
<p>
<strong>LETTER</strong> tells mom you're writing a letter. See
the section
<a href="letters.html#INTRO">Writing Letters</a>
for instructions on using <strong>mom</strong> to format letters.
-<br>
+<p>
<!---PRINTSTYLE--->
<hr width="66%" align="left">
<p>
<a name="PRINTSTYLE"></a>
-Macro: <strong>PRINTSTYLE</strong> <var>TYPESET | TYPEWRITE [ SINGLESPACE ]</var>
+<nobr>Macro: <strong>PRINTSTYLE</strong> TYPESET | TYPEWRITE [ SINGLESPACE ]</nobr>
<br>
<em>*Required for document processing.</em>
+<br>
+<em>*Must come before any changes to default document style</em>
<p>
<strong>PRINTSTYLE</strong> tells <strong>mom</strong> whether to typeset
@@ -909,6 +1244,15 @@ a <strong>PRINTSTYLE</strong>. If you don't give one,
<strong>mom</strong> will warn you on stderr and print a single
page with a nasty message.
<p>
+Furthermore, <strong>PRINTSTYLE</strong> must come before any
+changes to <strong>mom</strong>'s default typestyle parameters.
+(This applies primarily to, but is by no means restricted to,
+<strong>PRINTSTYLE TYPESET</strong>.) <strong>PRINTSTYLE</strong>
+sets up complete &quot;templates&quot; that include default
+papersize, margins, family, fonts, point sizes, and so on.
+Therefore, changes to any aspect of document style must come
+afterwards.
+<p>
<strong>TYPESET</strong>, as the argument implies, typesets documents
(by default in Times Roman; see
<a href="#TYPESET_DEFAULTS">TYPESET defaults</a>).
@@ -918,6 +1262,27 @@ as well as the
<a href="definitions.html#STYLE_CONTROL">style control macros</a>
of document processing.
<p>
+As mentioned above, <strong>PRINTSTYLE TYPESET</strong> must come
+before any changes to <strong>mom</strong>'s default typographic
+settings. For example,
+
+<pre>
+ .PAPER A4
+ .LS 14
+ .PRINTSTYLE TYPESET
+</pre>
+
+will not changes <strong>mom</strong>'s default paper size to A4,
+nor her default document leading 14 points, whereas
+
+<pre>
+ .PRINTSTYLE TYPESET
+ .PAPER A4
+ .LS 14
+</pre>
+
+will.
+<p>
With <strong>TYPEWRITE</strong>, <strong>mom</strong> does her best
to reproduce the look and feel of typewritten, double-spaced copy (see
<a href="#TYPEWRITE_DEFAULTS">TYPEWRITE defaults</a>).
@@ -958,7 +1323,7 @@ or singlespaced, the only way to get it is with the
macro, and then ONLY if <strong>DOC_LEAD</strong> is set
<strong>before</strong> you invoke the <strong>START</strong>
macro.
-
+<p>
<a name="TYPESET_DEFAULTS"><h3><u>TYPESET defaults</u></h3></a>
<pre>
Family = Times Roman
@@ -1014,6 +1379,7 @@ these macros in the midst of a document,
<strong>.UNDERLINE_SLANT</strong> restore underlining of
italics and pseudo-italics.
<p>
+<a name="UNDERLINE_QUOTES"></a>
Additionally, by default, <strong>mom</strong> underlines
<a href="definitions.html#TERMS_QUOTES">quotes</a>
(but not
@@ -1039,14 +1405,14 @@ headers/footers should they become crowded (quite likely to
happen if the title of your document is long and your
<a href="#COPYSTYLE">COPYSTYLE</a>
is <strong>DRAFT</strong>).
-<br>
+<p>
<!---COPYSTYLE--->
<hr width="66%" align="left">
<p>
<a name="COPYSTYLE"></a>
-Macro: <strong>COPYSTYLE</strong> <var>DRAFT | FINAL</var>
+<nobr>Macro: <strong>COPYSTYLE</strong> DRAFT | FINAL</nobr>
<p>
<strong>Mom</strong>'s default <strong>COPYSTYLE</strong> is
@@ -1066,13 +1432,13 @@ you want to.
<a href="#REVISION">REVISION</a>
(see
<a href="#REFERENCE_MACROS">reference macros</a>),
- appear in the center part of
+ appear in the centre part of
<a href="definitions.html#TERMS_HEADER">page headers</a>
- (or footers, depending on which you'ves selected) along with
+ (or footers, depending on which you've selected) along with
any other information that normally appears there.
</ol>
<p>
-<strong>IMPORTANT:</strong> If you define your own center part for page
+<strong>IMPORTANT:</strong> If you define your own centre part for page
headers with
<a href="headfootpage.html#HDRFTR_CENTER">HEADER_CENTER</a>,
no draft and/or revision number will appear there. If you want draft
@@ -1083,11 +1449,11 @@ and revision information in this circumstance, use
<br>
<ol>
<li>it respects the starting page number you give the document
- <li>page numbers are set in normal (arabic) digits
+ <li>page numbers are set in normal (Arabic) digits
<li>no draft or revision number appears in the page headers
</ol>
<p>
-<strong>NOTE:</strong> The center part of page headers can get crowded,
+<strong>NOTE:</strong> The centre part of page headers can get crowded,
especially with
<a href="docprocessing.html#DOCTYPE">DOCTYPE CHAPTER</a>
and
@@ -1100,17 +1466,17 @@ Another, which only works with
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPESET</a>,
is to reduce the size of the header's centre part only (with
<a href="headfootpage.html#_SIZE">HEADER_CENTER_SIZE</a>).
-And finally, you can elect to have the draft/revsion information
-attached to page numbers instead of having it appear in the center
+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
<a href="headfootpage.html#DRAFT_WITH_PAGENUMBER">DRAFT_WITH_PAGENUMBER</a>).
-<br>
+<p>
<hr>
<!========================================================================>
<a name="STYLE_BEFORE_START"><h2><u>Changing type/style parameters prior to START</u></h2></a>
-
+<p>
In the third (optional) part of setting up a document (see
<a href="#DOCPROCESSING_TUT">Tutorial -- setting up a mom document</a>),
you can use the
@@ -1139,39 +1505,86 @@ adjusted to fill pages fully to the bottom margin.
<li><a href="#DOCHEADER_CONTROL">Docheader control</a>
</ul>
</ul>
+<br>
<hr width="66%" align="left">
<a name="TYPE_BEFORE_START"><h2><u>Using the typesetting macros prior to START</u></h2></a>
+<p>
+From time to time (or maybe frequently), you'll want the overall
+look of a document to differ from <strong>mom</strong>'s defaults.
+Perhaps you'd like her to use a different
+<a href="definitions.html#TERMS_FAMILY">family</a>,
+or a different overall
+<a href="definitions.html#TERMS_LEADING">leading</a>,
+or have different left and/or right page margins.
+<p>
+To accomplish such alterations, use the appropriate
+<a href="typesetting.html#MACROS_TYPESETTING">typesetting macros</a>
+(listed below) <strong>after</strong>
+<a href="#PRINTSTYLE">PRINTSTYLE</a>
+and <strong>before</strong>
+<a href="#START">START</a>.
+<p>
+More than one user has, quite understandably, not fully grasped
+the significance of the preceding sentence. The part they've missed
+is &quot;<u>after <strong>PRINTSTYLE</strong></u>&quot;.
+<p>
+Changes to any aspect of the default look and/or formatting
+of a <strong>mom</strong> document must come after
+<strong>PRINTSTYLE</strong>. For example, it might seem natural to
+set up page margins at the very top of a document with
+<p>
+<pre>
+ .L_MARGIN 1i
+ .R_MARGIN 1.5i
+</pre>
-When used before the
-<a href="#START">START</a>
-macro, the following
+However, when you invoke <strong>.PRINTSTYLE</strong>, those
+margins will be overridden. The correct place to set margins--and
+all other changes to the look of a document--is <strong>after
+PRINTSTYLE</strong>.
+
+<p>
+<strong>NOTE:</strong> Don't use the macros listed in <a
+href="#DOC_PARAM_MACROS">Changing document-wide typesetting
+parameters after START</a> prior to <strong>START</strong>; they are
+exclusively for use afterwards.
+<p>
+When used before
+<strong>START</strong>,
+the
<a href="typesetting.html#MACROS_TYPESETTING">typesetting macros</a>
-have these meanings:
+(below) have the following meanings:
<p>
<pre>
- L_MARGIN Left margin of pages, including headers/footers
- R_MARGIN Right margin of pages, including headers/footers
- T_MARGIN The point at which running text (i.e. not
- headers/footers or page numbers) starts on each page
- B_MARGIN The point at which running text (i.e. not
- headers/footers or page numbers) ends on each page
-
- (PAGE If you use PAGE, its first 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
- calculate automatic point size changes (eg. for heads,
- footnotes, quotes, headers, etc)
- *LS or AUTOLEAD The leading used in paragraphs; all leading and spacing
- of running text is calculated from this
- QUAD Affects paragraphs only
+ 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 <a href="#DOC_LEAD_ADJUST">DOC_LEAD_ADJUST</a>
+ *See <a href="headfootpage.html#FOOTER_MARGIN">FOOTER MARGIN AND BOTTOM MARGIN</a> for an important warning
+ **See <a href="#DOC_LEAD_ADJUST">DOC_LEAD_ADJUST</a>
+***See <a href="#LRC_NOTE">Special note</a>
</pre>
Other macros that deal with type style, or refinements thereof
@@ -1179,11 +1592,79 @@ Other macros that deal with type style, or refinements thereof
It is not recommended that you set up tabs or indents prior to
<strong>START</strong>.
<p>
-If you want to change any of the basic parameters above
+If you want to change any of the basic parameters (above)
<em>after</em> <strong>START</strong> and have them affect a
document globally (as if you'd entered them <em>before</em>
<strong>START</strong>), you must use the macros listed in
<a href="#DOC_PARAM_MACROS">Changing document-wide style parameters after START</a>.
+
+<a name="LRC_NOTE"></a>
+<h3><u>Special note on .LEFT, .RIGHT and .CENTER prior to START</u></h3>
+In a word, these three macros have no effect on document processing
+when invoked prior to <strong>START</strong>.
+<p>
+All <strong>mom</strong>'s document element tags
+(<strong>PP</strong>, <strong>HEAD</strong>,
+<strong>BLOCKQUOTE</strong>, <strong>FOOTNOTE</strong>, etc.)
+except
+<a href="docelement.html#QUOTE">QUOTE</a>
+set a
+<a href="definitions.html#TERMS_FILLED">fill mode</a>
+as soon as they're invoked. If you wish to turn fill mode off for
+the duration of any tag (with
+<a href="typesetting.html#LRC">.LEFT, .RIGHT or .CENTER</a>)
+you must do so immediately after invoking the tag. Furthermore,
+the change affects <em>only</em> the current invocation of the tag.
+Subsequent invocations of the same tag for which you want the same
+change require that you invoke <strong>LEFT</strong>,
+<strong>RIGHT</strong> or <strong>CENTER</strong> immediately after
+every invocation of the tag.
+<p>
+
+<!---COLOR--->
+<a name="COLOR"><h2><u>Colour</u></h2></a>
+<br>
+Although it doesn't really matter where you define/initialize
+colours for use in document processing (see
+<a href="color.html#NEWCOLOR">NEWCOLOR</a>
+and
+<a href="color.html#XCOLOR">XCOLOR</a>
+in the section
+<a href="color.html#COLOR_INTRO">Coloured text</a>),
+I recommend doing so before you begin document processing with
+<a href="#START">START</a>.
+<p>
+The macro,
+<a href="color.html#COLOR">COLOR</a>,
+and the
+<a href="definitions.html#TERMS_INLINES">inline escape</a>,
+<a href="color.html#COLOR_INLINE">\[&lt;colorname&gt;]</a>,
+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
+<a href="docelement.html#DOCELEMENT_CONTROL">document element control macros</a>.
+<p>
+<strong>PLEASE NOTE:</strong> If you plan to have <strong>mom</strong>
+generate a
+<a href="docelement.html#TOC">table of contents</a>,
+do NOT embed colour
+<a href="definitions.html#TERMS_INLINES">inline escapes</a>
+(<a href="color.html#COLOR_INLINE">\[&lt;colorname&gt;]</a>)
+in the
+<a href="definitions.html#TERMS_STRINGARGUMENT">string arguments</a>
+given to any of the
+<a href="docprocessing.html#REFERENCE_MACROS">reference macros</a>,
+nor in the string arguments given to
+<a href="docelement.html#HEAD">.HEAD</a>,
+<a href="docelement.html#SUBHEAD">.SUBHEAD</a>
+or
+<a href="docelement.html#PARAHEAD">.PARAHEAD</a>.
+Use, rather, the
+<a href="definitions.html#TERMS_CONTROLMACRO">control macros</a>
+<strong>mom</strong> provides to automatically colourize these
+elements.
<br>
<!---DOC_LEAD_ADJUST--->
@@ -1191,7 +1672,7 @@ document globally (as if you'd entered them <em>before</em>
<hr width="66%" align="left">
<a name="DOC_LEAD_ADJUST"><h3><u>Adjusting document leading to fill pages</u></h3></a>
<br>
-Macro: <strong>DOC_LEAD_ADJUST</strong> <var>toggle</var>
+<nobr>Macro: <strong>DOC_LEAD_ADJUST</strong> toggle</nobr>
<br>
<em>*Must come after LS or AUTOLEAD and before START</em>
@@ -1208,49 +1689,65 @@ leading, then incrementally adds
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.
+unnoticeable, and since in almost all cases adjusted leading is
+what you want, it's <strong>mom</strong>'s default.
<p>
-<strong>Mom</strong> uses <strong>DOC_LEAD_ADJUST</strong> with
-her default document settings, but if you invoke
-<a href="typesetting.html#LS">LS</a>
-or
-<a href="typesetting.html#AUTOLEAD">AUTOLEAD</a>
-prior to
-<a href="#START">START</a>,
-you have to do
+Should you NOT want adjusted document leading, you MUST turn it
+off manually, like this:
<p>
<pre>
- .DOC_LEAD_ADJUST
+ .DOC_LEAD_ADJUST OFF
</pre>
-in order to enable it.
-<p>
-If you don't like the idea of <strong>mom</strong> playing around
-with the leading by default, you can turn adjusting off with
+ If you set the document leading prior to <strong>START</strong>
+with
+<a href="typesetting.html#LS">LS</a>
+or
+<a href="typesetting.html#AUTOLEAD">AUTOLEAD</a>,
+<strong>DOC_LEAD_ADJUST OFF</strong> must come afterwards, like
+this:
<p>
<pre>
+ .LS 12
.DOC_LEAD_ADJUST OFF
</pre>
In this scenario, the maximum number of lines that fit on a page at
-the current document leading determine where <strong>mom</strong> ends
+a
+<a href="definitions.html#TERMS_LEADING">leading</a>
+of 12
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>
+determine where <strong>mom</strong> ends
a page. The effect will be that last lines usually fall (slightly)
-short of your expected bottom margin.
+short of the &quot;official&quot; bottom margin.
+<p>
+In
+<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE</a>
+<strong>TYPEWRITE</strong>, the leading is always adjusted and
+can't be turned off.
<p>
<strong>NOTE:</strong> <strong>DOC_LEAD_ADJUST</strong>, if
used, must be invoked after
-<a href="typesetting.html#LS">LS</a>
+<a href="typesetting.html#LEADING">LS</a>
or
<a href="typesetting.html#AUTOLEAD">AUTOLEAD</a>
and before
<a href="#START">START</a>
-<br>
+<p>
+<strong>ADDITIONAL NOTE:</strong> Even if you disable
+<strong>DOC_LEAD_ADJUST</strong>, <strong>mom</strong> will still
+adjust the leading of endnotes pages and toc pages. See
+<a href="docelement.html#ENDNOTE_LEAD">ENDNOTE_LEAD</a>
+and
+<a href="docelement.html#TOC_LEAD">TOC_LEAD</a>
+for an explanation of how to disable this default behaviour.
+<p>
<!---DOCHEADER--->
<hr width="66%" align="left">
<a name="DOCHEADER"><h3><u>Managing the docheader</u></h3></a>
<br>
-Macro: <strong>DOCHEADER</strong> <var>&lt;toggle&gt; [ distance to advance from top of page ]</var>
+<nobr>Macro: <strong>DOCHEADER</strong> &lt;toggle&gt; [ distance to advance from top of page ]</nobr>
<br>
<em>*Must come before START; distance requires a <a href="#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -1270,17 +1767,22 @@ turn it off with
have to be <strong>OFF</strong>; it can be anything you like.
<p>
If you turn the docheader off, <strong>mom</strong>, by default, starts
-your document in the same place she would if the docheader were there.
-If you'd like her to start at a different vertical position, give
-her the distance you'd like as a second argument.
+the running text of your document on the same top
+<a href="definitions.html#TERMS_BASELINE">baseline</a>
+as all subsequent pages. If you'd like her to start at a different
+vertical position, give her the distance you'd like as a second
+argument.
<p>
<pre>
.DOCHEADER OFF 1.5i
</pre>
-This starts the document 1.5 inches from the top of the page.
-The distance you give is measured from the top edge of the paper
-to the
+This starts the document 1.5 inches from the top of the page PLUS
+whatever spacing adjustment <strong>mom</strong> has to make in
+order to ensure that the first baseline of running text falls on a
+&quot;legal&quot; baseline (i.e. one that ensures that the bottom
+margin of the first page falls where it should). The distance is
+measured from the top edge of the paper to the
<a href="definitions.html#TERMS_BASELINE">baseline</a>
of the first line of type.
<p>
@@ -1293,8 +1795,8 @@ like the way <strong>mom</strong> does things) and use
<strong>DOCHEADER OFF</strong> 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 <strong>.PSPIC</strong>;
-see the <strong>grops</strong> man page for usage).
-
+see the <strong>groff_tmac</strong> man page for usage).
+<p>
<a name="DOCHEADER_CONTROL"><h3><u>How to change the look of docheaders: docheader control macros</u></h3></a>
<p>
@@ -1336,18 +1838,40 @@ is CHAPTER,
The
<a href="definitions.html#TERMS_FAMILY">family</a>
is the prevailing family of the whole document.
+<p>
+<strong>NOTE:</strong> If your <strong>DOCTYPE</strong> is
+<strong>CHAPTER</strong> and you have both &quot;Chapter #&quot;
+and a &quot;Chapter Title&quot; (as above), you may find the
+<a href="definitions.html#TERMS_LEADING">leading</a>
+a bit cramped (owing to <strong>mom</strong>'s default docheader
+leading). If this is the case, you can adjust the leading either
+with
+<a href="#ADJUST_LEADING">DOCHEADER_LEAD</a>
+or by including the
+<a name="definitions.html#TERMS_INLINES">inline escape</a>,
+<a href="inlines.html#DOWN">\*[DOWN]</a>,
+in the argument you pass to
+<a href="#CHAPTER_TITLE">CHAPTER_TITLE</a>, like this:
+<p>
+<pre>
+ .CHAPTER_TITLE "\*[DOWN 2p]Why Not Patent Calculus?"
+</pre>
+
-<h3><u>The docheader macros to:</u></h3>
+<a name="DOCHEADER_CONTROL_INDEX"><h3><u>The docheader macros to:</u></h3></a>
<ol>
- <li><a href="#CHANGE_START">Change the starting position</a>
+ <li><a href="#CHANGE_START">Change the starting position of the docheader</a>
+ <li><a href="#DOCHEADER_FAMILY">Change the family of the entire docheader</a>
<li><a href="#ADJUST_LEADING">Adjust the docheader leading</a>
- <li><a href="#CHANGE_FAMILY">Change the family of docheader elements</a>
+ <li><a href="#CHANGE_FAMILY">Change the family of individual docheader elements</a>
<li><a href="#CHANGE_FONT">Change the font of docheader elements</a>
+ <li><a href="#CHANGE_COLOR">Change the colour of the docheader</a>
<li><a href="#CHANGE_SIZE">Adjust the size of docheader elements</a>
<li><a href="#CHANGE_ATTRIBUTE">Change the attribution string (&quot;by&quot;)</a>
</ol>
<p>
<a name="CHANGE_START"><h3><u>1. Change the starting position</u></h3></a>
+<p>
By default, a docheader starts on the same
<a href="definitions.html#TERMS_BASELINE">baseline</a>
as
@@ -1379,14 +1903,41 @@ you might find the docheaders a bit high when headers are off.
Use
<a href="#CHANGE_START">DOCHEADER_ADVANCE</a>
to place them where you want.
+<p>
+
+<a name="DOCHEADER_FAMILY"><h3><u>2. Change the family of the entire docheader</u></h3></a>
+<p>
+By default, <strong>mom</strong> sets the docheader in the same
+family used for
+<a href="definitions.html#TERMS_RUNNING">running text</a>.
+If you'd prefer to have your docheaders set in a different family,
+invoke <strong>DOCHEADER_FAMILY</strong> with the family you want.
+The argument for <strong>DOCHEADER_FAMILY</strong> is the same as
+for
+<a href="typesetting.html#FAMILY">FAMILY</a>.
+<p>
+For example, <strong>mom</strong>'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,
+<p>
+<pre>
+ .DOCHEADER_FAMILY H
+</pre>
+is how you'd do it.
+<p>
+Please note that if you use <strong>DOCHEADER_FAMILY</strong>,
+you can still alter the family of individual parts of the docheader
+with the macros listed
+<a href="#CHANGE_FAMILY">here</a>.
-<a name="ADJUST_LEADING"><h3><u>2. Adjust the leading</u></h3></a>
+<a name="ADJUST_LEADING"><h3><u>3. Adjust the leading</u></h3></a>
+<p>
The
-<a href="definitions.html#TERMS_LEADING">leading</a> of
-docheaders is the same as running text (except when
+<a href="definitions.html#TERMS_LEADING">leading</a>
+of docheaders is the same as running text (except when
<a href="#DOCTYPE">DOCTYPE</a>
-is <strong>CHAPTER</a> <em>and both</em> a chapter number and a
+is <strong>CHAPTER</strong> <em>and</em> both a chapter number and a
chapter title have been supplied, in which case the default is 4 points
more than running text.)
<p>
@@ -1394,42 +1945,48 @@ If you'd like your docheaders to have a different leading, say, 2
points more than the lead of running text, use:
<p>
<pre>
- .DOCHEADER_LEAD +2p
+ .DOCHEADER_LEAD +2
</pre>
Since the leading of docheaders is calculated from the lead of running
text, a + or - sign is required before the argument (how much to add
-or subtract from the lead of running text). The
+or subtract from the lead of running text). No
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
-is also required.
+is required; points is assumed.
+<p>
-<a name="CHANGE_FAMILY"><h3><u>3. Change the family of docheader elements</u></h3></a>
+<a name="CHANGE_FAMILY"><h3><u>4. Change the family of docheader elements</u></h3></a>
+<p>
The following macros let you change the
<a href="definitions.html#TERMS_FAMILY">family</a>
of each docheader element separately:
<p>
<ul>
-<li><strong>TITLE_FAMILY</strong> <var>&lt;family&gt;</var>
-<li><strong>CHAPTER_TITLE_FAMILY</strong> <var>&lt;family&gt;</var>
-<li><strong>SUBTITLE_FAMILY</strong> <var>&lt;family&gt;</var>
-<li><strong>AUTHOR_FAMILY</strong> <var>&lt;family&gt;</var>
-<li><strong>DOCTYPE_FAMILY</strong> <var>&lt;family&gt;</var> (if
+<li><strong>TITLE_FAMILY</strong> <nobr>&lt;family&gt;</nobr>
+<li><strong>CHAPTER_TITLE_FAMILY</strong> <nobr>&lt;family&gt;</nobr>
+<li><strong>SUBTITLE_FAMILY</strong> <nobr>&lt;family&gt;</nobr>
+<li><strong>AUTHOR_FAMILY</strong> <nobr>&lt;family&gt;</nobr>
+<li><strong>DOCTYPE_FAMILY</strong> <nobr>&lt;family&gt; (if</nobr>
<a href="#DOCTYPE">DOCTYPE</a> is NAMED)
</ul>
<p>
-Simply pass the appropriate macro the family you want.
+Simply pass the appropriate macro the family you want, just as you
+would with
+<a href="typesetting.html#FAMILY">FAMILY</a>.
+<p>
-<a name="CHANGE_FONT"><h3><u>4. Change the font of docheader elements</u></h3></a>
+<a name="CHANGE_FONT"><h3><u>5. Change the font of docheader elements</u></h3></a>
+<p>
The following macros let you change the
<a href="definitions.html#TERMS_FONT">font</a>
of each docheader element separately:
<p>
<ul>
-<li><strong>TITLE_FONT</strong> <var>R | B | I | BI</var>
-<li><strong>CHAPTER_TITLE_FONT</strong> <var>R | B | I | BI</var>
-<li><strong>SUBTITLE_FONT</strong> <var>R | B | I | BI</var>
-<li><strong>AUTHOR_FONT</strong> <var>R | B | I | BI</var>
-<li><strong>DOCTYPE_FONT</strong> <var>R | B | I | BI</var> (if
+<li><strong>TITLE_FONT</strong> <nobr>R | B | I | BI</nobr>
+<li><strong>CHAPTER_TITLE_FONT</strong> <nobr>R | B | I | BI</nobr>
+<li><strong>SUBTITLE_FONT</strong> <nobr>R | B | I | BI</nobr>
+<li><strong>AUTHOR_FONT</strong> <nobr>R | B | I | BI</nobr>
+<li><strong>DOCTYPE_FONT</strong> <nobr>R | B | I | BI (if</nobr>
<a href="#DOCTYPE">DOCTYPE</a> is NAMED)
</ul>
<p>
@@ -1437,9 +1994,60 @@ Simply pass the appropriate macro the font you want. <strong>R,
B, I</strong> and <strong>BI</strong> have the same meaning as
they do for
<a href="typesetting.html#FONT">FT</a>.
+<p>
+<a name="CHANGE_COLOR"><h3><u>6. Change the colour of the docheader elements individually</u></h3></a>
+<p>
+The following macros let you change the color of each docheader
+element separately. You must pre-define (or
+&quot;initialize&quot;) the color with
+<a href="color.html#NEWCOLOR">NEWCOLOR</a>
+or
+<a href="color.html#XCOLOR">XCOLOR</a>.
+<p>
+<ul>
+ <li><strong>TITLE_COLOR</strong> <nobr>&lt;colorname&gt;</nobr>
+ <li><strong>CHAPTER_TITLE_COLOR</strong> <nobr>&lt;colorname&gt;</nobr>
+ <ul>
+ <li><strong>Note: CHAPTER_TITLE_COLOR</strong> is needed
+ only if you enter both a <strong>CHAPTER</strong>
+ reference macro AND a <strong>CHAPTER_TITLE</strong>
+ macro. Otherwise, the macro,
+ <strong>TITLE_COLOR</strong> takes care of colorizing
+ the chapter header.
+ </ul>
+ <li><strong>SUBTITLE_COLOR</strong> <nobr>&lt;colorname&gt;</nobr>
+ <li><strong>ATTRIBUTE_COLOR</strong> <nobr>&lt;colorname&gt;</nobr>
+ (the &quot;by&quot; string that precedes the author[s] name[s])
+ <li><strong>AUTHOR_COLOR</strong> <nobr>&lt;colorname&gt;</nobr>
+ <li><strong>DOCTYPE_COLOR</strong> <nobr>&lt;colorname&gt; (if</nobr>
+ <a href="#DOCTYPE">DOCTYPE</a> is NAMED)
+</ul>
+<p>
+It is not recommended that you embed colour (with the
+<a href="definitions.html#TERMS_INLINES">inline escape</a>,
+<a href="color.html#COLOR_INLINE">\*[&lt;colorname&gt;]</a>)
+in the strings passed to
+<strong>TITLE</strong>, <strong>CHAPTER_TITLE</strong>,
+<strong>SUBTITLE</strong>, <strong>AUTHOR</strong> or the name you
+give <strong>DOCTYPE NAMED</strong>. The strings passed to these
+macros are used to generate page
+<a href="definitions.html#TERMS_HEADER">headers</a>
+and
+<a href="definitions.html#TERMS_FOOTER">footers</a>.
+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.)
+<p>
+<a name="DOCHEADER_COLOR"></a>
+If you want to colourize the entire docheader, use the macro
+<p>
+<ul>
+<li><strong>DOCHEADER_COLOR</strong> <nobr>&lt;color name&gt;.</nobr>
+</ul>
-<a name="CHANGE_SIZE"><h3><u>5. Adjust the size of docheader elements</u></h3></a>
+<a name="CHANGE_SIZE"><h3><u>7. Adjust the size of docheader elements</u></h3></a>
+<p>
The following macros let you adjust the point size of each docheader
element separately.
<p>
@@ -1452,27 +2060,28 @@ so there's no need to append a unit to the argument. Fractional point
sizes are allowed.
<p>
<ul>
-<li><strong>TITLE_SIZE</strong> <var>&lt;+/-points&gt;</var>
+<li><strong>TITLE_SIZE</strong> <nobr>&lt;+/-points&gt;</nobr>
<br>
default = +3.5 (+4 if docheader title is &quot;Chapter #&quot;)
-<li><strong>CHAPTER_TITLE_SIZE</strong> <var>&lt;+/-points&gt;</var>
+<li><strong>CHAPTER_TITLE_SIZE</strong> <nobr>&lt;+/-points&gt;</nobr>
<br>
default = +4
-<li><strong>SUBTITLE_SIZE</strong> <var>&lt;+/-points&gt;</var>
+<li><strong>SUBTITLE_SIZE</strong> <nobr>&lt;+/-points&gt;</nobr>
<br>
default = +0
-<li><strong>AUTHOR_SIZE</strong> <var>&lt;+/-points&gt;</var>
+<li><strong>AUTHOR_SIZE</strong> <nobr>&lt;+/-points&gt;</nobr>
<br>
default = +0
-<li><strong>DOCTYPE_SIZE</strong> <var>&lt;+/-points&gt;</var> (if
+<li><strong>DOCTYPE_SIZE</strong> <nobr>&lt;+/-points&gt; (if</nobr>
<a href="#DOCTYPE">DOCTYPE</a> is NAMED)
<br>
default = +3
</ul>
<p>
Simply pass the appropriate macro the size adjustment you want.
+<p>
-<a name="CHANGE_ATTRIBUTE"><h3><u>6. Change the attribution string (&quot;by&quot;)</u></h3></a>
+<a name="CHANGE_ATTRIBUTE"><h3><u>8. Change the attribution string (&quot;by&quot;)</u></h3></a>
<p>
If you're not writing in English, you can change what
<strong>mom</strong> prints where &quot;by&quot; appears in
@@ -1502,12 +2111,12 @@ in the argument to <strong>ATTRIBUTE_STRING</strong>. For
example,
<p>
<pre>
- .ATTRIBUTE_STRING "\f[HBI]\*S[-2p] by \*S[+2p]\*[PREV]"
+ .ATTRIBUTE_STRING "\f[HBI]\*[SIZE -2p] by \*[SIZE +2p]\*[PREV]"
</pre>
would set &quot;by&quot; in Helvetica bold italic, 2 points
smaller than normal.
-<br>
+<p>
<hr>
<!---COLUMNS_INTRO--->
@@ -1545,14 +2154,14 @@ and
(and probably the
<a href="docelement.html#PARA_INDENT">paragraph first-line indent</a>
as well).
-<br>
+<p>
<!---COLUMNS--->
<hr width="66%" align="left">
<a name="COLUMNS"><h3><u>COLUMNS</u></h3></a>
<br>
-Macro: <strong>COLUMNS</strong> <var>&lt;number of columns&gt; &lt;width of gutters&gt;</var>
+<nobr>Macro: <strong>COLUMNS</strong> &lt;number of columns&gt; &lt;width of gutters&gt;</nobr>
<br>
<em>*Should be the last macro before START
<br>
@@ -1580,9 +2189,19 @@ when the
is <strong>TYPEWRITE</strong>. The notion of typewriter-style
output in columns is just too ghastly for her to bear.
+<h3><u>Using tabs when COLUMNS are enabled</u></h3>
+<strong>Mom</strong>'s tabs
+(both
+<a href="typesetting.html#TYPESETTING_TABS">typesetting tabs</a>
+and
+<a href="typesetting.html#STRING_TABS">string tabs</a>)
+behave as you'd expect during document processing, even when
+<strong>COLUMNS</strong> are enabled. Tab structures set up
+during document processing carry over from page to page and column
+to column.
+
<a name="BREAKING_COLUMNS"></a>
<h3><u>Breaking columns manually</u></h3>
-<p>
<strong>Mom</strong> takes care of breaking columns when they reach
the bottom margin of a page. However, there may be times you want to
break the columns yourself. There are two macros for breaking columns
@@ -1634,7 +2253,7 @@ merges it with her defaults, sets up headers and page numbering,
and prepares <strong>mom</strong> to process your document using
the document element tags. No document processing takes place until
you invoke <strong>START</strong>.
-<br>
+<p>
<!---START--->
@@ -1655,7 +2274,7 @@ don't use <strong>START</strong>.
At a barest minimum before <strong>START</strong>, you must enter a
<a href="#PRINTSTYLE">PRINTSTYLE</a>
command.
-<br>
+<p>
<hr>
<!========================================================================>
@@ -1670,9 +2289,9 @@ parameters of a document <em>before</em>
using
<a href="typesetting.html#MACROS_TYPESETTING">typesetting macros</a>
(<strong>L_MARGIN, FAMILY, PT_SIZE, LS,</strong> etc). After
-<strong>START</strong>, you must use the following macros to make
+<strong>START</strong>, you MUST use the following macros to make
global changes to the basic type parameters of a document.
-<br>
+<p>
<a name="INDEX_DOC_PARAM">
<h3><u>Macro list</u></h3>
@@ -1687,11 +2306,12 @@ global changes to the basic type parameters of a document.
<li><a href="#DOC_LEAD_ADJUST">DOC_LEAD_ADJUST</a>
<li><a href="#DOC_QUAD">DOC_QUAD</a>
</ul>
+<br>
<hr width="66%" align="left">
<p>
<a name="DOC_LEFT_MARGIN">
- Macro: <strong>DOC_LEFT_MARGIN</strong> <var>&lt;left margin&gt;</var>
+ <nobr>Macro: <strong>DOC_LEFT_MARGIN</strong> &lt;left margin&gt;</nobr>
</a>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -1703,13 +2323,12 @@ global changes to the basic type parameters of a document.
<li>the line length remains the same (i.e. the right margin
shifts when you change the left margin)
</ul>
-
<br>
<hr width="66%" align="left">
<p>
<a name="DOC_RIGHT_MARGIN">
- Macro: <strong>DOC_RIGHT_MARGIN</strong> <var>&lt;right margin&gt;</var>
+ <nobr>Macro: <strong>DOC_RIGHT_MARGIN</strong> &lt;right margin&gt;</nobr>
</a>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -1717,7 +2336,17 @@ global changes to the basic type parameters of a document.
<ul>
<li>the argument is the same as for
<a href="typesetting.html#R_MARGIN">R_MARGIN</a>
- <li>changes all right margins to the new value
+ <li>changes all right margins, including
+ <a href="definitions.html#TERMS_DOCHEADER">docheaders</a>,
+ headers (or footers) and page numbering to the new value;
+ for changing the right margin of
+ <a href="definitions.html#TERMS_RUNNING">running text</a>
+ only, use
+ <a href="typesetting.html#R_MARGIN">R_MARGIN</a>
+ (see
+ <a href="typemacdoc.html#TOP">Using typesetting macros during
+ document processing</a>,
+ entry for <strong>R_MARGIN</strong>)
<li>all mom commands that include a right indent calculate
the indent from the new value
</ul>
@@ -1726,42 +2355,50 @@ global changes to the basic type parameters of a document.
<hr width="66%" align="left">
<p>
<a name="DOC_LINE_LENGTH">
- Macro: <strong>DOC_LINE_LENGTH</strong> <var>&lt;length&gt;</var>
+ <nobr>Macro: <strong>DOC_LINE_LENGTH</strong> &lt;length&gt;</nobr>
</a>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
<p>
<ul>
<li>the argument is the same as for
- <a href="typesetting.html#LL">LL</a>
- <li>equivalent to changing the right margin with DOC_RIGHT_MARGIN
+ <a href="typesetting.html#LINELENGTH">LL</a>
+ <li>exactly equivalent to changing the right margin with
+ DOC_RIGHT_MARGIN (see
+ <a href="#DOC_RIGHT_MARGIN">above</a>);
+ for changing the line length of
+ <a href="definitions.html#TERMS_RUNNING">running text</a>
+ only, use
+ <a href="typesetting.html#LINELENGTH">LL</a>
+ (see
+ <a href="typemacdoc.html#TOP">Using typesetting macros during
+ document processing</a>,
+ entry for <strong>LL</strong>)
</ul>
<br>
<hr width="66%" align="left">
<p>
<a name="DOC_FAMILY">
- Macro: <strong>DOC_FAMILY</strong> <var>&lt;family&gt;</var>
+ <nobr>Macro: <strong>DOC_FAMILY</strong> &lt;family&gt;</nobr>
</a>
<p>
<ul>
<li>the argument is the same as for
<a href="typesetting.html#FAMILY">FAMILY</a>
<li>globally changes the type family
- <li>if you wish the
- <a href="definitions.html#TERMS_HEADER">header</a>
- and/or page number families to remain at their old values,
- you must reset them with
- <a href="headfootpage.html#HEADER_FAMILY">HEADER_FAMILY</a>
- and
- <a href="headfootpage.html#PAGENUM_FAMILY">PAGENUM_FAMILY</a>
+ <li>any page elements (e.g.
+ <a href="definitions.html#TERMS_HEADER">headers</a>,
+ page numbers, footnotes) whose families you wish to remain
+ at their old values must be reset with the appropriate
+ <a href="docelement.html#DOCELEMENT_CONTROL">control macros</a>
</ul>
<br>
<hr width="66%" align="left">
<p>
<a name="DOC_PT_SIZE">
- Macro: <strong>DOC_PT_SIZE</strong> <var>&lt;point size&gt;</var>
+ <nobr>Macro: <strong>DOC_PT_SIZE</strong> &lt;point size&gt;</nobr>
</a>
<br>
<em>*Does not require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>; points is assumed</em>
@@ -1782,7 +2419,7 @@ global changes to the basic type parameters of a document.
<hr width="66%" align="left">
<p>
<a name="DOC_LEAD">
- Macro: <strong>DOC_LEAD</strong> <var>&lt;points&gt; [ ADJUST ]</var>
+ <nobr>Macro: <strong>DOC_LEAD</strong> &lt;points&gt; [ ADJUST ]</nobr>
</a>
<br>
<em>*Does not require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>; points is assumed</em>
@@ -1814,10 +2451,20 @@ immediately prior to a new page, like this:
.NEWPAGE
</pre>
+<strong>NOTE:</strong> Even if you don't pass
+<strong>DOC_LEAD</strong> the optional argument
+<strong>ADJUST</strong>, <strong>mom</strong> will still adjust the
+leading of endnotes pages and toc pages. See
+<a href="docelement.html#ENDNOTE_LEAD">ENDNOTE_LEAD</a>
+and
+<a href="docelement.html#TOC_LEAD">TOC_LEAD</a>
+for an explanation of how to disable this default behaviour.
+<p>
+
<hr width="66%" align="left">
<p>
<a name="DOC_QUAD">
- Macro: <strong>DOC_QUAD</strong> <var>L | R | C | J</var>
+ <nobr>Macro: <strong>DOC_QUAD</strong> L | R | C | J</nobr>
</a>
<p>
<ul>
@@ -1826,11 +2473,11 @@ immediately prior to a new page, like this:
<li>affects paragraphs, epigraphs and footnotes; does not
affect blockquotes
</ul>
+<br>
-<p>
<hr>
-<a href="docelement.html#TOP">Next</a>&nbsp;&nbsp;
-<a href="inlines.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="typemacdoc.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="color.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="#TOP">Top</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
</body>
diff --git a/contrib/groff/contrib/mom/momdoc/goodies.html b/contrib/groff/contrib/mom/momdoc/goodies.html
index 8876966a068f..6b907b49bdff 100644
--- a/contrib/groff/contrib/mom/momdoc/goodies.html
+++ b/contrib/groff/contrib/mom/momdoc/goodies.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -10,16 +11,16 @@
<a href="inlines.html#TOP">Next</a>&nbsp;&nbsp;
<a href="typesetting.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
-
+<p>
<a name="TOP"></a>
<a name="GOODIES">
- <h2><u>Goodies</u></h2>
+ <h1 align="center"><u>Goodies</u></h1>
</a>
-
+<p>
<a name="INTRO_GOODIES"></a>
The macros in this section are a collection of useful (and sometimes
-nearly indispensible) routines to simplify typesetting.
-
+nearly indispensable) routines to simplify typesetting.
+<p>
<a name="INDEX_GOODIES">
<h3><u>Goodies list</u></h3>
</a>
@@ -28,8 +29,9 @@ nearly indispensible) routines to simplify typesetting.
<li><a href="#ALIAS">ALIAS</a> (rename macros)
<li><a href="#SILENT">SILENT</a> (&quot;hide&quot; input lines from output)
<li><a href="#TRAP">TRAP</a> (suspend/re-invoke traps)
- <li><a href="#SMARTQUOTES">SMARTQUOTES</a>
+ <li><a href="#SMARTQUOTES">SMARTQUOTES</a> (convert typewriter doublequotes to proper doublequotes)
<li><a href="#CAPS">CAPS</a> (convert to upper case)
+ <li><a href="#STRING">STRING</a> (user-definable strings)
<br>
<li><strong>Underscore/underline</strong>
<ul>
@@ -56,14 +58,24 @@ nearly indispensible) routines to simplify typesetting.
<li><a href="#DROPCAP_FAMILY">DROPCAP_FAMILY</a> (change drop cap family)
<li><a href="#DROPCAP_FONT">DROPCAP_FONT</a> (change drop cap font)
<li><a href="#DROPCAP_ADJUST">DROPCAP_ADJUST</a> (alter size of drop cap)
+ <li><a href="#DROPCAP_COLOR">DROPCAP_COLOR</a> (change colour of drop cap)
<li><a href="#DROPCAP_GUTTER">DROPCAP_GUTTER</a> (change space between drop cap and running text)
</ul>
</ul>
- <li><strong>Superscript</strong>
+ <li><strong>Superscripts</strong>
<ul>
<li><a href="#SUP">\*[SUP]</a> (set superscript)
<li><a href="#CONDSUP">\*[CONDSUP]</a> (set condensed superscript)
- <li><a href="#EXTSUP">\*[EXTSUP}</a> (set extended superscript)
+ <li><a href="#EXTSUP">\*[EXTSUP]</a> (set extended superscript)
+ </ul>
+ <li><strong>Lists</strong>
+ <ul>
+ <li><a href="docelement.html#LIST_INTRO">Introduction to lists</a>
+ <li><a href="docelement.html#LIST">LIST</a>
+ <li><a href="docelement.html#ITEM">ITEM</a>
+ <li><a href="docelement.html#SHIFT_LIST">SHIFT_LIST</a>
+ <li><a href="docelement.html#RESET_LIST">RESET_LIST</a>
+ <li><a href="docelement.html#PAD_LIST_DIGITS">PAD_LIST_DIGITS</a>
</ul>
</ul>
@@ -72,7 +84,7 @@ nearly indispensible) routines to simplify typesetting.
<hr width="66%" align="left">
<a name="ALIAS"><h3><u>Rename macros</u></h3></a>
<br>
-Macro: <strong>ALIAS</strong> <var>&lt;new name&gt; &lt;old name&gt;</var>
+<nobr>Macro: <strong>ALIAS</strong> &lt;new name&gt; &lt;old name&gt;</nobr>
<p>
The <strong>ALIAS</strong> macro may well be your best friend. With it,
@@ -142,14 +154,14 @@ of your documents, please.
<strong>EXPERTS:</strong> <strong>ALIAS</strong> is an alias of
<code>.als</code>. You can use either, or mix 'n' match with
impunity.
-<br>
+<p>
<!---SILENT--->
<hr width="66%" align="left">
<a name="SILENT"><h3><u>Hide input lines from output</u></h3></a>
<br>
-Macro: <strong>SILENT</strong> <var>toggle</var>
+<nobr>Macro: <strong>SILENT</strong> toggle</nobr>
<br>
Alias: <strong>COMMENT</strong>
@@ -195,14 +207,14 @@ or
to which you've passed the <strong>J</strong> or <strong>QUAD</strong>
argument. You must insert <code>.BR</code> yourself, or risk a
portion of your text disappearing into a black hole.
-<br>
+<p>
<!---TRAP--->
<hr width="66%" align="left">
<a name="TRAP"><h3><u>Suspend/re-invoke traps</u></h3></a>
<br>
-Macro: <strong>TRAP</strong> <var>toggle</var>
+<nobr>Macro: <strong>TRAP</strong> toggle</nobr>
<p>
Traps are vertical positions on the output page at which you or
@@ -211,13 +223,8 @@ something automatically. Commonly, this is near the bottom of
the page, where automatic behind-the-scenes processing is needed
in order for one page to finish and another to start.
<p>
-Sometimes, traps get sprung when you don't want them, notably
-when using the
-<a href="#EL">EL</a>
-and
-<a href="#TN">TN</a>
-macros. If this happens, surround just the offending macros and
-input lines with
+Sometimes, traps get sprung when you don't want them. If this
+happens, surround just the offending macros and input lines with
<p>
<pre>
.TRAP OFF
@@ -229,22 +236,27 @@ input lines with
turns it off (i.e. suspends the trap), and no argument turns it
(back) on.
<p>
-Have a look at the <strong>IMPORTANT</strong> sections
-of <strong>EL</strong> and <strong>TN</strong> to see
-<strong>TRAP</strong> in action.
-<br>
<!---SMARTQUOTES--->
<hr width="66%" align="left">
-<a name="SMARTQUOTES"><h3><u>Smartquotes</u></h3></a>
+<a name="SMARTQUOTES"><h3><u>Convert typewriter doublequotes to proper doublequotes</u></h3></a>
+<br>
+<nobr>Macro: <strong>SMARTQUOTES</strong> [&lt;off&gt;] [ ,, | &gt;&gt; | &lt;&lt; ]</nobr>
+<br>
+or
<br>
-Macro: <strong>SMARTQUOTES</strong> <var>toggle</var>
+<nobr>Macro: <strong>SMARTQUOTES</strong> DA | DE | ES | FR | IT | NL | NO | PT | SV</nobr>
<p>
-<strong>SMARTQUOTES</strong> converts all instances of the
-inch-mark, (<kbd>"</kbd> -- also called a &quot;doublequote&quot;),
-into the appropriate instances of true open- and close-doublequotes.
+If you invoke <strong>SMARTQUOTES</strong> without an argument,
+<strong>mom</strong> converts all instances of the inch-mark,
+(<kbd>"</kbd> -- also called a &quot;doublequote&quot;), into
+the appropriate instances of true Anglo-American open- and
+close-doublequotes. (See
+<a href="#SQ_INTERNATIONAL">Internationalization</a>
+for how to get SMARTQUOTES to behave correctly for non-English
+quoting styles.)
<p>
Typographically, there is a difference between the inch-mark and
doublequotes -- a BIG difference. Sadly, typewriters and computer
@@ -255,20 +267,83 @@ 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?
<p>
-When preparing documents for typesetting, by all means, use the
-inch-mark. Just make sure to turn <strong>SMARTQUOTES</strong>
-on. <strong>SMARTQUOTES</strong> is a toggle, so invoking it with
-no argument turns it on, and invoking it with any argument at all
-turns it off.
+<a name="SQ_INTERNATIONAL"><h3>Internationalization</h3></a>
+<p>
+If you invoke <strong>SMARTQUOTES</strong> with one of the optional
+arguments (<kbd>,,</kbd> or <kbd>&gt;&gt;</kbd> or
+<kbd>&lt;&lt;</kbd>) you can use <kbd>&quot;</kbd> as &quot;cheap&quot;
+open- and close-quotes when inputting text in a language other than
+English, and have <strong>mom</strong> convert them, on output,
+into the chosen open- and close-quote style.
+<p>
+<kbd>,,</kbd> opens quotes with &quot;lowered doublequotes&quot; and
+closes them with &quot;raised doublequotes&quot;, as in this ascii
+approximation:
+<p>
+<pre>
+ ,,Hilfe !``
+</pre>
+
+<kbd>&gt;&gt;</kbd> opens quotes with guillemets pointing to the
+right, and closes them with guillemets pointing to the left, as in
+this ascii approximation:
+<p>
+<pre>
+ &gt;&gt;Zurück !&lt;&lt;
+</pre>
+
+<kbd>&lt;&lt;</kbd> opens quotes with guillemets pointing to the
+left, and closes them with guillemets pointing to the right, as in
+this ascii approximation:
+<p>
+<pre>
+ &lt;&lt;Mais monsieur! Je ne suis pas ce genre de fille!&gt;&gt;
+</pre>
+
+Please note: the above arguments to <strong>SMARTQUOTES</strong>
+are literal ASCII characters. <kbd>,,</kbd> is two commas,
+<kbd>&lt;&lt;</kbd> is two less-than signs and <kbd>&gt;&gt;</kbd>
+is two greater-than signs.
+<p>
+Alternatively, you can pass <strong>SMARTQUOTES</strong> the
+two-letter, ISO 639 abbreviation for the language you're writing in,
+and <strong>mom</strong> will output the correct quotes.
+<p>
+<pre>
+ .SMARTQUOTES DA = Danish &gt;&gt;text&lt;&lt;
+ .SMARTQUOTES DE = German ,,text``
+ .SMARTQUOTES ES = Spanish ``text´´
+ .SMARTQUOTES FR = French &lt;&lt; text &gt;&gt;
+ .SMARTQUOTES IT = Italian &lt;&lt; text &gt;&gt;
+ .SMARTQUOTES NL = Dutch ´´text´´
+ .SMARTQUOTES NO = Norwegian &lt;&lt;text&gt;&gt;
+ .SMARTQUOTES PT = Portuguese &lt;&lt;text&gt;&gt;
+ .SMARTQUOTES SV = Swedish &gt;&gt;text&gt;&gt;
+</pre>
+<p>
+Turn <strong>SMARTQUOTES</strong> off by passing it any argument
+<em>not</em> in the argument list (e.g. <strong>OFF</strong>,
+<strong>QUIT</strong>, <strong>X</strong>, etc.)
<p>
If you're using the
<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>
with
<a href="#PRINTSTYLE">PRINTSTYLE TYPESET</a>,
-<strong>SMARTQUOTES</strong> is on by default; with
+<strong>SMARTQUOTES</strong> is on by default (in the Anglo-American
+style); with
<a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>,
it's off by default (and should probably stay that way).
<p>
+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
+<a href="definitions.html#TERMS_INLINES">inline escapes</a>
+for special characters (see man groff_char for a complete list of
+special characters). Entering quote marks this way allows you to
+use <strong>mom</strong>'s
+<a href="inlines.html#INLINE_KERNING_MOM">inline kerning escapes</a>
+to fine-tune the look of quotes.
+<p>
<strong>NOTE:</strong> <strong>SMARTQUOTES</strong> does not work on
single quotes, which most people input with the apostrophe (found at
the right-hand end of the &quot;home row&quot; on a QWERTY keyboard).
@@ -289,14 +364,14 @@ the foot- and inch-marks, when you need them, with the
<a href="definitions.html#TERMS_INLINES">inline escapes</a>
<strong>\*[FOOT]</strong> and <strong>\*[INCH]</strong>, instead
of <kbd>'</kbd> and <kbd>"</kbd>.
-<br>
+<p>
<!---CAPS--->
<hr width="66%" align="left">
<a name="CAPS"><h3><u>Convert to upper case</u></h3></a>
<br>
-Macro: <strong>CAPS</strong> <var>toggle</var>
+<nobr>Macro: <strong>CAPS</strong> toggle</nobr>
<p>
<strong>CAPS</strong> converts all lower case letters to upper
@@ -318,12 +393,57 @@ produces, on output
ALL WORK AND NO PLAY MAKES JACK A DULL BOY.
</pre>
+<!---STRING--->
+
+<hr width="66%" align="left">
+<a name="STRING"><h3><u>User-defined strings</u></h3></a>
+<br>
+<nobr>Macro: <strong>STRING</strong> &lt;name&gt; &lt;what you want in the string&gt;</nobr>
+
+<p>
+You may find sometimes that you have to type out portions of text
+repeatedly. If you'd like not to wear out your fingers, you can
+define a &quot;string&quot; that, whenever you call it by name,
+outputs whatever you put into it.
+<p>
+For example, say you're creating a document that repeatedly uses
+the phrase &quot;the Montreal/Windsor corridor&quot;. Instead of
+typing all that out every time, you could define a string, like
+this:
+<p>
+<pre>
+ .STRING mw the Montreal/Windsor corridor
+</pre>
+
+Once a string is defined, you can call it any time with the
+<a href="definitions.html#INLINES">inline escape</a>
+<kbd>\*[&lt;stringname&gt;]</kbd>. Using the example string above
+<p>
+<pre>
+ The schedule for trains along \*[mw]:
+</pre>
+
+produces, on output
+<p>
+<pre>
+ The schedule for trains along the Montreal/Windsor corridor:
+</pre>
+
+<strong>NOTE:</strong> Be very careful not to put any spaces at the
+ends of strings you're defining, unless you want them. Everything
+after the name argument you pass to <strong>STRING</strong> goes
+into the string, including trailing spaces.
+<p>
+<strong>Experts: STRING</strong> is an alias for <strong>ds</strong>.
+You can use either, or mix 'n' match with impunity.
+<p>
+
<!---UNDERSCORE--->
<hr width="66%" align="left">
<a name="UNDERSCORE"><h3><u>Single underscore</u></h3></a>
<br>
-Macro: <strong>UNDERSCORE</strong> <var>[ &lt;distance below baseline&gt; ] &quot;&lt;string&gt;&quot;</var>
+<nobr>Macro: <strong>UNDERSCORE</strong> [ &lt;distance below baseline&gt; ] &quot;&lt;string&gt;&quot;</nobr>
<br>
<em>*Optional argument requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -383,14 +503,14 @@ no solution to the occasional problems with justified copy.
printed, looks fine. Generally, I recommend using <strong>gv</strong>
to preview files anyway. See the section on
<a href="#PREVIEWING">previewing</a>.
-<br>
+<p>
<!---UNDERSCORE2--->
<hr width="66%" align="left">
<a name="UNDERSCORE2"><h3><u>Double underscore</u></h3></a>
<br>
-Macro: <strong>UNDERSCORE2</strong> <var>[ &lt;distance below baseline&gt; [ &lt;distance between rules&gt; ] ] &quot;&lt;string&gt;&quot;</var>
+<nobr>Macro: <strong>UNDERSCORE2</strong> [ &lt;distance below baseline&gt; [ &lt;distance between rules&gt; ] ] &quot;&lt;string&gt;&quot;</nobr>
<br>
<em>*Optional arguments require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -427,20 +547,20 @@ to <strong>UNDERSCORE2</strong> as to
<strong>UNDERSCORE</strong>. See the
<a href="#NOTES_UNDERSCORE">NOTES</a>
for <strong>UNDERSCORE</strong>.
-<br>
+<p>
<!---UNDERLINE--->
<hr width="66%" align="left">
<a name="UNDERLINE"><h3><u>Underline text -- Courier font only!</u></h3></a>
<br>
-Macro: <strong>UNDERLINE</strong> <var>toggle</var>
+<nobr>Macro: <strong>UNDERLINE</strong> toggle</nobr>
<p>
If your font is Courier, or you're using the document processing macro
<a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>,
<strong>UNDERLINE</strong> allows you to underline words and
-passages that, in typeset copy, would be italicised. You invoke
+passages that, in typeset copy, would be italicized. You invoke
<strong>UNDERLINE</strong> as you do with all toggle macros --
by itself (i.e. with no argument) to initiate underlining, and
with any argument to turn underlining off.
@@ -453,7 +573,7 @@ readable copy than a solid underline.
<a href="definitions.html#TERMS_INLINES">inline</a>
with the escapes
<a href="#UL">\*[UL]...\*[ULX].</a>
-<br>
+<p>
<!---UL--->
@@ -466,7 +586,7 @@ Inline: <strong>\*[UL]...\*[ULX]</strong>
If your font is Courier, or you're using the document processing macro
<a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>,
<strong>\*[UL]...\*[ULX]</strong> underlines words and
-passages that, in typeset copy, would be italicised.
+passages that, in typeset copy, would be italicized.
<p>
<strong>\*[UL]</strong> underlines all letters, words and numbers
following it, but not punctuation or spaces. This makes for more
@@ -512,11 +632,13 @@ produces the same result as
<hr width="66%" align="left">
<a name="PAD"><h3><u>Insert space into lines</u></h3></a>
<br>
-Macro: <strong>PAD</strong> <var>&quot;&lt;string with pad markers inserted&gt;&quot;</var>
+<nobr>Macro: <strong>PAD</strong> &quot;&lt;string with pad markers inserted&gt;&quot; [NOBREAK]</nobr>
<p>
With <strong>PAD</strong>, you can insert unspecified amounts of
-whitespace into a line.
+whitespace into a line. The optional <strong>NOBREAK</strong>
+argument tells <strong>mom</strong> not to advance on the page
+after the <strong>PAD</strong> macro has been invoked.
<p>
<strong>PAD</strong> calculates the difference between the length of
text on the line and the distance remaining to its end, then inserts
@@ -560,55 +682,50 @@ particularly useful in conjunction with
<a href="#STRING_TABS">string tabs</a>.
The following uses the Date/Signature example above, but adds
rules into the whitespace through the use of string tabs and
+<strong>mom</strong>'s
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
+<a href="inlines.html#INLINE_RULE_MOM">\*[RULE]</a>.
+(Instead of <strong>\*[RULE]</strong>,
groff's line drawing function,
-<a href="#INLINE_LINEDRAWING_GROFF">\l</a>.
+<a href="inlines.html#INLINE_LINEDRAWING_GROFF">\l</a>
+could be used.)
<p>
<pre>
.LL 30P
- .PAD "Date\*[ST1]#\*[ST1X]Signature\*[ST2]###\*[ST2X]"
- .EL
+ .PAD "Date \*[ST1]#\*[ST1X] Signature \*[ST2]###\*[ST2X]" NOBREAK
.ST 1 J
.ST 2 J
.TAB 1
- \l'\n(.lu'
+ \*[RULE]
.TN
- \l'\n(.lu'
+ \*[RULE]
.TQ
</pre>
If you're not a typesetter, and if you're new to groff, the
example probably looks like gibberish. My apologies. However,
remember that typesetting is a craft, and without having studied
-the craft, it takes a while to grasp its concepts. Also,
-although <strong>mom</strong> tries very hard to provide
-consistent-looking, comprehensible alternatives to groff's
-native
-<a href="definitions.html#TERMS_INLINES">inline escapes</a>,
-<strong>mom</strong> has not yet found a replacement for
-<strong>\l</strong>.
+the craft, it takes a while to grasp its concepts.
<p>
Basically, what the example does is:
<br>
<ol>
<li>Pads the Date/Signature line (using the pad marker #),
encloses the padded space with two string tabs markers,
- and outputs the line
+ and outputs the line.
<br>
<li>Sets the two string tabs (notice the use of
<a href="#EL">EL</a>
beforehand; you don't want <strong>mom</strong>
- to advance a line at this point)
+ to advance a line at this point).
<br>
<li>Calls the first string tab and draws a rule to its full
- length (<kbd>\l'\n(.lu'</kbd>; for an easier way to draw a rule
- that fills a tab, see
- <a href="inlines.html#INLINE_RULE_MOM">Full measure
- rules</a>).
+ length.
<br>
<li>Calls the second tab with
<a href="#TN">TN</a>
(which moves to tab 2 and stays on the same baseline)
- then draws a rule to the full length of string tab 2
+ then draws a rule to the full length of string tab 2.
</ol>
<br>
Often, when setting up string tabs this way, you don't want the
@@ -632,14 +749,14 @@ this is to use the groff
<strong>\(lq</strong> and <strong>\(rq</strong> (leftquote and
rightquote respectively) whenever double-quotes are required in the
string passed to <strong>PAD</strong>.
-<br>
+<p>
<!---PAD_MARKER--->
<hr width="66%" align="left">
<a name="PAD_MARKER"><h3><u>Change/set the marker used with PAD</u></h3></a>
<br>
-Macro: <strong>PAD_MARKER</strong> <var>&lt;character to use as the pad marker&gt;</var>
+<nobr>Macro: <strong>PAD_MARKER</strong> &lt;character to use as the pad marker&gt;</nobr>
<p>
If you need to change <strong>mom</strong>'s default pad marker
@@ -658,7 +775,7 @@ Once you've changed the pad marker, the new marker remains in
effect for every instance of
<a href="#PAD">PAD</a>
until you change it again (say, back to the pound sign).
-<br>
+<p>
<!---\*[LEADER]--->
@@ -714,7 +831,7 @@ with leaders. The result looks like this:
<hr width="66%" align="left">
<a name="LEADER_CHARACTER"><h3><u>Change/set the leader character</u></h3></a>
<br>
-Macro: <strong>LEADER_CHARACTER</strong> <var>&lt;character&gt;</var>
+<nobr>Macro: <strong>LEADER_CHARACTER</strong> &lt;character&gt;</nobr>
<p>
<strong>LEADER_CHARACTER</strong> takes one argument: a single
@@ -736,7 +853,7 @@ default (a period) to the underscore character, enter
<hr width="66%" align="left">
<a name="DROPCAP"><h3><u>Drop caps</u></h3></a>
<br>
-Macro: <strong>DROPCAP</strong> <var>&lt;dropcap letter&gt; &lt;number of lines to drop&gt; [ COND &lt;percentage&gt; | EXT &lt;percentage&gt; ]</var>
+<nobr>Macro: <strong>DROPCAP</strong> &lt;dropcap letter&gt; &lt;number of lines to drop&gt; [ COND &lt;percentage&gt; | EXT &lt;percentage&gt; ]</nobr>
<p>
The first two arguments to <strong>DROPCAP</strong> are the letter you
@@ -812,6 +929,8 @@ rest she solves with macros that change the default behaviour of
<br>
<a href="#DROPCAP_FONT">DROPCAP_FONT</a>,
<br>
+<a href="#DROPCAP_COLOR">DROPCAP_COLOR</a>,
+<br>
<a href="#DROPCAP_ADJUST">DROPCAP_ADJUST</a>
<br>
and
@@ -862,10 +981,22 @@ e.g.
<a href="definitions.html#TERMS_PICASPOINTS">points</a>,
therefore do not append any
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
-to the argument. And always be sure to preprend the plus or
+to the argument. And always be sure to prepend the plus or
minus sign, depending on whether you want the drop cap larger or
smaller.
+
+<h3><a name="DROPCAP_COLOR"><u>DROPCAP_COLOR</u></a></h3>
+
+If you'd like your drop cap colourized, simply invoke
+<strong>DROPCAP_COLOR</strong> with the name of a colour you've already
+created (&quot;initialized&quot;) with
+<a href="color.html#NEWCOLOR">NEWCOLOR</a>
+or
+<a href="color.html#XCOLOR">XCOLOR</a>. Only the drop cap will be
+colourized; all other text will remain at the current colour
+default (usually black).
+
<h3><a name="DROPCAP_GUTTER"><u>DROPCAP_GUTTER</u></a></h3>
By default, <strong>mom</strong> puts three points of space
@@ -916,7 +1047,6 @@ I'm neither a mathematician nor a chemist, so I don't need them.
Of course, anyone who wishes to contribute a subscript routine to
<strong>mom</strong> will receive eternal blessings not only in this
lifetime, but in all lifetimes to come.
-
<p>
<hr>
<a href="inlines.html#TOP">Next</a>&nbsp;&nbsp;
diff --git a/contrib/groff/contrib/mom/momdoc/headfootpage.html b/contrib/groff/contrib/mom/momdoc/headfootpage.html
index b82cac22f09d..723b18110575 100644
--- a/contrib/groff/contrib/mom/momdoc/headfootpage.html
+++ b/contrib/groff/contrib/mom/momdoc/headfootpage.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -10,10 +11,11 @@
<a href="rectoverso.html#TOP">Next</a>&nbsp;&nbsp;
<a href="docelement.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
+<p>
<a name="TOP"></a>
<a name="HEADFOOTPAGE">
- <h2 align="center"><u>DOCUMENT HEADERS, FOOTERS, AND PAGINATION</u></h2>
+ <h1 align="center"><u>PAGE HEADERS, FOOTERS, AND PAGINATION</u></h1>
</a>
<ul>
@@ -24,7 +26,7 @@
<li><a href="#DESCRIPTION_GENERAL">General description of headers/footers</a>
<li><a href="#HEADER_STYLE">Default specs for headers/footers</a>
<li><a href="#VERTICAL_SPACING">Vertical placement and spacing of headers/footers</a>
- <li><a href="#HEADFOOT_MANAGEMENT">Managing headers/footers</a>
+ <li><a href="#HEADFOOT_MANAGEMENT">Managing headers/footers</a> -- see also <a href="#HEADFOOT_TOC">Control macros for headers/footers</a>
<ul>
<li><a href="#HEADERS">HEADERS</a> -- on or off
<li><a href="#FOOTERS">FOOTERS</a> -- on or off
@@ -35,9 +37,13 @@
<li><a href="#HDRFTR_RECTOVERSO">HEADER_RECTO, HEADER_VERSO</a>
</ul>
</ul>
+ <a name="HEADFOOT_TOC"></a>
<li><a href="#HEADFOOT_CONTROL">Control macros for headers/footers</a>
<ul>
<li><a href="#HDRFTR_STRINGS">Header/footer strings</a>
+ <ul>
+ <li><a href="#RESERVED_STRINGS">Using mom's &quot;reserved&quot; strings in header/footer definitions</a>
+ </ul>
<li><a href="#HDRFTR_STYLE">Header/footer style</a>
<ul>
<li><a href="#HDRFTR_STYLE_GLOBAL">Global style control</a>
@@ -52,6 +58,7 @@
<ul>
<li><a href="#HDRFTR_RULE">HEADER_RULE</a> -- on or off
<li><a href="#HDRFTR_RULE_GAP">HEADER_RULE_GAP</a> -- distance of rule from header/footer
+ <li><a href="#HDRFTR_RULE_COLOR">HEADER_RULE_COLOR</a> -- colour of the header/footer rule
</ul>
</ul>
<li><a href="#PAGINATION">Pagination</a>
@@ -64,7 +71,6 @@
<h2><u>Introduction</u></h2>
</a>
-<p>
<a href="definitions.html#TERMS_HEADER">Headers</a>
and
<a href="definitions.html#TERMS_FOOTER">footers</a>,
@@ -110,16 +116,17 @@ correspondingly dense at this point.
above or below running text is technically a kind of header/footer,
<strong>mom</strong> and this documentation treat it as a
separate page element.
+<p>
<a name="DESCRIPTION_GENERAL"><h3><u>General description of headers/footers</u></h3></a>
<p>
-Headers comprise three distinct parts: a left part, a center part,
+Headers comprise three distinct parts: a left part, a centre part,
and a right part. Each part contains text (a &quot;string&quot;)
that identifies some aspect of the document as a whole.
<p>
The left part (&quot;header left&quot;) lines up with the document's
-left margin. The center part (&quot;header center&quot;) is
-centered on the document's line length. The right part (&quot;header
+left margin. The centre part (&quot;header centre&quot;) is
+centred on the document's line length. The right part (&quot;header
right&quot;) lines up with the document's right margin. Not all parts
need contain a string, and if you don't want headers at all, you can
turn them off completely.
@@ -134,7 +141,7 @@ to the document type selected with
<a href="docprocessing.html#DOCTYPE">DOCTYPE</a>.
You can, however, supply whatever strings you like -- including page
numbers -- to go in any part of headers. What's more, you can set the
-family, font, size and capitalisation style (caps or caps/lower-case)
+family, font, size and capitalization style (caps or caps/lower-case)
for each header part individually.
<p>
By default, <strong>mom</strong> prints a horizontal rule beneath
@@ -143,11 +150,12 @@ footers, the rule is <em>above</em> running text. You can increase
or decrease the space between the header and the rule if you like (with
<a href="#HDRFTR_RULE_GAP">HEADER_RULE_GAP</a>),
or remove it completely.
+<p>
<a name="HEADER_STYLE"><h3><u>Default specs for headers/footers</u></h3></a>
<p>
<strong>Mom</strong> makes small type adjustments to each part of
-the header (left, center, right) to achieve an aesthetically
+the header (left, centre, right) to achieve an aesthetically
pleasing result. The defaults are listed below. (The strings
<strong>mom</strong> puts by default in each part are explained in
<a href="docprocessing.html#DOCTYPE">DOCTYPE</a>.)
@@ -161,6 +169,7 @@ TYPE SPEC HEADER LEFT HEADER CENTER HEADER RIGHT
--------- ----------- ------------- ------------
Family document default document default document default
Font roman italic roman
+Colour (black) (black) (black)
All caps no no yes
Size* -.5 (points) -.5 (points) -2 (points)
(-2 if all caps) (-2 if all caps) (-.5 if not all caps)
@@ -175,7 +184,9 @@ up, <strong>mom</strong> has a special macro,
that removes all type adjustments to headers. The straightforward
type specs for paragraphs are used instead, providing a simple
reference point for any alterations you want to make to the family,
-font, size and capitalisation style of any header part.
+font, size and capitalization style of any header part.
+<p>
+
<a name="VERTICAL_SPACING"><h3><u>Vertical placement and spacing of headers/footers</u></h3></a>
<p>
As explained in the section on
@@ -184,7 +195,7 @@ the top and bottom margins of a <strong>mom</strong> document
are the vertical start and end positions of
<a href="definitions.html#TERMS_RUNNING">running text</a>,
not the vertical positions of headers or footers, which, by definition,
-appear in the margin <em>above</em> (or below) running text.
+appear in the margins <em>above</em> (or below) running text.
<p>
The vertical placement of headers
is controlled by the macro
@@ -208,7 +219,10 @@ running text at whatever top margin you gave.
<strong>FOOTER_GAP</strong> and
<a href="typesetting.html#B_MARGIN">B_MARGIN</a>
work similarly, except they determine where running text
-<em>ends</em> on the page.
+<em>ends</em> on the page. (See
+<a href="#FOOTER_MARGIN">FOOTER MARGIN AND BOTTOM MARGIN -- VERY IMPORTANT!</a>
+for a warning about possible conflicts between the footer margin
+and the bottom margin.)
<p>
Confused? <strong>Mom</strong> apologizes. It's really quite
simple. By default, <strong>mom</strong> sets headers 4-1/2
@@ -238,7 +252,7 @@ or the bottom of the page, is managed exactly as if the
page numbers were headers (or footers), and are controlled
by the same macros. See
<a href="#PAGINATION">Pagination control</a>.
-<br>
+<p>
<hr>
<!========================================================================>
@@ -272,14 +286,14 @@ automatically turned off. Equally, if footers are on, headers
you'd prefer footers in a document, you need only invoke
<a href="#FOOTERS">FOOTERS</a>;
there's no need to turn headers off first.
-<br>
+<p>
<!---HEADERS--->
<hr width="66%" align="left">
<p>
<a name="HEADERS"></a>
-Macro: <strong>HEADERS</strong> <var>toggle</var>
+<nobr>Macro: <strong>HEADERS</strong> toggle</nobr>
<p>
<a href="definitions.html#TERMS_HEADER">Page headers</a>
@@ -311,14 +325,14 @@ Explicitly invoking footers moves page numbering to the
top of the page, where its placement and spacing are the same as
for headers. (I.e. the top margin of running text remains 7.5
picas.)
-<br>
+<p>
<!---FOOTERS--->
<hr width="66%" align="left">
<p>
<a name="FOOTERS"></a>
-Macro: <strong>FOOTERS</strong> <var>toggle</var>
+<nobr>Macro: <strong>FOOTERS</strong> toggle</nobr>
<p>
<a href="definitions.html#TERMS_FOOTER">Page footers</a>
@@ -342,14 +356,14 @@ page of a document, nor on first pages after
<a href="rectoverso.html#COLLATE">COLLATE</a>.
If you don't want this behaviour, you can change it with
<a href="#PAGENUM_ON_FIRST_PAGE">PAGENUM_ON_FIRST_PAGE</a>.
-<br>
+<p>
<!---FOOTER_ON_FIRST_PAGE--->
<hr width="66%" align="left">
<p>
<a name="FOOTER_ON_FIRST_PAGE"></a>
-Macro: <strong>FOOTER_ON_FIRST_PAGE</strong> <var>toggle</var>
+<nobr>Macro: <strong>FOOTER_ON_FIRST_PAGE</strong> toggle</nobr>
<p>
If you invoke
@@ -357,9 +371,9 @@ If you invoke
<strong>mom</strong>, by default, does not print a footer on the
first page of the document. (The
<a href="definitions.html">docheader</a>
-on page makes it redundant.) However, should you wish a footer on
+on page 1 makes it redundant.) However, should you wish a footer on
page 1, invoke <strong>FOOTER_ON_FIRST_PAGE</strong> without any argument.
-<br>
+<p>
<hr>
<!---USERDEF_HDRFTR--->
@@ -377,8 +391,8 @@ information contained in the headers/footers split over two pages,
as is often the case with recto/verso documents.
<p>
Say, for example, you want recto page headers to contain a document's
-author, centered, and verso page headers to contain the document's
-title, also centered, like this:
+author, centred, and verso page headers to contain the document's
+title, also centred, like this:
<p>
<pre>
+------------------------+ +------------------------+
@@ -403,17 +417,17 @@ With <strong>mom</strong>'s standard 3-part headers, this isn't
possible, even when
<a href="rectoverso.html#RECTO_VERSO">RECTO_VERSO</a>
is enabled. <strong>RECTO_VERSO</strong> switches the left and
-right parts of headers on alternate pages, but the center
+right parts of headers on alternate pages, but the centre
part remains unchanged.
<p>
-Anytime you need distinctly different headers on alternate
+Any time you need distinctly different headers on alternate
pages, <strong>mom</strong> has macros that let you manually
design and determine what goes into headers on recto pages, and
what goes into headers on verso pages. The macros are
<a href="#HDRFTR_RECTO">HEADER_RECTO</a>
and
<a href="#HDRFTR_VERSO">HEADER_VERSO</a>.
-Both allow you to state whether the header is flush left, centered,
+Both allow you to state whether the header is flush left, centred,
or flush right, and both take a single
<a href="definitions.html#TERMS_STRINGARGUMENT">string argument</a>
with which, by combining text and
@@ -421,18 +435,19 @@ with which, by combining text and
you can make the headers come out just about any way you want.
Use of the <strong>\*[PAGE#]</strong> escape is permitted in the
string argument (see
-<a href="#PAGE_NUMBER_INCL">Including the page number in header-left, -center or -right</a>),
-and <strong>mom</strong> provides a special mechanism whereby
-it's possible to &quot;pad&quot; it as well.
-<br>
+<a href="#PAGE_NUMBER_INCL">Including the page number in header-left, -centre or -right</a>),
+and as an added bonus, <strong>mom</strong> provides a special
+mechanism whereby it's possible to &quot;pad&quot; the string as well.
+<p>
<!---HDRFTR_RECTOVERSO--->
<hr width="66%" align="left">
<p>
<a name="HDRFTR_RECTOVERSO"></a>
-Macro: <strong>HEADER_RECTO</strong> <var>LEFT | CENTER | RIGHT &quot;&lt;header recto string&gt;&quot;</var>
-Macro: <strong>HEADER_VERSO</strong> <var>LEFT | CENTER | RIGHT &quot;&lt;header verso string&gt;&quot;</var>
+<nobr>Macro: <strong>HEADER_RECTO</strong> LEFT | CENTER | RIGHT &quot;&lt;header recto string&gt;&quot;</nobr>
+<br>
+<nobr>Macro: <strong>HEADER_VERSO</strong> LEFT | CENTER | RIGHT &quot;&lt;header verso string&gt;&quot;</nobr>
<br>
<p>
@@ -451,7 +466,10 @@ place of <strong>LEFT, CENTER</strong> and
surrounded by double-quotes, containing what you want in the
header. <strong>HEADER_RECTO</strong> disables <strong>mom</strong>'s
normal 3-part headers, therefore anything you want in the
-headers must be entered by hand in the string.
+headers must be entered by hand in the string, including colours
+(via the
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
+<a href="color.html#COLOR_INLINE">\*[&lt;colorname&gt;]</a>).
<p>
By default, <strong>HEADER_RECTO</strong> is set at the same
size, and in the same family and font, as paragraph text. The
@@ -471,9 +489,9 @@ inline escapes.
<p>
To include the current page number in the string, use the
<strong>\*[PAGE#]</strong> inline.
+<br>
-<h3><u>Padding the HEADER_RECTO/HEADER_VERSO string</u></h3>
-<p>
+<h3><u>*Padding the HEADER_RECTO/HEADER_VERSO string</u></h3>
You can &quot;pad&quot; the header-recto string, a convenience you'll
appreciate in circumstances such as the following.
<p>
@@ -504,7 +522,9 @@ point in the string where you want an equalized amount of whitespace
inserted. (If you're unsure what padding is, see
<a href="goodies.html#PAD">Insert space into lines</a>.)
Note that if you're padding the string, it doesn't matter what
-quad direction you give <strong>HEADER_RECTO</strong>.
+quad direction you give <strong>HEADER_RECTO</strong> since
+padding, by its nature, justifies text to the left and right
+margins.
<p>
The situation depicted above is accomplished like this:
<p>
@@ -517,6 +537,16 @@ Note that <strong>mom</strong> does not interpret the <kbd>#</kbd>
in <strong>\*[PAGE#]</strong> as a padding marker (i.e. as a place
to insert whitespace).
<p>
+Also, notice that the argument <strong>LEFT</strong> is used in both
+cases. When padding a header, it doesn't matter whether you use
+LEFT, CENTER or RIGHT as the argument.
+<p>
+Furthermore, should you need a user-defined header of
+the sort provided by <strong>HEADER_RECTO</strong> and
+<strong>HEADER_VERSO</strong> but aren't actually printing
+recto/verso, you can use <strong>HEADER_RECTO</strong> to design the
+header that appears at the top of every page.
+<p>
<strong>IMPORTANT:</strong> The
<a href="goodies.html#PAD_MARKER">PAD_MARKER</a>
macro, which changes the default pad marker (<kbd>#</kbd>) used by
@@ -524,20 +554,20 @@ macro, which changes the default pad marker (<kbd>#</kbd>) used by
has no effect on the pad marker used in the
<strong>HEADER_RECTO</strong> string. If you absolutely must
have a literal pound sign in your <strong>HEADER_RECTO</strong>
-string, use the escape sequence <kbd>\N'35'</kbd> where you want
-the pound sign to go.
-<br>
+string, use the escape sequence for the pound sign
+(<kbd>\[sh]</kbd>) where you want the pound sign to go.
+<p>
<hr>
<a name="HEADFOOT_CONTROL">
<h2><u>Control macros for headers/footers</u></h2>
</a>
-<p>
Virtually every part of headers (see the paragraph on how
<a href="#HEADERFOOTER">&quot;headers&quot; means &quot;footers&quot;</a>
in the
<a href="#HEADFOOTPAGE_INTRO">introduction to headers/footers</a>)
can be designed to your own specifications.
+<p>
<a name="INDEX_REFERENCE">
<h3><u>Header/footer control macros</u></h3>
@@ -548,23 +578,28 @@ can be designed to your own specifications.
<ul>
<li><a href="#HDRFTR_LEFT">HEADER_LEFT</a>
<li><a href="#HDRFTR_CENTER">HEADER_CENTER</a>
+ <ul>
+ <li><a href="#HDRFTR_CENTER_PAD">HEADER_CENTER_PAD</a> -- stick some space left of right of the centre string
+ </ul>
<li><a href="#HDRFTR_RIGHT">HEADER_RIGHT</a>
- <li><a href="#PAGE_NUMBER_SYMBOL">Replacing header left, center or right with the page number</a>
- <li><a href="#PAGE_NUMBER_INCL">Including the page number in header left, center or right</a>
+ <li><a href="#PAGE_NUMBER_SYMBOL">Replacing header left, centre or right with the page number</a>
+ <li><a href="#PAGE_NUMBER_INCL">Including the page number in header left, centre or right</a>
</ul>
<li><a href="#HDRFTR_STYLE"><strong>STYLE</strong></a>
<ul>
<li><a href="#HDRFTR_STYLE_GLOBAL"><strong>Global changes</strong></a>
<li><a href="#HDRFTR_GLOBAL_FAMILY">HEADER_FAMILY</a>&nbsp;-- family for entire header
<li><a href="#HDRFTR_GLOBAL_SIZE">HEADER_SIZE</a>&nbsp;&nbsp;&nbsp;-- size for entire header
- <li><a href="HDRFTR_PLAIN">HDRFTR_PLAIN</a>&nbsp;&nbsp;-- disable default adjustments to header parts
+ <li><a href="#HDRFTR_PLAIN">HEADER_PLAIN</a>&nbsp;&nbsp;-- disable default adjustments to header parts
+ <li><a href="#HDRFTR_COLOR">HEADER_COLOR</a>&nbsp;&nbsp;-- colourize the header
</ul>
<ul>
<li><a href="#HDRFTR_STYLE_PART"><strong>Part-by-part changes</strong></a>
- <li><a href="#_FAMILY">_FAMILY</a>&nbsp;-- left, center or right family
- <li><a href="#_FONT">_FONT</a>&nbsp;&nbsp;&nbsp;-- left, center or right font
- <li><a href="#_SIZE">_SIZE</a>&nbsp;&nbsp;&nbsp;-- left, center or right size
- <li><a href="#_CAPS">_CAPS</a>&nbsp;&nbsp;&nbsp;-- left, center or right all caps
+ <li><a href="#_FAMILY">_FAMILY</a>&nbsp;-- left, centre or right family
+ <li><a href="#_FONT">_FONT</a>&nbsp;&nbsp;&nbsp;-- left, centre or right font
+ <li><a href="#_SIZE">_SIZE</a>&nbsp;&nbsp;&nbsp;-- left, centre or right size
+ <li><a href="#_CAPS">_CAPS</a>&nbsp;&nbsp;&nbsp;-- left, centre or right all caps
+ <li><a href="#_COLOR">_COLOR</a>&nbsp;&nbsp;-- left, centre or right colour
</ul>
<li><a href="#HDRFTR_VERTICAL"><strong>VERTICAL PLACEMENT AND SPACING</strong></a>
<ul>
@@ -575,6 +610,7 @@ can be designed to your own specifications.
<ul>
<li><a href="#HDRFTR_RULE">HEADER_RULE</a>
<li><a href="#HDRFTR_RULE_GAP">HEADER_RULE_GAP</a>
+ <li><a href="#HDRFTR_RULE_COLOR">HEADER_RULE_COLOR</a>
</ul>
</ul>
@@ -584,20 +620,20 @@ can be designed to your own specifications.
<a name="HDRFTR_STRINGS"><h3><u>Header/footer strings</u></h3></a>
<p>
<a name="HDRFTR_LEFT">
- Macro: <strong>HEADER_LEFT</strong> <var>&quot;&lt;text of header left&gt;&quot; | #</var>
+ <nobr>Macro: <strong>HEADER_LEFT</strong> &quot;&lt;text of header left&gt;&quot; | #</nobr>
</a>
<br>
<a name="HDRFTR_CENTER">
- Macro: <strong>HEADER_CENTER</strong> <var>&quot;&lt;text of header center&gt;&quot; | #</var>
+ <nobr>Macro: <strong>HEADER_CENTER</strong> &quot;&lt;text of header centre&gt;&quot; | #</nobr>
</a>
<br>
<a name="HDRFTR_RIGHT">
- Macro: <strong>HEADER_RIGHT</strong> <var>&quot;&lt;text of header right&gt;&quot; | #</var>
+ <nobr>Macro: <strong>HEADER_RIGHT</strong> &quot;&lt;text of header right&gt;&quot; | #</nobr>
</a>
<p>
-To change the text (the &quot;string&quot;) of the left, center,
-or right part of headers, invoke the appopriate macro above with
+To change the text (the &quot;string&quot;) of the left, centre,
+or right part of headers, invoke the appropriate macro above with
the string you want. For example, <strong>mom</strong>, by default,
prints the document's author in the header-left position. If your
document has, say, two authors, and you want both their names to
@@ -614,11 +650,155 @@ they must be enclosed in double-quotes.
<p>
<strong>NOTE:</strong> Replace <strong>HEADER_</strong>, above,
with <strong>FOOTER_</strong> to change the strings in footers.
+
+<a name="HDRFTR_CENTER_PAD"><h3><u>*Padding the header/footer centre string</u></h3></a>
+<p>
+<nobr>Macro: <strong>HEADER_CENTER_PAD</strong> LEFT | RIGHT &lt;amount of space by which to pad centre string left or right&gt;</nobr>
<br>
+<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
+<p>
+By default, <strong>mom</strong> centres the header centre string
+literally on the line length in effect for page headers. In some
+cases, notably when the header left or header right strings are
+particularly long, the effect isn't pretty. The offendingly long
+header left or right crowds, or even overprints, the header centre.
+That's where <strong>HEADER_CENTER_PAD</strong> comes in. With a
+bit of experimentation (yes, you have to preview the document), you
+can use <strong>HEADER_CENTER_PAD</strong> to move the header
+centre string left or right until it looks acceptably centred
+between the two other strings.
+<p>
+For example, say your document is an outline for a novel called "By
+the Shores of Lake Attica." You've told <strong>mom</strong>
+you want
+<p>
+&nbsp;&nbsp;&nbsp;&nbsp;<a href="docprocessing.html#DOCTYPE">DOCTYPE</a>
+<halign="center">
+<strong>NAMED</strong> "Outline"
+<p>
+but when you preview your work, you see that "Outline", in the
+centre of the page header, is uncomfortably close to the title,
+which is to the right of it. By invoking
+<p>
+<pre>
+ .HEADER_CENTER_PAD RIGHT 3P
+</pre>
+
+you can scoot the word "Outline" over three
+<a href="definitions.html#TERMS_PICASPOINTS">picas</a>
+to the left (the padding's added to the right of the string)
+so that your head looks nicely spaced out. Invoking
+<strong>HEADER_CENTER_PAD</strong> with the <strong>LEFT</strong>
+argument obviously puts the padding on the left side of the string.
+<p>
+Most reassuring of all is that if you use
+<strong>HEADER_CENTER_PAD</strong> conjunction with
+<a href="rectoverso.html#RECTO_VERSO">RECTO_VERSO</a>,
+<strong>mom</strong> will pad the centre string appropriately left
+OR right, depending on which page you're on, without you having to
+tell her to do so.
+<p>
+
+<hr width="66%" align="left">
+<p>
+<a name="RESERVED_STRINGS"><h3><u>Using mom's &quot;reserved&quot; strings in header/footer definitions</u></h3></a>
+<p>
+As pointed out in the author's note in the introduction to
+headers/footers, headers and footers are something you don't
+normally have to worry much about. <strong>Mom</strong> usually
+knows what to do.
+<p>
+However, situations do arise where you need to manipulate what goes
+in the header/footer strings, setting and resetting them as you go
+along. A case where you might want to do this would be if you want
+to output endnotes at the end of each document in a series of
+<a href="rectoverso.html#COLLATE">collated</a>
+documents, and you want the word "Endnotes" to go in the header
+centre position of the endnotes, but want, say, the
+<a href="docprocessing.html#TITLE">TITLE</a>
+to go back into the centre position for the next output document.
+<p>
+In scenarios like the above, <strong>mom</strong> has a number of
+&quot;reserved&quot; strings that you can plug into the
+<strong>HEADER_LEFT, _CENTER</strong> and <strong>_RIGHT</strong>
+macros. They are:
+<p>
+<pre>
+ \*[$TITLE] -- the argument passed to .TITLE
+ \*[$DOCTITLE] -- the argument passed to .DOCTITLE
+ \*[$AUTHOR_1] -- the first argument passed to .AUTHOR
+ \*[$CHAPTER_STRING] -- the argument passed to .CHAPTER_STRING,
+ if invoked, otherwise, "Chapter"
+ \*[$CHAPTER] -- the argument (typically a number) passed
+ to .CHAPTER
+ \*[$CHAPTER_TITLE] -- the argument passed to .CHAPTER_TITLE
+</pre>
+
+Returning to the scenario above, first, you'd define a centre
+string for the endnotes page:
+<p>
+<pre>
+ .HEADER_CENTER "Endnotes"
+</pre>
+
+Then, you'd output the endnotes:
+<p>
+<pre>
+ .ENDNOTES
+</pre>
+
+Then, you'd prepare <strong>mom</strong> for the next document:
+<p>
+<pre>
+ .COLLATE
+ .TITLE "New Doc Title"
+ .AUTHOR "Josephine Blough"
+</pre>
+
+Then, you'd redefine the header centre string using the reserved
+string \*[$TITLE], like this:
+<p>
+<pre>
+ .HEADER_CENTER "\*[$TITLE]"
+</pre>
+
+And last, you'd do:
+<p>
+<pre>
+ .START
+</pre>
+
+Voilà! Any argument you pass to <strong>TITLE</strong> from here
+on in (say, for subsequent documents) is back in the header centre
+position. Here's the whole routine again:
+<p>
+<pre>
+ .HEADER_CENTER "Endnotes"
+ .ENDNOTES
+ .COLLATE
+ .TITLE "New Doc Title"
+ .AUTHOR "Josephine Blough"
+ .HEADER_CENTER "\*[$TITLE]"
+ .START
+</pre>
+
+If need be, you can concatenate the strings, as in the following
+example.
+<p>
+<pre>
+ .HEADER_CENTER "\*[$CHAPTER_STRING] \*[$CHAPTER]"
+</pre>
+
+which, assuming a <strong>.CHAPTER_STRING</strong> of
+&quot;Chapter&quot; and a <strong>.CHAPTER</strong> of
+&quot;2&quot;, would put &quot;Chapter 2&quot; in the header centre
+position.
+<p>
<a name="PAGE_NUMBER_SYMBOL">
- <h3><u>Replacing header-left, -center or -right with the page number</u></h3>
+ <h3><u>*Replacing header-left, -CENTER or -right with the page number</u></h3>
</a>
+<p>
If you would like to have the current page number to appear
header-left, -center, or -right <em>instead</em> of a text
string, invoke the appropriate macro, above, with the single
@@ -630,12 +810,14 @@ double-quotes. For example,
.HEADER_CENTER #
</pre>
-will print the current page number in the center part of
+will print the current page number in the CENTER part of
headers.
+<p>
<a name="PAGE_NUMBER_INCL">
- <h3><u>Including the page number in header-left, -center or -right</u></h3>
+ <h3><u>*Including the page number in header-left, -CENTER or -right</u></h3>
</a>
+<p>
If you would like to <em>include</em> the current page number in
the string you pass to <strong>HEADER_LEFT, _CENTER,</strong> or
<strong>_RIGHT</strong>, use the special
@@ -653,7 +835,7 @@ invoke <strong>HEADER_RIGHT</strong> as follows:
Header-right of page two will read &quot;page 2 of 10&quot;,
header-right of page three will read &quot;page 3 of 10&quot;,
and so on.
-<br>
+<p>
<hr>
<!---HDRFTR_STYLE--->
@@ -674,12 +856,13 @@ Please note that <strong>HEADER_FAMILY</strong> and
<li><a href="#HDRFTR_GLOBAL_FAMILY">HEADER_FAMILY</a>
<li><a href="#HDRFTR_GLOBAL_SIZE">HEADER_SIZE</a>
<li><a href="#HDRFTR_PLAIN">HEADER_PLAIN</a>
+ <li><a href="#HDRFTR_COLOR">HEADER_COLOR</a>
</ul>
<hr width="33%" align="left">
<p>
<a name="HDRFTR_GLOBAL_FAMILY">
- Macro: <strong>HEADER_FAMILY</strong> <var>&lt;family&gt;</var>
+ <nobr>Macro: <strong>HEADER_FAMILY</strong> &lt;family&gt;</nobr>
</a>
<p>
@@ -693,12 +876,12 @@ typesetting macro
<p>
<strong>NOTE:</strong> Replace <strong>HEADER_</strong>, above,
with <strong>FOOTER_</strong> to change the footer family.
-<br>
+<p>
<hr width="33%" align="left">
<p>
<a name="HDRFTR_GLOBAL_SIZE">
- Macro: <strong>HEADER_SIZE</strong> <var>&lt;+|-number of points&gt;</var>
+ <nobr>Macro: <strong>HEADER_SIZE</strong> &lt;+|-number of points&gt;</nobr>
<br>
<em>*Argument is relative to the point size of type in paragraphs</em>
</a>
@@ -740,7 +923,7 @@ You'll most likely require this when the
<a href="docprocessing.html#COPYSTYLE">COPYSTYLE</a>
is <strong>DRAFT</strong>, since portions of the header may overprint
if, say, the title of your document is very long.
-<br>
+<p>
<hr width="33%" align="left">
<p>
@@ -762,7 +945,33 @@ and point size as she uses in paragraphs.
<strong>NOTE:</strong> Replace <strong>HEADER_</strong>, above,
with <strong>FOOTER_</strong> to disable <strong>mom</strong>'s
default behaviour for the various elements of footer style.
-<br>
+<p>
+
+<hr width="33%" align="left">
+<p>
+<a name="HDRFTR_COLOR">
+ <nobr>Macro: <strong>HEADER_COLOR</strong> &lt;colorname&gt;</nobr>
+</a>
+
+<p>
+If you want your headers in a colour different from the document
+default (usually black), invoke <strong>HEADER_COLOR</strong> with
+the name of a colour pre-defined (or &quot;initialized&quot;) with
+<a href="color.html#NEWCOLOR">NEWCOLOR</a>
+or
+<a href="color.html#XCOLOR">XCOLOR</a>.
+<p>
+<strong>HEADER_COLOR</strong> will set all the parts of the header
+AND the header rule in the colour you give it as an argument. If
+you wish finer control over colour in headers, you can use
+<a href="#_COLOR">HEADER_&lt;POSITION&gt;_COLOR</a>
+to colourize each part of the header separately, as well as
+<a href="#HDRFTR_RULE_COLOR">HEADER_RULE_COLOR</a>
+to change the colour of the header rule.
+<p>
+<strong>NOTE:</strong> Replace <strong>HEADER_</strong>, above,
+with <strong>FOOTER_</strong> to colourize footers.
+<p>
<hr width="66%" align="left">
<p>
@@ -777,12 +986,13 @@ or <strong>RIGHT</strong> as appropriate.
<li><a href="#_FONT">HEADER_&lt;POSITION&gt;_FONT</a>
<li><a href="#_SIZE">HEADER_&lt;POSITION&gt;_SIZE</a>
<li><a href="#_CAPS">HEADER_&lt;POSITION&gt;_CAPS</a>
+ <li><a href="#_COLOR">HEADER_&lt;POSITION&gt;_COLOR</a>
</ul>
<hr width="33%" align="left">
<p>
<a name="_FAMILY">
- Macro: <strong>HEADER_&lt;POSITION&gt;_FAMILY</strong> <var>&lt;family&gt;</var>
+ <nobr>Macro: <strong>HEADER_&lt;POSITION&gt;_FAMILY</strong> &lt;family&gt;</nobr>
</a>
<p>
Use <strong>HEADER_&lt;POSITION&gt;_FAMILY</strong> to change the
@@ -794,12 +1004,12 @@ for an explanation of how control macros ending in
<p>
<strong>NOTE:</strong> Replace <strong>HEADER_</strong>, above,
with <strong>FOOTER_</strong> to change a footer part's family.
-<br>
+<p>
<hr width="33%" align="left">
<p>
<a name="_FONT">
- Macro: <strong>HEADER_&lt;POSITION&gt;_FONT</strong> <var>&lt;font&gt;</var>
+ <nobr>Macro: <strong>HEADER_&lt;POSITION&gt;_FONT</strong> &lt;font&gt;</nobr>
</a>
<p>
Use <strong>HEADER_&lt;POSITION&gt;_FONT</strong> to change the
@@ -811,12 +1021,12 @@ for an explanation of how control macros ending in
<p>
<strong>NOTE:</strong> Replace <strong>HEADER_</strong>, above,
with <strong>FOOTER_</strong> to change a footer part's font.
-<br>
+<p>
<hr width="33%" align="left">
<p>
<a name="_SIZE">
- Macro: <strong>HEADER_&lt;POSITION&gt;_SIZE</strong> <var>&lt;+|-number of points&gt;</var>
+ <nobr>Macro: <strong>HEADER_&lt;POSITION&gt;_SIZE</strong> &lt;+|-number of points&gt;</nobr>
</a>
<p>
Use <strong>HEADER_&lt;POSITION&gt;_SIZE</strong> to change the size of any
@@ -828,12 +1038,12 @@ for an explanation of how control macros ending in
<p>
<strong>NOTE:</strong> Replace <strong>HEADER_</strong>, above,
with <strong>FOOTER_</strong> to change a footer part's size.
-<br>
+<p>
<hr width="33%" align="left">
<p>
<a name="_CAPS">
- Macro: <strong>HEADER_&lt;POSITION&gt;_CAPS</strong> <var>toggle</var>
+ <nobr>Macro: <strong>HEADER_&lt;POSITION&gt;_CAPS</strong> toggle</nobr>
</a>
<p>
<strong>HEADER_&lt;POSITION&gt;_CAPS</strong> is a
@@ -853,7 +1063,50 @@ QUIT, END, X...</strong>).
<strong>NOTE:</strong> Replace <strong>HEADER_</strong>, above,
with <strong>FOOTER_</strong> to change a footer part's
capitalization style.
-<br>
+
+<p>
+<hr width="33%" align="left">
+<p>
+<a name="_COLOR">
+ <nobr>Macro: <strong>HEADER_&lt;POSITION&gt;_COLOR</strong> &lt;colorname&gt;</nobr>
+</a>
+<p>
+<strong>HEADER_&lt;POSITION&gt;_COLOR</strong> allows you to set a
+colour for each of the three possible parts of a page header
+separately. For example, say you want the right part of the header
+(by default, the document title) in red, this is how you'd get it:
+<p>
+<pre>
+ .HEADER_RIGHT_COLOR red
+</pre>
+
+The other parts of the header will be in the default header colour
+(usually black, but that can be changed with
+<a href="#HDRFTR_COLOR">HEADER_COLOR</a>).
+<p>
+Remember that you have to define (or &quot;initialize&quot;) a
+colour with
+<a href="color.html#NEWCOLOR">NEWCOLOR</a>
+or
+<a href="color.html#XCOLOR">XCOLOR</a>
+before you can use the colour.
+<p>
+If you create a
+<a href="#USERDEF_HDRFTR">user-defined header</a>
+with
+<a href="#HDRFTR_RECTO">HEADER_RECTO</a>
+or
+<a href="#HDRFTR_VERSO">HEADER_VERSO</a>,
+and you want various elements within the header to be colourized,
+embed the colours in the string passed to <strong>HEADER_RECTO</strong>
+or <strong>HEADER_VERSO</strong> with the
+<a href="color.html#COLOR_INLINE">\*[&lt;colorname&gt;]</a>
+<a href="definitions.html#TERMS_INLINES">inline escape</a>.
+<p>
+<strong>NOTE:</strong> Replace <strong>HEADER_</strong>, above,
+with <strong>FOOTER_</strong> to set the colours for the various
+elements of footers.
+<p>
<hr>
<!---HDRFTR_VERTICAL--->
@@ -867,14 +1120,14 @@ See
<a href="#VERTICAL_SPACING">Vertical placement and spacing of headers/footers</a>
for an explanation of how <strong>mom</strong> deals with
headers, footers, and top/bottom page margins.
-<br>
+<p>
<!---HDRFTR_MARGIN--->
<hr width="66%" align="left">
<p>
<a name="HDRFTR_MARGIN"></a>
-Macro: <strong>HEADER_MARGIN</strong> <var>&lt;distance to baseline of header&gt;</var>
+<nobr>Macro: <strong>HEADER_MARGIN</strong> &lt;distance to baseline of header&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -902,11 +1155,60 @@ edge of the page to the baseline of type in footers.
<p>
<strong>Mom</strong>'s default footer margin is 3
<a href="definitions.html#TERMS_PICASPOINTS">picas</a>.
+
+<a name="FOOTER_MARGIN"></a>
<p>
-<strong>NOTE:</strong> <strong>Mom</strong> uses
-<strong>HEADER_MARGIN</strong> and
+<strong>FOOTER MARGIN AND BOTTOM MARGIN -- VERY IMPORTANT!</strong>
+<p>
+<strong>Mom</strong> requires a footer margin for proper operation,
+hence she sets one, even if you don't. (As stated above, her default
+footer margin is 3-picas).
+<p>
+If you set a bottom margin for your document (with
+<a href="typesetting.html#B_MARGIN">B_MARGIN</a>,
+prior to
+<a href="docprocessing.html#START">START</a>)
+and the margin's too close to <strong>mom</strong>'s default
+footer margin (or a footer margin you set yourself
+with <strong>FOOTER_MARGIN</strong>), <strong>mom</strong> will
+not print your footers; additionally, she'll give you a warning
+and some advice on standard error. When this happens, you must
+reset either <strong>B_MARGIN</strong> or
+<strong>FOOTER_MARGIN</strong> so there's an adequate amount of
+space for <strong>mom</strong> to print the bottom line of running
+text and the footer.
+<p>
+If you see the warning even when footers and/or bottom-of-page page
+numbering are disabled, set a nominal footer margin of 0 prior to
+<a href="docprocessing.html#START">START</a>,
+as in these examples.
+<p>
+<strong>Example 1</strong>
+<p>
+<pre>
+ &lt;reference macros, etc&gt;
+ .PAGINATION OFF
+ .B_MARGIN .25i
+ .FOOTER_MARGIN O
+ .START
+</pre>
+
+<strong>Example 2</strong>
+<p>
+<pre>
+ &lt;reference macros, etc&gt;
+ .HEADERS OFF
+ .PAGENUM_POS TOP RIGHT
+ .B_MARGIN .25i
+ .FOOTER_MARGIN O
+ .START
+</pre>
+
+<h3>A note on header/footer margins and page numbering</h3>
+<strong>Mom</strong> uses HEADER_MARGIN</strong> and
<strong>FOOTER_MARGIN</strong> to establish the baseline
-position of page numbers in addition to headers and footers.
+position of page numbers in addition to the baseline position of
+headers and footers.
<p>
By default, page numbers appear at the bottom of the page, therefore
if you want the default position (bottom), but want to change the
@@ -918,14 +1220,14 @@ there with
<a href="#PAGENUM_POS">PAGENUM_POS</a>,
you'd use <strong>HEADER_MARGIN</strong> to change their
baseline placement.
-<br>
+<p>
<!---HDRFTR_GAP--->
<hr width="66%" align="left">
<p>
<a name="HDRFTR_GAP"></a>
-Macro: <strong>HEADER_GAP</strong> <var>&lt;distance from header to start of running text&gt;</var>
+<nobr>Macro: <strong>HEADER_GAP</strong> &lt;distance from header to start of running text&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -950,7 +1252,7 @@ top margin.
<p>
<strong>Mom</strong>'s default header gap is 3
<a href="definitions.html#TERMS_PICASPOINTS">picas</a>,
-but if you want a different gap, say, 2 centimeters, do
+but if you want a different gap, say, 2 centimetres, do
<p>
<pre>
.HEADER_GAP 2c
@@ -987,7 +1289,7 @@ the last line of running text and a bottom page number, use
<strong>FOOTER_GAP</strong>. If page numbers are at the top of the
page, change the gap between the number and the first line of running
text with <strong>HEADER_GAP</strong>.
-<br>
+<p>
<hr>
<!---HDRFTR_SEPARATOR--->
@@ -1010,14 +1312,14 @@ footer), you can alter its placement.
<ul>
<li><a href="#HDRFTR_RULE">HEADER_RULE</a> -- on or off
<li><a href="#HDRFTR_RULE_GAP">HEADER_RULE_GAP</a> -- distance of rule from header
-</ul
+</ul>
<!---HDRFTR_RULE--->
<hr width="66%" align="left">
<p>
<a name="HDRFTR_RULE"></a>
-Macro: <strong>HEADER_RULE</strong> <var>toggle</var>
+<nobr>Macro: <strong>HEADER_RULE</strong> toggle</nobr>
<p>
By default, <strong>mom</strong> prints a header separator rule
@@ -1036,14 +1338,14 @@ without any argument.
with <strong>FOOTER_</strong> to enable/disable the printing of
the footer separator rule. (Most likely, if you're using
<a href="#FOOTERS">FOOTERS</a>, you'll want it off.)
-<br>
+<p>
<!---HDRFTR_RULE_GAP--->
<hr width="66%" align="left">
<p>
<a name="HDRFTR_RULE_GAP"></a>
-Macro: <strong>HEADER_RULE_GAP</strong> <var>distance of rule beneath header</var>
+<nobr>Macro: <strong>HEADER_RULE_GAP</strong> distance of rule beneath header</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -1057,7 +1359,7 @@ required, and decimal fractions are allowed. Please note that
(i.e. <strong>HEADER_RULE_GAP</strong> is NOT added to
<strong>HEADER_GAP</strong> when <strong>mom</strong> calculates
the space between headers and the start of
-<a href="definitions.html#TERMS_RUNNING">running text</a>.
+<a href="definitions.html#TERMS_RUNNING">running text</a>).
<p>
By default, the header rule gap is 4
<a href="definitions.html#TERMS_PICASPOINTS">points</a>.
@@ -1087,7 +1389,34 @@ footer or <strong>mom</strong> may not get the rule gap right.
Inline changes to the size of type in
<strong>FOOTER_RECTO</strong> and <strong>FOOTER_VERSO</strong>
should always be negative (smaller) than the default.
-<br>
+<p>
+
+<!---HDRFTR_RULE_COLOR--->
+
+<hr width="66%" align="left">
+<p>
+<a name="HDRFTR_RULE_COLOR"></a>
+<nobr>Macro: <strong>HEADER_RULE_COLOR</strong> &lt;colorname&gt;</nobr>
+
+<p>
+If you wish to change the colour of the header rule, invoke
+<strong>HEADER_RULE_COLOR</strong> with the name of a colour
+pre-defined (or &quot;initialized&quot;) with
+<a href="color.html#NEWCOLOR">NEWCOLOR</a>
+or
+<a href="color.html#XCOLOR">XCOLOR</a>.
+<p>
+Please note that <strong>HEADER_RULE_COLOR</strong> overrides the
+colour set with
+<a href="#HDRFTR_COLOR">HDRFTR_COLOR</a>,
+so that it's possible to have the heads entirely in, say, blue (set
+with <strong>HEADER_COLOR</strong>), and the header rule in, say,
+red.
+<p>
+<strong>NOTE:</strong> Replace <strong>HEADER_</strong>, above,
+with <strong>FOOTER_</strong> to change the colour of the footer
+rule.
+<p>
<hr>
<a name="PAGINATION">
@@ -1096,11 +1425,11 @@ should always be negative (smaller) than the default.
<p>
By default, <strong>mom</strong> paginates documents. Page numbers
-appear in the bottom margin of the page, centered between two hyphens.
+appear in the bottom margin of the page, centred between two hyphens.
As with all elements of <strong>mom</strong>'s document processing,
most aspects of pagination style can be altered to suit your taste
with control macros.
-<br>
+<p>
<a name="INDEX_PAGINATION">
<h3><u>Pagination macros list</u></h3>
@@ -1114,14 +1443,14 @@ with control macros.
<li><a href="#DRAFT_WITH_PAGENUMBER">DRAFT_WITH_PAGENUMBER</a> -- attach draft/revision information to page numbers
<li><a href="#PAGINATE_CONTROL">Control macros</a>
</ul>
-<br>
+<p>
<!---PAGINATE--->
<hr width="66%" align="left">
<p>
<a name="PAGINATE"></a>
-Macro: <strong>PAGINATE</strong> <var>toggle</var>
+<nobr>Macro: <strong>PAGINATE</strong> toggle</nobr>
<br>
Alias: <strong>PAGINATION</strong>
@@ -1137,14 +1466,14 @@ NO, QUIT, END, X...</strong>), e.g.
To (re)start pagination, invoke <strong>PAGINATE</strong>
without any argument.
-<br>
+<p>
<!---PAGENUMBER--->
<hr width="66%" align="left">
<p>
<a name="PAGENUMBER"></a>
-Macro: <strong>PAGENUMBER</strong> <var>&lt;number&gt;</var>
+<nobr>Macro: <strong>PAGENUMBER</strong> &lt;number&gt;</nobr>
<p>
As is to be expected, pagination of documents begins at page 1.
@@ -1157,34 +1486,34 @@ number on the first page of a document, invoke
any time to tell <strong>mom</strong> what number you want a
page to have. Subsequent page numbers will, of course, be
incremented by 1 from that number.
-<br>
+<p>
<!---PAGENUM_STYLE--->
<hr width="66%" align="left">
<p>
<a name="PAGENUM_STYLE"></a>
-Macro: <strong>PAGENUM_STYLE</strong> <var>DIGIT | ROMAN | roman | ALPHA | alpha</var>
+<nobr>Macro: <strong>PAGENUM_STYLE</strong> DIGIT | ROMAN | roman | ALPHA | alpha</nobr>
<p>
<strong>PAGENUM_STYLE</strong> lets you tell
<strong>mom</strong> what kind of page numbering you want.
<p>
<table valign="baseline" summary="pagenumstyle">
-<tr><td>DIGIT<td align="center" width="15">=<td>arabic digits (1, 2, 3...)
+<tr><td>DIGIT<td align="center" width="15">=<td>Arabic digits (1, 2, 3...)
<tr><td>ROMAN<td align="center" width="15">=<td>upper case roman numerals (I, II, III...)
<tr><td>roman<td align="center" width="15">=<td>lower case roman numerals (i, ii, iii...)
<tr><td>ALPHA<td align="center" width="15">=<td>upper case letters (A, B, C...)
<tr><td>alpha<td align="center" width="15">=<td>lower case letters (a, b, c...)</td></tr>
</table>
-<br>
+<p>
<!---PAGENUM_ON_FIRST_PAGE--->
<hr width="66%" align="left">
<p>
<a name="PAGENUM_ON_FIRST_PAGE"></a>
-Macro: <strong>PAGENUM_ON_FIRST_PAGE</strong> <var>toggle</var>
+<nobr>Macro: <strong>PAGENUM_ON_FIRST_PAGE</strong> toggle</nobr>
<p>
This macro applies only if you've enabled
@@ -1207,7 +1536,7 @@ page of a document, but do want one on pages that appear after
<a href="docprocessing.html#START">START</a>
of the document, then invoke it either just before or after your
first <strong>COLLATE</strong>.
-<br>
+<p>
<!---DRAFT_WITH_PAGENUMBER--->
@@ -1219,7 +1548,7 @@ Macro: <strong>DRAFT_WITH_PAGENUMBER</strong>
<p>
Sometimes, in
<a href="docprocessing.html#COPYSTYLE">COPYSTYLE DRAFT</a>,
-the center part of page headers gets overcrowded because of the draft
+the CENTER part of page headers gets overcrowded because of the draft
and revision information that go there by default.
<strong>DRAFT_WITH_PAGENUMBER</strong> is one way to
fix the problem.
@@ -1236,7 +1565,7 @@ See the note in
<a href="docprocessing.html#COPYSTYLE">COPYSTYLE DRAFT</a>
for other ways of dealing with crowded page headers when formatting
draft-style copy.
-<br>
+<p>
<hr>
<!---PAGINATE_CONTROL--->
@@ -1244,12 +1573,12 @@ draft-style copy.
<a name="PAGINATE_CONTROL"><h3><u>Pagination control macros</u></h3></a>
<ol>
- <li><a href="#PAGINATE_GENERAL">Family/font/size</a>
+ <li><a href="#PAGINATE_GENERAL">Family/font/size/colour</a>
<li><a href="#PAGENUM_POS">Page number position (vertical and horizontal)</a>
<li><a href="#PAGENUM_HYPHENS">Enclose page numbers with hyphens (on or off)</a>
</ol>
<br>
-<a name="PAGINATE_GENERAL"><h3><u>1. Page number family/font/size</u></h3></a>
+<a name="PAGINATE_GENERAL"><h3><u>1. Page number family/font/size/colour</u></h3></a>
<p>
See
<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
@@ -1258,11 +1587,12 @@ See
.PAGENUM_FAMILY default = prevailing document family; default is Times Roman
.PAGENUM_FONT default = roman
.PAGENUM_SIZE default = 0 (i.e. same size as paragraph text)
+.PAGENUM_COLOR default= black
</pre>
<a name="PAGENUM_POS"><h3><u>2. Page number position</u></h3></a>
<p>
-Macro: <strong>PAGENUM_POS</strong> <var>TOP | BOTTOM&nbsp;&nbsp;LEFT | CENTER | RIGHT</var>
+<nobr>Macro: <strong>PAGENUM_POS</strong> TOP | BOTTOM&nbsp;&nbsp;LEFT | CENTER | RIGHT</nobr>
<p>
Use <strong>PAGENUM_POS</strong> to change the default position of
@@ -1275,14 +1605,15 @@ For example, if you turn both
and
<a href="definitions.html#TERMS_FOOTER">footers</a>
off (with <code>.HEADERS OFF</code> and <code>.FOOTERS
-OFF</code)) and you want <strong>mom</strong> to number your
+OFF</code>) and you want <strong>mom</strong> to number your
pages at the top right position, enter
<p>
<pre>
.PAGENUM_POS TOP RIGHT
</pre>
-<a name="#PAGENUM_HYPHENS"><h3><u>3. Enclose page numbers with hyphens (on or off)</u></h3></a>
+<a name="PAGENUM_HYPHENS"><h3><u>3. Enclose page numbers with hyphens (on or off)</u></h3></a>
+<p>
By default, <strong>mom</strong> encloses page numbers between hyphens.
If you don't want this behaviour, invoke the macro
<strong>PAGENUM_HYPHENS</strong> with any argument (<strong>OFF, QUIT, END, X...</strong>),
@@ -1294,8 +1625,8 @@ like this:
If, for some reason, you want to turn page number hyphens back
on, invoke the macro without an argument.
-
<p>
+
<hr>
<a href="rectoverso.html#TOP">Next</a>&nbsp;&nbsp;
<a href="docelement.html#TOP">Prev</a>&nbsp;&nbsp;
diff --git a/contrib/groff/contrib/mom/momdoc/inlines.html b/contrib/groff/contrib/mom/momdoc/inlines.html
index 2d8aa82a9a30..9409aab9320d 100644
--- a/contrib/groff/contrib/mom/momdoc/inlines.html
+++ b/contrib/groff/contrib/mom/momdoc/inlines.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -7,19 +8,19 @@
<!====================================================================>
-<a href="docprocessing.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="color.html#TOP">Next</a>&nbsp;&nbsp;
<a href="goodies.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
<a name="TOP"></a>
-<h2>
+<h1 align="center">
<a name="INLINE_ESCAPES"><u>Inline escapes</u></a>
-</h2>
-
+</h1>
+<p>
<a href="#INLINE_ESCAPES_INTRO">Introduction to inline escapes</a>
<br>
<a href="#INDEX_INLINES">Index of inline escapes</a>
-<br>
+<p>
<a name="INLINE_ESCAPES_INTRO">
<h2><u>Introduction to inline escapes</u></h2>
@@ -52,14 +53,14 @@ backslash character as part of a line of text, simply enter it twice
character." (You can also use <strong>\e</strong> to print a literal
backslash.)
<p>
-Groff has a number of ways of recognising what constitutes a complete
+Groff has a number of ways of recognizing what constitutes a complete
escape sequence. This is both a boon and a curse; some escape
sequences have no terminating delimiter and consequently become
difficult to distinguish from real input text. Others require
the use of an opening parenthesis with no corresponding closing
parenthesis. Still others need to be enclosed in square brackets.
<p>
-<strong>Mom</strong> recognises that certain escapes get used more
+<strong>Mom</strong> recognizes that certain escapes get used more
often than others. For these, she has a consistent input style that
takes the form \*[...], which makes them stand out well from the text
of your documents. These escapes are the ones listed under
@@ -88,6 +89,8 @@ that take
<li><a href="#INLINE_KERNING_MOM">Pairwise kerning</a>
<li><a href="#INLINE_HORIZONTAL_MOM">Horizontal movement</a>
<li><a href="#INLINE_VERTICAL_MOM">Vertical movement</a>
+ <li><a href="#B">Terminate a line without advancing on the page</a>
+ <li><a href="#TB+">Call the next sequential tab without advancing on the page</a>
<li><a href="#INLINE_RULE_MOM">Full measure rules</a>
</ul>
<li><a name="INLINES_GROFF"><strong>Groff inline escapes</strong></a>
@@ -100,6 +103,7 @@ that take
<li><a href="#INLINE_CHARACTERS_GROFF">Special characters</a>
</ul>
</ul>
+<p>
<hr>
<!---INLINE_FONTS_MOM--->
@@ -109,27 +113,43 @@ that take
<a name="INLINE_FONTS_MOM"><h3><u>Changing fonts</u></h3></a>
<p>
-<strong>Mom</strong> provides five inlines to change fonts
-inline.
-<p>
-<table valign="baseline" summary="inlinefonts">
-<tr><td width="15"><td><strong>\*[ROM]</strong><td>Change font to roman
-<tr><td><td><strong>\*[IT]</strong><td>Change font to italic
-<tr><td><td><strong>\*[BD]</strong><td>Change font to bold
-<tr><td><td><strong>\*[BDI]</strong><td>Change font to bold italic
-<tr><td><td><strong>\*[PREV]</strong><td>Revert to previous font</td></tr>
+<strong>Mom</strong> provides five escapes for changing fonts
+inline:
+<p>
+<table valign="baseline" cellpadding="10" summary="inlinefonts">
+<tr>
+ <td><strong>\*[ROM]</strong></td>
+ <td>Change font to medium roman</td>
+</tr>
+<tr>
+ <td><strong>\*[IT]</strong></td>
+ <td>Change font to medium italic</td>
+</tr>
+<tr>
+ <td><strong>\*[BD]</strong></td>
+ <td>Change font to bold roman</td>
+</tr>
+<tr>
+ <td><strong>\*[BDI]</strong></td>
+ <td>Change font to bold italic</td>
+</tr>
+<tr>
+ <td><strong>\*[PREV]</strong></td>
+ <td>Revert to previous font</td>
+</tr>
</table>
<p>
-See also
-<a href="#INLINE_FONTS_GROFF">font control with \f</a>
-for other ways to change fonts inline.
+These escapes are provided for merely for convenience, legibility,
+and consistency when typesetting with <strong>mom</strong>. For
+more complete and flexible inline font control, please see
+<a href="#INLINE_FONTS_GROFF">font control with \f</a>.
<p>
<strong>NOTE:</strong> If you're using the
<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>,
inline font changes remain in effect only for the duration of the
-current macro.
-<br>
+current document element tag.
+<p>
<!---INLINE_SIZE_MOM--->
@@ -137,42 +157,59 @@ current macro.
<a name="INLINE_SIZE_MOM"><h3><u>Changing point size</u></h3></a>
<p>
-<strong>Mom</strong>'s inline escape for changing point
-size, sadly, does not observe her normal inline syntax
-<strong>\*[whatever]</strong>. It's the only exception, and there's
-no way around it. The escape for changing point size looks like this:
+<strong>Mom</strong> has two inline escapes for changing point
+size:
+<p>
+<pre>
+ \*[SIZE &lt;size&gt;]
+</pre>
+
+and
+<p>
+<pre>
+ \*[S&lt;size&gt;]
+</pre>
+
+where &quot;size&quot; 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
<p>
<pre>
- \*S[size]
+ \*[SIZE 12]
</pre>
-where &quot;size&quot; is the new size you want. For example, to
-change the point size inline to 12 points, you'd enter
+or
<p>
<pre>
\*S[12]
</pre>
-Notice that the new size does not require a
+The advantage of the first form is that it's easy to remember, and
+follows <strong>mom</strong>'s usual inline syntax. The advantage
+of the second is that it's more concise.
+<p>
+Notice that in both cases, the new size does not require a
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>;
<a href="definitions.html#TERMS_PICASPOINTS">points</a>
-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.
<p>
-The size given to <strong>\*S</strong> may be expressed in plus
-or minus terms, which can be very useful. In the following
-example, the word &quot;mom&quot; will be output 2 points larger
-than the point size of the rest of the line.
+The size given to <strong>\*[SIZE&nbsp;&lt;size&gt;]</strong> or
+<strong>\*S[&lt;size&gt;]</strong> may be expressed in plus or minus
+terms, which can be very useful. In the following examples, the word
+&quot;mom&quot; will be output 2 points larger than the point size
+of the rest of the line.
<p>
<pre>
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.
</pre>
<strong>NOTE:</strong> If you're accustomed to groff's usual way
of handling inline size requests (<kbd>\sN, \s±N, \s(NN, \s±(NN,
\s[NNN], \s±[NNN]</kbd>), feel free to continue with your old habits.
<strong>Mom</strong> doesn't care.
-<br>
+<p>
<!---INLINE_KERNING_MOM--->
@@ -187,16 +224,20 @@ for more details).
<p>
<strong>Mom</strong> permits inline pairwise
kerning through the use of the inline escapes
-<p>
-<table valign="baseline" summary="inlinekerning">
-<tr><td width="15"><td><strong>\*[BU #]<td></strong>Closes the space between letters (<strong>B</strong>ack <strong>U</strong>nits).
-<tr><td><td><strong>\*[FU #]</strong><td>Opens the space between letters (<strong>F</strong>orward <strong>U</strong>nits).
+<table valign="baseline" cellpadding="10" summary="inlinekerning">
+<tr>
+ <td><pre>\*[BU n]</pre></td>
+ <td>Closes the space between letters (<strong>B</strong>ack <strong>U</strong>nits).</td>
+</tr>
+<tr>
+ <td><pre>\*[FU n]</pre></td>
+ <td>Opens the space between letters (<strong>F</strong>orward <strong>U</strong>nits).</td>
+</tr>
</table>
<br>
-"<strong>#</strong>" is the number of <a
-href="definitions.html#TERMS_KERNUNIT">kern units</a>
-by which to close or open the space between letters. Decimal fractions
-are allowed.
+&quot;<strong>n</strong>&quot; is the number of
+<a href="definitions.html#TERMS_KERNUNIT">kern units</a>
+by which to close or open the space between letters.
<p>
For example,
<p>
@@ -210,14 +251,15 @@ to the letter W. Additionally, the letter T in "WATER" is moved 5 kern
units closer to the letter A.
<p>
For backward compatibility, the forms
-<p>
-<table valign="baseline" summary="inlinekerningold">
-<tr><td width="15"><td><strong>\*[BU1]...\*[BU36]</strong><td>
-Move back 1...36
-<a href="definitions.html#TERMS_KERNUNIT">kern units</a>
-<tr><td><td><strong>\*[FU1]...\*[FU36]</strong><td>
-Move forward 1...36
-<a href="definitions.html#TERMS_KERNUNIT">kern units</a>
+<table valign="baseline" cellpadding="10" summary="inlinekerningold">
+<tr>
+ <td><pre>\*[BU1]...\*[BU36]</pre></td>
+ <td>Move back 1...36 <a href="definitions.html#TERMS_KERNUNIT">kern units</a></td>
+</tr>
+<tr>
+ <td><pre>\*[FU1]...\*[FU36]</pre></td>
+ <td>Move forward 1...36 <a href="definitions.html#TERMS_KERNUNIT">kern units</a></td>
+</tr>
</table>
<br>
also exist (i.e. with no space before the number of kern units desired,
@@ -227,7 +269,7 @@ up to a limit of 36).
between characters pairs that are already automatically kerned
disables the automatic kerning and uses the value you give to
<strong>BU</strong> or <strong>FU</strong> instead.
-<br>
+<p>
<!---INLINE_HORIZONTAL_MOM--->
@@ -245,17 +287,21 @@ line in order to create special typographic effects.
<p>
<strong>Mom</strong>'s inline escapes for these horizontal movements are
<p>
-<table align="left" valign="baseline" summary="inlinehorizontal">
+<table align="left" valign="baseline" cellpadding="10" summary="inlinehorizontal">
+<tr>
<a name="FWD"></a>
-<tr><td width="15"><td width="20%"><strong>\*[FWD #&lt;unit&gt;]
-<td>Move forward inline the specified number of
-<a href="definitions.html#TERMS_UNITOFMEASURE">units of measure</a>;
-decimal fractions are allowed.
+ <td><pre>\*[FWD n&lt;unit&gt;]</pre></td>
+ <td width="80%">Move forward inline the specified number of
+ <a href="definitions.html#TERMS_UNITOFMEASURE">units of measure</a>;
+ decimal fractions are allowed.</td>
+</tr>
+<tr>
<a name="BCK"></a>
-<tr><td><td><strong>\*[BCK #&lt;unit&gt;]
-<td>Move backward inline the specified number of
-<a href="definitions.html#TERMS_UNITOFMEASURE">units of measure</a>;
-decimal fractions are allowed.
+ <td><pre>\*[BCK n&lt;unit&gt;]</pre></td>
+ <td width="80%">Move backward inline the specified number of
+ <a href="definitions.html#TERMS_UNITOFMEASURE">units of measure</a>;
+ decimal fractions are allowed.</td>
+</tr>
</table>
<p>
For example,
@@ -268,9 +314,15 @@ puts 12 points of space between &quot;1.&quot; and
<p>
<strong>NOTE:</strong> For backward compatibility, the forms
<p>
-<table valign="baseline" summary="inlinehorizontalold">
-<tr><td width="15"><td><strong>\*[BP.25]...\*[BP12.75]</strong><td>Move back .25...12.75 points
-<tr><td><td><strong>\*[FP.25]...\*[FP12.75]</strong><td>Move forward .25...12.75 points</td></tr>
+<table valign="baseline" cellpadding="10" summary="inlinehorizontalold">
+<tr>
+ <td><pre>\*[BP.25]...\*[BP12.75]</pre></td>
+ <td>Move back .25...12.75 points</td>
+</tr>
+<tr>
+ <td><pre>\*[FP.25]...\*[FP12.75]</pre></td>
+ <td>Move forward .25...12.75 points</td>
+</tr>
</table>
<br>
also exist (i.e. with no space before the digit and points being
@@ -278,7 +330,7 @@ the unit of measure, hence no unit of measure required). Both
accept quarter points, so it's possible to do, for example,
<strong>\*[FP.5]</strong> or <strong>\*[BP1.25]</strong> up to a limit
of 12.75 points.
-<br>
+<p>
<!---INLINE_VERTICAL_MOM--->
@@ -289,15 +341,19 @@ of 12.75 points.
If you need to move portions of type up or down on a line,
<strong>mom</strong> provides the following inline escapes:
<p>
-<table valign="baseline" summary="inlinevertical">
+<table width="80%" valign="baseline" cellpadding="10" summary="inlinevertical">
+<tr>
<a name="UP"></a>
-<tr><td width="15"><td><strong>\*[UP #&lt;unit&gt;]</strong>
-<td>Move up inline the specified number of
-<a href="definitions.html#TERMS_UNITOFMEASURE">units of measure</a>
+ <td><pre>\*[UP n&lt;unit&gt;]</pre></td>
+ <td>Move up inline the specified number of
+ <a href="definitions.html#TERMS_UNITOFMEASURE">units of measure</a></td>
+</tr>
+<tr>
<a name="DOWN"></a>
-<tr><td><td><strong>\*[DOWN #&lt;unit&gt;]</strong>
-<td>Move down inline the specified number of
-<a href="definitions.html#TERMS_UNITOFMEASURE">units of measure</a>
+ <td><pre>\*[DOWN n&lt;unit&gt;]</pre></td>
+ <td>Move down inline the specified number of
+ <a href="definitions.html#TERMS_UNITOFMEASURE">units of measure</a></td>
+</tr>
</table>
<br>
For example,
@@ -309,20 +365,95 @@ For example,
moves the hyphen in the telephone number up by 1 point, then
moves back down by the same amount.
<p>
-<strong>NOTE:</strong> For backward compatibility, the following are
-also available:
-<p>
-<table valign="baseline" summary="inlinevertical">
-<tr><td width="15"><td><strong>\*[ALD.25]...\*[ALD12.75]</strong><td>
-Advance lead .25...12.75 points (move downward)
-<tr><td><td><strong>\*[RLD.25]...\*[RLD12.75]</strong><td>
-Reverse lead .5...12.75 points (move upward)</td></tr>
+<strong>NOTE: \*[UP]</strong> and <strong>\*[DOWN]</strong> do not
+work with the inline escape,
+<a href="#INLINE_RULE_MOM">\*[RULE]</a>.
+See
+<a href="#RULE_EXCEPTION">here</a>
+for details.
+<p>
+<strong>ADDITIONAL NOTE:</strong> For backward compatibility, the
+following are also available:
+<p>
+<table valign="baseline" cellpadding="10" summary="inlinevertical">
+<tr>
+ <td><pre>\*[ALD.25]...\*[ALD12.75]</pre>
+ <td>Advance lead .25...12.75 points (move downward)
+</tr>
+<tr>
+ <td><pre>\*[RLD.25]...\*[RLD12.75]</pre></td>
+ <td>Reverse lead .5...12.75 points (move upward)</td>
+</tr>
</table>
<p>
<p>
Both <strong>\*[ALD]</strong> and <strong>\*[RLD]</strong> work in
-points, hence you musn't use a unit of measure.
-<br>
+points, hence you mustn't use a unit of measure.
+<p>
+
+<!---INLINE_B_MOM--->
+
+<hr width="66%" align="left">
+<a name="B"><h3><u>Terminate a line without advancing on the page</u></h3></a>
+
+<p>
+Sometimes, you want <strong>mom</strong> to break a line but not
+advance on the page. See
+<a href="typesetting.html#EL_EXAMPLE">here</a>
+for an example of when you might want to do this.
+<p>
+In versions of <strong>mom</strong> prior to 1.2-f, this was
+accomplished through the use of
+<a href="typesetting.html#EL">EL</a>.
+As of 1.2-f, you can, if you prefer, accomplish the same thing
+by using the inline escape, <strong>\*[B]</strong>. Simply
+attach the escape to the end of any line. Using the example
+given in the document entry for <strong>EL</strong>, you'd use
+<strong>\*[B]</strong> like this:
+
+<p>
+<pre>
+ .LEFT
+ .LS 12.5
+ A line of text.\*[B]
+ .ALD 24p
+ The next line of text.
+</pre>
+
+<strong>\*[B]</strong> works reliably regardless of the current
+<a href="definitions.html#TERMS_FILLED">fill mode</a>.
+<p>
+
+<!---INLINE_TB+_MOM--->
+
+<hr width="66%" align="left">
+<a name="TB+"><h3><u>Call the next sequential tab without advancing on the page</u></h3></a>
+
+<p>
+Sometimes, you want <strong>mom</strong> to move to the next tab in
+sequence (e.g. from TAB 1 to TAB 2, or TAB 8 to TAB 9) without
+<strong>mom</strong> advancing on the page. (See the example in
+<a href="typesetting.html#NOTE_TN">here</a>
+if you're not clear how <strong>mom</strong> manages tabs and
+linebreaks.)
+<p>
+In versions of <strong>mom</strong> prior to 1.2-f, this was
+accomplished through the use of
+<a href="typesetting.html#TN">TN</a>.
+As of 1.2-f, you can, if you prefer, accomplish the same thing
+by using the inline escape, <strong>\*[TB+]</strong>. Simply
+attach the escape to the end of any line in a tab, like this:
+
+<p>
+<pre>
+ .TAB 1
+ Some text\*[TB+] \" This line is in tab 1
+ Some more text \" This line is in tab 2, on the same baseline as tab 1
+</pre>
+
+<strong>\*[TB+]</strong> works reliably regardless of the current
+<a href="definitions.html#TERMS_FILLED">fill mode</a>.
+<p>
<!---INLINE_RULE_MOM--->
@@ -344,10 +475,28 @@ example:
</pre>
The above draws a rule the full measure of the 6-pica line length.
-Please note that <strong>\*[$RULE]</strong> should appear on a line by
-itself and that it draws the rule to the full measure, hence it
-<em>cannot</em> be used to fill the remainder of a partial line with
-a rule in this way:
+<p>
+<strong>\*[RULE]</strong> should appear on a line by itself. In
+<a href="definitions.html#TERMS_FILLED">fill modes</a>,
+(i.e.
+<a href="typesetting.html#QUAD">QUAD</a>
+or
+<a href="typesetting.html#JUSTIFY">JUSTIFY</a>),
+it requires a
+<a href="typesetting.html#BR">.BR</a>
+on the line immediately before it; otherwise, the rule will be drawn
+on the same baseline occupied by any type preceding it. In
+<a href="definitions.html#TERMS_NOFILL">nofill modes</a>
+(i.e
+<a href="typesetting.html#LRC">LEFT</a>,
+<a href="typesetting.html#LRC">RIGHT</a>
+or
+<a href="typesetting.html#LRC">CENTER</a>),
+the <strong>.BR</strong> is not required.
+<p>
+Please note that <strong>\*[RULE]</strong> draws the rule to the
+full measure, hence it <em>cannot</em> be used to fill the remainder
+of a partial line with a rule in this way:
<p>
<pre>
Signature__________________________________________
@@ -358,13 +507,34 @@ If you wish to accomplish this effect, you have to use
<a href="goodies.html#PAD"><strong>PAD</strong></a>
macro and
<a href="typesetting.html#STRING_TABS">string tabs</a>.
-(See the example provided with
-<a href="goodies.html#PAD_EXAMPLE"><strong>.PAD</strong></a>.
+(See the
+<a href="goodies.html#PAD_EXAMPLE">example</a>
+provided with <strong>PAD</strong>.)
+<a name="RULE_EXCEPTION"></a>
+<p>
+Please also note that the inline escapes
+<a href="#UP">\*[UP]</a>
+and
+<a href="#DOWN">\*[DOWN]</a>
+cannot be used in conjunction with <strong>\*[RULE]</strong>. This
+doesn't work:
+<p>
+<pre>
+ \*[DOWN 2p]\*[RULE]\*[UP 2p]
+</pre>
+
+This does:
<p>
+<pre>
+ .ALD 2p
+ \*[RULE]
+ .RLD 2p
+</pre>
+
See groff's
<a href="#INLINE_LINEDRAWING_GROFF">Horizontal line drawing function</a>
for more information on drawing horizontal rules.
-<br>
+<p>
<hr>
<!---INLINE_FONT_GROFF--->
@@ -375,33 +545,52 @@ for more information on drawing horizontal rules.
<p>
Groff's basic mechanism for inline font control is the escape
-<strong>\f</strong>.
-<p>
-<table valign="baseline" summary="inlinefontsgroff">
-<tr><td width="15"><td><strong>\fR</strong><td>Change font to roman
-<tr><td><td><strong>\fI</strong><td>Change font to italic
-<tr><td><td><strong>\fB</strong><td>Change font to bold
-<tr><td><td><strong>\f(BI</strong><td>Change font to bold italic
-<tr><td><td><strong>\fP</strong><td>Revert to previous font</td></tr>
+<strong>\f[&lt;</strong>font&gt;<strong>]</strong>.
+<p>
+<table valign="baseline" cellpadding="10" summary="inlinefontsgroff">
+<tr>
+ <td><strong>\f[R]</strong></td>
+ <td>Change font to medium roman (equivalent to mom's <strong>\*[ROM]</strong>)</td>
+</tr>
+<tr>
+ <td><strong>\f[I]</strong></td>
+ <td>Change font to medium italic (equivalent to mom's <strong>\*[IT]</strong>)</td>
+</tr>
+<tr>
+ <td><strong>\f[B]</strong></td>
+ <td>Change font to bold roman (equivalent to mom's <strong>\*[BD]</strong>)</td>
+</tr>
+<tr>
+ <td><strong>\f[BI]</strong></td>
+ <td>Change font to bold italic (equivalent to mom's <strong>\*[BDI]</strong>)</td>
+</tr>
+<tr>
+ <td><strong>\f[P]</strong></td>
+ <td>Revert to previous font (equivalent to mom's <strong>\*[PREV]</strong>)</td>
+</tr>
</table>
<p>
-A special instance of <strong>\f</strong> is
-<strong>\f[font]</strong>, where &quot;font&quot; can be a
-complete legal family/font name combo. This is especially
-useful should you need to change both family and font inline.
-For example, if your prevailing family and font are Times Roman
-and you want a few words in Courier Bold Italic, you could do
-this:
+<strong>\f[&lt;</strong>font&gt;<strong>]</strong> can be used with
+any legal font style registered with groff. (See
+<a href="appendices.html#STYLE_EXTENSIONS">here</a>
+for a list of pre-registered font styles provided by
+<strong>mom</strong>).
+<p>
+<strong>\f[&lt;</strong>font&gt;<strong>]</strong> can also take a
+complete legal family+font name combo. This is especially useful
+should you need to change both family and font inline. For example,
+if your prevailing family and font are Times Roman and you want a
+few words in Courier Bold Italic, you could do this:
<p>
<pre>
.FAM T
.FT R
- The command \f[CBI]ls -l\fP gives a &quot;long&quot; directory listing.
+ The command \f[CBI]ls -l\f[P] gives a &quot;long&quot; directory listing.
</pre>
The Unix command &quot;ls -l&quot; will appear in Courier Bold Italic
in a line that is otherwise in Times Roman.
-<br>
+<p>
<!---INLINE_HORIZONTAL_GROFF--->
@@ -423,7 +612,7 @@ moves you 1.25 inches to the right (forwards) of the horizontal
position on the current
<a href="definitions.html#TERMS_OUTPUTLINE">output line</a>.
<strong>\h'&lt;distance&gt;'</strong> is exactly equivalent to
-<a href="#FWD"><strong>\*[FWD #&lt;unit&gt;]</strong></a>.
+<a href="#FWD"><strong>\*[FWD n&lt;unit&gt;]</strong></a>.
<p>
<pre>
\h'-1.25i'
@@ -431,8 +620,8 @@ position on the current
moves you 1.25 inches to the left (backwards).
<strong>\h'-&lt;distance&gt;'</strong> is exactly equivalent to
-<a href="#BCK"><strong>\*[BCK #&lt;unit&gt;]</strong></a>.
-<br>
+<a href="#BCK"><strong>\*[BCK n&lt;unit&gt;]</strong></a>.
+<p>
<!---INLINE_VERTICAL_GROFF--->
@@ -456,7 +645,7 @@ moves you (approx.) 2/3 of an
downward on the current
<a href="definitions.html#TERMS_OUTPUTLINE">output line</a>.
<strong>\v'&lt;distance&gt;'</strong> is exactly equivalent to
-<a href="#DOWN"><strong>\*[DOWN #&lt;unit&gt;]</strong></a>.
+<a href="#DOWN"><strong>\*[DOWN n&lt;unit&gt;]</strong></a>.
<p>
<pre>
\v'-.6m'
@@ -464,7 +653,7 @@ downward on the current
moves you (approx.) 2/3 of an em upward.
<strong>\v'&lt;-distance&gt;'</strong> is exactly equivalent to <a
-href="#UP"><strong>\*[UP #&lt;unit&gt;]</strong></a>.
+href="#UP"><strong>\*[UP n&lt;unit&gt;]</strong></a>.
<p>
<strong>IMPORTANT:</strong> The vertical motion of <strong>\v</strong>
affects ONLY type on the current
@@ -479,7 +668,7 @@ you've done what you want to do. Otherwise, the remaining type
will be set too high (if you used <strong>\v</strong> with the
minus sign) or too low (if you used <strong>\v</strong> without
the minus sign).
-<br>
+<p>
<!---INLINE_STRINGWIDTHL_GROFF--->
@@ -507,7 +696,7 @@ argument.</em>
Furthermore, if the string is composed of several words separated
by spaces, you MUST surround the whole escape with double quotes,
as in the example above.
-<br>
+<p>
<!---INLINE_LINEDRAWING_GROFF--->
@@ -543,15 +732,16 @@ a number of other line-drawing escapes, but frankly, using them for
typographically precise drawing is a bit like hammering in a nail
with a screwdriver -- doable, but not recommended.
<p>
-Groff comes with a number of &quot;preprocessors&quot; designed to ease
-creating rules, boxes, splines, and so on (tbl, pic, and friends), but
-I tend not to use them. A firm believer in the &quot;right tool for
-the job,&quot; I prefer a vector drawing program (in my case, tgif)
-when I need to combine type with graphic elements (say, a complex
-ruled form). Inserting the results into a document is easy enough
-with <strong>.PSPIC</strong> (consult the <strong>grops</strong>
-man page for information on this indispensible and easy-to-use macro).
-<br>
+Groff comes with a number of &quot;preprocessors&quot; designed
+to ease creating rules, boxes, splines, and so on (tbl, pic,
+and friends), but I tend not to use them. A firm believer
+in the &quot;right tool for the job,&quot; I prefer a vector
+drawing program when I need to combine type with graphic elements
+(say, a complex ruled form). Inserting the results into a
+document is easy enough with <strong>.PSPIC</strong> (consult
+the <strong>groff_tmac</strong> man page for information on this
+indispensable and easy-to-use macro).
+<p>
<!---INLINE_CHARACTERS_GROFF--->
@@ -563,11 +753,12 @@ Here follows a short list of commonly-used special characters available
via inline escapes. If you're not sure of the meaning of some of
these characters, consult the
<a href="definitions.html#TERMS">Definitions of Terms</a>.
-For a more complete list, consult the section <em>Special
-Character Names</em> at the end of the <em>Tutorial Examples</em>
-in <strong>cstr54</strong>, available
-<a href="http://www.kohala.com/start/troff/">here</a>.
-
+<p>
+For a complete list of special characters and glyphs (i.e. just
+about anything you'd ever want to appear on the printed page,
+including mathematical symbols, accented characters, unusual
+ligatures and letters unique to various European languages), consult
+<kbd>man groff_char</kbd>.
<p>
<pre>
CHARACTER ESCAPE SEQUENCE
@@ -603,7 +794,7 @@ in <strong>cstr54</strong>, available
</pre>
<hr>
-<a href="docprocessing.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="color.html#TOP">Next</a>&nbsp;&nbsp;
<a href="goodies.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="#TOP">Top</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
diff --git a/contrib/groff/contrib/mom/momdoc/intro.html b/contrib/groff/contrib/mom/momdoc/intro.html
index 40c306d7302e..4c6e3ebef747 100644
--- a/contrib/groff/contrib/mom/momdoc/intro.html
+++ b/contrib/groff/contrib/mom/momdoc/intro.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -25,6 +26,8 @@
<br>
<a href="#INTRO_DOCUMENTATION">A note on mom's documentation</a>
<br>
+<a href="#CANONICAL">Canonical reference materials</a>
+<br>
<a href="#MACRO_ARGS">How to read macro arguments</a>
<h2><a name="INTRO_INTRO"><u>Who is mom meant for?</u></a></h2>
@@ -50,7 +53,7 @@ She's aimed at three kinds of users:
started.
</ol>
<p>
-As might be infered from the above, <strong>mom</strong> is two macro
+As might be inferred from the above, <strong>mom</strong> is two macro
packages in one: a set of typesetting macros, and a set of document
processing macros. The typesetting macros govern the physical
aspects of page layout and provide sane, comprehensible control over
@@ -61,7 +64,7 @@ typesetting or page layout at all.
Because <strong>mom</strong> provides both typesetting and document
processing macros, it's safe to say she blurs the distinction between
document processing and document design. While her basic document style
-comes with pretty spiffy defaults (okay -- change &quot;spiffy&quot;
+comes with pretty spiffy defaults (okay--change &quot;spiffy&quot;
to &quot;typographically professional&quot;), you can easily control
how all the various document elements look: titles, page headers and
footers, page numbering, heads, subheads, footnotes and so on can be
@@ -72,6 +75,7 @@ read up on groff
<a href="definitions.html#TERMS_PRIMITIVES">primitives</a>
in order to accomplish what you want; the typesetting macros take
care of that.
+<p>
<a name="INTRO_TYPESETTING">
<h2><u>Typesetting with mom</u></h2>
@@ -101,13 +105,12 @@ want document processing (via the
<a href="docprocessing.html#START">START</a>
macro; see below), every macro is a literal command that remains in
effect until you modify it or turn it off. This means that if you
-want to create flyers, document covers, surveys, tabulated forms,
-curricula vitae and so on, you may do so in the good old-fashioned
-way: one step at a time with complete control over every element on
-the page.
+want to create flyers, surveys, tabulated forms, curricula vitae and
+so on, you may do so in the good old-fashioned way: one step at a
+time with complete control over every element on the page.
<p>
Years of reading various mailing lists dealing with computer
-typesetting (groff, TeX, and friends) have convinced me that no progam
+typesetting (groff, TeX, and friends) have convinced me that no program
can ever replace the human eye and human input when it comes to high
quality typesetting. As of this writing, a thread on the subject of
&quot;micro typography&quot; in groff has been going on for nearly a
@@ -117,26 +120,25 @@ rendered flawlessly by any algorithm, no matter how clever. (For
whatever it's worth, a similar problem exists with engraving musical
scores by computer.)
<p>
-<strong>Mom</strong> does not try to solve the problems posed by
-things like hanging punctuation, left-margin adjustments for those
-annoying &quot;space-y&quot; upper case letters like T and W, and
-so on. She merely tries to provide tools that allow knowledgeable
-typesetters to come up with solutions to these problems
-in ways that are somewhat easier and more intuitive than manipulating
-groff at the
-<a href="definitions.html#TERMS_PRIMITIVES">primtive</a>
+<strong>Mom</strong> does not try to solve the problems posed
+by things like hanging punctuation, left-margin adjustments for
+upper case letters like T and W, and so on. She merely tries to
+provide tools that allow knowledgeable typesetters to come up with
+solutions to these problems in ways that are easier and more
+intuitive than manipulating groff at the
+<a href="definitions.html#TERMS_PRIMITIVES">primitive</a>
level. As a professional typesetter of more than two decades, and a
writer, I have encountered few situations that cannot be handled by
<strong>mom</strong>'s typesetting macros.
<p>
<strong>Author's note:</strong> One area where groff itself needs
serious rethinking is in the matter of an algorithm that takes into
-account both word AND letter spacing when
+account both word and letter spacing when
<a href="definitions.html#TERMS_JUST">justifying</a>
lines. At present, only word spacing is adjusted, requiring what I
consider an unnecessary amount of user intervention whenever
letter spacing is required.
-
+<p>
<a name="INTRO_DOCPROCESSING">
<h2><u>Document processing with mom</u></h2>
</a>
@@ -149,7 +151,7 @@ differs is in the degree of control you have over the look and
placement of the various elements of a document. For example, if you
don't want your heads underlined, or you want them bigger/smaller,
or you'd prefer them to be in a different font, or you'd rather they
-were flush left instead of centered, you can make the changes easily
+were flush left instead of centred, you can make the changes easily
and have them apply to the whole document. Temporary and one-off
changes are easy, too.
<p>
@@ -157,13 +159,13 @@ changes are easy, too.
don't provide. For example, you can switch between draft-style and
final-copy output. If you regularly make submissions to publishers
and editors who insist on "typewritten, double-spaced," there's a
-special macro --
+special macro--
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>
--- that changes typeset documents into ones that would make your
-high-school typing teacher proud. Footnotes, multiple columns,
-recto/verso printing and user designable headers and footers are also
-part of the fun.
-
+--that changes typeset documents into ones that would make your
+high-school typing teacher proud. Footnotes, endnotes, tables of
+contents, multiple columns, nested lists, recto/verso printing and
+user designable headers and footers are also part of the fun.
+<p>
<a name="INTRO_PHILOSOPHY">
<h2><u>Mom's philosophy</u></h2>
</a>
@@ -194,8 +196,9 @@ for their special typesetting needs. Not to put too fine a point on
it, groff primitives tend toward the abstruse, and most inline escapes
are about as readable in-line as an encrypted password. This does
not make for happy-camper writers, who either find themselves stuck
-with document formatting style they don't really like, or are forced to
-learn groff from the ground up -- a daunting task, to say the least.
+with a document formatting style they don't really like, or are
+forced to learn groff from the ground up--a daunting task, to say
+the least.
<p>
<strong>Mom</strong> aims to make creating documents a simple matter,
but with no corresponding loss of user control. The document
@@ -220,8 +223,7 @@ produce output that looks good no matter where it's displayed.
She's designed for printed output, although with
<a href="#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>
she produces acceptable terminal copy. She makes no attempt to be
-compatible with older versions of troff. And she remains largely
-untested with the groff preprocessors (tbl, pic, eqn, etc.)
+compatible with older versions of troff.
<p>
One special feature in <strong>mom</strong>'s design is the attention
she pays to aligning the bottom margins of every page. Nothing screams
@@ -233,7 +235,7 @@ bottom of the page without some text underneath it), but in all cases
where hanging bottom margins can be avoided, <strong>mom</strong> does
avoid them, by clever adjustments to leading (&quot;line spacing&quot;)
and the spacing between different elements on the page.
-
+<p>
<a name="INTRO_DOCUMENTATION">
<h2><u>A note on mom's documentation</u></h2>
</a>
@@ -249,40 +251,54 @@ that gets tossed.
<strong>Mom</strong>'s documentation assumes users know their way
around GNU/Linux. It further assumes they at least know what groff
is, even if they don't know much about it. Lastly, it assumes that
-everyone -- groff newbies and experts alike -- learns faster from
+everyone--groff newbies and experts alike--learns faster from
a few well-placed examples than from manpage-style reference docs.
What <strong>mom</strong>'s documentation doesn't assume is that
-you know everything -- not about groff, not about typesetting,
+you know everything--not about groff, not about typesetting,
not about document processing. Even experts have odd lacunae in
their knowledge base. Therefore, whenever I suspect that a term
or procedure will cause head scratching, I offer an explanation.
And when explanations aren't enough, I offer examples.
-<a name="CANONICAL"></a>
+<br>
+
+<a name="CANONICAL"><h3><u>Canonical reference materials</u></h3></a>
<p>
-The canonical reference materials for groff are <strong>cstr54</strong>
-(a downloadable PostScript copy of which is available
+The canonical reference materials for groff are
+<strong>cstr54</strong> (a downloadable PostScript copy of which is
+available
<a href="http://www.kohala.com/start/troff/">here</a>)
-and the <strong>troff</strong> and <strong>groff_diff</strong> manpages.
-I've tried to avoid reiterating them, however, in a few places, this has
-proved impossible. Be forewarned: I have no qualms about sidestepping
-excrutiating completeness about groff usage; I'm more concerned with
-getting <strong>mom</strong> users up and running. <em>Mea culpa.</em>
+and the <strong>troff</strong> and <strong>groff_diff</strong>
+manpages. Another excellent source of information (maybe the best)
+is the groff <strong>info</strong> pages, available by typing
+<p>
+<pre>
+ info groff
+</pre>
+
+at the command line (assuming you have <strong>info</strong>
+installed on your system). And for inputting special characters,
+see <strong>man groff_char.</strong>
+<p>
+I've tried to avoid reiterating the information contained in these
+documents; however, in a few places, this has proved impossible.
+But be forewarned: I have no qualms about sidestepping excruciating
+completeness concerning groff usage; I'm more interested in getting
+<strong>mom</strong> users up and running. <em>Mea culpa.</em>
<p>
<strong>Note:</strong> <strong>Mom</strong>'s macro file
(om.tmac) is heavily commented. Each macro is preceded by a
-description of its arguments, function, and usage, which may
+description of its arguments, function and usage, which may
give you information in addition to what's contained in this
documentation.
-
+<p>
<a name="MACRO_ARGS">
<h3><u>How to read macro arguments</u></h3>
</a>
-<p>
The concise descriptions of macros in this documentation typically
look like this:
<blockquote>
-Macro: <strong>NAME</strong> <var>arguments</var>
+Macro: <strong>NAME</strong> <nobr>arguments</nobr>
</blockquote>
<var>arguments</var> lists the macro's arguments using conventions that
should be familiar to anyone who has ever read a manpage. Briefly:
@@ -299,7 +315,7 @@ should be familiar to anyone who has ever read a manpage. Briefly:
which means &quot;or.&quot;
<li>Arguments that are optional are surrounded by square brackets.
<li>&lt;off&gt; in an argument list means that any argument
- turns the macro off.
+ other than those in the argument list turns the macro off.
</ol>
<a name="TOGGLE_MACRO"><h3><u>Toggle macros</u></h3></a>
@@ -313,14 +329,16 @@ it could even be I_LOVE_MOM.
Since these macros toggle things on and off, the argument list
simply reads
<blockquote>
-<var>toggle</var>
+<nobr>toggle</nobr>
</blockquote>
+<br>
<hr>
<h3>Example 1: an argument requiring double-quotes</h3>
<blockquote>
-Macro: <strong>TITLE</strong> <var>&quot;&lt;title of document&gt;&quot;</var>
+Macro: <strong>TITLE</strong> <nobr>&quot;&lt;title of document&gt;&quot;</nobr>
</blockquote>
+<p>
The required argument to <strong>TITLE</strong> is the title of your
document. Since it's surrounded by double-quotes, you must
include them in the argument, like this:
@@ -331,8 +349,9 @@ include them in the argument, like this:
<h3>Example 2: a macro with required and optional arguments</h3>
<blockquote>
-Macro: <strong>TAB_SET</strong> <var>&lt;tab #&gt; &lt;indent&gt; &lt;length&gt; [ L | R | C | J [ QUAD ] ]</var>
+Macro: <strong>TAB_SET</strong> <nobr>&lt;tab #&gt; &lt;indent&gt; &lt;length&gt; [ L | R | C | J [ QUAD ] ]</nobr>
</blockquote>
+<p>
The first required argument is a number that identifies the tab (say,
"3"). The second required argument is an indent from the left margin
(say, 6 picas). The third required argument is the length of the tab
@@ -355,12 +374,12 @@ you could enter:
.TAB_SET 3 6P 3P L QUAD
</pre>
-<a name="TOGGLE_EXAMPLE"><h3>Example 3: a sample toggle macro:</h3></a>
-
+<a name="TOGGLE_EXAMPLE"></a>
+<h3>Example 3: a sample toggle macro:</h3>
<blockquote>
-Macro: <strong>QUOTE</strong> <var>toggle</var>
+Macro: <strong>QUOTE</strong> <nobr>toggle</nobr>
</blockquote>
-
+<p>
<strong>QUOTE</strong> begins a section of quoted text in a document
and doesn't require an argument. When the quote's finished,
you have to tell <strong>mom</strong> it's done.
diff --git a/contrib/groff/contrib/mom/momdoc/letters.html b/contrib/groff/contrib/mom/momdoc/letters.html
index a344f4c61b36..ad35a7118950 100644
--- a/contrib/groff/contrib/mom/momdoc/letters.html
+++ b/contrib/groff/contrib/mom/momdoc/letters.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -7,9 +8,10 @@
<!====================================================================>
-<a href="typemacdoc.html#TOP">Next</a>&nbsp;&nbsp;
-<a href="cover.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="macrolist.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="refer.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
+<p>
<a name="TOP"></a>
<a name="LETTERS">
@@ -33,11 +35,11 @@ to design correspondence to your own specifications. However,
flexibility in the matter of letters, which are, after all, simple
communicative documents whose only real style requirements are that
they be neat and professional-looking.
-
+<p>
<a name="TUTORIAL"><h2><u>Tutorial on writing letters</u></h2></a>
-
-<strong>Mom</strong> letters begin, like all <strong>mom</strong>
-processed documents, with a
+<p>
+<strong>Mom</strong> letters begin, like all
+<strong>mom</strong>-processed documents, with a
<a href="docprocessing.html#REFERENCE_MACROS">reference macro</a>
(in this case,
<a href="docprocessing.html#AUTHOR">AUTHOR</a>),
@@ -46,7 +48,8 @@ a
(<strong>LETTER</strong>, obviously), the essential
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE</a>
macro, and
-<a href="docprocessing.html#START">START</a>.
+<a href="docprocessing.html#START">START</a>,
+like this:
<p>
<pre>
.AUTHOR "Yannick P. Guique"
@@ -58,30 +61,40 @@ macro, and
<strong>PRINTSTYLE</strong>, above, could also be
<strong>TYPEWRITE</strong>. <strong>Mom</strong> has no objection
to creating letters that look like they were typed on an Underwood
-by a shapely secretary with great gams back in the 1940s.
+by a shapely secretary with 1940s gams.
<p>
-After the <strong>START</strong> macro, you enter data pertinent to
+After the <strong>START</strong> macro, you enter headers pertinent to
your letter: the date, the addressee (in business correspondence,
-typically both name and address), the addressor (that's you; in
+typically both name and address), the addresser (that's you; in
business correspondence, typically both name and address), and a
-greeting (in full, e.g. &quot;Dear Mr. Smith,&quot;).
+greeting (in full, e.g. &quot;Dear Mr. Smith,&quot; or &quot;Dear
+Mr. Smith:&quot;).
<p>
-The macros for entering the data are simple (they're not even
-<a href="definitions.html#TERMS_TOGGLE">toggles</a>)
-and entered in an intuitive order.
-<br>
-<ol>
- <li><code>.DATE</code>
- <li><code>.TO</code>
- <li><code>.FROM</code>
- <li><code>.GREETING</code>
-</ol>
+The macros for entering the headers are simple (they're not even
+<a href="definitions.html#TERMS_TOGGLE">toggles</a>):
+<p>
+<pre>
+ .DATE
+ .TO
+ .FROM
+ .GREETING
+</pre>
+
+You may enter them in any order you like, except for
+<strong>GREETING</strong>, which must come last.
+<strong>Mom</strong> ignores any headers you omit and spaces the
+letter's opening according to what you do include. See
+<a href="#LETTERS_DEFAULTS">Default for letters</a>
+to find out how <strong>mom</strong> formats the headers.
<p>
-<strong>Mom</strong> ignores any you omit and spaces the letter's
-opening according to what you do include.
+(In pre 1.1.7-a releases of <strong>mom</strong>, the order
+of entry was fixed at the above. This has been changed, although
+if you do follow the above order, <strong>mom</strong> will
+continue to behave exactly as she did in pre 1.1.7-a.)
<p>
Once you've filled in what you need to get a letter started, simply
-type the letter, introducing each and every paragraph with the
+type the letter, introducing each and every paragraph, including
+the first, with the
<a href="docelement.html#PP">PP</a>
macro.
<p>
@@ -132,19 +145,79 @@ here's what the complete letter looks like.
.CLOSING
Sincerely,
</pre>
+
+This produces a letter with headers that follow the North American
+standard for business correspondence. If you'd prefer another
+style of correspondence, for example, British, you'd set up the
+same letter like this:
+<p>
+<pre>
+ .AUTHOR "Yannick P. Guique"
+ .DOCTYPE LETTER
+ .PRINTSTYLE TYPESET
+ .START
+ .FROM
+ .RIGHT
+ Y.P. GUIQUE
+ 022 Umask Road
+ St-Sauveur-en-dehors-de-la-mappe, Québec
+ .TO
+ GUILLAUME BARRIÈRES
+ Minidoux Corporation
+ 5000 Pannes Drive
+ Redmond, Virginia
+ .DATE
+ .RIGHT
+ August 25, 2004
+ .GREETING
+ Dear Mr. Barrières,
+</pre>
+
+Notice the use of <strong>.RIGHT</strong> after
+<strong>.FROM</strong> and <strong>.DATE</strong> in this example,
+used to change the default quad for these macros.
+<p>
<hr>
<a name="LETTERS_DEFAULTS">
<h2><u>Defaults for letters</u></h2>
</a>
-In letters, <strong>mom</strong> sets:
+In letters, if the order of header macros is
<p>
+<pre>
+ .DATE
+ .TO
+ .FROM
+ .GREETING
+</pre>
+
+<strong>mom</strong> sets
+<br>
<ol>
- <li>the date flush right, page right, at the top of page one
- <li>the addressee in a block flush left, page left
- <li>the addressor in a block flush left, page left
- <li>the greeting flush left
+ <li>the date flush right, page right, at the top of page one,
+with a gap of two linespaces underneath
+ <li>the addressee in a block flush left, page left, with a gap of
+one linespace underneath
+ <li>the addresser in a block flush left, page left, with a gap of
+one linespace underneath
+ <li>the greeting flush left, with a gap of one linespace
+underneath
+</ol>
+<p>
+which is the standard for North American business correspondence.
+<p>
+If you switch the order of <strong>.DATE</strong>,
+<strong>.TO</strong> and/or <strong>.FROM</strong>,
+<strong>mom</strong> sets all the headers flush left, with a gap of
+one linespace underneath each. (The default left quad of any header
+can be changed by invoking the <strong>.RIGHT</strong> macro, on
+a line by itself, immediately before inputting the text of the
+header.)
+<p>
+Following the headers, <strong>mom</strong> sets
+<p>
+<ul>
<li>the body of the letter justified
<li>in multi-page letters:
<ul>
@@ -152,7 +225,7 @@ In letters, <strong>mom</strong> sets:
<li>the page number at the top of every page after page one
</ul>
<li>the closing/signature line flush left, indented halfway across the page
-</ol>
+</ul>
<p>
Other important style defaults are listed below, and may be changed
via the
@@ -185,7 +258,7 @@ Spaced paragraphs yes no
Footers* yes yes
Footer margin 3 picas 3 picas
Footer gap 3 picas 3 picas
-Page numbers top, centered top, centered
+Page numbers top, centred top, centred
*Footers contain a &quot;next page&quot; number of the form .../#
</pre>
@@ -207,6 +280,7 @@ except <strong>NO_SUITE</strong>.
<li><a href="#CLOSING">CLOSING</a>
<li><a href="#NO_SUITE">NO_SUITE</a> -- &quot;next page&quot; number off
</ul>
+<br>
<!---DATE--->
@@ -224,6 +298,29 @@ underneath, like this:
October 31, 2002
</pre>
+If you wish to change the default quad direction for the date,
+enter <kbd>.LEFT</kbd> or <kbd>.RIGHT</kbd>, on a line by itself,
+immediately after <kbd>.DATE</kbd>.
+<p>
+If you wish to insert additional space between the date and any
+letter header that comes after it, do so after inputting the date,
+not at the top of the next header macro, like this:
+<p>
+<pre>
+ .DATE
+ October 31, 2002
+ .SPACE \" Or, more simply, .SP
+</pre>
+
+If you wish to remove the default space,
+<p>
+<pre>
+ .SPACE -1v \" Or, more simply, .SP -1v
+</pre>
+
+will do the trick.
+<p>
+
<!---TO--->
<hr width="66%" align="left">
@@ -242,6 +339,31 @@ and address of the addressee underneath, like this:
Bramladesh, Ont.
</pre>
+If you wish to change the default quad direction for the address,
+enter <kbd>.LEFT</kbd> or <kbd>.RIGHT</kbd>, on a line by itself,
+immediately after <kbd>.TO</kbd>.
+<p>
+If you wish to insert additional space between the address and
+any letter header that comes after it, do so after inputting the
+address, not at the top of the next header macro, like this:
+<p>
+<pre>
+ .TO
+ JOHN SMITH
+ 10 Roberts Crescent
+ Bramladesh, Ont.
+ .SPACE \" Or, more simply, .SP
+</pre>
+
+If you wish to remove the default space,
+<p>
+<pre>
+ .SPACE -1v \" Or, more simply, .SP -1v
+</pre>
+
+will do the trick.
+<p>
+
<!---FROM--->
<hr width="66%" align="left">
@@ -251,7 +373,7 @@ Macro: <strong>FROM</strong>
<p>
Invoke <strong>FROM</strong> on a line by itself, with the name
-and address of the addressor underneath, like this:
+and address of the addresser underneath, like this:
<p>
<pre>
.FROM
@@ -260,6 +382,31 @@ and address of the addressor underneath, like this:
Ste-Vieille-Andouille, Québec
</pre>
+If you wish to change the default quad direction for the address,
+enter <kbd>.LEFT</kbd> or <kbd>.RIGHT</kbd>, on a line by itself,
+immediately after <kbd>.FROM</kbd>.
+<p>
+If you wish to insert additional space between the address and
+any letter header that comes after it, do so after inputting the
+address, not at the top of the next header macro, like this:
+<p>
+<pre>
+ .FROM
+ JOE BLOW
+ 15 Brunette Road
+ Ste-Vieille-Andouille, Québec
+ .SPACE \" Or, more simply, .SP
+</pre>
+
+If you wish to remove the default space,
+<p>
+<pre>
+ .SPACE -1v \" Or, more simply, .SP -1v
+</pre>
+
+will do the trick.
+<p>
+
<!---GREETING--->
<hr width="66%" align="left">
@@ -308,8 +455,8 @@ page&quot; number at the bottom of multi-page letters, invoke
<p>
<hr>
-<a href="typemacdoc.html#TOP">Next</a>&nbsp;&nbsp;
-<a href="cover.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="macrolist.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="refer.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="#TOP">Top</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
</body>
diff --git a/contrib/groff/contrib/mom/momdoc/macrolist.html b/contrib/groff/contrib/mom/momdoc/macrolist.html
new file mode 100644
index 000000000000..01125f72e08d
--- /dev/null
+++ b/contrib/groff/contrib/mom/momdoc/macrolist.html
@@ -0,0 +1,1794 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<title>Mom -- Quick reference guide</title>
+</head>
+<body bgcolor="#dfdfdf">
+
+<!====================================================================>
+
+<a href="appendices.html#MOREDOC">Next</a>&nbsp;&nbsp;
+<a href="typemacdoc.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="toc.html">Back to Table of Contents</a>
+
+<a name="TOP"></a>
+<h1 align="center">
+ <a name="QUICK">Quick reference guide</a>
+</h1>
+
+Once you know your way around <strong>mom</strong>, you may find
+this guide preferable to using the Table of Contents. It lists (I
+hope) all <strong>mom</strong>'s user-space macros. The links
+point to references found elsewhere in the documentation.
+<p>
+<strong>NOTE:</strong> This guide uses tables extensively. Better
+make sure you're reading it in a browser that renders them
+sensibly.
+<p>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Typesetting</th>
+ <th>Document processing</th>
+</tr>
+<tr>
+ <td><a href="#1">Page/paper size; margins; line length</a></td>
+ <td><a href="#21">Reference macros</a></td>
+</tr>
+<tr>
+ <td><a href="#2">Family/font; pointsize; leading</a></td>
+ <td><a href="#22">Letters</a></td>
+</tr>
+<tr>
+ <td><a href="#3">Font modifications</a></td>
+ <td><a href="#23">Document style</a></td>
+</tr>
+<tr>
+ <td><a href="#4">Underscoring and underlining</a></td>
+ <td><a href="#24">Special to PRINTSTYLE TYPEWRITE</a></td>
+</tr>
+<tr>
+ <td><a href="#5">Colour</a></td>
+ <td><a href="#25">Begin document processing</a></td>
+</tr>
+<tr>
+ <td><a href="#6">Quad, justification and fill</a></td>
+ <td><a href="#26">Customizing the document header</a></td>
+</tr>
+<tr>
+ <td><a href="#7">Line termination</a></td>
+ <td><a href="#27">Pagination</a></td>
+</tr>
+<tr>
+ <td><a href="#8">Hyphenation</a></td>
+ <td><a href="#28">Recto/verso</a></td>
+</tr>
+<tr>
+ <td><a href="#9">Word and sentence spacing</a></td>
+ <td><a href="#29">Automatic columns</a></td>
+</tr>
+<tr>
+ <td><a href="#10">Kerning; ligatures</a></td>
+ <td><a href="#30">Epigraphs</a></td>
+</tr>
+<tr>
+ <td><a href="#11">Vertical movements</a></td>
+ <td><a href="#31">Heads</a></td>
+</tr>
+<tr>
+ <td><a href="#12">Horizontal movements</a></td>
+ <td><a href="#32">Subheads</a></td>
+</tr>
+<tr>
+ <td><a href="#13">Indents</a></td>
+ <td><a href="#33">Paragraph heads</a></td>
+</tr>
+<tr>
+ <td><a href="#14">Tabs</a></td>
+ <td><a href="#34">Paragraphs</a></td>
+</tr>
+<tr>
+ <td><a href="#15">Manual columns</a></td>
+ <td><a href="#35">Quotes</a></td>
+</tr>
+<tr>
+ <td><a href="#16">Superscripts</a></td>
+ <td><a href="#36">Blockquotes</a></td>
+</tr>
+<tr>
+ <td><a href="#17">Dropcaps</a></td>
+ <td><a href="#37">Author linebreaks</a></td>
+</tr>
+<tr>
+ <td><a href="#18">Lists</a></td>
+ <td><a href="#38">Footnotes</a></td>
+</tr>
+<tr>
+ <td><a href="#19">Padding lines</a></td>
+ <td><a href="#39">Endnotes</a></td>
+</tr>
+<tr>
+ <td><a href="#20">Miscellaneous</a></td>
+ <td><a href="#40">Designing endnotes pages</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#18">Lists</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#51">Margin notes</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#52">Line numbering</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#54">References</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#55">Bibliographies</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#41">Table of contents</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#42">Designing a table of contents</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#43">Finis</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#44">Headers and footers</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#45">Part-by-part control
+ <br>of headers</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#46">Footers</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#47">Covers and doc covers</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#48">Customizing covers
+ <br>and doc covers</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#49">Part-by-part control of
+ <br>covers and doc covers</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="#50">Miscellaneous</a></td>
+</tr>
+</table>
+
+<br>
+<hr>
+<h2 align="center"><u>Typesetting macros</u></h2>
+
+<a name="1"><h3 align="center">Page/paper size; margins; line length</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Page/paper size</th>
+ <th>Margins</th>
+ <th>Line length</th>
+</tr>
+<tr>
+ <td><a href="typesetting.html#PAGEWIDTH">PAGEWIDTH</a></td>
+ <td><a href="typesetting.html#T_MARGIN">T_MARGIN</a></td>
+ <td><a href="typesetting.html#LINELENGTH">LL</a></td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#PAGELENGTH">PAGELENGTH</a></td>
+ <td><a href="typesetting.html#B_MARGIN">B_MARGIN</a></td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#PAPER">PAPER</a></td>
+ <td><a href="typesetting.html#L_MARGIN">L_MARGIN</a></td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#PAGE">PAGE</a></td>
+ <td><a href="typesetting.html#R_MARGIN">R_MARGIN</a></td>
+ <td>&nbsp;</td>
+</table>
+
+<a name="2"><h3 align="center">Family/font; pointsize; leading</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Family/font</th>
+ <th>Point size</th>
+ <th>Leading</th>
+</tr>
+<tr>
+ <td><a href="typesetting.html#FAMILY">FAMILY</a></td>
+ <td><a href="typesetting.html#PS">PT_SIZE</a></td>
+ <td><a href="typesetting.html#LEADING">LS</a></td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#FONT">FT</a></td>
+ <td><a href="inlines.html#INLINE_SIZE_MOM">\*[SIZE n]</a></td>
+ <td><a href="typesetting.html#AUTOLEAD">AUTOLEAD</a></td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#FALLBACK_FONT">FALLBACK_FONT</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+
+<a name="3"><h3 align="center">Font modifications (pseudo-italic, -bold, -condensed, -extended)</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Italicize</th>
+ <th>Embolden</th>
+ <th>Condense</th>
+ <th>Extend</th>
+</tr>
+<tr>
+ <td><a href="typesetting.html#SETSLANT">SETSLANT</a></td>
+ <td><a href="typesetting.html#SETBOLDER">SETBOLDER</a></td>
+ <td><a href="typesetting.html#CONDENSE">CONDENSE</a></td>
+ <td><a href="typesetting.html#EXTEND">EXTEND</a></td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#SLANT_INLINE">\*[SLANT]</a></td>
+ <td><a href="typesetting.html#BOLDER_INLINE">\*[BOLDER]</a></td>
+ <td><a href="typesetting.html#COND_INLINE">\*[COND]</a></td>
+ <td><a href="typesetting.html#EXT_INLINE">\*[EXT]</a></td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#SLANT_INLINE">\*[SLANTX]</a></td>
+ <td><a href="typesetting.html#BOLDER_INLINE">\*[BOLDERX]</a></td>
+ <td><a href="typesetting.html#COND_INLINE">\*[CONDX]</a></td>
+ <td><a href="typesetting.html#EXT_INLINE">\*[EXTX]</a></td>
+</tr>
+</table>
+
+<a name="4"><h3 align="center">Underscoring and underlining</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Underscore</th>
+ <th>Underline</th>
+</tr>
+<tr>
+ <td><a href="goodies.html#UNDERSCORE">UNDERSCORE</a></td>
+ <td><a href="goodies.html#UNDERLINE">UNDERLINE</a></td>
+</tr>
+<tr>
+ <td><a href="goodies.html#UNDERSCORE2">UNDERSCORE_2</a></td>
+ <td><a href="goodies.html#UL">\*[UL]...\*[ULX]</a></td>
+</tr>
+</table>
+
+<a name="5"><h3 align="center">Colour</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Define colours</th>
+ <th>Invoke colours</th>
+</tr>
+<tr>
+ <td><a href="color.html#NEWCOLOR">NEWCOLOR</a></td>
+ <td><a href="color.html#COLOR">COLOR</a></td>
+</tr>
+<tr>
+ <td><a href="color.html#XCOLOR">XCOLOR</a></td>
+ <td><a href="color.html#COLOR_INLINE">\*[&lt;colorname&gt;]</a></td>
+</table>
+
+<a name="6"><h3 align="center">Quad, justification and fill</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Fill modes</th>
+ <th>No-fill modes</th>
+</tr>
+<tr>
+ <td><a href="typesetting.html#JUSTIFY">JUSTIFY</a></td>
+ <td><a href="typesetting.html#LRC">LEFT</a></td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#QUAD">QUAD</a></td>
+ <td><a href="typesetting.html#LRC">CENTER</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="typesetting.html#LRC">RIGHT</a></td>
+</tr>
+</table>
+
+<a name="7"><h3 align="center">Line termination</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Break</th>
+ <th>Break (no space)</th>
+ <th>Break (extra space)</th>
+ <th>Break (force justify)</th>
+</tr>
+<tr align="center">
+ <td><a href="typesetting.html#BR">BR</a></td>
+ <td><a href="typesetting.html#EL">EL</a></td>
+ <td><a href="typesetting.html#SPACE">SPACE</a></td>
+ <td><a href="typesetting.html#SPREAD">SPREAD</a></td>
+</tr>
+</table>
+
+<a name="8"><h3 align="center">Hyphenation</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Enable</th>
+ <th>Set parameters</th>
+</tr>
+<tr align="center">
+ <td><a href="typesetting.html#HY">HY</a></td>
+ <td><a href="typesetting.html#HY_SET">HY_SET</a></td>
+</tr>
+</table>
+
+<a name="9"><h3 align="center">Word and sentence spacing</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Word space</th>
+ <th>Sentence space</th>
+</tr>
+<tr align="center">
+ <td><a href="typesetting.html#WS">WS</a></td>
+ <td><a href="typesetting.html#SS">SS</a></td>
+</tr>
+</table>
+
+<a name="10"><h3 align="center">Character pair and full line kerning; ligatures</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Kern character pairs</th>
+ <th>Kern full lines</th>
+ <th>Ligatures</th>
+</tr>
+<tr>
+ <td><a href="typesetting.html#KERN">KERN</a></td>
+ <td><a href="typesetting.html#RW">RW</a></td>
+ <td><a href="typesetting.html#LIGATURES">LIGATURES</a></td>
+</tr>
+<tr>
+ <td><a href="inlines.html#INLINE_KERNING_MOM">\*[BU n]</a>
+ <td><a href="typesetting.html#EW">EW</a></td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="inlines.html#INLINE_KERNING_MOM">\*[FU n]</a>
+ <td><a href="typesetting.html#BR_AT_LINE_KERN">BR_AT_LINE_KERN</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+
+<a name="11"><h3 align="center">Vertical movements</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Down</th>
+ <th>Up</th>
+</tr>
+<tr>
+ <td><a href="typesetting.html#ALD">ALD</a></td>
+ <td><a href="typesetting.html#RLD">RLD</a></td>
+</tr>
+<tr>
+ <td><a href="inlines.html#DOWN">\*[DOWN n]</a></td>
+ <td><a href="inlines.html#UP">\*[UP n]</a></td>
+</tr>
+</table>
+
+<a name="12"><h3 align="center">Horizontal movements</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Forward</th>
+ <th>Back</th>
+</tr>
+<tr align="center">
+ <td><a href="inlines.html#FWD">\*[FWD n]</a></td>
+ <td><a href="inlines.html#BCK">\*[BCK n]</a></td>
+</tr>
+</table>
+
+<a name="13"><h3 align="center">Indents</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Left</th>
+ <th>Right</th>
+ <th>Both</th>
+ <th>Quit</th>
+ <th>Temp</th>
+ <th>Hanging</th>
+</tr>
+<tr>
+ <td><a href="typesetting.html#IL">IL</a></td>
+ <td><a href="typesetting.html#IR">IR</a></td>
+ <td><a href="typesetting.html#IB">IB</a></td>
+ <td align="center"><a href="typesetting.html#IQ">IQ</a></td>
+ <td align="center"><a href="typesetting.html#TI">TI</a></td>
+ <td align="center"><a href="typesetting.html#HI">HI</a></td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#IQ">ILX</a></td>
+ <td><a href="typesetting.html#IQ">IRX</a></td>
+ <td><a href="typesetting.html#IQ">IBX</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+
+<a name="14"><h3 align="center">Tabs</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Setup</th>
+ <th>Invoking</th>
+ <th>Quitting</th>
+</tr>
+<tr>
+ <td><a href="typesetting.html#TAB_SET">TAB_SET</a></td>
+ <td align="center"><a href="typesetting.html#TAB">TAB</a></td>
+ <td align="center"><a href="typesetting.html#TQ">TQ</a></td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#INLINE_ST">\*[STn]...\*[STnX]</a></td>
+ <td align="center"><a href="typesetting.html#TN">TN</a></td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="typesetting.html#ST">ST</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+
+<a name="15"><h3 align="center">Manual columns</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Initializing</th>
+ <th>Returning to top</th>
+ <th>Exiting</th>
+</tr>
+<tr align="center">
+ <td><a href="typesetting.html#MCO">MCO</a></td>
+ <td><a href="typesetting.html#MCR">MCR</a></td>
+ <td><a href="typesetting.html#MCX">MCX</a></td>
+</tr>
+</table>
+
+<a name="16"><h3 align="center">Superscripts</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Superscript</th>
+ <th>Condensed superscript</th>
+ <th>Extended superscript</th>
+</tr>
+<tr>
+ <td><a href="goodies.html#SUP">\*[SUP]...\*[SUPX]</a></td>
+ <td><a href="goodies.html#SUP">\*[CONDSUP]...\*[CONDSUPX]</a></td>
+ <td><a href="goodies.html#SUP">\*[EXTSUP]...\*[EXTSUPX]</a></td>
+</tr>
+</table>
+
+<a name="17"><h3 align="center">Dropcaps</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Invoking</th>
+ <th>Dropcap control</th>
+</tr>
+<tr>
+ <td><a href="goodies.html#DROPCAP">DROPCAP</a></td>
+ <td><a href="goodies.html#DROPCAP_FAMILY">DROPCAP_FAMILY</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="goodies.html#DROPCAP_FONT">DROPCAP_FONT</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="goodies.html#DROPCAP_COLOR">DROPCAP_COLOR</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="goodies.html#DROPCAP_ADJUST">DROPCAP_ADJUST</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="goodies.html#DROPCAP_GUTTER">DROPCAP_GUTTER</a></td>
+</tr>
+</table>
+
+<a name="18"><h3 align="center">Lists</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Initializing</th>
+ <th>Setting items</th>
+ <th>List control</th>
+</tr>
+<tr>
+ <td align="center"><a href="docelement.html#LIST">LIST</a></td>
+ <td align="center"><a href="docelement.html#ITEM">ITEM</a></td>
+ <td><a href="docelement.html#SHIFT_LIST">SHIFT_LIST</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html##RESET_LIST">RESET_LIST</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="#PAD_LIST_DIGITS">PAD_LIST_DIGITS</a></td>
+</tr>
+</table>
+
+<a name="19"><h3 align="center">Padding lines</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr align="center">
+ <th>Pad a line</th>
+ <th>Change the pad marker</th>
+</tr>
+<tr align="center">
+ <td><a href="goodies.html#PAD">PAD</a></td>
+ <td><a href="goodies.html#PAD_MARKER">PAD_MARKER</a></td>
+</tr>
+</table>
+
+<a name="20"><h3 align="center">Miscellaneous</h3>
+
+<table align="center" valign="center" border=1 cellpadding="6">
+<tr align="center">
+ <th>Newpage</th>
+ <th>All caps</th>
+ <th>Smartquotes</th>
+ <th>Rules/leaders</th>
+</tr>
+<tr align="center">
+ <td><a href="typesetting.html#NEWPAGE">NEWPAGE</a></td>
+ <td><a href="goodies.html#CAPS">CAPS</a></td>
+ <td><a href="goodies.html#SMARTQUOTES">SMARTQUOTES</a></td>
+ <td align="left"><a href="inlines.html#INLINE_RULE_MOM">\*[RULE]</a></td>
+</tr>
+<tr align="left">
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="goodies.html#LEADER">\*[LEADER]</a></td>
+</tr>
+<tr align="left">
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="goodies.html#LEADER_CHARACTER">LEADER_CHARACTER</a></td>
+</tr>
+</table>
+<br>
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Change the escape character</th>
+ <th>Suppress input</th>
+ <th>Disable traps</th>
+</tr>
+<tr align="center">
+ <td><a href="docelement.html#QUOTE_TIP">ESC_CHAR</a></td>
+ <td><a href="goodies.html#SILENT">COMMENT</a></td>
+ <td><a href="goodies.html#TRAP">TRAP</a></td>
+</tr>
+<tr align="center">
+ <td>&nbsp;</td>
+ <td><a href="goodies.html#SILENT">SILENT</a></td>
+ <td>&nbsp;</td>
+</tr>
+</tr>
+</table>
+
+<br>
+<hr>
+
+<h2 align="center"><u>Document processing</u></h2>
+
+<a name="21"><h3 align="center">Reference macros</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Titles</th>
+ <th>Authors</th>
+ <th>Draft copies</th>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#TITLE">TITLE</a></td>
+ <td><a href="docprocessing.html#AUTHOR">AUTHOR</a></td>
+ <td><a href="docprocessing.html#DRAFT">DRAFT</a></td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#SUBTITLE">SUBTITLE</a></td>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#REVISION">REVISION</a></td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#DOCTITLE">DOCTITLE</a></td>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#DRAFT_STRING">DRAFT_STRING</a></td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#CHAPTER">CHAPTER</a></td>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#REVISION_STRING">REVISION_STRING</a></td>
+</tr>
+</table>
+
+<a name="22"><h3 align="center">Letters</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Headers</th>
+ <th>Closing</th>
+ <th>Control</th>
+</tr>
+<tr>
+ <td><a href="letters.html#DATE">DATE</a></td>
+ <td><a href="letters.html#CLOSING">CLOSING</a></td>
+ <td><a href="letters.html#NO_SUITE">NO_SUITE</a></td>
+</tr>
+<tr>
+ <td><a href="letters.html#FROM">FROM</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="letters.html#TO">TO</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="letters.html#GREETING">GREETING</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+
+<a name="23"><h3 align="center">Document style</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Basic style</th>
+ <th>Style control*</th>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#COPYSTYLE">COPYSTYLE</a></td>
+ <td><a href="docprocessing.html#DOC_LEFT_MARGIN">DOC_LEFT_MARGIN</a></td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#DOCTYPE">DOCTYPE</a></td>
+ <td><a href="docprocessing.html#DOC_RIGHT_MARGIN">DOC_RIGHT_MARGIN</a></td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE</a>**</td>
+ <td><a href="docprocessing.html#DOC_LINE_LENGTH">DOC_LINE_LENGTH</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#DOC_FAMILY">DOC_FAMILY</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#DOC_PT_SIZE">DOC_PT_SIZE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#DOC_LEAD">DOC_LEAD</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#DOC_LEAD_ADJUST">DOC_LEAD_ADJUST</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#DOC_QUAD">DOC_QUAD</a></td>
+</tr>
+</table>
+<p align="center">
+*See the note
+<a href="docprocessing.html#DOC_PARAM_MACROS">Changing document-wide style parameters after START</a>
+<br>
+**Absolutely required if you wish to use the document processing macros.
+
+<a name="24"><h3 align="center">Special to PRINTSTYLE TYPEWRITE</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Italic/underlining</th>
+ <th>Quotes</th>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#TYPEWRITE_CONTROL">UNDERLINE_ITALIC</a></td>
+ <td><a href="docprocessing.html#UNDERLINE_QUOTES">UNDERLINE_QUOTES</a></td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#TYPEWRITE_CONTROL">ITALIC_MEANS_ITALIC</a></td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#TYPEWRITE_CONTROL">UNDERLINE_SLANT</a></td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#TYPEWRITE_CONTROL">SLANT_MEANS_SLANT</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+
+<a name="25"><h3 align="center">Begin document processing</h3></a>
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Absolutely required in order to initialize document processing</th>
+</tr>
+<tr>
+ <td align="center"><a href="docprocessing.html#START">START</a></td>
+</tr>
+</table>
+
+<a name="26"><h3 align="center">Customizing the document header</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="8">
+<tr>
+ <th>Global</th>
+ <th>Title</th>
+ <th>Subtitle</th>
+ <th>Chapter</th>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#DOCHEADER">DOCHEADER</a></td>
+ <td><a href="docprocessing.html#CHANGE_FAMILY">TITLE_FAMILY</a></td>
+ <td><a href="docprocessing.html#CHANGE_FAMILY">SUBTITLE_FAMILY</a></td>
+ <td><a href="docprocessing.html#CHAPTER_STRING">CHAPTER_STRING</a></td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#CHANGE_START">DOCHEADER_ADVANCE</a></td>
+ <td><a href="docprocessing.html#CHANGE_FONT">TITLE_FONT</a></td>
+ <td><a href="docprocessing.html#CHANGE_FONT">SUBTITLE_FONT</a></td>
+ <td><a href="docprocessing.html#CHANGE_FAMILY">CHAPTER_TITLE_FAMILY</a></td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#DOCHEADER_FAMILY">DOCHEADER_FAMILY</a></td>
+ <td><a href="docprocessing.html#CHANGE_SIZE">TITLE_SIZE</a></td>
+ <td><a href="docprocessing.html#CHANGE_SIZE">SUBTITLE_SIZE</a></td>
+ <td><a href="docprocessing.html#CHANGE_FONT">CHAPTER_TITLE_FONT</a></td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#DOCHEADER_COLOR">DOCHEADER_COLOR</a></td>
+ <td><a href="docprocessing.html#CHANGE_COLOR">TITLE_COLOR</a></td>
+ <td><a href="docprocessing.html#CHANGE_COLOR">SUBTITLE_COLOR</a></td>
+ <td><a href="docprocessing.html#CHANGE_SIZE">CHAPTER_TITLE_SIZE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#CHANGE_COLOR">CHAPTER_TITLE_COLOR</a></td>
+</tr>
+</table>
+<br>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Attribution</th>
+ <th>Author</th>
+ <th>Document type</th>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#CHANGE_ATTRIBUTE">ATTRIBUTE_STRING</a></td>
+ <td><a href="docprocessing.html#CHANGE_FAMILY">AUTHOR_FAMILY</a></td>
+ <td><a href="docprocessing.html#CHANGE_FAMILY">DOCTYPE_FAMILY</a></td>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#CHANGE_COLOR">ATTRIBUTE_COLOR</a></td>
+ <td><a href="docprocessing.html#CHANGE_FONT">AUTHOR_FONT</a></td>
+ <td><a href="docprocessing.html#CHANGE_FONT">DOCTYPE_FONT</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#CHANGE_SIZE">AUTHOR_SIZE</a></td>
+ <td><a href="docprocessing.html#CHANGE_SIZE">DOCTYPE_SIZE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#CHANGE_COLOR">AUTHOR_COLOR</a></td>
+ <td><a href="docprocessing.html#CHANGE_COLOR">DOCTYPE_COLOR</a></td>
+</tr>
+</table>
+
+<a name="27"><h3 align="center">Pagination</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Paginate</th>
+ <th>Style control</th>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#PAGINATE">PAGINATE</a></td>
+ <td><a href="headfootpage.html#PAGINATE_GENERAL">PAGENUM_FAMILY</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#PAGENUMBER">PAGENUMBER</a></td>
+ <td><a href="headfootpage.html#PAGINATE_GENERAL">PAGENUM_FONT</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#PAGENUM_STYLE">PAGENUM_STYLE</a>*</td>
+ <td><a href="headfootpage.html#PAGINATE_GENERAL">PAGENUM_SIZE</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#PAGENUM_ON_FIRST_PAGE">PAGENUM_ON_FIRST_PAGE</a></td>
+ <td><a href="headfootpage.html#PAGINATE_GENERAL">PAGENUM_COLOR</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#DRAFT_WITH_PAGENUMBER">DRAFT_WITH_PAGENUMBER</a></td>
+ <td><a href="headfootpage.html#PAGENUM_POS">PAGENUM_POS</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#SUSPEND_PAGINATION">SUSPEND_PAGINATION</a></td>
+ <td><a href="headfootpage.html#PAGENUM_HYPHENS">PAGENUM_HYPHENS</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#SUSPEND_PAGINATION">RESTORE_PAGINATION</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+<p align="center">
+*I.e. the &quot;format&quot; of page numbering (digits, roman numerals, letters)
+
+<a name="28"><h3 align="center">Recto/verso</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Enabling</th>
+ <th>Controling</th>
+ <th>User-defined page headers/footers
+ <br>
+ for alternating pages*
+ </th>
+</tr>
+<tr>
+ <td><a href="rectoverso.html#RECTO_VERSO">RECTO_VERSO</a></td>
+ <td><a href="rectoverso.html#SWITCH_HDRFTR">SWITCH_HEADERS</a></td>
+ <td align="center"><a href="headfootpage.html#HDRFTR_RECTOVERSO">HEADER_RECTO</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="rectoverso.html#SWITCH_HDRFTR">SWITCH_FOOTERS</a>*</td>
+ <td align="center"><a href="headfootpage.html#HDRFTR_RECTOVERSO">HEADER_VERSO</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td align="center"><a href="headfootpage.html#HDRFTR_RECTOVERSO">FOOTER_RECTO</a>*</td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td align="center"><a href="headfootpage.html#HDRFTR_RECTOVERSO">FOOTER_VERSO</a>*</td>
+</tr>
+</table>
+<p align="center">
+*Please note that most aspects of page header and footer control
+are treated identically. In the documentation, the descriptions
+of macros that control header and footer behaviour usually only
+mention &quot;HEADER&quot; or &quot;HEADER_&quot;. Simply apply
+&quot;FOOTER&quot; or &quot;FOOTER_&quot; to the appropriate
+&quot;HEADER&quot; or &quot;HEADER_&quot;macros in order to enable
+their behaviour for footers.
+
+
+<a name="29"><h3 align="center">Automatic columns</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Enabling</th>
+ <th>Controling</th>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#COLUMNS">COLUMNS</a></td>
+ <td><a href="docprocessing.html#COL_NEXT">COL_NEXT</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docprocessing.html#COL_BREAK">COL_BREAK</a></td>
+</tr>
+</table>
+
+<a name="30"><h3 align="center">Epigraphs</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Type-style control</th>
+ <th>Other</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#EPIGRAPH">EPIGRAPH</a></td>
+ <td><a href="docelement.html#EPIGRAPH_CONTROL">EPIGRAPH_FAMILY</a></td>
+ <td><a href="docelement.html#EPIGRAPH_CONTROL">EPIGRAPH_AUTOLEAD</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#EPIGRAPH_CONTROL">EPIGRAPH_FONT</a></td>
+ <td><a href="docelement.html#EPIGRAPH_CONTROL">EPIGRAPH_QUAD</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#EPIGRAPH_CONTROL">EPIGRAPH_SIZE</a></td>
+ <td><a href="docelement.html#EPIGRAPH_CONTROL">EPIGRAPH_INDENT</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#EPIGRAPH_CONTROL">EPIGRAPH_COLOR</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+
+<a name="31"><h3 align="center">Heads</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Type-style control</th>
+ <th>Other</th>
+</tr>
+<tr>
+ <td align="center"><a href="docelement.html#HEAD">HEAD</a></td>
+ <td><a href="docelement.html#HEAD_GENERAL">HEAD_FAMILY</a></td>
+ <td><a href="docelement.html#HEAD_GENERAL">HEAD_QUAD</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#HEAD_GENERAL">HEAD_FONT</a></td>
+ <td><a href="docelement.html#HEAD_CAPS">HEAD_CAPS</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#HEAD_GENERAL">HEAD_SIZE</a></td>
+ <td><a href="docelement.html#HEAD_UNDERLINE">HEAD_UNDERLINE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#HEAD_GENERAL">HEAD_COLOR</a></td>
+ <td><a href="docelement.html#HEAD_SPACE">HEAD_SPACE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#NUMBER_HEADS">NUMBER_HEADS</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#RESET_HEAD_NUMBER">RESET_HEAD_NUMBER</a></td>
+</tr>
+</table>
+
+<a name="32"><h3 align="center">Subheads</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Type-style control</th>
+ <th>Other</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#SUBHEAD">SUBHEAD</a></td>
+ <td><a href="docelement.html#SUBHEAD_GENERAL">SUBHEAD_FAMILY</a></td>
+ <td><a href="docelement.html#SUBHEAD_GENERAL">SUBHEAD_QUAD</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#SUBHEAD_GENERAL">SUBHEAD_FONT</a></td>
+ <td><a href="docelement.html#NUMBER_SUBHEADS">NUMBER_SUBHEADS</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#SUBHEAD_GENERAL">SUBHEAD_SIZE</a></td>
+ <td><a href="docelement.html#RESET_SUBHEAD_NUMBER">RESET_SUBHEAD_NUMBER</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#SUBHEAD_CONTROL">SUBHEAD_COLOR</a></td>
+</tr>
+</table>
+
+<a name="33"><h3 align="center">Paragraph heads</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Type-style control</th>
+ <th>Other</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#PARAHEAD">PARAHEAD</a></td>
+ <td><a href="docelement.html#PARAHEAD_GENERAL">PARAHEAD_FAMILY</a></td>
+ <td><a href="docelement.html#PARAHEAD_INDENT">PARAHEAD_INDENT</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#PARAHEAD_GENERAL">PARAHEAD_FONT</a></td>
+ <td><a href="docelement.html#NUMBER_PARAHEADS">NUMBER_PARAHEADS</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#PARAHEAD_GENERAL">PARAHEAD_SIZE</a></td>
+ <td><a href="docelement.html#RESET_PARAHEAD_NUMBER">RESET_PARAHEAD_NUMBER</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#PARAHEAD_GENERAL">PARAHEAD_COLOR</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+
+<a name="34"><h3 align="center">Paragraphs</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Type-style control*</th>
+ <th>Other</th>
+</tr>
+<tr>
+ <td align="center"><a href="docelement.html#PP">PP</a></td>
+ <td align="center"><a href="docelement.html#PP_FONT">PP_FONT</a></td>
+ <td><a href="docelement.html#PARA_INDENT">PARA_INDENT</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#INDENT_FIRST_PARAS">INDENT_FIRST_PARAS</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#PP_SPACE">PARA_SPACE</a></td>
+</tr>
+</table>
+<p align="center">
+*For an in-depth explanation of how to manage the type-style of
+paragraphs, much of which is normally established through the use of
+typesetting macros prior to
+<a href="docprocessing.html#START">START</a>,
+see
+<a href="docelement.html#PP_CONTROL">Paragraph control macros</a>.
+
+<a name="35"><h3 align="center">Quotes</a>
+<br>
+(line-for-line cited text, e.g. poetry or code snippets)
+</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Type-style control</th>
+ <th>Other</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#QUOTE">QUOTE</a></td>
+ <td><a href="docelement.html#QUOTE_GENERAL">QUOTE_FAMILY</a></td>
+ <td><a href="docelement.html#QUOTE_GENERAL">QUOTE_INDENT</a>*</td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#QUOTE_GENERAL">QUOTE_FONT</a></td>
+ <td><a href="docelement.html#ALWAYS_FULLSPACE_QUOTES">ALWAYS_FULLSPACE_QUOTES</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#QUOTE_GENERAL">QUOTE_SIZE</a></td>
+ <td><a href="docelement.html#BREAK_QUOTE">BREAK_QUOTE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#QUOTE_GENERAL">QUOTE_AUTOLEAD</a></td>
+ <td><a href="docprocessing.html#UNDERLINE_QUOTES">UNDERLINE_QUOTES</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#QUOTE_GENERAL">QUOTE_COLOR</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+<p align="center">
+*Note that the use of QUOTE_INDENT sets the indent for both QUOTE
+and BLOCKQUOTE.
+
+<a name="36"><h3 align="center">Blockquotes</a>
+<br>
+(formatted citations)
+</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Type-style control</th>
+ <th>Other</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#BLOCKQUOTE">BLOCKQUOTE</a></td>
+ <td><a href="docelement.html#BLOCKQUOTE_GENERAL">BLOCKQUOTE_FAMILY</a></td>
+ <td><a href="docelement.html#QUOTE_GENERAL">BLOCKQUOTE_INDENT</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#BLOCKQUOTE_GENERAL">BLOCKQUOTE_FONT</a></td>
+ <td><a href="docelement.html#BLOCKQUOTE_GENERAL">BLOCKQUOTE_QUAD</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#BLOCKQUOTE_GENERAL">BLOCKQUOTE_SIZE</a></td>
+ <td><a href="docelement.html#BREAK_QUOTE">BREAK_BLOCKQUOTE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#BLOCKQUOTE_GENERAL">BLOCKQUOTE_AUTOLEAD</a></td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#BLOCKQUOTE_GENERAL">BLOCKQUOTE_COLOR</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+<p align="center">
+*Note that the use of BLOCKQUOTE_INDENT sets the indent for both BLOCKQUOTE
+and QUOTE.
+
+<a name="37"><h3 align="center">Author linebreaks</a>
+<br>
+(also called "scene" or "section" breaks)
+</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Type-style control</th>
+ <th>Other</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#LINEBREAK">LINEBREAK</a></td>
+ <td><a href="docelement.html#LINEBREAK_COLOR">LINEBREAK_COLOR</a></td>
+ <td><a href="docelement.html#LINEBREAK_CHAR">LINEBREAK_CHAR</a></td>
+</tr>
+</table>
+
+<a name="38"><h3 align="center">Footnotes</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Type-style control</th>
+ <th>Other</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#FOOTNOTE">FOOTNOTE</a>*</td>
+ <td><a href="docelement.html#FOOTNOTE_GENERAL">FOOTNOTE_FAMILY</a></td>
+ <td><a href="docelement.html#FOOTNOTE_GENERAL">FOOTNOTE_AUTOLEAD</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#FOOTNOTE_GENERAL">FOOTNOTE_FONT</a></td>
+ <td><a href="docelement.html#FOOTNOTE_GENERAL">FOOTNOTE_QUAD</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#FOOTNOTE_GENERAL">FOOTNOTE_SIZE</a></td>
+ <td><a href="docelement.html#FOOTNOTE_MARKERS">FOOTNOTE_MARKERS</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#FOOTNOTE_GENERAL">FOOTNOTE_COLOR</a></td>
+ <td><a href="docelement.html#FOOTNOTE_MARKER_STYLE">FOOTNOTE_MARKER_STYLE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#RESET_FOOTNOTE_NUMBER">RESET_FOOTNOTE_NUMBER</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#FOOTNOTE_RULE">FOOTNOTE_RULE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#FOOTNOTE_RULE_ADJ">FOOTNOTE_RULE_ADJ</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#FOOTNOTE_RULE_LENGTH">FOOTNOTE_RULE_LENGTH</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#FOOTNOTES_RUN_ON">FOOTNOTES_RUN_ON</a></td>
+</tr>
+</table>
+<p align="center">
+*Indenting of footnotes is handled by arguments passed to FOOTNOTE.
+
+<a name="39"><h3 align="center">Endnotes</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Input endnotes</th>
+ <th>Output endnotes pages</th>
+</tr>
+<tr align="center">
+ <td><a href="docelement.html#ENDNOTE">ENDNOTE</a></td>
+ <td><a href="docelement.html#ENDNOTES">ENDNOTES</a></td>
+</tr>
+</table>
+
+<a name="40"><h3 align="center">Designing endnotes pages</a>
+<br>
+(if you want to change the defaults)
+</h3>
+
+<table align="center" valign="center" border=1 cellpadding="6">
+<tr>
+ <th>Type-style control</th>
+ <th>Endnotes page
+ <br>title string*
+</th>
+ <th>Document identification string**</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTE_GENERAL">ENDNOTE_FAMILY</a></td>
+ <td><a href="docelement.html#ENDNOTE_STRING">ENDNOTE_STRING</a></td>
+ <td><a href="docelement.html#ENDNOTE_TITLE">ENDNOTE_TITLE</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTE_GENERAL">ENDNOTE_FONT</a></td>
+ <td><a href="docelement.html#ENDNOTE_STRING_CONTROL">ENDNOTE_STRING_FAMILY</a></td>
+ <td><a href="docelement.html#ENDNOTE_TITLE_CONTROL">ENDNOTE_TITLE_FAMILY</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTE_LEAD">ENDNOTE_LEAD</a></td>
+ <td><a href="docelement.html#ENDNOTE_STRING_CONTROL">ENDNOTE_STRING_FONT</a></td>
+ <td><a href="docelement.html#ENDNOTE_TITLE_CONTROL">ENDNOTE_TITLE_FONT</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTE_PT_SIZE">ENDNOTE_PT_SIZE</a></td>
+ <td><a href="docelement.html#ENDNOTE_STRING_CONTROL">ENDNOTE_STRING_SIZE</a></td>
+ <td><a href="docelement.html#ENDNOTE_TITLE_CONTROL">ENDNOTE_TITLE_SIZE</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTE_GENERAL">ENDNOTE_QUAD</a></td>
+ <td><a href="docelement.html#ENDNOTE_STRING_CAPS">ENDNOTE_STRING_CAPS</a></td>
+ <td><a href="docelement.html#ENDNOTE_TITLE_CONTROL">ENDNOTE_TITLE_QUAD</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#ENDNOTE_STRING_UNDERSCORE">ENDNOTE_STRING_UNDERSCORE</a></td>
+ <td><a href="docelement.html#ENDNOTE_TITLE_UNDERSCORE">ENDNOTE_TITLE_UNDERSCORE</a></td>
+</tr>
+</table>
+<p align="center">
+*By default, &quot;Endnotes&quot;, at the top of the first page of
+endnotes
+<br>
+**I.e. how each document in the endnotes for a collated document is
+identified (by default, the strings passed to the reference
+macro, .TITLE
+<p>
+
+<table align="center" valign="center" border=1 cellpadding="6">
+<tr>
+ <th>Endnotes numbering</th>
+ <th>Paragraph control</th>
+ <th>Endnotes headers/footers</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTE_NUMBER_CONTROL">ENDNOTE_NUMBER_FAMILY</a></td>
+ <td><a href="docelement.html#ENDNOTE_PARA_INDENT">ENDNOTE_PARA_INDENT</a></td>
+ <td><a href="docelement.html#ENDNOTES_ALLOWS_HEADERS">ENDNOTES_ALLOWS_HEADERS</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTE_NUMBER_CONTROL">ENDNOTE_NUMBER_FONT</a></td>
+ <td><a href="docelement.html#ENDNOTE_PARA_SPACE">ENDNOTE_PARA_SPACE</a></td>
+ <td><a href="docelement.html#ENDNOTES_HDRFTR_CENTER">ENDNOTES_HEADER_CENTER</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTE_NUMBER_CONTROL">ENDNOTE_NUMBER_SIZE</a></td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#ENDNOTES_HDRFTR_CENTER">ENDNOTES_FOOTER_CENTER</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTE_NUMBERS_ALIGN_LEFT">ENDNOTE_NUMBERS_ALIGN_LEFT</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTE_NUMBERS_ALIGN_RIGHT">ENDNOTE_NUMBERS_ALIGN_RIGHT</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+<br>
+
+<table align="center" valign="center" border=1 cellpadding="6">
+<tr>
+ <th>Endnotes page numbering</th>
+ <th>Misc</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTES_FIRST_PAGENUMBER">ENDNOTES_FIRST_PAGENUMBER</a></td>
+ <td><a href="docelement.html#ENDNOTES_NO_COLUMNS">ENDNOTES_NO_COLUMNS</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTES_PAGENUM_STYLE">ENDNOTES_PAGENUM_STYLE</a>*</td>
+ <td><a href="docelement.html#SINGLESPACE_ENDNOTES">SINGLESPACE_ENDNOTES</a>**</td>
+</tr>
+<tr>
+ <td><a href="docelement.html#ENDNOTES_NO_FIRST_PAGENUM">ENDNOTES_NO_FIRST_PAGENUM</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+<p align="center">
+*I.e. the format of page numbering (digits, roman, letters)
+<br>
+**Applies to PRINTSTYLE TYPEWRITE only
+
+<a name="51"><h3 align="center">Margin notes</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Initialize</th>
+ <th>Start</th>
+</tr>
+<tr>
+ <td align="center"><a href="docelement.html#MN_INIT">MN_INIT</a></td>
+ <td align="center"><a href="docelement.html#MN">MN</a></td>
+</tr>
+</table>
+
+<a name="52"><h3 align="center">Line numbering</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Text</th>
+ <th>Quotes</th>
+ <th>Blockquotes</th>
+</tr>
+<tr>
+ <td align="center"><a href="docelement.html#NUMBER_LINES">NUMBER_LINES</a></td>
+ <td align="center"><a href="docelement.html#NUMBER_QUOTE_LINES">NUMBER_QUOTE_LINES</a></td>
+ <td align="center"><a href="docelement.html#NUMBER_BLOCKQUOTE_LINES">NUMBER_BLOCKQUOTE_LINES</a></td>
+</tr>
+</table>
+
+<a name="54"><h3 align="center">References</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Begin/end refs</th>
+ <th>Footnote refs</th>
+ <th>Endnote refs</th>
+ <th>Embedded refs</th>
+</tr>
+<tr>
+ <td align="center"><a href="refer.html#REF">REF</a></td>
+ <td align="center"><a href="refer.html#FOOTNOTE_REFS">FOOTNOTE_REFS</a></td>
+ <td align="center"><a href="refer.html#ENDNOTE_REFS">ENDNOTE_REFS</a></td>
+ <td align="center"><a href="refer.html#BRACKET_REFS">REF( / REF)</a></td>
+</tr>
+<tr>
+ <td align="center">&nbsp;</td>
+ <td align="center">&nbsp;</td>
+ <td align="center">&nbsp;</td>
+ <td align="center"><a href="refer.html#BRACKET_REFS">REF( / REF)</a></td>
+</tr>
+<tr>
+ <td align="center">&nbsp;</td>
+ <td align="center">&nbsp;</td>
+ <td align="center">&nbsp;</td>
+ <td align="center"><a href="refer.html#BRACKET_REFS">REF[ / REF]</a></td>
+</tr>
+<tr>
+ <td align="center">&nbsp;</td>
+ <td align="center">&nbsp;</td>
+ <td align="center">&nbsp;</td>
+ <td align="center"><a href="refer.html#BRACKET_REFS">REF{ / REF}</a></td>
+</tr>
+</table>
+
+<a name="55"><h3 align="center">Bibliographies</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Start bibliography page</th>
+ <th>Bibliography type</th>
+</tr>
+<tr>
+ <td align="center"><a href="refer.html#BIBLIOGRAPHY">BIBLIOGRAPHY</a></td>
+ <td align="center"><a href="refer.html#BIBLIOGRAPHY_TYPE">BIBLIOGRAPHY_TYPE</a></td>
+</tr>
+</table>
+
+<a name="41"><h3 align="center">Table of contents</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Generate</th>
+ <th>General
+ <br>
+ type-style control
+ </th>
+ <th>TOC title string*
+ <br>
+ and style control
+ </th>
+</tr>
+<tr>
+ <td align="center"><a href="docelement.html#TOC">TOC</a></td>
+ <td align="center"><a href="docelement.html#TOC_FAMILY">TOC_FAMILY</a></td>
+ <td><a href="docelement.html#TOC_HEADER_STRING">TOC_HEADER_STRING</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td align="center"><a href="docelement.html#TOC_PT_SIZE">TOC_PT_SIZE</a></td>
+ <td><a href="docelement.html#TOC_HEADER_FAMILY">TOC_HEADER_FAMILY</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td align="center"><a href="docelement.html#TOC_LEAD">TOC_LEAD</a></td>
+ <td><a href="docelement.html#TOC_HEADER_FONT">TOC_HEADER_FONT</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#TOC_HEADER_SIZE">TOC_HEADER_SIZE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="docelement.html#TOC_HEADER_QUAD">TOC_HEADER_QUAD</a></td>
+</tr>
+</table>
+<p align="center">
+*By default, "Table of Contents"
+
+<a name="42"><h3 align="center">Designing a table of contents</a>
+<br>
+(if you want to change the defaults)
+</h3>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Title entries</th>
+ <th>Head entries</th>
+ <th>Subhead entries</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#TOC_TITLE_ENTRY">TOC_TITLE_ENTRY</a></td>
+ <td><a href="docelement.html#TOC_HEAD">TOC_HEAD_FAMILY</a></td>
+ <td><a href="docelement.html#TOC_SUBHEAD">TOC_SUBHEAD_FAMILY</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#TOC_APPENDS_AUTHOR">TOC_APPENDS_AUTHOR</a></td>
+ <td><a href="docelement.html#TOC_HEAD">TOC_HEAD_FONT</a></td>
+ <td><a href="docelement.html#TOC_SUBHEAD">TOC_SUBHEAD_FONT</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#TOC_TITLE">TOC_TITLE_FAMILY</a></td>
+ <td><a href="docelement.html#TOC_HEAD">TOC_HEAD_SIZE</a></td>
+ <td><a href="docelement.html#TOC_SUBHEAD">TOC_SUBHEAD_SIZE</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#TOC_TITLE">TOC_TITLE_FONT</a></td>
+ <td><a href="docelement.html#TOC_HEAD">TOC_HEAD_INDENT</a></td>
+ <td><a href="docelement.html#TOC_SUBHEAD">TOC_SUBHEAD_INDENT</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#TOC_TITLE">TOC_TITLE_SIZE</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="docelement.html#TOC_TITLE">TOC_TITLE_INDENT</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+<br>
+
+<table align="center" valign="center" border=1 cellpadding="6">
+<tr>
+ <th>Parahead entries</th>
+ <th>Page number entries</th>
+ <th>Pagination</th>
+ <th>Misc</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#TOC_PARAHEAD">TOC_PARAHEAD_FAMILY</a></td>
+ <td><a href="docelement.html#TOC_PN">TOC_PN_FAMILY</a></td>
+ <td align="center"><a href="docelement.html#PAGINATE_TOC">PAGINATE_TOC</a></td>
+ <td><a href="docelement.html#TOC_RV_SWITCH">TOC_RV_SWITCH</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#TOC_PARAHEAD">TOC_PARAHEAD_FONT</a></td>
+ <td><a href="docelement.html#TOC_PN">TOC_PN_FONT</a></td>
+ <td align="center"><a href="docelement.html#TOC_PAGENUM_STYLE">TOC_PAGENUM_STYLE</a>*</td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="docelement.html#TOC_PARAHEAD">TOC_PARAHEAD_SIZE</a></td>
+ <td><a href="docelement.html#TOC_PN">TOC_PN_SIZE</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td><a href="docelement.html#TOC_PARAHEAD">TOC_PARAHEAD_INDENT</a></td>
+ <td><a href="docelement.html#TOC_PADDING">TOC_PADDING</a></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+<p align="center">
+*I.e. the format of page numbering (digits, roman, letters)
+
+<a name="43"><h3 align="center">Finis</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Type style control</th>
+</tr>
+<tr>
+ <td><a href="docelement.html#FINIS">FINIS</a></td>
+ <td><a href="docelement.html#FINIS_COLOR">FINIS_COLOR</a></td>
+</tr>
+<tr>
+ <td><a href="docelement.html#FINIS_STRING">FINIS_STRING</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+
+<a name="44"><h3 align="center">Headers and footers</h3></a>
+<p align="center">
+<strong>Mom</strong> treats all aspects of headers and footers
+identically. The only difference between the two is whether the
+information they contain appears at the top of the page or at the
+bottom. Consequently, in the following, substitute FOOTERS
+for HEADERS, and FOOTER_ for HEADER_ if you're hunting down how to
+do something with footers.
+<p>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Macro</th>
+ <th>Placement</th>
+ <th>User-defined headers</th>
+ <th>General
+ <br>
+ type-style control
+ </th>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#HEADERS">HEADERS</a></td>
+ <td><a href="headfootpage.html#HDRFTR_MARGIN">HEADER_MARGIN</a></td>
+ <td><a href="headfootpage.html#HDRFTR_RECTOVERSO">HEADER_RECTO</a></td>
+ <td><a href="headfootpage.html#HDRFTR_GLOBAL_FAMILY">HEADER_FAMILY</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="headfootpage.html#HDRFTR_GAP">HEADER_GAP</a></td>
+ <td><a href="headfootpage.html#HDRFTR_RECTOVERSO">HEADER_VERSO</a></td>
+ <td><a href="headfootpage.html#HDRFTR_GLOBAL_SIZE">HEADER_SIZE</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="headfootpage.html#HDRFTR_COLOR">HEADER_COLOR</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td><a href="headfootpage.html#HDRFTR_PLAIN">HEADER_PLAIN</a></td>
+</tr>
+</table>
+
+<a name="45"><h3 align="center">Part-by-part control of headers</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Left</th>
+ <th>Center</th>
+ <th>Right</th>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#HDRFTR_LEFT">HEADER_LEFT</a></td>
+ <td><a href="headfootpage.html#HDRFTR_CENTER">HEADER_CENTER</a></td>
+ <td><a href="headfootpage.html#HDRFTR_RIGHT">HEADER_RIGHT</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#_FAMILY">HEADER_LEFT_FAMILY</a></td>
+ <td><a href="headfootpage.html#_FAMILY">HEADER_CENTER_FAMILY</a></td>
+ <td><a href="headfootpage.html#_FAMILY">HEADER_RIGHT_FAMILY</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#_FONT">HEADER_LEFT_FONT</a></td>
+ <td><a href="headfootpage.html#_FONT">HEADER_CENTER_FONT</a></td>
+ <td><a href="headfootpage.html#_FONT">HEADER_RIGHT_FONT</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#_SIZE">HEADER_LEFT_SIZE</a></td>
+ <td><a href="headfootpage.html#_SIZE">HEADER_CENTER_SIZE</a></td>
+ <td><a href="headfootpage.html#_SIZE">HEADER_RIGHT_SIZE</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#_COLOR">HEADER_LEFT_COLOR</a></td>
+ <td><a href="headfootpage.html#_COLOR">HEADER_CENTER_COLOR</a></td>
+ <td><a href="headfootpage.html#_COLOR">HEADER_RIGHT_COLOR</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#_CAPS">HEADER_LEFT_CAPS</a></td>
+ <td><a href="headfootpage.html#_CAPS">HEADER_CENTER_CAPS</a></td>
+ <td><a href="headfootpage.html#_CAPS">HEADER_RIGHT_CAPS</a></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><a href="headfootpage.html#HDRFTR_CENTER_PAD">HEADER_CENTER_PAD</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+<br>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Separator rule</th>
+ <th>Misc</th>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#HDRFTR_RULE">HEADER_RULE</a></td>
+ <td><a href="docprocessing.html#REVISION_STRING">REVISION_STRING</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#HDRFTR_RULE_GAP">HEADER_RULE_GAP</a></td>
+ <td><a href="docprocessing.html#DRAFT_STRING">DRAFT_STRING</a></td>
+</tr>
+<tr>
+ <td><a href="headfootpage.html#HDRFTR_RULE_COLOR">HEADER_RULE_COLOR</a></td>
+ <td>&nbsp;</td>
+</tr>
+</table>
+
+<a name="46"><h3 align="center">Footers</h3></a>
+<p align="center">
+This is the one exception to the &quot;HEADER also means FOOTER&quot;
+convention used throughout the documentation.
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <td><a href="headfootpage.html#FOOTER_ON_FIRST_PAGE">FOOTER_ON_FIRST_PAGE</a></td>
+</tr>
+</table>
+
+<a name="47"><h3 align="center">Covers and doc covers</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Covers</th>
+ <th>Doc covers</th>
+</tr>
+<tr align="center">
+ <td><a href="cover.html#COVER">COVER</a></td>
+ <td><a href="cover.html#COVER">DOC_COVER</a></td>
+</tr>
+<tr align="center">
+ <td><a href="cover.html#ON_OFF">COVERS</a></td>
+ <td><a href="cover.html#ON_OFF">DOC_COVERS</a></td>
+</tr>
+</table>
+
+
+<a name="48"><h3 align="center">Customizing covers and doc covers</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="8">
+<tr>
+ <th>Covers</th>
+ <th>Doc covers</th>
+</tr>
+<tr>
+ <td><a href="docprocessing.html#COVERTITLE">COVERTITLE</a></td>
+ <td><a href="docprocessing.html#COVERTITLE">DOC_COVERTITLE</a></td>
+</tr>
+<tr>
+ <td><a href="cover.html#COVER_ADVANCE">COVER_ADVANCE</a></td>
+ <td><a href="cover.html#COVER_ADVANCE">DOC_COVER_ADVANCE</a></td>
+</tr>
+<tr>
+ <td><a href="cover.html#COVER_FAMILY">COVER_FAMILY</a></td>
+ <td><a href="cover.html#COVER_FAMILY">DOC_COVER_FAMILY</a></td>
+</tr>
+<tr>
+ <td><a href="cover.html#COVER_LEAD">COVER_LEAD</a></td>
+ <td><a href="cover.html#COVER_LEAD">DOC_COVER_LEAD</a></td>
+</tr>
+</table>
+
+<a name="49"><h3 align="center">Part-by-part control of covers and doc covers</h3></a>
+
+<p align="center">
+For part-by-part control of the family, font, size and color, please
+see
+
+<table align="center" valign="center" border=1 cellpadding="8">
+ <tr>
+ <td align="center"><a href="cover.html#COVER_CONTROL">Control macros--changing the defaults for covers and document covers</a></td>
+ </tr>
+ <tr>
+ <td align="center"><a href="cover.html#COVER_CONTROL_INDEX">Index of cover and doc cover control macros</a></td>
+ </tr>
+</table>
+
+<a name="50"><h3 align="center">Miscellaneous</h3></a>
+
+<table align="center" valign="center" border=1 cellpadding="10">
+<tr>
+ <th>Output a blank page</th>
+ <th>Collate multiple
+ <br>documents</th>
+ <th>Get leading back
+ <br>on track</th>
+</tr>
+<tr align="center">
+ <td><a href="docelement.html#BLANK_PAGE">BLANKPAGE</a></td>
+ <td><a href="rectoverso.html#COLLATE">COLLATE</a></td>
+ <td><a href="docprocessing.html#SHIM">SHIM</a></td>
+</tr>
+</table>
+
+<br>
+<hr>
+
+<a href="appendices.html#MOREDOC">Next</a>&nbsp;&nbsp;
+<a href="typemacdoc.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="#TOP">Top</a>&nbsp;&nbsp;
+<a href="toc.html">Back to Table of Contents</a></td>
+</body>
+</html>
diff --git a/contrib/groff/contrib/mom/momdoc/rectoverso.html b/contrib/groff/contrib/mom/momdoc/rectoverso.html
index 88e661eaddfa..064490379e61 100644
--- a/contrib/groff/contrib/mom/momdoc/rectoverso.html
+++ b/contrib/groff/contrib/mom/momdoc/rectoverso.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -10,14 +11,12 @@
<a href="cover.html#TOP">Next</a>&nbsp;&nbsp;
<a href="headfootpage.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
+<p>
<a name="TOP"></a>
+<a name="INDEX_RECTOVERSO"></a>
<a name="RECTOVERSO">
- <h2 align="center"><u>RECTO/VERSO PRINTING and COLLATING</u></h2>
-</a>
-
-<a name="INDEX_RECTOVERSO">
- <h3><u>Recto/verso and collating</u></h3>
+ <h1 align="center"><u>RECTO/VERSO PRINTING and COLLATING</u></h1>
</a>
<ul>
@@ -57,7 +56,7 @@ of the following aspects of alternating page layout:
if user-defined, single string recto/verso headers
or footers are used in place of the default 3-part
headers or footers
- <li>switching the page number position (if page numbers are not centered)
+ <li>switching the page number position (if page numbers are not centred)
</ul>
<p>
It is beyond the scope of this documentation to cover the different
@@ -74,8 +73,7 @@ appropriately, put them back in your printer, and have
work from the command line, check out the man pages for
<strong>pstops</strong> and <strong>psbook</strong>. There are other
programs out there as well to help with two-sided printing.
-<br>
-
+<p>
<a name="RECTOVERSO_LIST">
<h3><u>Recto/verso macros list</u></h3>
@@ -85,6 +83,7 @@ programs out there as well to help with two-sided printing.
<li><a href="#RECTO_VERSO">RECTO_VERSO</a>
<li><a href="#SWITCH_HDRFTR">SWITCH_HEADERS (also FOOTERS)</a>
</ul>
+<p>
<hr>
<!---RECTO_VERSO--->
@@ -92,7 +91,6 @@ programs out there as well to help with two-sided printing.
<a name="RECTO_VERSO">
<h3><u>Recto/verso printing</u></h3>
</a>
-<br>
Macro: <strong>RECTO_VERSO</strong>
<p>
@@ -122,11 +120,11 @@ and
(before or after <strong>START</strong>).
<p>
Equally, recto/verso only switches the page number position if page
-numbers aren't centered, which means you have to set the page
+numbers aren't centred, which means you have to set the page
number position with
<a href="headfootpage.html#PAGENUM_POS">PAGENUM_POS</a>
(before or after <strong>START</strong>).
-<br>
+<p>
<!---SWITCH_HDRFTR--->
@@ -134,7 +132,6 @@ number position with
<a name="SWITCH_HDRFTR">
<h3><u>Switch header left part/right part</u></h3>
</a>
-<br>
Macro: <strong>SWITCH_HEADERS</strong>
<p>
@@ -144,7 +141,7 @@ string (by default, the document title). If you don't like
<strong>mom</strong>'s default placement of author and title, use
<strong>SWITCH_HEADERS</strong> to reverse it.
<p>
-<strong>SWITCH_HEADERS</strong> can also be useful in conjuction
+<strong>SWITCH_HEADERS</strong> can also be useful in conjunction
with
<a href="#RECTO_VERSO">RECTO_VERSO</a>.
The assumption of <strong>RECTO_VERSO</strong> is that the first
@@ -160,7 +157,7 @@ respect to headers) will come out as you want.
<p>
<strong>NOTE:</strong> Replace <strong>_HEADERS</strong>, above,
with <strong>_FOOTERS</strong> if your document uses footers.
-<br>
+<p>
<hr>
<!=====================================================================>
@@ -205,15 +202,14 @@ files, chances are the <strong>PRINTSTYLE</strong>'s already there.
<ol>
<li>Do not collate documents of differing
<strong>PRINTSTYLES</strong> (i.e. don't try to
- collate a TYPESET document and TYPEWRITE document --
- why would you want to do that anyway?)
+ collate a TYPESET document and TYPEWRITE document).
<li>Use <strong>DOC_FAMILY</strong> instead of
<strong>FAMILY</strong> if, for some reason, you want
to change the family of all the document elements after
<strong>COLLATE</strong>. <strong>FAMILY</strong>, by
itself, will change the family of paragraph text only.
</ol>
-<br>
+<p>
<!---COLLATE--->
@@ -221,7 +217,7 @@ files, chances are the <strong>PRINTSTYLE</strong>'s already there.
<a name="COLLATE">
<h3><u>Collate document files</u></h3>
</a>
-<br>
+
Macro: <strong>COLLATE</strong>
<p>
@@ -239,14 +235,14 @@ that require their own titles, looks like this:
<p>
<pre>
.COLLATE
- .CHAPTER_STRING "Geek Fatigue: Symptoms and Causes"
+ .CHAPTER_TITLE "Geek Fatigue: Symptoms and Causes"
.START
</pre>
<strong>NOTE:</strong> See the
<a href="#CAUTION">two words of caution</a>,
above.
-<br>
+<p>
<hr>
<a href="cover.html#TOP">Next</a>&nbsp;&nbsp;
diff --git a/contrib/groff/contrib/mom/momdoc/refer.html b/contrib/groff/contrib/mom/momdoc/refer.html
new file mode 100644
index 000000000000..bda1e4bca48e
--- /dev/null
+++ b/contrib/groff/contrib/mom/momdoc/refer.html
@@ -0,0 +1,1482 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+<title>Mom -- Bibliographies and References</title>
+</head>
+<body bgcolor="#dfdfdf">
+
+<!====================================================================>
+
+<a href="letters.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="cover.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="toc.html">Back to Table of Contents</a>
+
+<a name="TOP"></a>
+<h1 align="center">
+ <a name="REF_INTRO"><u>Bibliographies and references</u></a>
+</h1>
+<p>
+<a href="#INTRO_REF">Introduction to bibliographies and references</a>
+<br>
+<a href="#TUTORIAL_REF">Tutorial</a>
+<ul>
+ <li><a href="#DB_REF">Creating a refer database</a>
+ <li><a href="#RCOMMANDS_REF">Required "refer" commands</a>
+ <li><a href="#ACCESSING_REF">Accessing references</a>
+ <li><a href="#WHERE_REF">Telling mom where to put references</a>
+ <li><a href="#BIBLIO_REF">Creating bibliography pages</a>
+ <li><a href="#INVOKING_REF">Invoking groff with mom and refer</a>
+</ul>
+<br>
+<a href="#MACROS_REF">Index of bibliography and reference macros</a>
+<p>
+
+<a name="INTRO_REF">
+ <h2><u>Introduction to bibliographies and references</u></h2>
+</a>
+
+<strong>Mom</strong> provides the ability to automatically format
+and generate bibliography pages, as well as footnote or endnote
+bibliographic references, or references embedded in text. She
+accomplishes this by working in conjunction with a special
+<strong>groff</strong> program called "refer".
+<p>
+<strong>refer</strong> is a <strong>groff</strong>
+"pre-processor", which is to say that it scans your files looking
+for very specific commands (i.e. lines that begin with a period
+[dot], just like macros and document element tags). If the
+commands aren't there, <strong>refer</strong> can't do it's job,
+and neither can <strong>mom</strong>. The scanning is done
+<strong>before</strong> any actual <strong>mom</strong> processing
+occurs.
+<p>
+<strong>refer</strong> is a program that's been around for a long
+time. It's powerful and has many, many features. Unfortunately,
+the manpage (<kbd>man refer</kbd>), while complete and accurate, is
+dense and not a good introduction to <strong>refer</strong>. (It's
+a classic manpage Catch-22: the information it contains is most
+useful only after you already grasp it.)
+<p>
+In order to get <strong>mom</strong> users up and running with
+<strong>refer</strong>, this section of <strong>mom</strong>'s
+documentation focuses exclusively, in a recipe-like manner, on
+what you need to know to use <strong>refer</strong> satisfactorily
+in conjunction with <strong>mom</strong>. The information and
+instructions are <strong><em><u>not</u></em></strong> to be taken as
+a manual or tutorial on full <strong>refer</strong> usage. Much has
+been left out, on purpose.
+<p>
+It is tempting to provide two levels of documentation, one for
+users familiar with <strong>refer</strong> and one for newcomers
+to <strong>groff</strong> and <strong>mom</strong>, but such an
+approach may muddy the waters for newcomers. <strong>Mom</strong>'s
+allegiance, first and foremost, is to newcomers. If you're already
+a <strong>refer</strong> user, the information herein will be useful
+for adapting your current <strong>refer</strong> usage to
+<strong>mom</strong>'s way of doing things. If you've never used
+<strong>refer</strong>, the information is essential, and, in many
+cases, may be all you need.
+<p>
+(For the benefit of old groff-hands: <strong>refer</strong>
+support in <strong>mom</strong> is heavily based on the
+<strong>refer</strong> module of the ms macros. The choice
+was deliberate so that those wishing to play around with
+<strong>mom</strong>'s bibliography formatting style would be
+tinkering with the familiar.)
+<p>
+<strong>refer</strong> requires first that you create a
+bibliographic database. From the information contained in the
+database, <strong>mom</strong> formats and generates bibliographies
+and references in MLA (Modern Language Association) style. MLA
+style is clean, contemporary and flexible, and is widely used in
+the humanities, where the range of material that has to be
+referenced can run from simple books to live interviews and film.
+<p>
+Once you have created your database, you instruct
+<strong>refer</strong> (and <strong>mom</strong>) to access entries
+in it by supplying keywords from the entries. Depending on what
+you've instructed <strong>mom</strong> to do, she will put the
+entries--fully and properly formatted with respect to order, punctuation
+and italicization--in footnotes, endnotes, or a full bibliography.
+<p>
+I encourage anyone interested in what MLA style looks like--and, by
+extension, how your bibliographies and references will look after
+<strong>mom</strong> formats them--to check out
+<p>
+<pre>
+ http://www.aresearchguide.com/12biblio.html
+</pre>
+
+or any other website or reference book on MLA style.
+<p>
+<strong>NOTE:</strong> MLA style requires that second and
+subsequent lines of individual references be indented. <strong>Mom</strong>
+takes care of this for you with a default indent, which
+can be changed with the macro
+<a href="#INDENT_REFS">INDENT_REFS</a>.
+
+
+<a name="TUTORIAL_REF"><h2><u>Tutorial</u></h2></a>
+
+<ol>
+ <li><a href="#DB_REF">Creating a refer database</a>
+ <li><a href="#RCOMMANDS_REF">Required "refer" commands</a>
+ <li><a href="#ACCESSING_REF">Accessing references</a>
+ <li><a href="#WHERE_REF">Telling mom where to put references</a>
+ <li><a href="#BIBLIO_REF">Creating bibliography pages</a>
+ <li><a href="#INVOKING_REF">Invoking groff with mom and refer</a>
+</ol>
+<p>
+
+<a name="DB_REF"><h3><u>1. Creating a refer database</u></h3><a>
+<p>
+The first step in using <strong>refer</strong> with
+<strong>mom</strong> is setting up your bibliographic database.
+The database is a file containing separate entries for each
+reference you want to access from your <strong>mom</strong> files.
+The file is <em>not</em> a "mom" file; it is a separate database.
+You may set up individual databases for individual documents, or
+create a large database that contains all the references you'll
+ever need.
+<p>
+Entries ("records") in the database file are separated from each
+other by a single, blank line. The records themselves are composed
+of single lines ("fields") with no blank lines between them. Each
+field begins with a percent sign and a single letter (the "field
+identifier") e.g. %A or %T. The letter identifies what part of a
+bibliographic entry the field refers to: Author, Title, Publisher,
+Date, etc. After the field identifier comes a single space,
+followed by the information appropriate to field. No punctuation
+should go at the ends of fields; <strong>mom</strong> adds what's
+correct automatically. Do note, however, that author(s) (%A)
+requires that you enter the author information exactly as you wish
+it to come out (minus the period), including the comma after the
+first author's last name.
+<p>
+Here's a sample database containing two records so you can
+visualize what the above paragraph says:
+<p>
+<pre>
+%A Schweitzer, Albert
+%A C.M. Widor
+%T J.S. Bach
+%l Ernest Newman
+%V Vol 2
+%C London
+%I Adam and Charles Black
+%D 1923
+%O 2 vols
+%K bach vol 2
+
+%A Schaffter, Peter
+%T The Schumann Proof
+%C Toronto
+%I RendezVous Press
+%D 2004
+%K schumann schaffter
+</pre>
+
+The order in which you enter fields doesn't matter.
+<strong>mom</strong> and <strong>refer</strong> will re-arrange
+them in the correct order for you.
+<p>
+The meaning of the letters follows. There are, with
+<strong>refer</strong>, quite a few--all uppercase--which have, over
+time, come to be "standard". <strong>Mom</strong> respects these.
+However, she adds to the list (mostly the lowercase letters).
+<p>
+<pre>
+ %A Author -- additional authors may be entered on separate %A
+ lines as in first entry of the sample, above; mom
+ and refer will figure out what to do with multiple
+ authors according to MLA rules
+ %T Title -- either the primary title (e.g. of a book), or the
+ title of an article (e.g. within a book or
+ journal or magazine)
+ %B Book title -- the title of a book when %T contains the title
+ of an article; otherwise, use %T for book
+ titles
+ %R Report number -- for technical reports
+ %J Journal name -- the name of a journal or magazine when %T
+ contains the title of an article
+ %E Editor -- additional editors may be entered on separate %E
+ lines (like authors); mom and refer will figure
+ out what to do with them according to MLA rules
+ %e Edition -- the number of name of a specific edition
+ (e.g. Second, 2nd, Collector's, etc.)
+ %V Volume -- volume number of a journal or series of books
+ %N Journal number -- journal or magazine number
+ %S Series -- series name for books or journals that are part of
+ a series
+ %C City -- the city of publication
+ %I Publisher -- the publisher; %I stands for "Issuer"
+ %D Publication date
+ %P Page number(s) -- enter page ranges as, e.g., 22-25
+ %G Gov't.
+ ordering number -- for government publications
+ %O Other -- additional information or comments you want
+ to appear at the end of the reference
+ %K Keywords -- any words that will clear up ambiguities
+ resulting from database entries that
+ contain, say, the same author or the
+ same title
+ %d original
+ publication date -- if different from the date
+ of publication
+ %a additions -- for books, any additions to the original work,
+ such as the preface to a new edition or a new
+ introduction
+ %t reprint title -- if different from a work's original title
+ %l translator -- if the translator is not the editor; if more
+ than one translator, this field should contain
+ all the names, with appropriate punctuation
+ %r translator
+ and editor -- if tr. and ed. are one in the same;
+ %s site name -- for web sites, the site name
+ %c content
+ of site -- for web sites, the content, if unclear
+ (i.e. advertisement, cartoon, blog)
+ %o organization -- for web sites, the organization, group or
+ sponsor of the site
+ %a access date -- for a website, the date you accessed it
+ %u URL -- for websites, the full URL of the site
+</pre>
+
+<a name="REF_DISC_HY"></a>
+<strong>Tip:</strong> If you have hyphenation turned on in your
+document (you probably do), <strong>mom</strong> will hyphenate
+your references. This can be a problem because references
+typically contain several proper names. Proper names shouldn't be
+hyphenated. The solution is to prepend to any proper name in the
+database the <strong>groff</strong>
+<a href="definitions.html#TERMS_DISCRETIONARYHYPHEN">discretionary hyphen</a>
+character, <strong>\%</strong>, like this:
+<p>
+<pre>
+ %A Hill, \%Reginald
+</pre>
+
+Alternatively, you can turn hyphenation off entirely in
+references with the macro,
+<a href="#HYPHENATE_REFS">HYPHENATE_REFS</a> <kbd>OFF</kbd>.
+<p>
+
+<a name="RCOMMANDS_REF"><h3><u>2. Required "refer" commands</u></h3><a>
+<p>
+Having set up your database, you now need to put some
+<strong>refer</strong>-specific commands at the top of your
+<strong>mom</strong> file. You cannot skip this step, nor can you
+"source" these commands with the <strong>groff</strong>
+<a href="definitions.html#TERMS_PRIMITIVES">primitive</a>,
+<strong>.so</strong>. They <strong><em>must</em></strong>
+appear, exactly as shown, in every file requiring bibliographic
+references.
+<p>
+<strong>refer</strong> commands are introduced with a single
+line containing <kbd>.R1</kbd>, and concluded with a single line
+containing <kbd>.R2</kbd>. What you put between the <kbd>.R1</kbd>
+and <kbd>.R2</kbd> lines are the commands themselves. The commands
+should be entered one per line, in lowercase letters, <em><u>with
+no initial period (dot)</u></em>.
+<p>
+Here's an example:
+<p>
+<pre>
+ .R1
+ no-label-in-text
+ no-label-in-reference
+ .R2
+</pre>
+
+There are an awful lot of <strong>refer</strong> commands. We will
+focus only on those required to get <strong>mom</strong> cooperating
+with <strong>refer</strong>. If you're interested, study the
+<strong>refer</strong> manpage to discover what other commands are
+available and how to manipulate them.
+<p>
+At a minimum, all <strong>mom</strong> files accessing
+a bibliographic database must contain the following
+<strong>refer</strong> commands, exactly as shown:
+<p>
+<a name="REFER_BLOCK1"></a>
+<pre>
+.R1
+no-label-in-text
+no-label-in-reference
+join-authors ", and " ", " ", and "
+database &lt;full path to the database&gt;
+.R2
+</pre>
+
+The first two commands tell <strong>refer</strong> to let
+<strong>mom</strong> handle everything associated with footnote
+and endnote markers, both in the body of the document, and in the
+footnotes/endnotes themselves.
+<p>
+The third command is required for <strong>mom</strong> to handle
+multiple authors in proper, MLA style.
+<p>
+The last command, <kbd>database</kbd>, assumes you have created
+your own database, and do not otherwise have a system-wide
+"default" database. "...full path to the database" means the full
+path <em>including</em> the database filename, e.g.
+/home/user/refer/my_database.
+<p> If you're already a <strong>refer</strong> user, feel free to
+enter whatever <strong>refer</strong> commands are necessary to
+access the database(s) you want.
+<p>
+With the above <strong>refer</strong> block, you can embed
+references directly into the text of your document, or have them
+output as footnotes or endnotes. If you want to "collect"
+references for later output on a bibliography page, the block must
+read:
+<p>
+<pre>
+.R1
+no-label-in-text
+no-label-in-reference
+join-authors ", and " ", " ", and "
+database &lt;full path to the database&gt;
+sort
+accumulate
+.R2
+</pre>
+
+<a name="ACCESSING_REF"><h3><u>3. Accessing references</u></h3><a>
+<p>
+References are accessed by putting keywords, all on one line,
+between the <strong>refer</strong> commands <strong>.[</strong> and
+<strong>.]</strong>. Both of these commands must appear on separate
+lines, by themselves, like this:
+<p>
+<pre>
+ .[
+ keyword(s)
+ .]
+</pre>
+
+Keywords are any word, or set of words, that identify a database
+record (i.e. a reference) unambiguously. (<strong>refer</strong>
+doesn't like ambiguity.)
+<p>
+If, for example, you want to reference a book by Ray Bradbury,
+and the database contains only one book by Bradbury, a suitable
+keyword would be "Bradbury". If your database contains several
+books by Bradbury, say, <em>Fahrenheit 451</em> and <em>The Martian
+Chronicles</em>, you could reference them with the keywords, "451"
+and "Martian". If, in addition to the two books by Bradbury, you
+also had one whose title was <em>The Martian Mission</em>, suitable
+keywords to reference <em>The Martian Chronicles</em> might be:
+<p>
+<pre>
+ .[ or .[ or .[
+ Bradbury Martian Bradbury Chronicles Martian Chronicles
+ .] .] .]
+</pre>
+
+The database field identifier, %K, lets you create special keywords
+for references. This can be very handy if you need both a "short"
+and a "long" reference to the same work. The short reference might
+be used in footnotes; the long one in a bibliography. Consider the
+following:
+<p>
+<pre>
+ %A Isherwood, Christopher %A Isherwood
+ %T Mr. Norris Changes Trains %T Mr. Norris Changes Trains
+ %d 1935 %K Nor short
+ %t The Last of Mr. \%Norris
+ %a Intro. Tom Crawford
+ %C New York
+ %I New Directions
+ %D 1945
+ %K Norris
+
+</pre>
+
+To access the shorter reference, you'd do
+<p>
+<pre>
+ .[
+ Nor short
+ .]
+</pre>
+
+To access the longer one, you'd do
+<pre>
+ .[
+ Norris
+ .]
+</pre>
+
+<a name="WHERE_REF"><h3><u>4. Telling mom where to put references</u></h3><a>
+<p>
+<strong>Mom</strong> provides several mechanisms for outputting
+references where you want.
+<p>
+<h3>Embedding references in the document body</h3>
+<p>
+References may be embedded in the document body, surrounded by
+parentheses, square brackets, or braces. Use whichever you prefer,
+following the recipes below.
+<p>
+<pre>
+ Parentheses Square brackets Braces
+ ----------- --------------- ------
+
+ .REF( .REF[ .REF{
+ .[ .[ .[
+ keyword(s) keyword(s) keyword(s)
+ .] .] .]
+ .REF) .REF] .REF}
+</pre>
+
+<h3>Footnote or endnote references</h3>
+<p>
+Most times, you'll probably want references in either footnotes or
+endnotes. <strong>Mom</strong> provides a simple mechanism whereby
+you can choose which, or even switch back and forth. The primary
+tag is
+<a href="#REF">REF</a>, which is used like this:
+<p>
+<pre>
+ .REF
+ .[
+ keyword(s)
+ .]
+ .REF
+</pre>
+
+<strong>REF</strong> collects references and outputs them
+where you say with the macros,
+<a href="#FOOTNOTE_REFS">FOOTNOTE_REFS</a>
+or
+<a href="#ENDNOTE_REFS">ENDNOTE_REFS</a>.
+Neither
+<strong>FOOTNOTE_REFS</strong> nor <strong>ENDNOTE_REFS</strong>
+requires an argument. All they do is tell <strong>REF</strong>,
+whenever it's invoked, where to put the references.
+<p>
+A recipe for footnote references looks like this:
+<pre>
+ .FOOTNOTE_REFS
+ .REF
+ .[
+ keyword(s)
+ .]
+ .REF
+</pre>
+
+When <strong>FOOTNOTE_REFS</strong> are enabled, <strong>REF</strong>
+behaves identically to
+<a href="docelement.html#FOOTNOTE">FOOTNOTE</a>,
+so please read the
+<a href="docelement.html#FOOTNOTE_NOTE">HYPER IMPORTANT NOTE</a>
+found in the document entry for <strong>FOOTNOTE</strong>.
+<p>
+The reference between the first and second <strong>REF</strong>
+will be treated as a footnote, as will all subsequent
+<strong>REF</strong> pairs unless you invoke the macro,
+<strong>ENDNOTE_REFS</strong>.
+<p>
+A recipe for endnote references looks like this:
+<pre>
+ .ENDNOTE_REFS
+ .REF
+ .[
+ keyword(s)
+ .]
+ .REF
+</pre>
+
+The reference between the first and second <strong>REF</strong>
+will be treated as an endnote, as will all subsequent
+<strong>REF</strong> pairs unless you invoke the macro,
+<strong>FOOTNOTE_REFS</strong>.
+<p>
+When <strong>ENDNOTE_REFS</strong> are enabled, <strong>REF</strong>
+behaves identically to
+<a href="docelement.html#FOOTNOTE">ENDNOTE</a>,
+so please read the
+<a href="docelement.html#ENDNOTE_NOTE">HYPER IMPORTANT NOTE</a>
+found in the document entry for <strong>ENDNOTE</strong>.
+<p>
+The innate flexibility of this scheme allows you to have both
+footnote references and endnote references in the same document.
+This would be desirable if, say, you wanted "short" references in
+footnotes, and complete references in endnotes.
+<p>
+
+<a name="COLLECTED_REF"><h3>Collected references</h3></a>
+<p>
+Sometimes, you may want to put references in input text near
+sections of text to which they pertain, but not actually want
+them output until later (typically, on a bibliography page).
+<strong>REF</strong> is used for this, too, but you have to make
+sure your <strong>refer</strong> commands block is set up properly.
+The recipe for this is:
+<p>
+<a name="REFER_BLOCK2"></a>
+<pre>
+.R1
+no-label-in-text
+no-label-in-reference
+join-authors ", and " ", " ", and "
+database &lt;full path to the database&gt;
+sort
+accumulate
+.R2
+</pre>
+
+After this set up, and provided you don't issue a
+<strong>FOOTNOTE_REFS</strong> or <strong>ENDNOTE_REFS</strong>
+command, all reference between <strong>REF</strong> pairs will be
+collected for later output.
+<p>
+As a precaution, <strong>mom</strong> will issue a message the
+first time you call <strong>.REF</strong> if neither
+<strong>FOOTNOTE_REFS</strong> nor <strong>ENDNOTE_REFS</strong> is
+in effect. If collected references are what you want, and you have
+set up your <strong>.R1 - .R2</strong> block as above, you may
+safely ignore the message.
+<p>
+<strong>LIMITATION:</strong> You cannot combine "collected"
+references (plain <strong>REF</strong>) with <strong>REF</strong>s
+that are instructed to go into footnotes (with
+<strong>FOOTNOTE_REFS</strong>) or endnotes (with
+<strong>ENDNOTE_REFS</strong>). This is a limitation imposed by
+<strong>refer</strong>, not <strong>mom</strong>.
+
+<a name="BIBLIO_REF"><h3><u>5. Creating bibliography pages</u></h3><a>
+<p>
+Bibliography pages are separate pages, like endnotes, on which
+complete bibliographies are output. And, like endnotes pages, just
+about every element on them can be designed to your specifications
+with control macros. (See
+<a href="#BIBLIO_CONTROL_MACROS">Control macros for bibliographies</a>.)
+A bibliography page that uses <strong>mom</strong>'s defaults
+begins with the macro,
+<a href="BIBLIOGRAPHY">BIBLIOGRAPHY</a>,
+like this:
+<p>
+<pre>
+ .BIBLIOGRAPHY
+</pre>
+
+<p>
+Following <strong>BIBLIOGRAPHY</strong>, you have three choices of
+how to proceed.
+<p>
+If you have elected to have references collected from within the
+body of a document (see above,
+<a href="#COLLECTED_REF">Collected references</a>,
+for instructions), which assumes you have a <strong>refer</strong>
+command block like the one
+<a href="#REFER_BLOCK2">here</a>
+at the top of your document, you need only do
+<p>
+<pre>
+ .BIBLIOGRAPHY
+ .[
+ $LIST$
+ .]
+</pre>
+
+If you want to create the bibliography by hand (which may be the
+case if you've used footnote and/or endnote references throughout
+your document), follow this recipe, which assumes you already have a
+<strong>refer</strong> block like the one
+<a href="#REFER_BLOCK1">here</a>
+at the top of your document:
+<p>
+<pre>
+ .BIBLIOGRAPHY
+ .R1
+ sort
+ accumulate
+ .R2
+ .[ -+
+ keyword(s) |
+ .] | "keyword(s)" are keywords identifying the
+ .[ | particular bibliographic reference you want
+ keyword(s) | from your database. Order doesn't matter here;
+ .] | the refer command, sort, takes care of that.
+ .[ |
+ keyword(s) |
+ .] -+
+ .[
+ $LIST$
+ .]
+</pre>
+
+Your final choice is to output your whole database. Again,
+assuming you have a <strong>refer</strong> block like the one
+<a href="#REFER_BLOCK1">here</a> at the top of your file, you need
+only do:
+<p>
+<pre>
+ .BIBLIOGRAPHY
+ .R1
+ bibliography &lt;full path to database&gt;
+ .R2
+</pre>
+
+If you haven't put a <strong>refer</strong> block in
+your file already, you can put the whole thing after
+<strong>BIBLIOGRAPHY</strong>, like this:
+<p>
+<pre>
+ .BIBLIOGRAPHY
+ .R1
+ no-label-in-text -+
+ no-label-in-reference | These are actually optional
+ database &lt;full path to the database&gt; -+
+ join-authors ", and " ", " ", and "
+ bibliography &lt;full path to database&gt;
+ .R2
+</pre>
+
+Whichever option you choose, <strong>mom</strong> will output a
+full bibliography page, complete with a title (BIBLIOGRAPHY by
+default, but that can be changed).
+
+<a name="INVOKING_REF"><h3><u>6. Invoking groff with mom and refer</u></h3><a>
+<p>
+So, now you've got a document, formatted properly to use
+references processed with <strong>refer</strong>, what do you do to
+output the document?
+<p>
+It's simple. Instead of invoking <strong>groff</strong> with just
+the -mom option, as explained
+<a href="using.html#USING_INVOKING">here</a>,
+invoke groff with the -R option as well, like this:
+<p>
+<pre>
+ groff -R -mom filename
+</pre>
+
+<hr width="66%">
+
+<p>
+<a name="MACROS_REF"><h3><u>Index of bibliography and reference macros</u></h3></a>
+<ul>
+ <li><a href="#REF">Tag: REF</a> -- collected, footnote or endnote references tag
+ <li><a href="#FOOTNOTE_REFS">FOOTNOTE_REFS</a> -- REFs go to footnotes
+ <li><a href="#ENDNOTE_REFS">ENDNOTE_REFS</a> -- REFs go to endnotes
+ <li><a href="#BRACKET_REFS">REF(</a> -- references embedded in text between parentheses
+ <li><a href="#BRACKET_REFS">REF[</a> -- references embedded in text between square brackets
+ <li><a href="#BRACKET_REFS">REF{</a> -- references embedded in text between braces
+ <li><a href="#INDENT_REFS">INDENT_REFS</a> -- manage the 2nd line indent of references
+ <li><a href="#HYPHENATE_REFS">HYPHENATE_REFS</a> -- en/disable hyphenation of references
+ <li><a href="#BIBLIOGRAPHY">BIBLIOGRAPHY</a> -- begin a bibliography page
+ <li><a href="#BIBLIOGRAPHY_TYPE">BIBLIOGRAPHY_TYPE</a> -- plain, or numbered list bibliography
+ <li><a href="#BIBLIO_CONTROL">Bibliography page style control</a>
+</ul>
+<p>
+
+<!---REF--->
+
+<hr width="66%" align="left">
+<a name="REF"><h3><u>Marking off references for footnotes, endnotes, or collection</u></h3></a>
+<p>
+
+Tag: <strong>REF</strong>
+<p>
+The macro, <strong>REF</strong>, tells <strong>mom</strong> that
+what follows is <strong>refer</strong>-specific, a
+keyword-identified reference from a
+<strong>refer</strong> database. Depending on whether you've
+issued a
+<a href="#FOOTNOTE_REFS">FOOTNOTE_REFS</a>
+or
+<a href="#ENDNOTE_REFS">ENDNOTE_REFS</a>
+instruction, <strong>REF</strong> also tells <strong>mom</strong>
+where to place the reference. If <strong>FOOTNOTE_REFS</strong>,
+the reference will be formatted and placed in a footnote. If
+<strong>ENDNOTE_REFS</strong>, the reference will be collected for
+output as an endnote. If you have issued neither instruction, the
+reference will be collected for later output, most likely on a
+<a href="#BIBLIOGRAPHY">bibliography page</a>.
+<p>
+Before you use <strong>REF</strong>, you must create a
+<strong>refer</strong> block containing <strong>refer</strong>
+commands (see
+<a href="#RCOMMANDS_REF">Required refer commands</a>
+in the tutorial, above).
+<p>
+<strong>REF</strong> usage always looks like this:
+<p>
+<pre>
+ .REF
+ .[
+ keyword(s)
+ .]
+ .REF
+</pre>
+
+Notice that <strong>REF</strong> "brackets" the
+<strong>refer</strong> call, and never takes an argument.
+<p>
+What <strong>REF</strong> really is is a convenience. One could,
+for example, put a reference in a footnote by doing
+<p>
+<pre>
+ .FOOTNOTE
+ .[
+ keyword(s)
+ .]
+ .FOOTNOTE OFF
+</pre>
+
+However, if you have a lot of references going into footnotes (or
+endnotes), it's much shorter to type <kbd>.REF/.REF</kbd> than
+<kbd>.FOOTNOTE/.FOOTNOTE OFF</kbd>. It also helps you
+distinguish--visually, in your input file--between footnotes (or
+endnotes) which are references, and footnotes (or endnotes) which
+are explanatory, or expand on the text.
+<p>
+<strong>Additional arguments:</strong> If you're using
+<strong>REF</strong> to put references in footnotes and your
+footnotes need to be indented, you may (indeed, should) pass
+<strong>REF</strong> the same arguments used to indent footnotes.
+See
+<a href="docelement.html#FOOTNOTE">FOOTNOTE</a>.
+<p>
+<strong>Note:</strong>
+When <strong>REF</strong> is used with
+<a href="#FOOTNOTE_REFS">FOOTNOTE_REFS</a>,
+it behaves identically to
+<a href="docelement.html#FOOTNOTE">FOOTNOTE</a>,
+so please read the
+<a href="docelement.html#FOOTNOTE_NOTE">HYPER IMPORTANT NOTE</a>
+found in the document entry for <strong>FOOTNOTE</strong>.
+<p>
+When <strong>REF</strong> is used with
+<a href="#ENDNOTE_REFS">ENDNOTE_REFS</a>,
+it behaves identically to
+<a href="docelement.html#FOOTNOTE">ENDNOTE</a>,
+so please read the
+<a href="docelement.html#ENDNOTE_NOTE">HYPER IMPORTANT NOTE</a>
+found in the document entry for <strong>ENDNOTE</strong>.
+
+<br>
+
+<!---FOOTNOTE_REFS--->
+
+<hr width="33%" align="left">
+<a name="FOOTNOTE_REFS"><h3><u>Instruct REF to put references in footnotes</u></h3></a>
+<p>
+
+Macro: <strong>FOOTNOTE_REFS</strong>
+<p>
+<strong>FOOTNOTE_REFS</strong> is an instruction to
+<a href="#REF">REF</a>,
+saying, "put all subsequent references bracketed by the
+<strong>REF</strong> macro into footnotes." You invoke it by
+itself, with no argument.
+<p>
+When <strong>FOOTNOTE_REFS</strong> is in effect, regular
+footnotes, (i.e. those introduced with <kbd>.FOOTNOTE</kbd> and
+terminated with <kbd>.FOOTNOTE OFF</kbd>) continue to behave
+normally.
+<p>
+You may switch between <strong>FOOTNOTE_REFS</strong> and
+<a href="#ENDNOTE_REFS">ENDNOTE_REFS</a>
+at any time.
+<p>
+If you have a lot of footnote references, and are identifying
+footnotes by line number rather than by markers in the text, you may
+want to enable
+<a href="docelement.html#FOOTNOTES_RUN_ON">FOOTNOTES_RUN_ON</a>
+in conjunctions with <strong>FOOTNOTE_REFS</strong>.
+
+<br>
+
+<!---ENDNOTE_REFS--->
+
+<hr width="33%" align="left">
+<a name="ENDNOTE_REFS"><h3><u>Instruct REF to put references in endnotes</u></h3></a>
+<p>
+
+Macro: <strong>ENDNOTE_REFS</strong>
+<p>
+<strong>ENDNOTE_REFS</strong> is an instruction to
+<a href="#REF">REF</a>,
+saying, "add all subsequent references bracketed by the
+<strong>REF</strong> macro to endnotes." You invoke it by
+itself, with no argument.
+<p>
+When <strong>ENDNOTE_REFS</strong> is in effect,
+<strong>mom</strong> continues to format regular endnotes, (i.e.
+those introduced with <kbd>.ENDNOTE</kbd> and terminated with
+<kbd>.ENDNOTE OFF</kbd>) in the normal way.
+<p>
+You may switch between <strong>ENDNOTE_REFS</strong> and
+<a href="#FOOTNOTE_REFS">FOOTNOTE_REFS</a>
+at any time.
+
+<br>
+
+<!---BRACKET_REFS--->
+
+<hr width="33%" align="left">
+<a name="BRACKET_REFS"><h3><u>References embedded in text</u></h3></a>
+<p>
+
+Macro pair: <strong>REF(</strong>&nbsp;&nbsp;...&nbsp;&nbsp;<strong>REF)</strong>
+<br>
+Macro pair: <strong>REF[</strong>&nbsp;&nbsp;...&nbsp;&nbsp;<strong>REF]</strong>
+<br>
+Macro pair: <strong>REF{</strong>&nbsp;&nbsp;...&nbsp;&nbsp;<strong>REF}</strong>
+<p>
+You may sometimes want to embed references directly into the body
+of your documents, typically, but not always, inside parentheses.
+<strong>Mom</strong> makes this possible through the use of the
+<strong>REF&lt;bracket&nbsp;type&gt;</strong> macros.
+<p>
+All three macro pairs, above, are invoked the same way, namely by
+introducing the reference with the first ("open") macro of
+the <strong>REF&lt;bracket&nbsp;type&gt;</strong> pair, and
+terminating it with the second ("close")
+<strong>REF&lt;bracket&nbsp;type&gt;</strong> of the pair. For
+example
+<p>
+<pre>
+ .REF(
+ .[
+ keyword(s)
+ .]
+ .REF)
+</pre>
+
+will embed a reference in the body of your document, surrounded by
+parentheses. <strong>.REF[</strong>&nbsp;...&nbsp;<strong>.REF]</strong> will
+surround the reference with square brackets.
+<strong>.REF{</strong>&nbsp;...&nbsp;<strong>.REF}</strong> will surround it with
+curly braces.
+<br>
+
+<!---INDENT_REFS--->
+
+<hr width="33%" align="left">
+<a name="INDENT_REFS"><h3><u>Manage the second-line indent of references</u></h3></a>
+<p>
+
+<nobr>Macro: <strong>INDENT_REFS</strong> FOOTNOTE | ENDNOTE | BIBLIO &lt;indent&gt; </nobr>
+<br>
+<em>*&lt;indent&gt; requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
+<p>
+Proper MLA-style references should have their second, and subsequent
+lines, if any, indented. Since <strong>mom</strong> formats
+references in MLA style, she automatically indents second lines.
+By default, the indent for the second line of references,
+regardless of whether the references appear in footnotes, endnotes,
+or bibliographies, is 1.5
+<a href="definitions.html#TERMS_EM">ems</a>
+for
+<a href="docprocessing.html#PRINTSTYLE">PRINSTYLE</a>
+<strong>TYPESET</strong>
+and 2 ems for
+<a href="docprocessing.html#PRINTSTYLE">PRINSTYLE</a>
+<strong>TYPEWRITE</strong>.
+<p>
+If you'd like to change the indent for footnotes, endnotes or
+bibliographies, just invoke <strong>INDENT_REFS</strong> with a
+first argument telling <strong>mom</strong> for which you want the
+indent changed, and a second argument saying what you'd like the
+indent to be. For example, if you want the second-line indent of
+references on a bibliography page to be 3
+<a href="definitions.html#TERMS_PICAS_POINTS">picas</a>,
+<p>
+<pre>
+ .INDENT_REFS BIBLIO 3P
+</pre>
+
+is how you'd set it up.
+<p>
+<strong>Tip:</strong> if you are identifying endnotes by line
+number
+(<a href="docelement.html#ENDNOTE_MARKER_STYLE">ENDNOTE_MARKER_STYLE</a> <strong>LINE</strong>)
+and you have instructed <strong>mom</strong> to put references
+bracketed by
+<a href="#REF">REF</a>
+into endnotes (with
+<a href="#ENDNOTE_REFS">ENDNOTE_REFS</a>),
+you will probably want to adjust the second-line indent for
+references in endnotes, owing to the way <strong>mom</strong>
+formats line-numbered endnotes. Study the output of such
+documents to see whether an indent adjustment is required.
+<br>
+
+<!---HYPHENATE_REFS--->
+
+<hr width="33%" align="left">
+<a name="HYPHENATE_REFS"><h3><u>Enable/disable hyphenation of references</u></h3></a>
+<p>
+
+<nobr>Macro: <strong>HYPHENATE_REFS</strong> &lt;toggle&gt;</nobr>
+<p>
+If you have hyphenation turned on for a document (see <a
+href="typesetting.html#HY">HY</a>),
+and in most cases you probably do, <strong>mom</strong> will
+hyphenate references bracketed by the
+<a href="#REF">REF</a>
+macro. Since references typically contain quite a lot of proper
+names, which shouldn't be hyphenated, you may want to disable
+hyphenation for references.
+<p>
+<strong>HYPHENATE_REFS</strong> is a toggle macro;
+invoking it by itself will turn automatic hyphenation of
+<strong>REF</strong>-bracketed references on (the default).
+Invoking it with any other argument (<strong>OFF</strong>,
+<strong>NO</strong>, <strong>X</strong>, etc.) will disable
+automatic hyphenation for references bracketed by
+<strong>REF</strong>.
+<p>
+An alternative to turning reference hyphenation off is to prepend
+to selected proper names in your <strong>refer</strong> database
+the <strong>groff</strong>
+<a href="definitions.html#TERMS_DISCRETIONARYHYPHEN">discretionary hyphen</a>
+character, <strong>\%</strong>. (See
+<a href="#REF_DISC_HY">here</a>
+in the tutorial for an example.)
+<p>
+<strong>Note:</strong> references embedded in the body of a document
+with
+<a href="#BRACKET_REFS">REF</a><strong>&lt;bracket&nbsp;type&gt;</strong>
+are considered part of
+<a href="definitions.html#TERMS_RUNNING">running text</a>,
+and are hyphenated (or not) according to whether hyphenation
+is turned on or off for running text. Therefore, if you want to
+disable hyphenation for such references, you must do so
+temporarily, with <strong>HY</strong>, like this:
+<p>
+<pre>
+ .HY OFF
+ .REF(
+ .[
+ keyword(s)
+ .]
+ .REF)
+ .HY
+</pre>
+
+Alternatively, sprinkle your database fields liberally with
+<strong>\%</strong>.
+<br>
+
+<!---BIBLIOGRAPHY--->
+
+<hr width="33%" align="left">
+<a name="BIBLIOGRAPHY"><h3><u>Begin a bibliography page</u></h3></a>
+<p>
+
+Macro: <strong>BIBLIOGRAPHY</strong>
+<br>
+<p>
+If you want to append a bibliography to your document, all you need
+do is invoke <strong>BIBLIOGRAPHY</strong> at the place you want
+it. <strong>BIBLIOGRAPHY</strong> breaks to a new page, prints the
+title (BIBLIOGRAPHY by default, but that can be changed), and awaits
+<strong>refer</strong> instructions. How to create bibliographies
+is covered in the tutorial section,
+<a href="#BIBLIO_REF">Creating bibliography pages</a>.
+<p>
+See the
+<a href="#BIBLIO_CONTROL">Bibliography page style control macros</a>
+for macros to tweak, design and control the appearance of
+bibliography pages.
+<br>
+
+<!---BIBLIOGRAPHY_TYPE--->
+
+<hr width="33%" align="left">
+<a name="BIBLIOGRAPHY_TYPE"><h3><u>Plain, or numbered list bibliography</u></h3></a>
+<p>
+
+<nobr>Macro: <strong>BIBLIOGRAPHY_TYPE</strong> PLAIN | LIST [ &lt;list separator&gt; ] [ &lt;list prefix&gt; ]</nobr>
+<p>
+<strong>Mom</strong> offers two styles of bibliography output: plain,
+or numbered list style. With <strong>PLAIN</strong>, bibliography
+entries are output with no enumerators. With <strong>LIST</strong>,
+each entry is numbered.
+<p>
+Entering <kbd>.BIBLIOGRPHY_TYPE PLAIN</kbd> gives you a plain
+bibliography.
+<p>
+Entering <kbd>.BIBLIOGRAPHY_TYPE LIST</kbd> gives you an enumerated
+bibliography. The two optional arguments,
+<strong>&lt;list&nbsp;separator&gt;</strong> and
+<strong>&lt;list&nbsp;prefix&gt;</strong> have the same meaning as
+the equivalent arguments to
+<a href="docelement.html#LIST">LIST</a>
+(i.e. <strong>&lt;separator&gt;</strong> and <strong>&lt;prefix&gt;</strong>).
+<p>
+You may enter <strong>BIBLIOGRAPHY_TYPE</strong> either before or
+after <strong>BIBLIOGRAPHY</strong>. It must, however, always come
+before the <strong>refer</strong> command to output bibliographies.
+(See the tutorial section,
+<a href="#BIBLIO_REF">Creating bibliography pages</a>,
+for instructions on how to output bibliographies.)
+<p>
+<strong>Mom</strong>'s default <strong>BIBLIOGRAPHY_TYPE</strong>
+is <strong>LIST</strong>, with a period (dot) as the separator, and
+no prefix.
+
+<br>
+
+<!---BIBLIO_CONTROL--->
+
+<hr width="66%" align="left">
+<a name="BIBLIO_CONTROL"><h3><u>Bibliography page style control</u></h3></a>
+
+<p>
+<strong>Mom</strong> processes bibliography pages in a manner very
+similar to the way she processes endnotes pages. The bibliography
+page control macros, therefore, behave in the same way as their
+endnotes pages equivalents.
+<br>
+<ol>
+ <li><a href="#BIBLIO_GENERAL"><strong>General bibliography page style control</strong></a>
+ <ul>
+ <li><a href="#BIBLIO_STYLE">Base family/font/quad for bibliographies</a>
+ <li><a href="#BIBLIO_PT_SIZE">Base point size for bibliographies</a>
+ <li><a href="#BIBLIO_LEAD">Leading of bibliographies</a>
+ <li><a href="#SINGLESPACE_BIBLIO">Singlespace bibliographies (for TYPEWRITE only)</a>
+ <li><a href="#BIBLIO_NO_COLUMNS">Turning off column mode during bibliography output</a>
+ <li>Pagination of bibliographies:
+ <ul>
+ <li><a href="#BIBLIO_PAGENUM_STYLE">Bibliography pages page numbering style</a>
+ <li><a href="#BIBLIO_FIRST_PAGENUMBER">Setting the first page number of bibliography pages</a>
+ <li><a href="#BIBLIO_NO_FIRST_PAGENUM">Omitting a page number on the first page of bibliographies</a>
+ </ul>
+ <li><a href="#SUSPEND_PAGINATION">Suspending pagination of bibliographies</a>
+ </ul>
+ <li><a href="#BIBLIO_HEADER_CONTROL"><strong>Bibliography pages header/footer control</strong></a>
+ <ul>
+ <li><a href="#BIBLIO_MODIFY_HDRFTR">Modifying what goes in the bibliography pages header/footer</a>
+ <li><a href="#BIBLIO_HDRFTR_CENTER">Enabling a header/footer centre when doctype is CHAPTER</a>
+ <li><a href="#BIBLIO_ALLOWS_HEADERS">Allow headers on bibliography pages</a>
+ </ul>
+ <li><a href="#BIBLIO_MAIN_TITLE"><strong>Bibliography page head (i.e. the title at the top) control</strong></a>
+ <ul>
+ <li><a href="#BIBLIO_STRING">Creating/modifying the bibliography page head</a>
+ <li><a href="#BIBLIO_STRING_CONTROL">Bibliography page head control</a>
+ <li><a href="#BIBLIO_STRING_UNDERSCORE">Bibliography page head underscoring</a>
+ <li><a href="#BIBLIO_STRING_CAPS">Bibliography page head capitalization</a>
+ </ul>
+ </ul>
+</ol>
+<hr>
+
+<a name="BIBLIO_GENERAL"><h2><u>1. General bibliography page style control</u></h2>
+
+<a name="BIBLIO_STYLE"><h3><u>*Bibliography family/font/quad</u></h3></a>
+<p>
+See
+<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
+<p>
+<pre>
+.BIBLIOGRAPHY_FAMILY default = prevailing document family; default is Times Roman
+.BIBLIOGRAPHY_FONT default = roman
+.BIBLIOGRAPHY_QUAD* default = justified
+
+*Note: BIBLIOGRAPHY_QUAD must be set to either L or J
+</pre>
+
+<!---BIBLIO_PT_SIZE--->
+
+<a name="BIBLIO_PT_SIZE"><h3><u>*Bibliography point size</u></h3></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_PT_SIZE</strong> &lt;base type size of bibliography&gt;</nobr>
+
+<p>
+Unlike most other control macros that deal with size of document
+elements, <strong>BIBLIOGRAPHY_PT_SIZE</strong> takes as its argument an
+absolute value, relative to nothing. Therefore, the argument represents
+the size of bibliography type in
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>,
+unless you append an alternative
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>.
+For example,
+<p>
+<pre>
+ .BIBLIOGRAPHY_PT_SIZE 12
+</pre>
+
+sets the base point size of type on the bibliography page to 12
+points, whereas
+<p>
+<pre>
+ .BIBLIOGRAPHY_PT_SIZE .6i
+</pre>
+
+sets the base point size of type on the bibliography page to 1/6 of an
+inch.
+<p>
+The type size set with <strong>BIBLIOGRAPHY_PT_SIZE</strong> is the size of
+type used for the text of the bibliographies, and forms the basis from which
+the point size of other bibliography page elements is calculated.
+<p>
+The default for
+<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPESET</a>
+is 12.5 points (the same default size used in the body of the document).
+<p>
+
+<!---BIBLIO_LEAD--->
+
+<a name="BIBLIO_LEAD"><h3><u>*Bibliography lead</u></h3></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_LEAD</strong> &lt;base leading of bibliographies&gt; [ ADJUST ]</nobr>
+<br>
+<em>*Does not require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>; points is assumed</em>
+
+<p>
+Unlike most other control macros that deal with leading of document
+elements, <strong>BIBLIOGRAPHY_LEAD</strong> takes as its argument an
+absolute value, relative to nothing. Therefore, the argument represents
+the
+<a href="definitions.html#TERMS_LEADING">leading</a>
+of endnotes in
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>
+unless you append an alternative
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>.
+For example,
+<p>
+<pre>
+ .BIBLIOGRAPHY_LEAD 14
+</pre>
+
+sets the base leading of type on the bibliography page to 14
+points, whereas
+<p>
+<pre>
+ .BIBLIOGRAPHY_LEAD .5i
+</pre>
+
+sets the base leading of type on the bibliography page to 1/2 inch.
+<p>
+If you want the leading of bibliographies adjusted to fill the page,
+pass <strong>BIBLIOGRAPHY_LEAD</strong> the optional argument
+<strong>ADJUST</strong>. (See
+<a href="docprocessing.html#DOC_LEAD_ADJUST">DOC_LEAD_ADJUST</a>
+for an explanation of leading adjustment.)
+<p>
+The default for
+<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPESET</a>
+is 14 points, adjusted.
+<p>
+<strong>NOTE:</strong> Even if you give <strong>mom</strong> a
+<strong>DOC_LEAD_ADJUST OFF</strong> command, she will still, by
+default, adjust bibliography leading. You MUST enter
+<strong>BIBLIOGRAPHY_LEAD &lt;lead&gt;</strong> with no
+<strong>ADJUST</strong> argument to disable this default behaviour.
+<p>
+
+<!---SINGLESPACE_BIBLIO--->
+
+<a name="SINGLESPACE_BIBLIO"><h3><u>*Singlespace bibliographies (TYPEWRITE only)</u></h3></a>
+<p>
+<nobr>Macro: <strong>SINGLESPACE_BIBLIOGRAPHY</strong> &lt;toggle&gt;</nobr>
+
+<p>
+If your
+<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE</a>
+is <strong>TYPEWRITE</strong> and you use TYPEWRITE's default
+double-spacing, bibliographies are double-spaced. If your document
+is single-spaced, bibliographies are single-spaced.
+<p>
+If, for some reason, you'd prefer that bibliographies be single-spaced
+in an otherwise double-spaced document (including double-spaced
+<a href="rectoverso.html#COLLATE">collated</a>
+documents), invoke <strong>SINGLESPACE_BIBLIOGRAPHY</strong> with
+with no argument.
+<p>
+
+<!---BIBLIO_SPACING--->
+
+<a name="BIBLIO_SPACING"><h3><u>*Adjusting the space between bibliography entries</u></h3></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_SPACING</strong> &lt;amount of space&gt; </nobr>
+<br>
+<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
+
+<p>
+By default, <strong>mom</strong> inserts 1 linespaces between
+bibliography entries on bibliography pages. If you'd prefer she
+add a different amount of space, instruct her to do so with the
+macro, <strong>BIBLIOGRAPHY_SPACING</strong>. Say, for example,
+you'd prefer only 1/2 linespace. That would be done with
+<p>
+<pre>
+ .BIBLIOGRAPHY_SPACING .5v
+</pre>
+
+As with endnotes pages, owing to the space inserted between bibliography
+entries, bibliography pages may have hanging bottom margins.
+Unlike endnotes pages, <strong>mom</strong> is sad to report that
+there's nothing you can do about this, except a) pray things work
+out, or b) set your <strong>BIBLIOGRAPHY_SPACING</strong> to zero.
+
+<!---BIBLIO_NO_COLUMNS--->
+
+<a name="BIBLIO_NO_COLUMNS"><h3><u>*Turning off column mode during bibliography output</u></h3></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_NO_COLUMNS</strong> &lt;toggle&gt;</nobr>
+
+<p>
+By default, if your document is
+<a href="columns.html#COLUMNS">set in columns</a>,
+<strong>mom</strong> sets the bibliographies in columns, too. However,
+if your document is set in columns and you'd like the bibliographies not
+to be, just invoke <strong>BIBLIOGRAPHY_NO_COLUMNS</strong> with no
+argument. The bibliography pages will be set to the full page measure
+of your document.
+<p>
+If you output bibliographies at the end of each document in a
+<a href="rectoverso.html#COLLATE">collated</a>
+document set in columns, column mode will automatically
+be reinstated for each document, even with
+<strong>BIBLIOGRAPHY_NO_COLUMNS</strong> turned on.
+<p>
+
+<!---BIBLIO_PAGENUM_STYLE--->
+
+<a name="BIBLIO_PAGENUM_STYLE"><h3><u>*Bibliography-page page numbering style</u></h3></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_PAGENUM_STYLE</strong> DIGIT | ROMAN | roman | ALPHA | alpha</nobr>
+
+<p>
+Use this macro to set the page numbering style of bibliography pages.
+The arguments are identical to those for
+<a href="headfootpage.html#PAGENUM_STYLE">PAGENUM_STYLE</a>.
+The default is <strong>digit</strong>. You may want to change it
+to, say, <strong>alpha</strong>, which you would do with
+<p>
+<pre>
+ .BIBLIOGRAPHY_PAGENUM_STYLE alpha
+</pre>
+
+<!---BIBLIO_FIRST_PAGENUMBER--->
+
+<a name="BIBLIO_FIRST_PAGENUMBER"><h3><u>*Setting the first page number of bibliography pages</u></h3></a>
+<p>
+<nobr>Macro: <strong>BIBILOGRAPHY_FIRST_PAGENUMBER</strong> &lt;page # that appears on page 1 of bibliographies&gt;</nobr>
+
+<p>
+Use this macro with caution. If all bibliographies for several
+<a href="rectoverso.html#COLLATE">collated</a>
+documents are to be output at once, i.e. not at the end of each
+separate doc, <strong>BIBLIOGRAPHY_FIRST_PAGENUMBER</strong> tells
+<strong>mom</strong> what page number to put on the first page of
+the bibliography.
+<p>
+If you set <strong>BIBLIOGRAPHY_FIRST_PAGENUMBER</strong> in collated
+documents where the bibliographies are output after each separate doc,
+you have to reset every separate document's first page number after
+<a href="rectoverso.html#COLLATE">COLLATE</a>
+and before
+<a href="docprocessing.html#START">START</a>.
+<p>
+
+<!---BIBLIO_NO_FIRST_PAGENUN--->
+
+<a name="BIBLIO_NO_FIRST_PAGENUM"><h3><u>*Omitting a page number on the first page of bibliographies</u></h3></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_NO_FIRST_PAGENUM</strong> &lt;toggle&gt;</nobr>
+
+<p>
+This macro is for use only if <strong>FOOTERS</strong> are on. It
+tells
+<a href="#BIBLIOGRAPHY">BIBLIOGRAPHY</a>
+not to print a page number on the first bibliography page.
+<strong>Mom</strong>'s default is to print the page number.
+<p>
+
+<!---SUSPEND_PAGINATION--->
+
+<a name="SUSPEND_PAGINATION"><h3><u>*Suspending pagination of bibliography pages</u></h3></a>
+<p>
+Macro: <strong>SUSPEND_PAGINATION</strong>
+<br>
+Macro: <strong>RESTORE_PAGINATION</strong>
+
+<p>
+<strong>SUSPEND_PAGINATION</strong> doesn't take an argument.
+Invoked immediately prior to
+<a href="#BIBLIOGRAPHY">BIBLIOGRAPHY</a>,
+it turns off pagination for the duration of the bibliography.
+<strong>Mom</strong> continues, however to increment page numbers
+silently.
+<p>
+To restore normal document pagination after bibliographies, invoke
+<strong>RESTORE_PAGINATION</strong> (again, with no argument)
+immediately after you've finished with your bibliography.
+
+<a name="BIBLIO_HEADER_CONTROL"><h2><u>2. Bibliography page header/footer control</u></h2></a>
+<p>
+<a name="BIBLIO_MODIFY_HDRFTR"></a>
+If you wish to modify what appears in the header/footer that appears
+on bibliography pages, make the changes before you invoke
+<a href="#BIBLIOGRAPHY">BIBLIOGRAPHY</a>,
+not afterwards.
+<p>
+Except in the case of
+<a href="docprocessing.html#DOCTYPE">DOCTYPE CHAPTER</a>,
+<strong>mom</strong> prints the same header or footer used throughout
+the document on bibliography pages. Chapters get treated differently
+in that, by default, <strong>mom</strong> does not print the
+header/footer centre string (normally the chapter number or chapter
+title.) In most cases, this is what you want. However, should you
+<em>not</em> want <strong>mom</strong> to remove the centre string from
+the bibliography pages headers/footers, invoke
+<a href="#BIBLIOGRAPHY_HDRFTR_CENTER">BIBLIOGRAPHY_HEADER_CENTER</a>
+with no argument.
+<p>
+An important change you may want to make is to put the word
+&quot;Bibliography&quot; in the header/footer centre position.
+To do so, do
+<p>
+<pre>
+ .HEADER_CENTER "Bibliography"
+ or
+ .FOOTER_CENTER "Bibliography"
+</pre>
+
+prior to invoking <strong>.BIBLIOGRAPHY</strong>. If your
+<a href="docprocessing.html#DOCTYPE">DOCTYPE</a>
+is <kbd>CHAPTER</kbd>, you must also invoke
+<a href="#BIBLIOGRAPHY_HDRFTR_CENTER">BIBLIOGRAPHY_HEADER_CENTER</a>
+for the <strong>HEADER_CENTER</strong> to appear.
+<p>
+
+<a name="BIBLIO_HDRFTR_CENTER"><h3><u>*Bibliography page header/footer centre string</u></h3></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_HEADER_CENTER</strong> toggle</nobr>
+
+<p>
+If your
+<a href="docprocessing.html#DOCTYPE">DOCTYPE</a>
+is <kbd>CHAPTER</kbd> and you want <strong>mom</strong> to include
+a centre string in the headers/footers that appear on bibliography pages,
+invoke <strong>BIBLIOGRAPHY_HEADER_CENTER</strong> (or
+<strong>BIBLIOGRAPHY_FOOTER_CENTER</strong>) with no argument.
+<strong>Mom</strong>'s default is NOT to print the centre string.
+<p>
+If, for some reason, having enabled the header/footer centre string
+on bibliography pages, you wish to disable it, invoke the same macro
+with any argument (<strong>OFF, QUIT, Q, X</strong>...).
+<p>
+
+<a name="BIBLIO_ALLOWS_HEADERS"><h3><u>*Allow headers on bibliography pages</u></h3></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_ALLOWS_HEADERS</strong> &lt;none&gt; | ALL</nobr>
+
+<p>
+By default, if <strong>HEADERS</strong> are on, <strong>mom</strong>
+prints page headers on all bibliography pages except the first. If you
+don't want her to print headers on bibliography pages, do
+<p>
+<pre>
+ .BIBLIOGRAPHY_ALLOWS_HEADERS OFF
+</pre>
+
+If you want headers on every page <em>including the first</em>, do
+<p>
+<pre>
+ .BIBLIOGRAPHY_ALLOWS_HEADERS ALL
+</pre>
+
+<strong>NOTE:</strong> If <strong>FOOTERS</strong> are on,
+<strong>mom</strong> prints footers on every bibliography page. This is
+a style convention. In <strong>mom</strong>, there is no such beast
+as <strong>BIBLIOGRAPHY_ALLOWS_FOOTERS OFF</strong>.
+<p>
+
+<a name="BIBLIO_MAIN_TITLE"><h2><u>3. Bibliography page first page head (title) control</u></h2>
+
+<!---BIBLIO_STRING--->
+
+<a name="BIBLIO_STRING"><h3><u>*Bibliography pages first page head (title) string</u></h3></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_STRING</strong> &quot;&lt;head to print at the top of bibliography pages&gt;&quot;</nobr>
+
+<p>
+By default, <strong>mom</strong> prints the word &quot;BIBLIOGRAPHY&quot;
+as a head at the top of the first page of a bibliography. If you want her
+to print something else, invoke <strong>BIBLIOGRAPHY_STRING</strong> with
+the bibliography page head you want, surrounded by double-quotes. If
+you don't want a head at the top of the first bibliography page, invoke
+<strong>BIBLIOGRAPHY_STRING</strong> with a blank argument (either two
+double-quotes side by side -- <kbd>&quot;&quot;</kbd> -- or no argument
+at all).
+<p>
+
+<!---BIBLIO_STRING_CONTROL--->
+
+<a name="BIBLIO_STRING_CONTROL"><h3><u>*Bibliography page first page head (title) control</u></h3></a>
+<p>
+See
+<a href="#CONTROL_MACRO_ARGS">Arguments to the control macros</a>.
+<p>
+<pre>
+.BIBLIOGRAPHY_STRING_FAMILY default = prevailing document family; default is Times Roman
+.BIBLIOGRAPHY_STRING_FONT default = bold
+.BIBLIOGRAPHY_STRING_SIZE* default = +1
+.BIBLIOGRAPHY_STRING_QUAD default = centred
+
+*Relative to the size of the bibliography text (set with BIBLIOGRAPHY_PT_SIZE)
+</pre>
+
+<!---BIBLIO_STRING_UNDERSCORE--->
+
+<a name="BIBLIO_STRING_UNDERSCORE"><h3><u>*Bibliography-page head (title) underscoring</h3></u></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_STRING_UNDERSCORE</strong> toggle | 2</nobr>
+
+<p>
+Invoked by itself, <strong>BIBLIOGRAPHY_STRING_UNDERSCORE</strong> will
+underscore the bibliography page head. Invoked with the argument 2
+(i.e. the digit 2), <strong>BIBLIOGRAPHY_STRING_UNDERSCORE</strong> will
+double-underscore the head. Invoked with any other argument, the macro
+disables underscoring of the head.
+<p>
+<strong>Mom</strong>'s default is to double-underscore the
+head, therefore if you want no underscoring, you must insert
+<kbd>.BIBLIOGRAPHY_STRING_UNDERSCORE OFF</kbd> (or <kbd>QUIT, X, NO,
+NONE,</kbd> etc.) into your document prior to outputting a
+bibliography with
+<a href="#BIBLIOGRAPHY">BIBLIOGRAPHY</a>.
+
+<!---BIBLIO_STRING_CAPS--->
+
+<a name="BIBLIO_STRING_CAPS"><h3><u>*Bibliography-page head (title) automatic capitalization</h3></u></a>
+<p>
+<nobr>Macro: <strong>BIBLIOGRAPHY_STRING_CAPS</strong> toggle</nobr>
+
+<p>
+Invoked by itself, <strong>BIBLIOGRAPHY_STRING_CAPS</strong> will
+automatically capitalize the bibliography page head. Invoked with any
+other argument, the macro disables automatic capitalization of the
+head.
+<p>
+If you're generating a table of contents, you may want the
+bibliography page head string in caps, but the toc entry in caps/lower
+case. If the argument to
+<a href="#BIBLIOGRAPHY_STRING">BIBLIOGRAPHY_STRING</a>
+is in caps/lower case and <strong>BIBLIOGRAPHY_STRING_CAPS</strong> is
+on, this is exactly what will happen.
+<p>
+<strong>Mom</strong>'s default is to capitalize the bibliography-page
+head string.
+<p>
+
+<br>
+
+<hr>
+<a href="letter.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="cover.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="#TOP">Top</a>&nbsp;&nbsp;
+<a href="toc.html">Back to Table of Contents</a>
+</body>
+</html>
diff --git a/contrib/groff/contrib/mom/momdoc/reserved.html b/contrib/groff/contrib/mom/momdoc/reserved.html
index 193b56d88016..ab8eeb193396 100644
--- a/contrib/groff/contrib/mom/momdoc/reserved.html
+++ b/contrib/groff/contrib/mom/momdoc/reserved.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -7,11 +8,26 @@
<!====================================================================>
-<a href="appendices.html#TOP">Prev</a>&nbsp;&nbsp; <a href="toc.html">Back to Table of Contents</a> <a name="TOP"></a> <a name="RESERVED"> <h2 align="center"><u>LIST OF RESERVED WORDS</u></h2> </a> <p> The following is a list of &quot;reserved&quot; words used by <strong>mom</strong>. Before changing the name of any macro or document element tag with <a href="goodies.html#ALIAS">ALIAS</a>, I strongly recommend doing a search of this page for your proposed new name. If you find it in the left hand column, DON'T USE IT. Choose something else instead. <p>
+<a href="appendices.html#TOP">Prev</a>&nbsp;&nbsp; <a href="toc.html">Back to Table of Contents</a>
+<p>
+
+<a name="TOP"></a>
+<a name="RESERVED">
+<h1 align="center"><u>LIST OF RESERVED WORDS</u></h1>
+</a>
+<p> The following is a list of &quot;reserved&quot; words used by
+<strong>mom</strong>. Before changing the name of any macro or
+document element tag with
+<a href="goodies.html#ALIAS">ALIAS</a>,
+I strongly recommend doing a search of this page for your proposed
+new name. If you find it in the left hand column, DON'T USE IT.
+Choose something else instead.
+<p>
Anyone interested in playing around inside <strong>mom</strong>'s macro
file (om.tmac) will find this list useful as well since it lists all
-(I hope) the macros, strings, and number registers <strong>mom</strong>
-uses, along with brief descriptions of their functions.
+(I hope) the macros, strings, diversions and number registers
+<strong>mom</strong> uses, along with brief descriptions of their
+functions.
<p>
<pre>
TYPESETTING
@@ -28,25 +44,32 @@ PAPER Letter, legal, or A4
B_MARGIN Space to leave at page bottom
L_MARGIN Page offset
-R_MARGIN Line length as a function of pagewidth - pageoffset - rightmargin
+R_MARGIN Line length as a function of
+ pagewidth minus pageoffset minus rightmargin
T_MARGIN Advance lead from page top
Page control
------------
-DO_B_MARGIN Margin at bottom of page
-DO_T_MARGIN Margin at top of page
+DO_B_MARGIN Margin at bottom of page; trap-invoked
+DO_T_MARGIN Margin at top of page; trap-invoked
Style
-----
-CONDENSE Set percentage of pseudo-condense (alias of CONDENSE_OR_EXTEND)
-EXTEND Set percentage of pseudo-extend (alias of CONDENSE_OR_EXTEND)
-FAMILY Family
-FT Font
-LL Line length
-LS Leading (.vs)
-PT_SIZE Point size
-SETBOLDER Set degree of emboldening (pseudo-bold) in units
-SETSLANT Set degree of pseudo-italic
+COLOR Change color of text to predefined value
+CONDENSE Set percentage of pseudo-condense (alias of
+ CONDENSE_OR_EXTEND)
+EXTEND Set percentage of pseudo-extend (alias of
+ CONDENSE_OR_EXTEND)
+FAMILY Family
+FT Font
+FALLBACK_FONT Font to use whenever FAMILY or FT errors occur
+LL Line length
+LS Leading (.vs)
+NEWCOLOR Define a text color
+PT_SIZE Point size
+SETBOLDER Set degree of emboldening (pseudo-bold) in units
+SETSLANT Set degree of pseudo-italic
+XCOLOR Initialize a color from rgb.txt
Autolead
--------
@@ -55,11 +78,11 @@ AUTOLEAD Always lead n points more than .PT_SIZE
Flush
-----
JUSTIFY Justified text
-QUAD Filled text, left, right, or center
+QUAD Filled text, left, right, or centre
Quad
----
-CENTER Non-filled text, center
+CENTER Non-filled text, centre
LEFT Non-filled text, left
RIGHT Non-filled text, right
@@ -129,32 +152,45 @@ Misc + Support
BR_AT_LINE_KERN Deposit a break before RW and WE
CAPS Convert u/lc to UC
COMMENT Don't print lines till COMMENT OFF (alias of SILENT)
-DROPCAP_ADJUST Points (poss. fractional) to add/subtract from drop caps
+DROPCAP_ADJUST Points (poss. fractional) to add/subtract
+ from drop caps
DROPCAP Create drop cap
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
-EW Extra white -- loosen overall line kern (character spacing)
+ESC_CHAR Alias for .ec
+EW Extra white -- loosen overall line kern
+ (character spacing)
LEADER_CHARACTER Sets leader character
PAD Insert padding spaces at marked places
PADMARKER Sets character to use instead of # in PAD
-PRINT Simply prints args passed to it; keeps my code indented nicely
-RW Reduce white -- tighten overal line kern (character spacing)
+PRINT Simply prints args passed to it; keeps my code
+ indented nicely
+RW Reduce white -- tighten overall line kern
+ (character spacing)
SILENT Don't print lines till SILENT OFF
-SIZESPECS Get cap-height, x-height and descender depth for current point size
+SIZESPECS Get cap-height, x-height and descender depth for
+ current point size
TRAP Turn traps off or on
+++DIVERSIONS+++
NO_FLASH Diverts output of SILENT or COMMENT so they don't print
-NULL Diverts SIZESPECS in PRINT_HDRFTR so it SIZESPECS doesn't screw up FOOTER and FOOTNOTE processing when FOOTERS are on
+NULL Diverts SIZESPECS in PRINT_HDRFTR so it doesn't screw up
+ FOOTER and FOOTNOTE processing when FOOTERS are on
PAD_STRING Diverts $PAD_STRING for processing
TYPESIZE Diverts SIZESPECS routine so it doesn't print
+++NUMBER REGISTERS+++
+#ABORT_FT_ERRORS Abort on FT errors? (toggle)
#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
@@ -164,22 +200,28 @@ TYPESIZE Diverts SIZESPECS routine so it doesn't print
#BR_INDENT Value of right indent when IB
c column mark
#CONDENSE Are we in pseudo-condense mode? (toggle)
-#COND_WIDTH Width of pseudo-condensed type (pointsize x $COND_PERCENT)
+#CONDENSE_WAS_ON For restoring \*[COND] in DROPCAP
+#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&lt;n&gt; Number register enumerator for depth &lt;n&gt; in lists
+#EXT_WIDTH Width of pseudo-extended type
+ (pointsize x $EXT_PERCENT)
#EXTEND Are we in pseudo-extend mode? (toggle)
-#EXT_WIDTH Width of pseudo-extended type (pointsize x $EXT_PERCENT)
+#EXTEND_WAS_ON For restoring \*[EXT] in DROPCAP
#FILL_MODE Are we in fill mode (i.e. \n(.u=1)? (toggle)
-#FONT_FOR_PAD Used to ensure that the font in effect prior
- to PAD is restored at the start of every iteration
- of $PAD_STRING
#H_INDENT Value of left indent when IH
#HL_INDENT Value of the hang when IH
#HYPHENATE Hyphenation on? (toggle)
-#HY_SET Did we manually set hyphenation parameters? (toggle)
-#IN_TAB Are we in a tab? (toggle) Set in macro TAB; used in ST to
- determine whether to add #ST_OFFSET to #ST&lt;#&gt;_OFFSETT
+#HY_SET Did we manually set hyphenation parameters?
+ (toggle)
+#IN_TAB Are we in a tab? (toggle)
+ Set in macro TAB; used in ST to determine
+ whether to add #ST_OFFSET to #ST&lt;#&gt;_OFFSET
#INDENT_ACTIVE Indicates whether an indent is active (toggle)
#INDENT_BOTH_ACTIVE Toggle
#INDENT_LEFT_ACTIVE Toggle
@@ -190,37 +232,59 @@ c column mark
#INDENT_STYLE_RIGHT Indicates IR when #INDENT_ACTIVE=1 (toggle)
#INDENT_STYLE_TEMP Indicates IT when #INDENT_ACTIVE=1 (toggle)
#IX_WARN Toggles to 1 the first time IX is user-invoked
+#JUSTIFY In EW/RW, when BR_AT_LINE_KERN, whether to
+ break or break-spread preceding line (toggle)
#KERN Kern on? (toggle)
#LAST_TAB Last tab number set in multi-columns
#LEAD Leading (alias)
#LIGATURES Ligatures on? (toggle)
+#LIST_INDENT&lt;n&gt; Left indent of list &lt;n&gt;
#L_INDENT Value of left indent
#L_LENGTH Line length
-#L_MARGIN Page offset if set with LMARGIN; if .po used, \n(.o returns
+#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
+#OLD_LEAD Lead in effect prior to changing it with .vs
+ in .LS
#OPEN_CLOSE Manipulates character " to print `` or ''
-p Output line horiz position at end of $PAD_STRING
+#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? (toggle)
#PAD_SPACE Size of padding space
#PAGE_LENGTH Page length (alias)
#PAGE_WIDTH Page width
#PP_ACTIVE Are we in the context of a para? (toggle)
-#PRINT_FOOTER_ON_PAGE_1 toggle
+#PRINT_FOOTER_ON_PAGE_1 (toggle)
+#PSEUDO_FILL Signals that LEFT, RIGHT or CENTER is
+ in effect (toggled off, i.e. to 0, when
+ QUAD <arg> or JUSTIFY is called)
#PT_SIZE Point size (fractional) in units (alias)
-#Q_AT_TOP Does a quote start at the top of a new page? (toggle)
+#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
+ (toggle)
+#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
+#RESTORE_LN_NUMBER Start linenumbering again with stored
+ #NEXT_LN? (toggle)
+#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 iteration
- of $PAD_STRING
+ to PAD is restored at the start of every
+ iteration of $PAD_STRING
#SLANT_ON Is SLANT on? (toggle)
#SMART_QUOTES Smartquotes on? (toggle)
#SPACE_TO_END Whitespace at end of string passed to PAD
@@ -228,45 +292,87 @@ p Output line horiz position at end of $PAD_STRING
#ST&lt;#&gt;_MARK Page offset of autotab &lt;#&gt; at ST&lt;#&gt;X
#ST_NUM Incrementing counter for autotab identification
#ST_OFFSET Offset (from current tab) to add to #ST&lt;#&gt;_OFFSET
- when calculating string indents set from within tabs
+ when calculating string indents set from within
+ tabs
#ST&lt;#&gt;_OFFSET Indent of autotab &lt;#&gt; (page offset)
-t "mark" register set in T_MARGIN; recalled in LS and AUTOLEAD if #T_MARGIN_SET is 1
+#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_INDENT Value of temporary indent
+#T_MARGIN Top margin
#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)
+#TOP Set to 1 in T_MARGIN, DO_T_MARGIN and ALD; tells
+ the first LS or AUTOLEAD on a page to maintain
+ the baseline position prior to the LS call
+#TOP_BASELINE_ADJ Amount by which to adjust the baseline position
+ of the first line on the page if an LS or AUTOLEAD
+ request differs from the lead current at the end of
+ the previous page
+#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
+++STRINGS+++
$COND_PERCENT Percentage by which to pseudo-condense type
+$COLOR_SCHEME Color scheme used in NEWCOLOR
$CURRENT_QUAD Restores current quad value in RULE
$CURRENT_TAB Current tab number
$DC_ADJUST +|- # of points to subtract from dropcap
$DC_FAM Drop cap family
$DC_FT Drop cap font
+$ENUMERATOR&lt;n&gt; String enumerator for depth &lt;n&gt; 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
- to PAD is restored at the start of every iteration
- of $PAD_STRING
+ to PAD is restored at the start of every
+ iteration of $PAD_STRING
$FONT Font
+$FONT_FOR_PAD Used to ensure that the font in effect prior
+ to PAD is restored at the start of every
+ iteration of $PAD_STRING
$PAD_MARKER Character to mark off padding in PAD
$PAD_STRING Arg passed to PAD
-$QUAD_VALUE Quad value (left, right, center, justify)
-$QUOTE0 ``
-$QUOTE1 ''
-$RESTORE_QUAD_VALUE Quad value for use in restoring L, R, C, J (after tabs)
+$QUAD_VALUE Quad value (left, right, centre, justify)
+$QUOTE0 Open quotation marks
+$QUOTE1 Close quotation marks
+$RESTORE_COND Restores the pseudo-condense value in effect
+ prior to DROPCAP
+$RESTORE_EXT Restores the pseudo-extend value in effect
+ prior to DROPCAP
+$RESTORE_FAM Used to restore the family in effect
+ prior to DROPCAP
+$RESTORE_FT Used to restore the font/fontstyle in effect
+ prior to DROPCAP
+$RESTORE_PT_SIZE Used to restore the point size of normal
+ running text after a dropcap
+$RESTORE_QUAD_VALUE Quad value for use in restoring L, R, C, J
+ (after tabs)
+$SAVED_STYLE Current style, if there is one (used in FAMILY)
+$SEPARATOR&lt;n&gt; Separator for depth &lt;n&gt; in lists
$SS_VAR Holds + or - sentence space value
$ST&lt;#&gt;_FILL Always QUAD if QUAD passed to ST &lt;#&gt;
$ST&lt;#&gt;_QUAD_DIR Quad direction supplied to ST for &lt;#&gt;
-$TAB_NUMBER Argument passed to TAB macro to call TAB# macro created in TAB_SET
+$TAB_NUMBER Argument passed to TAB macro to call TAB# macro
+ created in TAB_SET
$WS_CONSTANT 12; used to hold groff default wordspace
-$WS Holds WS value; concatenation of WS_CONSTANT and WS_VAR
+$WS Holds WS value; concatenation of WS_CONSTANT and
+ WS_VAR
$WS_VAR + or - value to add to $WS_CONSTANT
+BLACK Pre-defined black color
+black Pre-defined black color
+WHITE Pre-defined white color
+white Pre-defined white color
+++ALIASES+++
@@ -274,6 +380,7 @@ ALIAS als
ALIASN aln
BR br
CENTRE CENTER
+COLOUR COLOR
COMMENT SILENT
CONDENSE CONDENSE_OR_EXTEND
EXTEND CONDENSE_OR_EXTEND
@@ -285,6 +392,7 @@ LIG LIGATURES
LL LINE_LENGTH
MAC de
NEW_PAGE bp
+NEWCOLOUR NEWCOLOR
NEWPAGE NEW_PAGE
PAGELENGTH PAGE_LENGTH
PAGE_LENGTH pl
@@ -296,6 +404,7 @@ TABSET TAB_SET
TB TAB
TI IT
UNDERSCORE_2 UNDERSCORE2
+XCOLOUR XCOLOR
+++ALIASES FOR NUMBER REGISTERS+++
@@ -316,11 +425,14 @@ BOLDER Pseudo-bold on
BOLDERX Pseudo-bold off
BP Back points (horizontal movement)
BU Back units (inline pairwise kerning)
-COND_FOR_SUP Pseudo-condense string for use with superscripts (called with CONDSUP)
-COND_FOR_SUP Pseudo-extend string for use with superscripts (called with EXTSUP)
+COND_FOR_SUP Pseudo-condense string for use with superscripts
+ (called with CONDSUP)
+COND_FOR_SUP Pseudo-extend string for use with superscripts (called
+ with EXTSUP)
COND Pseudo-condense type
CONDX Pseudo-condense off
-CONDSUP Pseudo-condensed superscript (using value set with CONDENSE)
+CONDSUP Pseudo-condensed superscript (using value set with
+ CONDENSE)
CONDSUPX Pseudo-condensed superscript off
DOWN Inline downward vertical movement
EXT Pseudo-extend type
@@ -331,7 +443,8 @@ FP Forward points (horizontal movement)
FU Forward units (inline pairwise kerning)
FWD Inline forward horizontal movement
LEADER Deposit leader to end of current LL or TAB
-RULE Draw a rule to the full measure of the current line or tab length
+RULE Draw a rule to the full measure of the current line or
+ tab length
SLANT Slant (pseudo-italic on
SLANTX Slant off
ST&lt;#&gt; String tab end marker
@@ -357,556 +470,1430 @@ Document info
AUTHOR Author
CHAPTER Chapter number
CHAPTER_TITLE Chapter title
+COPYRIGHT Copyright info (covers only)
+DOCTITLE Overall doc title (for collated docs)
DRAFT Draft number
+MISC Misc info (covers only)
REVISION Revision number
SUBTITLE Doc subtitle
TITLE Doc title
+Covers
+------
+COVER What goes on cover
+COVERS Whether covers get printed (toggle)
+COVER_ADVANCE Set vertical start position of cover material
+COVER_LEAD Overall leading of covers
+COVERTITLE User-defined cover title string
+DOC_COVER What goes on doc cover
+DOC_COVERS Whether doc covers get printed
+DOC_COVER_ADVANCE Set vertical start position of doc cover material
+DOC_COVER_LEAD Overall leading of doc covers
+DOC_COVERTITLE User-defined doc cover title string
+
Document style
--------------
-COPYSTYLE Output style (DRAFT or FINAL)
-DEFAULTS In START, sets defaults
-DOCTYPE Kind of doc (DEFAULT, CHAPTER, NAMED, LETTER)
-PAGENUMBER Page number that appears on 1st page of doc
-PAPER Paper size (LETTER, LEGAL, A4)
-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
+COPYSTYLE Output style (DRAFT or FINAL)
+DEFAULTS In START, sets defaults
+DOCTYPE Kind of doc (DEFAULT, CHAPTER, NAMED, LETTER)
+PAGENUMBER Page number that appears on 1st page of doc
+PAPER Paper size (LETTER, LEGAL, A4)
+PRINTSTYLE Print style (TYPEWRITE or TYPESET)
+NUMBER_LINES Number output lines in the left margin
+
+Document tags and macros
+------------------------
+ADD_SPACE Special macro to add space to the top of a pages after
+ page 1; must be preceded by NEWPAGE
+BIBLIOGRAPHY Begin a bibliography page
+BIBLIOGRAPHY_TYPE LIST or PLAIN
+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
+ENDNOTE_REFS Send REFs to endnotes
+ENDNOTES Output endnotes
+EPIGRAPH Epigraph before 1st para
+FINIS Prints --END--
+FOOTNOTE Collects footnotes in text for printing at bottom of page
+FOOTNOTE_REFS Send REFs to footnotes
+HEAD Section title (main heads)
+HYPHENATE_REFS Turn on/off hyphenation of REF references
+ITEM Begin a list item
+LINEBREAK Break between narrative sections
+LIST Initialize a list
+MN Margin note
+MN_INIT Initialize parameters for margin notes
+NUMBER_LINES Number text lines
+NUMBER_BLOCKQUOTE_LINES Number blockquote lines
+NUMBER_QUOTE_LINES Number quote lines
+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
+REF Wrapper around FOOTNOTE or ENDNOTE, depending
+ on FOOTNOTE_REFS or ENDNOTE_REFS
+REF( Begin embedded reference, parens
+REF) End embedded reference, parens
+REF[ Begin embedded reference, square brackets
+REF] End embedded reference, square brackets
+REF{ Begin embedded reference, braces
+REF} End embedded reference, braces
+REF_INDENT Amount of 2nd line indent of references for
+ footnote, endnote or bibliography refs
+RESET_LIST Reset digit or alpha list enumerator
+SHIFT_LIST Move a list over to the right
+START Sets doc defaults and prints info collected
+ with doc info macros
+SUBHEAD Subheads
Headers/footers
---------------
-BREAK_QUOTE Manually break a footnoted quote that crosses a page/column
+---------------
+BREAK_QUOTE Manually break a footnoted quote that crosses
+ a page/column
DO_FOOTER Prints footer (after footnote processing, if any)
FOOTER_ON_FIRST_PAGE Print footer on first page? (toggle)
FOOTER Trap-invoked footer macro
HEADER Trap-invoked header macro
PAGINATE Turns page numbering on or off (doc default=on)
-RECTO_VERSO Enables switch HEADER_LEFT and HEADER_RIGHT on alternate pages
+PAGINATE_TOC Turns pagination of toc on or off (default=on)
+RECTO_VERSO Enables switch HEADER_LEFT and HEADER_RIGHT on
+ alternate pages
Alter doc "look" and/or change defaults
---------------------------------------
-ALWAYS_FULLSPACE_QUOTES Fullspace quotes instead of default 1/2 spacing them.
+***General***
+
+ALWAYS_FULLSPACE_QUOTES Fullspace quotes instead of default
+ 1/2 spacing them.
ATTRIBUTE_STRING What to print before author (default is "by")
-AUTHOR_FAMILY Family to use for author in doc header
-AUTHOR_FONT Font to use for author in doc header
-AUTHOR_SIZE ps to use for author in doc header
-BLOCKQUOTE_FAMILY Family to use in blockquotes
-BLOCKQUOTE_FONT Font to use in blockquotes
-BLOCKQUOTE_QUAD How to quad blockquotes
-BLOCKQUOTE_SIZE How much to de/increase point size of bquotes
-CHAPTER_STRING What to print whenever the word "chapter" is required
-CHAPTER_TITLE_FAMILY Family to use for chapter title in doc header
-CHAPTER_TITLE_FONT Font to use for chapter title in doc header
-CHAPTER_TITLE_SIZE ps in/decrease of chapter title (relative to size of running text)
+CHAPTER_STRING What to print whenever the word "chapter"
+ is required
COLUMNS Print in columns
DOC_FAMILY Overall doc family
-DOCHEADER_ADVANCE Start position of docheader (relative to top of page)
-DOCHEADER_LEAD +|- value applied to #DOC_LEAD to in/decrease leading of doc header
-DOC_HEADER Print doc header?
+DOCHEADER Print doc header?
+DOCHEADER_ADVANCE Start position of docheader (relative to top
+ of page)
+DOCHEADER_LEAD +|- value applied to #DOC_LEAD to in/decrease
+ leading of doc header
DOC_LEAD_ADJUST Adjust #DOC_LEAD to fill page to #B_MARGIN
DOC_LEAD Overall doc leading
DOC_LEFT_MARGIN Doc left margin
DOC_LINE_LENGTH Doc line length
DOC_PT_SIZE Overall doc point size
-DOC_QUAD Overall quad of document
DOC_RIGHT_MARGIN Doc right margin
-DOCTYPE_FAMILY Family to use for doctype string in doc header
-DOCTYPE_FONT Font to use for doctype string in doc header
-DOCTYPE_SIZE ps to use for doctype string in doc header
-DOCTYPE Type of doc (DEFAULT, CHAPTER, NAMED, LETTER)
-DO_QUOTE Print quote (invoked from QUOTE or BLOCKQUOTE)
-DRAFT_STRING What to print whenever the word "draft" is required
-DRAFT_WITH_PAGENUMBER Attach draft/revision info to page number (instead of putting it HEADER center)
-ENDNOTE_FAMILY Family for endnotes
-ENDNOTE_FONT Font for endnotes
-ENDNOTE_LEAD Leading for endnotes page
-ENDNOTE_PARA_INDENT First line indent of paras in multi-para endnotes
-ENDNOTE_PARA_SPACE Whether to space paras in multi-para endnotes
-ENDNOTE_PT_SIZE Base point size for endnotes page
-ENDNOTE_QUAD Endnote quad
-ENDNOTE_STRING Endnotes page head
-ENDNOTE_STRING_FAMILY Family for endnotes page head
-ENDNOTE_STRING_FONT Font for endnotes page head
-ENDNOTE_STRING_QUAD Quad direction for endnotes page head
-ENDNOTE_STRING_SIZE Size for endnotes page head
-ENDNOTE_STRING_UNDERSCORE Underscoring of endnotes page head
-ENDNOTE_TITLE Endnotes identifying title
-ENDNOTE_TITLE_FAMILY Family for endnotes identifying title
-ENDNOTE_TITLE_FONT Font for endnotes identifying title
-ENDNOTE_TITLE_QUAD Quad direction for endnotes identifying title
-ENDNOTE_TITLE_SIZE Size for endnotes identifying title
-ENDNOTE_TITLE_UNDERSCORE Underscoring of endnotes identifying title
-ENDNOTE_NUMBER_FAMILY Family of endnote numbers
-ENDNOTE_NUMBER_FONT Font of endnote numbers
-ENDNOTE_NUMBER_SIZE Size of endnote numbers
-ENDNOTE_NUMBERS_ALIGN_RIGHT Hang endnote numbers and align right
-ENDNOTE_NUMBERS_ALIGN_LEFT Dont' hang endnote numbers and align left
-ENDNOTES_HDRFTR_CENTER Print header/footer center string on endnotes pages?
-ENDNOTES_HEADER_CENTER Print header center string on endnotes pages?
-ENDNOTES_FOOTER_CENTER Print footer center string on endnotes pages?
+DOC_TITLE Overall doc title that gets printed in
+ headers/footers (mostly for use with collated
+ docs where each doc is an article with a
+ different title
+DRAFT_STRING What to print whenever the word "draft" is
+ required
+DRAFT_WITH_PAGENUMBER Attach draft/revision info to page number
+ (instead of putting it HEADER centre)
+REVISION_STRING What to print whenever the word "revision"
+ is required
+
+***Covers***
+
+COVER_ADVANCE Vertical place on page to start outputting
+ cover material
+COVER_LEAD Lead in/decrease for cover pages
+DOC_COVER_ADVANCE Vertical place on page to start outputting
+ doc cover material
+DOC_COVER_LEAD Lead in/decrease for doc cover pages
+
+***Epigraphs and finis***
+
EPIGRAPH_AUTOLEAD Autolead value for epigraphs
-EPIGRAPH_FAMILY Family to use in epigraphs
-EPIGRAPH_FONT Font to use in epigraphs
-EPIGRAPH_INDENT Value by which to multiply PP_INDENT for block epigraphs
-EPIGRAPH_QUAD Quad value of block style epigraphs
-EPIGRAPH_SIZE ps de/increase of epigraphs*
+EPIGRAPH_INDENT Value by which to multiply PP_INDENT for
+ block epigraphs
FINIS_STRING What to print when FINIS is invoked
+
+***Footnotes***
+
+FOOTNOTE_AUTOLEAD Autolead to use in footnotes
+FOOTNOTE_LINENUMBER_BRACKETS Brackets for footnote linenumbers
+FOOTNOTE_LINENUMBER_SEPARATOR Separator for footnote linenumbers
+FOOTNOTE_MARKERS Turns footnote markers on or off
+FOOTNOTE_MARKER_STYLE STAR or NUMBER; default=STAR
+FOOTNOTE_RULE_ADJ # of points to raise footnote rule from its
+ baseline
+FOOTNOTE_RULE_LENGTH Length of footnote separator rule
+FOOTNOTE_RULE Turns printing of fn separator rule on or off;
+ default is on
+FOOTNOTE_SPACING Post footnote item spacing
+FOOTNOTES_RUN_ON Run footnotes on (line numbering mode only)
+RESET_FOOTNOTE_NUMBER Reset fn# to 1, or, if arg PAGE, reset
+ automatically to 1 on every page
+RUNON_WARNING Utility macro; warns if FOOTNOTES_RUN_ON
+ was called when fn marker style is STAR or NUMBER
+
+***Endnotes***
+
+ENDNOTE_LEAD Leading for endnotes page
+ENDNOTE_LINENUMBER_BRACKETS Brackets around line numbers identifying
+ endnotes and text
+ENDNOTE_LINENUMBER_GAP Amount of space to leave between line
+ENDNOTE_LINENUMBER_SEPARATOR Separator between line numbers identifying
+ endnotes and the endnote item text
+ endnotes and text
+ENDNOTE_MARKER_STYLE NUMBER or LINE
+ENDNOTE_NUMBERS_ALIGN_RIGHT Hang endnote numbers and align right
+ENDNOTE_NUMBERS_ALIGN_LEFT Don't hang endnote numbers and align left
+ENDNOTE_PARA_INDENT First line indent of paras in multi-para
+ endnotes
+ENDNOTE_PARA_SPACE Whether to space paras in multi-para endnotes
+ENDNOTE_PT_SIZE Base point size for endnotes page
+ENDNOTE_STRING Endnotes page head
+ENDNOTE_STRING_CAPS Capitalize the endnotes string
+ENDNOTE_STRING_UNDERSCORE Underscoring of endnotes page head
+ENDNOTE_TITLE Endnotes identifying title
+ENDNOTE_TITLE_SPACE Distance from top of page to endnotest title
+ENDNOTE_TITLE_UNDERSCORE Underscoring of endnotes identifying title
+ENDNOTES_ALLOWS_HEADERS Page headers on endnotes pages? (toggle)
+ENDNOTES_FIRST_PAGENUMBER Page number to appear on page 1 of endnotes
+ pages
+ENDNOTES_HDRFTR_CENTER Print header/footer centre string on endnotes
+ pages?
+ENDNOTES_HEADER_CENTER Print header centre string on endnotes pages?
+ENDNOTES_FOOTER_CENTER Print footer centre string on endnotes pages?
+ENDNOTES_NO_COLUMNS Turn columnar mode off for endnotes pages
+ENDNOTES_NO_FIRST_PAGENUM Don't print a pagenumber on page 1 of
+ endnotes.
+ENDNOTES_PAGENUM_STYLE Set numbering style for endnotes pages page
+ numbers
+SINGLESPACE_ENDNOTES Single space TYPEWRITE endnotes
+
+***Bibliographies***
+
+BIBLIOGRAPHY_ALLOWS_HEADERS Allow headers on bib pages
+BIBLIOGRAPHY_FIRST_PAGENUMBER Starting page number for bibliographies
+BIBLIOGRAPHY_HDRFTR_CENTER Header/footer center string for bib pages
+BIBLIOGRAPHY_LEAD Base lead of bib pages
+BIBLIOGRAPHY_NO_COLUMNS De-columnize bibliographies
+BIBLIOGRAPHY_NO_FIRST_PAGENUM Don't print a page number on the first
+ page of bibliographies
+BIBLIOGRAPHY_PAGENUM_STYLE Format for bib pages page numbering
+BIBLIOGRAPHY_PT_SIZE Base point size for bib pages
+BIBLIOGRAPHY_SPACING Post bib entry space
+BIBLIOGRAPHY_STRING String for bib title
+BIBLIOGRAPHY_STRING_CAPS Capitalize bib title string
+BIBLIOGRAPHY_STRING_UNDERSCORE Underscore bib title string
+SINGLESPACE_BIBLIOGRAPHY Singlespace bibs if PRINTSTYLE TYPEWRITE
+
+***Headers and footers***
+
+FOOTER_COLOR Footer color
FOOTER_GAP Distance between running text and footer
FOOTER_MARGIN Distance from footer to bottom of page
FOOTERS Turns footers on or off
-FOOTNOTE_AUTOLEAD Autolead to use in footnotes
-FOOTNOTE_FAMILY Family to use in footnotes
-FOOTNOTE_FONT Font to use in footnotes
-FOOTNOTE_MARKERS Turns footnote markers on or off
-FOOTNOTE_MARKER_STYLE STAR or NUMBER; default=STAR
-FOOTNOTE_QUAD Quad to use in footnotes
-FOOTNOTE_RULE_ADJ # of points to raise footnote rule from its baseline
-FOOTNOTE_RULE_LENGTH Length of footnote separator rule
-FOOTNOTE_RULE Turns printing of fn separator rule on or off; default is on
-FOOTNOTE_SIZE ps of footnotes
-HDRFTR_CENTER_CAPS Center part of header/footer in caps? (toggle)
-HDRFTR_CENTER_FAMILY Family of center part of header/footer
-HDRFTR_CENTER_FONT Font of center part of header/footer
-HDRFTR_CENTER_SIZE ps in/decrease of center part of header/footer**
-HDRFTR_CENTER String to go in center part of header/footer; default doctype
-HDRFTR_CENTER The header/footer center string
-HDRFTR_FAMILY Family to use in the headers/footers
+HDRFTR_CENTER String to go in centre part of header/footer;
+ default doctype
+HDRFTR_CENTER_CAPS Centre part of header/footer in caps? (toggle)
+HDRFTR_CENTER_PAD Pad hdrftr CENTER left or right by specified
+ amount
HDRFTR_GAP Distance from header/footer to running text
HDRFTR_LEFT_CAPS Left part of header/footer in caps? (toggle)
-HDRFTR_LEFT_FAMILY Family of left part of header/footer
-HDRFTR_LEFT_FONT Font of left part of header/footer
-HDRFTR_LEFT_SIZE ps in/decrease of left part of headers/footers**
-HDRFTR_LEFT String to go in left part of header/footer; default author
+HDRFTR_LEFT String to go in left part of header/footer;
+ default is AUTHOR_1
HDRFTR_LEFT The header/footer left string
HDRFTR_MARGIN Distance from top of page to header
-HDRFTR_PLAIN Header/footer fam/ft/ps all same as running text
-HDRFTR_RECTO User-defined, single string recto header/footer
+HDRFTR_PLAIN Header/footer fam/ft/ps all same as running
+ text
+HDRFTR_RECTO User-defined, single string recto
+ header/footer
HDRFTR_RIGHT_CAPS Right part of header/footer in caps? (toggle)
-HDRFTR_RIGHT_FAMILY Family of right part of headers/footers
-HDRFTR_RIGHT_FONT Font of right part of headers/footers
-HDRFTR_RIGHT_SIZE Size of right part of headers/footers
HDRFTR_RIGHT The header/footer right string
-HDRFTR_RULE_GAP Space between header/footer and header/footer rule
+HDRFTR_RULE_GAP Space between header/footer and header/footer
+ rule
HDRFTR_RULE_INTERNAL Prints the header/footer rule
HDRFTR_RULE Turns header/footer rule on or off
-HDRFTR_RULE Turns header/footer rule on or off. When invoked internally, prints the rule.
-HDRFTR_SIZE ps in/decrease of headers/footers*
-HDRFTR_VERSO User-defined, single string verso header/footer
-HEAD_CAPS Print section titles in caps? (toggle)
+ When invoked internally, prints the rule.
+HDRFTR_VERSO User-defined, single string verso
+ header/footer
+HEADERS Turns headers on or off
+SWITCH_HDRFTR Switch HDRFTR_LEFT and HDRFTR_RIGHT
+
+***Page numbering***
+
+PAGENUM_HYPHENS Turns on/off hyphens surrounding page numbers
+PAGENUM_ON_FIRST_PAGE Print page number on first page when footers
+ are on (toggle)
+PAGENUM_POS Controls placement of page numbers;
+ default=bottom/centred
+PAGENUM_SIZE How much to in/decrease point size of page
+ numbers*
+PAGENUM_STYLE Page # in roman, Arabic, or alphabetic
+RESTORE_PAGINATION Restore pagination after outputting non-
+ paginated endnotes.
+SUSPEND_PAGINATION Suspend pagination prior to outputting
+ endnotes
+
+***Heads***
+
HEADER_GAP Space between header and running text
HEADER_MARGIN Space from top of page to header
-HEADERS Turns headers on or off
-HEAD_FAMILY Family to use in section titles
-HEAD_FONT Font to use in section titles
-HEAD_QUAD Quad value of section titles
-HEAD_SIZE How much to in/decrease point size of section titles
-HEAD_SPACE Give HEADs 2 line-spaces before. If OFF, only 1. Default is on.
+HEAD_CAPS Print section titles in caps? (toggle)
+HEAD_SPACE Give HEADs 2 line-spaces before. If OFF,
+ only 1. Default is on.
HEAD_UNDERLINE Underline section titles? (toggle)
-INDENT_FIRST_PARAS Indent 1st paras? (doc default=not indented)
-ITALIC_MEANS_ITALIC For TYPEWRITE; render .FT I in italic.
NUMBER_HEADS Print head numbers
-NUMBER_PARAHEADS Print parahead numbers
+RESET_HEAD_NUMBER Reset head number
+
+***Subheads***
+
NUMBER_SUBHEADS Print subhead numbers
-PAGENUM_FAMILY Family to use in footers
-PAGENUM_FONT Font to use for page numbers
-PAGENUM_HYPHENS Turns on/off hyphens surrounding page numbers
-PAGENUM_ON_FIRST_PAGE Print page number on first page when footers are on (toggle)
-PAGENUM_POS Controls placement of page numbers default=bottom/centered
-PAGENUM_SIZE How much to in/decrease point size of page numbers
-PAGENUM_STYLE Page # in roman, arabic, or alphabetic
-PARAHEAD_FAMILY Family to use for paraheads
-PARAHEAD_FONT Font to use for paraheads
-PARAHEAD_INDENT How mucht to indent paraheads
-PARAHEAD_SIZE Size of paraheads
+RESET_SUBHEAD_NUMBER Reset subhead number
+
+***Para heads***
+
+NUMBER_PARAHEADS Print parahead numbers
+PARAHEAD_INDENT How much to indent paraheads
+RESET_PARAHEAD_NUMBER Reset parahead number
+
+***Paragraphs***
+
+INDENT_FIRST_PARAS Indent 1st paras? (doc default=not indented)
PARA_INDENT Size of para indent
PARA_SPACE Put a line space before paras
PP_FONT Overall doc font
-QUOTE_FAMILY Family to use in pquotes
-QUOTE_FONT Font to use in pquotes
-QUOTE_INDENT Value by which to multiply PP_INDENT for block quotes
-QUOTE_SIZE How much to de/increase point size of pquotes
-RESET_FOOTNOTE_NUMBER Reset fn# to 1, or, if arg PAGE, reset automatically to 1 on every page
-RESET_HEAD_NUMBER Reset head number
-RESET_PARAHEAD_NUMBER Reset parahead number
-RESET_SUBHEAD_NUMBER Reset subhead number
-REVISION_STRING What to print whenever the word "revision" is required
+
+***Quotes***
+
+Q_FITS Utility macro for DO_QUOTE
+Q_NOFIT Utility macro for DO_QUOTE
+QUOTE_AUTOLEAD Leading of (block)quotes
+
+***Line/section breaks***
+
+LINEBREAK_CHAR Linebreak character, iterations and positioning
+
+***Printstyle TYPEWRITE***
+
+ITALIC_MEANS_ITALIC For TYPEWRITE; render .FT I in italic.
SLANT_MEANS_SLANT In TYPEWRITE, render \*[SLANT] as slant
-SUBHEAD_FAMILY Family to use in subheads
-SUBHEAD_FONT Font to use in subheads
-SUBHEAD_SIZE How much to in/decrease point size of subheads
-SUBTITLE_FAMILY Family to use for subtitle in doc header
-SUBTITLE_FONT Font to use for subtitle in doc header
-SUBTITLE_SIZE ps to use for subtitle in doc header
-SWITCH_HDRFTR Switch HDRFTR_LEFT and HDRFTR_RIGHT
-TITLE_FAMILY Family to use for title in doc headers
-TITLE_FONT Font to use for title in doc headers
-TITLE_SIZE How much to in/decrease title at start of doc
UNDERLINE_ITALIC In TYPEWRITE, render .FT I as underlined
UNDERLINE_QUOTES In TYPEWRITE, underline quotes? (toggle)
UNDERLINE_SLANT In TYPEWRITE, render \*[SLANT] as underlined
- *relative to #DOC_PT_SIZE
-**relative to overall ps of headers as set by HEADER_SIZE
+***Table of contents***
+
+TOC_APPENDS_AUTHORS Appends author(s) to toc doc title entries
+TOC_LEAD Leading of toc pages
+TOC_PADDING Number of placeholders for toc entries page
+ numbers
+TOC_HEAD_INDENT Indent of toc head entries
+TOC_HEADER_STRING TOC header string (default=Contents)
+TOC_PAGENUM_STYLE Page numbering style (hdrftr nums) of
+ toc pages
+TOC_RV_SWITCH Switch L/R margins of toc pages
+TOC_PARAHEAD_INDENT Indent of toc parahead entries
+TOC_SUBHEAD_INDENT Indent of toc subhead entries
+TOC_TITLE_ENTRY User supplied toc doc title entry
+TOC_TITLE_INDENT Indent of toc doc title entries
+
+***Aliases for headers and footers***
+HEADER_SIZE HDRFTR_SIZE
+HEADER_RIGHT_PS HDRFTR_RIGHT_SIZE
+HEADER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
+HEADER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
+HEADER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
+HEADER_RIGHT_FONT HDRFTR_RIGHT_FONT
+HEADER_RIGHT_FT HDRFTR_RIGHT_FONT
+HEADER_LEFT_PS HDRFTR_LEFT_SIZE
+HEADER_LEFT_SIZE HDRFTR_LEFT_SIZE
+HEADER_LEFT_FAM HDRFTR_LEFT_FAMILY
+HEADER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
+HEADER_LEFT_FONT HDRFTR_LEFT_FONT
+HEADER_LEFT_FT HDRFTR_LEFT_FONT
+HEADER_CENTRE_PS HDRFTR_CENTER_SIZE
+HEADER_CENTRE_SIZE HDRFTR_CENTER_SIZE
+HEADER_FAM HDRFTR_FAMILY
+HEADER_FAMILY HDRFTR_FAMILY
+HEADER_CENTRE_FAM HDRFTR_CENTER_FAMILY
+HEADER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
+HEADER_CENTRE_FONT HDRFTR_CENTER_FONT
+HEADER_CENTRE_FT HDRFTR_CENTER_FONT
+HEADER_CENTER_PS HDRFTR_CENTER_SIZE
+HEADER_CENTER_SIZE HDRFTR_CENTER_SIZE
+HEADER_CENTER_FAM HDRFTR_CENTER_FAMILY
+HEADER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
+HEADER_CENTER_FONT HDRFTR_CENTER_FONT
+HEADER_CENTER_FT HDRFTR_CENTER_FONT
+FOOTER_SIZE HDRFTR_SIZE
+FOOTER_RIGHT_PS HDRFTR_RIGHT_SIZE
+FOOTER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
+FOOTER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
+FOOTER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
+FOOTER_RIGHT_FONT HDRFTR_RIGHT_FONT
+FOOTER_RIGHT_FT HDRFTR_RIGHT_FONT
+FOOTER_LEFT_PS HDRFTR_LEFT_SIZE
+FOOTER_LEFT_SIZE HDRFTR_LEFT_SIZE
+FOOTER_LEFT_FAM HDRFTR_LEFT_FAMILY
+FOOTER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
+FOOTER_LEFT_FONT HDRFTR_LEFT_FONT
+FOOTER_LEFT_FT HDRFTR_LEFT_FONT
+FOOTER_CENTRE_PS HDRFTR_CENTER_SIZE
+FOOTER_CENTRE_SIZE HDRFTR_CENTER_SIZE
+FOOTER_FAM HDRFTR_FAMILY
+FOOTER_FAMILY HDRFTR_FAMILY
+FOOTER_CENTRE_FAM HDRFTR_CENTER_FAMILY
+FOOTER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
+FOOTER_CENTRE_FT HDRFTR_CENTER_FONT
+FOOTER_CENTER_PS HDRFTR_CENTER_SIZE
+FOOTER_CENTER_SIZE HDRFTR_CENTER_SIZE
+FOOTER_CENTER_FAM HDRFTR_CENTER_FAMILY
+FOOTER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
+FOOTER_CENTER_FONT HDRFTR_CENTER_FONT
+FOOTER_CENTER_FT HDRFTR_CENTER_FONT
+
+ *relative to #DOC_PT_SIZE
+ **relative to overall ps of headers as set by HEADER_SIZE
+ ***relative to overall ps of endnotes pages
+****relative to overall ps of toc pages
+++LETTER MACROS+++
-CLOSING Closing (ie. Yours truly,)
-DATE Date string for letters
-FROM Addressor's name and address
-GREETING Full salutation (eg. Dear John Smith,)
+CLOSING Closing (i.e. Yours truly,)
+DATE Date for letters
+FROM Addresser's name and address
+GREETING Full salutation (e.g. Dear John Smith,)
NO_SUITE Remove suite page numbers from bottom of letter pages
TO Addressee's name and address
ALL_DONE .em (the "end macro") for letters
-+++DIVERSIONS+++
-
-B_QUOTE Block (indented) quote text
-CLOSING Closing (ie. Yours truly,)
-DATE Date string for letters
-EPI_TEXT Epigraph text
-FN_OVERFLOW Excess footnotes when B_MARGIN is reached
-FOOTNOTES Text of footnotes
-FROM_ADDRESS Addressor's name and address
-GREETING Full salutation (eg. Dear John Smith,)
-P_QUOTE Line for line (poetic) quote text
-TO_ADDRESS Addressee's name and address
-
+++SUPPORT+++
-CHECK_INDENT Applies indents to doc elements inside ev's (head, subhead, etc)
-D0_QUOTE Outputs quotes with space adjustments before and after
-DIVERT_FN_LEFTOVER Diverts excess fn stored in FN_OVERFLOW into FOOTNOTE
-DIVERT_FN_OVERFLOW Diverts excess fn stored in FN_OVERFLOW when FN_DEFER into FOOTNOTE
-DO_EPIGRAPH Outputs epigraphs with space adjustments before and after
-FN_OVERFLOW_TRAP Fixed at B_MARGIN; if footnotes run longer than B_MARGIN, diverts excess into FN_OVERFLOW
+CHECK_INDENT Applies indents to doc elements inside ev's
+ (head, subhead, etc)
+CLEANUP_DEFAULTS Removes selected rregisters and strings
+ from DEFAULTS after START
+DO_COVER Formats and outputs covers
+DO_DOC_COVER Formats and outputs doc covers
+D0_QUOTE Outputs quotes with space adjustments before
+ and after
+DIVER_FN_1_PRE -+
+DIVER_FN_2_PRE | Manage footnotes called inside diversions
+ | QUOTE, BLOCKQUOTE and EPIGRAPH
+DIVER_FN_2_POST -+
+DIVERT_FN_LEFTOVER Diverts excess fn stored in FN_OVERFLOW into
+ FOOTNOTE
+DIVERT_FN_OVERFLOW Diverts excess fn stored in FN_OVERFLOW when
+ FN_DEFER into FOOTNOTE
+DO_EPIGRAPH Outputs epigraphs with space adjustments before
+ and after
+FN_OVERFLOW_TRAP Fixed at B_MARGIN; if footnotes run longer than
+ B_MARGIN, diverts excess into FN_OVERFLOW
+GET_ROMAN_INDENT Figures out amount of space to reserve
+ for roman numerals in lists
HDRFTR_RULE Prints rule under header or over footer
-PRINT_FOOTNOTE_RULE An alias of PRINT_FOOTNOTE; prints footnote separator rule
+MN_OVERFLOW_TRAP Trap-invoked macro to collect margin note
+ overflows
+PRINT_FOOTNOTE_RULE An alias of PRINT_FOOTNOTE; prints footnote
+ separator rule
PRINT_HDRFTR Prints header/footer (trap invoked)
PRINT_PAGE_NUMBER Invoked in HEADER or FOOTER
-PRINT_USERDEF_HDRFTR Prints user defined, single string recto/verso header/footer
+PRINT_USERDEF_HDRFTR Prints user defined, single string recto/verso
+ header/footer
+PROCESS_SHIM Calculates #SHIM when \n(.d is lower on the
+ page than #T_MARGIN
+PROCESS_FN_IN_DIVER Processes footnotes gathered in a diversion (called
+ at page/column breaks)
REMOVE_INDENT Removes indents set with CHECK_INDENT
-TRAPS Sets hdrftr traps; optionally adjusts #DOC_LEAD to fill page to #B_MARGIN
+Q_FITS Handles spacing of quotes when quote fits on the page
+Q_NOFIT Handles spacing of quotes when quote does not fit on
+ the page
+QUIT_LISTS Exit lists cleanly and completely
+SET_LIST_INDENT Restore indent of a prev. level of list
+SHIM Advance to next "legal" baseline
+TERMINATE .em that ensures deferred footnotes get output
+ on final pages
+TRAPS Sets hdrftr traps; optionally adjusts #DOC_LEAD
+ to fill page to #B_MARGIN
+TYPEWRITER Sets family (C), font (R) and point size (12)
+ for PRINTSTYLE TYPEWRITE
+VFP_CHECK Trap-sprung macro 1 legal baseline higher than
+ where FOOTER will be sprung; checks whether
+ there is, in fact, just enough room for
+ another line of running text to be added to
+ the page without jamming footnotes too close
+ to running text.
+
++++DIVERSIONS+++
+
+B_QUOTE Block (indented) quote text
+CLOSING Closing (i.e. Yours truly,)
+EPI_TEXT Epigraph text
+END_NOTES Endnotes text
+FN_IN_DIVER Footnotes gathered from inside a diversion
+FN_OVERFLOW Excess footnotes when B_MARGIN is reached
+FOOTNOTES Text of footnotes
+GREETING Full salutation (e.g. Dear John Smith,)
+LETTERHEAD&lt;n&gt; Date, addresser, addressee or greeting;
+ &lt;n&gt; is from 1 to 4, supplied by #FIELD
+P_QUOTE Line for line (poetic) quote text
+RUNON_FOOTNOTES Special diversion for run-on footnotes
+RUNON_FN_IN_DIVER Special diversion for run-on footnotes inside
+ (block)quotes
+TOC_ENTRIES TOC entries
+++NUMBER REGISTERS+++
+#1ST_FN_VP_ADJ An adjustment factor that ensures VFP
+ doesn't fall below what should be the
+ correct last printed line of running
+ text
+#ADD_BREAK Instructs FOOTNOTEs and ENDNOTEs to add
+ a break afer processing a footnote if
+ we're not in fill mode
+#ADJ_BIB_LEAD Adjust BIB_LEAD? (toggle)
#ADJ_DOC_LEAD Adjust DOC_LEAD? (toggle)
-#ARG_NUM Keeps track of number of args passed to a macro
-#AUTHOR_LINES # of lines of authors in doc header; odd=0 even=1
-#AUTHOR_NUM Keeps track of user-defined string AUTHOR_&lt;#&gt; in AUTHOR
-#AUTHORS Equals final value of AUTHOR_NUM; used for authors in doc header
+#ADJ_TOC_LEAD Adjust TOC_LEAD? (toggle)
+#ARG_NUM Keeps track of number of args passed to a
+ macro
+#ARGS_TO_LIST Was LIST passed some args? (toggle)
+#AUTHOR_[n] Strings passed to AUTHOR
+#AUTHOR_LINES # of lines of authors in doc header; odd=0
+ even=1
+#AUTHOR_NUM Keeps track of user-defined string
+ AUTHOR_&lt;#&gt; in AUTHOR
+#AUTHORS Equals final value of AUTHOR_NUM;
+ used for authors in doc header
+#BASELINE_MARK In PP, the vertical position on the page
+ (when paragraph spacing is on) after a
+ quote or blockquote has been output and
+ the post-quote space has been added.
+#BMARG Position of unvarying bottom margin
+ during doc processing; required for
+ collecting footnotes inside diversions
+#BIB_ALLOWS_HEADERS Put headers on bib pages? (toggle)
+#BIB_ALLOWS_HEADERS_ALL Put headers on all bib pages? (toggle)
+#BIB_FIRST_PAGE Tells PRINT_PAGE_NUMBER about bibliography
+ first page number
+#BIB_FIRST_PN Starting pagenumber for bibliographies
+#BIB_HDRFTR_CENTER Put a center string in bib page headers?
+ (toggle)
+#BIB_LEAD Bibliography lead, expressed in points
+#BIB_LIST Output bibs in list style? (toggle)
+#BIB_NO_COLS De-columnize bibliographies? (toggle)
+#BIB_NO_FIRST_PN Put a page number on the first page of
+ bibliographies? (toggle)
+#BIB_SINGLESPACE Single-space TYPEWRITE bibliographies? (toggle)
+#BIB_SPACE Post item space for bibliography pages
+#BIB_STRING_CAPS Capitalize bib title? (toggle)
+#BIB_STRING_UNDERSCORE Underscore bib title? 0=no; 1=yes; 2=double
+#BIB_PS Base point size for bibliography pages expressed
+ in points
+#BIBLIOGRAPHY Are we doing a bib page? (toggle)
+#BQ_AUTOLEAD Register created by BLOCKQUOTE_AUTOLEAD
+#BQ_LEAD Leading of blockquotes
+#BQUOTE_COLOR Colored blockquotes? (toggle)
+#BQUOTE_LN Number blockquotes? (toggle)
#BROKEN_QUOTE Did we invoke BREAK_QUOTE? (toggle)
-#CAP_HEIGHT_ADJUST Tallest cap height of strings LEFT, CENTER, and RIGHT in footers; used to place rule over footer
-#CAPS_WAS_ON In HDRFTR, to re-enable running text CAPS (toggle)
-#CENTER_CAP_HEIGHT Cap height of center string in headers/footers
+#CAP_HEIGHT_ADJUST Tallest cap height of strings LEFT, CENTER,
+ and RIGHT in footers; used to place rule
+ over footer
+#CAPS_WAS_ON In HDRFTR, to re-enable running text CAPS
+ (toggle)
+#CENTER_CAP_HEIGHT Cap height of CENTER string in
+ headers/footers
+#CHAPTER_TITLE_COLOR Colored chapter title? (toggle)
#CLOSING Is there a closing (for letters)? 1=yes
#COL_L_LENGTH Line length of columns
-#COL_NEXT Was COL_NEXT invoked? (toggle; used in FOOTER)
-#COL_NUM Incrementing counter of num of columns; for use with #COL_&lt;#&gt;_L_MARGIN
-#COL_TOTAL #COL_L_LENGTH + #GUTTER; used to calculate #COL_&lt;#&gt;_L_MARGIN
+#COL_NEXT Was COL_NEXT invoked? (toggle; used in
+ FOOTER)
+#COL_NUM Incrementing counter of num of columns;
+ for use with #COL_&lt;#&gt;_L_MARGIN
+#COL_TOTAL #COL_L_LENGTH + #GUTTER; used to calculate
+ #COL_&lt;#&gt;_L_MARGIN
+#COLLATED_DOC If 1, instructs TOC that this is a collated
+ doc
#COLUMNS Are columns turned on? (toggle)
+#COLUMNS_WERE_ON Stores columnar state prior to outputting
+ endnotes in no-columns mode
#COPY_STYLE 1=draft, 2=final
-#DATE Is there a date (for letters)? 1=yes
+#COUNTERS_RESET Tells FOOTNOTE if fn counters have
+ been reset because of footnotes gathered
+ inside a diversion
+#COVER_COLOR Colored cover? (toggle)
+#COVER_START_POS Vertical starting pos of cover material
+#COVER_TITLE_COLOR Colored cover title? (toggle)
+#COVER_SUBTITLE_COLOR Colored cover subtitle? (toggle)
+#COVER_ATTRIBUTE_COLOR Colored cover attribution string? (toggle)
+#COVER_AUTHOR_COLOR Colored cover author(s)? (toggle)
+#COVER_DOCTYPE_COLOR Colored cover doctype? (toggle)
+#COVER_COPYRIGHT_COLOR Colored cover copyright line? (toggle)
+#COVER_MISC_COLOR Colored cover misc line? (toggle)
+#CURRENT_V_POS \n(.d ; used in SHIM
+#COVERS Print covers? (toggle)
+#DATE_FIRST Was .DATE invoked as first letter
+ header after .START? (toggle)
dc "mark" register for document columns
-#DEPTH_1 Doc header depth with lead adjustment (#DOCHEADER_LINES * #DOCHEADER_LEAD)
-#DEPTH_2 Doc header depth without lead adjustment (#DOCHEADER_LINES * #DOC_LEAD)
+#DIVER_FN Register that tells FOOTNOTE whether to
+ "move" or "defer" a footnote collected
+ inside a diversion
+#DEFER_BIB_SPACING Tells DEFAULTS to do BIBLIOGRAPHY_SPACING
+ if it was called before START
+#DEFER_PAGINATION Tells COLLATE to restore pagination (from
+ RESTORE_PAGINATION
+#DELAY_SHIM Instructs DO_QUOTE to delay SHIM when quote
+ falls at the top of a page
+#DEPTH_1 Doc header depth with lead adjustment
+ (#DOCHEADER_LINES * #DOCHEADER_LEAD)
+#DEPTH_2 Doc header depth without lead adjustment
+ (#DOCHEADER_LINES * #DOC_LEAD)
#DEPTH_TO_B_MARGIN Page length minus #B_MARGIN
-#DOCHEADER_ADVANCE Distance from top-of-page to baseline of docheader
-#DOCHEADER_LEAD_ADJ +|- value applied to #DOC_LEAD to in/decrease leading of doc header
-#DOCHEADER_LEAD Lead of doc header (#DOC_LEAD + #DOCHEADER_LEAD_ADJ)
-#DOCHEADER_SPACE_ADJ Lead difference between #DEPTH_1 and #DEPTH_2
+#DIVERSIONS_HY_MARGIN A reasonable value for .hym applied to
+ QUOTE, BLOCKQUOTE and EPIGRAPH to
+ avoid excessive hyphenation if these are
+ set quad left
+#DIVERTED Set to 1 in DIVERT_FN_OVERFLOW; reset
+ subsequently in FOOTNOTES when called by
+ PROCESS_FN_LEFTOVER to 2 or 3 for use by
+ FOOTER to decide whether to in/decrease
+ #FN_DEPTH when outputting footnotes
+#DOCHEADER_ADVANCE Distance from top-of-page to baseline of
+ docheader
+#DOCHEADER_COLOR Colored docheader? (toggle)
+#DOCHEADER_LEAD Lead of doc header
+ (#DOC_LEAD + #DOCHEADER_LEAD_ADJ)
+#DOCHEADER_SPACE_ADJ Lead difference between #DEPTH_1 and
+ #DEPTH_2
+#DOC_COVER_START_POS Vertical starting pos of doc cover material
+#DOC_COVERS Print doc covers? (toggle)
+#DOC_COVER_COLOR Colored cover? (toggle)
+#DOC_COVER_START_POS Vertical starting pos of cover material
+#DOC_COVER_TITLE_COLOR Colored doc cover title? (toggle)
+#DOC_COVER_SUBTITLE_COLOR Colored doc cover subtitle? (toggle)
+#DOC_COVER_ATTRIBUTE_COLOR Colored doc cover attribution string? (toggle)
+#DOC_COVER_AUTHOR_COLOR Colored doc cover author(s)? (toggle)
+#DOC_COVER_DOCTYPE_COLOR Colored doc cover doctype? (toggle)
+#DOC_COVER_COPYRIGHT_COLOR Colored doc cover copyright line? (toggle)
+#DOC_COVER_MISC_COLOR Colored doc cover misc line? (toggle)
#DOC_HEADER Whether to print a doc header (toggle)
-#DOC_LEAD_ADJ Incrementing value (in units) added to #DOC_LEAD to fill page to #B_MARGIN
+#DOC_LEAD_ADJ Incrementing value (in units) added to
+ #DOC_LEAD to fill page to #B_MARGIN
#DOC_LEAD Leading used in body
#DOC_L_LENGTH Global L_LENGTH
#DOC_L_MARGIN Global L_MARGIN
-#DOC_LR_MARGIN_TMP In HEADER, if RECTO_VERSO=1, temporarily holds DOC_L_MARGIN during page margin switch
+#DOC_LR_MARGIN_TMP In HEADER, if RECTO_VERSO=1, temporarily
+ holds DOC_L_MARGIN during page margin switch
#DOC_PT_SIZE Point size used for body text
#DOC_R_MARGIN Global R_MARGIN
#DOCS Always 1 after START
#DOC_TYPE 1=default, 2=chapter, 3=named, 4=letter
-#DRAFT The draft number
-#DRAFT_WITH_PAGENUM Are we attaching draft/revision info to page number? (toggle)
+#DOING_COVER Tells PRINT_AUTHORS that it's printing
+ the authors for a cover or doc cover
+#DONE_ONCE Keeps track of how many times footnotes
+ have been collected inside the same diversion
+#DONT_RULE_ME Rule this (apparent) first footnote? (toggle)
+#DIVER_LN_OFF Turn linenumbering off in (block)quotes?
+ (toggle)
+#DRAFT_WITH_PAGENUM Are we attaching draft/revision info to page
+ number? (toggle)
#EM_ADJUST Amount to raise \(em at END
-#EN_PS ps of endnotes
+#EN_ALLOWS_HEADERS Put page headers on endnotes pages? (toggle)
+#EN_ALLOWS_HEADERS_ALL Put page headers on all endnotes pages?
+ (toggle)
+#EN_BQ_AUTOLEAD Register created by EN_BLOCKQUOTE_AUTOLEAD
+#EN_BQ_LEAD Leading of blockquotes on endnotes pages
+#EN_FIGURE_SPACE Width of \0, for use with formatting endnotes
+#EN_FIRST_PAGE Tells PRINT_PAGE_NUMBER about endnotes
+ first page number
+#EN_FIRST_PN Page number that appears on page 1 of
+ endnotes pages.
+#EN_HDRFTR_CENTER Should we print centre string of
+ headers/footers on endnotes pages? (toggle)
#EN_LEAD Lead of endnotes
-#EN_STRING_UNDERSCORE Underscore endnotes page head? (toggle)
-#EN_TITLE_UNDERSCORE Underscore endnotes document identifier? (toggle)
-#EN_NUMBERS_ALIGN_RIGHT Hang and align endnote numbers right? (toggle)
-#EN_NUMBERS_ALIGN_LEFT Align endnote numbers with left margin? (toggle)
-#EN_NUMBERS_PLACEHOLDERS Number of placeholders when endnote numbers hang and align right
-#EN_NUMBER_L_LENGTH Line length for endnote numbers when they're right aligned
-#EN_PP_INDENT First line indent of paras in multi-para endnotes
+#EN_LN_BRACKETS Are we using brackets for line-numbered
+ endnotes (toggle)
+#EN_LN_SEP Are we using a separator for line-numbered
+ endnotes (toggle)
+#EN_MARK \n(ln when \*[EN-MARK] is called
+#EN_MARK_2 \n(ln when ENDNOTE is called
+#EN_MARKER_STYLE 1=NUMBER; 2=LINE
+#EN_NO_COLS Do not set endnotes in columns? (toggle)
+#EN_NO_FIRST_PN Put pagenumber on 1st page of endnotes?
+ (toggle)
+#EN_NUMBERS_ALIGN_RIGHT Hang and align endnote numbers right?
+ (toggle)
+#EN_NUMBERS_ALIGN_LEFT Align endnote numbers with left margin?
+ (toggle)
+#EN_NUMBERS_PLACEHOLDERS Number of placeholders when endnote numbers
+ hang and align right
+#EN_NUMBER_L_LENGTH Line length for endnote numbers when they're
+ right aligned
+#EN_PP_INDENT First line indent of paras in multi-para
+ endnotes
#EN_PP_SPACE Space multi-paras in endnotes? (toggle)
-#EN_TEXT_INDENT Page offset for text of endnotes when numbers right align
-#END_QUOTE For PP=0 indenting; did we just end a quote? (toggle)
+#EN_PS ps of endnotes
+#EN_Q_AUTOLEAD Register created by EN_QUOTE_AUTOLEAD
+#EN_Q_LEAD Leading of quotes on endnotes pages
+#EN_REF Put REFs in endnotes? (toggle)
+#EN_SINGLESPACE Single space endnotes pages? (toggle)
+#EN_STRING_CAPS Should ENDNOTES capitalize the endnotes
+ string? (toggle)
+#EN_STRING_UNDERSCORE Underscore endnotes page head? (toggle)
+#EN_TITLE_UNDERSCORE Underscore endnotes document identifier?
+ (toggle)
+#EN_TEXT_INDENT Page offset for text of endnotes when
+ numbers right align
+#END_QUOTE For PP=0 indenting; did we just end a quote?
+ (toggle)
#ENDNOTE Are we in an endnote? (toggle)
-#EN_HDRFTR_CENTER Should we print centre string of headers/footers on endnotes pages? (toggle)
+#ENDNOTE_REFS Are REFs going to endnotes? (toggle)
+#ENDNOTES Are we in an endnote (for FOOTERs; toggle)
#EPI_ACTIVE Are we in an epigraph? (toggle)
-#EPI_DEPTH Depth of epigraph from first baseline to last
+#EPI_COLOR Colored epigraphs? (toggle)
+#EPI_DEPTH Depth of epigraph from first baseline to
+ last
#EPI_FITS Does epigraph fit on page/column? (toggle)
#EPIGRAPH Did we have an epigraph? (toggle)
#EPI_LEAD_DIFF Difference between #DOC_LEAD and #EPI_LEAD
#EPI_LEAD Leading of epigraph; set by AUTOLEAD
-#EPI_LINES_EVEN Even # of lines at end of epi crossing page in TYPEWRITE (d-spaced)?
+#EPI_LINES_EVEN Even # of lines at end of epi crossing page in
+ TYPEWRITE (d-spaced)?
#EPI_LINES Number of lines in the epigraph
-#EPI_LINES_TO_END Number of epigraph lines remaining after footer trap is sprung
-#EPI_LINES_TO_TRAP Number of epigraph lines till footer trap is sprung
+#EPI_LINES_TO_END Number of epigraph lines remaining after
+ footer trap is sprung
+#EPI_LINES_TO_TRAP Number of epigraph lines till footer trap is
+ sprung
#EPI_L_LENGTH Epigraph line length
#EPI_OFFSET Left margin of epigraphs
#EPI_OFFSET_VALUE Epigraph indent as a function of page offset
#EPI_ON Are we in an epigraph? (toggle)
-#EPI_WHITESPACE Space after epigraph to compensate for epigraph leading
+#EPI_WHITESPACE Space after epigraph to compensate for
+ epigraph leading
+#FIELD Incrementing register tacked onto LETTERHEAD
+#FINIS Was FINIS invoked? (toggle)
+#FINIS_COLOR Colored FINIS? (toggle)
#FN_AUTOLEAD Autolead value of footnotes
#FN_BL_INDENT Left indent of INDENT BOTH in footnotes
#FN_BR_INDENT Right indent of INDENT BOTH in footnotes
-#FN_COUNT_FOR_COLS Holds a separate footnote count for columns (so they don't reset to 0 1 until page break)
-#FN_DEFER Defer footnote to next page/column? (toggle) If 0, don't defer.
-#FN_DEFER_SPACE Whether to deposit space before footnote 1 because there's a deferred footnote on the page
+#FN_COUNT Which fn marker to print; also to
+ tell mom to reserve space for and print
+ the rule above footnotes
+#FN_COUNT_AT_FOOTER The FN_COUNT after FOOTNOTES has been
+ output in FOOTER
+#FN_COUNT_FOR_COLS Holds a separate footnote count for columns
+ (so they don't reset to 0 1 until page break)
+#FN_DEFER Defer footnote to next page/column? (toggle)
+ If 0, don't defer.
+#FN_DEFER_SPACE Whether to deposit space before
+ footnote 1 because there's a deferred
+ footnote on the page
#FN_DEPTH Depth of footnote diversion(s)
-#FN_FOR_EPI Signals to epigraph that a footnote is being processed
-#FN_LEAD Lead in footnotes after FN_AUTOLEAD is applied
+#FN_FOR_EPI Signals to epigraph that a footnote is being
+ processed
+#FN_GAP When there are footnotes on a page, the
+ difference between where FOOTER will be
+ sprung and the next legal baseline.
+ Used in VFP_CHECK.
+#FN_LEAD Lead in footnotes after FN_AUTOLEAD is
+ applied
#FN_L_INDENT Left indent of INDENT LEFT in footnotes
-#FN_LINES Number of lines in fn; used to calculate fn depth
+#FN_LINES Number of lines in fn; used to calculate
+ fn depth
+#FN_LN_BRACKETS Are footnote linenumber brackets being used?
+ (toggle)
+#FN_LN_SEP Is a footnote linenumber separator being used?
+ (toggle)
+#FN_MARK \n(ln when \*[FN-MARK] is called
+#FN_MARK_2 \n(nl when FOOTNOTE is called
#FN_MARKERS Print footnote markers? (toggle)
#FN_MARKER_STYLE 1=STAR; 2=NUMBER
-#FN_NUMBER Running count of fn #; used to print fn marker numbers
+#FN_NUMBER The footnote number attached to running text
+ (and fns) when numbers instead of
+ star/dagger is being used for footnootes
+ numbers
+#FN_OVERFLOW_TRAP_POS The register that sets the position of
+ trap FN_OVERFLOW_TRAP.
#FN_R_INDENT Right indent of INDENT RIGHT in footnotes
-#FN_RULE_ADJ # of points to raise footnote separator from its baseline
+#FN_REF Put REFs in footnotes? (toggle)
+#FN_RULE_ADJ # of points to raise footnote separator from
+ its baseline
#FN_RULE_LENGTH Length of footnote separator rule
#FN_RULE Print fn rule? (toggle)
-#FN_WAS_DEFERED Tells HEADER about a defered footnote
-#FOOTER_GAP Amount of space between end of text and page #
-#FOOTER_MARGIN Amount of space between page # and bottom of page
-#FROM Is there an addressor (for letters)? 1=yes
+#FN_SPACE Post footnote space
+#FN_WAS_DEFERED Tells HEADER about a deferred footnote
+#FOOTER_DIFF In TRAPS, the difference between the
+ original #B_MARGIN and #VISUAL_B_MARGIN
+#FOOTER_GAP Amount of space between end of text and
+ page #
+#FOOTER_MARGIN Amount of space between page # and bottom
+ of page
+#FOOTER_POS Position of footer trap (required for
+ collecting footnotes inside a diversion)
+#FOOTERS_ON Are we using footers? (toggle)
+#FOOTERS_WERE_ON Were footers on? - used in FINIS and BLANKPAGE
+ (toggle)
+#FOOTNOTE_COLOR Colored footnotes? (toggle)
+#FROM_DIVERT_FN Signals to FOOTNOTE, when run from
+ within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING
+ to the total area allowable for running text
+#FROM_FOOTER In col to col footnote processing, tells
+ FOOTNOTE that FOOTNOTES was output from
+ FOOTER.
+#FROM_HEADER In col to col footnote processing, tells
+ FOOTNOTE that FOOTNOTES was output from
+ HEADER.
#FULLSPACE_QUOTES Should we fullspace quotes? (toggle)
-#GREETING Is there a greeting (for letters)? 1=yes
+#GET_DEPTH Signals to FOOTNOTE that it should
+ measure the depth of current footnotes
+ plus the most recently added one, except
+ where the footnote is to be deferred to
+ the next page or column
#GUTTER Width of gutter between columns
-#HDRFTR_CENTER_CAPS Center part of header/footer in caps? (toggle; default=off)
-#HDRFTR_HEIGHT Cap height of $HDRFTR_RECTO/$HDRFTR_VERSO strings
-#HDRFTR_LEFT_CAPS Left part of header/footer in caps? (toggle; default=off)
-#HDRFTR_RIGHT_CAPS Right part of header/footer in caps? (toggle; default=on)
-#HDRFTR_RULE_GAP Space between header/footer and header/footer rule
+#HDRFTR_CENTER_CAPS CENTER part of header/footer in caps?
+ (toggle; default=off)
+#HDRFTR_COLOR Colored headers/footers? (toggle)
+#HDRFTR_CTR_PAD_LEFT Amount of hdrftr CENTER padding on the left
+#HDRFTR_CTR_PAD_RIGHT Amount of hdrftr CENTER padding on the right
+#HDRFTR_CTR_PAD_TMP Temp storage of left hdrftr CENTER padding
+ (for recto/verso switch)
+#HDRFTR_HEIGHT Cap height of $HDRFTR_RECTO/$HDRFTR_VERSO
+ strings
+#HDRFTR_LEFT_CAPS Left part of header/footer in caps?
+ (toggle; default=off)
+#HDRFTR_RIGHT_CAPS Right part of header/footer in caps?
+ (toggle; default=on)
+#HDRFTR_RULE_COLOR Colored header/footer rule? (toggle)
+#HDRFTR_RULE_GAP Space between header/footer and
+ header/footer rule
#HDRFTR_RULE Print head/footer rule? (toggle)
-#HDRFTR_TMP_CAPS_SWITCH Temporarily holds HDRFTR_LEFT_CAPS value if #SWITCH_HDRFTR=1
+#HDRFTR_TMP_CAPS_SWITCH Temporarily holds HDRFTR_LEFT_CAPS value if
+ #SWITCH_HDRFTR=1
#HEAD 1=main/section head 2=subhead
#HEAD_CAPS Print section titles in caps? (toggle)
+#HEAD_COLOR Colored heads? (toggle)
#HEADER_GAP Distance from header to running text
#HEADER_MARGIN Distance from top of page to header
#HEADERS_ON Headers on? (toggle)
-#HEADER_STATE Saves header state in COLLATE for use in START after COLLATE
+#HEADER_STATE Saves header state in COLLATE for use in
+ START after COLLATE
+#HEADERS_WERE_ON Were headers on? - used in BLANKPAGE (toggle)
#HEAD_NUM Head number
-#HEAD_SPACE 2 line spaces before heads? (toggle; 1=yes, 0=no)
-#HEAD_UNDERLINE Underline section titles? (toggle)
-#IGNORE Should we ignore this macro? Set to 1 in TYPEWRITE.
+#HEAD_SPACE 2 line spaces before heads?
+ (toggle; 1=yes, 0=no)
+#HORIZ_MARK Horizontal
+#HOW_MANY Number of blank pages to output
+#IGNORE Should we ignore this macro? Set to 1 in
+ TYPEWRITE.
+#IN_BIB_LIST Tells ITEM we're doing a bibliography in
+ list style
#INDENT_FIRST_PARAS Indent first paras? (toggle)
-#INDENT_FIRSTS Tells foonotes to leave INDENT_FIRST_PARAS alone if it's on for running text.
+#INDENT_FIRSTS Tells footnotes to leave INDENT_FIRST_PARAS
+ alone if it's on for running text.
#ITALIC_MEANS_ITALIC For TYPEWRITE. 1=yes; 0=no
+#L_LENGTH_FOR_EPI Stores line length at top of doc for use
+ with EPIGRAPH when columns are on
+#L_MARGIN_DIFF Difference between DOC_L_MARGIN and
+ L_MARGIN
#LEFT_CAP_HEIGHT Cap height of left string in headers/footers
+#LEGAL_BASELINE Calculates vert. position of next legal
+ baseline in SHIM
#LETTER_STYLE 1=BUSINESS 2=PERSONAL
#LINEBREAK Did we have a linebreak? (toggle)
-#LINES_PER_PAGE # of lines (at DOC_LEAD) that fit on page after #B_MARGIN is set
-#L_LENGTH_FOR_EPI Stores line length at top of doc for use with EPIGRAPH when columns are on
-#L_MARGIN_DIFF Difference between DOC_L_MARGIN and L_MARGIN
+#LINEBREAK_COLOR Colored linebreak? (toggle)
+#LINENUMBERS Holds various states of line-numbering when
+ line numbering is enabled
+#LINES_PER_PAGE # of lines (at DOC_LEAD) that fit on
+ page after #B_MARGIN is set
+#LN Are line numbers on? (toggle)
+#MISC_&lt;n&gt; Used to print "next" misc lines in DO_COVER
+#MISC_NUM Number of MISC lines
+#MISCS =#MISC_NUM in DO_COVER
+#MN_OVERFLOW_LEFT If 1, left margin note text overflows
+#MN_OVERFLOW_RIGHT If 1, right margin note text overflows
#n%_AT_PAGENUM_SET Page # from n% when PAGENUMBER invoked
-#NEXT_AUTHOR Supplies correct digit to AUTHOR_&lt;#&gt; when printing authors in doc header
+#NEEDS_SPACE Instruct FOOTNOTE, when called by
+ PROCESS_FN_IN_DIVER, that if the footnote
+ had to be deferred, the VFP must be
+ raised by 1v (set in DIVER_FN_2_PRE)
+#NEXT_AUTHOR Supplies correct digit to AUTHOR_&lt;#&gt;
+ when printing authors in doc header
+#NEXT_LN Next linenumber when \n(ln has to be stored
+ because linenumbering suspended
+#NEXT_MISC Incrementing counter for misc lines in
+ DO_COVER
+#NO_BACK_UP Instructs FN_OVERFLOW_TRAP not to
+ subtract 1 line of footnote lead from
+ FN_OVERFLOW in a PREV_FN_DEFERRED
+ situation.
+#NO_SPACE When para spacing is active, instructs
+ PP not to add space after a quote or blockquote.
#NO_TRAP_RESET Should we reset page traps? (toggle)
-#NUM_AUTHORS # of authors mod 2 to test if odd or even # of authors
+#NUM_AUTHORS # of authors mod 2 to test if odd or even
+ # of authors
+#NUM_MISCS Number of args passed to MISC
#NUMBER_HEAD Are heads numbered? (toggle)
#NUMBER_PH Are paraheads numbered? (toggle)
#NUMBER_SH Are subheads numbered? (toggle)
#NUM_COLS Number of columns per page
+#NUM_FIELDS Incrementing register used to match
+ #TOTAL_FIELDS
+#OK_PROCESS_LEAD Initial processing of TOC and endnote
+ leading is deferred until OK_PROCESS_LEAD=1
+#ORIGINAL_B_MARGIN The value for #B_MARGIN as set by the
+ macro B_MARGIN
+#ORIGINAL_DOC_LEAD The lead for PRINT_STYLE 1 as set in
+ PRINTSTYLE; required so that PRINT_STYLE 1
+ footnotes have an unadjusted lead of
+ 12 points
+#OVERFLOW Signals to FOOTNOTE that some of the
+ footnote text won't fit on the page
#PAGE_NUM_ADJ What to add to n% to get #PAGENUMBER
#PAGENUMBER The page number
#PAGENUM_STYLE_SET Did we set pagenumber style? (toggle)
-#PAGE_NUM_H_POS 1=left 2=center 3=right; default=2
-#PAGE_NUM_HYPHENS Print hyphens surrounding page numbers? (toggle)
-#PAGE_NUM_HYPHENS_SET Did user set (or unset) hyphens around page numbers? (toggle)
+#PAGE_NUM_H_POS 1=left 2=CENTER 3=right; default=2
+#PAGE_NUM_COLOR Colored pagenumbers? (toggle)
+#PAGE_NUM_HYPHENS Print hyphens surrounding page numbers?
+ (toggle)
+#PAGE_NUM_HYPHENS_SET Did user set (or unset) hyphens around page
+ numbers? (toggle)
#PAGE_NUM_POS_SET Did user set page number position? (toggle)
-#PAGE_NUM_SET Test if PAGE_1_NUM was used to set 1st page number
+#PAGE_NUM_SET Test if PAGE_1_NUM was used to set 1st page
+ number
#PAGE_NUMS Print page numbers? (toggle)
#PAGE_NUM_V_POS 1=top 2=bottom; default=2
#PAGE_TOP \n(nl after HEADER completes itself
+#PH_COLOR Colored paraheads? (toggle)
#PH_NUM Parahead number
-#PAGINATION_STATE Saves pagination state in COLLATE for use in START after a COLLATE
+#PAGE_POS Exact position on page during a diversion
+ (required for collecting footnotes inside
+ a diversion)
+#PAGINATE_TOC Is toc pagination on? (toggle)
+#PAGINATE_WAS_ON Keeps track of pagination state while
+ outputting blank pages
+#PAGINATION_STATE Saves pagination state in COLLATE for use in
+ START after a COLLATE
+#PAGINATION_WAS_ON Was pagination on? - used in FINIS (toggle)
#PP 0 at first para; auto-increments
#PP_AT_PAGE_BREAK # of last (incl. partial) para on page
#PP_INDENT How much to indent paras
#PP_SPACE Put space before paras? (toggle)
-#PP_SPACE_SUSPEND Suspend para spacing for blockquotes and epigraphs
-#PP_STYLE_PREV In footnotes, stores PP style in effect prior to invoking FOOTNOTE
+#PP_SPACE_SUSPEND Suspend para spacing for blockquotes and
+ epigraphs
+#PP_STYLE_PREV In footnotes, stores PP style in effect
+ prior to invoking FOOTNOTE
#PP_STYLE Regular para=1; quote or epi para=2
-#PRINT_PAGENUM_ON_PAGE_1 Should we print the page number on first page of doc when footers are on? (toggle)
+#PRINT_PAGENUM_ON_PAGE_1 Should we print the page number on first
+ page of doc when footers are on? (toggle)
#PRINT_STYLE Typewrite=1, typeset=2
-#PT_SIZE_IN_UNITS Stored value of \n[.ps] from last time PT_SIZE was called
+#PT_SIZE_IN_UNITS Stored value of \n[.ps] from last time
+ PT_SIZE was called
+#Q_AUTOLEAD Register created by QUOTE_AUTOLEAD
#Q_DEPTH Depth of quote
-#Q_FITS Does this quote fit on one page/column? (toggle)
+#Q_FITS Does this quote fit on one page/column?
+ (toggle)
+#Q_LEAD Leading of quotes
+#Q_LEAD_DIFF Difference between leading of running text
+ and the leading used in quotes/blockquotes
+#Q_LEAD_REAL Leading of quotes and blockquotes saved at the
+ ends of their respective diversions
#Q_L_LENGTH Line length of quotes
#Q_OFFSET Page offset for quotes
-#Q_OFFSET_VALUE Factor by which to multiply PP_INDENT to offset quotes
-#Q_PP In PP, stores para # in QUOTE. Removed in ENDQUOTE.
+#Q_OFFSET_VALUE Factor by which to multiply PP_INDENT to
+ offset quotes
+#Q_PARTIAL_DEPTH The amount of a quote/blockquote that fits at
+ the bottom of a page when a quote/blockquote
+ spans pages
+#Q_PP In PP, stores para # in QUOTE. Removed in
+ ENDQUOTE.
+#Q_SPACE_ADJ The flexible amount of whitespace to add before
+ and after a quote/blockquote
#Q_TOP Vertical place on page that a quote starts
#QUOTE 1=PQUOTE, 2=BQUOTE
-#RECTO_VERSO Switch HEADER_LEFT and HEADER_RIGHT on alternate pages? (toggle); default=0
-#REPEAT Number of times to repeat linebreak character
+#QUOTE_COLOR Color quotes (poetic)? (toggle)
+#QUOTE_LN Linenumber quotes? (toggle)
+#RECTO_VERSO Switch HEADER_LEFT and HEADER_RIGHT on
+ alternate pages? (toggle); default=0
+#REF_HYPHENATE Hyphenate REFs? (toggle)
+#REF_WARNING Have we issued a ref warning? (toggle)
+#REPEAT Number of times to repeat linebreak
+ character
+#RESERVED_SPACE Just enough room to put 1 more line of
+ footnotes on the page
#RESET_EN_PP Holds value of register #EN_PP_INDENT
-#RESET_FN_NUMBER Should fn# start at 1 on every page? (toggle)
+#RESET_FN_COUNTERS 1 = "moved" footnote collected in a diversion
+ 2 = "deferred" fn collected in a diversion
+#RESET_FN_NUMBER Should fn# start at 1 on every page?
+ (toggle)
#RESET_L_LENGTH Stores current line length when necessary
-#RESET_PARA_SPACE Holds current value of toggle register #PP_SPACE
+#RESET_PARA_SPACE Holds current value of toggle register
+ #PP_SPACE
#RESET_PP_INDENT Stores value of PP_INDENT when necessary
-#RESET_QUOTE_SPACING Stores value of toggle register #FULLSPACE_QUOTES (used in endnotes)
-#RESTORE_DOC_LEAD Holds value of current doc lead (used in endnotes)
-#RESTORE_OFFSET Page offset at moment footer trap is sprung; not currently used
-#REVISION The revision number
-#RIGHT_CAP_HEIGHT Cap height of right string in headers/footers
-#SH_LEAD_ADJUST #DOC_LEAD/8 (TYPESET) or /2 (TYPEWRITE) (used for subhead spacing)
+#RESET_QUOTE_SPACING Stores value of toggle register
+ #FULLSPACE_QUOTES (used in endnotes)
+#RESTORE_DOC_LEAD Holds value of current doc lead (used in
+ endnotes)
+#RESTORE_HY Restore hyphenation after .][? (toggle)
+#RESTORE_OFFSET Page offset at moment footer trap is sprung;
+ not currently used
+#RESTORE_TOC_PN_PADDING Saves #TOC_PN_PADDING in TOC prior to
+ processing $FIRST_DOC_TITLE
+#RIGHT_CAP_HEIGHT Cap height of right string in
+ headers/footers
+#RULED Tells FOOTNOTE if a rule (or space has been
+ put above the first footnote on the page
+#RUNON_FN_IN_DIVER If #LN=1, if we're in a (block)quote, instructs
+ FOOTNOTE to unformat diversion RUNON_FN_IN_DIVER
+#RUNON_FOOTNOTES If #LN=1, instructs FOOTNOTE to unformat
+ diversion RUNON_FOOTNOTES
+#RUN_ON Are we using run-on footnotes? (toggle)
+#SAVED_DIVER_FN_COUNT In the case of a footnote inside a
+ diversion that should be treated as a
+ "normal" footnote, FOOTNOTE needs to
+ distinguish between a "normal" deferred
+ footnote (always the 1st footnote on the
+ page) and one that only looks as if
+ it should be deferred, when, in fact,
+ it's an overflow; this register lets
+ FOOTNOTE know whether the diversion
+ footnote is, in fact, the first on the
+ page.
+#SAVED_FN_COUNT #FN_COUNT+1 prior to +#FN_COUNT; used
+ in FOOTNOTES while gathering fns inside
+ diversions
+#SAVED_FN_COUNT_FOR_COLS #FN_COUNT_FOR_COLS+1 prior to
+ +#FN_COUNT_FOR_COLS; used in FOOTNOTES
+ while gathering fns inside diversions
+#SAVED_FN_DEPTH_1 Footnote depth prior to adding footnote
+ diversion depth to FN_DEPTH; used when
+ footnote text will overflow
+#SAVED_FN_DEPTH_2 Footnote depth after to adding footnote
+ diversion depth to FN_DEPTH; used when
+ footnote text will overflow
+#SAVED_FOOTER_POS Position of FOOTER in DO_QUOTE (hack)
+#SAVED_LEAD In FOOTER and DO_FOOTER, stores the
+ lead in effect prior to outputting
+ FOOTNOTES or performing either
+ PROCESS_FN_LEFTOVER or
+ PROCESS_FN_IN_DIVERSION; both the
+ diversion FOOTNOTES and the two macros
+ have, for PRINT_STYLE 2, an AUTOLEAD
+ call, which requires that an LS be
+ performed with the #SAVED_LEAD in
+ order to remove register #AUTO_LEAD or
+ #AUTO_LEAD_FACTOR.
+#SEP_TYPE Set to 1 if LIST separator is ( or [ or {
+#SH_LEAD_ADJUST #DOC_LEAD/8 (TYPESET) or /2 (TYPEWRITE)
+ (used for subhead spacing)
#SH_NUM Subhead number
+#SHIM Amount of lead required to advance to
+ next legal baseline
+#SILENT_BQUOTE_LN "Silently" linenumber blockquotes? (toggle)
+#SILENT_QUOTE_LN "Silently" linenumber quotes? (toggle)
#SINGLE_SPACE Is TYPEWRITE in single space mode? (toggle)
+#SKIP_FOOTER If 1, instructs DO_FOOTER to do nothing
+ if B_MARGIN falls below FOOTER_MARGIN
#SLANT_MEANS_SLANT For TYPEWRITE. 1=yes; 0=no
-#SLANT_WAS_ON Keeps track of SLANT when it needs to go off for a while
-#SPACE_REMAINING Space remaining to footer trap; used to decide whether or not to defer a footnote
+#SLANT_WAS_ON Keeps track of SLANT when it needs to go off
+ for a while
+#SPACE_REMAINING Space remaining to footer trap; used to
+ decide whether or not to defer a footnote
+#SR_ADJ_FACTOR An adjustment factor that compensates
+ for the fact that #SPACE_REMAINING
+ sometimes reports a fractionally larger
+ space than is actually available for
+ footnote text.
#START If 1, signals completion of START
-#START_FOR_FOOTERS Toggle set in START; signals to PRINT_HDRFTR that START has been invoked, allowing PRINT_HDRFTR to decide whether or not to print a footer on page 1
+#START_FOR_FOOTERS Toggle set in START; signals to
+ PRINT_HDRFTR that START has been invoked,
+ allowing PRINT_HDRFTR to decide whether or
+ not to print a footer on page 1
+#START_FOR_MNinit If 1, defer processing MN_INIT until #START
+#STORED_PP_INDENT Temporarily holds value of #PP_INDENT
#SUITE Current page number (for letters)
#SUP_PT_SIZE Point size of superscript
-#SWITCH_HDRFTR Switch HDRFTR_LEFT and HDRFTR_RIGHT? (toggle)
+#SUSPEND_PAGINATION Suspend pagination prior to endnotes?
+#SWITCH_HDRFTR Switch HDRFTR_LEFT and HDRFTR_RIGHT?
+ (toggle)
+#T_MARGIN_LEAD_ADJ \n(.v-12000; ensures critically accurate
+ placement of first lines on pages when
+ doc processing is not being used and
+ a T_MARGIN has been set
#TAB_OFFSET# "#" at the end is from $CURRENT_TAB
-#TO Is there an addressee date (for letters)? 1=yes
+#TERMINATE Has TERMINATE been called? (toggle)
+#TOC_AUTHORS Whether to append author(s) to toc doc
+ title entries (toggle)
+#TOC_ENTRY_PN Current page number when a toc entry is
+ collected
+#TOC_FIRST_PAGE If 1, tells PRINT_PAGE_NUMBER that this
+ is the first page of the toc
+#TOC_LEAD Leading of toc pages
+#TOC_PN_PADDING Max. # of placeholders for toc entries
+ page numbers
+#TOC_PS Point size of toc pages
+#TOC_RV_SWITCH Switch L/R margins of toc pages
+#TOC_HEAD_INDENT Indent of toc head entries
+#TOC_HEAD_SIZE_CHANGE ps in/decrease of toc head entries****
+#TOC_PH_INDENT Indent of toc parahead entries
+#TOC_PH_SIZE_CHANGE ps in/decrease of toc parahead entries****
+#TOC_SH_INDENT Indent of toc subhead entries
+#TOC_SH_SIZE_CHANGE ps in/decrease of toc subhead entries****
+#TOC_TITLE_INDENT Indent of toc doc title entries
+#TOC_TITLE_SIZE_CHANGE ps in/decrease of toc doc title entries****
+#TOTAL_FIELDS Total number of letter header fields
#UNDERLINE_ITALIC For TYPEWRITE. 1=yes; 0=no
#UNDERLINE_QUOTE Underline pquotes? (toggle)
#UNDERLINE_SLANT For TYPEWRITE. 1=yes; 0=no
-#UNDERLINE_WAS_ON In HEADER to re-enable running text UNDERLINE (toggle)
-#USERDEF_HDRFTR User defined single string recto/verso header/footer? (toggle)
-#USERDEF_HDRFTR_RECTO_QUAD 1=left, 2=center, 3=right
-#USERDEF_HDRFTR_VERSO_QUAD 1=left, 2=center, 3=right
-#USER_DEF_HEADER_CENTER User defined center title? (1=yes); used in COPYSTYLE
-#USER_DEF_HEADER_LEFT User defined center title? (1=yes); used in COPYSTYLE
-#USER_DEF_HEADER_RIGHT User defined center title? (1=yes); used in COPYSTYLE
-#VARIABLE_FOOTER_POS Wandering trap position for processing footnotes and footers; pos depends on footnotes
+#UNDERLINE_WAS_ON In HEADER to re-enable running text
+ UNDERLINE (toggle)
+#USERDEF_HDRFTR User defined single string recto/verso
+ header/footer? (toggle)
+#USERDEF_HDRFTR_RECTO_QUAD 1=left, 2=CENTER, 3=right
+#USERDEF_HDRFTR_VERSO_QUAD 1=left, 2=CENTER, 3=right
+#USER_DEF_HEADER_CENTER User defined CENTER title? (1=yes);
+ used in COPYSTYLE
+#USER_DEF_HEADER_LEFT User defined CENTER title? (1=yes);
+ used in COPYSTYLE
+#USER_DEF_HEADER_RIGHT User defined CENTER title? (1=yes);
+ used in COPYSTYLE
+#VARIABLE_FOOTER_POS Wandering trap position for processing
+ footnotes and footers; pos depends on
+ footnotes
+#VISUAL_B_MARGIN Set in TRAPS, what \n(nl would report
+ on the last line of running text before
+ FOOTER is sprung.
+#VFP_DIFF #FN_DEPTH minus #SAVED_FN_DEPTH; the
+ number of footnote lines that will fit
+ on the page when there will be over, and
+ therefore the amount by which to raise
+ the VFP for footnotes with overflow after
+ the 1st footnote.
+y Vertical position stored with mk in hdrftrs.
+++STRINGS+++
-$ATTRIBUTE_STRING "by" line in doc header
-$AUTHOR_1...9 Document author(s)
-$AUTHOR_FAM Family to use for author in doc header
-$AUTHOR_FT Font to use for author in doc header
-$AUTHOR_SIZE_CHANGE ps in/decrease of author in doc header*
-$AUTHOR_PT_SIZE Absolute ps of authors
-$BQUOTE_FAM Family to use for blockquotes
-$BQUOTE_FT Font to use for blockquotes
-$BQUOTE_QUAD Quad value for blockquotes
-$BQUOTE_SIZE_CHANGE ps in/decrease of blockquotes*
-$CENTER_TITLE What to put in the middle of header title
-$CHAPTER The chapter number
-$CHAPTER_STRING What to print whenever the word "chapter" is required
-$CHAPTER_TITLE Chapter title (if there is one)
-$CHAPTER_TITLE_FAM Family of chapter title
-$CHAPTER_TITLE_FT Font of chapter title
-$CHAPTER_TITLE_SIZE_CHANGE ps in/decrease of chapter title*
-$CHAPTER_TITLE_PT_SIZE Absolute ps of chapter title
-$COPY_STYLE DRAFT or FINAL
-$DOC_FAM Predominant font family used in the document
-$DOC_QUAD Quad used for body text (justified or left)
-$DOC_TYPE Document type (default, chapter, named, letter)
-$DOCTYPE_FAM Family to use for DOCTYPE string in doc header
-$DOCTYPE_FT Font to use for DOCTYPE string in doc header
-$DOCTYPE_SIZE_CHANGE ps in/decrease of DOCTYPE string in doc header*
-$DOCTYPE_PT_SIZE Absolute ps of DOCTYPE
-$DRAFT_STRING What to print whenever the word "draft" is required
-$EN_FAMILY Family for endnotes
-$EN_FT Font for endnotes
-$EN_QUAD Quad for endnotes
-$EN_STRING Endnotes page head
-$EN_STRING_FAM Endnotes page head family
-$EN_STRING_FT Endnotes page head font
-$EN_STRING_QUAD Endnotes page head quad direction
-$EN_STRING_SIZE_CHANGE Endnotes page head size***
-$EN_TITLE Endnote document identifier
-$EN_TITLE_FAM Endnote document identifier family
-$EN_TITLE_FT Endnote document identifier font
-$EN_TITLE_QUAD Endnote document identifier quad direction
-$EN_TITLE_SIZE_CHANGE Endnote document identifier size***
-$EN_NUMBER_FAM Endnote numbering family
-$EN_NUMBER_FT Endnote numbering font
-$EN_NUMBER_SIZE_CHANGE Endnote numbering size***
-$EPI_AUTOLEAD Autolead value (decimals ok) of epigraphs
-$EPI_FAM Family to use in epigraphs
-$EPI_FT Font to use in epigraphs
-$EPI_QUAD Quad in block-style epigraphs (justified or left)
-$EPI_SIZE_CHANGE ps in/decrease of epigraphs*
-$FINIS_STRING What to print when FINIS macro is invoked
-$FN_FAM Family used in footnotes
-$FN_FT Font used in footnotes
-$FN_QUAD Quad used in footnotes
-$FN_SIZE_CHANGE ps in/decrease of footnotes*
-$HDRFTR_CENTER_FAM Family of center part of headers
-$HDRFTR_CENTER_FT Font of center part of headers
-$HDRFTR_CENTER_SIZE_CHANGE ps in/decrease of center title in headers**
-$HDRFTR_CENTER What to put in center part of headers; default doctype
-$HDRFTR_FAM Family to use in headers
-$HDRFTR_LEFT_FAM Family of left part of headers
-$HDRFTR_LEFT_FT Font of left part of headers
-$HDRFTR_LEFT_SIZE_CHANGE ps in/decrease of author in headers**
-$HDRFTR_LEFT What to put in left part of headers; default author
-$HDRFTR_RIGHT_FAM Family of right part of headers
-$HDRFTR_RIGHT_FT Font of right part of headers
-$HDRFTR_RIGHT_SIZE_CHANGE ps in/decrease of right part of headers**
-$HDRFTR_RIGHT What to put in right part of headers; default title
-$HDRFTR_SIZE_CHANGE ps in/decrease of headers*
-$HDRFTR_TMP_SIZE_CHANGE_SWITCH Temporarily holds HDRFTR_LEFT_SIZE_CHANGE if #SWITCH_HDRFTRS=1
-$HDRFTR_TMP_SWITCH Temporarily holds HDRFTR_LEFT if #SWITCH_HDRFTRS=1
-$HEAD_FAM Family to use for section titles
-$HEAD_FT Font to use for section titles
-$HEAD_QUAD Quad valude of section titles
-$HEAD_SIZE_CHANGE ps in/decrease of section titles*
-$LINEBREAK_CHAR Character that marks line breaks
-$LINEBREAK_CHAR_V_ADJ +|- amount by which to raise/lower linebreak character
-PAGE# For use in hdrftr strings where page # is needed; \*[PAGE]
-$PAGENUM_STYLE String passed to PAGENUM_STYLE
-$PAGE_NUM_FAM Family of page numbers
-$PAGE_NUM_FT Font of page numbers
-$PAGE_NUM_SIZE_CHANGE ps in/decrease of page numbers
-$PAPER Paper size (LETTER, A4, LEGAL); default=LETTER
-$PP_FT Font used in paragraphs
-$QUOTE_FAM Family to use for pquotes
-$QUOTE_FT Font to use for pquotes
-$QUOTE_SIZE_CHANGE ps in/decrease of pquotes*
-$REVISION_STRING What to print whenever the word "revision" is required
-$SH_FAM Family to use in subheads
-$SH_FT Font to use in subheads
-$SH_SIZE_CHANGE ps in/decrease of subheads*
-$SUBTITLE Document subtitle
-$SUBTITLE_FAM Family to use for subtitle in doc header
-$SUBTITLE_FT Font to use for subtitle in doc header
-$SUBTITLE_SIZE_CHANGE ps in/decrease of subtitle*
-$SUBTITLE_PT_SIZE Absolute ps of subtitle
-$SUITE The #SUITE number register
-$TITLE Document title
-$TITLE_FAM Family to use for title in doc header
-$TITLE_FT Font to use for title in doc header
-$TITLE_PT_SIZE Absolute point size of title in docheader
-$TITLE_SIZE_CHANGE ps in/decrease of title in doc header*
-$USERDEF_HDRFTR_RECTO User defined header/footer recto string
-$USERDEF_HDRFTR_VERSO User defined header/footer verso string
-
- *relative to #DOC_PT_SIZE
- **relative to overall ps of headers as set by HEADER_SIZE
-***relative to overall ps of endnotes
+$1ST_LETTER First letter of first arg to LIST
+$ADJUST_BIB_LEAD 2nd arg to BIBLIOGRAPHY_LEAD; if not blank
+ adjust bib leading
+$ATTRIBUTE_STRING "by" line in doc header
+$AUTHOR_1...9 Document author(s)
+$AUTHOR_FAM Family to use for author in doc header
+$AUTHOR_FT Font to use for author in doc header
+$AUTHOR_SIZE_CHANGE ps in/decrease of author in doc header*
+$AUTHOR_PT_SIZE Absolute ps of authors
+$BIB_FAM Bibliography page family
+$BIB_FT Bibliography page font
+$BIB_LEAD Base leading for bibliographies
+$BIB_LIST_SEPARATOR Separator between enumerator and text
+ when outputting bibliographies in LIST style
+$BIB_LIST_PREFIX Prefix before enumerator when outputting
+ bibliographies in LIST style
+$BIB_PN_STYLE Format of bibliography page numbers
+$BIB_SPACE Post entry space for bibliographies
+$BIB_STRING Bibliography title string
+$BIB_STRING_FAM Bib title family
+$BIB_STRING_FT Bib title font
+$BIB_STRING_QUAD Bib title quad
+$BIB_STRING_SIZE_CHANGE Bib title size (+ or -)
+$BQ_LN_GUTTER Gutter between line numbers and bquotes in
+ bquotes
+$BQUOTE_COLOR Blockquote color
+$BQUOTE_FAM Family to use for blockquotes
+$BQUOTE_FT Font to use for blockquotes
+$BQUOTE_QUAD Quad value for blockquotes
+$BQUOTE_SIZE_CHANGE ps in/decrease of blockquotes*
+$CENTER_TITLE What to put in the middle of header
+ title
+$CHAPTER The chapter number
+$CHAPTER_STRING What to print whenever the word
+ "chapter" is required
+$CHAPTER_TITLE Chapter title (if there is one)
+$CHAPTER_TITLE_FAM Family of chapter title
+$CHAPTER_TITLE_FT Font of chapter title
+$CHAPTER_TITLE_SIZE_CHANGE ps in/decrease of chapter title*
+$CHAPTER_TITLE_PT_SIZE Absolute ps of chapter title
+$CHAPTER_TITLE_COLOR Color of chapter title
+$COPYRIGHT_FAM Copyright line family
+$COPYRIGHT_FT Copyright line font
+$COPYRIGHT_SIZE_CHANGE Copyright line size*
+$COPYRIGHT_COLOR Copyright line color
+$COPYRIGHT_QUAD Copyright line quad direction
+$COPY_STYLE DRAFT or FINAL
+$COVER_FAM Overall cover family
+$COVER_COLOR Overall cover color
+$COVER_TITLE User-defined cover title string
+$COVER_TITLE_FAM Cover title family
+$COVER_TITLE_FT Cover title font
+$COVER_TITLE_SIZE_CHANGE Cover title size*
+$COVER_TITLE_COLOR Cover title color
+$COVER_SUBTITLE_FAM Cover subtitle family
+$COVER_SUBTITLE_FT Cover subtitle font
+$COVER_SUBTITLE_SIZE_CHANGE Cover subtitle size*
+$COVER_SUBTITLE_COLOR Cover subtitle color
+$COVER_ATTRIBUTE_COLOR Cover attribution string color
+$COVER_AUTHOR_FAM Cover author(s) family
+$COVER_AUTHOR_FT Cover author(s) font
+$COVER_AUTHOR_SIZE_CHANGE Cover author(s) size*
+$COVER_AUTHOR_COLOR Cover author(s) color
+$COVER_DOCTYPE_FAM Cover doctype family
+$COVER_DOCTYPE_FT Cover doctype font
+$COVER_DOCTYPE_SIZE_CHANGE Cover doctype size*
+$COVER_DOCTYPE_COLOR Cover doctype color
+$COVER_COPYRIGHT_FAM Cover copyright family
+$COVER_COPYRIGHT_FT Cover copyright font
+$COVER_COPYRIGHT_SIZE_CHANGE Cover copyright size*
+$COVER_COPYRIGHT_COLOR Cover copyright color
+$COVER_MISC_FAM Cover misc family
+$COVER_MISC_FT Cover misc font
+$COVER_MISC_SIZE_CHANGE Cover misc size*
+$COVER_MISC_COLOR Cover misc color
+$CURRENT_EV \n[.ev] at REF_BRACKETS_START
+$DOC_COVER_FAM Overall doc cover family
+$DOC_COVER_COLOR Overall doc cover color
+$DOC_COVER_TITLE User-defined doc cover title string
+$DOC_COVER_TITLE_FAM Doc cover title family
+$DOC_COVER_TITLE_FT Doc cover title font
+$DOC_COVER_TITLE_SIZE_CHANGE Doc cover title size*
+$DOC_COVER_TITLE_COLOR Doc cover title color
+$DOC_COVER_SUBTITLE_FAM Doc cover subtitle family
+$DOC_COVER_SUBTITLE_FT Doc cover subtitle font
+$DOC_COVER_SUBTITLE_SIZE_CHANGE Doc cover subtitle size*
+$DOC_COVER_SUBTITLE_COLOR Doc cover subtitle color
+$DOC_COVER_ATTRIBUTE_COLOR Doc cover attribution string color
+$DOC_COVER_AUTHOR_FAM Doc cover author(s) family
+$DOC_COVER_AUTHOR_FT Doc cover author(s) font
+$DOC_COVER_AUTHOR_SIZE_CHANGE Doc cover author(s) size*
+$DOC_COVER_AUTHOR_COLOR Doc cover author(s) color
+$DOC_COVER_DOCTYPE_FAM Doc cover doctype family
+$DOC_COVER_DOCTYPE_FT Doc cover doctype font
+$DOC_COVER_DOCTYPE_SIZE_CHANGE Doc cover doctype size*
+$DOC_COVER_DOCTYPE_COLOR Doc cover doctype color
+$DOC_COVER_COPYRIGHT_FAM Doc cover copyright family
+$DOC_COVER_COPYRIGHT_FT Doc cover copyright font
+$DOC_COVER_COPYRIGHT_SIZE_CHANGE Doc cover copyright size*
+$DOC_COVER_COPYRIGHT_COLOR Doc cover copyright color
+$DOC_COVER_MISC_FAM Doc cover misc family
+$DOC_COVER_MISC_FT Doc cover misc font
+$DOC_COVER_MISC_SIZE_CHANGE Doc cover misc size*
+$DOC_COVER_MISC_COLOR Doc cover misc color
+$DOC_FAM Predominant font family used in the
+ document
+$DOC_QUAD Quad used for body text (justified or
+ left)
+$DOC_TITLE Overall doc title that gets printed in
+ headers/footers (mostly for use with
+ collated docs where each doc is an
+ article with a different title)
+$DOC_TYPE Document type (default, chapter, named,
+ letter)
+$DOCHEADER_COLOR Color of docheader
+$DOCHEADER_FAM Family used for all parts of the docheader
+$DOCHEADER_LEAD_ADJ +|- value applied to #DOC_LEAD to
+ in/decrease leading of doc header
+$DOCTYPE_FAM Family to use for DOCTYPE string in
+ doc header
+$DOCTYPE_FT Font to use for DOCTYPE string in
+ doc header
+$DOCTYPE_SIZE_CHANGE ps in/decrease of DOCTYPE string in
+ doc header*
+$DOCTYPE_PT_SIZE Absolute ps of DOCTYPE
+$DRAFT The draft number (string valued)
+$DRAFT_STRING What to print whenever the word "draft"
+ is required
+EN_MARK Inline, gets #EN_MARK (\(ln)
+$EN_CLOSE_BRACKET Close bracket for line-number enumerated
+ endnotes
+$EN_FAMILY Family for endnotes
+$EN_FT Font for endnotes
+$EN_LINENUMBER String to print for line-number enumerators
+ in line-numbered endnotes
+$EN_LN_FAM Family for line-numbers in line-number
+ identified endnotes
+$EN_LN_FT Font for line-numbers in line-number
+ identified endnotes
+$EN_LN_GAP Gap to leave in initial endnote lines
+ between line-number identifies and text
+$EN_OPEN_BRACKET Open bracket for line-number enumerated
+ endnotes
+$EN_LN_SIZE_CHANGE Size change (+ or -) for line-numbers in
+ line-number identified endnotes
+$EN_PN_STYLE Pagenumbering style for endnotes pages
+$EN_QUAD Quad for endnotes
+$EN_STRING Endnotes page head
+$EN_STRING_FAM Endnotes page head family
+$EN_STRING_FT Endnotes page head font
+$EN_STRING_QUAD Endnotes page head quad direction
+$EN_STRING_SIZE_CHANGE Endnotes page head size***
+$EN_TITLE Endnote document identifier
+$EN_TITLE_FAM Endnote document identifier family
+$EN_TITLE_FT Endnote document identifier font
+$EN_TITLE_QUAD Endnote document identifier quad
+ direction
+$EN_TITLE_SIZE_CHANGE Endnote document identifier size***
+$EN_NUMBER_FAM Endnote numbering family
+$EN_NUMBER_FT Endnote numbering font
+$EN_NUMBER_SIZE_CHANGE Endnote numbering size***
+$EPI_AUTOLEAD Autolead value (decimals ok) of
+ epigraphs
+$EPI_COLOR Color of epigraphs
+$EPI_FAM Family to use in epigraphs
+$EPI_FT Font to use in epigraphs
+$EPI_QUAD Quad in block-style epigraphs
+ (justified or left)
+$EPI_SIZE_CHANGE ps in/decrease of epigraphs*
+$EVAL_BIB_SPACE Temporary string to find out if the
+ arg to BIBLIOGRAPHY_SPACING ended in "v"
+$FINIS_COLOR Color of FINIS string
+$FINIS_STRING What to print when FINIS macro is
+ invoked
+$FIRST_DOC_TITLE 1st doc's title captured in COLLATE
+FN_MARK Inline, gets #FN_MARK (\n(ln)
+$FN_CLOSE_BRACKET Close bracket for line-number identified
+ footnotes
+$FN_FAM Family used in footnotes
+$FN_FT Font used in footnotes
+$FN_LINENUMBER String to print before footnotes when
+ line-numbering enabled for footnotes
+$FN_LN_SEP Separator after line-number identified
+ footnotes
+$FN_OPEN_BRACKET Open bracket for line-number identified
+ footnotes
+$FN_QUAD Quad used in footnotes
+$FN_SIZE_CHANGE ps in/decrease of footnotes*
+$FOOTNOTE_COLOR Footnote color
+$HDRFTR_CENTER What to put in CENTER part of headers;
+ default doctype
+$HDRFTR_CENTER_FAM Family of CENTER part of headers
+$HDRFTR_CENTER_FT Font of centre part of headers
+$HDRFTR_CENTER_NEW HDRFTR_CENTER after the start of TOC;
+ defined in HDRFTR_CENTER if
+ HDRFTR_CENTER is called as
+ FOOTER_CENTER
+$HDRFTR_CENTER_OLD HDRFTR_CENTER just prior to start of
+ TOC; defined in HDRFTR_CENTER if
+ HDRFTR_CENTER is called as
+ FOOTER_CENTER
+$HDRFTR_CENTER_SIZE_CHANGE ps in/decrease of centre title in
+ headers**
+$HDRFTR_COLOR Color of headers/footers
+$HDRFTR_FAM Family to use in headers
+$HDRFTR_LEFT_FAM Family of left part of headers
+$HDRFTR_LEFT_FT Font of left part of headers
+$HDRFTR_LEFT_SIZE_CHANGE ps in/decrease of author in headers**
+$HDRFTR_LEFT What to put in left part of headers;
+ default author
+$HDRFTR_RIGHT_FAM Family of right part of headers
+$HDRFTR_RIGHT_FT Font of right part of headers
+$HDRFTR_RIGHT_SIZE_CHANGE ps in/decrease of right part of
+ headers**
+$HDRFTR_RIGHT What to put in right part of headers;
+ default title
+$HDRFTR_SIZE_CHANGE ps in/decrease of headers*
+$HDRFTR_TMP_SIZE_CHANGE_SWITCH Temporarily holds
+ HDRFTR_LEFT_SIZE_CHANGE if
+ #SWITCH_HDRFTRS=1
+$HDRFTR_TMP_SWITCH Temporarily holds HDRFTR_LEFT if
+ #SWITCH_HDRFTRS=1
+$HEAD_COLOR Head color
+$HEAD_FAM Family to use for section titles
+$HEAD_FT Font to use for section titles
+$HEAD_QUAD Quad value of section titles
+$HEAD_SIZE_CHANGE ps in/decrease of section titles*
+$LINEBREAK_CHAR Character that marks line breaks
+$LINEBREAK_CHAR_V_ADJ +|- amount by which to raise/lower
+ linebreak character
+$LAST_CHAR Temporary string used to discover whether
+ user has remembered to put a digit after
+ ROMAN or roman in arg to LIST
+$LINEBREAK_COLOR Linebreak color
+$LIST_ARG_1 The first arg to LIST (minus digits if
+ ROMAN or roman
+$LN_GUTTER Gutter to leave between line numbers
+ and text
+$LN_INC 2nd arg to NUMBER_LINES as a string
+$LN_NUM 1st arg to NUMBER_LINES as a string
+$MISC_COLOR Misc line color
+$MISC_QUAD Misc line quad
+PAGE# For use in hdrftr strings where page #
+ is needed; \*[PAGE]
+$PAGENUM_COLOR Page number color
+$PAGENUM_STYLE String passed to PAGENUM_STYLE
+$PAGE_NUM_FAM Family of page numbers
+$PAGE_NUM_FT Font of page numbers
+$PAGE_NUM_SIZE_CHANGE ps in/decrease of page numbers
+$PAPER Paper size (LETTER, A4, LEGAL);
+ default=LETTER
+$PH_COLOR Parahead color
+$PP_FT Font used in paragraphs
+$ROMAN_WIDTH The digit(s) appended to ROMAN or
+ roman LIST args
+$Q_LN_GUTTER Gutter between linenumbers and quotes
+ in quotes
+$QUOTE_COLOR Quote (poetic) color
+$QUOTE_FAM Family to use for pquotes
+$QUOTE_FT Font to use for pquotes
+$QUOTE_SIZE_CHANGE ps in/decrease of pquotes*
+$REF_BIB_INDENT 2nd line indent value for references in
+ bibliographies
+$REF_EN_INDENT 2nd line indent value for references in
+ endnotes
+$REF_FN_INDENT 2nd line indent value for references in
+ footnotes
+$RESTORE_SS_VAR Saves \*[$SS_VAR] for use with ref*build
+#REVISION The revision number (string valued)
+$REVISION_STRING What to print whenever the word
+ "revision" is required
+$SH_FAM Family to use in subheads
+$SH_FT Font to use in subheads
+$SH_SIZE_CHANGE ps in/decrease of subheads*
+$SH_COLOR Subhead color
+$SUBTITLE Document subtitle
+$SUBTITLE_FAM Family to use for subtitle in doc
+ header
+$SUBTITLE_FT Font to use for subtitle in doc header
+$SUBTITLE_SIZE_CHANGE ps in/decrease of subtitle*
+$SUBTITLE_PT_SIZE Absolute ps of subtitle
+$SUITE The #SUITE number register
+$TITLE Document title
+$TITLE_FAM Family to use for title in doc header
+$TITLE_FT Font to use for title in doc header
+$TITLE_PT_SIZE Absolute point size of title in docheader
+$TITLE_SIZE_CHANGE ps in/decrease of title in doc header*
+$TOC_AUTHORS What to print after toc doc title entry
+ if #TOC_AUTHORS=1
+$TOC_FAM Family to use on toc pages
+$TOC_HEAD_FAM Family of toc head entries
+$TOC_HEAD_FT Font of toc head entries
+$TOC_HEAD_ITEM A head as collected for TOC_ENTRIES
+$TOC_HEADER_FAM Family to use for "Contents"
+$TOC_HEADER_FT Font to use for "Contents"
+$TOC_HEADER_QUAD Quad direction of "Contents"
+$TOC_HEADER_SIZE ps in/decrease of "Contents"****
+$TOC_HEADER_STRING Header string of first toc page
+$TOC_PN Sets up toc leaders + entry pn
+ (typeset)
+$TOC_PN_FAM Family for toc entries page numbers
+$TOC_PN_FT Font for toc entries page numbers
+$TOC_PN_SIZE_CHANGE ps in/decrease of toc entries page
+ numbers
+$TOC_PN_STYLE Page-numbering style of toc pages
+$TOC_PN_TYPEWRITE Sets up toc leaders + entry pn
+ (typewrite)
+$TOC_PH_FAM Family of toc parahead entries
+$TOC_PH_FT Font of toc parahead entries
+$TOC_PARAHEAD_ITEM A parahead collected for TOC_ENTRIES
+$TOC_SH_FAM Family of toc subhead entries
+$TOC_SH_FT Font of toc subhead entries
+$TOC_SH_ITEM A subhead collected for TOC_ENTRIES
+$TOC_TITLE_FAM Family of toc doc title entries
+$TOC_TITLE_FT Font of toc doc title entries
+$USER_SET_TITLE_ITEM User defined toc doc title entry as
+ set by TOC_TITLE_ENTRY
+$UR_PAGINATION_STYLE Pagination style prior to endnotes
+$USERDEF_HDRFTR_RECTO User defined header/footer recto string
+$USERDEF_HDRFTR_VERSO User defined header/footer verso string
+
+ *relative to #DOC_PT_SIZE
+ **relative to overall ps of headers as set by HEADER_SIZE
+ ***relative to overall ps of endnotes
+****relative to overall ps of toc pages
+++PREPROCESSOR KEYWORDS+++
@@ -948,6 +1935,19 @@ cend
+++ALIASES+++
+Please note:
+
+Prior to version 1.1.9, all macros that included the word COLOR had
+aliases that used COLOUR instead. This convenience has now been
+removed, in an effort to reduce the size of the om.tmac file.
+
+Furthermore, if you want the convenience, you'll have to edit the
+om.tmac file. Simply aliasing, say, HEAD_COLOR as HEAD_COLOUR will
+not work, owing to significant changes in the handling of
+docelement control macros that end in _COLOR.
+
++++The following are for convenience, and header/footer management+++
+
BREAK_BLOCKQUOTE BREAK_QUOTE
BREAK_CITATION BREAK_QUOTE
BREAK_CITE BREAK_QUOTE
@@ -956,7 +1956,7 @@ CITE BLOCKQUOTE
COL_BREAK COL_NEXT
DOC_FAM DOC_FAMILY
DOC_LLENGTH DOC_LINE_LENGTH
-DOC_L_LENGTT DOC_LINE_LENGTH
+DOC_L_LENGTH DOC_LINE_LENGTH
DOC_L_MARGIN DOC_LEFT_MARGIN
DOC_LMARGIN DOC_LEFT_MARGIN
DOC_LS DOC_LEAD
@@ -964,84 +1964,31 @@ DOC_PS DOC_PT_SIZE
DOC_R_MARGIN DOC_RIGHT_MARGIN
DOC_RMARGIN DOC_RIGHT_MARGIN
FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS
-FOOTER_CENTER_FAM HDRFTR_CENTER_FAMILY
-FOOTER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
-FOOTER_CENTER_FONT HDRFTR_CENTER_FONT
-FOOTER_CENTER_FT HDRFTR_CENTER_FONT
FOOTER_CENTER HDRFTR_CENTER
-FOOTER_CENTER_PS HDRFTR_CENTER_SIZE
-FOOTER_CENTER_SIZE HDRFTR_CENTER_SIZE
FOOTER_CENTRE_CAPS HDRFTR_CENTER_CAPS
-FOOTER_CENTRE_FAM HDRFTR_CENTER_FAMILY
-FOOTER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
-FOOTER_CENTRE_FT HDRFTR_CENTER_FONT
FOOTER_CENTRE HDRFTR_CENTER
-FOOTER_CENTRE_PS HDRFTR_CENTER_SIZE
-FOOTER_CENTRE_SIZE HDRFTR_CENTER_SIZE
-FOOTER_FAM HDRFTR_FAMILY
-FOOTER_FAMILY HDRFTR_FAMILY
FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS
-FOOTER_LEFT_FAM HDRFTR_LEFT_FAMILY
-FOOTER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
-FOOTER_LEFT_FONT HDRFTR_LEFT_FONT
-FOOTER_LEFT_FT HDRFTR_LEFT_FONT
FOOTER_LEFT HDRFTR_LEFT
-FOOTER_LEFT_PS HDRFTR_LEFT_SIZE
-FOOTER_LEFT_SIZE HDRFTR_LEFT_SIZE
FOOTER_PLAIN HDRFTR_PLAIN
FOOTER_RECTO HDRFTR_RECTO
FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
-FOOTER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
-FOOTER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
-FOOTER_RIGHT_FONT HDRFTR_RIGHT_FONT
-FOOTER_RIGHT_FT HDRFTR_RIGHT_FONT
FOOTER_RIGHT HDRFTR_RIGHT
-FOOTER_RIGHT_PS HDRFTR_RIGHT_SIZE
-FOOTER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
FOOTER_RULE_GAP HDRFTR_RULE_GAP
FOOTER_RULE HDRFTR_RULE
-FOOTER_SIZE HDRFTR_SIZE
FOOTER_VERSO HDRFTR_VERSO
HDRFTR_RULE_INTERNAL HDRFTR_RULE
HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS
-HEADER_CENTER_FAM HDRFTR_CENTER_FAMILY
-HEADER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
-HEADER_CENTER_FONT HDRFTR_CENTER_FONT
-HEADER_CENTER_FT HDRFTR_CENTER_FONT
HEADER_CENTER HDRFTR_CENTER
-HEADER_CENTER_PS HDRFTR_CENTER_SIZE
-HEADER_CENTER_SIZE HDRFTR_CENTER_SIZE
HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS
-HEADER_CENTRE_FAM HDRFTR_CENTER_FAMILY
-HEADER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
-HEADER_CENTRE_FONT HDRFTR_CENTER_FONT
-HEADER_CENTRE_FT HDRFTR_CENTER_FONT
HEADER_CENTRE HDRFTR_CENTER
-HEADER_CENTRE_PS HDRFTR_CENTER_SIZE
-HEADER_CENTRE_SIZE HDRFTR_CENTER_SIZE
-HEADER_FAM HDRFTR_FAMILY
-HEADER_FAMILY HDRFTR_FAMILY
HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS
-HEADER_LEFT_FAM HDRFTR_LEFT_FAMILY
-HEADER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
-HEADER_LEFT_FONT HDRFTR_LEFT_FONT
-HEADER_LEFT_FT HDRFTR_LEFT_FONT
HEADER_LEFT HDRFTR_LEFT
-HEADER_LEFT_PS HDRFTR_LEFT_SIZE
-HEADER_LEFT_SIZE HDRFTR_LEFT_SIZE
HEADER_PLAIN HDRFTR_PLAIN
HEADER_RECTO HDRFTR_RECTO
HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
-HEADER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
-HEADER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
-HEADER_RIGHT_FONT HDRFTR_RIGHT_FONT
-HEADER_RIGHT_FT HDRFTR_RIGHT_FONT
HEADER_RIGHT HDRFTR_RIGHT
-HEADER_RIGHT_PS HDRFTR_RIGHT_SIZE
-HEADER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
HEADER_RULE_GAP HDRFTR_RULE_GAP
HEADER_RULE HDRFTR_RULE
-HEADER_SIZE HDRFTR_SIZE
HEADER_VERSO HDRFTR_VERSO
PAGENUM PAGENUMBER
PAGINATION PAGINATE
@@ -1049,6 +1996,200 @@ PP_FT PP_FONT
PRINT_FOOTNOTE_RULE FOOTNOTE_RULE
SWITCH_FOOTERS SWITCH_HDRFTR
SWITCH_HEADERS SWITCH_HDRFTR
+TOC_LS TOC_LEAD
+TOC_PS TOC_PT_SIZE
+
++++The following are used for docelement type-style control+++
+
+AUTHOR_FAMILY _FAMILY
+AUTHOR_FONT _FONT
+AUTHOR_SIZE _SIZE
+BIBLIOGRAPHY_FAMILY _FAMILY
+BIBLIOGRAPHY_FONT _FONT
+BIBLIOGRAPHY_FOOTER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
+BIBLIOGRAPHY_FOOTER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
+BIBLIOGRAPHY_HEADER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
+BIBLIOGRAPHY_HEADER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
+BIBLIOGRAPHY_QUAD _QUAD
+BIBLIOGRAPHY_STRING_FAMILY _FAMILY
+BIBLIOGRAPHY_STRING_FONT _FONT
+BIBLIOGRAPHY_STRING_QUAD _QUAD
+BIBLIOGRAPHY_STRING_SIZE _SIZE
+BLOCKQUOTE_AUTOLEAD Q_AUTOLEAD
+BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
+BLOCKQUOTE_COLOR _COLOR
+BLOCKQUOTE_FAMILY _FAMILY
+BLOCKQUOTE_FONT _FONT
+BLOCKQUOTE_QUAD _QUAD
+BLOCKQUOTE_SIZE _SIZE
+CHAPTER_TITLE_COLOR _COLOR
+CHAPTER_TITLE_FAMILY _FAMILY
+CHAPTER_TITLE_FONT _FONT
+CHAPTER_TITLE_SIZE _SIZE
+COVER_ATTRIBUTE_COLOR _COLOR
+COVER_AUTHOR_COLOR _COLOR
+COVER_AUTHOR_FAMILY _FAMILY
+COVER_AUTHOR_FONT _FONT
+COVER_AUTHOR_SIZE _SIZE
+COVER_COLOR _COLOR
+COVER_COPYRIGHT_COLOR _COLOR
+COVER_COPYRIGHT_FAMILY _FAMILY
+COVER_COPYRIGHT_FONT _FONT
+COVER_COPYRIGHT_QUAD _QUAD
+COVER_COPYRIGHT_SIZE _SIZE
+COVER_DOCTYPE_COLOR _COLOR
+COVER_DOCTYPE_FAMILY _FAMILY
+COVER_DOCTYPE_FONT _FONT
+COVER_DOCTYPE_SIZE _SIZE
+COVER_FAMILY _FAMILY
+COVER_MISC_COLOR _COLOR
+COVER_MISC_QUAD _QUAD
+COVER_SUBTITLE_COLOR _COLOR
+COVER_SUBTITLE_FAMILY _FAMILY
+COVER_SUBTITLE_FONT _FONT
+COVER_SUBTITLE_SIZE _SIZE
+COVER_TITLE_COLOR _COLOR
+COVER_TITLE_FAMILY _FAMILY
+COVER_TITLE_FONT _FONT
+COVER_TITLE_SIZE _SIZE
+DOC_COVER_ATTRIBUTE_COLOR _COLOR
+DOC_COVER_AUTHOR_COLOR _COLOR
+DOC_COVER_AUTHOR_FAMILY _FAMILY
+DOC_COVER_AUTHOR_FONT _FONT
+DOC_COVER_AUTHOR_SIZE _SIZE
+DOC_COVER_COLOR _COLOR
+DOC_COVER_COPYRIGHT_COLOR _COLOR
+DOC_COVER_COPYRIGHT_FAMILY _FAMILY
+DOC_COVER_COPYRIGHT_FONT _FONT
+DOC_COVER_COPYRIGHT_QUAD _QUAD
+DOC_COVER_COPYRIGHT_SIZE _SIZE
+DOC_COVER_DOCTYPE_COLOR _COLOR
+DOC_COVER_DOCTYPE_FAMILY _FAMILY
+DOC_COVER_DOCTYPE_FONT _FONT
+DOC_COVER_DOCTYPE_SIZE _SIZE
+DOC_COVER_FAMILY _FAMILY
+DOC_COVER_MISC_COLOR _COLOR
+DOC_COVER_MISC_QUAD _QUAD
+DOC_COVER_SUBTITLE_COLOR _COLOR
+DOC_COVER_SUBTITLE_FAMILY _FAMILY
+DOC_COVER_SUBTITLE_FONT _FONT
+DOC_COVER_SUBTITLE_SIZE _SIZE
+DOC_COVER_TITLE_COLOR _COLOR
+DOC_COVER_TITLE_FAMILY _FAMILY
+DOC_COVER_TITLE_FONT _FONT
+DOC_COVER_TITLE_SIZE _SIZE
+DOCHEADER_COLOR _COLOR
+DOCHEADER_FAMILY _FAMILY
+DOC_QUAD _QUAD
+DOCTYPE_FAMILY _FAMILY
+DOCTYPE_FONT _FONT
+DOCTYPE_SIZE _SIZE
+ENDNOTE_BLOCKQUOTE_AUTOLEAD Q_AUTOLEAD
+ENDNOTE_BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
+ENDNOTE_FAMILY _FAMILY
+ENDNOTE_FONT _FONT
+ENDNOTE_LINENUMBER_FAMILY _FAMILY
+ENDNOTE_LINENUMBER_FONT _FONT
+ENDNOTE_LINENUMBER_SIZE _SIZE
+ENDNOTE_NUMBER_FAMILY _FAMILY
+ENDNOTE_NUMBER_FONT _FONT
+ENDNOTE_NUMBER_SIZE _SIZE
+ENDNOTE_QUAD _QUAD
+ENDNOTE_QUOTE_AUTLOEAD Q_AUTOLEAD
+ENDNOTE_QUOTE_AUTOLEAD QUOTE_AUTOLEAD
+ENDNOTE_STRING_FAMILY _FAMILY
+ENDNOTE_STRING_FONT _FONT
+ENDNOTE_STRING_QUAD _QUAD
+ENDNOTE_STRING_SIZE _SIZE
+ENDNOTE_TITLE_FAMILY _FAMILY
+ENDNOTE_TITLE_FONT _FONT
+ENDNOTE_TITLE_QUAD _QUAD
+ENDNOTE_TITLE_SIZE _SIZE
+EPIGRAPH_COLOR _COLOR
+EPIGRAPH_FAMILY _FAMILY
+EPIGRAPH_FONT _FONT
+EPIGRAPH_QUAD _QUAD
+EPIGRAPH_SIZE _SIZE
+FINIS_COLOR _COLOR
+FOOTNOTE_COLOR _COLOR
+FOOTNOTE_FAMILY _FAMILY
+FOOTNOTE_FONT _FONT
+FOOTNOTE_QUAD _QUAD
+FOOTNOTE_SIZE _SIZE
+HDRFTR_CENTER_FAMILY _FAMILY
+HDRFTR_CENTER_FONT _FONT
+HDRFTR_CENTER_SIZE _SIZE
+HDRFTR_COLOR _COLOR
+HDRFTR_FAMILY _FAMILY
+HDRFTR_LEFT_FAMILY _FAMILY
+HDRFTR_LEFT_FONT _FONT
+HDRFTR_LEFT_SIZE _SIZE
+HDRFTR_RIGHT_FAMILY _FAMILY
+HDRFTR_RIGHT_FONT _FONT
+HDRFTR_RIGHT_SIZE _SIZE
+HDRFTR_RULE_COLOR _COLOR
+HDRFTR_SIZE _SIZE
+HEAD_COLOR _COLOR
+HEAD_FAMILY _FAMILY
+HEAD_FONT _FONT
+HEAD_QUAD _QUAD
+HEAD_SIZE _SIZE
+LINEBREAK_COLOR _COLOR
+MISC_COLOR _COLOR
+MISC_QUAD _QUAD
+PAGENUM_COLOR _COLOR
+PAGENUM_FAMILY _FAMILY
+PAGENUM_FONT _FONT
+PARAHEAD_COLOR _COLOR
+PARAHEAD_FAMILY _FAMILY
+PARAHEAD_FONT _FONT
+PARAHEAD_SIZE _SIZE
+QUOTE_COLOR _COLOR
+QUOTE_FAMILY _FAMILY
+QUOTE_FONT _FONT
+QUOTE_INDENT _INDENT
+QUOTE_SIZE _SIZE
+REF_INDENT INDENT_REFS
+REF) REF_BRACKETS_END
+REF] REF_BRACKETS_END
+REF} REF_BRACKETS_END
+REF( REF_BRACKETS_START
+REF[ REF_BRACKETS_START
+REF{ REF_BRACKETS_START
+SUBHEAD_COLOR _COLOR
+SUBHEAD_FAMILY _FAMILY
+SUBHEAD_FONT _FONT
+SUBHEAD_SIZE _SIZE
+SUBTITLE_COLOR _COLOR
+SUBTITLE_FAMILY _FAMILY
+SUBTITLE_FONT _FONT
+SUBTITLE_SIZE _SIZE
+TITLE_COLOR _COLOR
+TITLE_FAMILY _FAMILY
+TITLE_FONT _FONT
+TITLE_SIZE _SIZE
+TOC_FAM _FAMILY
+TOC_FAMILY _FAMILY
+TOC_HEADER_FAMILY _FAMILY
+TOC_HEADER_FONT _FONT
+TOC_HEADER_QUAD _QUAD
+TOC_HEADER_SIZE _SIZE
+TOC_HEAD_FAMILY _FAMILY
+TOC_HEAD_FONT _FONT
+TOC_HEAD_SIZE _SIZE
+TOC_PARAHEAD_FAMILY _FAMILY
+TOC_PARAHEAD_FONT _FONT
+TOC_PARAHEAD_SIZE _SIZE
+TOC_PN_FAMILY _FAMILY
+TOC_PN_FONT _FONT
+TOC_PN_SIZE _SIZE
+TOC_PT_SIZE _SIZE
+TOC_SUBHEAD_FAMILY _FAMILY
+TOC_SUBHEAD_FONT _FONT
+TOC_SUBHEAD_SIZE _SIZE
+TOC_TITLE_FAMILY _FAMILY
+TOC_TITLE_FONT _FONT
+TOC_TITLE_SIZE _SIZE
</pre>
<hr>
diff --git a/contrib/groff/contrib/mom/momdoc/toc.html b/contrib/groff/contrib/mom/momdoc/toc.html
index cd853e8e88a0..515740449cfc 100644
--- a/contrib/groff/contrib/mom/momdoc/toc.html
+++ b/contrib/groff/contrib/mom/momdoc/toc.html
@@ -1,14 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
-<title>Mom -- Table of Contents</title>
+<title>Mom, version 1.3-a -- Table of Contents</title>
</head>
<body bgcolor="#dfdfdf">
<!====================================================================>
-<h1><u>Table of Contents</u></h1>
+<h1 align="center"><u>Table of Contents for mom, version 1.3-a</u></h1>
+
+The table of contents has grown quite large. If you've been using
+<strong>mom</strong> for a while, you might prefer the
+<a href="macrolist.html#TOP"><strong>Quick Reference Guide</strong></a>.
+<p>
+If you're new to <strong>mom</strong>, click on any link in the
+<a href="#QUICK_TOC"><strong>Quick Table of Contents</strong></a>
+to go to the
+appropriate section of the <strong>Full Table of Contents</strong>.
+<p>
+Or click
+<a href="#TOC_PROP">here</a>
+to go directly to the <strong>Full Table of Contents</strong>.
+<p>
+<hr>
+
+<a name="QUICK_TOC"><h2>Quick Table of Contents</h2></a>
+<a href="#INTRO"><strong>INTRODUCTORY STUFF</strong></a>
+<ul>
+ <li><a href="#WHAT">What is mom?</a>
+ <li><a href="#DEFS">Definitions of terms used in this manual</a>
+ <li><a href="#USING">Using mom</a>
+</ul>
+<a href="#TYPESET"><strong>TYPESETTING WITH MOM</strong></a>
<ul>
+ <li><a href="#TYPE_INTRO">Intro to typesetting macros</a>
+ <li><a href="#PAGE">Page setup</a>
+ <li><a href="#PARAM">Basic typesetting parameters</a>
+ <li><a href="#JUST">Justifying, quadding, etc.</a>
+ <li><a href="#REFINE">Refinements</a>
+ <li><a href="#MOD">Modifying type</a>
+ <li><a href="#VERT">Vertical movements</a>
+ <li><a href="#TAB">Tabs</a>
+ <li><a href="#COL">Multiple columns</a>
+ <li><a href="#IND">Indents</a>
+ <li><a href="#GOODIES">Goodies</a>
+ <li><a href="#ESCAPES">Inline escapes</a>
+ <li><a href="#COLOR">Coloured text</a>
+</ul>
+<p>
+<a href="#DOCPROC"><strong>DOCUMENT PROCESSING WITH MOM</strong></a>
+<ul>
+ <li><a href="#DOCPROC_INTRO">Introduction to document processing</a>
+ <li><a href="#PRELIM">Preliminary document setup</a>
+ <li><a href="#TAGS">The document element tags</a> -- heads, subheads, footnotes, etc.
+ <li><a href="#HDRFTR">Headers and footers</a>
+ <li><a href="#PAGINATE">Pagination</a>
+ <li><a href="#RV">Recto/verso printing and collating</a>
+ <li><a href="#COVER">Cover pages</a>
+ <li><a href="#REF">Bibliographies and references</a>
+ <li><a href="#LETTER">Writing letters</a>
+ <li><a href="#TYPEMACDOC">Using typesetting macros during document processing</a>
+ <li><a href="#QUICK">Quick reference guide to mom</a>
+ <li><a href="#APP">Appendices</a>
+</ul>
+<br>
+<hr>
+<a name="TOC_PROP"></a>
+<h2>Full Table of Contents</h2>
+<a name="INTRO"></a>
+<a name="WHAT"></a>
<li><a href="intro.html#INTRO"><strong>1. WHAT IS MOM?</strong></a>
<ul>
<li><a href="intro.html#INTRO_INTRO">1.1 Who is mom meant for?</a>
@@ -21,12 +82,14 @@
<li><a href="intro.html#TOGGLE_MACRO">1.5.2 &quot;Toggle&quot; macros</a>
</ul>
</ul>
+<a name="DEFS"></a>
<li><a href="definitions.html#TERMS"><strong>2. DEFINITIONS OF TERMS USED IN THIS MANUAL</strong></a>
<ul>
<li><a href="definitions.html#TERMS_TYPESETTING">2.1 Typesetting terms</a>
<li><a href="definitions.html#TERMS_GROFF">2.2 Groff terms</a>
<li><a href="definitions.html#TERMS_MOM">2.3 Mom's document processing terms</a>
</ul>
+<a name="USING"></a>
<li><a href="using.html#USING"><strong>3. USING MOM</strong></a>
<ul>
<li><a href="using.html#USING_INTRO">3.1 Introduction</a>
@@ -34,34 +97,43 @@
<li><a href="using.html#USING_INVOKING">3.3 Printing -- invoking groff with mom</a>
<li><a href="using.html#USING_PREVIEWING">3.4 How to preview documents</a>
</ul>
+<a name="TYPESET"></a>
<li><a href="typesetting.html#MACROS_TYPESETTING"><strong>4. THE TYPESETTING MACROS</strong></a>
<ul>
+<a name="TYPE_INTRO"></a>
<li><a href="typesetting.html#INTRO_MACROS_TYPESETTING">4.1 Introduction to the typesetting macros</a>
<br>
+<a name="PAGE"></a>
<li><a href="typesetting.html#PAGE_MARGINS"><strong>4.2 Page Setup</strong></a> -- paper size and page margins
<ul>
<li><a href="typesetting.html#INDEX_SETUP">4.2.1 Macro list</a>
</ul>
- <li><a href="typesetting.html#BASIC_PARAMS"><strong>4.3 Basic Parameters</strong></a> -- family, font, point size, line space, line length, autolead
+<a name="PARAM"></a>
+ <li><a href="typesetting.html#BASIC_PARAMS"><strong>4.3 Basic Parameters</strong></a> -- family, font, fallback font, point size, line space, line length, autolead
<ul>
<li><a href="typesetting.html#INDEX_BASIC">4.3.1 Macro list</a>
</ul>
+<a name="JUST"></a>
<li><a href="typesetting.html#JUST_QUAD_FILL"><strong>4.4 Justifying, Quadding, Filling and Breaking Lines</strong></a>
<ul>
<li><a href="typesetting.html#INDEX_JUST">4.4.1 Macro list</a>
</ul>
+<a name="REFINE"></a>
<li><a href="typesetting.html#REFINEMENTS"><strong>4.5 Refinements</strong></a> -- word space, sentence space, letter spacing (track kerning), hyphenation, kerning, ligatures
<ul>
<li><a href="typesetting.html#INDEX_REFINEMENTS">4.5.1 Macro list</a>
</ul>
+<a name="MOD"></a>
<li><a href="typesetting.html#MODIFICATIONS"><strong>4.6 Modifying Type</strong></a> -- pseudo-italic, -bold, -condensed, and -extended
<ul>
<li><a href="typesetting.html#INDEX_MODIFICATIONS">4.6.1 Macro list</a>
</ul>
+<a name="VERT"></a>
<li><a href="typesetting.html#ALDRLD"><strong>4.7 Vertical Movements</strong></a> -- moving up and down on the page
<ul>
<li><a href="typesetting.html#INDEX_ALDRLD">4.7.1 Macro list</a>
</ul>
+<a name="TAB"></a>
<li><a href="typesetting.html#TABS"><strong>4.8 Tabs</strong></a>
<ul>
<li><a href="typesetting.html#TYPESETTING_TABS">4.8.1 Typesetting tabs</a>
@@ -74,22 +146,26 @@
</ul>
<li><a href="typesetting.html#INDEX_TABS">4.8.3 Macro list</a>
</ul>
+<a name="COL"></a>
<li><a href="typesetting.html#MULTI_COLUMNS"><strong>4.9 Multi-columns</strong></a>
<ul>
<li><a href="typesetting.html#INDEX_MULTI_COLUMNS">4.9.1 Macro list</a>
</ul>
+<a name="IND"></a>
<li><a href="typesetting.html#INDENTS"><strong>4.10 Indents</strong></a>
<ul>
<li><a href="typesetting.html#INDENTS_TUT">4.10.1 A brief explanation of how mom handles indents</a>
<li><a href="typesetting.html#INDEX_INDENTS">4.10.2 Macro list</a>
</ul>
+<a name="GOODIES"></a>
<li><a href="goodies.html#GOODIES"><strong>4.11 Goodies</strong></a> -- aliases,
transparent lines, smartquotes, caps,
underscoring/underlining, padding lines, leaders, drop
- caps, superscripts
+ caps, superscripts, (nested) lists, user-definable strings
<ul>
<li><a href="goodies.html#INDEX_GOODIES">4.11.1 Macro list</a>
</ul>
+<a name="ESCAPES"></a>
<li><a href="inlines.html#INLINE_ESCAPES"><strong>4.12 Inline Escapes</strong></a>
<ul>
<li><a href="inlines.html#INTRO_INLINE_ESCAPES">4.12.1 Introduction to inline escapes</a>
@@ -97,14 +173,24 @@
<li><a href="inlines.html#INLINES_GROFF">4.12.3 Groff inlines</a>
<li><a href="inlines.html#INLINE_CHARACTERS_GROFF">4.12.3.1 Inlines for special characters and symbols</a>
</ul>
+<a name="COLOR"></a>
+ <li><a href="color.html#TOP"><strong>4.13 Coloured text</strong></a>
+ <ul>
+ <li><a href="color.html#INTRO_COLOR">4.13.1 Introduction to coloured text</a>
+ <li><a href="color.html#MACROS_COLOR">4.13.2 Macro list</a>
+ </ul>
</ul>
+<a name="DOCPROC"></a>
+<a name="DOCPROC_INTRO"></a>
<li><a href="docprocessing.html#DOCPROCESSING"><strong>5. DOCUMENT PROCESSING WITH MOM</strong></a>
<ul>
<li><a href="docprocessing.html#INTRO_MACROS_DOCPROCESSING">5.1 Introduction to document processing</a>
<li><a href="docprocessing.html#DEFAULTS">5.2 Some document defaults</a>
<ul>
- <li><a href="docprocessing.html#LEADING_NOTE">IMPORTANT NOTE on leading/spacing and bottom margins</a>
+ <li><a href="docprocessing.html#LEADING_NOTE">IMPORTANT NOTE on leading/spacing and bottom margins</a>
+ <li><a href="docprocessing.html#SHIM">The SHIM macro</a> -- to get document leading back on track
</ul>
+<a name="PRELIM"></a>
<li><a href="docprocessing.html#SETUP"><strong>5.3 PRELIMINARY DOCUMENT SETUP</strong></a>
<ul>
<li><a href="docprocessing.html#DOCPROCESSING_TUT">5.3.1 Tutorial</a> -- setting up a mom document
@@ -112,12 +198,17 @@
<li><a href="docprocessing.html#REFERENCE_MACROS"><strong>5.3.2 The Reference Macros</strong></a>
<ul>
<li><a href="docprocessing.html#TITLE">5.3.2.1 TITLE</a>
- <li><a href="docprocessing.html#SUBTITLE">5.3.2.2 SUBTITLE</a>
- <li><a href="docprocessing.html#AUTHOR">5.3.2.3 AUTHOR</a>
- <li><a href="docprocessing.html#CHAPTER">5.3.2.4 CHAPTER</a>
- <li><a href="docprocessing.html#CHAPTER_TITLE">5.3.2.5 CHAPTER_TITLE</a>
- <li><a href="docprocessing.html#DRAFT">5.3.2.6 DRAFT</a>
- <li><a href="docprocessing.html#REVISION">5.3.2.7 REVISION</a>
+ <li><a href="docprocessing.html#DOC_TITLE">5.3.2.2 DOCTITLE</a>
+ <li><a href="docprocessing.html#SUBTITLE">5.3.2.3 SUBTITLE</a>
+ <li><a href="docprocessing.html#AUTHOR">5.3.2.4 AUTHOR</a>
+ <li><a href="docprocessing.html#CHAPTER">5.3.2.5 CHAPTER</a>
+ <li><a href="docprocessing.html#CHAPTER_TITLE">5.3.2.6 CHAPTER_TITLE</a>
+ <li><a href="docprocessing.html#DRAFT">5.3.2.7 DRAFT</a>
+ <li><a href="docprocessing.html#REVISION">5.3.2.8 REVISION</a>
+ <li><a href="docprocessing.html#COPYRIGHT">5.3.2.9 COPYRIGHT</a>
+ <li><a href="docprocessing.html#MISC">5.3.2.10 MISC</a>
+ <li><a href="docprocessing.html#COVERTITLE">5.3.2.11 COVER_TITLE</a>
+ <li><a href="docprocessing.html#COVERTITLE">5.3.2.12 DOC_COVER_TITLE</a>
</ul>
<li><a href="docprocessing.html#DOCSTYLE_MACROS"><strong>5.3.3 The Docstyle Macros</strong></a>
<ul>
@@ -127,9 +218,15 @@
</ul>
<li><a href="docprocessing.html#STYLE_BEFORE_START"><strong>5.3.4 Changing Type and Style Parameters <em>before</em> START</strong></a>
<ul>
- <li><a href="docprocessing.html#TYPE_BEFORE_START">5.3.4.1 Typesetting macros</a> -- usage
- <li><a href="docprocessing.html#DOC_LEAD_ADJUST">5.3.4.2 DOC_LEAD_ADJUST</a> -- adjust document leading to fill pages
- <li><a href="docprocessing.html#DOCHEADER">5.3.4.3 DOCHEADER</a> -- managing the docheader
+ <li><a href="docprocessing.html#TYPE_BEFORE_START">5.3.4.1 Typesetting macros before START</a> -- usage
+ <ul>
+ <li><a href="docprocessing.html#COLOR">Colour</a>
+ </ul>
+ <li><a href="docprocessing.html#DOC_LEAD_ADJUST">5.3.4.2 DOC_LEAD_ADJUST</a> -- adjusting the document
+ <a href="definitions.html#TERMS_LEADING">leading</a> (line spacing) to fill pages
+ <li><a href="docprocessing.html#DOCHEADER">5.3.4.3 DOCHEADER</a> -- managing the
+ <a href="definitions.html#TERMS_DOCHEADER">document header</a>
+
<li><a href="docprocessing.html#COLUMNS_INTRO">5.3.4.4 COLUMNS</a> -- setting documents in columns
</ul>
<li><a href="docprocessing.html#START_MACRO"><strong>5.3.5 ***START***</strong></a> -- the macro to initiate document processing
@@ -138,7 +235,10 @@
<ul>
<li><a href="docprocessing.html#INDEX_DOC_PARAM">5.3.6.1 Macro list</a>
</ul>
+<a name="TYPEMACDOC"></a>
+ <li><a href="typemacdoc.html#TYPESETTING"><strong>5.3.7 Using typesetting macros during document processing</strong></A>
</ul>
+<a name="TAGS"></a>
<li><a href="docelement.html#DOCELEMENT"><strong>5.4 THE DOCUMENT ELEMENT TAGS</strong></a>
<ul>
<li><a href="docelement.html#DOCELEMENT_INTRO">5.4.1 Introduction to the document element tags</a>
@@ -151,13 +251,19 @@
<li><a href="docelement.html#HEAD_INTRO">5.4.4 Main heads</a>
<li><a href="docelement.html#SUBHEAD_INTRO">5.4.5 Subheads</a>
<li><a href="docelement.html#PARAHEAD_INTRO">5.4.6 Paragraph heads</a>
- <li><a href="docelement.html#LINEBREAK_INTRO">5.4.7 Linebreaks</a> -- author linebreaks
- <li><a href="docelement.html#QUOTE_INTRO">5.4.8 Quotes</a> -- line for line poetic quotes
+ <li><a href="docelement.html#LINEBREAK_INTRO">5.4.7 Linebreaks</a> -- author linebreaks (section breaks)
+ <li><a href="docelement.html#QUOTE_INTRO">5.4.8 Quotes</a> -- line for line poetic quotes or unformatted, verbatim text (e.g. code snippets)
<li><a href="docelement.html#BLOCKQUOTE_INTRO">5.4.9 Blockquotes</a> -- cited material
- <li><a href="docelement.html#FOOTNOTE_INTRO">5.4.10 Footnotes</a>
- <li><a href="docelement.html#ENDNOTE_INTRO">5.4.11 Endnotes</a>
- <li><a href="docelement.html#FINIS_INTRO">5.4.12 Document termination</a> -- FINIS
+ <li><a href="docelement.html#LIST_INTRO">5.4.10 Lists</a> -- (nested) lists
+ <li><a href="docelement.html#NUMBER_LINES_INTRO">5.4.11 Line numbering</a>
+ <li><a href="docelement.html#FOOTNOTE_INTRO">5.4.12 Footnotes</a>
+ <li><a href="docelement.html#ENDNOTE_INTRO">5.4.13 Endnotes</a>
+ <li><a href="docelement.html#MARGIN_NOTES_INTRO">5.4.14 Margin notes</a>
+ <li><a href="docelement.html#BLANK_PAGE_TITLE">5.4.15 Blank pages</a>
+ <li><a href="docelement.html#TOC_INTRO">5.4.16 Table of contents</a>
+ <li><a href="docelement.html#FINIS_INTRO">5.4.17 Document termination</a> -- FINIS
</ul>
+<a name="HDRFTR"></a>
<li><a href="headfootpage.html#HEADFOOTPAGE"><strong>5.5 DOCUMENT HEADERS AND FOOTERS</strong></a>
<ul>
<li><a href="headfootpage.html#HEADFOOTPAGE_INTRO">5.5.1 Introduction</a>
@@ -170,11 +276,13 @@
</ul>
<li><a href="headfootpage.html#HEADFOOT_CONTROL">5.5.6 Control macros for headers/footers</a>
</ul>
+<a name="PAGINATE"></a>
<li><a href="headfootpage.html#PAGINATION"><strong>5.6 PAGINATION</strong></a>
<ul>
<li><a href="headfootpage.html#PAGINATION">Introduction</a>
<li><a href="headfootpage.html#INDEX_PAGINATION">Pagination macros list</a>
</ul>
+<a name="RV"></a>
<li><a href="rectoverso.html#RECTOVERSO"><strong>5.7 RECTO/VERSO PRINTING AND COLLATING</strong></a>
<ul>
<li><a href="rectoverso.html#RECTOVERSO_INTRO">5.7.1 Introduction to recto/verso</a>
@@ -186,23 +294,35 @@
<li><a href="rectoverso.html#COLLATE">5.7.2.1 The COLLATE macro</a>
</ul>
</ul>
- <li><a href="cover.html#RECTOVERSO"><strong>5.8 CREATING A COVER PAGE</strong></a>
+<a name="COVER"></a>
+ <li><a href="cover.html#COVER_TOP"><strong>5.8 CREATING COVER PAGES</strong></a>
<br>
- <li><a href="letters.html#LETTERS"><strong>5.9 WRITING LETTERS</strong></a>
+<a name="REF"></a>
+ <li><a href="refer.html#REF_TOP"><strong>5.9 BIBLIOGRAPHIES AND REFERENCES</strong></a>
+ <br>
+<a name="LETTER"></a>
+ <li><a href="letters.html#LETTERS"><strong>5.10 WRITING LETTERS</strong></a>
<ul>
- <li><a href="letters.html#LETTERS_INTRO">5.9.1 Introduction to writing letters</a>
- <li><a href="letters.html#TUTORIAL">5.9.2 Tutorial on writing letters</a>
- <li><a href="letters.html#LETTERS_DEFAULTS">5.9.3 Default style for letters</a>
- <li><a href="letters.html#LETTERS_MACROS">5.9.4 The letter macros</a>
+ <li><a href="letters.html#LETTERS_INTRO">5.10.1 Introduction to writing letters</a>
+ <li><a href="letters.html#TUTORIAL">5.10.2 Tutorial on writing letters</a>
+ <li><a href="letters.html#LETTERS_DEFAULTS">5.10.3 Default style for letters</a>
+ <li><a href="letters.html#LETTERS_MACROS">5.10.4 The letter macros</a>
</ul>
- <li><a href="typemacdoc.html#TYPESETTING"><strong>5.10 USING TYPESETTING MACROS DURING DOCUMENT PROCESSING</strong></a>
</ul>
- <li><a href="appendices.html#APPENDICES"><strong>6. APPENDICES</strong></a>
+<a name="QUICK"></a>
+<li><a href="macrolist.html#QUICK"><strong>6. QUICK REFERENCE GUIDE TO MOM</strong></a>
+<p>
+<a name="APP"></a>
+<li><a href="appendices.html#APPENDICES"><strong>7. APPENDICES</strong></a>
<ul>
- <li><a href="appendices.html#MOREDOC">6.1 Further notes on this documentation</a>
- <li><a href="appendices.html#CODENOTES">6.2 Some reflections on mom</a>
- <li><a href="reserved.html#RESERVED">6.3 List of reserved words</a>
- <li><a href="appendices.html#CONTACT">6.4 Contact the author</a>
+ <li><a href="appendices.html#MOREDOC">7.1 Further notes on this documentation</a>
+ <li><a href="appendices.html#FONTS">7.2 Adding PostScript fonts to groff</a>
+ <ul>
+ <li><a href="appendices.html#HOWTO">7.2.1 How to create a PostScript font for use with groff</a>
+ </ul>
+ <li><a href="appendices.html#CODENOTES">7.2 Some reflections on mom</a>
+ <li><a href="reserved.html#RESERVED">7.3 List of reserved words</a>
+ <li><a href="appendices.html#CONTACT">7.4 Contact the author</a>
</ul>
</ul>
</body>
diff --git a/contrib/groff/contrib/mom/momdoc/typemacdoc.html b/contrib/groff/contrib/mom/momdoc/typemacdoc.html
index ef23d08442f4..bedd031905bc 100644
--- a/contrib/groff/contrib/mom/momdoc/typemacdoc.html
+++ b/contrib/groff/contrib/mom/momdoc/typemacdoc.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -7,9 +8,10 @@
<!====================================================================>
-<a href="appendices.html#TOP">Next</a>&nbsp;&nbsp;
-<a href="letters.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="docelement.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="docprocessing.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
+<p>
<a name="TOP"></a>
<a name="TYPESETTING">
@@ -29,24 +31,27 @@ alone. (To indent footnotes, see the full explanation of the
<a href="docelement.html#FOOTNOTE">FOOTNOTE</a>
macro.)
<p>
-There are, however, some typesetting macros that, used during document
+<strong>Mom</strong>'s tabs
+(both
+<a href="typesetting.html#TYPESETTING_TABS">typesetting tabs</a>
+and
+<a href="typesetting.html#STRING_TABS">string tabs</a>)
+behave as expected in running text during document processing. Tab
+structures that do not exceed the line length of running text are
+preserved sensibly from page to page, and, if
+<a href="docprocessing.html#COLUMNS">COLUMNS</a>
+are enabled, from column to column.
+<p>
+Some typesetting macros, however, when used during document
processing, behave in special ways. These are the macros that deal
-with the basic parameters of type style: horizontal and vertical margins,
-line length,
+with the basic parameters of type style: horizontal and vertical
+margins, line length,
<a href="definitions.html#TERMS_FAMILY">family</a>,
<a href="definitions.html#TERMS_FONT">font</a>,
-point size,
+<a href="definitions.html#TERMS_PS">point size</a>,
<a href="definitions.html#TERMS_LEADING">leading</a>,
and
<a href="definitions.html#TERMS_QUAD">quad</a>.
-<p>
-<strong>NOTE:</strong> See the section on
-<a href="#TB_MARGINS">Top and bottom margins in document processing</a>
-for information on how <strong>mom</strong> interprets
-<a href="typesetting.html#T_MARGIN">T_MARGIN</a>
-and
-<a href="typesetting.html#B_MARGIN">B_MARGIN</a>
-in document processing.
<p>
<strong>Mom</strong> assumes that any changes to these parameters
@@ -58,7 +63,17 @@ middle of a document.
<p>
The following lists those typesetting macros whose behaviour during
document processing requires some explanation.
-<p>
+(Please refer to
+<a href="#TB_MARGINS">Top and bottom margins in document processing</a>
+for information on how <strong>mom</strong> interprets
+<a href="typesetting.html#T_MARGIN">T_MARGIN</a>
+and
+<a href="typesetting.html#B_MARGIN">B_MARGIN</a>
+in document processing. Additionally, see
+<a href="#ADD_SPACE">ADD_SPACE</a>
+if you encounter the problem of trying to get <strong>mom</strong>
+to put space at the tops of pages after the first.)
+
<pre>
MACRO EFFECT DURING DOCUMENT PROCESSING
----- ---------------------------------
@@ -115,9 +130,14 @@ LS *Changes line space for the duration of the
current tag only. As soon as another document
element tag is entered, the line space reverts to
the current document default for the new
- tag. Highly NOT recommended, since changes to
- a document's leading interfere with mom's
- ability to balance bottom margins.
+ tag.
+
+ Using LS to temporarily change leading within a
+ document will almost certainly result in a bottom
+ margin that doesn't align with the bottom margin
+ of subsequent pages. You'll need to use the SHIM
+ macro to get mom back on track when you're ready
+ to return to the document's default leading.
QUAD *Changes quad for the duration of the
current tag only. As soon as another document
@@ -159,10 +179,56 @@ running text, but have no effect on the placement of
<a href="definitions.html#TERMS_FOOTER">footers</a>,
or page numbers.
+<a name="ADD_SPACE">
+ <h2><u>ADD_SPACE</u></h2>
+</a>
+
+<p>
+Occasionally, you may want to insert space before the start of
+<a href="definitions.html#TERMS_RUNNING">running text</a>
+on pages after the first.
+<p>
+You might have tried using
+<a href="typesetting.html#ALD">ALD</a>
+or
+<a href="typesetting.html#SPACE">SPACE</a>
+and found it did nothing. This is because <strong>mom</strong>
+normally inhibits any extra space before the start of running text
+on pages after the first.
+<p>
+If you need the space, you must use the macro,
+<strong>ADD_SPACE</strong>, in conjuction with
+<a href="typesetting.html#NEWPAGE">NEWPAGE</a>.
+<strong>ADD_SPACE</strong> takes as its single argument the
+distance you want <strong>mom</strong> to advance from the normal
+baseline position at the top of the page. A
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
+is required.
+
+<p>
+For example, say you wanted to insert 2 inches of space before the
+start of running text on a page other than the first. You'd
+accomplish it with
+
+<p>
+<pre>
+ .NEWPAGE
+ .ADD_SPACE 2i
+</pre>
+
+which would terminate your current page, break to a new page,
+print the header (assuming headers are on) and insert 2 inches of
+space before the start of running text.
+<p>
+Since adding space in this way is almost sure to disrupt
+<strong>mom</strong>'s ability to guarantee perfectly flush bottom
+margins, I highly recommend using the
+<a href="docprocessing.html#SHIM">SHIM</a>
+macro immediately after <strong>ADD_SPACE</strong>.
<p>
<hr>
-<a href="appendices.html#TOP">Next</a>&nbsp;&nbsp;
-<a href="letters.html#TOP">Prev</a>&nbsp;&nbsp;
+<a href="docelement.html#TOP">Next</a>&nbsp;&nbsp;
+<a href="docprocessing.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="#TOP">Top</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
</body>
diff --git a/contrib/groff/contrib/mom/momdoc/typesetting.html b/contrib/groff/contrib/mom/momdoc/typesetting.html
index 8ac345ee2b23..a161c5b4c341 100644
--- a/contrib/groff/contrib/mom/momdoc/typesetting.html
+++ b/contrib/groff/contrib/mom/momdoc/typesetting.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -10,7 +11,7 @@
<a href="goodies.html#TOP">Next</a>&nbsp;&nbsp;
<a href="definitions.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
-
+<p>
<a name="TOP"></a>
<a name="MACROS_TYPESETTING">
<h1 align="center"><u>THE TYPESETTING MACROS</u></h1>
@@ -29,7 +30,7 @@
<li><a href="#INTRO_BASIC_PARAMS">Introduction to Basic Parameters</a>
<li><a href="#INDEX_BASIC">List of macros</a>
</ul>
- <li><strong>JUSTIFYING, QUADDING, FILLING, BREAKING LINES</strong>
+ <li><strong>JUSTIFYING, QUADDING, FILLING, BREAKING and JOINING LINES</strong>
<ul>
<li><a href="#INTRO_JUST_QUAD_FILL">Introduction to justify, quad, fill, break</a>
<li><a href="#INDEX_JUST">List of macros</a>
@@ -83,6 +84,7 @@
<li><a href="inlines.html#INDEX_INLINES">List of inline escapes</a>
</ul>
</ul>
+<p>
<hr>
<h2><a name="INTRO_MACROS_TYPESETTING"><u>Introduction to the typesetting macros</u></a></h2>
@@ -108,12 +110,12 @@ the same thing.
<strong>Mom</strong>'s typesetting macros can be used as a standalone
package, independent of the
<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>.
-With them, you can typeset on-the-fly. Document covers, your best
-friend's résumé, a poster for a lost dog -- none of these requires
+With them, you can typeset on-the-fly. Book covers, your best
+friend's résumé, a poster for a lost dog--none of these requires
structured document processing (page headers, paragraphs, heads,
footnotes, etc). What they do demand is precise control over every
element on the page. The typesetting macros give you that control.
-<br>
+<p>
<hr>
<!====================================================================>
@@ -138,7 +140,7 @@ for a number of well-known, established paper sizes. The
<a href="#PAGE">PAGE</a>
macro provides a convenient way of setting the page dimensions and
some or all of the page margins with a single macro.
-<br>
+<p>
<a name="INDEX_SETUP">
<h3><u>Page setup macros list</u></h3>
@@ -155,13 +157,14 @@ some or all of the page margins with a single macro.
<li><a href="#PAGE">PAGE</a> (page dimensions and margins all in one fell swoop)
<li><a href="#NEWPAGE">NEWPAGE</a> (start a new page)
</ul>
+<p>
<!---PAGEWIDTH--->
<hr width="66%" align="left">
<a name="PAGEWIDTH"><h3><u>Page width</u></h3></a>
<br>
-Macro: <strong>PAGEWIDTH</strong> <var>&lt;width of printer sheet&gt;</var>
+<nobr>Macro: <strong>PAGEWIDTH</strong> &lt;width of printer sheet&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -180,7 +183,7 @@ the width of your printer sheet is 8-1/2 inches, you enter
<hr width="66%" align="left">
<a name="PAGELENGTH"><h3><u>Page length</u></h3></a>
<br>
-Macro: <strong>PAGELENGTH</strong> <var>&lt;length of printer sheet&gt;</var>
+<nobr>Macro: <strong>PAGELENGTH</strong> &lt;length of printer sheet&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -200,12 +203,12 @@ enter
<hr width="66%" align="left">
<a name="PAPER"><h3><u>Paper</u></h3></a>
<br>
-Macro: <strong>PAPER</strong> <var>&lt;paper type&gt;</var>
+<nobr>Macro: <strong>PAPER</strong> &lt;paper type&gt;</nobr>
<p>
<strong>PAPER</strong> provides a convenient way to set the page
-dimensions for some common printer sheet sizes. <var>&lt;paper
-type&gt;</var> can be one of:
+dimensions for some common printer sheet sizes. <nobr>&lt;paper
+type&gt; can be one of:</nobr>
<p>
<pre>
LETTER
@@ -243,7 +246,7 @@ than to remember the correct dimensions and enter
<hr width="66%" align="left">
<a name="L_MARGIN"><h3><u>Left margin</u></h3></a>
<br>
-Macro: <strong>L_MARGIN</strong> <var>&lt;left margin&gt;</var>
+<nobr>Macro: <strong>L_MARGIN</strong> &lt;left margin&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -282,14 +285,14 @@ using the
See
<a href="typemacdoc.html#TYPESETTING">Typesetting Macros in Document Processing</a>
for an explanation.
-<br>
+<p>
<!---R_MARGIN--->
<hr width="66%" align="left">
<a name="R_MARGIN"><h3><u>Right margin</u></h3></a>
<br>
-Macro: <strong>R_MARGIN</strong> <var>&lt;right margin&gt;</var>
+<nobr>Macro: <strong>R_MARGIN</strong> &lt;right margin&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -356,14 +359,14 @@ when you're using the
See
<a href="typemacdoc.html#TYPESETTING">Typesetting Macros in Document Processing</a>
for an explanation.
-<br>
+<p>
<!---T_MARGIN--->
<hr width="66%" align="left">
<a name="T_MARGIN"><h3><u>Top margin</u></h3></a>
<br>
-Macro: <strong>T_MARGIN</strong> <var>&lt;top margin&gt;</var>
+<nobr>Macro: <strong>T_MARGIN</strong> &lt;top margin&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -371,7 +374,7 @@ Macro: <strong>T_MARGIN</strong> <var>&lt;top margin&gt;</var>
<strong>T_MARGIN</strong> establishes the distance from the top of
the printer sheet at which you want your type to start. It requires
a unit of measure, and decimal fractions are allowed. To set a top
-margin of 2-1/2 centimeters, you'd enter
+margin of 2-1/2 centimetres, you'd enter
<p>
<pre>
.T_MARGIN 2.5c
@@ -408,14 +411,14 @@ slightly different when you're using the
See
<a href="typemacdoc.html#TB_MARGINS">Top and bottom margins in document processing</a>
for an explanation.
-<br>
+<p>
<!---B_MARGIN--->
<hr width="66%" align="left">
<a name="B_MARGIN"><h3><u>Bottom margin</u></h3></a>
<br>
-Macro: <strong>B_MARGIN</strong> <var>&lt;bottom margin&gt;</var>
+<nobr>Macro: <strong>B_MARGIN</strong> &lt;bottom margin&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -449,7 +452,7 @@ slightly different when you're using the document processing macros.
See
<a href="typemacdoc.html#TB_MARGINS">Top and bottom margins in document processing</a>
for an explanation.
-<br>
+<p>
<!---PAGE--->
@@ -457,7 +460,7 @@ for an explanation.
<a name="PAGE"><h3><u>Page</u></h3></a>
<br>
Macro: <strong>PAGE</strong>
-<var>&lt;width&gt;&nbsp;[ &lt;length&gt; [ &lt;lm&gt; [ &lt;rm&gt; [ &lt;tm&gt; [ &lt;bm&gt; ] ] ] ] ]</var>
+<nobr>&lt;width&gt;&nbsp;[ &lt;length&gt; [ &lt;lm&gt; [ &lt;rm&gt; [ &lt;tm&gt; [ &lt;bm&gt; ] ] ] ] ]</nobr>
<br>
<em>*All arguments require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -465,8 +468,8 @@ Macro: <strong>PAGE</strong>
<strong>PAGE</strong> lets you establish paper dimensions and page
margins with a single macro. The only required argument is page width.
The rest are optional, <strong>but they must appear in order and you can't
-skip over any.</strong> <var>&lt;lm&gt;, &lt;rm&gt;, &lt;tm&gt;</var>
-and <var>&lt;bm&gt;</var> refer to the left, right, top and bottom
+skip over any.</strong> <nobr>&lt;lm&gt;, &lt;rm&gt;, &lt;tm&gt;</nobr>
+and <nobr>&lt;bm&gt; refer to the left, right, top and bottom</nobr>
margins respectively.
<p>
Assuming your page dimensions are 11 inches by 17 inches, and that's
@@ -484,7 +487,7 @@ If you want to set the left margin as well, say, at 1 inch,
</pre>
Now suppose you also want to set the top margin, say, at 1-1/2
-inches. <var>&lt;tm&gt;</var> comes after <var>&lt;rm&gt;</var>
+inches. <nobr>&lt;tm&gt; comes after <nobr>&lt;rm&gt;</nobr></nobr>
in the optional arguments, but you can't skip over any arguments,
therefore to set the top margin, you must also give a right margin.
The <strong>PAGE</strong> macro would look like this:
@@ -528,7 +531,7 @@ of the first line of text down by one linespace. To compensate, do
immediately before entering any text, or, if it's feasible, make
<strong>PAGE</strong> the last macro you invoke prior to entering text.
-<br>
+<p>
<!---NEWPAGE--->
@@ -544,10 +547,16 @@ processing the current page and move you to the top of a new one
(subject to the top margin set with
<a href="#T_MARGIN">T_MARGIN</a>.
<p>
-<strong>Experts:</strong> <strong>NEWPAGE</strong> is an alias of
-<strong>.bp</strong>. You can use either, or mix 'n' match with
-impunity.
-<br>
+<strong>Experts:</strong> Prior to version 1.1.9,
+<strong>NEWPAGE</strong> was simply an alias of
+<strong>.bp</strong>. As of 1.1.9, <strong>NEWPAGE</strong>,
+is its own <strong>mom</strong> macro. While the new macro
+should be backwardly compatible with documents created using
+pre-1.1.9 <strong>mom</strong>s, I suggest that from this version
+onward, if you were in the habit of using <strong>.bp</strong>
+whenever you wanted to break to a new page, you now begin to use
+<strong>NEWPAGE</strong> instead.
+<p>
<hr>
<!====================================================================>
@@ -566,12 +575,13 @@ to the basic parameter macros remain in effect until you change them.
The document processing macros handle things differently. See
<a href="typemacdoc.html#TYPESETTING">Typesetting Macros in Document Processing</a>
for an explanation.
-<br>
+<p>
<a name="INDEX_BASIC"><h3><u>Basic parameter macros list</u></h3></a>
<ul>
<li><a href="#FAMILY">FAMILY</a> (type family)
<li><a href="#FONT">FONT</a> (font)
+ <li><a href="#FALLBACK_FONT">FALLBACK_FONT</a> (for invalid fonts)
<li><a href="#PS">PT_SIZE</a> (point size of type)
<li><a href="#LEADING">LS</a> (line spacing/leading)
<li><a href="#AUTOLEAD">AUTOLEAD</a> (automatic line spacing)
@@ -583,12 +593,13 @@ for an explanation.
<hr width="66%" align="left">
<a name="FAMILY"><h3><u>Type family</u></h3></a>
<br>
-Macro: <strong>FAMILY</strong> <var>&lt;family&gt;</var>
+<nobr>Macro: <strong>FAMILY</strong> &lt;family&gt;</nobr>
<br>
Alias: <strong>FAM</strong>
<p>
-<strong>FAMILY</strong> takes one argument: the name of the type family
+<strong>FAMILY</strong> takes one argument: the name of the
+<a href="definitions.html#TERMS_FAMILY">family</a>
you want. Groff comes with a number of PostScript families, each
identified by a 1-, 2- or 3-letter mnemonic. The standard families
are:
@@ -596,29 +607,80 @@ are:
<tr><td width="15"><td><strong>A</strong><td>Avant Garde
<tr><td><td><strong>BM</strong> <td>Bookman
<tr><td><td><strong>H</strong><td>Helvetica
+<tr><td><td><strong>HN</strong><td>Helvetica Narrow
<tr><td><td><strong>N</strong><td>New Century Schoolbook
<tr><td><td><strong>P</strong><td>Palatino
<tr><td><td><strong>T</strong><td>Times Roman</td></tr>
+<tr><td><td><strong>ZCM</strong><td>Zapf Chancery</td></tr>
</table>
<p>
The argument you pass to <strong>FAMILY</strong> is the identifier at
-left above. For example, if you want Helvetica, enter
+left, above. For example, if you want Helvetica, enter
<p>
<pre>
.FAMILY H
</pre>
-<strong>NOTE:</strong> The <a href="#FONT">font macro</a>
-(<strong>FT</strong>) lets you to specify both the type family
+<strong>NOTE:</strong> The
+<a href="#FONT">font macro</a>
+(<strong>FT</strong>) lets you specify both the type family
and the desired font with a single macro. While this saves a few
keystrokes, I recommend using <strong>FAMILY</strong> for family,
and <strong>FT</strong> for font, except where doing so is genuinely
-inconvenient.
+inconvenient. <strong>ZCM</strong>, for example, only exists in one
+style: Italic (<strong>I</strong>). Therefore, <kbd>.FT ZCMI</kbd>
+makes more sense than setting the family to &quot;ZCM&quot;, then
+setting the font to &quot;I&quot;.
+<p>
+<a name="FAM_ADD_NOTE"></a>
+<strong>ADDITIONAL NOTE:</strong> As of <strong>mom, version
+1.1.9-a</strong>, if you are running a version of groff lower
+than 1.19.2, you <em>MUST</em> follow all <strong>FAMILY</strong>
+requests with a <strong>FT</strong> request, otherwise
+<strong>mom</strong> will set all type up to the next
+<strong>FT</strong> request in the
+<a href="#FALLBACK_FONT">fallback font</a>.
+<p>
+If you are running a version of groff greater than or equal
+to 1.19.2, when you invoke the <strong>FAMILY</strong> macro,
+<strong>mom</strong> &quot;remembers&quot; the font style (Roman,
+Italic, etc) currently in use (if the font style exists in the new
+family) and will continue to use the same font style in the new
+family. For example:
+<p>
+<pre>
+ .FAMILY BM \" Bookman family
+ .FT I \" Medium Italic
+ &lt;some text&gt; \" Bookman Medium Italic
+ .FAMILY H \" Helvetica family
+ &lt;more text&gt; \" Helvetica Medium Italic
+</pre>
+
+However, if the font style does not exist in the new family,
+<strong>mom</strong> will set all subsequent type in the
+<a href="#FALLBACK_FONT">fallback font</a>
+(by default, Courier Medium Roman) until she encounters a
+<a href="#FONT">.FT</a>
+request that's valid for the family. For example, assuming
+you don't have the font &quot;Medium Condensed Roman&quot;
+(<strong>mom</strong> extension &quot;<strong>CD</strong>&quot;)
+in the Helvetica family:
+<p>
+<pre>
+ .FAMILY UN \" Univers family
+ .FT CD \" Medium Condensed
+ &lt;some text&gt; \" Univers Medium Condensed
+ .FAMILY H \" Helvetica family
+ &lt;more text&gt; \" Courier Medium Roman!
+</pre>
+
+In the above example, you must follow <kbd>.FAMILY H</kbd> with a
+<strong>FT</strong> request that's valid for Helvetica.
<p>
<strong>Experts:</strong>
<br>
If you add other PostScript families to groff's /font/devps directory,
-be sure to follow the groff standard for naming families and fonts.
+I recommend following the groff standard for naming families and fonts.
For example, if you add the Garamond family, name the font files
<p>
<pre>
@@ -632,54 +694,180 @@ GARAMOND then becomes a legal family name you can pass to
<strong>FAMILY</strong>. (You could, of course, shorten GARAMOND to just
G, or GD.) R, I, B, and BI after GARAMOND are the roman, italic,
bold and bold-italic fonts respectively.
-<br>
+<p>
+Please see the Appendices,
+<a href="appendices.html#FONTS">Adding PostScript fonts to groff</a>,
+for information on adding fonts and families to groff, as well as
+to see a list of the extensions <strong>mom</strong> provides to
+groff's basic <strong>R, I, B, BI</strong> styles.
+<p>
<!---FT--->
<hr width="66%" align="left">
<a name="FONT"><h3><u>Font</u></h3></a>
<br>
-Macro: <strong>FT</strong> <var>R | I | B | BI</var>
+<nobr>Macro: <strong>FT</strong> R | I | B | BI | &lt;any other valid font style&gt;</nobr>
<p>
-<strong>FT</strong> takes one of four possible arguments specifying the
-desired font:
+By default, groff permits <strong>FT</strong> to take one of four
+possible arguments specifying the desired font:
<table valign="baseline" summary="font">
-<tr><td width="15"><td><strong>R</strong><td> = <td>roman
-<tr><td><td><strong>I</strong><td> = <td>italic
-<tr><td><td><strong>B</strong><td> = <td>bold
-<tr><td><td><strong>BI</strong><td> = <td>bold-italic</td></tr>
+<tr><td width="15"><td><strong>R</strong><td> = <td>(Medium) Roman
+<tr><td><td><strong>I</strong><td> = <td>(Medium) Italic
+<tr><td><td><strong>B</strong><td> = <td>Bold (Roman)
+<tr><td><td><strong>BI</strong><td> = <td>Bold Italic</td></tr>
</table>
<p>
-For example, if your family is Helvetica, entering
+For example, if your
+<a href="definitions.html#TERMS_FAMILY">family</a>
+is Helvetica, entering
<p>
<pre>
.FT B
</pre>
-will give you the Helvetica bold font. If your family were
-Palatino, you'd get the Palatino bold font.
+will give you the Helvetica bold
+<a href="definitions.html#TERMS_FONT">font</a>.
+If your family were Palatino, you'd get the Palatino bold font.
<p>
-You can specify both family and font in the <strong>FT</strong> macro.
-As an example,
+(As of <strong>mom, version 1.1.9-a,</strong> the range of arguments
+that can be passed to <strong>FT</strong> has been considerably
+extended, allowing access to a greater variety of font
+<a href="definitions.html#TERMS_WEIGHT">weights</a>
+and
+<a href="definitions.html#TERMS_SHAPE">shapes</a>.
+Please see the
+<a href="#FONT_NOTE">NOTE</a>,
+below.)
+<p>
+How <strong>mom</strong> reacts to an invalid argument to
+<strong>FT</strong> depends on which version of groff you're using.
+If your groff version is greater than or equal to 1.19.2,
+<strong>mom</strong> will issue a warning and, depending on how
+you've set up the
+<a href="#FALLBACK_FONT">fallback font</a>,
+either continue processing using the fallback font, or abort
+(allowing you to correct the problem). If your groff version is less
+than 1.19.2, <strong>mom</strong> will silently continue processing,
+using either the fallback font or the font that was in effect prior
+to the invalid <strong>FT</strong> call.
+<p>
+<strong>FT</strong> will also accept, as an argument, a full
+family+font name. For example,
<p>
<pre>
.FT HB
</pre>
-sets the font to Helvetica bold. I strongly recommend keeping
-family and font separate.
+will set subsequent type in Helvetica Bold. However, I strongly
+recommend keeping family and font separate except where doing so is
+genuinely inconvenient.
<p>
-Fonts can also be changed inline. See
+For inline control of fonts, see
<a href="inlines.html#INLINE_FONTS_MOM">Inline Escapes, font control</a>.
+<p>
+<a name="FONT_NOTE"></a>
+<strong>NOTE: mom, versions 1.1.9-a</strong> and higher,
+considerably extends the range of arguments you can pass to
+<strong>FT</strong>, making it more convenient to add and access
+fonts of differing
+<a href="definitions.html#TERMS_WEIGHT">weights</a>
+and
+<a href="definitions.html#TERMS_SHAPE">shapes</a>
+within the same family. Have a look
+<a href="appendices.html#STYLE_EXTENSIONS">here</a>
+for a list of the weight/style arguments <strong>mom</strong>
+allows.
+<p>
+Be aware, though, that you must have the fonts, correctly
+installed and named, in order to use the arguments. (See
+<a href="appendices.html#HOWTO">How to create a PostScript font for use with groff</a>
+for how to add fonts to groff.) Please also read the
+<a href="#FAM_ADD_NOTE">ADDITIONAL NOTE</a>
+found in the description of the <strong>FAMILY</strong> macro.
+<p>
+
+<!---FALLBACK_FONT--->
+
+<hr width="66%" align="left">
+<a name="FALLBACK_FONT"><h3><u>Fallback font</u></h3></a>
<br>
+<nobr>Macro: <strong>FALLBACK_FONT</strong> &lt;fallback font&gt; [ ABORT | WARN ] | ABORT | WARN</nobr>
+
+<p>
+In the event that you pass an invalid argument to
+<a href="#FONT">.FAMILY</a>
+(i.e. a non-existent family), <strong>mom</strong>, by default, uses
+the fallback font, Courier Medium Roman (CR), in order to continue
+processing your file.
+<p>
+If you'd prefer another fallback font, pass
+<strong>FALLBACK_FONT</strong> the <strong>full family+font name
+of the font you'd like</strong>. For example, if you'd rather the
+fallback font were Times Roman Medium Roman,
+
+<pre>
+ .FALLBACK_FONT TR
+</pre>
+<p>
+would do the trick.
+<p>
+Additionally, if your version of groff accepts accepts &quot;if
+F&quot; and &quot;if S&quot; (see
+<a href="#FAM_ADD_NOTE">above</a>),
+<strong>mom</strong> issues a warning whenever a
+<strong>font style</strong> set with
+<a href="#FONT">.FT</a>
+does not exist, either because you haven't registered the style
+(see
+<a href="appendices.html#REGISTER_STYLE">here</a>
+for instructions on registering styles), or because the font style
+does not exist in the current family set with
+<a href="#FAMILY">.FAMILY</a>.
+By default, <strong>mom</strong> then aborts, which allows you to
+correct the problem.
+<p>
+If you'd prefer that <strong>mom</strong> not abort on non-existent
+fonts, but rather continue processing using a fallback font,
+you can pass <strong>FALLBACK_FONT</strong> the argument
+<strong>WARN</strong>, either by itself, or in conjunction with your
+chosen fallback font.
+<p>
+<strong>Some examples of invoking FALLBACK_FONT:</strong>
+<br>
+<ul>
+ <li><kbd>.FALLBACK_FONT WARN</kbd>
+ <br>
+ <strong>mom</strong> will issue a warning whenever you try
+ to access a non-existent font but will continue processing
+ your file with the default fallback font, Courier Medium Roman.
+ <li><kbd>.FALLBACK_FONT TR WARN</kbd>
+ <br>
+ <strong>mom</strong> will issue a warning whenever you try
+ to access a non-existent font but will continue processing
+ your file with a fallback font of Times Roman Medium Roman;
+ additionally, &quot;TR&quot; will be the fallback font whenever
+ you try to access a <strong>family</strong> that does not exist.
+ <li><kbd>.FALLBACK_FONT TR ABORT</kbd>
+ <br>
+ <strong>mom</strong> will abort whenever you try to access a
+ non-existent font, and will use the fallback font
+ &quot;TR&quot; whenever you try to access a <strong>family</strong>
+ that does not exist.
+</ul>
+<p>
+If, for some reason, you want to revert to ABORT, just enter
+<kbd>.FALLBACK_FONT ABORT</kbd> and <strong>mom</strong> will once
+again abort on font errors.
+<p>
<!---PT_SIZE--->
<hr width="66%" align="left">
<a name="PS"><h3><u>Point size of type</u></h3></a>
<br>
-Macro: <strong>PT_SIZE</strong> <var>&lt;size of type in points&gt;</var>
+<nobr>Macro: <strong>PT_SIZE</strong> &lt;size of type in points&gt;</nobr>
<br>
<em>*Does not require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -714,14 +902,27 @@ then later reset it to 12 with
The size of type can also be changed inline. See
<a href="inlines.html#INLINE_SIZE_MOM">Inline Escapes, changing point size</a>.
-<br>
+<p>
+<strong>NOTE:</strong> It is unfortunate that the <kbd>pic</kbd>
+pre-processor uses <strong>PS</strong>, and thus
+<strong>mom</strong>'s macro for setting point sizes can't use it.
+However, if you aren't using <kbd>pic</kbd>, you might want to
+alias <strong>PT_SIZE</strong> as <strong>PS</strong>, since
+there'd be no conflict.
+<p>
+<pre>
+ .ALIAS PS PT_SIZE
+</pre>
+
+would allow you to set point sizes with <kbd>.PS</kbd>.
+<p>
<!---LS--->
<hr width="66%" align="left">
<a name="LEADING"><h3><u>Line spacing/leading</u></h3></a>
<br>
-Macro: <strong>LS</strong> <var>&lt;distance between lines&gt;</var>
+<nobr>Macro: <strong>LS</strong> &lt;distance between lines&gt;</nobr>
<br>
<em>*Does not require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -767,14 +968,14 @@ then later reset it to 14 points with
<strong>ls</strong>. <strong>LS</strong> acts like <strong>vs</strong>.
<strong>mom</strong> does not provide a macro analogous to
<strong>ls</strong>.
-<br>
+<p>
<!---AUTOLEAD--->
<hr width="66%" align="left">
<a name="AUTOLEAD"><h3><u>Automatic line spacing</u></h3></a>
<br>
-Macro: <strong>AUTOLEAD</strong> <var>&lt;amount of automatic leading&gt; [FACTOR]</var>
+<nobr>Macro: <strong>AUTOLEAD</strong> &lt;amount of automatic leading&gt; [FACTOR]</nobr>
<br>
<em>*Does not require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -822,14 +1023,14 @@ to 14, the leading automatically changes to 15.75 (14 x 1.125).
<strong>NOTE:</strong> There's no need to prepend a plus sign (+)
to <strong>AUTOLEAD</strong>'s argument, although you may do so if you
wish.
-<br>
+<p>
<!---LL--->
<hr width="66%" align="left">
<a name="LINELENGTH"><h3><u>Line length</u></h3></a>
<br>
-Macro: <strong>LL</strong> <var>&lt;line length&gt;</var>
+<nobr>Macro: <strong>LL</strong> &lt;line length&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -856,10 +1057,36 @@ As with other macros that require a unit of measure, the argument to
sets the line length to 4-1/2 inches.
<p>
+Additionally, you may express a new line length relative to the
+current line length by prepending a plus or minus sign to the
+argument. Thus, if you wanted to increase the line length by 3
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>, you could
+do
+<p>
+<pre>
+ .LL +3p
+</pre>
+
+This is especially handy when you want to &quot;hang&quot;
+punctuation outside the right margin since you can pass groff's
+<a href="inlines.html#INLINE_STRINGWIDTH_GROFF"><strong>\w</strong></a>
+escape as the argument to <strong>LL</strong>, like this:
+<p>
+<pre>
+ .LL +\w'.'u
+</pre>
+
+The above example increases the current line length by the width of
+a period. Notice that you must append the
+<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>,
+<strong>u</strong>, to the escape since .LL requires a unit of
+measure.
+
+<p>
<strong>NOTE:</strong> The <a href="#R_MARGIN">right margin
macro</a> (<strong>R_MARGIN</strong>) can also be used to set line
length.
-<br>
+<p>
<hr>
<!====================================================================>
@@ -873,34 +1100,39 @@ length.
The justification and quadding macros deal with how type aligns along
the left and right margins. In a nutshell, type either aligns at the
left margin, at the right margin, at both margins, or at neither margin
-(centered).
+(centred).
<p>
These macros also determine whether or not
-<a href="definitions.html#TERMS_INPUTLINE">input lines</a> are joined and
-<a href="definitions.html#TERMS_FILLED">filled</a> during output.
+<a href="definitions.html#TERMS_INPUTLINE">input lines</a>
+are joined and
+<a href="definitions.html#TERMS_FILLED">filled</a>
+during output.
<p>
Additionally, macros that deal with how to break
-<a href="definitions.html#TERMS_OUTPUTLINE">output lines</a> are covered in this
-section, as is the
-<a href="definitions.html#TERMS_INLINES">inline escape</a> for joining output lines.
+<a href="definitions.html#TERMS_OUTPUTLINE">output lines</a>
+are covered in this section, as is the
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
+for joining input lines.
<p>
You may encounter some words here that are unfamiliar. Refer to
-<a href="definitions.html#TERMS_TYPESETTING">Typesetting terms</a> and
-<a href="definitions.html#TERMS_GROFF">Groff terms</a> for an explanation.
+<a href="definitions.html#TERMS_TYPESETTING">Typesetting terms</a>
+and
+<a href="definitions.html#TERMS_GROFF">Groff terms</a>
+for an explanation.
<a name="INDEX_JUST"><h3><u>Justification, quad, fill, and break macro list</u></h3></a>
-
+<p>
<ul>
<li><strong>Fill modes</strong>
<ul>
<li><a href="#JUSTIFY">JUSTIFY</a> (set lines justified)
- <li><a href="#QUAD">QUAD</a> (set filled lines flush left, right or centered)
+ <li><a href="#QUAD">QUAD</a> (set filled lines flush left, right or centred)
</ul>
<li><strong>Nofill modes</strong>
<ul>
<li><a href="#LRC">LEFT</a> (set non-filled lines flush left)
<li><a href="#LRC">RIGHT</a> (set non-filled lines flush right)
- <li><a href="#LRC">CENTER</a> (set non-filled lines centered)
+ <li><a href="#LRC">CENTER</a> (set non-filled lines centred)
</ul>
<li><strong>Breaking lines</strong>
<ul>
@@ -909,7 +1141,8 @@ You may encounter some words here that are unfamiliar. Refer to
<li><a href="#SPACE">SPACE</a> (break a line and add space before the next output line)
<li><a href="#SPREAD">SPREAD</a> (break and force-justify an output line)
</ul>
- <li><strong>Joining lines</strong>
+ <li><strong>Joining input lines in
+ <a href="definitions.html#TERMS_NOFILL">nofill mode</a></strong>
<ul>
<li><a href="#JOIN">\c</a> inline escape
</ul>
@@ -935,14 +1168,14 @@ upon output.
To break lines and prevent them from being filled and justified,
use the
<a href="#BR">BR</a> macro.
-<br>
+<p>
<!---QUAD--->
<hr width="66%" align="left">
-<a name="QUAD"><h3><u>Quad lines left, right, or center</u></h3></a>
+<a name="QUAD"><h3><u>Quad lines left, right, or centre</u></h3></a>
<br>
-Macro: <strong>QUAD</strong> <var>L | LEFT | R | RIGHT | C | CENTER | J | JUSTIFY</var>
+<nobr>Macro: <strong>QUAD</strong> L | LEFT | R | RIGHT | C | CENTER | J | JUSTIFY</nobr>
<br>
Alias: <strong>FILL</strong>
<br>
@@ -963,7 +1196,7 @@ along the left margin.
If <strong>R</strong> or <strong>RIGHT</strong>, type is
set flush along the right margin.
<p>
-If <strong>C</strong> or <strong>CENTER</strong> type is set centered
+If <strong>C</strong> or <strong>CENTER</strong> type is set centred
on the current line length.
<p>
<strong>J</strong> and <strong>JUSTIFY</strong> justify text,
@@ -974,12 +1207,12 @@ href="#JUSTIFY">JUSTIFY</a>.
<p>
To break lines and prevent them from being filled, use the
<a href="#BR">BR</a> macro.
-<br>
+<p>
<!---LEFT, RIGHT, CENTER--->
<hr width="66%" align="left">
-<a name="LRC"><h3><u>Set non-filled lines flush left, right, or centered</u></h3></a>
+<a name="LRC"><h3><u>Set non-filled lines flush left, right, or centred</u></h3></a>
<br>
Macro: <strong>LEFT</strong>
&nbsp;&nbsp;Macro: <strong>RIGHT</strong>
@@ -1029,7 +1262,7 @@ modes, groff does not always respect the current line length.
that run long may exceed it, or get broken in undesirable ways.
Therefore, when using these three macros, you should preview your
work to ensure that all lines fit as expected.
-<br>
+<p>
<!---BR--->
@@ -1069,7 +1302,7 @@ ALL macros cause a break. If a break is not desired, use the
<p>
<strong>Experts: BR</strong> is an alias for <strong>br</strong>.
You can use either, or mix 'n' match with impunity.
-<br>
+<p>
<!---EL--->
@@ -1077,7 +1310,25 @@ You can use either, or mix 'n' match with impunity.
<a name="EL"><h3><u>Manually break a line without advancing on the page</u></h3></a>
<br>
Macro: <strong>EL</strong>
-
+<br>
+<em>*In nofill modes (LEFT, RIGHT, CENTER), you must terminate the
+line input preceding EL with the </em><kbd>\c</kbd><em> inline
+escape. See
+<a href="#EL_NOTES">NOTES</a>,
+below.
+<br>
+*If you find remembering whether to put in the <kbd>\c</kbd>
+bothersome, you may prefer to use the
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
+alternative to
+<kbd>.EL</kbd>,
+<a href="inlines.html#B">\*[B]</a>,
+which works consistently regardless of the fill mode.
+<br>
+*EL does not work after the PAD macro.
+See
+<a href="goodies.html#PAD">PAD</a>
+for the way around this</em>.
<p>
The mnemonic "EL" is borrowed from old Compugraphic typesetting
systems, where it stood for "End Line." Conceptually,
@@ -1088,11 +1339,14 @@ with no linefeed.
<em>Note to groff jocks:</em> <strong>EL</strong> is
unrelated to groff's <strong>.el</strong>. If you find the
similarity confusing, you may want to alias <strong>EL</strong> as
-<strong>EOL</strong>.
+something else (but don't use <strong>EOL</strong>; it's already
+taken.)
<p>
<strong>EL</strong>'s function is simple: it breaks a line without
-advancing on the page. As an example of where you might use it,
+advancing on the page.
+<a name="EL_EXAMPLE">As</a>
+an example of where you might use it,
imagine that you're working from marked-up copy. The markup
indicates 24 points of space between two given lines, but the
prevailing line spacing is 12.5 points. You may find it more
@@ -1102,16 +1356,18 @@ instead of calculating the lead that needs to be added to 12.5 to
get 24. To demonstrate:
<p>
<pre>
+ .LEFT
.LS 12.5
- A line of text.
+ A line of text.\c
.EL
.ALD 24p
The next line of text.
</pre>
-may be more instuitive than
+may be more intuitive than
<p>
<pre>
+ .LEFT
.LS 12.5
A line of text.
.ALD 11.5p
@@ -1127,46 +1383,49 @@ you don't have to recalculate the extra space.
from Compugraphic), which is covered in the section
<a href="#ALDRLD">Vertical movement</a>.
<p>
-<strong>IMPORTANT:</strong>
-<strong>EL</strong> does not work as advertised on the last
+<a name="EL_NOTES"><strong>NOTES:</strong></a>
+<p>
+In versions of mom prior to 1.1.9, <strong>EL</strong> did not
+always work as advertised on the last
<a name="TERMS_OUTPUTLINE">output line</a>
-of pages that contain a footer trap (e.g. one set with
+of pages that contained a footer trap (e.g. one set with
<a href="#B_MARGIN">B_MARGIN</a>
or in documents formatted using the
<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>).
-The reason is that the <strong>EL</strong> macro itself deposits
-a line break that trips the trap (hey, I like that --
-&quot;trips the trap&quot;), and once the trap has been sprung,
-<strong>mom</strong> can't recover. She places the line after
-the <strong>EL</strong> on the next page.
<p>
-If you need <strong>EL</strong> functionality on the last line of
-a page with a footer trap, turn the trap off with
-<a href="goodies.html#TRAP">TRAP</a>,
-as in this example:
+<strong>EL</strong> has been re-written so that this should no longer be the
+case. However, in order for it to work in the
+<a href="definitions.html#TERMS_NOFILL">nofill</a>
+modes
+(<a href="#LRC">LEFT</a>,
+<a href="#LRC">RIGHT</a>
+or
+<a href="#LRC">CENTER</a>),
+you must always &quot;join&quot; <strong>.EL</strong> to the line
+before it using the
+<a href="#JOIN">\c</a>
+<a href="definitions.html#TERMS_INLINES">inline escape</a>,
+like this:
<p>
<pre>
- 3.
- .TRAP OFF
+ .LEFT
+ A line I don't want to advance\c
.EL
- .TRAP
- \*[FP12]Establish, once and for all, if 42 really is the answer.
-</pre>
-
-The above looks something like this upon output:
-<p>
-<pre>
- 3. Establish, once and for all, if 42 really is the answer.
</pre>
-with &quot;3.&quot; flush at the left margin, and &quot;Establish,
-once and for all...&quot; on the same line as &quot;3.&quot; but
-starting 12 points in from the left margin.
+Conversely, in
+<a href="definitions.html#TERMS_FILLED">fill modes</a>
+(<a href="#QUAD">QUAD LEFT</a>,
+<a href="#QUAD">QUAD RIGHT</a>,
+<a href="#QUAD">QUAD CENTER</a>
+or
+<a href="#JUSTIFY">JUSTIFY</a>),
+the <strong>\c</strong> must not be used.
<p>
-If you hadn't turned the trap off for <kbd>.EL</kbd>,
-&quot;3.&quot; would have appeared at the bottom of the page by
-itself, with &quot;Establish, once and for all...&quot;
-appearing at the top of the next page.
+If <strong>EL</strong> is used after most macros or groff
+<a href="definitions.html#TERMS_PRIMITIVES">primitives</a>
+(see the exception, below), you don't have to worry about this,
+regardless of the fill mode. Just type <kbd>.EL</kbd>
<br>
<!---SP--->
@@ -1174,15 +1433,17 @@ appearing at the top of the next page.
<hr width="66%" align="left">
<a name="SPACE"><h3><u>Break lines and add space between</u></h3></a>
<br>
-Macro: <strong>SPACE</strong> <var>&lt;space to add between lines&gt;</var>
+<nobr>Macro: <strong>SPACE</strong> &lt;space to add between lines&gt;</nobr>
<br>
Alias: <strong>SP</strong>
<p>
<strong>SPACE</strong> breaks a line, just like
<strong>BR</strong>, then adds space after the line. With no
-argument, it adds an extra line space. If you pass it a numeric
-argument without supplying a
+argument, it adds an extra line space of a value equal to the
+current
+<a href="definitions.html#TERMS_LEADING">leading</a>.
+If you pass it a numeric argument without supplying a
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>,
it advances that number of extra line spaces. For example:
<p>
@@ -1200,15 +1461,18 @@ breaks the line and adds two extra linespaces.
<p>
If you supply a unit of measure, <strong>SPACE</strong> breaks the
-line then adds the specified amount of extra space to the current
-linespace, as in
+line then advances one linespace (at the current
+<a href="definitions.html#TERMS_LEADING">leading</a>)
+PLUS the specified amount of extra space given to
+<strong>SPACE</strong>,
+as in
<p>
<pre>
.SPACE 6p
</pre>
-which breaks the line then adds six points of space to the current
-linespace.
+which breaks the line and advances one full linespace plus six
+points.
<p>
<strong>SUGGESTION: SPACE</strong> and
@@ -1225,7 +1489,7 @@ after a line.
<p>
<strong>Experts: SPACE</strong> is an alias of <strong>sp</strong>.
You can use either, or mix 'n' match with impunity.
-<br>
+<p>
<!---SPREAD--->
@@ -1248,7 +1512,7 @@ and have it came out fully justified.
<p>
<strong>Experts: SPREAD</strong> is an alias for <strong>brp</strong>.
You can use either, or mix 'n' match with impunity.
-<br>
+<p>
<!---JOIN--->
@@ -1300,7 +1564,18 @@ words of the output line would read
Please also note that had the example been in one of the
<a href="definitions.html#TERMS_FILLED">fill modes</a>,
there'd have been no need for the <strong>\c</strong>.
-<br>
+<p>
+<strong>Addendum:</strong> The example, above, is designed to
+demonstrate the use of <strong>\c</strong>. However, an easier and
+more intuitive way to accomplish the family/font change in the
+example would be with the groff
+<a href="definitions.html#TERMS_INLINES">inline escape</a>,
+<a href="inlines.html#INLINE_FONTS_GROFF">\f</a>.
+<p>
+<pre>
+ Some lines of text to be \f[HB]joined\*[PREV] together.
+</pre>
+<p>
<hr>
<!====================================================================>
@@ -1318,7 +1593,6 @@ ensuring that your documents look typographically professional.
<a name="INDEX_REFINEMENTS">
<h3><u>Typographic refinements macro list</u></h3>
</a>
-
<ul>
<li><strong>Word and sentence spacing</strong>
<ul>
@@ -1348,7 +1622,7 @@ ensuring that your documents look typographically professional.
<hr width="66%" align="left">
<a name="WS"><h3><u>Word spacing</u></h3></a>
<br>
-Macro: <strong>WS</strong> <var>&lt;+|-wordspace&gt; | DEFAULT</var>
+<nobr>Macro: <strong>WS</strong> &lt;+|-wordspace&gt; | DEFAULT</nobr>
<p>
<strong>WS</strong> (Word Space) increases or decreases the amount
@@ -1412,14 +1686,14 @@ its groff default by entering
This can be particularly useful if you've been playing around
with plus and minus values, and can't remember by how much you
have to in/decrease the word space to get it back to normal.
-<br>
+<p>
<!---SS--->
<hr width="66%" align="left">
<a name="SS"><h3><u>Sentence space</u></h3></a>
<br>
-Macro: <strong>SS</strong> <var>&lt;+sentence space&gt; | 0 | DEFAULT</var>
+<nobr>Macro: <strong>SS</strong> &lt;+sentence space&gt; | 0 | DEFAULT</nobr>
<p>
<strong>SS</strong> (Sentence Space) tells groff how to treat double
@@ -1486,22 +1760,22 @@ school of typists that puts two spaces between sentences. If you
ignore this advice and use <strong>SS</strong> when you habitually
put only one space between sentences, you risk producing output where
the space between sentences is not equal.
-<br>
+<p>
<!---HY--->
<hr width="66%" align="left">
<a name="HY"><h3><u>Automatic hyphenation control</u></h3></a>
<br>
-Macro: <strong>HY</strong> <var>toggle</var>
+<nobr>Macro: <strong>HY</strong> toggle</nobr>
<br>
-Macro: <strong>HY</strong> <var>LINES &lt;max. number of consecutive hyphenated lines&gt;</var>
+<nobr>Macro: <strong>HY</strong> LINES &lt;max. number of consecutive hyphenated lines&gt;</nobr>
<br>
-Macro: <strong>HY</strong> <var>MARGIN &lt;size of hyphenation margin&gt;</var>
+<nobr>Macro: <strong>HY</strong> MARGIN &lt;size of hyphenation margin&gt;</nobr>
<br>
-Macro: <strong>HY</strong> <var>SPACE &lt;extra interword spacing to prevent hyphenation&gt;</var>
+<nobr>Macro: <strong>HY</strong> SPACE &lt;extra interword spacing to prevent hyphenation&gt;</nobr>
<br>
-Macro: <strong>HY</strong> <var>DEFAULT</var>
+<nobr>Macro: <strong>HY</strong> DEFAULT</nobr>
<br>
Aliases: <strong>HYPHENATE, HYPHENATION</strong>
@@ -1514,8 +1788,6 @@ you can pass to <strong>HY</strong>, I've broken them down into
separate sections.
<h3><u>1. HY</u></h3>
-
-<p>
<strong>HY</strong> by itself (i.e. with no argument) simply turns
automatic hyphenation on. Any argument other than <strong>LINES,
MARGIN, SPACE</strong> or <strong>DEFAULT</strong>, turns automatic
@@ -1534,15 +1806,13 @@ you could turn <strong>HY</strong> off by entering
<strong>HY</strong> observes the following default hyphenation rules:
<br>
<ol>
- <li>Last lines (i.e. ones that will spring a trap -- typically
+ <li>Last lines (i.e. ones that will spring a trap--typically
the last line on a page) will not be hyphenated.
<li>The first and last two characters of a word are never
split off.
</ol>
<h3><u>2. HY LINES</u></h3>
-
-<p>
<strong>HY LINES</strong> sets the maximum number of consecutive
hyphenated lines that will appear in output copy. 2 is a very
good choice, and you'd set it with
@@ -1561,8 +1831,6 @@ count when groff is figuring out how many lines to hyphenate;
explicit hyphens do not.
<h3><u>3. HY MARGIN</u></h3>
-
-<p>
<strong>HY MARGIN</strong> sets the amount of room allowed at
the end of a line before hyphenation is tripped (e.g. if there's
only 6 points left at the end of a line, groff won't try to hyphenate
@@ -1585,8 +1853,6 @@ MARGIN</strong> requires a
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>.
<h3><u>4. HY SPACE</u></h3>
-
-<p>
<strong>HY SPACE</strong> sets an amount of extra interword
space that groff will <em>try</em> to put between words on a
line in order to PREVENT hyphenation. <strong>HY SPACE</strong>
@@ -1606,19 +1872,15 @@ value might be half a point, or one point, which you'd set with
SPACE</strong> requires a
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>.
-<h3><u>4. HY DEFAULT</u></h3>
-
-<p>
+<h3><u>5. HY DEFAULT</u></h3>
<strong>HY DEFAULT</strong> resets automatic hyphenation to its
default behaviour, cancelling any changes made with <strong>LINES,
MARGIN,</strong> and/or <strong>SPACE</strong>.
<h3><u>A note on hyphenation in general</u></h3>
-
-<p>
Hyphenation is a necessary evil. If it can be avoided, it should be.
If it can't be, it should occur infrequently. That's the reason for
-number of parameters you can set with <strong>HY</strong>.
+the number of parameters you can set with <strong>HY</strong>.
<p>
Furthermore, hyphenation in
@@ -1629,14 +1891,14 @@ on consecutive lines to achieve a pleasing, natural-looking rag.
Since such adjustments are often too fussy for document
processing, I recommend playing around with <strong>HY MARGIN</strong>
a bit if your copy looks hyphen-heavy.
-<br>
+<p>
<!---HY_SET--->
<hr width="66%" align="left">
<a name="HY_SET"><h3><u>Set hyphenation parameters all at once</u></h3></a>
<br>
-Macro: <strong>HY_SET</strong> <var>&lt;lines&gt; [ &lt;margin&gt; [ &lt;space&gt; ] ]</var>
+<nobr>Macro: <strong>HY_SET</strong> &lt;lines&gt; [ &lt;margin&gt; [ &lt;space&gt; ] ]</nobr>
<br>
Alias: <strong>HYSET</strong>
@@ -1678,14 +1940,14 @@ copy,
</pre>
is how you'd do it.
-<br>
+<p>
<!---RW--->
<hr width="66%" align="left">
<a name="RW"><h3><u>Reduce whitespace</u></h3></a>
<br>
-Macro: <strong>RW</strong> <var>&lt;amount of whitespace reduction between letters&gt;</var>
+<nobr>Macro: <strong>RW</strong> &lt;amount of whitespace reduction between letters&gt;</nobr>
<br>
<p>
@@ -1716,30 +1978,40 @@ highly recommend previewing your work to assess the effect of
<p>
<p>
-<strong>IMPORTANT:</strong> <strong>RW</strong> affects all
+<strong>IMPORTANT:</strong> In versions prior to 1.1.9-a,
+<strong>RW</strong> affected all
<a href="definitions.html#TERMS_FONT">fonts</a>
in the
<a href="definitions.html#TERMS_FAMILY">family</a>
-current at the time it's invoked. It must be reset to zero to
-cancel its effect (<code>.RW 0</code>) on those fonts, or reinvoked
-(possibly with a different value) if you change family.
+current at the time it was invoked. As of 1.1.9-a, this behaviour
+has been changed. <strong>RW</strong> affects only the font
+current at the time it's invoked, and remains in effect for that
+font every time the font is called, hence must be reset to zero to
+cancel its effect (<code>.RW 0</code>) on that font.
<p>
<strong>NOTE:</strong> By default, <strong>RW</strong> does not deposit a
<a href="#BR">break</a>
-(<strong>BR</strong>) when it's invoked. If you want
+(<strong>BR</strong>) when it's invoked if you're in one of the
+<a href="definitions.html#TERMS_FILL">fill</a>
+modes (i.e.
+<a href="#QUAD">QUAD</a>
+<strong>L, R, C, J</strong> or
+<a href="#JUSTIFY">JUSTIFY</a>).
+If you want
<strong>RW</strong> to break at the ends of the previous
-<a href="definitions.html#TERMS_INPUTLINE">input lines</a>,
-you can tell <strong>mom</strong> that's what you want by invoking the
+<a href="definitions.html#TERMS_INPUTLINE">input lines</a>
+while you're in a fill mode, tell <strong>mom</strong>
+that's what you want by invoking the
<a href="#BR_AT_LINE_KERN">BR_AT_LINE_KERN</a>
toggle macro.
-<br>
+<p>
<!---EW--->
<hr width="66%" align="left">
<a name="EW"><h3><u>Expand whitespace</u></h3></a>
<br>
-Macro: <strong>EW</strong> <var>&lt;amount of whitespace expansion between letters&gt;</var>
+<nobr>Macro: <strong>EW</strong> &lt;amount of whitespace expansion between letters&gt;</nobr>
<br>
<p>
@@ -1762,42 +2034,71 @@ small decimal values when loosening lines. For example,
may be just enough to open up a line without the change in letter
spacing being obvious. I highly recommend previewing your work to
assess the effect of <strong>EW</strong>.
-
+<p>
+<strong>IMPORTANT:</strong> In versions prior to 1.1.9-a,
+<strong>EW</strong> affected all
+<a href="definitions.html#TERMS_FONT">fonts</a>
+in the
+<a href="definitions.html#TERMS_FAMILY">family</a>
+current at the time it was invoked. As of 1.1.9-a, this behaviour
+has been changed. <strong>EW</strong> affects only the font
+current at the time it's invoked, and remains in effect for that
+font every time the font is called, hence must be reset to zero to
+cancel its effect (<code>.EW 0</code>) on that font.
<p>
<strong>NOTE:</strong> By default, <strong>EW</strong> does not deposit a
<a href="#BR">break</a>
-(<strong>BR</strong>) when it's invoked. If you want
+(<strong>BR</strong>) when it's invoked if you're in one of the
+<a href="definitions.html#TERMS_FILL">fill</a>
+modes (i.e.
+<a href="#QUAD">QUAD</a>
+<strong>L, R, C, J</strong> or
+<a href="#JUSTIFY">JUSTIFY</a>).
+If you want
<strong>EW</strong> to break at the ends of the previous
-<a href="definitions.html#TERMS_INPUTLINE">input lines</a>,
-you can tell <strong>mom</strong> that's what you want by invoking the
+<a href="definitions.html#TERMS_INPUTLINE">input lines</a>
+while you're in a fill mode, tell <strong>mom</strong>
+that's what you want by invoking the
<a href="#BR_AT_LINE_KERN">BR_AT_LINE_KERN</a>
toggle macro.
-<br>
+<p>
<!---BR_AT_LINE_KERN--->
<hr width="66%" align="left">
<a name="BR_AT_LINE_KERN"><h3><u>Break before line kerning</u></h3></a>
<br>
-Macro: <strong>BR_AT_LINE_KERN</strong> <var>toggle</var>
+<nobr>Macro: <strong>BR_AT_LINE_KERN</strong> toggle</nobr>
<br>
<p>
-By default, <strong>mom</strong> does not break
+By default, in
+<a href="definitions.html#TERMS_FILLED">fill</a>
+modes (i.e.
+<a href="#QUAD">QUAD</a>
+<strong>L, R, C, J</strong> or
+<a href="#JUSTIFY">JUSTIFY</a>)
+<strong>mom</strong> does not break
<a href="definitions.html#TERMS_INPUTLINE">input lines</a>
when you invoke <strong>RW</strong> or <strong>EW</strong>.
-If you'd like <strong>mom</strong> to break input lines prior
-to <strong>RW</strong> or <strong>EW</strong>, invoke
-<strong>BR_AT_INPUT_LINE</strong> without any argument. To
-disable the breaks, invoke <strong>BR_AT_INPUT_LINE</strong>
-with any argument (<strong>OFF, QUIT, Q, X</strong>...), like
-this
+If you'd like her to break input lines prior to <strong>RW</strong>
+or <strong>EW</strong>, invoke <strong>BR_AT_INPUT_LINE</strong>
+without any argument. To disable the breaks, invoke
+<strong>BR_AT_INPUT_LINE</strong> with any argument (<strong>OFF,
+QUIT, Q, X</strong>...), like this
<p>
<pre>
.BR_AT_LINE_KERN OFF
or
.BR_AT_LINE_KERN X
</pre>
+
+In <strong>QUAD L, R</strong> or <strong>C</strong>,
+<strong>mom</strong> simply breaks the line. In <strong>QUAD J</strong>
+(or <strong>JUSTIFY</strong>, which is the same thing), she breaks
+and
+<a href="definitions.html#TERMS_FORCE">force justifies</a>
+the line prior to <strong>EW</strong> or <strong>RW</strong>.
<br>
<!---KERN--->
@@ -1805,7 +2106,7 @@ this
<hr width="66%" align="left">
<a name="KERN"><h3><u>Automatic kerning</u></h3></a>
<br>
-Macro: <strong>KERN</strong> <var>toggle</var>
+<nobr>Macro: <strong>KERN</strong> toggle</nobr>
<br>
<p>
@@ -1817,16 +2118,16 @@ off.
<p>
Kerning of individual character pairs can be controlled with the
<a href="definitions.html#TERMS_INLINES">inline escapes</a>
-<strong>\*[BU #]</strong> and <strong>\*[FU #]</strong>. See
+<strong>\*[BU &lt;n&gt;]</strong> and <strong>\*[FU &lt;n&gt;]</strong>. See
<a href="inlines.html#INLINE_KERNING_MOM">Inline Escapes, kerning</a>.
-<br>
+<p>
<!---LIGATURES--->
<hr width="66%" align="left">
<a name="LIGATURES"><h3><u>Automatic ligature generation</u></h3></a>
<br>
-Macro: <strong>LIGATURES</strong> <var>toggle</var>
+<nobr>Macro: <strong>LIGATURES</strong> toggle</nobr>
<br>
Alias: <strong>LIG</strong>
@@ -1845,7 +2146,7 @@ Good Thing, hence <strong>mom</strong> has them on by default.
ligature generation off.
<p>
<strong>NOTE:</strong> Not all fonts support ligatures.
-<br>
+<p>
<hr>
<!====================================================================>
@@ -1863,7 +2164,7 @@ be missing an italic font, or a bold font. Or you might not be able
to get your hands on a condensed family. That's where these macros
and inline escapes come in. With them, you can fake the fonts
you're missing. A word of caution, though: &quot;faked&quot;
-fonts are just that -- faked. You should only use them as a
+fonts are just that--faked. You should only use them as a
last resort, and then only sparingly. A word or two or a line
or two in a faked font will pass unnoticed; large patches of
type in a faked font look typographically cheap.
@@ -1876,8 +2177,8 @@ type in a faked font look typographically cheap.
<ul>
<li><strong>Pseudo italic</strong>
<ul>
- <li><a href="#SETSLANT">SETSLANT</a> -- degree of pseudo-italicising
- <li><a href="#SLANT_INLINE">\*[SLANT]</a> -- inline escape for pseudo-italicising type
+ <li><a href="#SETSLANT">SETSLANT</a> -- degree of pseudo-italicizing
+ <li><a href="#SLANT_INLINE">\*[SLANT]</a> -- inline escape for pseudo-italicizing type
</ul>
<li><strong>Pseudo bold</strong>
<ul>
@@ -1899,12 +2200,12 @@ type in a faked font look typographically cheap.
<!---SETSLANT--->
<hr width="66%" align="left">
-<a name="SETSLANT"><h3><u>Set degree of slant for pseudo-italicising</u></h3></a>
+<a name="SETSLANT"><h3><u>Set degree of slant for pseudo-italicizing</u></h3></a>
<br>
-Macro: <strong>SETSLANT</strong> <var>&lt;degrees to slant type&gt; | RESET</var>
+<nobr>Macro: <strong>SETSLANT</strong> &lt;degrees to slant type&gt; | RESET</nobr>
<p>
-Pseudo-italicising of type is accomplished by slanting a roman font
+Pseudo-italicizing of type is accomplished by slanting a roman font
a certain number of degrees to the right. <strong>SETSLANT</strong>
lets you fix the number of degrees. <strong>Mom</strong>'s
default is 15, which produces an acceptable approximation of an
@@ -1923,12 +2224,12 @@ to the <strong>mom</strong> default, do
</pre>
<strong>NOTE:</strong> By itself, <strong>SETSLANT</strong>
-will not start pseudo-italicising type; it merely tells
+will not start pseudo-italicizing type; it merely tells
<strong>mom</strong> what degree of slant you want. To start
-pseudo-italicising, use the
+pseudo-italicizing, use the
<a href="definitions.html#TERMS_INLINES">inline escape</a>
<strong>\*[SLANT]</strong>.
-<br>
+<p>
<!---\*[SLANT]--->
@@ -1940,7 +2241,7 @@ Inline: <strong>\*[SLANT] -- turn pseudo-italic on</strong>
Inline: <strong>\*[SLANTX] -- turn pseudo-italic off</strong>
<p>
-<strong>\*[SLANT]</strong> begins pseudo-italicising type.
+<strong>\*[SLANT]</strong> begins pseudo-italicizing type.
<strong>\*[SLANTX]</strong> turns the feature off. Both are
<a href="definitions.html#TERMS_INLINES">inline escapes</a>,
therefore they should not appear as separate lines, but rather
@@ -1950,7 +2251,7 @@ be embedded in text lines, like this:
Not \*[SLANT]everything\*[SLANTX] is as it seems.
</pre>
-Alternatively, if you wanted the whole line pseudo-italicised,
+Alternatively, if you wanted the whole line pseudo-italicized,
you'd do
<p>
<pre>
@@ -1968,14 +2269,14 @@ with
<strong>mom</strong> underlines pseudo-italics by default. To
change this behaviour, use the special macro
<a href="docprocessing.html#SLANT_MEANS_SLANT">SLANT_MEANS_SLANT</a>.
-<br>
+<p>
<!---SETBOLDER--->
<hr width="66%" align="left">
<a name="SETBOLDER"><h3><u>Set amount of emboldening</u></h3></a>
<br>
-Macro: <strong>SETBOLDER</strong> <var>&lt;amount of emboldening, in machine units&gt; | RESET</var>
+<nobr>Macro: <strong>SETBOLDER</strong> &lt;amount of emboldening, in machine units&gt; | RESET</nobr>
<p>
Emboldening of type is accomplished by printing characters
@@ -2004,7 +2305,7 @@ will not start emboldening type; it merely tells
To start emboldening, use the
<a href="definitions.html#TERMS_INLINES">inline escape</a>
<strong>\*[BOLDER]</strong>.
-<br>
+<p>
<!---\*[BOLDER]--->
@@ -2043,14 +2344,14 @@ with
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>,
<strong>mom</strong> ignores <strong>\*[BOLDER]</strong>
requests.
-<br>
+<p>
<!---CONDENSE--->
<hr width="66%" align="left">
<a name="CONDENSE"><h3><u>Set percentage for pseudo-condensed type</u></h3></a>
<br>
-Macro: <strong>CONDENSE</strong> <var>&lt;pseudo-condense percentage&gt;</var>
+<nobr>Macro: <strong>CONDENSE</strong> &lt;pseudo-condense percentage&gt;</nobr>
<p>
Pseudo-condensing of type is accomplished by reducing the width of
@@ -2084,7 +2385,7 @@ is off (with
<a href="#COND_INLINE">\*[CONDX]</a>)
before before making any changes to the pseudo-condense percentage
with <strong>CONDENSE</strong>.
-<br>
+<p>
<!---\*[COND]--->
@@ -2127,14 +2428,14 @@ with
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>,
<strong>mom</strong> ignores <strong>\*[COND]</strong>
requests.
-<br>
+<p>
<!---EXTEND--->
<hr width="66%" align="left">
<a name="EXTEND"><h3><u>Set percentage for pseudo-extended type</u></h3></a>
<br>
-Macro: <strong>EXTEND</strong> <var>&lt;pseudo-extend percentage&gt;</var>
+<nobr>Macro: <strong>EXTEND</strong> &lt;pseudo-extend percentage&gt;</nobr>
<p>
Pseudo-extending of type is accomplished by increasing the width of
@@ -2148,7 +2449,7 @@ to be extended.
<strong>EXTEND</strong>, therefore you must set it before using the
<a href="definitions.html#TERMS_INLINES">inline escape</a>
<a href="#EXT_INLINE">\*[EXT]</a>.
-120 percent of the normal character width is a good value, and
+120% of the normal character width is a good value, and
you'd set it like this:
<p>
<pre>
@@ -2169,7 +2470,7 @@ pseudo-extending is off (with
<a href="#EXT_INLINE">\*[EXTX]</a>)
before before making any changes to the pseudo-extend percentage
with <strong>EXTEND</strong>.
-<br>
+<p>
<!---\*[EXT]--->
@@ -2212,7 +2513,7 @@ with
<a href="docprocessing.html#PRINTSTYLE">PRINTSTYLE TYPEWRITE</a>,
<strong>mom</strong> ignores <strong>\*[EXT]</strong>
requests.
-<br>
+<p>
<hr>
<!====================================================================>
@@ -2240,7 +2541,7 @@ relative to the current
<hr width="66%" align="left">
<a name="ALD"><h3><u>Advance Lead (move downward)</u></h3></a>
<br>
-Macro: <strong>ALD</strong> <var>&lt;distance to move downward&gt;</var>
+<nobr>Macro: <strong>ALD</strong> &lt;distance to move downward&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -2291,14 +2592,14 @@ way if you have set a top margin with
<a href="#T_MARGIN">T_MARGIN</a>
or
<a href="#PAGE">PAGE</a>.
-<br>
+<p>
<!---RLD--->
<hr width="66%" align="left">
<a name="RLD"><h3><u>Reverse Lead (move upward)</u></h3></a>
<br>
-Macro: <strong>RLD</strong> <var>&lt;distance to move upward&gt;</var>
+<nobr>Macro: <strong>RLD</strong> &lt;distance to move upward&gt;</nobr>
<br>
<em>*Requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -2328,7 +2629,7 @@ As the mnemonic (<strong>R</strong>dvance
use <strong>RLD</strong> with
<a href="definitions.html#TERMS_PICASPOINTS">points</a>
of lead.
-<br>
+<p>
<hr>
<!====================================================================>
@@ -2345,26 +2646,32 @@ do with the tab key on your keyboard, and both are utterly
divorced from groff's notion of tabs. I recommend reading this
section carefully in order to understand how
<strong>mom</strong> handles tabs.
+<p>
+<strong>NOTE:</strong> see the section
+<a href="typemacdoc.html#TYPESETTING">Using typesetting macros during document processing</a>
+for re-assuring information on the use of tabs during
+<a href="docprocessing.html#DOCPROCESSING">document processing</a>.
+<p>
<a name="TYPESETTING_TABS"><h3><u>Typesetting tabs</u></h3></a>
<p>
Typesetting tabs are defined by both an indent from the left margin and
a line length. This is quite different from typewriter-style tab stops
(the groff norm) that only define the left indent. In conjunction
-with the multi-column macros, typesetting tabs significantly facilitate
+with the
+<a href="#MULTI_COLUMNS">multi-column macros</a>,
+typesetting tabs significantly facilitate
tabular and columnar work.
<p>
-Typesetting tabs are created with the <strong>TAB_SET</strong>
+Typesetting tabs are created with the
+<a href="#TAB_SET">TAB_SET</a>
macro. <strong>TAB_SET</strong> identifies the tab (by number),
establishes its left indent and line length, and optionally sets
a quad direction and fill mode. After tabs have been created with
<strong>TAB_SET</strong>, they can be called at any time with the
-<strong>TAB</strong> macro.
+<a href="#TAB">TAB</a>
+macro.
<p>
-<strong>NOTE:</strong> see the section
-<a href="typemacdoc.html#TYPESETTING">Typesetting Macros in Document Processing</a>
-for information and advice on using tabs with the
-<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>.
<a name="TYPESETTING_TABS_TUT"><h3><u>Quickie tutorial on typesetting tabs</u></h3></a>
<p>
@@ -2411,7 +2718,7 @@ You want the second tab (&quot;EVALUATION&quot;)
<ul>
<li>to begin 8 picas from the left margin
<li>to have a length of 9 picas
- <li>to be set centered.
+ <li>to be set centred.
</ul>
<br>
You set it up like this:
@@ -2523,13 +2830,17 @@ tab 3 means you don't have to worry about the length of
<strong>mom</strong>
<a href="definitions.html#TERMS_FILLED">fills</a>
the tab and sets the type flush left.
-
+<p>
<a name="STRING_TABS"><h3><u>String tabs (autotabs)</u></h3></a>
<p>
-String tabs let you mark off tab positions inline. Left indents
-and line lengths are calculated from the beginning and end positions of
-the marks. This is especially useful when tab indents and lengths
-need to be determined from the text that goes in each tab.
+String tabs let you mark off tab positions with
+<a href="definitions.html#TERMS_INLINES">inline escapes</a>
+embedded in
+<a href="definitions.html#TERMS_INPUTLINE">input lines</a>.
+Left indents and line lengths are calculated from the beginning and
+end positions of the marks. This is especially useful when tab
+indents and lengths need to be determined from the text that goes in
+each tab.
<p>
Setting up string tabs is a two-step procedure. First, you enter an
input line in which you mark off where you want tabs to begin and end.
@@ -2550,10 +2861,10 @@ In combination with the
macro and the groff inline escape
<a href="inlines.html#INLINE_HORIZONTAL_GROFF">\h</a>
(move horizontally across the page) or <strong>mom</strong>'s
-<a href="inlines.html#INLINE_HORIZONTAL_MOM">\*[FP#]</a>
-(Forward Points) inline, string tabs provide
+<a href="inlines.html#INLINE_HORIZONTAL_MOM">\*[FWD &lt;distance&gt;]</a>
+(move forward) inline, string tabs provide
tremendous flexibility in setting up complex tab structures.
-
+<p>
<a name="STRING_TABS_TUT"><h3><u>Quickie tutorial on string tabs</u></h3></a>
<p>
Say you want to set up tabs for the
@@ -2577,8 +2888,12 @@ The first thing you need for string tabs is an
<a href="definitions.html#TERMS_INPUTLINE">input line</a>
with tab positions marked on it. Tabs are marked with the
<a href="definitions.html#TERMS_INLINES">inline escapes</a>
-<strong>\*[ST#]</strong> and <strong>\*[ST#X]</strong>. (In this
-example, we enclose the input line with the
+<a href="#ST_INLINE">\*[ST&lt;n&gt;]</a>
+and
+<a href="#ST_INLINE">\*[ST&lt;n&gt;X]</a>,
+where <strong>&lt;n&gt;</strong>
+is the number you want the tab to have. (In this example, we
+enclose the input line with the
<a href="goodies.html#SILENT">SILENT</a>
macro so the line doesn't print. We also use the
<a href="goodies.html#PAD">PAD</a>
@@ -2589,7 +2904,7 @@ The setup looks like this:
<p>
<pre>
.SILENT
- .PAD "\*[ST1]CRITERION\*[ST1X]\*[FP12]\*[ST2]EVALUATION\*[ST2X]\*[FP12]\*[ST3]#\*[ST3X]"
+ .PAD "\*[ST1]CRITERION\*[ST1X]\*[FWD 12p]\*[ST2]EVALUATION\*[ST2X]\*[FWD 12p]\*[ST3]#\*[ST3X]"
.SILENT OFF
</pre>
@@ -2603,10 +2918,10 @@ Here's what it means when broken down into its component parts:
<kbd>\*[ST1]CRITERION\*[ST1X]</kbd>
<br>
<li>We want a 1 pica (12 points) gutter between tab 1 and 2,
- so we insert 12 points of space with \*[FP12]
- (<strong>F</strong>orward <strong>P</strong>oints 12):
+ so we insert 12 points of space with \*[FWD 12p]
+ (<strong>F</strong>or<strong>W</strong>ar<strong>D</strong> 12 points):
<p>
- <kbd>\*[FP12]</kbd>
+ <kbd>\*[FWD 12p]</kbd>
<br>
<li>The longest line in tab 2 is &quot;EVALUATION&quot;, so
we enclose EVALUATION with begin/end markers for string
@@ -2615,9 +2930,9 @@ Here's what it means when broken down into its component parts:
<kbd>\*[ST2]EVALUATION\*[ST2X]</kbd>
<br>
<li>We want 1 pica (12 points) between tab 2 and 3, so we
- insert 12 points of space with another \*[FP12]:
+ insert 12 points of space with another \*[FWD 12p]:
<p>
- <kbd>\*[FP12]</kbd>
+ <kbd>\*[FWD 12p]</kbd>
<br>
<li>We want tab 3 to be as long as whatever space remains on
the current line length, so we enclose the
@@ -2656,7 +2971,7 @@ just like typesetting tabs (see
<a href="#TYPESETTING_TABS_TUT">typesetting tabs tutorial</a>).
<p>
Here's the complete setup and entry for the sample employee
-evaluation form utilising string tabs.
+evaluation form utilizing string tabs.
<p>
<pre>
.PAGE 8.5i 11i 1i 1i 1i
@@ -2669,7 +2984,7 @@ evaluation form utilising string tabs.
.HY OFF
.SS 0
.SILENT
- .PAD "\*[ST1]CRITERION\*[ST1X]\*[FP12]\*[ST2]EVALUATION\*[ST2X]\*[FP12]\*[ST3]#\*[ST3X]"
+ .PAD "\*[ST1]CRITERION\*[ST1X]\*[FWD 12p]\*[ST2]EVALUATION\*[ST2X]\*[FWD 12p]\*[ST3]#\*[ST3X]"
.SILENT OFF
.ST 1 L
.ST 2 L
@@ -2717,11 +3032,11 @@ it again. You'll see that the tab structure remains identical (tab
between tabs is still 1 pica), while the position and length
of the tabs have altered because of the new point size.
<p>
-Now try increasing the gutters to 2 picas (put an additional
-<kbd>\*[FP12]</kbd> after each <kbd>\*[FP12]</kbd>). Preview the
+Now try increasing the gutters to 2 picas (<kbd>\*[FWD 24p]</kbd> or
+<kbd>\*[FWD 2P]</kbd> instead of <kbd>\*[FWD 12p]</kbd>). Preview the
file again, and notice how the tab structure remains the same, but
the gutters are wider.
-
+<p>
<a name="INDEX_TABS">
<h3><u>Tabs macro list</u></h3>
@@ -2739,9 +3054,9 @@ the gutters are wider.
<!---TAB_SET--->
<hr width="66%" align="left">
- <a name="TAB_SET"><h3><u>Set up typsetting tabs</u></h3></a>
+ <a name="TAB_SET"><h3><u>Set up typesetting tabs</u></h3></a>
<br>
-Macro: <strong>TAB_SET</strong> <var>&lt;tab number&gt; &lt;indent&gt; &lt;length&gt; L | R | C | J [ QUAD ]</var>
+<nobr>Macro: <strong>TAB_SET</strong> &lt;tab number&gt; &lt;indent&gt; &lt;length&gt; L | R | C | J [ QUAD ]</nobr>
<br>
<em>*&lt;indent&gt; and &lt;length&gt; require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -2761,7 +3076,7 @@ four required arguments:
<li>a direction
</ul>
<br>
-To set up a centered tab 6 picas long and 9 points from the left
+To set up a centred tab 6 picas long and 9 points from the left
margin, you'd enter
<p>
<pre>
@@ -2774,7 +3089,7 @@ need to set up tabs in numerical sequence.
<p>
By default, tabs are in
<a href="definitions.html#TERMS_NOFILL">nofill</a>
-mode, meaning you can enter text in tabs on a line for line basis
+mode, meaning you can enter text in tabs on a line-for-line basis
without having to use the
<a href="#BR">BR</a>
macro. If you want a tab to be
@@ -2816,7 +3131,7 @@ up a tab structure within the confines of an existing tab).
<a href="#INDENTS">Indents</a>)
before setting up tabs with <strong>TAB_SET</strong>, or
<strong>mom</strong> may get confused.
-<br>
+<p>
<!---INLINE_ST--->
@@ -2824,7 +3139,19 @@ before setting up tabs with <strong>TAB_SET</strong>, or
<a name="INLINE_ST"><h3><u>Mark positions of string tabs</u></h3></a>
<br>
Inlines: <strong>\*[ST&lt;number&gt;]...\*[ST&lt;number&gt;X]</strong>
-
+<br>
+<em>*<a href="definitions.html#TERMS_QUAD">Quad</a>
+direction must be LEFT or JUSTIFY (see
+<a href="#QUAD">QUAD</a>
+and
+<a href="#JUSTIFY">JUSTIFY</a>)
+or the
+<a name="definitions.html#TERMS_NOFILL">no-fill mode</a>
+set to
+<a href="#LRC">LEFT</a>.
+Please see
+<a href="#IMPORTANT">IMPORTANT</a>,
+below.</em>
<p>
String tabs need to be marked off with
<a href="definitions.html#TERMS_INLINES">inline escapes</a>
@@ -2864,20 +3191,73 @@ printing, use the
<a href="#SILENT">SILENT</a>
macro.
<p>
-<strong>IMPORTANT:</strong> Do not try to set up string tabs on
-a line that is broken with
+<a name="IMPORTANT"><strong>IMPORTANT:</strong></a>
+Owing to the way groff processes
+<a href="definitions.html#TERMS_INPUTLINE">input lines</a>
+and turns them into
+<a href="definitions.html#TERMS_OUTPUTLINE">output lines</a>,
+it is not possible for <strong>mom</strong> to &quot;guess&quot; the
+correct starting position of string tabs marked off in lines that
+are centered or set flush right.
+<p>
+Equally, she cannot guess the starting position if a line is fully
+justified and broken with
<a href="#SPREAD">SPREAD</a>.
-<strong>Mom</strong> calculates string tab positions and lengths
-as she reads the input line, not after the line has undergone
-manipulations to the word spacing.
-<br>
+<p>
+In other words, in order to use string tabs,
+<a href="#LRC">LEFT</a>
+must be active, or, if
+<a href="#QUAD">QUAD LEFT</a>
+or
+<a href="#JUSTIFY">JUSTIFY</a>
+are active, the line on which the string tabs are marked must be
+broken &quot;manually&quot; with
+<a href="#BR">BR</a>
+(but not
+<a href="#SPREAD">SPREAD</a>).
+<p>
+To circumvent this behaviour, I recommend using the
+<a href="goodies.html#PAD">PAD</a>
+to set up string tabs in centered or flush right lines. Say, for
+example, you want to use a string tab to underscore the text of a
+centered line with a rule. Rather than this,
+<p>
+<pre>
+ .CENTER
+ \*[ST1]A line of text\*[ST1X]\c
+ .EL
+ .ST 1
+ .TAB 1
+ .PT_SIZE 24
+ .ALD 3p
+ \*[RULE]
+ .RLD 3p
+ .TQ
+</pre>
+
+you should do:
+<p>
+<pre>
+ .QUAD CENTER
+ .PAD "#\*[ST1]A line of text\*[ST1X]#"
+ .EL
+ .ST 1
+ .TAB 1
+ .PT_SIZE 24
+ .ALD 3p
+ \*[RULE] \" Note that you can't use \*[UP ] or \*[DOWN] with \*[RULE]
+ .RLD 3p
+ .TQ
+</pre>
+
+<p>
<!---ST--->
<hr width="66%" align="left">
<a name="ST"><h3><u>Set string tabs</u></h3></a>
<br>
-Macro: <strong>ST</strong> <var>&lt;tab number&gt; L | R | C | J [ QUAD ]</var>
+<nobr>Macro: <strong>ST</strong> &lt;tab number&gt; L | R | C | J [ QUAD ]</nobr>
<p>
After string tabs have been marked off on an input line (see
@@ -2911,14 +3291,14 @@ If you want it to be justified, enter
See the
<a href="#STRING_TABS_TUT">Quickie tutorial on string tabs</a>
for a full explanation of setting up string tabs.
-<br>
+<p>
<!---TAB--->
<hr width="66%" align="left">
<a name="TAB"><h3><u>Call tabs</u></h3></a>
<br>
-Macro: <strong>TAB</strong> <var>&lt;tab number&gt;</var>
+<nobr>Macro: <strong>TAB</strong> &lt;tab number&gt;</nobr>
<br>
Alias: <strong>TB</strong>
<p>
@@ -2980,7 +3360,7 @@ If you were happily zipping down the page with a left indent of 2
picas turned on, and you call a tab whose indent from the left margin
is 6 picas, your new distance from the left margin will be 6 picas,
not 6 picas plus the 2 pica indent.
-<br>
+<p>
<!---TN--->
@@ -2989,6 +3369,21 @@ not 6 picas plus the 2 pica indent.
<br>
Macro: <strong>TN</strong>
<br>
+<em>*In tabs that aren't given the QUAD argument when they're set up
+with
+<a href="#TAB_SET">TAB_SET</a>
+or
+<a href="#ST">ST</a>, you must terminate the line preceding
+<kbd>TN</kbd> with the \c inline escape. See the
+<a href="#TN_NOTE">ADDITIONAL NOTE</a>,
+<br>
+*If you find remembering whether to put in the <kbd>\c</kbd>
+bothersome, you may prefer to use the
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
+alternative to
+<kbd>.TN</kbd>,
+<a href="inlines.html#TB+">\*[TB+]</a>,
+which works consistently regardless of the fill mode.</em>
<p>
<strong>TN</strong> moves over to the next tab in numeric
@@ -2997,36 +3392,73 @@ sequence (tab n+1) without advancing on the page. See the
in the description of the <strong>TAB</strong> macro for an
example of how <strong>TN</strong> works.
<p>
-<strong>NOTE:</strong> <strong>TN</strong> is like
-<a href="#EL">EL</a>
-in that it doesn't work as advertised on the last line before a
-footer trap is sprung. If you need to use <strong>TN</strong>
-on the last line of a page with a footer trap, turn the trap off with
-<a href="goodies.html#TRAP">TRAP</a>,
-as in this example:
+<strong>NOTE:</strong> You <em>must</em> put text in the
+<a href="definitions.html#TERMS_INPUTLINE">input line</a>
+immediately after <strong>TN</strong>. &quot;Stacking&quot; of
+<strong>TN</strong>'s is not allowed. In other words, you cannot
+do
+<p>
+<pre>
+ .TAB 1
+ Some text
+ .TN
+ Some more text
+ .TN
+ .TN
+ Yet more text
+</pre>
+
+The above example, assuming tabs numbered from 1 to 4, should be entered
+<p>
+<pre>
+ .TAB 1
+ Some text
+ .TN
+ Some more text
+ .TAB 4
+ Yet more text
+</pre>
+<p>
+<a name="TN_NOTE"><strong>ADDITIONAL NOTE:</strong></a>
+In versions of mom prior to 1.1.9, <strong>TN</strong> did not
+always work as advertised on the last
+<a name="TERMS_OUTPUTLINE">output line</a>
+of pages that contained a footer trap (e.g. one set with
+<a href="#B_MARGIN">B_MARGIN</a>
+or in documents formatted using the
+<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>).
+<p>
+<strong>TN</strong> has been re-written so that this should no longer be the
+case. However, in order for it to work in tabs that have not been
+given a <kbd>QUAD</kbd> argument (see
+<a href="#TAB_SET">TAB_SET</a>
+and
+<a href="#ST">ST</a>)
+you must always &quot;join&quot; <strong>.TN</strong> to the line
+before it using the
+<a href="#JOIN">\c</a>
+<a href="definitions.html#TERMS_INLINES">inline escape</a>,
+as in the following example:
<p>
<pre>
.TAB_SET 1 0 1P L
.TAB_SET 2 1P 20P L
.TAB 1
- .TRAP OFF
- 1.
+ 1.\c
.TN
The first rule of survival is &quot;make and keep good friends.&quot;
- .TRAP
</pre>
-The above, at the bottom of a page, will look something like this:
+When output, the example will look like this:
<p>
<pre>
1. The first rule of survival is &quot;make and keep good friends.&quot;
</pre>
-If you hadn't turned the trap off before <kbd>.TN</kbd>,
-&quot;1.&quot; would have appeared as the last line on the page,
-with &quot;The first rule of survival...&quot; being the first
-line on the next page.
-<br>
+Conversely, if you did give a <kbd>QUAD</kbd> argument
+to <strong>TAB_SET</strong> or <strong>ST</strong>, the
+<strong>\c</strong> must not be used.
+<p>
<!---TQ--->
@@ -3042,7 +3474,7 @@ advances 1 linespace, and restores the left margin, line length,
quad direction and
<a href="definitions.html#TERMS_FILLED">fill mode</a>
that were in effect prior to invoking any tabs.
-<br>
+<p>
<hr>
<!====================================================================>
@@ -3123,7 +3555,7 @@ the
<a href="docprocessing.html#COLUMNS">COLUMNS</a>
macro in the
<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>.
-
+<p>
<a name="INDEX_MULTI_COLUMNS">
<h3><u>Columns macro list</u></h3>
</a>
@@ -3147,7 +3579,7 @@ Macro: <strong>MCO</strong>
is the macro you use to begin multi-column setting. It marks
the current
<a href="definitions.html#TERMS_BASELINE">baseline</a>
-as the top of your columns, for use late with
+as the top of your columns, for use later with
<a href="#MCR">MCR</a>. See the
<a href="#MULTI_COLUMNS">introduction to columns</a>
for an explanation of multi-columns and some sample
@@ -3158,7 +3590,7 @@ the
<a href="docprocessing.html#COLUMNS">COLUMNS</a>
macro in the
<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>.
-<br>
+<p>
<!---MCR--->
@@ -3173,14 +3605,14 @@ Once you've turned multi-columns on (with
<a href="#MCO">MCO</a>),
<strong>MCR</strong>, at any time, returns you to the top of
your columns.
-<br>
+<p>
<!---MCX--->
<hr width="66%" align="left">
<a name="MCX"><h3><u>Exit multi-columns</u></h3></a>
<br>
-Macro: <strong>MCX</strong> <var>[ &lt;distance to advance below longest column&gt; ]</var>
+<nobr>Macro: <strong>MCX</strong> [ &lt;distance to advance below longest column&gt; ]</nobr>
<br>
<em>*Optional argument requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -3196,9 +3628,9 @@ below the longest column. Linespace, in this instance, is the
in effect <em>at the moment <strong>MCX</strong> is
invoked.</em>
<p>
-If you pass the <var>&lt;distance&gt;</var> argument to
+If you pass the <nobr>&lt;distance&gt; argument to</nobr>
<strong>MCX</strong>, it advances 1 linespace below the longest
-column (see above) PLUS the distance specified by the argumemnt.
+column (see above) PLUS the distance specified by the argument.
The argument requires a unit of measure; therefore, to advance
an extra 6 points below where <strong>MCX</strong> would
normally place you, you'd enter
@@ -3223,7 +3655,7 @@ macro, like this:
The above advances to precisely 24 points below the baseline
of the longest column.
-<br>
+<p>
<hr>
<!====================================================================>
@@ -3240,7 +3672,7 @@ provides temporary left indents (i.e. only one line is indented,
as at the start of a paragraph) and &quot;hanging&quot; left indents
(the reverse of a temporary indent; the first line isn't indented,
subsequent lines are).
-
+<p>
<a name="INDENTS_TUT"><h3><u>A brief explanation of how mom handles indents</u></h3></a>
<p>
<strong>Mom</strong> provides five kinds of indents: left, right,
@@ -3373,7 +3805,7 @@ picas and control each separately, as in the following example.
More text \"Text is still indented 4 picas left
</pre>
-If, at <kbd>.IRX</kbd>, you wanted the text afterward to have no
+If, at <kbd>.IRX</kbd>, you wanted the text afterwards to have no
indents (either left or right), you would enter <kbd>.IQ</kbd>,
which exits all indent styles at once.
<p>
@@ -3388,9 +3820,9 @@ at which they excel.
<p>
<strong>NOTE:</strong> see the section
<a href="typemacdoc.html#TYPESETTING">Typesetting Macros in Document Processing</a>
-for information and advice on using idents with the
+for information and advice on using indents with the
<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>.
-
+<p>
<a name="INDEX_INDENTS"><h3><u>Indents macro list</u></h3>
<ul>
<li><a href="#IL">IL</a>&nbsp;&nbsp;(Indent left)
@@ -3412,7 +3844,7 @@ for information and advice on using idents with the
<hr width="66%" align="left">
<a name="IL"><h3><u>Indent left</u></h3></a>
<br>
-Macro: <strong>IL</strong> <var>[ &lt;measure&gt; ]</var>
+<nobr>Macro: <strong>IL</strong> [ &lt;measure&gt; ]</nobr>
<br>
<em>*The optional argument requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -3447,15 +3879,15 @@ for more details.
automatically cancels any active indents.
<p>
<strong>ADDITIONAL NOTE:</strong> Invoking <strong>IL</strong>
-automtically turns off <strong>IB</strong>.
-<br>
+automatically turns off <strong>IB</strong>.
+<p>
<!---IR--->
<hr width="66%" align="left">
<a name="IR"><h3><u>Indent right</u></h3></a>
<br>
-Macro: <strong>IR</strong> <var>[ &lt;measure&gt; ]</var>
+<nobr>Macro: <strong>IR</strong> [ &lt;measure&gt; ]</nobr>
<br>
<em>*The optional argument requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -3468,7 +3900,7 @@ measure. Subsequent invocations with a measure add to the previous
indent measure. A minus sign may be prepended to the argument to
subtract from the current indent measure. The
<a href="inlines.html#INLINE_STRINGWIDTH_GROFF">\w</a>
-<a href="definitions.html#TERMS_INLINES">inline esacpe</a>
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
may be used to specify a text-dependent measure, in which case
no unit of measure is required. For example,
<p>
@@ -3488,15 +3920,15 @@ for more details.
automatically cancels any active indents.
<p>
<strong>ADDITIONAL NOTE:</strong> Invoking <strong>IR</strong>
-automtically turns off <strong>IB</strong>.
-<br>
+automatically turns off <strong>IB</strong>.
+<p>
<!---IB--->
<hr width="66%" align="left">
<a name="IB"><h3><u>Indent both</u></h3></a>
<br>
-Macro: <strong>IB</strong> <var>[ &lt;left measure&gt; &lt;right measure&gt; ]</var>
+<nobr>Macro: <strong>IB</strong> [ &lt;left measure&gt; &lt;right measure&gt; ]</nobr>
<br>
<em>*The optional arguments require a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -3519,12 +3951,12 @@ save yourself a lot of grief.
A minus sign may be prepended to the arguments to subtract from their
current values. The
<a href="inlines.html#INLINE_STRINGWIDTH_GROFF">\w</a>
-<a href="definitions.html#TERMS_INLINES">inline esacpe</a>
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
may be used to specify text-dependent measures, in which case
no unit of measure is required. For example,
<p>
<pre>
- .IB \w'margaraine' \w'jello'
+ .IB \w'margarine' \w'jello'
</pre>
left indents text by the width of the word &quot;margarine&quot;
@@ -3540,22 +3972,22 @@ for more details.
automatically cancels any active indents.
<p>
<strong>ADDITIONAL NOTE:</strong> Invoking <strong>IB</strong>
-automtically turns off <strong>IL</strong> and
+automatically turns off <strong>IL</strong> and
<strong>IR</strong>.
-<br>
+<p>
<!---TI--->
<hr width="66%" align="left">
<a name="TI"><h3><u>Temporary (left) indent</u></h3></a>
<br>
-Macro: <strong>TI</strong> <var>[ &lt;measure&gt; ]</var>
+<nobr>Macro: <strong>TI</strong> [ &lt;measure&gt; ]</nobr>
<br>
<em>*The optional argument requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
<p>
A temporary indent is one that applies only to the first line of
-text that comes after it. It's chief use is indenting the first
+text that comes after it. Its chief use is indenting the first
line of paragraphs. (<strong>Mom</strong>'s
<a href="docprocessing.html#PP">PP</a>
macro, for example, uses a temporary indent.)
@@ -3594,7 +4026,7 @@ are NOT additive. In the following example, the second <kbd>.TI
<hr width="66%" align="left">
<a name="HI"><h3><u>Hanging indent</u></h3></a>
<br>
-Macro: <strong>HI</strong> <var>[ &lt;measure&gt; ]</var>
+<nobr>Macro: <strong>HI</strong> [ &lt;measure&gt; ]</nobr>
<br>
<em>*The optional argument requires a <a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a></em>
@@ -3639,10 +4071,15 @@ prior to the line you want hung (i.e. without any intervening
<a href="definitions.html#TERMS_CONTROLLINES">control lines</a>).
And because hanging indents affect only one line, there's no need to turn
them off.
-
+<p>
<a name="NUM_LISTS"><h3><u>A recipe for numbered lists</u></h3></a>
<p>
-A common use for hanging indents is setting numbered lists.
+<strong>PLEASE NOTE: mom</strong> now has macros for setting lists (see
+<a href="docelement.html#LIST_INTRO">Nested lists</a>),
+making this recipe superfluous. It remains here in the hope that
+it will clarify the use of hanging indents generally, if no longer
+specifically.
+<p>
Consider the following example:
<p>
<pre>
@@ -3678,7 +4115,7 @@ of 2
plus a period (using the
<a href="inlines.html#INLINE_STRINGWIDTH_GROFF">\w</a>
inline escape). At this point, the left indent is active; text
-afterward would normally be indented. However, we invoke a hanging
+afterwards would normally be indented. However, we invoke a hanging
indent of exactly the same width, which hangs the first line (and
first line only!) to the left of the indent by the same distance
(in this case, that means &quot;out to the left margin&quot;).
@@ -3697,20 +4134,20 @@ Paste the example above into a file and preview it with <kbd>groff -mom -X
<strong>IB</strong>, measures given to <strong>HI</strong>
are NOT additive. Each time you pass a measure to
<strong>HI</strong>, the measure is treated literally.
-<br>
+<p>
<!---IX--->
<hr width="66%" align="left">
<a name="IQ"><h3><u>Quitting indents</u></h3></a>
<br>
-Macro: <strong>IQ</strong>&nbsp;&nbsp;<var>[ CLEAR ]&nbsp;&nbsp;</var>(quit any/all indents -- see <strong>*IMPORTANT NOTE</strong>)
+<nobr>Macro: <strong>IQ</strong>&nbsp;&nbsp;[ CLEAR ]&nbsp;&nbsp;(quit any/all indents -- see <strong>*IMPORTANT NOTE</strong>)</nobr>
<br>
-Macro: <strong>ILX</strong>&nbsp;<var>[ CLEAR ]&nbsp;&nbsp;</var>(exit <strong>I</strong>ndent <strong>L</strong>eft)
+<nobr>Macro: <strong>ILX</strong>&nbsp;[ CLEAR ]&nbsp;&nbsp;(exit <strong>I</strong>ndent <strong>L</strong>eft)</nobr>
<br>
-Macro: <strong>IRX</strong>&nbsp;<var>[ CLEAR ]&nbsp;&nbsp;</var>(exit <strong>I</strong>ndent <strong>R</strong>ight)
+<nobr>Macro: <strong>IRX</strong>&nbsp;[ CLEAR ]&nbsp;&nbsp;(exit <strong>I</strong>ndent <strong>R</strong>ight)</nobr>
<br>
-Macro: <strong>IBX</strong>&nbsp;<var>[ CLEAR ]&nbsp;&nbsp;</var>(exit <strong>I</strong>ndent <strong>B</strong>oth)
+<nobr>Macro: <strong>IBX</strong>&nbsp;[ CLEAR ]&nbsp;&nbsp;(exit <strong>I</strong>ndent <strong>B</strong>oth)</nobr>
<p>
<strong>*IMPORTANT NOTE:</strong>
@@ -3728,7 +4165,7 @@ now also be invoked as</em> <strong>ILQ, IRQ</strong> <em>and</em>
<strong>IBQ</strong><em>. Both forms are acceptable.</em>
<p>
Without an argument, the macros to quit indents merely restore your
-original left margin and line length. The measures stored in the
+original margins and line length. The measures stored in the
indent macros themselves are saved so you can call them again without
having to supply a measure.
<p>
@@ -3747,5 +4184,6 @@ the values for all indent styles at once.
<a href="definitions.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="#TOP">Top</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
+
</body>
</html>
diff --git a/contrib/groff/contrib/mom/momdoc/using.html b/contrib/groff/contrib/mom/momdoc/using.html
index 327e86ba4da3..1265eec8cd97 100644
--- a/contrib/groff/contrib/mom/momdoc/using.html
+++ b/contrib/groff/contrib/mom/momdoc/using.html
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
@@ -10,7 +11,7 @@
<a href="typesetting.html#TOP">Next</a>&nbsp;&nbsp;
<a href="definitions.html#TOP">Prev</a>&nbsp;&nbsp;
<a href="toc.html">Back to Table of Contents</a>
-
+<p>
<a name="TOP"></a>
<a name="USING">
<h1 align="center"><u>USING MOM</u></h1>
@@ -23,7 +24,7 @@
<a href="#USING_INVOKING">Invoking groff</a>
<br>
<a href="#USING_PREVIEWING">Previewing documents</a>
-<br>
+<p>
<hr>
<h2><a name="USING_INTRO"><u>Introduction</u></a></h2>
@@ -46,11 +47,11 @@ macro, explained below. After <strong>START</strong>,
<strong>mom</strong> determines the appearance of text following
the markup tags automatically, although you, the user, can easily
change how <strong>mom</strong> interprets the tags. This gives you
-nearly complete control over the look and feel of your documents.
-In addition, the typesetting macros, in combination with document
-processing, let you meet all sorts of typesetting needs that just
-can't be covered by &quot;one macro fits all&quot; markup tags.
-
+nearly complete control over document design. In addition, the
+typesetting macros, in combination with document processing, let you
+meet all sorts of typesetting needs that just can't be covered by
+&quot;one macro fits all&quot; markup tags.
+<p>
<a name="USING_MACROS">
<h2><u>How to input mom's macros</u></h2>
</a>
@@ -67,9 +68,9 @@ following apply.
rules for <strong>mom</strong>'s macros and
<a href="definitions.html#TERMS_INLINES">inline escapes</a>.
I use the vi clone called elvis, and find it a pure
- joy in this regard. Simply colorizing macros and
+ joy in this regard. Simply colourizing macros and
inlines to half-intensity can be enough to make text stand
- out clearly from formattting commands.
+ out clearly from formatting commands.
<li>All <strong>mom</strong>'s macros begin with a period
(dot) and must be entered in upper case (capital)
letters.
@@ -120,12 +121,12 @@ Consider the following, which is a template for starting the
chapter of a book.
<p>
<pre>
- .TITLE "My Pulizter Novel"
+ .TITLE "My Pulitzer Novel"
.AUTHOR "Joe Blow"
.CHAPTER 1
\#
.DOCTYPE CHAPTER
- .PRINTSTYPE TYPESET
+ .PRINTSTYLE TYPESET
\#
.FAM P
.PT_SIZE 10
@@ -171,7 +172,7 @@ option along with the other options you require. Theoretically, you
only need <code>-U</code> with <code>.open, .opena, .pso, .sy,</code>
and <code>.pi</code>, however reality seems, at times, to dictate
otherwise.
-
+<p>
<a name="USING_PREVIEWING">
<h2><u>How to preview documents</u></h2>
</a>
@@ -184,7 +185,7 @@ Groff itself comes with a quick and dirty previewer called
gxditview. Invoke it with
<p>
<pre>
- groff -X -mom &lt;filename&gt;
+ groff -X -mom filename
</pre>
It's not particularly pretty, doesn't have many navigation
@@ -200,18 +201,24 @@ doesn't gobble up system resources.
<p>
A surer way to preview documents is with <strong>gv</strong>
(ghostview). This involves processing documents with groff,
-directing the output to a temporary (PostScript) file, then opening
-the temporary file in <strong>gv</strong>. While that may sound
-like a lot of work, I've set up my editor (elvis) to do it for me.
-Whenever I'm working on a document that needs previewing/checking,
-I fire up <strong>gv</strong> with the &quot;Watch File&quot;
-option turned on. To look at the file, I tell elvis to process
-it (with groff) and send it to a temporary file (<kbd>groff
--mom filename &gt; filename.ps</kbd>), then open the file inside
-<strong>gv</strong>. Ever after, when I want to look at any changes
-I make, I simply tell elvis to work his magic again. The Watch File
-option in <strong>gv</strong> registers that the file has changed,
-and automatically loads the new version. Voilà! -- instant previewing.
+and directing the output to a PostScript file, like this,
+<p>
+<pre>
+ groff -mom filename &gt; filename.ps
+</pre>
+then opening .ps file in <strong>gv</strong>.
+<p>
+While that may sound like a lot of work, I've set up my editor
+(elvis) to do it for me. Whenever I'm working on a document that
+needs previewing/checking, I fire up <strong>gv</strong> with the
+&quot;Watch File&quot; option turned on. To look at the file, I
+tell elvis to process it (with groff) and send it to a temporary
+file (<kbd>groff -mom filename &gt; filename.ps</kbd>), then open
+the file inside <strong>gv</strong>. Ever after, when I want to
+look at any changes I make, I simply tell elvis to work his magic
+again. The Watch File option in <strong>gv</strong> registers that
+the file has changed, and automatically loads the new version.
+Voilà! --instant previewing.
<p>
<hr>
diff --git a/contrib/groff/contrib/mom/om.tmac b/contrib/groff/contrib/mom/om.tmac
index 5d43b5087bec..37e9161fd841 100644
--- a/contrib/groff/contrib/mom/om.tmac
+++ b/contrib/groff/contrib/mom/om.tmac
@@ -1,42 +1,89 @@
.\" om.tmac
-.\"
-.\" Mom -- a typesetting/document-processing macro set for groff.
-.\"
-.\" Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-.\" Written by Peter Schaffter (df191@ncf.ca)
-.\"
-.\" This file is part of groff.
-.\"
-.\" groff is free software; you can redistribute it and/or modify it under
-.\" the terms of the GNU General Public License as published by the Free
-.\" Software Foundation; either version 2, or (at your option) any later
-.\" version.
-.\"
-.\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
-.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
-.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-.\" for more details.
-.\"
-.\" You should have received a copy of the GNU General Public License along
-.\" with groff; see the file COPYING. If not, write to the Free Software
-.\" Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-.\"
-.
-.
-\# Version 1.1.5
-\# -------------
+.ig
+Mom -- a typesetting/document-processing macro set for groff.
+
+Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Written by Peter Schaffter (peter@faustus.dyn.ca)
+
+This file is part of groff.
+
+groff is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+groff is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License along
+with groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+Version 1.3-a
+-------------
+Antoine de St-Exupéry asserted that elegance in engineering is
+achieved not when there is nothing left to add, but when there is
+nothing left to take away.
+
+By those standards, mom is a Rube Goldberg contraption. She was
+created over the years while groff, and my understanding of it,
+changed and evolved. However, I'm a firm believer in "if it
+ain't broke, don't fix it," so I'm leaving any major clean-up
+of redundancies and whatnot for a rainy day.
+
+Inasmuch as possible, macros that turn a feature on or off follow
+a similar style. Invoking the macro without an argument turns
+the feature on. Invoking it with any other argument turns it off.
+Use of the argument OFF is recommended, but not required; users
+may find other conventions preferable (e.g. NO, X, END, QUIT, etc.).
+
+"<anything>" in the description of arguments that can be passed
+to a macro means that any argument turns the feature off.
+..
\#
-.if (\n[.x]\n[.y] < 118) \
-. ab You need GNU troff version 1.18 or higher to run this version of mom!
-\#
-\# Inasmuch as possible, macros that turn a feature on or off follow
-\# a similar style. Invoking the macro without an argument turns
-\# the feature on. Invoking it with any other argument turns it off.
-\# Use of the argument OFF is recommended, but not required; users
-\# may find other conventions preferable (e.g. NO, X, END, QUIT, etc.).
+\# ====================================================================
\#
-\# "<anything>" in the description of arguments that can be passed
-\# to a macro means that any argument turns the feature off.
+\# Check which version of groff is being run
+.if (\n[.x]\n[.y] < 118) \
+. ab You need GNU troff version 1.18 or higher to run this version of mom.
+\# Check that GNU troff is being run
+.if !\n[.g]=1 \
+. ab The mom macros require that you be running GNU troff.
+.if \n(.C \
+. ab The groff mom macros do not work in compatibility mode.
+\# Add supplementary styles
+.sty \n[.fp] L \" Light Roman
+.sty \n[.fp] LI \" Light Italic
+.sty \n[.fp] LCD \" Light Condensed Roman
+.sty \n[.fp] LCDI \" Light Condensed Italic
+.sty \n[.fp] LEX \" Light Extended Roman
+.sty \n[.fp] LEXI \" Light Extended Italic
+.sty \n[.fp] CD \" Medium/Book Condensed Roman
+.sty \n[.fp] CDI \" Medium/Book Condensed Italic
+.sty \n[.fp] EX \" Medium/Book Extended Roman
+.sty \n[.fp] EXI \" Medium/Book Extended Italic
+.sty \n[.fp] DB \" DemiBold Roman
+.sty \n[.fp] DBI \" DemiBold Italic
+.sty \n[.fp] BCD \" Bold Condensed Roman
+.sty \n[.fp] BCDI \" Bold Condensed Italic
+.sty \n[.fp] BEX \" Bold Extended Roman
+.sty \n[.fp] BEXI \" Bold Extended Italic
+.sty \n[.fp] HV \" Heavy Roman
+.sty \n[.fp] HVI \" Heavy Italic
+.sty \n[.fp] HVCD \" Heavy Condensed Roman
+.sty \n[.fp] HVCDI \" Heavy Condensed Italic
+.sty \n[.fp] HVEX \" Heavy Extended Roman
+.sty \n[.fp] HVEXI \" Heavy Extended Italic
+.sty \n[.fp] BL \" Black Roman
+.sty \n[.fp] BLI \" Black Italic
+.sty \n[.fp] BLCD \" Black Condensed Roman
+.sty \n[.fp] BLCDI \" Black Condensed Italic
+.sty \n[.fp] BLEX \" Black Extended Roman
+.sty \n[.fp] BLEXI \" Black Extended Italic
+.sty \n[.fp] UBL \" Ultra-Black Roman
+.sty \n[.fp] UBLI \" Ultra-Black Italic
\#
\# ====================================================================
\#
@@ -45,16 +92,21 @@
\#
\# +++ALIASES+++
\#
-.als ALIAS als \"Alias .als as ALIAS
-.als ALIASN aln \"Alias .aln (number registers) as ALIASN
+\# Alias .als as ALIAS, and .aln (number registers) as ALIASN
+\#
+.als ALIAS als
+.als ALIASN aln
+\#
+\#
+\# ALIASES FOR GROFF REQUESTS
+\# --------------------------
\#
.ALIAS MAC de
.ALIAS BR br
-.ALIAS SPACE sp
.ALIAS SP sp
.ALIAS PAGELENGTH pl
-.ALIAS NEWPAGE bp
.ALIAS SPREAD brp
+.ALIAS ESC_CHAR ec
.ALIAS STRING ds
\#
\# ALIASES FOR NUMBER REGISTERS
@@ -73,44 +125,37 @@
\#
\# MISCELLANEOUS
\# =============
-.cflags 4 /\(en
+.nr #L_MARGIN \n(.o \" Tabs, etc require #L_MARGIN
+.cflags 4 /\(en \" So slash and en-dashes get broken
+.warn 8192
+\#
+.ig
+About the warn level
+--------------------
+
+There's a lot of testing for the presence of number registers and
+strings in this macro file. Many of the registers and strings
+pop into and out of existence on the fly. For convenience, I
+often use
+
+ .if \\n[whatever] and .if !\\n[whatever]
+
+to test "if the register exists and is (not) empty." Groff,
+encountering such tests when called with the -ww options, emits
+
+ warning: number register whatever not defined.
+
+Groff also warns about strings similarly tested for.
+
+The warn level, above, is high in order to shut off those
+warnings. If you're futzing in this file and need more verbose
+warnings, either comment out ".warn 8192" or set the warnlevel
+to the one you need (but be ready for lots of what I've just
+described).
+..
\#
\# ====================================================================
\#
-\# END MACRO FOR LETTERS
-\# ---------------------
-\# *Arguments:
-\# none
-\# *Function:
-\# The .em macro executed at the end of letters. Turns footers and
-\# pagination off, terminates and outputs diversion CLOSING, indented with
-\# the author's name underneath.
-\#
-.MAC ALL_DONE END
-. br
-. FOOTERS OFF
-. PAGINATION OFF
-. if \\n[#DOC_TYPE]=4 \{\
-. br
-. if !'\\n(.z'' \{ .di \}
-. IQ CLEAR
-. TQ
-. TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
-. ALD \\n[#DOC_LEAD]u*2u
-. TAB 1
-. if \\n[#CLOSING] \{\
-. nf
-. CLOSING
-. \}
-. ALD \\n[#DOC_LEAD]u*3u
-. PRINT \\*[$AUTHOR_1]
-. \}
-.DO_FOOTER
-.END
-\#
-\#
-\# =====================================================================
-\#
\# +++PAGE LAYOUT+++
\#
\# Macros that control the physical layout of the page: paper size
@@ -119,7 +164,7 @@
\# PAGE WIDTH
\# ----------
\# *Argument:
-\# <width of printer sheet (ipPc)>
+\# <width of printer sheet>
\# *Function:
\# Stores user supplied page width in register #PAGE_WIDTH.
\# *Notes:
@@ -137,7 +182,7 @@
\# L_MARGIN
\# --------
\# *Argument:
-\# <offset from page left (ipPc)>
+\# <offset from page left>
\# *Function:
\# Stores user supplied page offset in register #L_MARGIN.
\# Sets .po to user supplied offset.
@@ -154,7 +199,7 @@
\# R_MARGIN
\# --------
\# *Argument:
-\# <width of right margin (ipPc)>
+\# <width of right margin>
\# *Function:
\# Stores user supplied right margin in register #R_MARGIN.
\# *Notes:
@@ -178,7 +223,7 @@
\# T_MARGIN
\# --------
\# *Argument:
-\# <distance to advance from top of page (ipPcv)>
+\# <distance to advance from top of page>
\# *Function:
\# Stores the user supplied top margin in register #T_MARGIN.
\# Advances user supplied depth from the top of the page.
@@ -186,11 +231,9 @@
\# Requires unit of measure.
\#
.MAC T_MARGIN END
-. br
. nr #T_MARGIN (\\$1)
-. nr #T_MARGIN_SET 1
+. nr #TOP 1
. if !\\n[#DOCS] \{\
-. PRINT \&
. sp |\\n[#T_MARGIN]u-1v
. \}
. wh 0i DO_T_MARGIN
@@ -200,7 +243,7 @@
\# B_MARGIN
\# --------
\# *Argument:
-\# <space to leave at the bottom of the page (ipPcv)>
+\# <space to leave at the bottom of the page>
\# *Function:
\# Stores the user supplied bottom margin in register #B_MARGIN.
\# *Notes:
@@ -209,6 +252,8 @@
.MAC B_MARGIN END
. br
. nr #B_MARGIN (\\$1)
+. nr #ORIGINAL_B_MARGIN \\n[#B_MARGIN]
+. nr #B_MARGIN_SET 1
. wh -\\n[#B_MARGIN]u DO_B_MARGIN
.END
\#
@@ -229,14 +274,14 @@
\#
.MAC PAGE END
. br
-. PAGEWIDTH \\$1
-. PAGELENGTH \\$2
-. ie '\\$3'' \{ .L_MARGIN \\n(.o \}
-. el \{ .L_MARGIN \\$3 \}
-. ie '\\$4'' \{ .R_MARGIN 1i \}
-. el \{ .R_MARGIN \\$4 \}
-. if !'\\$5'' \{ .T_MARGIN \\$5 \}
-. if !'\\$6'' \{ .B_MARGIN \\$6 \}
+. PAGEWIDTH \\$1
+. PAGELENGTH \\$2
+. ie '\\$3'' \{ .L_MARGIN \\n(.o \}
+. el \{ .L_MARGIN \\$3 \}
+. ie '\\$4'' \{ .R_MARGIN 1i \}
+. el \{ .R_MARGIN \\$4 \}
+. if !'\\$5'' \{ .T_MARGIN \\$5 \}
+. if !'\\$6'' \{ .B_MARGIN \\$6 \}
.END
\#
\# =====================================================================
@@ -250,14 +295,16 @@
\# *Argument:
\# <none>
\# *Function:
-\# Plants the top margin (set in .PAGE) at the top of each page.
+\# Plants the top margin at the top of each page.
\# *Notes:
-\# The trap is set in .PAGE
+\# The trap is set in .T_MARGIN or .PAGE
\#
.MAC DO_T_MARGIN END
-. ev 1
+. ev T_MARGIN
+. nr #TOP 1
. sp |\\n[#T_MARGIN]u-1v
. ev
+. sp -\\n[#T_MARGIN_LEAD_ADJ]u
.END
\#
\#
@@ -266,14 +313,52 @@
\# *Argument:
\# <none>
\# *Function:
-\# Plants the bottom margin (set in .PAGE) at the bottom of each page.
+\# Plants the bottom margin at the bottom of each page.
\# *Notes:
-\# The trap is set in .PAGE.
+\# The trap is set in .B_MARGIN or .PAGE.
\#
.MAC DO_B_MARGIN END
-.ev 1
+. nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000
+. ev B_MARGIN
. bp
-.ev
+. ev
+.END
+\#
+\#
+\# NEWPAGE
+\# -------
+\# *Argument:
+\# <none>
+\# *Function:
+\# Breaks to a new page.
+\# *Notes:
+\# If a B_MARGIN has been set, processes that, otherwise, just
+\# breaks to a new page.
+\#
+.MAC NEWPAGE END
+. br
+. nr #NEWPAGE 1
+. ie \\n[#B_MARGIN_SET]=1 \{\
+. ie !\\n[#DOCS]=1 \{\
+. ev NP
+. bp
+. ev
+. \}
+. el \{\
+. if \\n[#COLUMNS]=1 \{ .nr #COL_NUM \\n[#NUM_COLS] \}
+. ie !\\n[#FN_DEPTH] \{\
+. ch FN_OVERFLOW_TRAP
+. DO_B_MARGIN
+. wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
+. \}
+. el \{\
+. DO_B_MARGIN
+. \}
+. \}
+. \}
+. el \{\
+. DO_B_MARGIN
+. \}
.END
\#
\# =====================================================================
@@ -287,7 +372,7 @@
\# LINE LENGTH
\# -----------
\# *Argument:
-\# <line length (iPpc)>
+\# <line length>
\# *Function:
\# Stores user supplied line length in register #L_LENGTH.
\# Sets .ll to #L_LENGTHu
@@ -295,13 +380,53 @@
\# Requires unit of measure.
\#
.MAC LL END
-. nr #L_LENGTH (\\$1)
. nr #USER_SET_L_LENGTH 1
-. ll \\n[#L_LENGTH]u
+. ll \\$1
+. nr #L_LENGTH \\n(.l
. ta \\n(.lu
.END
\#
\#
+\# +++FAMILY AND FONT+++
+\#
+\# FALLBACK FONT
+\# -------------
+\# *Argument:
+\# <fallback font> [ ABORT | WARN ] | ABORT | WARN
+\# *Function:
+\# Sets register #ABORT_FT_ERRORS to 1, or defines a fallback font
+\# called "dummy" at font position 0.
+\# *Notes:
+\# Calls to non-existent families cause mom to continue processing
+\# files using the fallback font until a valid family is entered.
+\#
+\# Calls to non-existent fonts generate warnings. If ABORT is passed
+\# to FALLBACK_FONT, mom stops processing files after the warning.
+\# Otherwise, she continues to process files using the fallback font
+\# after the warning is issued. The default fallback font is CR; the
+\# default for font warnings is to abort.
+\#
+.MAC FALLBACK_FONT END
+. if \\n[#NUM_ARGS]=1 \{\
+. if '\\$1'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
+. if '\\$1'WARN' \{\
+. if r#ABORT_FT_ERRORS \{ .nr #ABORT_FT_ERRORS 0 \}
+. \}
+. if !'\\$1'ABORT' \{\
+. if !'\\$1'WARN' \{\
+. fp 0 dummy \\$1
+. \}
+. \}
+. \}
+. if \\n[#NUM_ARGS]=2 \{\
+. fp 0 dummy \\$1
+. if '\\$2'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
+. if '\\$2'WARN' \{ .nr #ABORT_FT_ERRORS 0 \}
+. \}
+.END
+\#
+.FALLBACK_FONT CR ABORT
+\#
\# FAMILY
\# ------
\# *Argument:
@@ -311,17 +436,36 @@
\# to $FAMILY.
\#
.MAC FAMILY END
-. if \\n[#PRINT_STYLE]=1 \{ .return \}
-. if \\n[#IGNORE] \{ .return \}
+. if \\n[#PRINT_STYLE]=1 \{\
+. fam C
+. return
+. \}
+. if \\n[#IGNORE] \{\
+. fam C
+. return
+. \}
+. if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
+. ds $SAVED_STYLE \\n[.sty]
+. \}
. ds $FAMILY \\$1
+. ft 0
. fam \\*[$FAMILY]
+. if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
+. ft \\*[$SAVED_STYLE]
+. if !F\\n[.fn] \{\
+. ft 0
+. \}
+. \}
+. if \\n[#COLLATE]=1 \{\
+. if !r#START \{ .DOC_FAM \\*[$FAMILY] \}
+. \}
.END
\#
\#
\# FONT
\# ----
\# *Argument:
-\# R | I | B | BI
+\# R | I | B | BI | <other style extension>
\# *Function:
\# Stores user supplied font in $FONT and sets .ft to $FONT.
\#
@@ -342,7 +486,29 @@
. return
. \}
. ds $FONT \\$1
+. ft 0
. ft \\*[$FONT]
+. if if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
+. if '\\n[.sty]'' \{\
+. if !F\\n[.fn] \{\
+. if !S\\*[$FONT] \{\
+. tm1 "[mom]: Font style "\\*[$FONT]" at line \\n(.c has not been registered.
+. ie \\n[#ABORT_FT_ERRORS]=0 \{\
+. tm1 " Continuing to process using fallback font.
+. \}
+. el .ab Aborting.
+. \}
+. if \\n[.f]=0 \{\
+. tm1 "[mom]: Either font style "\\*[$FONT]" at line \\n(.c does not exist in family "\\n[.fam]",
+. tm1 " or family "\\n[.fam]" has not been installed in font/devps.
+. ie \\n[#ABORT_FT_ERRORS]=0 \{\
+. tm1 " Continuing to process using fallback font.
+. \}
+. el .ab Aborting.
+. \}
+. \}
+. \}
+. \}
.END
\#
\#
@@ -369,31 +535,55 @@
.END
\#
\#
+\# SIZE (inline)
+\# -------------
+\# *Arguments:
+\# <point size of type>
+\# *Function:
+\# Sets point size to user supplied value in scaled points.
+\# Intended to be called inline with \*[SIZE <n><unit>]
+\# *Notes:
+\# Can be used with a unit of measure or not.
+\#
+.MAC SIZE END
+\c
+.ps \\$1
+.END
+\#
+\#
\# LEADING
\# -------
\# *Argument:
\# <leading between lines of text>
\# *Function:
-\# Turns off #AUTO_LEAD if it's on.
+\# Turns off #AUTOLEAD if it's on.
\# Sets .vs to user supplied value.
\# *Notes:
-\# Does not require unit of measure. LEAD automatically turns off AUTOLEAD.
+\# Does not require unit of measure. LS automatically turns off AUTOLEAD.
\#
.MAC LS END
+. br
+. nr #OLD_LEAD \\n(.v
. if \\n[#PRINT_STYLE]=1 \{ .return \}
. if \\n[#IGNORE] \{ .return \}
-. nr #LEAD_SET 1
. if \\n[#AUTO_LEAD] \{\
. rr #AUTO_LEAD
. rr #AUTOLEAD_FACTOR
. \}
. vs \\$1
-. if \\n[#T_MARGIN_SET]=1 \{\
-. sp |\\n[#T_MARGIN]u-1v
-. rr #T_MARGIN_SET
+. if \\n[#TOP] \{\
+. nr #TOP_BASELINE_ADJ \\n(.v-\\n[#OLD_LEAD]
+. sp -\\n[#TOP_BASELINE_ADJ]u
+. rr #TOP
+. rr #TOP_BASELINE_ADJ
. \}
.END
\#
+.MAC RESET_LEAD END
+' vs
+. ch RESET_LEAD
+.END
+\#
\#
\# AUTOLEAD
\# --------
@@ -409,13 +599,11 @@
\# multiplied by #AUTOLEAD_VALUE instead of the two being added
\# together.
\#
-\# When AUTOLEAD is turned off, the leading reverts to the leading value
-\# in effect prior to invoking AUTOLEAD.
-\#
.MAC AUTOLEAD END
. if \\n[#PRINT_STYLE]=1 \{ .return \}
. if \\n[#IGNORE] \{ .return \}
. nr #AUTO_LEAD 1
+. nr #OLD_LEAD \\n(.v
. nr #AUTOLEAD_VALUE (p;\\$1)
. ie \\n[#NUM_ARGS]=2 \{\
. if '\\$2'FACTOR' \{\
@@ -426,9 +614,11 @@
. el \{\
. vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u
. \}
-. if \\n[#T_MARGIN_SET] \{\
-. sp |\\n[#T_MARGIN]u-1v
-. rr #T_MARGIN_SET
+. if \\n[#TOP] \{\
+. nr #TOP_BASELINE_ADJ \\n(.v-\\n[#OLD_LEAD]
+. sp -\\n[#TOP_BASELINE_ADJ]u
+. rr #TOP
+. rr #TOP_BASELINE_ADJ
. \}
.END
\#
@@ -442,7 +632,6 @@
.ds PREV \EfP
.ds S \Es
\#
-\#
\# =====================================================================
\#
\# +++KERNING+++
@@ -460,129 +649,71 @@
. nr #KERN 1
. \}
. el \{\
-. kern 0
-. nr #KERN 0
-. \}
-.END
+. kern 0
+. nr #KERN 0
+. \}
+.END
+\#
+\#
+.ig
+INLINE KERNING AND HORIZONTAL MOVEMENT
+--------------------------------------
+Kerning
+
+Inline kerning provides a simple method for users to adjust the
+amount of space between any two letters. It's predicated on a
+unit of measure "U", which is 1/36 of the current point size as
+returned by \n[.ps]. E.g., if the current point size is 18,
+\n[.ps] returns 18000u, therefore U=500u. Since U remains
+proportional relative to the current point size, the amount
+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<n>] or
+\*[FU<n>] 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 called with inline escapes, nor thence to evaluate conditional
+expressions. Consequently, each pseudo-escape \[BU<n>] had to be defined
+separately with ".char".
+
+As of v. 1.18, one can pass arguments to inline strings/macros,
+hence it is now possible to do \*[BU n] where n, inline, is the desired
+number of kern units. The original .char definitions have been left in
+for backward compatibility with documents created prior to mom-1.1.3c.
+..
\#
+.nr #KERN_UNIT 36
+.ds BU \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
+.ds FU \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
\#
-\# INLINE KERNING AND HORIZONTAL MOVEMENT
-\# --------------------------------------
-\# *Kerning
-\# Inline kerning provides a simple method for users to adjust the
-\# amount of space between any two letters. It's predicated on a
-\# unit of measure "U", which is 1/36 of the current point size as
-\# returned by \n[.ps]. E.g., if the current point size is 18,
-\# \n[.ps] returns 18000u, therefore U=500u. Since U remains
-\# proportional relative to the current point size, the amount
-\# of kerning between two letters as expressed in Us remains
-\# visually similar regardless of changes in point size.
+\# Initialize strings for pre-1.1.3c-style BU and FU
\#
-\# 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.
+.nr #LOOP 0 1
+.while \n+[#LOOP]<37 \{\
+. ds BU\n[#LOOP] \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
+.\}
\#
-\# 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
-\# separately with ".char".
+.nr #LOOP 0 1
+.while \n+[#LOOP]<37 \{\
+. ds FU\n[#LOOP] \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
+.\}
+.rr #LOOP
\#
-\# As of v. 1.18, one can pass arguments to inline strings/macros,
-\# hence it is now possible to do \*[BU #] where #, inline, is the desired
-\# number of kern units. The original .char definitions have been left in
-\# for backward compatibility with documents created prior to mom-1.1.3c.
+.ig
+Horizontal movements
+
+BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
+specified number of points.
+Left in for backward compatibility with mom-1.1.3c, the
+preferred methods for inline horizontal movements are now
+\*[BCK <n><unit>] and \*[FWD <n><unit>].
+..
\#
-\#
-.nr #KERN_UNIT 36
-.ds BU \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
-.ds FU \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
-\#
-.ds BU1 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
-.ds BU2 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
-.ds BU3 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
-.ds BU4 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
-.ds BU5 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
-.ds BU6 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
-.ds BU7 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
-.ds BU8 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
-.ds BU9 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
-.ds BU10 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
-.ds BU11 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
-.ds BU12 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
-.ds BU13 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
-.ds BU14 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
-.ds BU15 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
-.ds BU16 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
-.ds BU17 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
-.ds BU18 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
-.ds BU19 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
-.ds BU20 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
-.ds BU21 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
-.ds BU22 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
-.ds BU23 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
-.ds BU24 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
-.ds BU25 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
-.ds BU26 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
-.ds BU27 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
-.ds BU28 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
-.ds BU29 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
-.ds BU30 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
-.ds BU31 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
-.ds BU32 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
-.ds BU33 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
-.ds BU34 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
-.ds BU35 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
-.ds BU36 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
-\#
-\#
-.ds FU1 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
-.ds FU2 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
-.ds FU3 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
-.ds FU4 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
-.ds FU5 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
-.ds FU6 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
-.ds FU7 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
-.ds FU8 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
-.ds FU9 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
-.ds FU10 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
-.ds FU11 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
-.ds FU12 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
-.ds FU13 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
-.ds FU14 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
-.ds FU15 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
-.ds FU16 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
-.ds FU17 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
-.ds FU18 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
-.ds FU19 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
-.ds FU20 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
-.ds FU21 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
-.ds FU22 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
-.ds FU23 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
-.ds FU24 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
-.ds FU25 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
-.ds FU26 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
-.ds FU27 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
-.ds FU28 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
-.ds FU29 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
-.ds FU30 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
-.ds FU31 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
-.ds FU32 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
-.ds FU33 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
-.ds FU34 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
-.ds FU35 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
-.ds FU36 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
-\#
-\#
-\# *Horizontal movements
-\# BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
-\# specified number of points.
-\# Left in for backward compatibility with mom-1.1.3c, the preferred
-\# methods for inline horizontal movements are now \*[BCK #<unit>] and
-\# \*[FWD #<unit>].
-\#
-.ds BCK \h'-\\$1\\$2'
-.ds FWD \h'\\$1\\$2'
+.ds BCK \h'-\\$1'
+.ds FWD \h'\\$1'
\#
.ds BP.25 \h'-.25'
.ds BP.5 \h'-.5'
@@ -691,10 +822,13 @@
\#
\# WHOLE LINE KERNING (RW and EW)
\# -----------------------------
-\# The line kerning macros are special instances of track kerning,
-\# used where a complete line needs to be tightened (or relaxed) in
-\# order to accomodate or remove one or two more characters
-\# than the default justification permits.
+\#
+.ig
+The line kerning macros are special instances of track kerning,
+used where a complete line needs to be tightened (or relaxed) in
+order to accomodate or remove one or two more characters
+than the default justification permits.
+..
\#
\# *Argument:
\# <amount of overall "kerning" (letter spacing) to apply to the line>
@@ -708,38 +842,40 @@
\# *Notes:
\# Decimal values are acceptable.
\#
-\# The groff documentation is a tad confusing about what unit of
-\# measure is used in track kerning, only that the width of each
-\# character is increased or decreased by the amount(s) passed as
-\# arguments to .tkf, and something about linear function of point
-\# size. In fact, with the way I've put this macro together, it
-\# doesn't matter. All the user needs to know is that a value
-\# of one will produce an unacceptably tight or loose line at most
-\# text point sizes; therefore, effective use of RW and EW is in
-\# the fractional range below 1 (e.g. .25, .5). Given that RW
-\# and EW are for massaging type, a certain amount of
-\# experimentation and previewing is expected and necessary.
-\#
-\# \n(.f holds the current font number, which is acceptable to .tkf.
-\#
-\# RW and EW must be reset to 0 to cancel their effect on
-\# subsequent output lines.
+.ig
+The groff documentation is a tad confusing about what unit of
+measure is used in track kerning, only that the width of each
+character is increased or decreased by the amount(s) passed as
+arguments to .tkf, and something about linear function of point
+size. In fact, with the way I've put this macro together, it
+doesn't matter. All the user needs to know is that a value of
+one will produce an unacceptably tight or loose line at most text
+point sizes; therefore, effective use of RW and EW is in the
+fractional range below 1 (e.g. .25, .5). Given that RW and EW
+are for massaging type, a certain amount of experimentation and
+previewing is expected and necessary.
+
+\n(.f holds the current font number, which is acceptable to .tkf.
+
+RW and EW must be reset to 0 to cancel their effect on subsequent
+output lines.
+..
\#
.MAC RW END
-. if \\n[#BR_AT_LINE_KERN] \{ .br \}
-. tkf 1 1 -\\$1 1 -\\$1
-. tkf 2 1 -\\$1 1 -\\$1
-. tkf 3 1 -\\$1 1 -\\$1
-. tkf 4 1 -\\$1 1 -\\$1
+. if \\n[#BR_AT_LINE_KERN] \{\
+. ie \\n[#JUSTIFY]=1 \{ .brp \}
+. el \{ .br \}
+. \}
+. tkf \\n(.f 1 -\\$1 1 -\\$1
.END
\#
\#
.MAC EW END
-. if \\n[#BR_AT_LINE_KERN] \{ .br \}
-. tkf 1 1 \\$1 1 \\$1
-. tkf 2 1 \\$1 1 \\$1
-. tkf 3 1 \\$1 1 \\$1
-. tkf 4 1 \\$1 1 \\$1
+. if \\n[#BR_AT_LINE_KERN] \{\
+. ie \\n[#JUSTIFY]=1 \{ .brp \}
+. el \{ .br \}
+. \}
+. tkf \\n(.f 1 \\$1 1 \\$1
.END
\#
\#
@@ -768,24 +904,24 @@
\# *Arguments:
\# <none> | <anything> | DEFAULT
\# or
-\# LINES <#> | MARGIN <#> | SPACE <#>
+\# LINES <n> | MARGIN <n> | SPACE <n>
\# *Function:
\# Turns auto hyphenation on or off, resets the hyphenation style
\# to default, or permits the setting of various hyphenation
\# parameters.
\# *Notes:
-\# HY ON defaults to .hy 14, i.e. no hyphens after the
-\# first two or before the last two characters of a word, and
-\# no hyphenation of the last line prior to a trap (e.g.,
-\# at the bottom of a page).
+\# HY, by itself, defaults to .hy 14, i.e. no hyphens after the
+\# first two or before the last two characters of a word, and no
+\# hyphenation of the last line prior to a trap (e.g., at the
+\# bottom of a page).
\#
\# HY DEFAULT resets the hyphenation style to .hy 14 (see
\# above) if that behaviour is desired after changes have been
\# made to LINES, MARGIN, or SPACE.
\#
-\# HY LINES <#> sets the number of allowable consecutive hyphenated lines.
+\# HY LINES <n> sets the number of allowable consecutive hyphenated lines.
\#
-\# HY MARGIN <#> sets the amount of space (ipPcm) allowed at the end
+\# HY MARGIN <n> sets the amount of space (ipPcm) allowed at the end
\# of a line in QUAD mode before hyphenation is tripped (e.g. if there's
\# only 6 points left, groff won't try to hyphenate the next word).
\#
@@ -852,11 +988,25 @@
\# Creates or modifies register #ALD. Adds user supplied lead
\# below current baseline.
\# *Notes:
-\# Requires unit of measure ipPcmv.
+\# Requires a unit of measure.
\#
.MAC ALD END
-. nr #ALD (\\$1)
-. sp \\n[#ALD]u
+. if \\n(nl=0 \{ .nr #TOP 1 \}
+. if '\\$0'ALD' \{\
+. nr #ALD (\\$1)
+. sp \\n[#ALD]u
+. \}
+. if '\\$0'ADD_SPACE' \{\
+. nr #ALD (\\$1)
+. rs
+. sp \\n[#ALD]u
+. \}
+. if '\\$0'SPACE' \{\
+. sp \\$1u
+. \}
+. if '\\$0'SP' \{\
+. sp \\$1u
+. \}
.END
\#
\#
@@ -868,7 +1018,7 @@
\# Creates or modifies register #RLD. Reverses user supplied
\# lead above current baseline.
\# *Notes:
-\# Requires unit of measure ipPcmv.
+\# Requires a unit of measure.
\#
.MAC RLD END
. nr #RLD (\\$1)
@@ -877,13 +1027,16 @@
\#
\# ALD/RLD STRINGS
\# ---------------
-\# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding \*[RLD]
-\# forms have been left in for backward compatibility with documents
-\# created using mom-1.1.3c or earlier. The prefered methods of advancing
-\# and reversing on the page inline are \*[UP #<unit>] and \*[DOWN #<unit>].
+.ig
+The strings \*[ALD.25]...\*[ALD12.75] and their corresponding
+\*[RLD] forms have been left in for backward compatibility with
+documents created using mom-1.1.3c or earlier. The prefered methods
+of advancing and reversing on the page inline are \*[UP <n><unit>]
+and \*[DOWN <n><unit>].
+..
\#
-.ds DOWN \v'\\$1\\$2'
-.ds UP \v'-\\$1\\$2'
+.ds DOWN \v'\\$1'
+.ds UP \v'-\\$1'
\#
.ds ALD.25 \v'.25p'
.ds ALD.5 \v'.5p'
@@ -1003,7 +1156,7 @@
\# Ligatures may be supplied manually with \(fi, \(fl, etc.
\#
.MAC LIGATURES END
-. ie '\\$1'' \{\
+. ie '\\$1'' \{\
. lg
. nr #LIGATURES 1
. \}
@@ -1017,32 +1170,101 @@
\# SMARTQUOTES
\# -----------
\# *Arguments:
-\# <none> | <anything>
+\# [ ,, ] | [ << ] | [ >> ] | <anything>
+\# or
+\# [ DA | DE | ES | FR | IT | NL | NO | PT | SV ] | <anything>
\# *Function:
-\# Turns smartquotes on or off.
+\# Turns smartquotes on (optionally with a quoting style from the
+\# argument list, 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<n>) are then
+\# defined in the macro.
+\#
+\# (Note to myself: 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 '\\$1'DA' \{\
+. nr #ARGS_TO_SQ 1
+. ds $QUOTE0 \\[Fc]
+. ds $QUOTE1 \\[Fo]
+. \}
+. if '\\$1'DE' \{\
+. nr #ARGS_TO_SQ 1
+. ds $QUOTE0 \\[Bq]
+. ds $QUOTE1 \\[lq]
+. \}
+. if '\\$1'ES' \{\
+. nr #ARGS_TO_SQ 1
+. ds $QUOTE0 \\[lq]
+. ds $QUOTE1 \\[rq]
+. \}
+. if '\\$1'FR' \{\
+. nr #ARGS_TO_SQ 1
+. ds $QUOTE0 \\[Fo]\\|
+. ds $QUOTE1 \\|\\[Fc]
+. \}
+. if '\\$1'IT' \{\
+. nr #ARGS_TO_SQ 1
+. ds $QUOTE0 \\[Fo]\\|
+. ds $QUOTE1 \\|\\[Fc]
+. \}
+. if '\\$1'NL' \{\
+. nr #ARGS_TO_SQ 1
+. ds $QUOTE0 \\[rq]
+. ds $QUOTE1 \\[rq]
+. \}
+. if '\\$1'NO' \{\
+. nr #ARGS_TO_SQ 1
+. ds $QUOTE0 \\[Fo]
+. ds $QUOTE1 \\[Fc]
+. \}
+. if '\\$1'PT' \{\
+. nr #ARGS_TO_SQ 1
+. ds $QUOTE0 \\[Fo]
+. ds $QUOTE1 \\[Fc]
+. \}
+. if '\\$1'SV' \{\
+. nr #ARGS_TO_SQ 1
+. ds $QUOTE0 \\[Fc]
+. ds $QUOTE1 \\[Fc]
+. \}
+. 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
\#
@@ -1058,18 +1280,26 @@
\# Breaks a line without advancing.
\# *Notes:
\# EL is the mnemonic used on older, dedicated typesetting machines
-\# to indicate "process the line, then return to the left margin
-\# without advancing the galley medium." It stands for End Line.
+\# to indicate "process the line, without advancing the galley
+\# medium." It stands for End Line.
\#
-\# Sadly, EL is only a fake. It will work in all instances EXCEPT
-\# when the line to be EL'd is the last line before a footer trap.
-\# Use TRAP OFF/TRAP to circumvent this.
+\# The \c inline must be appended to the end of input lines when in
+\# nofill mode; in fill modes, the \c inline must not be used.
\#
.MAC EL END
+. TRAP OFF
+. if \\n[#PSEUDO_FILL]=1 \&
. br
. sp -1v
+. TRAP
.END
\#
+\# An inline escape to accomplish the same thing. Actually
+\# preferable, since it works with filled and non-filled copy and
+\# doesn't require the user to remember to use (or not use) the \c.
+\#
+.ds B \h'|0'\c
+\#
\# =====================================================================
\#
\# +++FILLING/QUADDING/JUSTIFYING+++
@@ -1079,9 +1309,9 @@
\# *Argument:
\# <none>
\# *Function:
-\# Turns fill on and sets .ad to b.
+\# Turns fill on and sets .ad to b.
\# *Notes:
-\# Justifies text left and right.
+\# Justifies text left and right.
\#
.MAC JUSTIFY END
. if \\n[#TAB_ACTIVE]=0 \{\
@@ -1091,7 +1321,7 @@
' ce 0
. QUAD J
. if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
-. nr #FILL 0
+. nr #PSEUDO_FILL 0
.END
\#
\#
@@ -1116,28 +1346,58 @@
. \}
' ce 0
' fi
-. if '\\*[$QUAD_VALUE]'L' \{ .ad l \}
-. if '\\*[$QUAD_VALUE]'LEFT' \{ .ad l \}
-. if '\\*[$QUAD_VALUE]'R' \{ .ad r \}
-. if '\\*[$QUAD_VALUE]'RIGHT' \{ .ad r \}
-. if '\\*[$QUAD_VALUE]'C' \{ .ad c \}
-. if '\\*[$QUAD_VALUE]'CENTER' \{ .ad c \}
-. if '\\*[$QUAD_VALUE]'CENTRE' \{ .ad c \}
-. if '\\*[$QUAD_VALUE]'J' \{ .ad b \}
-. if '\\*[$QUAD_VALUE]'JUSTIFY' \{ .ad b \}
-. nr #FILL 0
+. if '\\*[$QUAD_VALUE]'L' \{\
+. nr #JUSTIFY 0
+. ad l
+. \}
+. if '\\*[$QUAD_VALUE]'LEFT' \{\
+. nr #JUSTIFY 0
+. ad l
+. \}
+. if '\\*[$QUAD_VALUE]'R' \{\
+. nr #JUSTIFY 0
+. ad r
+. \}
+. if '\\*[$QUAD_VALUE]'RIGHT' \{\
+. nr #JUSTIFY 0
+. ad r
+. \}
+. if '\\*[$QUAD_VALUE]'C' \{\
+. nr #JUSTIFY 0
+. ad c
+. \}
+. if '\\*[$QUAD_VALUE]'CENTER' \{\
+. nr #JUSTIFY 0
+. ad c
+. \}
+. if '\\*[$QUAD_VALUE]'CENTRE' \{\
+. nr #JUSTIFY 0
+. ad c
+. \}
+. if '\\*[$QUAD_VALUE]'J' \{\
+. nr #JUSTIFY 1
+. ad b
+. \}
+. if '\\*[$QUAD_VALUE]'JUSTIFY' \{\
+. nr #JUSTIFY 1
+. ad b
+. \}
+. nr #PSEUDO_FILL 0
.END
\#
\#
\# LEFT, RIGHT, AND CENTER
\# -----------------------
-\# The purpose of these macros is to allow the user to enter lines
-\# of text that will be quadded LRC *without* the user having to
-\# enter .BR or .br between lines. For the sake of consistency,
-\# all three appear to behave similarly (from the point of view of the user),
-\# although the underlying primitives don't. For this reason, LEFT,
-\# RIGHT, and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY
-\# to restore text to groff fill mode.
+\#
+.ig
+The purpose of these macros is to allow the user to enter lines of
+text that will be quadded LRC *without* the user having to enter .BR
+or .br between lines. For the sake of consistency, all three appear
+to behave similarly (from the point of view of the user), although
+the underlying primitives don't. For this reason, LEFT, RIGHT, and
+CENTER must be followed by .QUAD [L R C J] or .JUSTIFY to restore
+text to groff fill mode.
+..
\#
\# LEFT
\# ----
@@ -1148,7 +1408,7 @@
\# requiring the .BR or .br macro.
\# *Notes:
\# LEFT simply turns fill off. Lines that exceed the current LL will
-\# not be broken, simply continued (indefinitely) until a return is
+\# not be broken, just continued (indefinitely) until a return is
\# encountered. Note that this behaviour differs from the RIGHT and
\# CENTER macros.
\#
@@ -1159,7 +1419,9 @@
. \}
. ce 0
. nf
-. nr #FILL 1
+. nr #PSEUDO_FILL 1
+.\" Fix for a little conflict with DOCTYPE LETTER
+. if '\\n(.z'LETTERHEAD1' \{ .rr #DATE_FIRST \}
.END
\#
\#
@@ -1181,7 +1443,7 @@
. \}
. fi
. rj 100000
-. nr #FILL 1
+. nr #PSEUDO_FILL 1
.END
\#
\#
@@ -1198,86 +1460,70 @@
\#
.MAC CENTER END
. if \\n[#TAB_ACTIVE]=0 \{\
+. rr #QUAD
. ds $RESTORE_QUAD_VALUE CENTER
. \}
. fi
. ce 100000
-. nr #FILL 1
+. nr #PSEUDO_FILL 1
.END
\#
\# =====================================================================
\#
\# +++TABS+++
\#
-\# There are two different kinds of tabs available: typesetting tabs
-\# and string tabs.
-\#
-\# Typesetting tabs are set with TAB_SET, which requires a tab number,
-\# an indent (offset) from the left margin and a length (optionally
-\# with a quad direction and an instruction to fill lines). After tabs
-\# are set with TS, they are called with .TAB <#>, where <#>
-\# corresponds to the number passed to TAB_SET as a valid tab number.
+.ig
+There are two different kinds of tabs available: typesetting tabs
+and string tabs.
+
+Typesetting tabs are set with TAB_SET, which requires a tab number,
+an indent (offset) from the left margin and a length (optionally
+with a quad direction and an instruction to fill lines). After tabs
+are set with TAB_SET, they are called with .TAB n, where "n"
+corresponds to the number passed to TAB_SET as a valid tab number.
+
+String tabs allow the user to mark off tab positions inline. Tab
+indents and lengths are calculated from the beginning and end
+positions of the marks. Up to 19 string tabs may be created,
+numbered 1-19. Once created, they are called with .TAB n,
+just like typesetting tabs.
+
+Setting up string tabs is a two-step procedure. First, the user
+enters an input line in which s/he wants to mark off string tabs.
+The beginning of a tab is marked with \*[STn], where "n" is
+the desired number of the tab. The end of the the tab is marked
+with \*[STnX]. All ST's must have a matching STX. String tabs
+may be nested.
+
+Next, the user invokes .ST n for every string tab defined, and
+optionally passes quad information to it. That done, string tabs
+can be called just like typesetting tabs.
+
+String tabs don't preview properly with gxditview. Use gv instead.
+..
\#
-\# String tabs allow the user to mark off tab positions inline. Tab
-\# indents and lengths are calculated from the beginning and end
-\# positions of the marks. Up to 19 string tabs may be created,
-\# numbered 1-19. Once created, they are called with .TAB <#>,
-\# just like typesetting tabs.
+\# Strings for string tab inlines
+\# ------------------------------
\#
-\# Setting up string tabs is a two-step procedure. First, the user
-\# enters an input line in which s/he wants to mark off string tabs.
-\# The beginning of a tab is marked with \*[ST<#>], where <#> is
-\# the desired number of the tab. The end of the the tab is marked
-\# with \*[ST<#>X]. All ST's must have a matching STX. String tabs
-\# may be nested.
+\# Initialize string tab markers numbered 1 to 19.
\#
-\# Next, the user invokes .ST <#> for every string tab defined, and
-\# optionally passes quad information to it. That done, string tabs
-\# can be called just like typesetting tabs.
+.nr #LOOP 0 1
+.while \n+[#LOOP]<20 \{\
+. ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET]
+.\}
\#
-\# String tabs don't preview properly with gxditview. Use gv instead.
+.nr #LOOP 0 1
+.while \n+[#LOOP]<20 \{\
+. ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK]
+.\}
+.rr #LOOP
\#
-\# Strings for string tab inlines
-\# ------------------------------
\#
-.ds ST1 \Ek[#ST1_OFFSET]
-.ds ST2 \Ek[#ST2_OFFSET]
-.ds ST3 \Ek[#ST3_OFFSET]
-.ds ST4 \Ek[#ST4_OFFSET]
-.ds ST5 \Ek[#ST5_OFFSET]
-.ds ST6 \Ek[#ST6_OFFSET]
-.ds ST7 \Ek[#ST7_OFFSET]
-.ds ST8 \Ek[#ST8_OFFSET]
-.ds ST9 \Ek[#ST9_OFFSET]
-.ds ST10 \Ek[#ST10_OFFSET]
-.ds ST11 \Ek[#ST11_OFFSET]
-.ds ST12 \Ek[#ST12_OFFSET]
-.ds ST13 \Ek[#ST13_OFFSET]
-.ds ST14 \Ek[#ST14_OFFSET]
-.ds ST15 \Ek[#ST15_OFFSET]
-.ds ST16 \Ek[#ST16_OFFSET]
-.ds ST17 \Ek[#ST17_OFFSET]
-.ds ST18 \Ek[#ST18_OFFSET]
-.ds ST19 \Ek[#ST19_OFFSET]
-.ds ST1X \Ek[#ST1_MARK]
-.ds ST2X \Ek[#ST2_MARK]
-.ds ST3X \Ek[#ST3_MARK]
-.ds ST4X \Ek[#ST4_MARK]
-.ds ST5X \Ek[#ST5_MARK]
-.ds ST6X \Ek[#ST6_MARK]
-.ds ST7X \Ek[#ST7_MARK]
-.ds ST8X \Ek[#ST8_MARK]
-.ds ST9X \Ek[#ST9_MARK]
-.ds ST10X \Ek[#ST10_MARK]
-.ds ST11X \Ek[#ST11_MARK]
-.ds ST12X \Ek[#ST12_MARK]
-.ds ST13X \Ek[#ST13_MARK]
-.ds ST14X \Ek[#ST14_MARK]
-.ds ST15X \Ek[#ST15_MARK]
-.ds ST16X \Ek[#ST16_MARK]
-.ds ST17X \Ek[#ST17_MARK]
-.ds ST18X \Ek[#ST18_MARK]
-.ds ST19X \Ek[#ST19_MARK]
+\# These are reserved ST numbers for internal use
+.ds ST100 \Ek[#ST100_OFFSET]
+.ds ST100X \Ek[#ST100_MARK]
+.ds ST101 \Ek[#ST101_OFFSET]
+.ds ST101X \Ek[#ST101_MARK]
\#
\#
\# QUAD AND SET STRING TABS
@@ -1288,7 +1534,7 @@
\# Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
\# tab based on the collected information.
\# *Notes:
-\# Like TS, ST invoked without a quad direction will default to LEFT.
+\# Like TAB_SET, ST invoked without a quad direction will default to LEFT.
\# If lines should be filled and quadded, use the optional argument QUAD.
\# N.B. -- indents *must* be turned off before setting string tabs
\# inside .PAD
@@ -1311,13 +1557,13 @@
\# TAB SET
\# -------
\# *Arguments:
-\# <#> ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]]
+\# <n> ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]]
\# *Function:
-\# Creates macros TAB<#> and TAB <#>, where # is any arbitrary number.
-\# TAB# is a typesetting tab (i.e. a tab defined as an indent
+\# Creates macros TABn and TAB n, where "n" is any arbitrary number.
+\# TABn is a typesetting tab (i.e. a tab defined as an indent
\# from the page left offset plus a line length.)
\# *Notes:
-\# <#> = arbitrary digit to identify the tab
+\# n = arbitrary digit to identify the tab
\# indent = indent from left margin; unit of measure required
\# length = length of tab (unit of measure required; can be
\# \w'<string>'u--if more than one word in string, surround
@@ -1331,40 +1577,43 @@
\#
\# N.B. -- indents *must* be turned off before setting tabs
\#
-\# Examples:
-\#
-\# .TAB_SET 1 2P+6p 12P C
-\#
-\# means "create a tab numbered 1 that starts 2 picas and 6 points from
-\# the left margin, is 12 picas long, and centre each input line."
-\#
-\# .TAB_SET 1 2P+6P 12P C QUAD
-\#
-\# means exactly the same thing, except that input lines are joined and
-\# the area delimted by the tab filled with centered text.
-\#
-\# TAB <#> can be called at any time after being set.
-\#
-\# Tabs are NOT columnar in behaviour. If the text inside a
-\# tab runs to several lines, when you call the next tab a break
-\# occurs, meaning that the new tab starts one line below the last
-\# line in the previous tab. For columnar behaviour, you must
-\# use the multi-column macros in addition to tabs.
-\#
-\# If you want tabs to line up bottom-line to bottom-line (most likely
-\# single line tabs), use .TN (provided the tabs are numbered sequentially).
-\# Otherwise, you must use .EL then .TAB # if you want them to align.
-\#
-\# If you want to reset tabs, you must use .TQ before .TAB_SET.
-\#
-\# Note that indents are turned off automatically whenever a new
-\# tab is called with TAB #.
-\#
-\# Tabs themselves are user-invoked using the TAB macro with a numeric
-\# argument, e.g. TAB 1.
-\#
-\# Generally, in order not to get confused, it's a good idea
-\# to make sure all indents are off before setting tabs.
+.ig
+Examples:
+--------
+
+.TAB_SET 1 2P+6p 12P C
+
+means "create a tab numbered 1 that starts 2 picas and 6 points from
+the left margin, is 12 picas long, and centre each input line."
+
+.TAB_SET 1 2P+6P 12P C QUAD
+
+means exactly the same thing, except that input lines are joined and
+the area delimted by the tab filled with centered text.
+
+TAB n can be called at any time after being set.
+
+Tabs are NOT columnar in behaviour. If the text inside a
+tab runs to several lines, when you call the next tab a break
+occurs, meaning that the new tab starts one line below the last
+line in the previous tab. For columnar behaviour, you must
+use the multi-column macros in addition to tabs.
+
+If you want tabs to line up bottom-line to bottom-line (most likely
+single line tabs), use .TN (provided the tabs are numbered sequentially).
+Otherwise, you must use .EL then .TAB <n> if you want them to align.
+
+If you want to reset tabs, you must use .TQ before .TAB_SET.
+
+Note that indents are turned off automatically whenever a new
+tab is called with TAB <n>.
+
+Tabs themselves are user-invoked using the TAB macro with a numeric
+argument, e.g. TAB 1.
+
+Generally, in order not to get confused, it's a good idea
+to make sure all indents are off before setting tabs.
+..
\#
.MAC TAB_SET END
. br
@@ -1373,13 +1622,19 @@
. nr #TAB_OFFSET (\\$2)
. nr #TAB_LENGTH (\\$3)
. MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
-. br
+. if !\\\\n[#TB+]=1 \{ .br \}
+. if \\\\n[#TB+]=1 \{\
+. EL
+. vpt 0
+. rr #TB+
+. \}
. in 0
. nr #TAB_ACTIVE 1
. nr #CURRENT_TAB \\n[#TAB_NUMBER]
-. po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET]u
-. nr #ST_OFFSET \\n[#TAB_OFFSET]
+. ds $CURRENT_TAB \\*[$CURRENT_TAB]
. nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
+. nr #ST_OFFSET \\n[#TAB_OFFSET]
+. po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
. ll \\n[#TAB_LENGTH]u
. ta \En(.lu
. ie '\\$5'QUAD' \{\
@@ -1395,6 +1650,10 @@
. if '\\$4'C' \{ .CENTER \}
. if '\\$4'J' \{ .JUSTIFY \}
. \}
+. if \\\\n[#TN]=1 \{\
+. TRAP
+. rr #TN
+. \}
.DONE
. rr #TAB_ACTIVE
.END
@@ -1411,7 +1670,6 @@
. ds $TAB_NUMBER \\$1
. TAB\\*[$TAB_NUMBER]
. nr #IN_TAB 1
-. po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET\\*[$TAB_NUMBER]]u
.END
\#
\#
@@ -1420,19 +1678,26 @@
\# *Argument:
\# <none>
\# *Function:
-\# Automagically moves to TAB#+1 on the same line as the last
+\# Automagically moves to TAB<n+1> on the same line as the last
\# line of the previous tab.
\# *Notes:
-\# If the tabs being aligned fall too close to the footer
-\# trap, the line entered after .TN will appear on the next page.
+\# The \c inline must be appended to the end of input lines when in
+\# nofill mode; in fill modes, the \c inline must not be used.
\#
.MAC TN END
-. br
+. nr #TN 1
+. TRAP OFF
+. sp -1v
. nr #NEXT_TAB \\n[#CURRENT_TAB]+1
. TAB\\n[#NEXT_TAB]
-. sp -1v
+. TRAP
.END
\#
+\# An inline escape to accomplish the same thing. Actually
+\# preferable, since it works with filled and non-filled copy and
+\# doesn't require the user to remember to use (or not use) the \c.
+\#
+.ds TB+ "\c\\R'#TB+ 1'\\R'#TN 1'\\R'#NEXT_TAB \\n[#CURRENT_TAB]+1'\\*[TAB\\n[#NEXT_TAB]]\c
\#
\# TAB QUIT
\# --------
@@ -1470,6 +1735,84 @@
. \}
.END
\#
+\# ====================================================================
+\#
+\# COLOR HANDLING
+\# ==============
+\#
+\# COLOR
+\# -----
+\# *Arguments:
+\# <pre-defined NEWCOLOR or XCOLOR>
+\# *Function:
+\# Allows the inline escape for setting color to be called
+\# as a macro.
+\#
+.MAC COLOR END
+.ie \\n(.u=1 \{\
+\c
+\\*[\\$1]\c
+.\}
+.el \{ \\*[\\$1] \}
+.END
+\#
+\#
+\# NEWCOLOR
+\# --------
+\# *Arguments:
+\# <color name> [<color scheme>] <color definition>
+\# *Function:
+\# Based on .defcolor, allows users to name and define colors using
+\# one of the four color schemes rgb, cmy, cmyk and grey. The new
+\# color is then defined as a string so that it can be called inline
+\# with \*[COLORNAME] or with .COLOR.
+\# *Notes:
+\# With only two args, the default color scheme is rgb.
+\#
+\# It is highly recommended that users define new colors as
+\# all-cap strings, to differentiate them from x colors, which must
+\# be in lower case.
+\#
+.MAC NEWCOLOR END
+. if \\n[#NUM_ARGS]=2 \{\
+. defcolor \\$1 rgb \\$2
+. \}
+. if \\n[#NUM_ARGS]=3 \{\
+. if '\\$2'RGB' .ds $COLOR_SCHEME rgb
+. if '\\$2'CYM' .ds $COLOR_SCHEME cym
+. if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk
+. if '\\$2'GRAY' .ds $COLOR_SCHEME gray
+. if '\\$2'GREY' .ds $COLOR_SCHEME gray
+. defcolor \\$1 \\*[$COLOR_SCHEME] \\$3
+. \}
+. ds \\$1 \\m[\\$1]
+.END
+\#
+\#
+\# XCOLOR
+\# ------
+\# *Arguments:
+\# <x color name> [<alias>]
+\# *Function:
+\# Defines a string of x color name (i.e. a predefined x
+\# color). If <alias> is given, creates a string of <alias name>
+\# that references the x color name of the first argument.
+\# *Notes:
+\# The color name must be a legal color name from rgb.txt, and
+\# must be given entirely in lower case, all one word.
+\#
+.MAC XCOLOR END
+. ds \\$1 \m[\\$1]
+. if \\n[#NUM_ARGS]=2 .ds \\$2 \m[\\$1]
+.END
+\#
+\# Pre-define xcolors black and white
+\#
+.ds black \m[black]
+.ds BLACK \m[black]
+.ds white \m[white]
+.ds WHITE \m[WHITE]
+\#
\# =====================================================================
\#
\# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
@@ -1860,9 +2203,9 @@
.ds SUP \
\R'#PT_SIZE_IN_UNITS \En[.ps]'\
\R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
-\s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]
+\s[\En[#PT_SIZE_IN_UNITS]u]\v'-.26m'\s[\En[#SUP_PT_SIZE]u]
\#
-.ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'
+.ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.26m'
\#
.ds CONDSUP \
\R'#PT_SIZE_IN_UNITS \En[.ps]'\
@@ -2047,46 +2390,49 @@
\# *Argments:
\# "<string of text with padding markers inserted>"
\# *Function:
-\# Defines and redefines padding character (default=pound sign unless
-\# padding character has been set with PAD_MARKER) several times
-\# so that when the string is output at the end of the macro, every #
-\# has been converted to an equal-sized amount of padding (blank space)
-\# on a line. # is equivalent to CompuGraphic's old <IS>.
+\# Defines and redefines padding character (default=pound sign
+\# unless padding character has been set with PAD_MARKER)
+\# several times so that when the string is output at the end
+\# of the macro, every # has been converted to an equal-sized
+\# amount of padding (blank space) on a line. # is equivalent to
+\# CompuGraphic's old <IS>.
\# *Notes:
\# String tabs may be marked off during PAD.
\#
.MAC PAD END
. if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
. nf
-. if !d$PAD_MARKER \{ .ds $PAD_MARKER # \}
+. if !d$PAD_MARKER .ds $PAD_MARKER #
. char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
. ds $FAMILY_FOR_PAD \\n[.fam]
-. nr #FONT_FOR_PAD \\n(.f
+\#. fp \\n[.fp] \\*[$FONT]
+. fp \\n[.fp] \\n[.sty]
+. ds $FONT_FOR_PAD \\*[$FONT]
. nr #SIZE_FOR_PAD \\n[.ps]
. ds $PAD_STRING \\$1
. as $PAD_STRING \Ekp
. di PAD_STRING
. fam \\*[$FAMILY_FOR_PAD]
-\\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
+\\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
. br
. di
. char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
. di PAD_STRING
. fam \\*[$FAMILY_FOR_PAD]
-\\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
+\\f]\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
. br
. di
. char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
. ie \\n[#SILENT] \{\
. SILENT
. fam \\*[$FAMILY_FOR_PAD]
-\\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
+\\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
. br
. SILENT OFF
. \}
. el \{\
. fam \\*[$FAMILY_FOR_PAD]
-\\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
+\\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
. br
. \}
. if \\n[#FILL_MODE]=1 \{\
@@ -2099,19 +2445,25 @@
. rm $PAD_STRING
. rm PAD_STRING
. rchar #
+. if '\\$2'NOBREAK' \{\
+. TRAP OFF
+. EOL
+. TRAP
+. \}
.END
\#
\#
\# +++LEADERS+++
\#
-\# The leader mechanism is primitive, but it works. Basically,
-\# every macro in this set that includes a line length also sets
-\# a single groff tab stop at the right hand end of the line.
-\# That way, whenever Ctrl-A is invoked (always at the end of
-\# an input line), leader of the correct length gets deposited.
-\# Ctrl-A is accessed by the string LEADER (i.e. inline, as
-\# \*[LEADER]). Leaders within tabs get their length from the
-\# tab line length.
+.ig
+The leader mechanism is primitive, but it works. Basically, every
+macro in this set that includes a line length also sets a single
+groff tab stop at the right hand end of the line. That way,
+whenever Ctrl-A is invoked (always at the end of an input line),
+leader of the correct length gets deposited. Ctrl-A is accessed by
+the string LEADER (i.e. inline, as \*[LEADER]). Leaders within tabs
+get their length from the tab line length.
+..
\#
\# SET LEADER CHARACTER
\# --------------------
@@ -2152,6 +2504,23 @@
.END
\#
\#
+\# DROPCAP COLOR
+\# -------------
+\# *Arguments:
+\# <pre-defined XCOLOR or NEWCOLOR>
+\# *Function:
+\# Defines string $DC_COLOR to argument.
+\# *Notes:
+\# User must define an XCOLOR or NEWCOLOR before using
+\# DC_COLOR.
+\#
+.MAC DROPCAP_COLOR END
+. if \\n[#PRINT_STYLE]=1 \{ .return \}
+. nr #DC_COLOR 1
+. ds $DC_COLOR \\$1
+.END
+\#
+\#
\# DROP CAP GUTTER
\# ---------------
\# *Argument:
@@ -2221,51 +2590,79 @@
. \}
. ds $DROPCAP \\$1
. nr #DC_LINES \\$2-1
-. ds $RESTORE_COND \\*[$COND_PERCENT]
-. ds $RESTORE_EXT \\*[$EXT_PERCENT]
+. if \\n[#CONDENSE]=1 \{\
+. ds $RESTORE_COND \\*[$COND_PERCENT]
+\\*[CONDX]
+. nr #CONDENSE_WAS_ON 1
+. \}
+. if \\n[#EXTEND]=1 \{\
+. ds $RESTORE_EXT \\*[$EXT_PERCENT]
+\\*[EXTX]
+. nr #EXTEND_WAS_ON 1
+. \}
. if '\\$3'COND' \{ .CONDENSE \\$4 \}
. if '\\$3'EXT' \{ .EXTEND \\$4 \}
. if !r#DC_GUT \{ .nr #DC_GUT (3p) \}
. ds $RESTORE_FAM \\n[.fam]
-. nr #RESTORE_FT \\n(.f
+. ds $RESTORE_FT \\*[$FONT]
. nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
. nr #RESTORE_INDENT \\n(.i
. SIZESPECS
. nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
. ie !d$DC_FAM \{ .FAM \\n[.fam] \}
. el \{ .FAM \\*[$DC_FAM] \}
-. ie !d$DC_FT \{ .FT \\n(.f \}
+. ie !d$DC_FT \{ .FT \\*[$FONT] \}
. el \{ .FT \\*[$DC_FT] \}
. while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
. ps \\n[#PT_SIZE]u+100u
. SIZESPECS
. nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
-. \}
+.\}
. if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
. mk x
. sp \\n[#DC_LINES]v
-. ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
-. el \{ .PRINT \\*[$DROPCAP] \}
+. ie \\n[#DC_COLOR]=1 \{\
+. ie !'\\$3'' \{\
+. ie '\\$3'COND' \{ .PRINT \m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[] \}
+. el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[] \}
+. \}
+. el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
+. \}
+. el \{\
+. ie !'\\$3'' \{\
+. ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
+. el \{ .PRINT \\*[EXT]\\*[$DROPCAP]\\*[EXTX] \}
+. \}
+. el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
+. \}
. if '\\$3'COND' \{ \E*[COND] \}
. if '\\$3'EXT' \{ \E*[EXT] \}
. ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
-. el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
+. el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
. if '\\$3'COND' \{ \E*[CONDX]\c \}
. if '\\$3'EXT' \{ \E*[EXTX]\c \}
. rt \\nxu
. FAM \\*[$RESTORE_FAM]
-. FT \\n[#RESTORE_FT]
+. FT \\*[$RESTORE_FT]
. ps \\n[#RESTORE_PT_SIZE]u
-. CONDENSE \\*[$RESTORE_COND]
-. EXTEND \\*[$RESTORE_EXT]
+. if \\n[#CONDENSE_WAS_ON] \{\
+. CONDENSE \\*[$RESTORE_COND]
+\\*[COND]\c
+. \}
+. if \\n[#EXTEND_WAS_ON] \{\
+. EXTEND \\*[$RESTORE_EXT]
+\\*[EXT]\c
+. \}
. ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
. el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
+. rr #CONDENSE_WAS_ON
+. rr #EXTEND_WAS_ON
. rm $DROPCAP
. rr #DC_LINES
. rm $RESTORE_COND
. rm $RESTORE_EXT
. rm $RESTORE_FAM
-. rr #RESTORE_FT
+. rm $RESTORE_FT
. rr #RESTORE_PT_SIZE
. rr #RESTORE_INDENT
. rr #DC_HEIGHT
@@ -2287,7 +2684,10 @@
\# *Notes:
\#
.MAC RULE END
-. if \\n(.j=1 \{\
+\c
+. EL
+. if \\n(.u=1 \{\
+. nr #FILL_WAS_ON 1
. ds $CURRENT_QUAD \\*[$QUAD_VALUE]
. nf
. \}
@@ -2295,15 +2695,19 @@
. nr #RESTORE_L_LENGTH \\n(.l
. if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
. if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
-. PRINT \El'\En(.lu'
+. PRINT \El'\En(.lu'\c
. ll \\n[#RESTORE_L_LENGTH]u
-. rr #RESTORE_L_LENGTH]u
+. rr #RESTORE_L_LENGTH
. \}
. el \{\
-. PRINT \El'\En(.lu'
+. PRINT \El'\En(.lu'\c
+. \}
+. if r#FILL_WAS_ON \{\
+. fi
+. rr #FILL_WAS_ON
+. QUAD \\*[$CURRENT_QUAD]
+. rm $CURRENT_QUAD
. \}
-. QUAD \\*[$CURRENT_QUAD]
-. rm $CURRENT_QUAD
. EL
.END
\#
@@ -2331,8 +2735,8 @@
.MAC WS END
. ds $WS_CONSTANT 12
. ds $WS_VAR \\$1
-. ie '\\$1'DEFAULT' \{ .ds $WS_VAR +0 \}
-. el \{ .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR]) \}
+. ie '\\$1'DEFAULT' .ds $WS_VAR +0
+. el .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR])
. ie \\n[.sss]=12 \{ .ss \\*[$WS] 12 \}
. el \{\
. ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
@@ -2377,85 +2781,88 @@
\#
\# +++INDENTS+++
\#
-\# There are five styles of indents: left, right, both, temporary,
-\# and hanging. Each is set/invoked with a different macro.
-\# Indent macros begin with the letter "I", hence .IL means "indent left,"
-\# .IR means "indent right," and so on.
-\#
-\# The first time any of the indent macros is used, it requires an
-\# argument--the size of the indent in ipPcm. The size may also
-\# be entered using the \w'#' function--very useful for numbered
-\# lists using HI). The unit of measure is required. Subsequent
-\# invocations don't require the argument; the indent measure remains the
-\# same until it's changed by invoking the macro with an argument again.
-\#
-\# If no indents are in effect, the arguments passed to indent macros are
-\# measured from the left and right margins of the page. If a left indent
-\# or a right indent is already in effect, the arguments passed to
-\# the indent macros are calculated from the current values; in other words,
-\# the arguments are additive. If you quit an indent and later return
-\# to it, its value will be the value last in effect, unless you pass
-\# it an argument. If you do pass an argument, it is added to the last
-\# value in effect, unless you cleared the indent with one of
-\# .I<LRB>X macros.
-\#
-\# Example
-\# -------
-\#
-\# .IL 2P
-\# ...some text...
-\# .IL 2P
-\# ...some text...
-\# .IQ
-\# ...some text...
-\# .IL
-\# ...some text...
-\#
-\# The first .IL 2P indents text 2P from the left margin. The second
-\# .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
-\# .IQ turns the indent off. The last .IL (which has no argument)
-\# takes its value from the total of all arguments passed to .IL (in
-\# this case, 2P and 2P), therefore it indents 2P+2P from the left
-\# margin, i.e. 4P. If you wanted the last .IL to indent just 2P,
-\# you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
-\# the last .IL the argument 2P.
-\#
-\# To reverse the sense of an indent added to an indent, you may use
-\# negative values.
-\#
-\# Indents can be turned off individually with ILX, IRX, and IBX.
-\# LEFT and RIGHT indents may be combined and manipulated
-\# separately, (e.g. you can have an IL of 2P and an IR of 4P
-\# operative at the same time, and then change, say, the IL to
-\# 4P--thereby left indenting 6P--while the IR remains at 4P.
-\#
-\# IB automatically turns off IL and IR. They have to be reinvoked
-\# again when needed. IL and IR automatically turn IB off; it, too,
-\# has to be reinvoked with needed.
-\#
-\# All indents can be turned off at once with IQ. The ILX, IRX, IBX,
-\# and IQ macros simply turn the indents off; the values stored in
-\# the respective indent macros (IL, IR, IB) remain in effect. If
-\# the user wishes to clear the values, the I<LRB>X macros should be
-\# invoked with the single argument CLEAR. IQ CLEAR clears out
-\# the values stored for all indent styles.
-\#
-\# Indents *must* be turned off before settting string tabs
-\# inside PAD. Generally, in order not to get confused, it's a
-\# good idea to turn all indents off before setting any tabs.
-\#
-\# TI and HI are special cases. There's no need to turn them off,
-\# since they affect only one line--the first after their
-\# invocation. Like the other indent styles, the first time
-\# they're invoked, they require a value in iPpcm; each subsequent
-\# invocation without an argument will use the same value. To
-\# 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
-\# can use HI.
+.ig
+There are five styles of indents: left, right, both, temporary,
+and hanging. Each is set/invoked with a different macro.
+Indent macros begin with the letter "I", hence .IL means "indent left,"
+.IR means "indent right," and so on.
+
+The first time any of the indent macros is used, it requires an
+argument--the size of the indent (with a unit of measure). The
+size may also be entered using the \w escape--very useful
+for numbered lists using HI. The unit of measure is required.
+Subsequent invocations don't require the argument; the indent
+measure remains the same until it's changed by invoking the macro
+with an argument again.
+
+If no indents are in effect, the arguments passed to indent macros are
+measured from the left and right margins of the page. If a left indent
+or a right indent is already in effect, the arguments passed to
+the indent macros are calculated from the current values; in other words,
+the arguments are additive. If you quit an indent and later return
+to it, its value will be the value last in effect, unless you pass
+it an argument. If you do pass an argument, it is added to the last
+value in effect, unless you cleared the indent with one of
+.I<LRB>X/Q macros.
+
+Example
+-------
+
+.IL 2P
+...some text...
+.IL 2P
+...some text...
+.IQ
+...some text...
+.IL
+...some text...
+
+The first .IL 2P indents text 2P from the left margin. The second
+.IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
+.IQ turns the indent off. The last .IL (which has no argument)
+takes its value from the total of all arguments passed to .IL (in
+this case, 2P and 2P), therefore it indents 2P+2P from the left
+margin, i.e. 4P. If you wanted the last .IL to indent just 2P,
+you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
+the last .IL the argument 2P.
+
+To reverse the sense of an indent added to an indent, you may use
+negative values.
+
+Indents can be turned off individually with ILX, IRX, and IBX.
+LEFT and RIGHT indents may be combined and manipulated
+separately, (e.g. you can have an IL of 2P and an IR of 4P
+operative at the same time, and then change, say, the IL to
+4P--thereby left indenting 6P--while the IR remains at 4P.
+
+IB automatically turns off IL and IR. They have to be reinvoked
+again when needed. IL and IR automatically turn IB off; it, too,
+has to be reinvoked with needed.
+
+All indents can be turned off at once with IQ. The ILX, IRX, IBX,
+and IQ macros simply turn the indents off; the values stored in
+the respective indent macros (IL, IR, IB) remain in effect. If
+the user wishes to clear the values, the I<LRB>X macros should be
+invoked with the single argument CLEAR. IQ CLEAR clears out
+the values stored for all indent styles.
+
+Indents *must* be turned off before settting string tabs
+inside PAD. Generally, in order not to get confused, it's a
+good idea to turn all indents off before setting any tabs.
+
+TI and HI are special cases. There's no need to turn them off,
+since they affect only one line--the first after their
+invocation. Like the other indent styles, the first time
+they're invoked, they require a value in iPpcm; each subsequent
+invocation without an argument will use the same value. To
+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
+or column. In other words, you must have IL or IB on before you
+can use HI.
+..
\#
\# INDENT LEFT
\# -----------
@@ -2591,7 +2998,7 @@
. if '\\$1'CLEAR' \{\
. rr #L_INDENT
. rr #INDENT_STYLE_LEFT
-. \}
+. \}
.END
\#
\#
@@ -2609,7 +3016,7 @@
. ta \\n(.lu
. \}
. \}
-. if '\\$1'CLEAR' \{\
+. if '\\$1'CLEAR' \{\
. rr #R_INDENT
. rr #INDENT_STYLE_RIGHT
. \}
@@ -2699,7 +3106,7 @@
. ie \\n[#COLUMNS] \{\
. ll \\n[#COL_L_LENGTH]u
. ta \\n(.lu
-. \}
+. \}
. el \{\
. ll \\n[#L_LENGTH]u
. ta \\n(.lu
@@ -2742,7 +3149,9 @@
\# Returns to the top of a column set
\#
.MAC MCR END
+. TRAP OFF
. sp |\\ncu
+. TRAP
.END
\#
\# MULTIPLE COLUMNS OFF
@@ -2768,7 +3177,7 @@
. TQ
. ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
. el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
-. rr #MCX_ALD (\\$1)
+. rr #MCX_ALD
. \}
.END
\#
@@ -2783,11 +3192,11 @@
\# *Function:
\# Enables/disables traps.
\# *Notes:
-\# EL and TN don't function as advertised on the last line before a
-\# trap (when they break the preceding line, they spring the trap, and
-\# groff won't back up to the line preceding the trap). TRAP is a kludge
-\# to get EL and TN work properly on last lines. The user simply enloses
-\# the offending lines in TRAP OFF/TRAP.
+\# EL and TN don't function as advertised on the last line before
+\# a trap (when they break the preceding line, they spring the
+\# trap, and groff won't back up to the line preceding the trap).
+\# TRAP is a kludge to get EL and TN work properly on last lines.
+\# The user simply enloses the offending lines in TRAP OFF/TRAP.
\#
.MAC TRAP END
. ie '\\$1'' \{ .vpt 1 \}
@@ -2800,7 +3209,7 @@
\# *Arguments:
\# <none> | <anything>
\# *Function:
-\# Diverts text so that it doesn't print, or turns to function off.
+\# Diverts text so that it doesn't print, or turns the function off.
\# *Notes:
\# Useful for setting up autotabs where you don't want the line with
\# the tab marks to print.
@@ -2820,15 +3229,14 @@
. \}
.END
\#
+\#
\# PRINT
\# -----
-\# *Arguments:
-\# <anything>
\# *Function:
\# Prints anything. A macro that helps keep my code nicely indented.
\#
.MAC PRINT END
-\\$*
+. nop \\$*
.END
\#
\#
@@ -2935,7 +3343,9 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\# +++TYPESETTING ALIASES+++
\#
+.ALIAS ADD_SPACE ALD
.ALIAS CENTRE CENTER
+.ALIAS COLOUR COLOR
.ALIAS COMMENT SILENT
.ALIAS CONDENSE CONDENSE_OR_EXTEND
.ALIAS EXTEND CONDENSE_OR_EXTEND
@@ -2943,15 +3353,19 @@ y\\R'#DESCENDER \\n[.cdp]'
.ALIAS HYPHENATE HY
.ALIAS HYPHENATION HY
.ALIAS HYSET HY_SET
-.ALIAS LIG LIGATURES
.ALIAS IBQ IBX
.ALIAS ILQ ILX
.ALIAS IQ IX
.ALIAS IRQ IRX
+.ALIAS LIG LIGATURES
+.ALIAS NEWCOLOUR NEWCOLOR
.ALIAS PADMARKER PAD_MARKER
+.ALIAS SP ALD
+.ALIAS SPACE ALD
.ALIAS TABSET TAB_SET
.ALIAS TB TAB
.ALIAS UNDERSCORE_2 UNDERSCORE2
+.ALIAS XCOLOUR XCOLOR
\#
\#
\# ====================================================================
@@ -2966,7 +3380,7 @@ y\\R'#DESCENDER \\n[.cdp]'
\# *Arguments:
\# LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
\# *Function:
-\# Sets up margins for different paper sizes.
+\# Sets up dimensions for different paper sizes.
\#
.MAC PAPER END
. ds $PAPER \\$1
@@ -3045,68 +3459,84 @@ y\\R'#DESCENDER \\n[.cdp]'
\# Number registers: TYPEWRITE=1, TYPESET=2.
\#
.MAC PRINTSTYLE END
-. if !d$PAPER \{ .PAPER LETTER \}
-. if '\\$1'TYPEWRITE' \{\
-. nr #PRINT_STYLE 1
-. if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
-. if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
-. fam C
-. ft R
-. ps 12
-. ie '\\$2'SINGLESPACE' \{\
-. nr #SINGLE_SPACE 1
-. vs 12
-. \}
-. el \{ .vs 24 \}
-. QUAD L
-. HY OFF
-. SMARTQUOTES OFF
-. if !\\n[#PP_INDENT] \{\
-. in 3P \"Set indent
-. nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
-. in 0 \"Remove indent
-. \}
-. HDRFTR_RIGHT_CAPS
-. nr #BOLDER_UNITS 0
-. nr #CONDENSE 0
-. nr #EXTEND 0
-. rm IT
-. rm BD
-. rm BDI
-. rm PREV
-. UNDERLINE_SLANT
-. UNDERLINE_ITALIC
-. UNDERLINE_QUOTES
-. nr #IGNORE_COLUMNS 1
-. \}
-. if '\\$1'TYPESET' \{\
-. nr #PRINT_STYLE 2
-. if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
-. if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
-. FAMILY T
-. FT R
-. if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
-. if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
-. JUSTIFY
-. HY
-. HY_SET 2 36p 1p
-. KERN
-. LIG
-. SS 0
-. SMARTQUOTES
-. if !\\n[#PP_INDENT] \{\
-. in 2m \"Set indent
-. nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
-. in 0 \"Remove indent
+. if !\\n[#COLLATE]=1 \{\
+. if !d$PAPER \{ .PAPER LETTER \}
+. if '\\$1'TYPEWRITE' \{\
+. nr #PRINT_STYLE 1
+. if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
+. if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
+. TYPEWRITER
+. color 0
+. ie '\\$2'SINGLESPACE' \{\
+. nr #SINGLE_SPACE 1
+. vs 12
+. nr #ORIGINAL_DOC_LEAD \\n(.v
+. \}
+. el \{\
+. vs 24
+. nr #ORIGINAL_DOC_LEAD \\n(.v
+. \}
+. QUAD L
+. HY OFF
+. SMARTQUOTES OFF
+. if !\\n[#PP_INDENT] \{\
+. in 3P \"Set indent
+. nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
+. in 0 \"Remove indent
+. \}
+. HDRFTR_RIGHT_CAPS
+. nr #BOLDER_UNITS 0
+. nr #CONDENSE 0
+. nr #EXTEND 0
+. rm IT
+. rm BD
+. rm BDI
+. rm PREV
+. UNDERLINE_SLANT
+. UNDERLINE_ITALIC
+. UNDERLINE_QUOTES
+. nr #IGNORE_COLUMNS 1
+. char \(em --
+. tr `'
+. \}
+. if '\\$1'TYPESET' \{\
+. nr #PRINT_STYLE 2
+. if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
+. if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
+. FAMILY T
+. FT R
+. if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
+. if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
+. JUSTIFY
+. HY
+. HY_SET 2 36p 1p
+. KERN
+. LIG
+. SS 0
+. SMARTQUOTES
+. if !\\n[#PP_INDENT] \{\
+. in 2m \"Set indent
+. nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
+. in 0 \"Remove indent
+. \}
+. HDRFTR_RIGHT_CAPS
+. rr #IGNORE_COLUMNS
. \}
-. HDRFTR_RIGHT_CAPS
-. rr #IGNORE_COLUMNS
. \}
.END
\#
\#
\# Macros to control behaviour of PRINTSTYLE TYPEWRITE
\#
+\# First, a little utility macro.
+\#
+.MAC TYPEWRITER END
+. fam C
+. ft R
+. ps 12
+.END
+\#
+\#
\# ITALIC MEANS ITALIC
\# -------------------
\# *Argument:
@@ -3224,13 +3654,13 @@ y\\R'#DESCENDER \\n[.cdp]'
. ds $COPY_STYLE \\$1
. if '\\*[$COPY_STYLE]'DRAFT' \{\
. nr #COPY_STYLE 1
-. if !r#DRAFT \{ .DRAFT 1 \}
+. if !d$DRAFT \{ .DRAFT 1 \}
. \}
. if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2 \}
. if !d$CHAPTER_STRING \{ .CHAPTER_STRING "Chapter" \}
. if !d$DRAFT_STRING \{ .DRAFT_STRING "Draft" \}
. if !d$REVISION_STRING \{ .REVISION_STRING "Rev." \}
-\# Default
+.\" Default
. if \\n[#DOC_TYPE]=1 \{\
. ie \\n[#COPY_STYLE]=1 \{\
. ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
@@ -3240,14 +3670,14 @@ y\\R'#DESCENDER \\n[.cdp]'
. ds $HDRFTR_CENTER
. \}
. el \{\
-. ie !\\n[#REVISION] \{\
+. ie '\\*[$REVISION]'' \{\
. ds $HDRFTR_CENTER \
- \\*[$DRAFT_STRING] \\n[#DRAFT]
+ \\*[$DRAFT_STRING]\\*[$DRAFT]
. \}
. el \{\
. ds $HDRFTR_CENTER \
- \\*[$DRAFT_STRING] \\n[#DRAFT], \
- \\*[$REVISION_STRING] \\n[#REVISION]
+ \\*[$DRAFT_STRING]\\*[$DRAFT], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
. \}
. \}
. \}
@@ -3255,12 +3685,16 @@ y\\R'#DESCENDER \\n[.cdp]'
. el \{\
. ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
. el \{ .PAGENUM_STYLE DIGIT \}
-. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{ .ds $HDRFTR_CENTER \}
+. if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
+. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
+. ds $HDRFTR_CENTER
+. rr #USER_DEF_HDRFTR_CENTER
+. \}
. \}
. \}
-\# Chapter
+.\" Chapter
. if \\n[#DOC_TYPE]=2 \{\
-\# Copystyle DRAFT
+.\" Copystyle DRAFT
. ie \\n[#COPY_STYLE]=1 \{\
. ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
. el \{ .PAGENUM_STYLE roman \}
@@ -3270,77 +3704,128 @@ y\\R'#DESCENDER \\n[.cdp]'
. ie !'\\*[$CHAPTER_TITLE]'' \{\
. ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
. \}
-. el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \}
+. el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
. \}
. el \{\
. ie !'\\*[$CHAPTER_TITLE]'' \{\
-. ds \\*[$CHAPTER_TITLE]
+. ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
. \}
-. el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
+. el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
. \}
. \}
. el \{\
-. ie !\\n[#REVISION] \{\
+. ie '\\*[$REVISION]'' \{\
. ie '\\*[$CHAPTER]'' \{\
. ie !'\\*[$CHAPTER_TITLE]'' \{\
-. ds $HDRFTR_CENTER \
- \\*[$CHAPTER_TITLE], \
- \\*[$DRAFT_STRING] \\n[#DRAFT]
+. ie '\\*[$DRAFT]'' \{\
+. ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
+. \}
+. el \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_TITLE], \
+ \\*[$DRAFT_STRING]\\*[$DRAFT]
+. \}
. \}
. el \{\
-. ds $HDRFTR_CENTER \
- \\*[$CHAPTER_STRING], \
- \\*[$DRAFT_STRING] \\n[#DRAFT]
+. ie '\\*[$DRAFT]'' \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_STRING]
+. \}
+. el \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_STRING], \
+ \\*[$DRAFT_STRING]\\*[$DRAFT]
+. \}
. \}
. \}
. el \{\
. ie !'\\*[$CHAPTER_TITLE]'' \{\
-. ds $HDRFTR_CENTER \
- \\*[$CHAPTER_TITLE], \
- \\*[$DRAFT_STRING] \\n[#DRAFT]
+. ie '\\*[$DRAFT]'' \{\
+. ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
+. \}
+. el \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_TITLE], \
+ \\*[$DRAFT_STRING]\\*[$DRAFT]
+. \}
. \}
. el \{\
-. ds $HDRFTR_CENTER \
- \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
- \\*[$DRAFT_STRING] \\n[#DRAFT]
+. ie '\\*[$DRAFT]'' \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_STRING] \\*[$CHAPTER]
+. \}
+. el \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
+ \\*[$DRAFT_STRING]\\*[$DRAFT]
+. \}
. \}
. \}
. \}
. el \{\
. ie '\\*[$CHAPTER]'' \{\
. ie !'\\*[$CHAPTER_TITLE]'' \{\
-. ds $HDRFTR_CENTER \
- \\*[$CHAPTER_TITLE], \
- \\*[$DRAFT_STRING] \\n[#DRAFT], \
- \\*[$REVISION_STRING] \\n[#REVISION]
+. ie '\\*[$DRAFT]'' \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_TITLE], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
+. \}
+. el \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_TITLE], \
+ \\*[$DRAFT_STRING]\\*[$DRAFT], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
+. \}
. \}
. el \{\
-. ds $HDRFTR_CENTER \
- \\*[$CHAPTER_STRING], \
- \\*[$DRAFT_STRING] \\n[#DRAFT], \
- \\*[$REVISION_STRING] \\n[#REVISION]
+. ie '\\*[$DRAFT]'' \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_STRING], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
+. \}
+. el \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_STRING], \
+ \\*[$DRAFT_STRING]\\*[$DRAFT], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
+. \}
. \}
. \}
. el \{\
. ie !'\\*[$CHAPTER_TITLE]'' \{\
-. ds $HDRFTR_CENTER \
- \\*[$CHAPTER_TITLE], \
- \\*[$DRAFT_STRING] \\n[#DRAFT], \
- \\*[$REVISION_STRING] \\n[#REVISION]
+. ie '\\*[$DRAFT]'' \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_TITLE], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
+. \}
+. el \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_TITLE], \
+ \\*[$DRAFT_STRING]\\*[$DRAFT], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
+. \}
. \}
. el \{\
-. ds $HDRFTR_CENTER \
- \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
- \\*[$DRAFT_STRING] \\n[#DRAFT], \
- \\*[$REVISION_STRING] \\n[#REVISION]
+. ie '\\*[$DRAFT]'' \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
+. \}
+. el \{\
+. ds $HDRFTR_CENTER \
+ \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
+ \\*[$DRAFT_STRING]\\*[$DRAFT], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
+. \}
. \}
. \}
. \}
. \}
. \}
. \}
-\# Copystyle FINAL
+.\" Copystyle FINAL
. el \{\
+. if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
. ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
. el \{ .PAGENUM_STYLE DIGIT \}
@@ -3363,7 +3848,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. \}
-\# Named
+.\" Named
. if \\n[#DOC_TYPE]=3 \{\
. ie \\n[#COPY_STYLE]=1 \{\
. ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
@@ -3373,21 +3858,34 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. el \{\
. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
-. ie !\\n[#REVISION] \{\
-. ds $HDRFTR_CENTER \
- \\*[$DOC_TYPE], \
- \\*[$DRAFT_STRING] \\n[#DRAFT]
+. ie '\\*[$REVISION]'' \{\
+. ie '\\*[$DRAFT]'' \{\
+. ds $HDRFTR_CENTER \\*[$DOC_TYPE]
+. \}
+. el \{\
+. ds $HDRFTR_CENTER \
+ \\*[$DOC_TYPE], \
+ \\*[$DRAFT_STRING]\\*[$DRAFT]
+. \}
. \}
. el \{\
-. ds $HDRFTR_CENTER \
- \\*[$DOC_TYPE], \
- \\*[$DRAFT_STRING] \\n[#DRAFT], \
- \\*[$REVISION_STRING] \\n[#REVISION]
+. ie '\\*[$DRAFT]'' \{\
+. ds $HDRFTR_CENTER \
+ \\*[$DOC_TYPE], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
+. \}
+. el \{\
+. ds $HDRFTR_CENTER \
+ \\*[$DOC_TYPE], \
+ \\*[$DRAFT_STRING]\\*[$DRAFT], \
+ \\*[$REVISION_STRING] \\*[$REVISION]
+. \}
. \}
. \}
. \}
. \}
. el \{\
+. if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
. if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
. ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
. el \{ .PAGENUM_STYLE DIGIT \}
@@ -3399,13 +3897,18 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\# ====================================================================
\#
-\# +++COLLECT DOC INFO -- STRINGS AND NUMBER REGISTERS+++
+\# +++COLLECT DOC INFO -- STRINGS AND REGISTERS FOR REFERENCE MACROS+++
\#
\# *Arguments:
\# various string/register arguments
\# *Function:
\# Collect information about documents.
\#
+\#
+.MAC DOCTITLE END
+. ds $DOC_TITLE \\$1
+.END
+\#
.MAC TITLE END \"Document title
. ds $TITLE \\$1
.END
@@ -3427,12 +3930,13 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\#
.MAC DRAFT END \"Draft number
-. nr #DRAFT \\$1
+. ie '\\$1'' .ds $DRAFT
+. el .ds $DRAFT " \\$1
.END
\#
\#
.MAC REVISION END \"Revision number
-. nr #REVISION \\$1
+. ds $REVISION \\$1
.END
\#
\#
@@ -3445,13 +3949,27 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #AUTHOR_NUM -1 1
. while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
. ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
-. \}
+.\}
. nr #NUM_AUTHORS \\n[#NUM_ARGS]%2 \"Use mod 2 to test if odd or even # of authors
. ie \\n[#NUM_AUTHORS]=1 \{ .nr #AUTHOR_LINES 0 \}
. el \{ .nr #AUTHOR_LINES 1 \}
.END
\#
\#
+.MAC COPYRIGHT END \"For use on cover page only
+. ds $COPYRIGHT \[co]\\$1
+.END
+\#
+\#
+.MAC MISC END \"For use on cover page only; enclose all args in double quotes
+. nr #MISC_NUM -1 1
+. while \\n[#NUM_ARGS]>\\n[#MISC_NUM] \{\
+. ds $MISC_\\n+[#MISC_NUM] \\$\\n[#MISC_NUM]
+.\}
+. nr #NUM_MISCS \\n[#NUM_ARGS]
+.END
+\#
+\#
.MAC PAGENUMBER END \"Page # that appears on page one.
. nr #n%_AT_PAGENUM_SET \\n%
. nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
@@ -3501,7 +4019,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. FOOTER_LEFT ""
. FOOTER_CENTER ""
. FOOTER_RIGHT_SIZE +0
-. FOOTER_RIGHT ".../\E*[$SUITE]
+. FOOTER_RIGHT "\&.../\E*[$SUITE]
. FOOTER_ON_FIRST_PAGE
. em ALL_DONE
. \}
@@ -3509,17 +4027,29 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\# +++LETTER MACROS+++
\#
+\# First, create a register to hold incrementing numbers to be
+\# appended to LETTERHEAD.
+\#
+.nr #FIELD 0 1
+\#
\# DATE
\# ----
\# *Arguments:
-\# <date string>
+\# <none>
\# *Function:
-\# Stores date string in string $DATE.
+\# Stores date (entered on the line after .DATE) in diversion
+\# LETTERHEAD<n>
\#
.MAC DATE END
-. nr #DATE 1
-. di DATE
-. RIGHT
+. if !'\\n(.z'' \{ .di \}
+. di LETTERHEAD\\n+[#FIELD]
+. ie \\n[#FIELD]=1 \{\
+. nr #DATE_FIRST 1
+. RIGHT
+. \}
+. el \{\
+. LEFT
+. \}
.END
\#
\#
@@ -3528,12 +4058,12 @@ y\\R'#DESCENDER \\n[.cdp]'
\# *Arguments:
\# <none>
\# *Function:
-\# Stores "to" info in diversion TO_ADDRESS.
+\# Stores addressee address (entered on the line after .TO) in
+\# diversion LETTERHEAD<n>
\#
.MAC TO END
. if !'\\n(.z'' \{ .di \}
-. nr #TO 1
-. di TO_ADDRESS
+. di LETTERHEAD\\n+[#FIELD]
. LEFT
.END
\#
@@ -3543,12 +4073,12 @@ y\\R'#DESCENDER \\n[.cdp]'
\# *Arguments:
\# <none>
\# *Function:
-\# Stores "from" info in diversion FROM_ADDRESS.
+\# Stores addresser address (entered on the line after .FROM) in
+\# diversion LETTERHEAD<n>
\#
.MAC FROM END
. if !'\\n(.z'' \{ .di \}
-. nr #FROM 1
-. di FROM_ADDRESS
+. di LETTERHEAD\\n+[#FIELD]
. LEFT
.END
\#
@@ -3556,14 +4086,14 @@ y\\R'#DESCENDER \\n[.cdp]'
\# GREETING
\# --------
\# *Arguments:
-\# <greeting string>
+\# <none>
\# *Function:
-\# Stores greeting in string $GREETING.
+\# Stores greeting (entered on the line after .GREETING) in
+\# diversion LETTERHEAD<n>
\#
.MAC GREETING END
. if !'\\n(.z'' \{ .di \}
-. nr #GREETING 1
-. di GREETING
+. di LETTERHEAD\\n+[#FIELD]
. LEFT
.END
\#
@@ -3573,7 +4103,7 @@ y\\R'#DESCENDER \\n[.cdp]'
\# *Arguments:
\# <closing string>
\# *Function:
-\# Stores greeting in string $CLOSING.
+\# Stores greeting in diversion CLOSING.
\#
.MAC CLOSING END
. br
@@ -3588,7 +4118,7 @@ y\\R'#DESCENDER \\n[.cdp]'
\# *Arguments:
\# <none>
\# *Function:
-\# Redefines $SUITE to blank so that a suite number doesn't
+\# Redefines $FOOTER_RIGHT to blank so that a suite number doesn't
\# appear at the bottom of letter pages.
\#
.MAC NO_SUITE END
@@ -3599,6 +4129,375 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\# +++DEFAULTS+++
\#
+\# TYPE-STYLE CONTROL MACROS
+\# -------------------------
+\#
+.ig
+The control macros for family, font, size, quad and color are here
+grouped together. Each (e.g. _FAMILY or _FONT) tests for a calling
+alias before performing the action(s) appropriate to the calling
+macro. Defaults for all these guys are set in DEFAULTS, and listed
+in the "Control Macros" section of the documentation pertinent to
+the macro whose style is to be changed.
+..
+\#
+.MAC _FAMILY END
+. if '\\$0'AUTHOR_FAMILY' .ds $AUTHOR_FAM \\$1
+. if '\\$0'BIBLIOGRAPHY_FAMILY' .ds $BIB_FAM \\$1
+. if '\\$0'BIBLIOGRAPHY_STRING_FAMILY' .ds $BIB_STRING_FAM \\$1
+. if '\\$0'BLOCKQUOTE_FAMILY' .ds $BQUOTE_FAM \\$1
+. if '\\$0'CITATION_FAMILY' .ds $BQUOTE_FAM \\$1
+. if '\\$0'CITE_FAMILY' .ds $BQUOTE_FAM \\$1
+. if '\\$0'CHAPTER_TITLE_FAMILY' .ds $CHAPTER_TITLE_FAM \\$1
+. if '\\$0'COVER_AUTHOR_FAMILY' .ds $COVER_AUTHOR_FAM \\$1
+. if '\\$0'COVER_CHAPTER_TITLE_FAMILY' .ds $COVER_CHAPTER_TITLE_FAM \\$1
+. if '\\$0'COVER_COPYRIGHT_FAMILY' .ds $COVER_COPYRIGHT_FAM \\$1
+. if '\\$0'COVER_DOCTYPE_FAMILY' .ds $COVER_DOCTYPE_FAM \\$1
+. if '\\$0'COVER_FAMILY' .ds $COVER_FAM \\$1
+. if '\\$0'COVER_SUBTITLE_FAMILY' .ds $COVER_SUBTITLE_FAM \\$1
+. if '\\$0'COVER_TITLE_FAMILY' .ds $COVER_TITLE_FAM \\$1
+. if '\\$0'DOC_COVER_AUTHOR_FAMILY' .ds $DOC_COVER_AUTHOR_FAM \\$1
+. if '\\$0'DOC_COVER_CHAPTER_TITLE_FAMILY' .ds $DOC_COVER_CHAPTER_TITLE_FAM \\$1
+. if '\\$0'DOC_COVER_COPYRIGHT_FAMILY' .ds $DOC_COVER_COPYRIGHT_FAM \\$1
+. if '\\$0'DOC_COVER_DOCTYPE_FAMILY' .ds $DOC_COVER_DOCTYPE_FAM \\$1
+. if '\\$0'DOC_COVER_FAMILY' .ds $DOC_COVER_FAM \\$1
+. if '\\$0'DOC_COVER_SUBTITLE_FAMILY' .ds $DOC_COVER_SUBTITLE_FAM \\$1
+. if '\\$0'DOC_COVER_TITLE_FAMILY' .ds $DOC_COVER_TITLE_FAM \\$1
+. if '\\$0'DOCHEADER_FAMILY' .ds $DOCHEADER_FAM \\$1
+. if '\\$0'DOCTYPE_FAMILY' .ds $DOCTYPE_FAM \\$1
+. if '\\$0'ENDNOTE_FAMILY' .ds $EN_FAM \\$1
+. if '\\$0'ENDNOTE_NUMBER_FAMILY' .ds $EN_NUMBER_FAM \\$1
+. if '\\$0'ENDNOTE_LINENUMBER_FAMILY' .ds $EN_LN_FAM \\$1
+. if '\\$0'ENDNOTE_STRING_FAMILY' .ds $EN_STRING_FAM \\$1
+. if '\\$0'ENDNOTE_TITLE_FAMILY' .ds $EN_TITLE_FAM \\$1
+. if '\\$0'EPIGRAPH_FAMILY' .ds $EPI_FAM \\$1
+. if '\\$0'FOOTNOTE_FAMILY' .ds $FN_FAM \\$1
+. if '\\$0'HDRFTR_CENTER_FAMILY' .ds $HDRFTR_CENTER_FAM \\$1
+. if '\\$0'HDRFTR_FAMILY' \{\
+. ds $HDRFTR_FAM \\$1
+. ds $HDRFTR_LEFT_FAM \\$1
+. ds $HDRFTR_CENTER_FAM \\$1
+. ds $HDRFTR_RIGHT_FAM \\$1
+. \}
+. if '\\$0'HDRFTR_LEFT_FAMILY' .ds $HDRFTR_LEFT_FAM \\$1
+. if '\\$0'HDRFTR_RIGHT_FAMILY' .ds $HDRFTR_RIGHT_FAM \\$1
+. if '\\$0'HEAD_FAMILY' .ds $HEAD_FAM \\$1
+. if '\\$0'PAGENUM_FAMILY' .ds $PAGE_NUM_FAM \\$1
+. if '\\$0'PARAHEAD_FAMILY' .ds $PH_FAM \\$1
+. if '\\$0'QUOTE_FAMILY' .ds $QUOTE_FAM \\$1
+. if '\\$0'SUBHEAD_FAMILY' .ds $SH_FAM \\$1
+. if '\\$0'SUBTITLE_FAMILY' .ds $SUBTITLE_FAM \\$1
+. if '\\$0'TITLE_FAMILY' .ds $TITLE_FAM \\$1
+. if '\\$0'TOC_FAMILY' .ds $TOC_FAM \\$1
+. if '\\$0'TOC_FAM' .ds $TOC_FAM \\$1
+. if '\\$0'TOC_HEADER_FAMILY' .ds $TOC_HEADER_FAM \\$1
+. if '\\$0'TOC_HEAD_FAMILY' .ds $TOC_HEAD_FAM \\$1
+. if '\\$0'TOC_PARAHEAD_FAMILY' .ds $TOC_PH_FAM \\$1
+. if '\\$0'TOC_PN_FAMILY' .ds $TOC_PN_FAM \\$1
+. if '\\$0'TOC_SUBHEAD_FAMILY' .ds $TOC_SH_FAM \\$1
+. if '\\$0'TOC_TITLE_FAMILY' .ds $TOC_TITLE_FAM \\$1
+.END
+\#
+\#
+.MAC _FONT END
+. if '\\$0'AUTHOR_FONT' .ds $AUTHOR_FT \\$1
+. if '\\$0'BIBLIOGRAPHY_FONT' .ds $BIB_FT \\$1
+. if '\\$0'BIBLIOGRAPHY_STRING_FONT' .ds $BIB_STRING_FT \\$1
+. if '\\$0'BLOCKQUOTE_FONT' .ds $BQUOTE_FT \\$1
+. if '\\$0'CITATION_FONT' .ds $BQUOTE_FT \\$1
+. if '\\$0'CITE_FONT' .ds $BQUOTE_FT \\$1
+. if '\\$0'CHAPTER_TITLE_FONT' .ds $CHAPTER_TITLE_FT \\$1
+. if '\\$0'COVER_AUTHOR_FONT' .ds $COVER_AUTHOR_FT \\$1
+. if '\\$0'COVER_CHAPTER_TITLE_FONT' .ds $COVER_CHAPTER_TITLE_FT \\$1
+. if '\\$0'COVER_COPYRIGHT_FONT' .ds $COVER_COPYRIGHT_FT \\$1
+. if '\\$0'COVER_DOCTYPE_FONT' .ds $COVER_DOCTYPE_FT \\$1
+. if '\\$0'COVER_SUBTITLE_FONT' .ds $COVER_SUBTITLE_FT \\$1
+. if '\\$0'COVER_TITLE_FONT' .ds $COVER_TITLE_FT \\$1
+. if '\\$0'DOC_COVER_AUTHOR_FONT' .ds $DOC_COVER_AUTHOR_FT \\$1
+. if '\\$0'DOC_COVER_CHAPTER_TITLE_FONT' .ds $DOC_COVER_CHAPTER_TITLE_FT \\$1
+. if '\\$0'DOC_COVER_COPYRIGHT_FONT' .ds $DOC_COVER_COPYRIGHT_FT \\$1
+. if '\\$0'DOC_COVER_DOCTYPE_FONT' .ds $DOC_COVER_DOCTYPE_FT \\$1
+. if '\\$0'DOC_COVER_SUBTITLE_FONT' .ds $DOC_COVER_SUBTITLE_FT \\$1
+. if '\\$0'DOC_COVER_TITLE_FONT' .ds $DOC_COVER_TITLE_FT \\$1
+. if '\\$0'DOCTYPE_FONT' .ds $DOCTYPE_FT \\$1
+. if '\\$0'ENDNOTE_FONT' .ds $EN_FT \\$1
+. if '\\$0'ENDNOTE_NUMBER_FONT' .ds $EN_NUMBER_FT \\$1
+. if '\\$0'ENDNOTE_LINENUMBER_FONT' .ds $EN_LN_FT \\$1
+. if '\\$0'ENDNOTE_STRING_FONT' .ds $EN_STRING_FT \\$1
+. if '\\$0'ENDNOTE_TITLE_FONT' .ds $EN_TITLE_FT \\$1
+. if '\\$0'EPIGRAPH_FONT' .ds $EPI_FT \\$1
+. if '\\$0'FOOTNOTE_FONT' .ds $FN_FT \\$1
+. if '\\$0'HDRFTR_CENTER_FONT' .ds $HDRFTR_CENTER_FT \\$1
+. if '\\$0'HDRFTR_LEFT_FONT' .ds $HDRFTR_LEFT_FT \\$1
+. if '\\$0'HDRFTR_RIGHT_FONT' .ds $HDRFTR_RIGHT_FT \\$1
+. if '\\$0'HEAD_FONT' .ds $HEAD_FT \\$1
+. if '\\$0'PAGENUM_FONT' .ds $PAGE_NUM_FT \\$1
+. if '\\$0'PARAHEAD_FONT' .ds $PH_FT \\$1
+. if '\\$0'QUOTE_FONT' .ds $QUOTE_FT \\$1
+. if '\\$0'SUBHEAD_FONT' .ds $SH_FT \\$1
+. if '\\$0'SUBTITLE_FONT' .ds $SUBTITLE_FT \\$1
+. if '\\$0'TITLE_FONT' .ds $TITLE_FT \\$1
+. if '\\$0'TOC_HEADER_FONT' .ds $TOC_HEADER_FT \\$1
+. if '\\$0'TOC_HEAD_FONT' .ds $TOC_HEAD_FT \\$1
+. if '\\$0'TOC_PARAHEAD_FONT' .ds $TOC_PH_FT \\$1
+. if '\\$0'TOC_PN_FONT' .ds $TOC_PN_FT \\$1
+. if '\\$0'TOC_SUBHEAD_FONT' .ds $TOC_SH_FT \\$1
+. if '\\$0'TOC_TITLE_FONT' .ds $TOC_TITLE_FT \\$1
+.END
+\#
+\#
+.MAC _SIZE END
+. if '\\$0'AUTHOR_SIZE' .ds $AUTHOR_SIZE_CHANGE \\$1
+. if '\\$0'BIBLIOGRAPHY_STRING_SIZE' .ds $BIB_STRING_SIZE_CHANGE \\$1
+. if '\\$0'BLOCKQUOTE_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
+. if '\\$0'CITATION_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
+. if '\\$0'CITE_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
+. if '\\$0'CHAPTER_TITLE_SIZE' .ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
+. if '\\$0'COVER_AUTHOR_SIZE' .ds $COVER_AUTHOR_SIZE_CHANGE \\$1
+. if '\\$0'COVER_CHAPTER_TITLE_SIZE' .ds $COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
+. if '\\$0'COVER_COPYRIGHT_SIZE' .ds $COVER_COPYRIGHT_SIZE_CHANGE \\$1
+. if '\\$0'COVER_DOCTYPE_SIZE' .ds $COVER_DOCTYPE_SIZE_CHANGE \\$1
+. if '\\$0'COVER_SUBTITLE_SIZE' .ds $COVER_SUBTITLE_SIZE_CHANGE \\$1
+. if '\\$0'COVER_TITLE_SIZE' .ds $COVER_TITLE_SIZE_CHANGE \\$1
+. if '\\$0'DOC_COVER_AUTHOR_SIZE' .ds $DOC_COVER_AUTHOR_SIZE_CHANGE \\$1
+. if '\\$0'DOC_COVER_CHAPTER_TITLE_SIZE' .ds $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
+. if '\\$0'DOC_COVER_COPYRIGHT_SIZE' .ds $DOC_COVER_COPYRIGHT_SIZE_CHANGE \\$1
+. if '\\$0'DOC_COVER_DOCTYPE_SIZE' .ds $DOC_COVER_DOCTYPE_SIZE_CHANGE \\$1
+. if '\\$0'DOC_COVER_SUBTITLE_SIZE' .ds $DOC_COVER_SUBTITLE_SIZE_CHANGE \\$1
+. if '\\$0'DOC_COVER_TITLE_SIZE' .ds $DOC_COVER_TITLE_SIZE_CHANGE \\$1
+. if '\\$0'DOCTYPE_SIZE' .ds $DOCTYPE_SIZE_CHANGE \\$1
+. if '\\$0'ENDNOTE_NUMBER_SIZE' .ds $EN_NUMBER_SIZE_CHANGE \\$1
+. if '\\$0'ENDNOTE_LINENUMBER_SIZE' .ds $EN_LN_SIZE_CHANGE \\$1
+. if '\\$0'ENDNOTE_STRING_SIZE' .ds $EN_STRING_SIZE_CHANGE \\$1
+. if '\\$0'ENDNOTE_TITLE_SIZE' .ds $EN_TITLE_SIZE_CHANGE \\$1
+. if '\\$0'EPIGRAPH_SIZE' .ds $EPI_SIZE_CHANGE \\$1
+. if '\\$0'FOOTNOTE_SIZE' .ds $FN_SIZE_CHANGE \\$1
+. if '\\$0'HDRFTR_CENTER_SIZE' .ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
+. if '\\$0'HDRFTR_LEFT_SIZE' .ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
+. if '\\$0'HDRFTR_RIGHT_SIZE' .ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
+. if '\\$0'HDRFTR_SIZE' .ds $HDRFTR_SIZE_CHANGE \\$1
+. if '\\$0'HEAD_SIZE' .ds $HEAD_SIZE_CHANGE \\$1
+. if '\\$0'PAGENUM_SIZE' .ds $PAGE_NUM_SIZE_CHANGE \\$1
+. if '\\$0'PARAHEAD_SIZE' .ds $PH_SIZE_CHANGE \\$1
+. if '\\$0'QUOTE_SIZE' .ds $QUOTE_SIZE_CHANGE \\$1
+. if '\\$0'SUBHEAD_SIZE' .ds $SH_SIZE_CHANGE \\$1
+. if '\\$0'SUBTITLE_SIZE' .ds $SUBTITLE_SIZE_CHANGE \\$1
+. if '\\$0'TITLE_SIZE' .ds $TITLE_SIZE_CHANGE \\$1
+. if '\\$0'TOC_HEADER_SIZE' .ds $TOC_HEADER_SIZE_CHANGE \\$1
+. if '\\$0'TOC_HEAD_SIZE' .ds $TOC_HEAD_SIZE_CHANGE \\$1
+. if '\\$0'TOC_PARAHEAD_SIZE' .ds $TOC_PH_SIZE_CHANGE \\$1
+. if '\\$0'TOC_PN_SIZE' .ds $TOC_PN_SIZE_CHANGE \\$1
+. if '\\$0'TOC_SUBHEAD_SIZE' .ds $TOC_SH_SIZE_CHANGE \\$1
+. if '\\$0'TOC_TITLE_SIZE' .ds $TOC_TITLE_SIZE_CHANGE \\$1
+.END
+\#
+\#
+.MAC _COLOR END
+. if \\n[#PRINT_STYLE]=1 \{ .return \}
+. if '\\$0'ATTRIBUTE_COLOR' \{\
+. nr #ATTRIBUTE_COLOR 1
+. ds $ATTRIBUTE_COLOR \\$1
+. \}
+. if '\\$0'AUTHOR_COLOR' \{\
+. nr #AUTHOR_COLOR 1
+. ds $AUTHOR_COLOR \\$1
+. \}
+. if '\\$0'BLOCKQUOTE_COLOR' \{\
+. nr #BQUOTE_COLOR 1
+. ds $BQUOTE_COLOR \\$1
+. \}
+. if '\\$0'CITATION_COLOR' \{\
+. nr #BQUOTE_COLOR 1
+. ds $BQUOTE_COLOR \\$1
+. \}
+. if '\\$0'CITE_COLOR' \{\
+. nr #BQUOTE_COLOR 1
+. ds $BQUOTE_COLOR \\$1
+. \}
+. if '\\$0'CHAPTER_TITLE_COLOR' \{\
+. nr #CHAPTER_TITLE_COLOR 1
+. ds $CHAPTER_TITLE_COLOR \\$1
+. \}
+. if '\\$0'COVER_ATTRIBUTE_COLOR' \{\
+. nr #COVER_ATTRIBUTE_COLOR 1
+. ds $COVER_ATTRIBUTE_COLOR \\$1
+. \}
+. if '\\$0'COVER_AUTHOR_COLOR' \{\
+. nr #COVER_AUTHOR_COLOR 1
+. ds $COVER_AUTHOR_COLOR \\$1
+. \}
+. if '\\$0'COVER_CHAPTER_TITLE_COLOR' \{\
+. nr #COVER_CHAPTER_TITLE_COLOR 1
+. ds $COVER_CHAPTER_TITLE_COLOR \\$1
+. \}
+. if '\\$0'COVER_COLOR' \{\
+. nr #COVER_COLOR 1
+. ds $COVER_COLOR \\$1
+. \}
+. if '\\$0'COVER_COPYRIGHT_COLOR' \{\
+. nr #COVER_COPYRIGHT_COLOR 1
+. ds $COVER_COPYRIGHT_COLOR \\$1
+. \}
+. if '\\$0'COVER_MISC_COLOR' \{\
+. nr #COVER_MISC_COLOR 1
+. ds $COVER_MISC_COLOR \\$1
+. \}
+. if '\\$0'COVER_TITLE_COLOR' \{\
+. nr #COVER_TITLE_COLOR 1
+. ds $COVER_TITLE_COLOR \\$1
+. \}
+. if '\\$0'COVER_SUBTITLE_COLOR' \{\
+. nr #COVER_SUBTITLE_COLOR 1
+. ds $COVER_SUBTITLE_COLOR \\$1
+. \}
+. if '\\$0'COVER_DOCTYPE_COLOR' \{\
+. nr #COVER_DOCTYPE_COLOR 1
+. ds $COVER_DOCTYPE_COLOR \\$1
+. \}
+. if '\\$0'DOC_COVER_ATTRIBUTE_COLOR' \{\
+. nr #DOC_COVER_ATTRIBUTE_COLOR 1
+. ds $DOC_COVER_ATTRIBUTE_COLOR \\$1
+. \}
+. if '\\$0'DOC_COVER_AUTHOR_COLOR' \{\
+. nr #DOC_COVER_AUTHOR_COLOR 1
+. ds $DOC_COVER_AUTHOR_COLOR \\$1
+. \}
+. if '\\$0'DOC_COVER_CHAPTER_TITLE_COLOR' \{\
+. nr #DOC_COVER_CHAPTER_TITLE_COLOR 1
+. ds $DOC_COVER_CHAPTER_TITLE_COLOR \\$1
+. \}
+. if '\\$0'DOC_COVER_COLOR' \{\
+. nr #DOC_COVER_COLOR 1
+. ds $DOC_COVER_COLOR \\$1
+. \}
+. if '\\$0'DOC_COVER_COPYRIGHT_COLOR' \{\
+. nr #DOC_COVER_COPYRIGHT_COLOR 1
+. ds $DOC_COVER_COPYRIGHT_COLOR \\$1
+. \}
+. if '\\$0'DOC_COVER_MISC_COLOR' \{\
+. nr #DOC_COVER_MISC_COLOR 1
+. ds $DOC_COVER_MISC_COLOR \\$1
+. \}
+. if '\\$0'DOC_COVER_TITLE_COLOR' \{\
+. nr #DOC_COVER_TITLE_COLOR 1
+. ds $DOC_COVER_TITLE_COLOR \\$1
+. \}
+. if '\\$0'DOC_COVER_SUBTITLE_COLOR' \{\
+. nr #DOC_COVER_SUBTITLE_COLOR 1
+. ds $DOC_COVER_SUBTITLE_COLOR \\$1
+. \}
+. if '\\$0'DOC_COVER_DOCTYPE_COLOR' \{\
+. nr #DOC_COVER_DOCTYPE_COLOR 1
+. ds $DOC_COVER_DOCTYPE_COLOR \\$1
+. \}
+. if '\\$0'DOCHEADER_COLOR' \{\
+. nr #DOCHEADER_COLOR 1
+. ds $DOCHEADER_COLOR \\$1
+. \}
+. if '\\$0'DOCTYPE_COLOR' \{\
+. nr #DOCTYPE_COLOR 1
+. ds $DOCTYPE_COLOR \\$1
+. \}
+. if '\\$0'EPIGRAPH_COLOR' \{\
+. nr #EPI_COLOR 1
+. ds $EPI_COLOR \\$1
+. \}
+. if '\\$0'FINIS_COLOR' \{\
+. nr #FINIS_COLOR 1
+. ds $FINIS_COLOR \\$1
+. \}
+. if '\\$0'FOOTNOTE_COLOR' \{\
+. nr #FOOTNOTE_COLOR 1
+. ds $FOOTNOTE_COLOR \\$1
+. \}
+. if '\\$0'HDRFTR_CENTER_COLOR' \{\
+. nr #HDRFTR_CENTER_COLOR 1
+. ds $HDRFTR_CENTER_COLOR \\$1
+. \}
+. if '\\$0'HDRFTR_COLOR' \{\
+. nr #HDRFTR_COLOR 1
+. ds $HDRFTR_COLOR \\$1
+. \}
+. if '\\$0'HDRFTR_LEFT_COLOR' \{\
+. nr #HDRFTR_LEFT_COLOR 1
+. ds $HDRFTR_LEFT_COLOR \\$1
+. \}
+. if '\\$0'HDRFTR_RIGHT_COLOR' \{\
+. nr #HDRFTR_RIGHT_COLOR 1
+. ds $HDRFTR_RIGHT_COLOR \\$1
+. \}
+. if '\\$0'HDRFTR_RULE_COLOR' \{\
+. nr #HDRFTR_RULE_COLOR 1
+. ds $HDRFTR_RULE_COLOR \\$1
+. \}
+. if '\\$0'HEAD_COLOR' \{\
+. nr #HEAD_COLOR 1
+. ds $HEAD_COLOR \\$1
+. \}
+. if '\\$0'LINEBREAK_COLOR' \{\
+. nr #LINEBREAK_COLOR 1
+. ds $LINEBREAK_COLOR \\$1
+. \}
+. if '\\$0'PAGENUM_COLOR' \{\
+. nr #PAGE_NUM_COLOR 1
+. ds $PAGENUM_COLOR \\$1
+. \}
+. if '\\$0'PARAHEAD_COLOR' \{\
+. nr #PH_COLOR 1
+. ds $PH_COLOR \\$1
+. \}
+. if '\\$0'QUOTE_COLOR' \{\
+. nr #QUOTE_COLOR 1
+. ds $QUOTE_COLOR \\$1
+. \}
+. if '\\$0'SUBHEAD_COLOR' \{\
+. nr #SH_COLOR 1
+. ds $SH_COLOR \\$1
+. \}
+. if '\\$0'SUBTITLE_COLOR' \{\
+. nr #SUBTITLE_COLOR 1
+. ds $SUBTITLE_COLOR \\$1
+. \}
+. if '\\$0'TITLE_COLOR' \{\
+. nr #TITLE_COLOR 1
+. ds $TITLE_COLOR \\$1
+. \}
+.END
+\#
+\#
+.MAC _QUAD END
+. if '\\$0'BIBLIOGRAPHY_QUAD' \{\
+. ds $BIB_QUAD \\$1
+. if '\\*[$BIB_QUAD]'R' .ab Fatal error: \\$0 must be set to either L or J
+. if '\\*[$BIB_QUAD]'C' .ab Fatal error: \\$0 must be set to either L or J
+. \}
+. if '\\$0'BIBLIOGRAPHY_STRING_QUAD' .ds $BIB_STRING_QUAD \\$1
+. if '\\$0'BLOCKQUOTE_QUAD' .ds $BQUOTE_QUAD \\$1
+. if '\\$0'CITATION_QUAD' .ds $BQUOTE_QUAD \\$1
+. if '\\$0'CITE_QUAD' .ds $BQUOTE_QUAD \\$1
+. if '\\$0'COVER_COPYRIGHT_QUAD' .ds $COVER_COPYRIGHT_QUAD \\$1
+. if '\\$0'COVER_MISC_QUAD' .ds $COVER_MISC_QUAD \\$1
+. if '\\$0'DOC_COVER_COPYRIGHT_QUAD' .ds $DOC_COVER_COPYRIGHT_QUAD \\$1
+. if '\\$0'DOC_COVER_MISC_QUAD' .ds $DOC_COVER_MISC_QUAD \\$1
+. if '\\$0'DOC_QUAD' \{\
+. ds $DOC_QUAD \\$1
+. QUAD \\*[$DOC_QUAD]
+. \}
+. if '\\$0'ENDNOTE_QUAD' \{\
+. ds $EN_QUAD \\$1
+. if '\\*[$EN_QUAD]'R' .ab Fatal error: \\$0 must be set to either L or J
+. if '\\*[$EN_QUAD]'C' .ab Fatal error: \\$0 must be set to either L or J
+. \}
+. if '\\$0'ENDNOTE_STRING_QUAD' .ds $EN_STRING_QUAD \\$1
+. if '\\$0'ENDNOTE_TITLE_QUAD' .ds $EN_TITLE_QUAD \\$1
+. if '\\$0'EPIGRAPH_QUAD' .ds $EPI_QUAD \\$1
+. if '\\$0'FOOTNOTE_QUAD' .ds $FN_QUAD \\$1
+. if '\\$0'HEAD_QUAD' .ds $HEAD_QUAD \\$1
+. if '\\$0'SUBHEAD_QUAD' .ds $SH_QUAD \\$1
+. if '\\$0'TOC_HEADER_QUAD' .ds $TOC_HEADER_QUAD \\$1
+.END
+\#
+\#
\# DEFAULTS
\# --------
\# *Arguments:
@@ -3612,7 +4511,10 @@ y\\R'#DESCENDER \\n[.cdp]'
.MAC DEFAULTS END
. if !d$PAPER \{ .PAPER LETTER \}
. if !\\n[#DOC_TYPE] \{ .DOCTYPE DEFAULT \}
-. if \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
+. ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
+. el \{\
+. if !\\n[#COPY_STYLE]=1 \{ .PAGENUM_STYLE DIGIT \}
+. \}
. if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
. if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
. if \\n[#DOC_TYPE]=4 \{\
@@ -3646,36 +4548,52 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. if !r#T_MARGIN \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
-. if !r#DOCHEADER_ADVANCE \{ .DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
+. if !r#DOCHEADER_ADVANCE \{ .nr #DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
. if !r#FOOTER_MARGIN \{ .FOOTER_MARGIN 3P \}
. if !r#FOOTER_GAP \{ .FOOTER_GAP 3P \}
. if !r#B_MARGIN \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
+. if (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
+. tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
+. tm1 " No footers or bottom-of-page page numbers will be printed.
+. tm1 " Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
+. tm1 " If no footers or bottom-of-page page numbers are required,
+. tm1 " type in .FOOTER_MARGIN 0 before .START
+. \}
. if !r#HDRFTR_RULE_GAP \{\
. if \\n[#HEADERS_ON] \{ .HDRFTR_RULE_GAP 4p \}
. if \\n[#FOOTERS_ON] \{ .HDRFTR_RULE_GAP 4p \}
. \}
-. if !r#HDRFTR_RULE \{ .HDRFTR_RULE \}
-. if !r#PAGE_NUM_SET \{ .PAGENUMBER 1 \}
-. ie r#ADJ_DOC_LEAD \{ . \}
-. el \{ .DOC_LEAD_ADJUST \}
-\# Read in number registers and strings for type parameters
+. if !r#HDRFTR_RULE \{ .HDRFTR_RULE \}
+. if !r#PAGE_NUM_SET \{ .PAGENUMBER 1 \}
+.\" Read in number registers and strings for type parameters
. nr #DOC_L_MARGIN \\n[#L_MARGIN]
. nr #DOC_L_LENGTH \\n[#L_LENGTH]
. nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
. ds $DOC_FAM \\*[$FAMILY]
. nr #DOC_PT_SIZE \\n[#PT_SIZE]
. nr #DOC_LEAD \\n[#LEAD]
+.\" #SAVED_DOC_LEAD is set in COLLATE
+. if r#SAVED_DOC_LEAD \{\
+. if !\\n[#DOC_LEAD]=\\n[#SAVED_DOC_LEAD] \{ .nr #RERUN_TRAPS 1 \}
+. \}
+. ie \\n[#ADJ_DOC_LEAD]=1 \{ . \}
+. el \{\
+. if !\\n[#DOC_LEAD_ADJUST_OFF] \{\
+. DOC_LEAD_ADJUST
+. \}
+. \}
. ds $DOC_QUAD \\*[$QUAD_VALUE]
. ds $PP_FT \\*[$FONT]
-\# Counters
+.\" Counters
. nr #PP 0
. nr #FN_NUMBER 0 1
. nr #EN_NUMBER 0 1
. nr #FN_COUNT_FOR_COLS 0 1
+. nr #DONE_ONCE 0 1
. RESET_HEAD_NUMBER
. RESET_SUBHEAD_NUMBER
. RESET_PARAHEAD_NUMBER
-\# General style defaults for both PRINTSTYLEs
+.\" General style defaults for both PRINTSTYLEs
. nr #PP_STYLE 1
. PARA_INDENT \\n[#PP_INDENT]u
. if !d$HDRFTR_FAM \{ .HDRFTR_FAMILY \\*[$DOC_FAM] \}
@@ -3697,19 +4615,22 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
. if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
. \}
-. if !d$FN_FAM \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
-. if !d$FN_FT \{ .FOOTNOTE_FONT R \}
-. if !d$FN_QUAD \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD] \}
-. if !r#FN_RULE \{ .FOOTNOTE_RULE \}
-. if !r#FN_MARKERS \{ .FOOTNOTE_MARKERS \}
-. if !r#FN_MARKER_STYLE \{ .FOOTNOTE_MARKER_STYLE STAR \}
-. if !d$EN_FAM \{ .ENDNOTE_FAMILY \\*[$DOC_FAM] \}
-. if !d$EN_FN \{ .ENDNOTE_FONT R \}
-. if !d$EN_QUAD \{ .ENDNOTE_QUAD \\*[$DOC_QUAD] \}
-. if !d$EN_STRING \{ .ENDNOTE_STRING "ENDNOTES" \}
-. if !d$EN_STRING_FAM \{ .ENDNOTE_STRING_FAMILY \\*[$DOC_FAM] \}
-. if !d$EN_STRING_QUAD \{ .ENDNOTE_STRING_QUAD CENTER \}
-. if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2 \}
+. if !d$FN_FAM \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
+. if !d$FN_FT \{ .FOOTNOTE_FONT R \}
+. if !d$FN_QUAD \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD] \}
+. if !r#FN_RULE \{ .FOOTNOTE_RULE \}
+. if !r#FN_MARKERS \{ .FOOTNOTE_MARKERS \}
+. if !\\n[#FN_MARKER_STYLE] \{ .FOOTNOTE_MARKER_STYLE STAR \}
+. if !\\n[#EN_MARKER_STYLE] \{ .ENDNOTE_MARKER_STYLE NUMBER \}
+. if !d$EN_PN_STYLE \{ .ENDNOTES_PAGENUM_STYLE digit \}
+. if !d$EN_FAM \{ .ENDNOTE_FAMILY \\*[$DOC_FAM] \}
+. if !d$EN_FT \{ .ENDNOTE_FONT R \}
+. if !d$EN_QUAD \{ .ENDNOTE_QUAD \\*[$DOC_QUAD] \}
+. if !d$EN_STRING \{ .ENDNOTE_STRING "Endnotes" \}
+. if !d$EN_STRING_FAM \{ .ENDNOTE_STRING_FAMILY \\*[$EN_FAM] \}
+. if !d$EN_STRING_QUAD \{ .ENDNOTE_STRING_QUAD CENTER \}
+. if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2 \}
+. if !r#EN_STRING_CAPS \{ .ENDNOTE_STRING_CAPS \}
. if !d$EN_TITLE \{\
. ie \\n[#DOC_TYPE]=2 \{\
. ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
@@ -3717,68 +4638,228 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
. \}
-. if !d$EN_TITLE_FAM \{ .ENDNOTE_TITLE_FAM \\*[$DOC_FAM] \}
-. if !d$EN_TITLE_QUAD \{ .ENDNOTE_TITLE_QUAD LEFT \}
-. if !r#EN_TITLE_UNDERSCORE \{ .ENDNOTE_TITLE_UNDERSCORE \}
-. if !d$EN_NUMBER_FAM \{ .ENDNOTE_NUMBER_FAMILY \\*[$DOC_FAM] \}
-. if !r#EN_NUMBERS_ALIGN_LEFT \{\
-. if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2 \}
-. \}
-\# String defaults for both PRINTSTYLEs
-. if !d$ATTRIBUTE_STRING \{ .ATTRIBUTE_STRING "by" \}
-. if \\n[#USER_DEF_HDRFTR_LEFT]=0 \{ .ds $HDRFTR_LEFT \\*[$AUTHOR_1] \}
-. rr #USER_DEF_HDRFTR_LEFT
-. if \\n[#USER_DEF_HDRFTR_RIGHT]=0 \{ .ds $HDRFTR_RIGHT \\*[$TITLE] \}
-. rr #USER_DEF_HDRFTR_RIGHT
-. if !d$FINIS_STRING \{ .FINIS_STRING "END" \}
-\# Defaults for printstyle TYPEWRITE
+. if !d$EN_TITLE_FAM \{ .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM] \}
+. if !d$EN_TITLE_QUAD \{ .ENDNOTE_TITLE_QUAD LEFT \}
+. if !r#EN_TITLE_UNDERSCORE \{ .ENDNOTE_TITLE_UNDERSCORE \}
+. if !d$EN_NUMBER_FAM \{ .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] \}
+. if !r#EN_NUMBERS_ALIGN_LEFT \{\
+. if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2 \}
+. \}
+. if !d$EN_LN_GAP \{ .ENDNOTE_LINENUMBER_GAP 1.5n \}
+. if !d$BIB_PN_STYLE \{ .BIBLIOGRAPHY_PAGENUM_STYLE digit \}
+. if !d$BIB_FAM \{ .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM] \}
+. if !d$BIB_FT \{ .BIBLIOGRAPHY_FONT R \}
+. if !d$BIB_QUAD \{ .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD] \}
+. if !d$BIB_STRING \{ .BIBLIOGRAPHY_STRING "Bibliography" \}
+. if !d$BIB_STRING_FAM \{ .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FAM] \}
+. if !d$BIB_STRING_QUAD \{ .BIBLIOGRAPHY_STRING_QUAD CENTER \}
+. if !r#BIB_STRING_UNDERSCORE \{ .BIBLIOGRAPHY_STRING_UNDERSCORE 2 \}
+. if !r#BIB_STRING_CAPS \{ .BIBLIOGRAPHY_STRING_CAPS \}
+. if !d$TOC_HEADER_STRING \{ .TOC_HEADER_STRING "Contents" \}
+. if !d$TOC_HEADER_QUAD \{ .TOC_HEADER_QUAD LEFT \}
+. if !d$TOC_PN_STYLE \{ .TOC_PAGENUM_STYLE roman \}
+. if !r#TOC_PN_PADDING \{ .TOC_PADDING 3 \}
+. if !r#TOC_TITLE_INDENT \{ .TOC_TITLE_INDENT 0 \}
+. if !r#TOC_HEAD_INDENT \{ .TOC_HEAD_INDENT 18p \}
+. if !r#TOC_SH_INDENT \{ .TOC_SUBHEAD_INDENT 30p \}
+. if !r#TOC_PH_INDENT \{ .TOC_PARAHEAD_INDENT 42p \}
+.\" String defaults for both PRINTSTYLEs
+. ie \\n[#DOC_TYPE]=1 \{\
+. ie '\\*[$DOC_TITLE]'' \{\
+. if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
+. rr #USER_DEF_HDRFTR_LEFT
+. if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
+. rr #USER_DEF_HDRFTR_RIGHT
+. \}
+. el \{\
+. if \\n[#COPY_STYLE]=1 \{ .DRAFT_WITH_PAGENUMBER \}
+. if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
+. rr #USER_DEF_HDRFTR_LEFT
+. if \\n[#USER_DEF_HDRFTR_CENTER]=0 .ds $HDRFTR_CENTER \\*[$TITLE]
+. rr #USER_DEF_HDRFTR_CENTER
+. if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$DOC_TITLE]
+. rr #USER_DEF_HDRFTR_RIGHT
+. \}
+. \}
+. el \{\
+. if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
+. rr #USER_DEF_HDRFTR_LEFT
+. if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
+. rr #USER_DEF_HDRFTR_RIGHT
+. \}
+. if !d$ATTRIBUTE_STRING \{ .ATTRIBUTE_STRING "by" \}
+. if !d$FINIS_STRING \{ .FINIS_STRING "END" \}
+.\" Covers
+. if !r#DOC_COVERS_OFF \{ .nr #DOC_COVERS 1 \}
+. if !r#COVERS_OFF \{ .nr #COVERS 1 \}
+. if !d$COVER_COPYRIGHT_QUAD \{ .COVER_COPYRIGHT_QUAD R \}
+. if !d$COVER_MISC_QUAD \{ .COVER_MISC_QUAD L \}
+. if !d$DOC_COVER_COPYRIGHT_QUAD \{ .DOC_COVER_COPYRIGHT_QUAD R \}
+. if !d$DOC_COVER_MISC_QUAD \{ .DOC_COVER_MISC_QUAD L \}
+.\" Defaults for printstyle TYPEWRITE
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES \}
. if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF \}
+.\" +Quotes and blockquotes
. if !r#Q_OFFSET_VALUE \{ .QUOTE_INDENT 2 \}
+.\" +Epigraphs
. if !r#EPI_OFFSET_VALUE \{ .EPIGRAPH_INDENT 2 \}
+.\" +Linebreaks
. if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 2p \}
+.\" +Footnotes
. if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE +0 \}
. if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 2i \}
+.\" +Paragraph heads
+. if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
+.\" +Endnotes
+. if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
+.\" +Footnotes
. if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 6p \}
+.\" +Slant stuff
. if !r#SLANT_MEANS_SLANT \{\
. ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
. el \{ .UNDERLINE_SLANT OFF \}
. \}
-. if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
-. if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
. \}
-\# Defaults for printstyle TYPESET
+.\" Defaults for printstyle TYPESET
. if \\n[#PRINT_STYLE]=2 \{\
-. if !r#DOCHEADER_LEAD_ADJ \{\
+. if !d$DOCHEADER_LEAD_ADJ \{\
. ie !'\\*[$CHAPTER_TITLE]'' \{\
. ie !'\\*[$CHAPTER_STRING]'' \{\
-. DOCHEADER_LEAD +4p
+. DOCHEADER_LEAD +4
. \}
. el \{ .DOCHEADER_LEAD +0 \}
. \}
. el \{ .DOCHEADER_LEAD +0 \}
. \}
-. if !d$TITLE_FAM \{ .TITLE_FAMILY \\*[$DOC_FAM] \}
-. if !d$TITLE_FT \{ .TITLE_FONT B \}
+.\" +Cover
+. if !d$COVER_LEAD_ADJ \{ .COVER_LEAD +0 \}
+. if !d$COVER_FAM \{ .COVER_FAMILY \\*[$DOC_FAM] \}
+.\" (title)
+. if !d$COVER_TITLE_FAM \{\
+. ie !d$COVER_FAM \{ .COVER_TITLE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .COVER_TITLE_FAMILY \\*[$COVER_FAM] \}
+. \}
+. if !d$COVER_TITLE_FT \{ .COVER_TITLE_FONT B \}
+. if !d$COVER_TITLE_SIZE_CHANGE \{ .COVER_TITLE_SIZE +3.5 \}
+.\" (chapter title)
+. if !d$COVER_CHAPTER_TITLE_FAM \{\
+. ie !d$COVER_FAM \{ .COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .COVER_CHAPTER_TITLE_FAMILY \\*[$COVER_FAM] \}
+. \}
+. if !d$COVER_CHAPTER_TITLE_FT \{ .COVER_CHAPTER_TITLE_FONT BI \}
+. if !d$COVER_CHAPTER_TITLE_SIZE_CHANGE \{ .COVER_CHAPTER_TITLE_SIZE +4 \}
+.\" (subtitle)
+. if !d$COVER_SUBTITLE_FAM \{\
+. ie !d$COVER_FAM \{ .COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .COVER_SUBTITLE_FAMILY \\*[$COVER_FAM] \}
+. \}
+. if !d$COVER_SUBTITLE_FT \{ .COVER_SUBTITLE_FONT R \}
+. if !d$COVER_SUBTITLE_SIZE_CHANGE \{ .COVER_SUBTITLE_SIZE +0 \}
+.\" (attribution and author[s])
+. if !d$COVER_AUTHOR_FAM \{\
+. ie !d$COVER_FAM \{ .COVER_AUTHOR_FAMILY \\*[$DOC_FAM] \}
+. el \{ .COVER_AUTHOR_FAMILY \\*[$COVER_FAM] \}
+. \}
+. if !d$COVER_AUTHOR_FT \{ .COVER_AUTHOR_FONT I \}
+. if !d$COVER_AUTHOR_SIZE_CHANGE \{ .COVER_AUTHOR_SIZE +0 \}
+.\" (doctype if "named")
+. if !d$COVER_DOCTYPE_FAM \{\
+. ie !d$COVER_FAM \{ .COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .COVER_DOCTYPE_FAMILY \\*[$COVER_FAM] \}
+. \}
+. if !d$COVER_DOCTYPE_FT \{ .COVER_DOCTYPE_FONT BI \}
+. if !d$COVER_DOCTYPE_SIZE_CHANGE \{ .COVER_DOCTYPE_SIZE +3 \}
+.\" (copyright)
+. if !d$COVER_COPYRIGHT_FAM \{\
+. ie !d$COVER_FAM \{ .COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] \}
+. el \{ .COVER_COPYRIGHT_FAMILY \\*[$COVER_FAM] \}
+. \}
+. if !d$COVER_COPYRIGHT_FT \{ .COVER_COPYRIGHT_FONT R \}
+. if !d$COVER_COPYRIGHT_SIZE_CHANGE \{ .COVER_COPYRIGHT_SIZE -2 \}
+.\" +Doc cover
+. if !d$DOC_COVER_LEAD_ADJ \{ .DOC_COVER_LEAD +0 \}
+. if !d$DOC_COVER_FAM \{ .DOC_COVER_FAMILY \\*[$DOC_FAM] \}
+.\" (title)
+. if !d$DOC_COVER_TITLE_FAM \{\
+. ie !d$DOC_COVER_FAM \{ .DOC_COVER_TITLE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .DOC_COVER_TITLE_FAMILY \\*[$DOC_COVER_FAM] \}
+. \}
+. if !d$DOC_COVER_TITLE_FT \{ .DOC_COVER_TITLE_FONT B \}
+. if !d$DOC_COVER_TITLE_SIZE_CHANGE \{ .DOC_COVER_TITLE_SIZE +3.5 \}
+.\" (chapter title)
+. if !d$DOC_COVER_CHAPTER_TITLE_FAM \{\
+. ie !d$DOC_COVER_FAM \{ .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_COVER_FAM] \}
+. \}
+. if !d$DOC_COVER_CHAPTER_TITLE_FT \{ .DOC_COVER_CHAPTER_TITLE_FONT BI \}
+. if !d$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \{ .DOC_COVER_CHAPTER_TITLE_SIZE +4 \}
+.\" (subtitle)
+. if !d$DOC_COVER_SUBTITLE_FAM \{\
+. ie !d$DOC_COVER_FAM \{ .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_COVER_FAM] \}
+. \}
+. if !d$DOC_COVER_SUBTITLE_FT \{ .DOC_COVER_SUBTITLE_FONT R \}
+. if !d$DOC_COVER_SUBTITLE_SIZE_CHANGE \{ .DOC_COVER_SUBTITLE_SIZE +0 \}
+.\" (attribution and author[s])
+. if !d$DOC_COVER_AUTHOR_FAM \{\
+. ie !d$DOC_COVER_FAM \{ .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_FAM] \}
+. el \{ .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_COVER_FAM] \}
+. \}
+. if !d$DOC_COVER_AUTHOR_FT \{ .DOC_COVER_AUTHOR_FONT I \}
+. if !d$DOC_COVER_AUTHOR_SIZE_CHANGE \{ .DOC_COVER_AUTHOR_SIZE +0 \}
+.\" (doctype if "named")
+. if !d$DOC_COVER_DOCTYPE_FAM \{\
+. ie !d$DOC_COVER_FAM \{ .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_COVER_FAM] \}
+. \}
+. if !d$DOC_COVER_DOCTYPE_FT \{ .DOC_COVER_DOCTYPE_FONT BI \}
+. if !d$DOC_COVER_DOCTYPE_SIZE_CHANGE \{ .DOC_COVER_DOCTYPE_SIZE +3 \}
+.\" (copyright)
+. if !d$DOC_COVER_COPYRIGHT_FAM \{\
+. ie !d$DOC_COVER_FAM \{ .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] \}
+. el \{ .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_COVER_FAM] \}
+. \}
+. if !d$DOC_COVER_COPYRIGHT_FT \{ .DOC_COVER_COPYRIGHT_FONT R \}
+. if !d$DOC_COVER_COPYRIGHT_SIZE_CHANGE \{ .DOC_COVER_COPYRIGHT_SIZE -2 \}
+.\" +Docheader
+. if !d$DOCHEADER_FAM \{ .DOCHEADER_FAMILY \\*[$DOC_FAM] \}
+. if !d$TITLE_FAM \{\
+. ie !d$DOCHEADER_FAM \{ .TITLE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .TITLE_FAMILY \\*[$DOCHEADER_FAM] \}
+. \}
+. if !d$TITLE_FT \{ .TITLE_FONT B \}
. if !d$TITLE_SIZE_CHANGE \{\
. ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
. el \{ .TITLE_SIZE +3.5 \}
. \}
-. if !d$CHAPTER_TITLE_FAM \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
-. if !d$CHAPTER_TITLE_FT \{ .CHAPTER_TITLE_FONT BI \}
-. if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE +4 \}
-. if !d$SUBTITLE_FAM \{ .SUBTITLE_FAMILY \\*[$DOC_FAM] \}
-. if !d$SUBTITLE_FT \{ .SUBTITLE_FONT R \}
-. if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE +0 \}
-. if !d$AUTHOR_FAM \{ .AUTHOR_FAMILY \\*[$DOC_FAM] \}
-. if !d$AUTHOR_FT \{ .AUTHOR_FONT I \}
-. if !d$AUTHOR_SIZE_CHANGE \{ .AUTHOR_SIZE +0 \}
-. if !d$DOCTYPE_FAM \{ .DOCTYPE_FAMILY \\*[$DOC_FAM] \}
-. if !d$DOCTYPE_FT \{ .DOCTYPE_FONT BI \}
-. if !d$DOCTYPE_SIZE_CHANGE \{ .DOCTYPE_SIZE +3 \}
+. if !d$CHAPTER_TITLE_FAM \{\
+. ie !d$DOCHEADER_FAM \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .CHAPTER_TITLE_FAMILY \\*[$DOCHEADER_FAM] \}
+. \}
+. if !d$CHAPTER_TITLE_FT \{ .CHAPTER_TITLE_FONT BI \}
+. if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE +4 \}
+. if !d$SUBTITLE_FAM \{\
+. ie !d$DOCHEADER_FAM \{ .SUBTITLE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .SUBTITLE_FAMILY \\*[$DOCHEADER_FAM] \}
+. \}
+. if !d$SUBTITLE_FT \{ .SUBTITLE_FONT R \}
+. if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE +0 \}
+. if !d$AUTHOR_FAM \{\
+. ie !d$DOCHEADER_FAM \{ .AUTHOR_FAMILY \\*[$DOC_FAM] \}
+. el \{ .AUTHOR_FAMILY \\*[$DOCHEADER_FAM] \}
+. \}
+. if !d$AUTHOR_FT \{ .AUTHOR_FONT I \}
+. if !d$AUTHOR_SIZE_CHANGE \{ .AUTHOR_SIZE +0 \}
+. if !d$DOCTYPE_FAM \{\
+. ie !d$DOCHEADER_FAM \{ .DOCTYPE_FAMILY \\*[$DOC_FAM] \}
+. el \{ .DOCTYPE_FAMILY \\*[$DOCHEADER_FAM] \}
+. \}
+. if !d$DOCTYPE_FT \{ .DOCTYPE_FONT BI \}
+. if !d$DOCTYPE_SIZE_CHANGE \{ .DOCTYPE_SIZE +3 \}
+.\" +Headers and footers
. if !d$HDRFTR_LEFT_FAM \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
-. if !d$HDRFTR_LEFT_FT \{ .HDRFTR_LEFT_FONT R \}
+. if !d$HDRFTR_LEFT_FT \{ .HDRFTR_LEFT_FONT R \}
. if \\n[#HDRFTR_LEFT_CAPS] \{\
. if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -2 \}
. \}
@@ -3788,54 +4869,172 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#HDRFTR_CENTER_CAPS] \{\
. if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
. \}
-. if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5 \}
-. if !d$HDRFTR_RIGHT_FAM \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] \}
-. if !d$HDRFTR_RIGHT_FT \{ .HDRFTR_RIGHT_FONT R \}
+. if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5 \}
+. if !d$HDRFTR_RIGHT_FAM \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] \}
+. if !d$HDRFTR_RIGHT_FT \{ .HDRFTR_RIGHT_FONT R \}
. if \\n[#HDRFTR_RIGHT_CAPS] \{\
. if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
. \}
. if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -.5 \}
+.\" +Heads
. if !d$HEAD_FAM \{ .HEAD_FAMILY \\*[$DOC_FAM] \}
. if !d$HEAD_FT \{ .HEAD_FONT B \}
. if !d$HEAD_SIZE_CHANGE \{ .HEAD_SIZE +1 \}
. if !r#HEAD_SPACE \{ .HEAD_SPACE \}
+.\" +Subheads
. if !d$SH_FAM \{ .SUBHEAD_FAMILY \\*[$DOC_FAM] \}
. if !d$SH_FT \{ .SUBHEAD_FONT B \}
. if !d$SH_SIZE_CHANGE \{ .SUBHEAD_SIZE +.5 \}
+.\" +Paragraph heads
. if !d$PH_FAM \{ .PARAHEAD_FAMILY \\*[$DOC_FAM] \}
. if !d$PH_FT \{ .PARAHEAD_FONT BI \}
. if !d$PH_SIZE_CHANGE \{ .PARAHEAD_SIZE -.25 \}
. if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
+.\" +Quotes
. if !d$QUOTE_FAM \{ .QUOTE_FAMILY \\*[$DOC_FAM] \}
. if !d$QUOTE_FT \{ .QUOTE_FONT I \}
. if !d$QUOTE_SIZE_CHANGE \{ .QUOTE_SIZE +0 \}
. if !r#Q_OFFSET_VALUE \{ .QUOTE_INDENT 3 \}
+.\" +Blockquotes
+.\" Note: the leading for quotes and blockquotes is set after .DEFAULTS in START
. if !d$BQUOTE_FAM \{ .BLOCKQUOTE_FAMILY \\*[$DOC_FAM] \}
. if !d$BQUOTE_FT \{ .BLOCKQUOTE_FONT R \}
. if !d$BQUOTE_SIZE_CHANGE \{ .BLOCKQUOTE_SIZE -1 \}
. if !d$BQUOTE_QUAD \{ .BLOCKQUOTE_QUAD LEFT \}
+.\" +Epigraphs
. if !d$EPI_FAM \{ .EPIGRAPH_FAMILY \\*[$DOC_FAM] \}
. if !d$EPI_FT \{ .EPIGRAPH_FONT R \}
. if !d$EPI_SIZE_CHANGE \{ .EPIGRAPH_SIZE -1.5 \}
. if !r#EPI_AUTOLEAD \{ .EPIGRAPH_AUTOLEAD 2 \}
. if !d$EPI_QUAD \{ .EPIGRAPH_QUAD \\*[$DOC_QUAD] \}
. if !r#EPI_OFFSET_VALUE \{ .EPIGRAPH_INDENT 3 \}
+.\" +Linebreaks
. if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 3p \}
+.\" +Footnotes
. if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 4P \}
. if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 3p \}
. if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE -2 \}
. if !r#FN_AUTOLEAD \{ .FOOTNOTE_AUTOLEAD 2 \}
+.\" +Endnotes
. if !r#EN_PS \{ .ENDNOTE_PT_SIZE \\n[#DOC_PT_SIZE]u \}
-. if !r#EN_LEAD \{ .ENDNOTE_LEAD 13.5p \}
. if !d$EN_STRING_FT \{ .ENDNOTE_STRING_FONT B \}
. if !d$EN_STRING_SIZE_CHANGE \{ .ENDNOTE_STRING_SIZE +1 \}
. if !d$EN_TITLE_FT \{ .ENDNOTE_TITLE_FONT B \}
-. if !d$EN_TITLE_SIZE_CHANGE \{ .ENDNOTE_TITLE_SIZE 0 \}
+. if !d$EN_TITLE_SIZE_CHANGE \{ .ENDNOTE_TITLE_SIZE +0 \}
. if !d$EN_NUMBER_FT \{ .ENDNOTE_NUMBER_FONT B \}
-. if !$EN_NUMBER_SIZE_CHANGE \{ .ENDNOTE_NUMBER_SIZE 0 \}
+. if !d$EN_NUMBER_SIZE_CHANGE \{ .ENDNOTE_NUMBER_SIZE +0 \}
. if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT 1.5m \}
+.\" +Bibliography
+. if !r#BIB_LIST \{ .BIBLIOGRAPHY_TYPE LIST . \}
+. if !r#BIB_PS \{ .BIBLIOGRAPHY_PT_SIZE \\n[#DOC_PT_SIZE]u \}
+. if !d$BIB_STRING_FT \{ .BIBLIOGRAPHY_STRING_FONT B \}
+. if !d$BIB_STRING_SIZE_CHANGE \{ .BIBLIOGRAPHY_STRING_SIZE +1 \}
+.\" +Table of contents
+. if !d$TOC_FAM \{ .TOC_FAMILY \\*[$DOC_FAM] \}
+. if !r#TOC_PS \{ .TOC_PT_SIZE \\n[#DOC_PT_SIZE]u \}
+. if !r#TOC_LEAD \{ .TOC_LEAD \\n[#DOC_LEAD]u ADJUST \}
+. if !d$TOC_HEADER_FAM \{ .TOC_HEADER_FAMILY \\*[$TOC_FAM] \}
+. if !d$TOC_HEADER_SIZE_CHANGE \{ .TOC_HEADER_SIZE +4 \}
+. if !d$TOC_HEADER_FT \{ .TOC_HEADER_FONT B \}
+. if !d$TOC_TITLE_FAM \{ .TOC_TITLE_FAMILY \\*[$TOC_FAM] \}
+. if !d$TOC_PN_FAM \{ .TOC_PN_FAMILY \\*[$TOC_FAM] \}
+. if !d$TOC_HEAD_FAM \{ .TOC_HEAD_FAMILY \\*[$TOC_FAM] \}
+. if !d$TOC_SH_FAM \{ .TOC_SUBHEAD_FAMILY \\*[$TOC_FAM] \}
+. if !d$TOC_PH_FAM \{ .TOC_PARAHEAD_FAMILY \\*[$TOC_FAM] \}
+. if !d$TOC_TITLE_FT \{ .TOC_TITLE_FONT BI \}
+. if !d$TOC_PN_FT \{ .TOC_PN_FONT R \}
+. if !d$TOC_HEAD_FT \{ .TOC_HEAD_FONT B \}
+. if !d$TOC_SH_FT \{ .TOC_SUBHEAD_FONT R \}
+. if !d$TOC_PH_FT \{ .TOC_PARAHEAD_FONT I \}
+. if !d$TOC_TITLE_SIZE_CHANGE \{ .TOC_TITLE_SIZE +.5 \}
+. if !d$TOC_PN_SIZE_CHANGE \{ .TOC_PN_SIZE +0 \}
+. if !d$TOC_HEAD_SIZE_CHANGE \{ .TOC_HEAD_SIZE +.5 \}
+. if !d$TOC_SH_SIZE_CHANGE \{ .TOC_SUBHEAD_SIZE +0 \}
+. if !d$TOC_PH_SIZE_CHANGE \{ .TOC_PARAHEAD_SIZE +0 \}
+. \}
+.\" +Refer support
+. if !r#ENDNOTE_REFS \{ .nr #FN_REFS 1 \}
+. if '\\*[$REF_FN_INDENT]'' \{\
+. if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS FOOTNOTE 2m \}
+. if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS FOOTNOTE 1.5m \}
+. \}
+. if '\\*[$REF_EN_INDENT]'' \{\
+. if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS ENDNOTE 2m \}
+. if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS ENDNOTE 1.5m \}
+. \}
+. if '\\*[$REF_BIB_INDENT]'' \{\
+. if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS BIBLIO 2m \}
+. if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS BIBLIO 1.5m :\}
+. \}
+.\" Adjust doc leading for PRINTSTYLE TYPESET
+. if \\n[#PRINT_STYLE]=2 \{\
+. ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
+. el \{ . \}
+. \}
+.\" This diversion is to get a value for #FN_AUTOLEAD
+. di NULL
+. ev NULL
+. if \\n[#PRINT_STYLE]=1 \{\
+. ps 12
+. ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
+. el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
+. AUTOLEAD \\n[#FN_AUTOLEAD]
+. \}
+. nr #FN_LEAD \\n[#LEAD]
+. if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u \}
+. ev
+. di
+. ie !\\n[#COLLATE] \{\
+.\" DOC_LEAD adjusted (or not) here
+. TRAPS
+. rr #DOC_LEAD_ADJUST_OFF
+.\" Endnote, bibliography and toc leading
+. nr #OK_PROCESS_LEAD 1
+. nr #RESTORE_DOC_LEAD \\n(.v
+. nr #RESTORE_B_MARGIN \\n[#B_MARGIN]
+. if \\n[#PRINT_STYLE]=1 \{\
+. ie \\n[#SINGLE_SPACE] \{\
+. ENDNOTE_LEAD 12 ADJUST
+. BIBLIOGRAPHY_LEAD 12 ADJUST
+. \}
+. el \{\
+. ie \\n[#EN_SINGLESPACE] \{ .ENDNOTE_LEAD 12 ADJUST \}
+. el \{ .ENDNOTE_LEAD 24 ADJUST \}
+. ie \\n[#BIB_SINGLESPACE] \{ .BIBLIOGRAPHY_LEAD 12 ADJUST \}
+. el \{ .BIBLIOGRAPHY_LEAD 24 ADJUST \}
+. \}
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. ie !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
+. el \{ .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] \}
+. ie !d$BIB_LEAD \{ .BIBLIOGRAPHY_LEAD 14 ADJUST \}
+. el \{ .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD] \}
+. ie !d$TOC_LEAD \{ .TOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
+. el \{ .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] \}
+. rm $ADJUST_EN_LEAD
+. rm $ADJUST_BIB_LEAD
+. rm $ADJUST_TOC_LEAD
+. \}
+. ie !d$BIB_SPACE \{ .BIBLIOGRAPHY_SPACING 1v \}
+. el \{\
+. if \\n[#DEFER_BIB_SPACING]=1 \{\
+. BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE]
+. rr #DEFER_BIB_SPACING
+. \}
+. \}
+. DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
+. nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
+. \}
+. el \{\
+. if \\n[#COLLATE] \{\
+. if !\\n[#PRINT_STYLE]=1 \{\
+. if \\n[#RERUN_TRAPS] \{ .TRAPS \}
+. \}
+. \}
. \}
-. TRAPS
. if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
.END
\#
@@ -3861,44 +5060,94 @@ y\\R'#DESCENDER \\n[.cdp]'
\# are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
\# use in the HEADER and FOOTER macros.
\#
-.\" First, define some strings for point sizes
-\#
-.ds $TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
-.ds $CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
-.ds $SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
-.ds $AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
-.ds $DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
-\#
-.\" Next, some utility macros for various routines to prevent repetition
+\# First, define some strings for point sizes
+\#
+\# Doc cover
+.ds $DOC_COVER_AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_AUTHOR_SIZE_CHANGE]
+.ds $DOC_COVER_CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE]
+.ds $DOC_COVER_COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_COPYRIGHT_SIZE_CHANGE]
+.ds $DOC_COVER_DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_DOCTYPE_SIZE_CHANGE]
+.ds $DOC_COVER_SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_SUBTITLE_SIZE_CHANGE]
+.ds $DOC_COVER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_TITLE_SIZE_CHANGE]
+\# Cover
+.ds $COVER_AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_AUTHOR_SIZE_CHANGE]
+.ds $COVER_CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_CHAPTER_TITLE_SIZE_CHANGE]
+.ds $COVER_COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_COPYRIGHT_SIZE_CHANGE]
+.ds $COVER_DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_DOCTYPE_SIZE_CHANGE]
+.ds $COVER_SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_SUBTITLE_SIZE_CHANGE]
+.ds $COVER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_TITLE_SIZE_CHANGE]
+\# Docheader
+.ds $AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
+.ds $CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
+.ds $COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COPYRIGHT_SIZE_CHANGE]
+.ds $DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
+.ds $SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
+.ds $TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
+\#
+\# Next, some utility macros for various routines to prevent repetition
\#
.MAC PRINT_AUTHORS END
-. nr #AUTHORS \\n[#AUTHOR_NUM]
-. nr #NEXT_AUTHOR 0 1
-. while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
-. PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
-. \}
+. nr #AUTHORS \\n[#AUTHOR_NUM]
+. nr #NEXT_AUTHOR 0 1
+. ie r#DOING_COVER \{\
+. if \\n[#COVER]=1 \{\
+. while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
+. ie \\n[#COVER_AUTHOR_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
+. \}
+. el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
+.\}
+. \}
+. if \\n[#DOC_COVER]=1 \{\
+. while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
+. ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
+. \}
+. el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
+.\}
+. \}
+. \}
+. el \{\
+. while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
+. ie \\n[#AUTHOR_COLOR]=1 \{\
+. PRINT \m[\\*[$AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
+. \}
+. el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
+.\}
+. \}
.END
\#
.MAC DEFAULT_DOCHEADER END
-. CENTER
-. FAMILY \\*[$TITLE_FAM]
-. FT \\*[$TITLE_FT]
-. PT_SIZE \\*[$TITLE_PT_SIZE]
-. LS \\n[#DOCHEADER_LEAD]u
-. PRINT \\*[$TITLE]
-. if !'\\*[$SUBTITLE]'' \{\
-. FAMILY \\*[$SUBTITLE_FAM]
-. FT \\*[$SUBTITLE_FT]
-. PT_SIZE \\*[$SUBTITLE_PT_SIZE]
-. PRINT \\*[$SUBTITLE]
-. \}
-. if !'\\*[$AUTHOR_1]'' \{\
-. FAMILY \\*[$AUTHOR_FAM]
-. FT \\*[$AUTHOR_FT]
-. PT_SIZE \\*[$AUTHOR_PT_SIZE]
-. PRINT \\*[$ATTRIBUTE_STRING]
-. PRINT_AUTHORS
+. CENTER
+. FAMILY \\*[$TITLE_FAM]
+. FT \\*[$TITLE_FT]
+. PT_SIZE \\*[$TITLE_PT_SIZE]
+. LS \\n[#DOCHEADER_LEAD]u
+. ie \\n[#TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$TITLE_COLOR]]\\*[$TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$TITLE] \}
+. if !'\\*[$SUBTITLE]'' \{\
+. FAMILY \\*[$SUBTITLE_FAM]
+. FT \\*[$SUBTITLE_FT]
+. PT_SIZE \\*[$SUBTITLE_PT_SIZE]
+. ie \\n[#SUBTITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$SUBTITLE_COLOR]]\\*[$TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$SUBTITLE] \}
+. \}
+. if !'\\*[$AUTHOR_1]'' \{\
+. FAMILY \\*[$AUTHOR_FAM]
+. FT \\*[$AUTHOR_FT]
+. PT_SIZE \\*[$AUTHOR_PT_SIZE]
+. if !'\\*[$ATTRIBUTE_STRING]'' \{\
+. ie \\n[#ATTRIBUTE_COLOR]=1 \{\
+. PRINT \m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
. \}
+. el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
+. \}
+. PRINT_AUTHORS
+. \}
.END
\#
\#
@@ -3908,6 +5157,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. FT \\*[$TITLE_FT]
. PT_SIZE \\*[$TITLE_PT_SIZE]
. LS \\n[#DOCHEADER_LEAD]u
+.\" Chapter title only
. ie '\\*[$CHAPTER]'' \{\
. ie !'\\*[$CHAPTER_TITLE]'' \{\
. if \\n[#PRINT_STYLE]=2 \{\
@@ -3916,22 +5166,35 @@ y\\R'#DESCENDER \\n[.cdp]'
. PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
. LS \\n[#DOCHEADER_LEAD]u
. \}
-. PRINT \\*[$CHAPTER_TITLE]
+. ie \\n[#TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_TITLE] \}
. \}
. el \{\
-. PRINT \\*[$CHAPTER_STRING]
+. ie \\n[#TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_STRING] \}
. \}
. \}
+.\" Chapter string, possibly with a chapter title
. el \{\
-. PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
+. ie \\n[#TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
. if !'\\*[$CHAPTER_TITLE]'' \{\
-. if \\n[#PRINT_STYLE]=1 \{ .PRINT \\*[$CHAPTER_TITLE] \}
+. if \\n[#PRINT_STYLE]=1 \{ .PRINT \\*[$CHAPTER_TITLE] \}
. if \\n[#PRINT_STYLE]=2 \{\
. FAMILY \\*[$CHAPTER_TITLE_FAM]
. FT \\*[$CHAPTER_TITLE_FT]
. PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
. LS \\n[#DOCHEADER_LEAD]u
-. PRINT \\*[$CHAPTER_TITLE]
+. ie \\n[#CHAPTER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_TITLE] \}
. RLD \\n[#DOC_LEAD]u \" Just looks better this way
. \}
. \}
@@ -3940,31 +5203,649 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\#
.MAC NAMED_DOCHEADER END
-. CENTER
-. FAMILY \\*[$TITLE_FAM]
-. FT \\*[$TITLE_FT]
-. PT_SIZE \\*[$TITLE_PT_SIZE]
-. LS \\n[#DOCHEADER_LEAD]u
-. PRINT \\*[$TITLE]
-. if !'\\*[$SUBTITLE]'' \{\
-. FAMILY \\*[$SUBTITLE_FAM]
-. FT \\*[$SUBTITLE_FT]
-. PT_SIZE \\*[$SUBTITLE_PT_SIZE]
-. PRINT \\*[$SUBTITLE]
-. \}
-. if !'\\*[$AUTHOR_1]'' \{\
-. FAMILY \\*[$AUTHOR_FAM]
-. FT \\*[$AUTHOR_FT]
-. PT_SIZE \\*[$AUTHOR_PT_SIZE]
-. PRINT \\*[$ATTRIBUTE_STRING]
-. PRINT_AUTHORS
-. \}
-. FAMILY \\*[$DOCTYPE_FAM]
-. FT \\*[$DOCTYPE_FT]
-. PT_SIZE \\*[$DOCTYPE_PT_SIZE]
-. LS \\n[#DOCHEADER_LEAD]u
-. ALD \\n[#DOCHEADER_LEAD]u
-. UNDERSCORE "\\*[$DOC_TYPE]
+. CENTER
+. FAMILY \\*[$TITLE_FAM]
+. FT \\*[$TITLE_FT]
+. PT_SIZE \\*[$TITLE_PT_SIZE]
+. LS \\n[#DOCHEADER_LEAD]u
+. ie \\n[#TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$TITLE_COLOR]]\\*[$TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$TITLE] \}
+. if !'\\*[$SUBTITLE]'' \{\
+. FAMILY \\*[$SUBTITLE_FAM]
+. FT \\*[$SUBTITLE_FT]
+. PT_SIZE \\*[$SUBTITLE_PT_SIZE]
+. ie \\n[#SUBTITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$SUBTITLE_COLOR]]\\*[$TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$SUBTITLE] \}
+. \}
+. if !'\\*[$AUTHOR_1]'' \{\
+. FAMILY \\*[$AUTHOR_FAM]
+. FT \\*[$AUTHOR_FT]
+. PT_SIZE \\*[$AUTHOR_PT_SIZE]
+. if !'\\*[$ATTRIBUTE_STRING]'' \{\
+. ie \\n[#ATTRIBUTE_COLOR]=1 \{\
+. PRINT \m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
+. \}
+. el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
+. \}
+. PRINT_AUTHORS
+. \}
+. FAMILY \\*[$DOCTYPE_FAM]
+. FT \\*[$DOCTYPE_FT]
+. PT_SIZE \\*[$DOCTYPE_PT_SIZE]
+. LS \\n[#DOCHEADER_LEAD]u
+. ALD \\n[#DOCHEADER_LEAD]u
+. ie \\n[#DOCTYPE_COLOR]=1 \{\
+. COLOR \\*[$DOCTYPE_COLOR]
+. UNDERSCORE "\\*[$DOC_TYPE]
+. \}
+. el .UNDERSCORE "\\*[$DOC_TYPE]
+.END
+\#
+\#
+\# COVER PAGE
+\# ----------
+\# *Arguments:
+\# TITLE | DOCTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE | COVERTITLE ...
+\# ... [ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC ]
+\# *Function:
+\# Toggles the number register for each cover page element
+\# passed as an argument.
+\# *Notes:
+\# TITLE, DOCTITLE, CHAPTER, CHAPTER_TITLE or CHAPTER+TITLE must
+\# be supplied. After that, users may enter as many or as few of
+\# the arguments as they like; however, the arguments must appear
+\# in the order given above.
+\#
+\# If called as DOC_COVER, performs the same operations, but
+\# applies everything to a doc cover.
+\#
+.MAC COVER END
+. ie '\\$0'DOC_COVER' \{\
+. nr #DOC_COVER 1
+. if '\\$1'TITLE' \{ .nr #DOC_COVER_TITLE 1 \}
+. if '\\$1'DOCTITLE' \{ .nr #DOC_COVER_TITLE 2 \}
+. if '\\$1'CHAPTER' \{ .nr #DOC_COVER_TITLE 3 \}
+. if '\\$1'CHAPTER_TITLE' \{ .nr #DOC_COVER_TITLE 4 \}
+. if '\\$1'CHAPTER+TITLE' \{ .nr #DOC_COVER_TITLE 5 \}
+. if '\\$1'COVERTITLE' \{ .nr #DOC_COVER_TITLE 6 \}
+. if '\\$2'SUBTITLE' \{ .nr #DOC_COVER_SUBTITLE 1 \}
+. if '\\$2'AUTHOR' \{ .nr #DOC_COVER_AUTHOR 1 \}
+. if '\\$2'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
+. if '\\$2'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
+. if '\\$2'MISC' \{ .nr #DOC_COVER_MISC 1 \}
+. if '\\$3'AUTHOR' \{ .nr #DOC_COVER_AUTHOR 1 \}
+. if '\\$3'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
+. if '\\$3'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
+. if '\\$3'MISC' \{ .nr #DOC_COVER_MISC 1 \}
+. if '\\$4'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
+. if '\\$4'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
+. if '\\$4'MISC' \{ .nr #DOC_COVER_MISC 1 \}
+. if '\\$5'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
+. if '\\$5'MISC' \{ .nr #DOC_COVER_MISC 1 \}
+. if '\\$6'MISC' \{ .nr #DOC_COVER_MISC 1 \}
+. \}
+. el \{\
+. nr #COVER 1
+. if '\\$1'TITLE' \{ .nr #COVER_TITLE 1 \}
+. if '\\$1'DOCTITLE' \{ .nr #COVER_TITLE 2 \}
+. if '\\$1'CHAPTER' \{ .nr #COVER_TITLE 3 \}
+. if '\\$1'CHAPTER_TITLE' \{ .nr #COVER_TITLE 4 \}
+. if '\\$1'CHAPTER+TITLE' \{ .nr #COVER_TITLE 5 \}
+. if '\\$1'COVERTITLE' \{ .nr #COVER_TITLE 6 \}
+. if '\\$2'SUBTITLE' \{ .nr #COVER_SUBTITLE 1 \}
+. if '\\$2'AUTHOR' \{ .nr #COVER_AUTHOR 1 \}
+. if '\\$2'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
+. if '\\$2'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
+. if '\\$2'MISC' \{ .nr #COVER_MISC 1 \}
+. if '\\$3'AUTHOR' \{ .nr #COVER_AUTHOR 1 \}
+. if '\\$3'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
+. if '\\$3'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
+. if '\\$3'MISC' \{ .nr #COVER_MISC 1 \}
+. if '\\$4'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
+. if '\\$4'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
+. if '\\$4'MISC' \{ .nr #COVER_MISC 1 \}
+. if '\\$5'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
+. if '\\$5'MISC' \{ .nr #COVER_MISC 1 \}
+. if '\\$6'MISC' \{ .nr #COVER_MISC 1 \}
+. \}
+.END
+\#
+\#
+.MAC COVERTITLE END
+. ie '\\$0'DOC_COVERTITLE' .ds $DOC_COVER_TITLE \\$1
+. el .ds $COVER_TITLE \\$1
+.END
+\#
+\#
+\# COVER PAGE LEADING
+\# ------------------
+\# *Arguments:
+\# <+|- amount by which to in/decrease leading of cover/doc cover>
+\# *Function:
+\# Stores user supplied lead in/decrease in string $COVER_LEAD_ADJ
+\# or $DOC_COVER_LEAD_ADJ, depending on whether the macro was called
+\# with an alias (DOC_COVER_LEAD).
+\# *Notes:
+\# A unit of measure must be supplied. Decimal fractions OK.
+\# Default is +0, i.e. same as DOC_LEAD.
+\#
+.MAC COVER_LEAD END
+. ie '\\$0'DOC_COVER_LEAD' \{\
+. ds $DOC_COVER_LEAD_ADJ \\$1
+. \}
+. el \{\
+. ds $COVER_LEAD_ADJ \\$1
+. \}
+.END
+\#
+\#
+\# COVER PAGE START POSITION
+\# -------------------------
+\# *Arguments:
+\# <distance from page top at which to start cover/doc cover>
+\# *Function:
+\# Stores user supplied lead in/decrease in #COVER_START_POS
+\# or #DOC_COVER_START_POS, depending on whether the macro was
+\# called by an alias (DOC_COVER_ADVANCE).
+\# *Notes:
+\# A unit of measure must be supplied. Decimal fractions OK.
+\# If user doesn't invoke this macro, the default starting
+\# position for both covers and doc covers is 1/3 of the way
+\# down the page (setup in DO_COVER).
+\#
+.MAC COVER_ADVANCE END
+. ie '\\$0'DOC_COVER_ADVANCE' \{\
+. nr #DOC_COVER_START_POS (\\$1)
+. \}
+. el \{\
+. nr #COVER_START_POS (\\$1)
+. \}
+.END
+\#
+\#
+\# COVERS - WHETHER TO PRINT
+\# -------------------------
+\# *Arguments:
+\# <none> | <anything>
+\# *Function:
+\# Creates or removes registers #COVERS and #COVERS_OFF, checked for
+\# in DEFAULTS (in START) prior to printing
+\#
+.MAC COVERS END
+. ie '\\$0'DOC_COVERS' \{\
+. ie '\\$1'' \{\
+. rr #DOC_COVERS_OFF
+. nr #DOC_COVERS 1
+. \}
+. el \{\
+. rr #DOC_COVERS
+. nr #DOC_COVERS_OFF 1
+. \}
+. \}
+. el \{\
+. ie '\\$1'' \{\
+. rr #COVERS_OFF
+. nr #COVERS 1
+. \}
+. el \{\
+. rr #COVERS
+. nr #COVERS_OFF 1
+. \}
+. \}
+.END
+\#
+\#
+.MAC DO_COVER END
+. nr #DOING_COVER 1
+. ev COVER
+. evc 0
+. TRAP OFF
+. if \\n[#PAGINATE]=1 \{\
+. nr #PAGINATION_WAS_ON 1
+. rr #PAGINATE
+. \}
+. if \\n[#HEADERS_ON]=1 \{\
+. nr #HEADERS_WERE_ON 1
+. HEADERS OFF
+. \}
+. if \\n[#FOOTERS_ON]=1 \{\
+. nr #FOOTERS_WERE_ON 1
+. FOOTERS OFF
+. \}
+. if \\n[#COLUMNS]=1 \{\
+. nr #COLUMNS_WERE_ON 1
+. rr #COLUMNS
+. \}
+.\" Doc cover
+. ie '\\$0'DO_DOC_COVER' \{\
+. if !r#DOC_COVER_START_POS \{\
+. nr #DOC_COVER_START_POS \\n[#PAGE_LENGTH]/3
+. \}
+. if \\n[#PRINT_STYLE]=1 \{\
+. ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
+. el \{ .vs \\n[#DOC_LEAD]u \}
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. LS \\n[#DOC_LEAD]u\\*[$DOC_COVER_LEAD_ADJ]
+. nr #DOC_COVER_LEAD \\n[#LEAD]
+. \}
+. PRINT \&
+. sp |\\n[#DOC_COVER_START_POS]u-1v
+. if \\n[#DOC_COVER_COLOR]=1 \{\
+. nf
+\m[\\*[$DOC_COVER_COLOR]]
+. EOL
+. \}
+. CENTER
+. FAMILY \\*[$DOC_COVER_TITLE_FAM]
+. FT \\*[$DOC_COVER_TITLE_FT]
+. PT_SIZE \\*[$DOC_COVER_TITLE_PT_SIZE]
+. LS \\n[#DOC_COVER_LEAD]u
+. if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
+. if \\n[#DOC_COVER_TITLE]=1 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. UNDERSCORE "\\*[$TITLE]"
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$TITLE] \}
+. \}
+. \}
+. if \\n[#DOC_COVER_TITLE]=2 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. UNDERSCORE "\\*[$DOC_TITLE]"
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$DOC_TITLE] \}
+. \}
+. \}
+. if \\n[#DOC_COVER_TITLE]=3 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
+. \}
+. \}
+. if \\n[#DOC_COVER_TITLE]=4 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. UNDERSCORE "\\*[$CHAPTER_TITLE]"
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_TITLE] \}
+. \}
+. \}
+. if \\n[#DOC_COVER_TITLE]=5 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
+. \}
+. if !'\\*[$CHAPTER_TITLE]'' \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. UNDERSCORE "\\*[$CHAPTER_TITLE]"
+. \}
+. el \{\
+. FAMILY \\*[$DOC_COVER_CHAPTER_TITLE_FAM]
+. FT \\*[$DOC_COVER_CHAPTER_TITLE_FT]
+. PT_SIZE \\*[$DOC_COVER_CHAPTER_TITLE_PT_SIZE]
+. ie \\n[#DOC_COVER_CHAPTER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_TITLE] \}
+. \}
+. \}
+. \}
+. if \\n[#DOC_COVER_TITLE]=6 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. UNDERSCORE "\\*[$DOC_COVER_TITLE]"
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_COVER_TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$DOC_COVER_TITLE] \}
+. \}
+. \}
+. if \\n[#DOC_COVER_SUBTITLE]=1 \{\
+. FAMILY \\*[$DOC_COVER_SUBTITLE_FAM]
+. FT \\*[$DOC_COVER_SUBTITLE_FT]
+. PT_SIZE \\*[$DOC_COVER_SUBTITLE_PT_SIZE]
+. if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
+. ie \\n[#DOC_COVER_SUBTITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$SUBTITLE] \}
+. \}
+. if \\n[#PRINT_STYLE]=1 \{\
+. if !r#DOC_COVER_SUBTITLE \{ .SP \}
+. \}
+. if \\n[#DOC_COVER_AUTHOR]=1 \{\
+. FAMILY \\*[$DOC_COVER_AUTHOR_FAM]
+. FT \\*[$DOC_COVER_AUTHOR_FT]
+. PT_SIZE \\*[$DOC_COVER_AUTHOR_PT_SIZE]
+. if \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. vs \\n[#DOC_LEAD]u/2u
+. \}
+. if !'\\*[$ATTRIBUTE_STRING]'' \{\
+. ie \\n[#DOC_COVER_ATTRIBUTE_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
+. \}
+. el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
+. \}
+. PRINT_AUTHORS
+. \}
+. FAMILY \\*[$DOC_COVER_DOCTYPE_FAM]
+. FT \\*[$DOC_COVER_DOCTYPE_FT]
+. PT_SIZE \\*[$DOC_COVER_DOCTYPE_PT_SIZE]
+. SP
+. if \\n[#DOC_COVER_DOCTYPE]=1 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. vs \\n[#DOC_LEAD]u
+. UNDERSCORE2 "\\*[$DOC_TYPE]
+. \}
+. el \{\
+. ie \\n[#DOC_COVER_DOCTYPE_COLOR]=1 \{\
+. COLOR \\*[$DOC_COVER_DOCTYPE_COLOR]
+. UNDERSCORE "\\*[$DOC_TYPE]
+. \}
+. el .UNDERSCORE "\\*[$DOC_TYPE]
+. \}
+. \}
+. sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
+. ie \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
+. el \{ .vs \\n[#DOC_LEAD]u/2u \}
+. \}
+. el \{\
+. FAMILY \\*[$DOC_COVER_COPYRIGHT_FAM]
+. FT \\*[$DOC_COVER_COPYRIGHT_FT]
+. AUTOLEAD 2
+. PT_SIZE \\*[$DOC_COVER_COPYRIGHT_PT_SIZE]
+. \}
+. if \\n[#DOC_COVER_COPYRIGHT]=1 \{\
+. QUAD \\*[$DOC_COVER_COPYRIGHT_QUAD]
+. ie \\n[#DOC_COVER_COPYRIGHT_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
+. \}
+. el \{ .PRINT \\*[$COPYRIGHT] \}
+. \}
+. sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
+. if \\n[#DOC_COVER_MISC]=1 \{\
+. QUAD \\*[$DOC_COVER_MISC_QUAD]
+. nr #MISCS \\n[#MISC_NUM]
+. sp -\\n[#MISCS]+1
+. nr #NEXT_MISC 0 1
+. while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
+. ie \\n[#DOC_COVER_MISC_COLOR]=1 \{\
+. PRINT \m[\\*[$DOC_COVER_MISC_COLOR]]\\*[$MISC_\\n+[#NEXT_MISC]]\m[]
+. br
+. \}
+. el \{\
+. PRINT \\*[$MISC_\\n+[#NEXT_MISC]]
+. br
+. \}
+.\}
+. \}
+. \}
+.\" Cover
+. el \{\
+. if !r#COVER_START_POS \{\
+. nr #COVER_START_POS \\n[#PAGE_LENGTH]/3
+. \}
+. if \\n[#PRINT_STYLE]=1 \{\
+. ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
+. el \{ .vs \\n[#DOC_LEAD]u \}
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. LS \\n[#DOC_LEAD]u\\*[$COVER_LEAD_ADJ]
+. nr #COVER_LEAD \\n[#LEAD]
+. \}
+. PRINT \&
+. sp |\\n[#COVER_START_POS]u-1v
+. if \\n[#COVER_COLOR]=1 \{\
+. nf
+\m[\\*[$COVER_COLOR]]
+. EOL
+. \}
+. CENTER
+. FAMILY \\*[$COVER_TITLE_FAM]
+. FT \\*[$COVER_TITLE_FT]
+. PT_SIZE \\*[$COVER_TITLE_PT_SIZE]
+. LS \\n[#COVER_LEAD]u
+. if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
+. if \\n[#COVER_TITLE]=1 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. UNDERSCORE "\\*[$TITLE]"
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$TITLE] \}
+. \}
+. \}
+. if \\n[#COVER_TITLE]=2 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. UNDERSCORE "\\*[$DOC_TITLE]"
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$DOC_TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$DOC_TITLE] \}
+. \}
+. \}
+. if \\n[#COVER_TITLE]=3 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
+. \}
+. \}
+. if \\n[#COVER_TITLE]=4 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. UNDERSCORE "\\*[$CHAPTER_TITLE]"
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_TITLE] \}
+. \}
+. \}
+. if \\n[#COVER_TITLE]=5 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
+. \}
+. if !'\\*[$CHAPTER_TITLE]'' \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. UNDERSCORE "\\*[$CHAPTER_TITLE]"
+. \}
+. el \{\
+. FAMILY \\*[$COVER_CHAPTER_TITLE_FAM]
+. FT \\*[$COVER_CHAPTER_TITLE_FT]
+. PT_SIZE \\*[$COVER_CHAPTER_TITLE_PT_SIZE]
+. ie \\n[#COVER_CHAPTER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$CHAPTER_TITLE] \}
+. \}
+. \}
+. \}
+. if \\n[#COVER_TITLE]=6 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. UNDERSCORE "\\*[$COVER_TITLE]"
+. CAPS OFF
+. \}
+. el \{\
+. ie \\n[#COVER_TITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$COVER_TITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$COVER_TITLE] \}
+. \}
+. \}
+. if \\n[#COVER_SUBTITLE]=1 \{\
+. FAMILY \\*[$COVER_SUBTITLE_FAM]
+. FT \\*[$COVER_SUBTITLE_FT]
+. PT_SIZE \\*[$COVER_SUBTITLE_PT_SIZE]
+. if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
+. ie \\n[#COVER_SUBTITLE_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE]\m[]
+. \}
+. el \{ .PRINT \\*[$SUBTITLE] \}
+. \}
+. if \\n[#PRINT_STYLE]=1 \{\
+. if !r#COVER_SUBTITLE \{ .SP \}
+. \}
+. if \\n[#COVER_AUTHOR]=1 \{\
+. FAMILY \\*[$COVER_AUTHOR_FAM]
+. FT \\*[$COVER_AUTHOR_FT]
+. PT_SIZE \\*[$COVER_AUTHOR_PT_SIZE]
+. if \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. vs \\n[#DOC_LEAD]u/2u
+. \}
+. if !'\\*[$ATTRIBUTE_STRING]'' \{\
+. ie \\n[#COVER_ATTRIBUTE_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
+. \}
+. el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
+. \}
+. PRINT_AUTHORS
+. \}
+. FAMILY \\*[$COVER_DOCTYPE_FAM]
+. FT \\*[$COVER_DOCTYPE_FT]
+. PT_SIZE \\*[$COVER_DOCTYPE_PT_SIZE]
+. SP
+. if \\n[#COVER_DOCTYPE]=1 \{\
+. ie \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. vs \\n[#DOC_LEAD]u
+. UNDERSCORE2 "\\*[$DOC_TYPE]
+. \}
+. el \{\
+. ie \\n[#COVER_DOCTYPE_COLOR]=1 \{\
+. COLOR \\*[$COVER_DOCTYPE_COLOR]
+. UNDERSCORE "\\*[$DOC_TYPE]
+. \}
+. el .UNDERSCORE "\\*[$DOC_TYPE]
+. \}
+. \}
+. sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
+. ie \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
+. el \{ .vs \\n[#DOC_LEAD]u/2u \}
+. \}
+. el \{\
+. FAMILY \\*[$COVER_COPYRIGHT_FAM]
+. FT \\*[$COVER_COPYRIGHT_FT]
+. AUTOLEAD 2
+. PT_SIZE \\*[$COVER_COPYRIGHT_PT_SIZE]
+. \}
+. if \\n[#COVER_COPYRIGHT]=1 \{\
+. QUAD \\*[$COVER_COPYRIGHT_QUAD]
+. ie \\n[#COVER_COPYRIGHT_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
+. \}
+. el \{ .PRINT \\*[$COPYRIGHT] \}
+. \}
+. sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
+. if \\n[#COVER_MISC]=1 \{\
+. QUAD \\*[$COVER_MISC_QUAD]
+. nr #MISCS \\n[#MISC_NUM]
+. sp -\\n[#MISCS]+1
+. nr #NEXT_MISC 0 1
+. while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
+. ie \\n[#COVER_MISC_COLOR]=1 \{\
+. PRINT \m[\\*[$COVER_MISC_COLOR]]\\*[$MISC_\\n+[#NEXT_MISC]]\m[]
+. br
+. \}
+. el \{\
+. PRINT \\*[$MISC_\\n+[#NEXT_MISC]]
+. br
+. \}
+.\}
+. \}
+. \}
+. EOL
+. TRAP
+. NEWPAGE
+. ev
+. if \\n[#PAGINATION_WAS_ON] \{\
+. rr #PAGINATION_WAS_ON
+. PAGINATE
+. PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]-1
+. \}
+. if \\n[#HEADERS_WERE_ON] \{\
+. rr #HEADERS_WERE_ON
+. HEADERS
+. \}
+. if \\n[#FOOTERS_WERE_ON] \{\
+. rr #FOOTERS_WERE_ON
+. FOOTERS
+. \}
+. if \\n[#COLUMNS_WERE_ON]=1 \{\
+. rr #COLUMNS_WERE_ON 1
+. nr #COLUMNS 1
+. \}
+. rr #DOING_COVER
.END
\#
\#
@@ -3982,50 +5863,187 @@ y\\R'#DESCENDER \\n[.cdp]'
. ab PRINTSTYLE missing
. \}
. nr #DOCS 1
-. DEFAULTS
+. if \\n[#LINENUMBERS]=1 \{\
+. NUMBER_LINES OFF
+. nr #LINENUMBERS 2
+. \}
. if \\n[#COLLATE] \{\
. COPYSTYLE \\*[$COPY_STYLE]
. nr #HEADERS_ON \\n[#HEADER_STATE]
. if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
. sp |\\n[#HEADER_MARGIN]u
. PRINT \&
+. if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
+. PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
+. rm $RESTORE_PAGENUM_STYLE
+. \}
. \}
-\#
+. DEFAULTS
+.\" Quote and blockquote default leads are the same as #DOC_LEAD, so
+.\" they have to be set after DEFAULTS (where DOC_LEAD is finalized)
+. if !r#Q_AUTOLEAD \{ .nr #Q_LEAD \\n[#DOC_LEAD] \}
+. if !r#BQ_AUTOLEAD \{ .nr #BQ_LEAD \\n[#DOC_LEAD] \}
+. if !r#EN_Q_AUTOLEAD \{ .nr #EN_Q_LEAD \\n[#EN_LEAD] \}
+. if !r#EN_BQ_AUTOLEAD \{ .nr #EN_BQ_LEAD \\n[#EN_LEAD] \}
+.\" Covers and doc covers
+. if \\n[#DOC_COVERS]=1 \{\
+. if \\n[#DOC_COVER]=1 \{\
+. DO_DOC_COVER
+. rr #DOC_COVER
+. rr #DOC_COVER_TITLE
+. rr #DOC_COVER_SUBTITLE
+. rr #DOC_COVER_AUTHOR
+. rr #DOC_COVER_DOCTYPE
+. rr #DOC_COVER_COPYRIGHT
+. rr #DOC_COVER_MISC
+. \}
+. \}
+. if \\n[#COVERS]=1 \{\
+. if \\n[#COVER]=1 \{\
+. DO_COVER
+. rr #COVER
+. rr #COVER_TITLE
+. rr #COVER_SUBTITLE
+. rr #COVER_AUTHOR
+. rr #COVER_DOCTYPE
+. rr #COVER_COPYRIGHT
+. rr #COVER_MISC
+. \}
+. \}
+.\" Collate related stuff
+. ie \\n[#COLLATED_DOC]=1 \{\
+.\" Collect TITLE for TOC.
+. nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
+. af #TOC_ENTRY_PN \\g[#PAGENUMBER]
+. ie \\n[#USER_SET_TITLE_ITEM] \{\
+. ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]\\|
+. rr #USER_SET_TITLE_ITEM
+. rm $USER_SET_TITLE_ITEM
+. \}
+. el \{\
+. ie \\n[#DOC_TYPE]=2 \{\
+. ie '\\*[$CHAPTER_TITLE]'' \{\
+. ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
+. \}
+. el \{\
+. ie '\\*[$CHAPTER]'' \{\
+. ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]\\|
+. \}
+. el \{\
+. ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
+. \}
+. \}
+. \}
+. el \{\
+. ds $TOC_TITLE_ITEM \\*[$TITLE]\\|
+. \}
+. \}
+. if \\n[#TOC_AUTHORS]=1 \{\
+. ie '\\*[$TOC_AUTHORS]'' \{\
+. as $TOC_TITLE_ITEM /\\|\\*[$AUTHOR_1]\\|
+. \}
+. el \{\
+. as $TOC_TITLE_ITEM /\\|\\*[$TOC_AUTHORS]\\|
+. rm $TOC_AUTHORS
+. \}
+. \}
+.\" Note the use of \!, which transparently embeds the macros used
+.\" in the TOC_ENTRIES diversion. The elements they control must be
+.\" processed literally when the diversion is output.
+. ev TOC_EV
+. da TOC_ENTRIES
+. if \\n[#PRINT_STYLE]=1 \{\
+\!. fam C
+\!. ft R
+\!. ps 12
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_TITLE_FAM]
+\!. FT \\*[$TOC_TITLE_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
+. \}
+\!. TRAP OFF
+. ie \\n[#PRINT_STYLE]=1 \{\
+\!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
+. \}
+. el \{\
+\!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
+. \}
+\!. EOL
+\!. ST 100 L
+\!. ST 101 R
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_PN_FAM]
+\!. FT \\*[$TOC_PN_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
+. \}
+\!. TAB 100
+\!. PRINT \\*[LEADER]
+\!. TN
+\!. TRAP
+\!. PRINT \\n[#TOC_ENTRY_PN]
+\!. TQ
+. di
+. ev
+. \}
+. el \{\
+. nr #FIRST_DOC_TITLE_PN \\n%+\\n[#PAGE_NUM_ADJ]
+. af #FIRST_DOC_TITLE_PN \\g[#PAGENUMBER]
+. nr #FIRST_DOC_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
+. \}
+.\" End TITLE collection
. if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
. sp |\\n[#HEADER_MARGIN]u
. PRINT_PAGE_NUMBER
. \}
. rr #COLLATE
. rr #PAGINATION_STATE
-\#
+.\" End collate stuff
. ie \\n[#DOC_HEADER]=0 \{\
. PRINT \&
. if \\n[#DOC_TYPE]=4 \{\
. if !'\\n(.z'' \{ .di \}
. \}
-. ie r#ADVANCE_FROM_TOP \{ .sp |\\n[#ADVANCE_FROM_TOP]u-1v \}
-. el \{ .sp |\\n[#T_MARGIN]u-1v \}
+. nr #STORED_PP_INDENT \\n[#PP_INDENT]
+. PARA_INDENT 0
. PP
+. PARA_INDENT \\n[#STORED_PP_INDENT]u
+. rr #STORED_PP_INDENT
+. ie r#ADVANCE_FROM_TOP \{\
+. sp |\\n[#ADVANCE_FROM_TOP]u-1v
+. if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
+. \}
+. el \{ .sp |\\n[#T_MARGIN]u-1v \}
+. if \\n[#COLUMNS] \{\
+. mk dc
+. nr #COL_NUM 0 1
+. po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
+. ll \\n[#COL_L_LENGTH]u
+. \}
. nr #PP 0
. rr #DOC_HEADER
. if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \}
. \}
. el \{\
-. if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u+\\n[#DOCHEADER_LEAD_ADJ]u \}
+. if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ] \}
. nr #DOCHEADER_LEAD \\n[#LEAD]
-\# Default
+.\" Default
. if \\n[#DOC_TYPE]=1 \{\
. PRINT \&
. sp |\\n[#DOCHEADER_ADVANCE]u-1v
-. ev TITLE
+. ev DOCHEADER
+. if \\n[#DOCHEADER_COLOR]=1 \{\
+. nf
+\m[\\*[$DOCHEADER_COLOR]]
+. EOL
+. \}
. L_MARGIN \\n[#DOC_L_MARGIN]u
. LL \\n[#DOC_L_LENGTH]u
. ta \\n(.lu
. if \\n[#PRINT_STYLE]=1 \{\
. CENTER
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
. ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
. el \{ .vs \\n[#DOC_LEAD]u \}
. CAPS
@@ -4051,7 +6069,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #NEXT_AUTHOR 0 1
. while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
. PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
-. \}
+.\}
. if \\n[#AUTHOR_LINES]=1 \{\
. ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
. el \{ .ALD \\n[#DOC_LEAD]u/2u \}
@@ -4081,19 +6099,22 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. ev
. \}
-\# Chapter
+.\" Chapter
. if \\n[#DOC_TYPE]=2 \{\
. PRINT \&
. sp |\\n[#DOCHEADER_ADVANCE]u-1v
-. ev TITLE
+. ev DOCHEADER
+. if \\n[#DOCHEADER_COLOR]=1 \{\
+. nf
+\m[\\*[$DOCHEADER_COLOR]]
+. EOL
+. \}
. L_MARGIN \\n[#DOC_L_MARGIN]u
. LL \\n[#DOC_L_LENGTH]u
. ta \\n(.lu
. if \\n[#PRINT_STYLE]=1 \{\
. CENTER
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
. vs \\n[#DOC_LEAD]u
. ie '\\*[$CHAPTER]'' \{\
. CAPS
@@ -4130,19 +6151,22 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. ev
. \}
-\# Named
+.\" Named
. if \\n[#DOC_TYPE]=3 \{\
. PRINT \&
. sp |\\n[#DOCHEADER_ADVANCE]u-1v
-. ev NAMED
+. ev DOCHEADER
+. if \\n[#DOCHEADER_COLOR]=1 \{\
+. nf
+\m[\\*[$DOCHEADER_COLOR]]
+. EOL
+. \}
. L_MARGIN \\n[#DOC_L_MARGIN]u
. LL \\n[#DOC_L_LENGTH]u
. ta \\n(.lu
. if \\n[#PRINT_STYLE]=1 \{\
. CENTER
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
. ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
. el \{ .vs \\n[#DOC_LEAD]u \}
. CAPS
@@ -4168,13 +6192,13 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #NEXT_AUTHOR 0 1
. while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
. PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
-. \}
+.\}
. if \\n[#AUTHOR_LINES]=1 \{\
. ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
. el \{ .ALD \\n[#DOC_LEAD]u/2u \}
. \}
-. \}
. vs \\n[#DOC_LEAD]u
+. \}
. el \{\
. ie !d$SUBTITLE \{\
. ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
@@ -4205,34 +6229,98 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. if !\\n[#DOC_TYPE]=4 \{\
. if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
-. nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD] \"Do we need the units?
-. ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]u-\\n[#DOCHEADER_SPACE_ADJ]u \}
+. nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD]
+. ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]-\\n[#DOCHEADER_SPACE_ADJ] \}
. el \{ .nr #DOCHEADER_EXTRA_SPACE 0 \}
. if \\n[#PRINT_STYLE]=2 \{ .ALD (\\n[#DOC_LEAD]u*2u)+\\n[#DOCHEADER_EXTRA_SPACE]u \}
. if \\n[#COLUMNS] \{\
. nr #COL_NUM 0 1
. nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
. po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
. LL \\n[#COL_L_LENGTH]u
. ta \\n(.lu
. mk dc
. \}
. \}
. \}
-. rr #DOCHEADER_LEAD
-. rr #DOCHEADER_LEAD_ADJ
+. LS \\n[#DOC_LEAD]u
+. if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
+. QUAD \\*[$DOC_QUAD]
+. CLEANUP_DEFAULTS
+. nr #START_FOR_FOOTERS 1
+. if \\n[#COLLATED_DOC]=1 \{\
+. if !\\n[MNinit_DEFERRED]=1 \{\
+. MN_INIT rerun
+. \}
+. \}
+. if \\n[#MNinit_DEFERRED]=1 \{\
+. rr #MNinit_DEFERRED
+. nr #START_FOR_MNinit 1
+. MN_INIT \\*[$MN-arg1] \\*[$MN-arg2] \\*[$MN-arg3] \\*[$MN-arg4] \\*[$MN-arg5] \\*[$MN-arg6] \\*[$MN-arg7] \\*[$MN-arg8] \\*[$MN-arg9]
+. \}
+. nr #START_FOR_MNinit 2
+. if !\\n[#DOC_TYPE]=4 \{ .em TERMINATE \}
+. if \\n[#LINENUMBERS]=2 \{\
+. NUMBER_LINES RESUME
+. nr #LINENUMBERS 1
+. \}
+. if \\n[#RUN_ON]=1 \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{ .RUNON_WARNING \}
+. if \\n[#FN_MARKER_STYLE]=2 \{ .RUNON_WARNING \}
+. \}
+.END
+\#
+.MAC CLEANUP_DEFAULTS END
+. nr #START 1
+.\" Family strings for docheader
+. rm $AUTHOR_FAM
+. rm $CHAPTER_TITLE_FAM
+. rm $DOCTYPE_FAM
+. rm $SUBTITLE_FAM
+. rm $TITLE_FAM
+.\" Family strings for cover
+. rm $COVER_AUTHOR_FAM
+. rm $COVER_CHAPTER_TITLE_FAM
+. rm $COVER_COPYRIGHT_FAM
+. rm $COVER_DOCTYPE_FAM
+. rm $COVER_LEAD_ADJ
+. rm $COVER_SUBTITLE_FAM
+. rm $COVER_TITLE_FAM
+.\" Family strings for doc cover
+. rm $DOC_COVER_AUTHOR_FAM
+. rm $DOC_COVER_CHAPTER_TITLE_FAM
+. rm $DOC_COVER_COPYRIGHT_FAM
+. rm $DOC_COVER_DOCTYPE_FAM
+. rm $DOC_COVER_LEAD_ADJ
+. rm $DOC_COVER_SUBTITLE_FAM
+. rm $DOC_COVER_TITLE_FAM
+.\" Quad args to copyright and misc
+. rm $COVER_COPYRIGHT_QUAD
+. rm $COVER_MISC_QUAD
+. rm $DOC_COVER_COPYRIGHT_QUAD
+. rm $DOC_COVER_MISC_QUAD
+.\" Miscellaneous strings
+. rm $TOC_TITLE_ITEM
+. rm $DOCHEADER_LEAD_ADJ
+.\" Various registers
+. rr #ADJ_DOC_LEAD
+. rr #ADVANCE_FROM_TOP
+. rr #AUTHOR_NUM
+. rr #AUTHORS
+. rr #COVER_LEAD
. rr #DEPTH_1
. rr #DEPTH_2
+. rr #DOC_COVER_LEAD
. rr #DOCHEADER_ADVANCE
-. rr #ADVANCE_FROM_TOP
-. rr #DOCHEADER_SPACE_ADJ
. rr #DOCHEADER_EXTRA_SPACE
-. rr #AUTHORS
+. rr #DOCHEADER_LEAD
+. rr #DOCHEADER_SPACE_ADJ
+. rr #MISC_NUM
+. rr #MISCS
. rr #NEXT_AUTHOR
-. rr #AUTHOR_NUM
+. rr #NEXT_MISC
. rr #NUM_AUTHORS
-. nr #START 1
-. nr #START_FOR_FOOTERS 1
.END
\#
\# ====================================================================
@@ -4266,13 +6354,13 @@ y\\R'#DESCENDER \\n[.cdp]'
\# *Arguments:
\# <+|- amount by which to in/decrease leading of doc header>
\# *Function:
-\# Stores user supplied lead in/decrease in register #DOCHEADER_LEAD_ADJ.
+\# Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
\# *Notes:
\# A unit of measure must be supplied. Decimal fractions OK.
\# Default is +0, i.e. same as DOC_LEAD.
\#
.MAC DOCHEADER_LEAD END
-. nr #DOCHEADER_LEAD_ADJ (\\$1)
+. ds $DOCHEADER_LEAD_ADJ \\$1
.END
\#
\#
@@ -4291,234 +6379,6 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
-\# TITLE FAMILY
-\# ------------
-\# *Argument:
-\# <family to use for the document header title>
-\# *Function:
-\# Creates or modifies string $TITLE_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC TITLE_FAMILY END
-. ds $TITLE_FAM \\$1
-.END
-\#
-\#
-\# TITLE FONT
-\# ----------
-\# *Argument:
-\# <font to use for the document header title>
-\# *Function:
-\# Creates or modifies string $TITLE_FT.
-\# *Notes:
-\# Default is bold.
-\#
-.MAC TITLE_FONT END
-. ds $TITLE_FT \\$1
-.END
-\#
-\#
-\# TITLE SIZE
-\# ----------
-\# *Argument:
-\# <+|- number of points by which to in/decrease title at start
-\# of the document (relative to running text)>
-\# *Function:
-\# Creates string $TITLE_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign, with no space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is +3.5 for printstyle TYPESET DEFAULT | STORY | NAMED;
-\# 4 for TYPESET CHAPTER; +0 for TYPEWRITE.
-\#
-.MAC TITLE_SIZE END
-. ds $TITLE_SIZE_CHANGE \\$1
-.END
-\#
-\#
-\# CHAPTER TITLE FAMILY
-\# --------------------
-\# *Argument:
-\# <family to use for the chapter title, if there is one>
-\# *Function:
-\# Creates or modifies string $CHAPTER_TITLE_FAM.
-\# *Notes:
-\# Default isame as running text.
-\#
-.MAC CHAPTER_TITLE_FAMILY END
-. ds $CHAPTER_TITLE_FAM \\$1
-.END
-\#
-\#
-\# CHAPTER TITLE FONT
-\# ------------------
-\# *Argument:
-\# <font to use for the chapter title, if there is one>
-\# *Function:
-\# Creates or modifies string $CHAPTER_TITLE_FT.
-\# *Notes:
-\# Default is bold italic for TYPESET; varies in TYPEWRITE between
-\# caps and underscored, depending on whether chapter title stands
-\# alone or has CHAPTER # above it.
-\#
-.MAC CHAPTER_TITLE_FONT END
-. ds $CHAPTER_TITLE_FT \\$1
-.END
-\#
-\#
-\# CHAPTER TITLE SIZE
-\# ------------------
-\# *Argument:
-\# <+|- number of points by which to in/decrease title at start
-\# of the document (relative to running text)>
-\# *Function:
-\# Creates string $CHAPTER_TITLE_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign, with no space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is +4 for printstyle TYPESET
-\#
-.MAC CHAPTER_TITLE_SIZE END
-. ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
-.END
-\#
-\#
-\# SUBTITLE FAMILY
-\# ---------------
-\# *Argument:
-\# <family to use for the document header title>
-\# *Function:
-\# Creates or modifies string $SUBTITLE_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC SUBTITLE_FAMILY END
-. ds $SUBTITLE_FAM \\$1
-.END
-\#
-\#
-\# SUBTITLE FONT
-\# -------------
-\# *Argument:
-\# <font to use for the document header title>
-\# *Function:
-\# Creates or modifies string $SUBTITLE_FT.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC SUBTITLE_FONT END
-. ds $SUBTITLE_FT \\$1
-.END
-\#
-\#
-\# SUBTITLE SIZE
-\# -------------
-\# *Argument:
-\# <+|- number of points by which to in/decrease subtitle at start
-\# of the document (relative to running text)>
-\# *Function:
-\# Creates or modifies string $SUBTITLE_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign with no space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is +0.
-\#
-.MAC SUBTITLE_SIZE END
-. ds $SUBTITLE_SIZE_CHANGE \\$1
-.END
-\#
-\#
-\# AUTHOR FAMILY
-\# -------------
-\# *Argument:
-\# <family to use for author in document header>
-\# *Function:
-\# Creates or modifies string $AUTHOR_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC AUTHOR_FAMILY END
-. ds $AUTHOR_FAM \\$1
-.END
-\#
-\#
-\# AUTHOR FONT
-\# -----------
-\# *Argument:
-\# <font to use for author in document header>
-\# *Function:
-\# Creates or modifies string $AUTHOR_FT.
-\# *Notes:
-\# Default is italic.
-\#
-.MAC AUTHOR_FONT END
-. ds $AUTHOR_FT \\$1
-.END
-\#
-\#
-\# AUTHOR SIZE
-\# -----------
-\# *Argument:
-\# <+|- number of points by which to in/decrease author at start
-\# of the document>
-\# *Function:
-\# Creates or modifies string $AUTHOR_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign with no space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is same as running text.
-\#
-.MAC AUTHOR_SIZE END
-. ds $AUTHOR_SIZE_CHANGE \\$1
-.END
-\#
-\#
-\# DOCTYPE FAMILY
-\# --------------
-\# *Argument:
-\# <family to use for the document type string>
-\# *Function:
-\# Creates or modifies string $DOCTYPE_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC DOCTYPE_FAMILY END
-. ds $DOCTYPE_FAM \\$1
-.END
-\#
-\#
-\# DOCTYPE FONT
-\# ------------
-\# *Argument:
-\# <font to use for the document type string>
-\# *Function:
-\# Creates or modifies string $DOCTYPE_FT.
-\# *Notes:
-\# Default is bold italic.
-\#
-.MAC DOCTYPE_FONT END
-. ds $DOCTYPE_FT \\$1
-.END
-\#
-\#
-\# DOCTYPE SIZE
-\# -------------
-\# *Argument:
-\# <+|- number of points by which to in/decrease the document
-\# type string (relative to running text)>
-\# *Function:
-\# Creates or modifies string $DOCTYPE_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign with no space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is +3 for TYPESET; 0 for TYPEWRITE.
-\#
-.MAC DOCTYPE_SIZE END
-. ds $DOCTYPE_SIZE_CHANGE \\$1
-.END
-\#
-\#
\# DOCUMENT LEFT MARGIN
\# --------------------
\# *Argument:
@@ -4580,8 +6440,8 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
.MAC DOC_FAMILY END
. br
-. ds $DOC_FAM \\$1
-. FAMILY \\*[$DOC_FAM]
+. ds $DOC_FAM \\$1
+. ds $FAMILY \\*[$DOC_FAM]
. TITLE_FAMILY \\*[$DOC_FAM]
. SUBTITLE_FAMILY \\*[$DOC_FAM]
. AUTHOR_FAMILY \\*[$DOC_FAM]
@@ -4592,7 +6452,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
. EPIGRAPH_FAMILY \\*[$DOC_FAM]
. HDRFTR_FAMILY \\*[$DOC_FAM]
-. PAGENUM_FAMILY \\*[$DOC_FAM]
+. FOOTNOTE_FAMILY \\*[$DOC_FAM]
.END
\#
\#
@@ -4601,7 +6461,7 @@ y\\R'#DESCENDER \\n[.cdp]'
\# *Argument:
\# <point size of running text>
\# *Function:
-\# Creates or modifies register $DOC_PT_SIZE.
+\# Creates or modifies register #DOC_PT_SIZE.
\# *Notes:
\# DOC_PT_SIZE is the basis for calculating all type sizes in
\# a document.
@@ -4640,6 +6500,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. if '\\$2'ADJUST' \{ .TRAPS \}
.END
\#
+\#
\# ADJUST DOCUMENT LEAD
\# --------------------
\# *Arguments:
@@ -4649,30 +6510,62 @@ y\\R'#DESCENDER \\n[.cdp]'
\# on #B_MARGIN.
\#
.MAC DOC_LEAD_ADJUST END
-. ie '\\$1'' \{ .nr #ADJ_DOC_LEAD 1 \}
-. el \{ .nr #ADJ_DOC_LEAD 0 \}
+. ie '\\$1'' \{\
+. nr #ADJ_DOC_LEAD 1
+. \}
+. el \{\
+. nr #ADJ_DOC_LEAD 0
+. nr #DOC_LEAD_ADJUST_OFF 1
+. \}
.END
\#
\#
-\# DOCUMENT QUAD
-\# -------------
-\# *Arguments:
-\# L | LEFT | R | RIGHT | C | CENTER | CENTRE | J | JUSTIFY
+\# SHIM
+\# ----
+\# *Argument:
+\# None
\# *Function:
-\# Creates or modifies string $DOC_QUAD.
+\# Advances to the next "legal" baseline.
\# *Notes:
-\# While QUAD (from the typesetting macros) can be used before START
-\# to change the default document quad, DOC_QUAD *must* be used after
-\# the START macro has been invoked.
+\# If a user plays around with spacing in a doc (say, with ALD),
+\# it isn't easy to get mom back on track so she can achieve
+\# perfectly flush bottom margins. Any time SHIM is used, it
+\# ensures that the next output line falls on a legal baseline.
\#
-\# Default is LEFT for printstyle TYPEWRITE, JUSTIFY for printstyle
-\# TYPESET.
+\# First, a little convenience macro
\#
-.MAC DOC_QUAD END
-. ds $DOC_QUAD \\$1
-. QUAD \\*[$DOC_QUAD]
+.MAC PROCESS_SHIM END
+. while \\n+[#LEGAL_BASELINE]<\\n[#CURRENT_V_POS] \{\
+.
+.\}
+. nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
.END
\#
+\#
+.MAC SHIM END
+. nr #LEGAL_BASELINE \\n[#T_MARGIN]-1v \\n[#DOC_LEAD]
+. if !r#CURRENT_V_POS \{ .nr #CURRENT_V_POS \\n(.d \}
+. ie r#ADVANCE_FROM_TOP \{\
+. ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
+. while \\n-[#LEGAL_BASELINE]>\\n[#CURRENT_V_POS] \{\
+.
+.\}
+. nr #LEGAL_BASELINE +\\n[#DOC_LEAD]
+. nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
+. \}
+. el \{\
+. PROCESS_SHIM
+. \}
+. \}
+. el \{\
+. PROCESS_SHIM
+. \}
+. ALD \\n[#SHIM]u
+. rr #CURRENT_V_POS
+.END
+\#
+\#
+\#
\# ====================================================================
\#
\# +++INTERNATIONALIZATION+++
@@ -4750,6 +6643,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. CAPS OFF
.END
\#
+\#
\# ====================================================================
\#
\# +++RECTO/VERSO+++
@@ -4775,65 +6669,6 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\# +++EPIGRAPHS+++
\#
-\# EPIGRAPH FAMILY
-\# ---------------
-\# *Argument:
-\# <family to use for epigraphs>
-\# *Function:
-\# Creates or modifies string $EPI_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC EPIGRAPH_FAMILY END
-. ds $EPI_FAM \\$1
-.END
-\#
-\#
-\# EPIGRAPH FONT
-\# -------------
-\# *Argument:
-\# <font to use for epigraphs>
-\# *Function:
-\# Creates or modifies string $EPI_FT.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC EPIGRAPH_FONT END
-. ds $EPI_FT \\$1
-.END
-\#
-\#
-\# EPIGRAPH SIZE
-\# -------------
-\# *Argument:
-\# <-|+ number of points by which to de/increase point size of epigraphs
-\# (relative to running text)>
-\# *Function:
-\# Creates or modifies string $EPI_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a - or + sign with no space afterwards.
-\# Fractional point sizes are allowed. Default -1.5 for printstyle
-\# TYPESET; +0 for TYPEWRITE.
-\#
-.MAC EPIGRAPH_SIZE END
-. ds $EPI_SIZE_CHANGE \\$1
-.END
-\#
-\#
-\# EPIGRAPH QUAD
-\# -------------
-\# *Arguments:
-\# L | LEFT | J | JUSTIFY
-\# *Function:
-\# Creates or modifies string $EPI_QUAD.
-\# *Notes:
-\# Default is $DOC_QUAD when BLOCK argument is passed to EPIGRAPH.
-\#
-.MAC EPIGRAPH_QUAD END
-. ds $EPI_QUAD \\$1
-.END
-\#
-\#
\# EPIGRAPH INDENT
\# ---------------
\# *Argument:
@@ -4883,6 +6718,10 @@ y\\R'#DESCENDER \\n[.cdp]'
.MAC EPIGRAPH END
. nr #PP_STYLE 2
. nr #Q_PP 0
+. if \\n[#LINENUMBERS]=1 \{\
+. NUMBER_LINES OFF
+. nr #LINENUMBERS 2
+. \}
. if \\n[#START] \{\
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
@@ -4891,6 +6730,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. ie '\\$1'' \{\
. nr #EPIGRAPH 1
. ev EPIGRAPH
+. nr #IN_DIVER 1
. ll \\n[#L_LENGTH]u
. ta \\n(.lu
. CHECK_INDENT
@@ -4921,11 +6761,19 @@ y\\R'#DESCENDER \\n[.cdp]'
. FAMILY \\*[$EPI_FAM]
. FT \\*[$EPI_FT]
. PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
+. if \\n[#EPI_COLOR]=1 \{\
+. nf
+\m[\\*[$EPI_COLOR]]
+. EOL
+. \}
. AUTOLEAD \\n[#EPI_AUTOLEAD]
. nr #EPI_LEAD \\n[#LEAD]
. nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
. \}
. di EPI_TEXT
+. nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
+. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
+. hy 14
. nr #EPI_ACTIVE 1
. \}
. el \{\
@@ -4971,9 +6819,16 @@ y\\R'#DESCENDER \\n[.cdp]'
. FAMILY \\*[$EPI_FAM]
. FT \\*[$EPI_FT]
. PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
+. if \\n[#EPI_COLOR]=1 \{\
+. nf
+\m[\\*[$EPI_COLOR]]
+. EOL
+. \}
. AUTOLEAD \\n[#EPI_AUTOLEAD]
. QUAD \\*[$EPI_QUAD]
-. HY
+. nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
+. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
+. hy 14
. nr #EPI_LEAD \\n[#LEAD]
. nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
. di EPI_TEXT
@@ -5003,13 +6858,27 @@ y\\R'#DESCENDER \\n[.cdp]'
.MAC DO_EPIGRAPH END
. br
. di
+. rr #IN_DIVER
+. if \\n[#RESET_FN_COUNTERS]=2 \{\
+. if !\\n[#FN_COUNT]=1 \{\
+. if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
+. DIVER_FN_2_POST
+. rr #RESET_FN_COUNTERS
+. \}
+. \}
+. \}
+. nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
+. nr #DONE_ONCE 0 1
. REMOVE_INDENT
. ev
. nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
. nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
. ie \\n[#START] \{\
+. RLD \\n[#SHIM]u
. nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
-. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
+. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
+. nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
+.\}
. if \\n[#PRINT_STYLE]=2 \{\
. RLD \\n[#DOC_LEAD]u
. if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
@@ -5024,7 +6893,9 @@ y\\R'#DESCENDER \\n[.cdp]'
. ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
. nr #EPI_FITS 1
. nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
-. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
+. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
+. nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
+.\}
. ie \\n[#PRINT_STYLE]=1 \{\
. if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
. \}
@@ -5036,20 +6907,28 @@ y\\R'#DESCENDER \\n[.cdp]'
. ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
. \}
. \}
+. if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
. \}
. el \{\
. nr #EPI_LINES_TO_TRAP 0 1
-. while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{ .nr #LOOP 1 \}
+. while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\
+. nr #LOOP 1
+.\}
. nr #EPI_LINES_TO_TRAP -1
. nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
-. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
+. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
+. nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
+.\}
. if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
. if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
. \}
. \}
. if \\n[#EPIGRAPH]=1 \{\
. po \\n[#L_MARGIN]u
-. if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
+. if \\n[#COLUMNS] \{\
+. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
+. \}
. \}
. if \\n[#EPIGRAPH]=2 \{\
. nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
@@ -5065,8 +6944,10 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#PRINT_STYLE]=1 \{\
. ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
. el \{\
-. if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#DOC_LEAD]u/2u \}
+. ie \\n[#EPI_LINES]%2=1 \{ .ALD \\n[#DOC_LEAD]u \}
+. el \{ .ALD \\n[#DOC_LEAD]u/2u \}
. \}
+. SHIM
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
@@ -5075,6 +6956,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
. ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
. \}
+. SHIM
. \}
. \}
. el \{\
@@ -5083,7 +6965,9 @@ y\\R'#DESCENDER \\n[.cdp]'
. ie \\n[#FN_FOR_EPI] \{\
. nr #EPI_LINES_TO_END 1
. nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
-. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
+. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
+. nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
+.\}
. ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
. \}
. el \{\
@@ -5102,10 +6986,12 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. el \{\
. nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
-. if \\n[#LOOP] \{. nr #EPI_LINES_TO_END +1 \}
+. if \\n[#LOOP] \{ .nr #EPI_LINES_TO_END +1 \}
. rr #LOOP
. nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
-. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
+. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
+. nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
+.\}
. ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
. if \\n[#PRINT_STYLE]=1 \{\
. if !\\n[#SINGLE_SPACE] \{\
@@ -5122,13 +7008,21 @@ y\\R'#DESCENDER \\n[.cdp]'
. ALD \\n[#DOC_LEAD]u
. QUAD \\*[$DOC_QUAD]
. po \\n[#L_MARGIN]u
-. if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
+. if \\n[#COLUMNS] \{\
+. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
+. \}
. if \\n[#START] \{\
. if \\n[#COLUMNS] \{\
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
. mk dc
. \}
. \}
+. if \\n[#LINENUMBERS]=2 \{\
+. NUMBER_LINES RESUME
+. nr #LINENUMBERS 1
+. \}
.END
\#
\# ====================================================================
@@ -5143,18 +7037,26 @@ y\\R'#DESCENDER \\n[.cdp]'
\# Deposits --END-- at the end of a document.
\#
.MAC FINIS END
+. br
+. ev FINIS
+. evc 0
. if \\n[#TAB_ACTIVE] \{ .TQ \}
. if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
-. FOOTERS OFF
-. PAGINATION OFF
. nr #EM_ADJUST (1m/8)
-. if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
+. if \\n[#COLUMNS] \{\
+. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
+. \}
. ALD \\n[#DOC_LEAD]u
. CENTER
. if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
. if \\n[#PRINT_STYLE]=2 \{\
-. PRINT "\v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em
+. ie \\n[#FINIS_COLOR] \{\
+. PRINT "\m[\\*[$FINIS_COLOR]]\v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em\m[]
+. \}
+. el \{ .PRINT \v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em\m[] \}
. \}
+. ev
.END
\#
\# ====================================================================
@@ -5168,47 +7070,6 @@ y\\R'#DESCENDER \\n[.cdp]'
.ds PAGE# \En[#PAGENUMBER]
\#
\#
-\# HDRFTR FAMILY
-\# -------------
-\# *Argument:
-\# <family to use in header/footers>
-\# *Function:
-\# Creates or modifies string $HDRFTR_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC HDRFTR_FAMILY END
-. ds $HDRFTR_FAM \\$1
-.END
-\#
-\#
-\# HDRFTR SIZE
-\# -----------
-\# *Argument:
-\# <+|-number of points by which to in/decrease point size of
-\# header/footers (relative to running text)>
-\# *Function:
-\# Creates or modifies string $HDRFTR_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign. No space afterwards.
-\# Fractional point sizes are allowed. Default is +0.
-\#
-\# By default, header/footers print the author .5 points smaller
-\# than the base point size of running text, center titles
-\# (Chapter, Draft, Revision, etc.) .5 points smaller
-\# than running text (in italics), and the document title 2 full
-\# points smaller than running text (in caps). The HDRFTR_SIZE
-\# macro changes the overall size for all three parts while
-\# maintaining the internal size changes.
-\#
-\# In other words, if the user likes the header/footers but wants
-\# them a bit bigger or a bit smaller, s/he should use HDRFTR_SIZE.
-\#
-.MAC HDRFTR_SIZE END
-. ds $HDRFTR_SIZE_CHANGE \\$1
-.END
-\#
-\#
\# HDRFTR RULE GAP
\# ---------------
\# *Argument:
@@ -5252,48 +7113,6 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
-\# HDRFTR LEFT FAMILY
-\# ------------------
-\# *Argument:
-\# <family of header/footer left string>
-\# *Function:
-\# Creates or modifies string $HDRFTR_LEFT_FAM.
-\#
-.MAC HDRFTR_LEFT_FAMILY END
-. ds $HDRFTR_LEFT_FAM \\$1
-.END
-\#
-\#
-\# HDRFTR LEFT FONT
-\# ----------------
-\# *Argument:
-\# <font of header/footer left string>
-\# *Function:
-\# Creates or modifies string $HDRFTR_LEFT_FT.
-\#
-.MAC HDRFTR_LEFT_FONT END
-. ds $HDRFTR_LEFT_FT \\$1
-.END
-\#
-\#
-\# HDRFTR LEFT SIZE
-\# ----------------
-\# *Argument:
-\# <+|- number of points to in/decrease size of left string in
-\# header/footers (relative to running text)>
-\# *Function:
-\# Creates or modifies string HDRFTR_LEFT_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign. No space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is -.5 for printstyle TYPESET; if all caps, -2
-\# Has no effect in TYPEWRITE.
-\#
-.MAC HDRFTR_LEFT_SIZE END
-. ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
-.END
-\#
-\#
\# HDRFTR LEFT CAPS
\# ----------------
\# *Argument:
@@ -5310,7 +7129,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. el \{\
. nr #HDRFTR_LEFT_CAPS 0
-. ds $HDRFTR_RIGHT_SIZE_CHANGE +0
+. ds $HDRFTR_LEFT_SIZE_CHANGE +0
. \}
.END
\#
@@ -5338,70 +7157,80 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
.MAC HDRFTR_CENTER END
. nr #USER_DEF_HDRFTR_CENTER 1
+. if '\\$0'FOOTER_CENTER' \{\
+. ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
+. ds $HDRFTR_CENTER_NEW \\$1
+. \}
+. if '\\$0'FOOTER_CENTRE' \{\
+. ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
+. ds $HDRFTR_CENTER_NEW \\$1
+. \}
. ds $HDRFTR_CENTER \\$1
.END
\#
\#
-\# HDRFTR CENTER FAMILY
-\# --------------------
-\# *Argument:
-\# <family of header/footer center string>
-\# *Function:
-\# Creates or modifies string $HDRFTR_CENTER_FAM.
-\#
-.MAC HDRFTR_CENTER_FAMILY END
-. ds $HDRFTR_CENTER_FAM \\$1
-.END
-\#
-\#
-\# HDRFTR CENTER FONT
+\# HDRFTR CENTER CAPS
\# ------------------
\# *Argument:
-\# <font of header/footer center string>
+\# <none> | <anything>
\# *Function:
-\# Creates or modifies string $HDRFTR_CENTER_FT.
+\# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
+\# the document) on or off.
+\# *Notes:
+\# Default is on.
\#
-.MAC HDRFTR_CENTER_FONT END
-. ds $HDRFTR_CENTER_FT \\$1
+.MAC HDRFTR_CENTER_CAPS END
+. ie '\\$1'' \{\
+. nr #HDRFTR_CENTER_CAPS 1
+. \}
+. el \{\
+. nr #HDRFTR_CENTER_CAPS 0
+. ds $HDRFTR_CENTER_SIZE_CHANGE +0
+. \}
.END
\#
\#
-\# HDRFTR CENTER SIZE
-\# ------------------
+\# HDRFTR CENTER PADDING
+\# ---------------------
\# *Argument:
-\# <+|- number of points to in/decrease size of centre string in
-\# header/footers (relative to header/footer size)>
+\# LEFT | RIGHT <amount of padding to put left or right of hdrftr
+\# center string>
\# *Function:
-\# Creates string HDRFTR_CENTER_SIZE_CHANGE.
+\# Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
+\# #HDRFTR_CTR_PAD_RIGHT.
\# *Notes:
-\# Must be preceded by a +|- sign. No space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is -.5 for printstyle TYPESET; if all caps, -2
-\# Has no effect in TYPEWRITE.
+\# By default, the HDRFTR_CENTER string is centered on the doc
+\# line length. Long titles or long author names can screw up
+\# visual centering, or create overprints. This macro allows the
+\# user to pad the center string by the specified amount of space
+\# to fix these problems. Use only one of LEFT or RIGHT.
+\#
+\# A unit of measure is required.
\#
-.MAC HDRFTR_CENTER_SIZE END
-. ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
+.MAC HDRFTR_CENTER_PAD END
+. if '\\$1'LEFT' \{\
+. nr #HDRFTR_CTR_PAD_LEFT (\\$2)
+. \}
+. if '\\$1'RIGHT' \{\
+. nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
+. \}
.END
\#
\#
-\# HDRFTR CENTER CAPS
-\# ------------------
+\# SWITCH HDRFTR CENTER PADDING SIDE - support macro
+\# --------------------------------
\# *Argument:
-\# <none> | <anything>
+\# <none>
\# *Function:
-\# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
-\# the document) on or off.
+\# Switches the padding side of hdrftr center padding.
\# *Notes:
-\# Default is on.
+\# Required to keep spacing around hdrftr string constant
+\# in recto/verso documents.
\#
-.MAC HDRFTR_CENTER_CAPS END
-. ie '\\$1'' \{\
-. nr #HDRFTR_CENTER_CAPS 1
-. \}
-. el \{\
-. nr #HDRFTR_CENTER_CAPS 0
-. ds $HDRFTR_CENTER_SIZE_CHANGE +0
-. \}
+.MAC SWITCH_HDRFTR_CENTER_PAD END
+. nr #HDRFTR_CTR_PAD_TMP \\n[#HDRFTR_CTR_PAD_LEFT]
+. HDRFTR_CENTER_PAD LEFT \\n[#HDRFTR_CTR_PAD_RIGHT]u
+. HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
.END
\#
\#
@@ -5431,48 +7260,6 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
-\# HDRFTR RIGHT FAMILY
-\# -------------------
-\# *Argument:
-\# <family of header/footer right string>
-\# *Function:
-\# Creates or modifies string $HDRFTR_RIGHT_FAM.
-\#
-.MAC HDRFTR_RIGHT_FAMILY END
-. ds $HDRFTR_RIGHT_FAM \\$1
-.END
-\#
-\#
-\# HDRFTR RIGHT FONT
-\# -----------------
-\# *Argument:
-\# <font of header/footer right string>
-\# *Function:
-\# Creates or modifies string $HDRFTR_RIGHT_FT.
-\#
-.MAC HDRFTR_RIGHT_FONT END
-. ds $HDRFTR_RIGHT_FT \\$1
-.END
-\#
-\#
-\# HDRFTR RIGHT SIZE
-\# -----------------
-\# *Argument:
-\# <+|- number of points to in/decrease size of right string in
-\# header/footers (relative to header/footer size)>
-\# *Function:
-\# Creates or modifies string HDRFTR_RIGHT_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign. No space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is -2 for printstyle TYPESET if all caps; otherwise -.5
-\# Has no effect in TYPEWRITE.
-\#
-.MAC HDRFTR_RIGHT_SIZE END
-. ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
-.END
-\#
-\#
\# HDRFTR RIGHT CAPS
\# -----------------
\# *Argument:
@@ -5485,7 +7272,7 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
.MAC HDRFTR_RIGHT_CAPS END
. ie '\\$1'' \{\
-. nr #HDRFTR_RIGHT_CAPS 1
+. nr #HDRFTR_RIGHT_CAPS 1
. \}
. el \{\
. nr #HDRFTR_RIGHT_CAPS 0
@@ -5493,24 +7280,35 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
.END
\#
+\#
\# HDRFTR RULE
\# -----------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
-\# under the header/footer. Otherwise, turns HDRFTR_RULE on or off.
+\# under the header/over the footer. Otherwise, turns HDRFTR_RULE
+\# on or off.
\#
.MAC HDRFTR_RULE END \"To print rule under header/over footer.
. ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
. ie \\n[#USERDEF_HDRFTR] \{\
. nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
-. PT_SIZE 12
-. if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
+. ps 12
+. if \\n[#HEADERS_ON] \{\
+. rt \\nyu
+. ALD \\n[#HDRFTR_RULE_GAP]u
+. \}
. if \\n[#FOOTERS_ON] \{\
+. rt \\nyu
. RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
. \}
-. PRINT \\l'\\n[#DOC_L_LENGTH]u'
+. ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
+. PRINT \m[\\*[$HDRFTR_RULE_COLOR]]\\l'\\n[#DOC_L_LENGTH]u'\m[]
+. \}
+. el \{\
+. PRINT \\l'\\n[#DOC_L_LENGTH]u'
+. \}
. br
. \}
. el \{\
@@ -5527,12 +7325,21 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
. \}
-. PT_SIZE 12
-. if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
+. ps 12
+. if \\n[#HEADERS_ON] \{\
+. rt \\nyu
+. ALD \\n[#HDRFTR_RULE_GAP]u
+. \}
. if \\n[#FOOTERS_ON] \{\
-. RLD \\n[#LEAD]u*3u+\\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
+. rt \\nyu
+. RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
+. \}
+. ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
+. PRINT \m[\\*[$HDRFTR_RULE_COLOR]]\\l'\\n[#DOC_L_LENGTH]u'\m[]
+. \}
+. el \{\
+. PRINT \\l'\\n[#DOC_L_LENGTH]u'
. \}
-. PRINT \\l'\\n[#DOC_L_LENGTH]u'
. br
. \}
. \}
@@ -5581,21 +7388,23 @@ y\\R'#DESCENDER \\n[.cdp]'
\# Creates or modifies register #SWITCH_HDRFTR, used to switch
\# default location of HDRFTR_LEFT and HDRFTR_RIGHT.
\# *Notes:
-\# Typically, the author string appears at the left of header/footers,
-\# and the title string appears at the right. This switches the
-\# location of the two. Useful in conjuction with RECTO_VERSO to
-\# tweak switches on alternate pages to come out as the user wishes.
-\# The assumption of RECTO_VERSO is that the first page of the document
-\# (recto) is odd, and even though it has no header/footer, if it did have one,
-\# it would print as AUTHOR...CENTER...TITLE (or whatever strings
-\# the user has supplied for HDRFTR_LEFT/RIGHT), meaning that the
-\# next page, which does have a header/footer, will come out as
-\# TITLE...CENTER...AUTHOR (or whatever strings the user has
-\# supplied for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user
-\# to get the desired string in the desired place on the desired
-\# recto/verso page.
\#
-\# Default is OFF.
+.ig
+Typically, the author string appears at the left of header/footers,
+and the title string appears at the right. This switches the
+location of the two. Useful in conjuction with RECTO_VERSO to tweak
+switches on alternate pages to come out as the user wishes. The
+assumption of RECTO_VERSO is that the first page of the document
+(recto) is odd, and even though it has no header/footer, if it did
+have one, it would print as AUTHOR...CENTER...TITLE (or whatever
+strings the user has supplied for HDRFTR_LEFT/RIGHT), meaning that
+the next page, which does have a header/footer, will come out as
+TITLE...CENTER...AUTHOR (or whatever strings the user has supplied
+for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user to get the
+desired string in the desired place on the desired recto/verso page.
+
+Default is OFF.
+..
\#
.MAC SWITCH_HDRFTR END
. ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
@@ -5613,7 +7422,9 @@ y\\R'#DESCENDER \\n[.cdp]'
\# *Notes:
\# For use when users don't want 3-part headers/footers, but rather
\# want to design their own headers/footers and need different
-\# headers/footers on recto and verso pages.
+\# headers/footers on recto and verso pages. Using just
+\# HEADER_RECTO, even when recto/verso is not on, allows users to
+\# design their own headers/footers for doc pages.
\#
.MAC HDRFTR_RECTO END
. nr #USERDEF_HDRFTR 1
@@ -5706,7 +7517,6 @@ y\\R'#DESCENDER \\n[.cdp]'
. if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{ .return \}
. \}
. \}
-. if \\n[#HEADERS_ON] \{ .vs 0 \}
. if \\n[#USERDEF_HDRFTR] \{\
. PRINT_USERDEF_HDRFTR
. return
@@ -5721,12 +7531,17 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #HDRFTR_TMP_CAPS_SWITCH \\n[#HDRFTR_LEFT_CAPS]
. nr #HDRFTR_LEFT_CAPS \\n[#HDRFTR_RIGHT_CAPS]
. nr #HDRFTR_RIGHT_CAPS \\n[#HDRFTR_TMP_CAPS_SWITCH]
+. ds $HDRFTR_TMP_COLOR_SWITCH \\*[$HDRFTR_LEFT_COLOR]
+. ds $HDRFTR_LEFT_COLOR \\*[$HDRFTR_RIGHT_COLOR]
+. ds $HDRFTR_RIGHT_COLOR \\*[$HDRFTR_TMP_COLOR_SWITCH]
. rr #HDRFTR_TMP_CAPS_SWITCH
. rm $HDRFTR_TMP_SWITCH
. rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
+. rm $HDRFTR_TMP_COLOR_SWITCH
. nr #SWITCH_HDRFTR 0
. \}
. nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
+. if \\n[#ENDNOTES] \{ .PAGENUM_STYLE \\*[$EN_PN_STYLE] \}
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#FOOTERS_ON] \{\
. di NULL
@@ -5748,11 +7563,12 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
. CENTER
. if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
+. rt \\nyu
. ie '\\*[$HDRFTR_CENTER]'#' \{\
-. PRINT \\v'-(\\n[#LEAD]u*1u)'\\n[#PAGENUMBER]
+. PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
. \}
. el \{\
-. ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\*[$HDRFTR_CENTER] \}
+. ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
. el \{ .PRINT \& \}
. \}
. if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
@@ -5760,19 +7576,26 @@ y\\R'#DESCENDER \\n[.cdp]'
. if e \{ .RIGHT \}
. if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
. if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
+. rt \\nyu
. ie '\\*[$HDRFTR_RIGHT]'#' \{\
-. PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
+. PRINT \\n[#PAGENUMBER]
. \}
. el \{\
-. ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
+. ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \\*[$HDRFTR_RIGHT] \}
. el \{ .PRINT \& \}
. \}
. if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
-. FAMILY \\*[$HDRFTR_LEFT_FAM]
-. FT \\*[$HDRFTR_LEFT_FT]
-. PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
+. if \\n[#HDRFTR_COLOR]=1 \{\
+. nf
+\m[\\*[$HDRFTR_COLOR]]
+. EOL
+. \}
+. fam \\*[$HDRFTR_LEFT_FAM]
+. ft \\*[$HDRFTR_LEFT_FT]
+. ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
+. vs 12
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
@@ -5783,15 +7606,30 @@ y\\R'#DESCENDER \\n[.cdp]'
. if e \{ .RIGHT \}
. if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
. if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
-. ie '\\*[$HDRFTR_LEFT]'#' \{ .PRINT \\n[#PAGENUMBER] \}
+. ie '\\*[$HDRFTR_LEFT]'#' \{\
+. ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
+. PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[]
+. \}
+. el \{\
+. PRINT \\n[#PAGENUMBER]
+. \}
+. \}
. el \{\
-. ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
+. ie !'\\*[$HDRFTR_LEFT]'' \{\
+. ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
+. PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[]
+. \}
+. el \{\
+. PRINT \\*[$HDRFTR_LEFT]
+. \}
+. \}
. el \{ .PRINT \& \}
. \}
. if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
-. FAMILY \\*[$HDRFTR_CENTER_FAM]
-. FT \\*[$HDRFTR_CENTER_FT]
-. PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
+. fam \\*[$HDRFTR_CENTER_FAM]
+. ft \\*[$HDRFTR_CENTER_FT]
+. ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
+. vs 12
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
@@ -5800,17 +7638,31 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. CENTER
. if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
+. rt \\nyu
. ie '\\*[$HDRFTR_CENTER]'#' \{\
-. PRINT \\v'-(\\n[#LEAD]u*1u)'\\n[#PAGENUMBER]
+. ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
+. PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
+. \}
+. el \{\
+. PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
+. \}
. \}
. el \{\
-. ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\*[$HDRFTR_CENTER] \}
+. ie !'\\*[$HDRFTR_CENTER]'' \{\
+. ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
+. PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
+. \}
+. el \{\
+. PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
+. \}
+. \}
. el \{ .PRINT \& \}
. \}
. if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
-. FAMILY \\*[$HDRFTR_RIGHT_FAM]
-. FT \\*[$HDRFTR_RIGHT_FT]
-. PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
+. fam \\*[$HDRFTR_RIGHT_FAM]
+. ft \\*[$HDRFTR_RIGHT_FT]
+. ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
+. vs 12
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
@@ -5821,11 +7673,24 @@ y\\R'#DESCENDER \\n[.cdp]'
. if e \{ .LEFT \}
. if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
. if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
+. rt \\nyu
. ie '\\*[$HDRFTR_RIGHT]'#' \{\
-. PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
+. ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
+. PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[]
+. \}
+. el \{\
+. PRINT \\n[#PAGENUMBER]
+. \}
. \}
. el \{\
-. ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
+. ie !'\\*[$HDRFTR_RIGHT]'' \{\
+. ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
+. PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[]
+. \}
+. el \{\
+. PRINT \\*[$HDRFTR_RIGHT]
+. \}
+. \}
. el \{ .PRINT \& \}
. \}
. if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
@@ -5833,6 +7698,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#HDRFTR_RULE] \{\
. HDRFTR_RULE_INTERNAL
. \}
+. br
.END
\#
\#
@@ -5853,6 +7719,10 @@ y\\R'#DESCENDER \\n[.cdp]'
. FAMILY \\*[$HDRFTR_FAM]
. FT R
. PT_SIZE \\n[#HDRFTR_PT_SIZE]u
+. if \\n[#HDRFTR_COLOR]=1 \{\
+. nf
+. COLOR \\*[$HDRFTR_COLOR]
+. \}
. \}
. ie \\n[#RECTO_VERSO] \{\
. if o \{\
@@ -5860,7 +7730,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
. PRINT \\*[$USERDEF_HDRFTR_RECTO]
-. EL
+. EOL
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
@@ -5873,21 +7743,21 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT \}
. if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
. if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT \}
-. \}
-. PRINT \\*[$USERDEF_HDRFTR_VERSO]
-. EL
-. if \\n[#FOOTERS_ON] \{\
-. di NULL
-. SIZESPECS
-. nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
-. di
+. PRINT \\*[$USERDEF_HDRFTR_VERSO]
+. EOL
+. if \\n[#FOOTERS_ON] \{\
+. di NULL
+. SIZESPECS
+. nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
+. di
+. \}
. \}
. el \{\
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
. PRINT \\*[$USERDEF_HDRFTR_RECTO]
-. EL
+. EOL
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
@@ -5902,7 +7772,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
. if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
. PRINT \\*[$USERDEF_HDRFTR_RECTO]
-. EL
+. EOL
. if \\n[#FOOTERS_ON] \{\
. di NULL
. SIZESPECS
@@ -5911,6 +7781,10 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. fc
+. if \\n[#PRINT_STYLE]=2 \{\
+. ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]]
+. el \m[black]
+. \}
. if \\n[#HDRFTR_RULE] \{\
. HDRFTR_RULE_INTERNAL
. \}
@@ -5976,37 +7850,46 @@ y\\R'#DESCENDER \\n[.cdp]'
\# event that the user enters .TITLE in caps/lc), I've used
\# quad left, quad centre, and quad right to arrange the three bits
\# of the header, rather than .tl. This allows the use of the CAPS macro.
-\# The downside is that I have to add \\v'-(\\n[#LEAD]u*#) in order
+\# The downside is that I have to add \\v'-(\\n[#LEAD]u*<n>) in order
\# for -Tlatin1 output to align the header/footer strings on the baseline.
\# The console output still isn't brilliant, but at least it's
\# comprehensible.
\#
.MAC HEADER END
-. PROCESS_FN_LEFTOVER
-. nr #FN_COUNT_FOR_COLS 0 1
+. MNtop
+. rr #FROM_FOOTER
+. nr #FROM_HEADER 1
+. nr #LAST_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]
+. if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
+. rr #RULED
. if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
. po \\n[#DOC_L_MARGIN]u
. if \\n[#RECTO_VERSO] \{\
-. nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
-. DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u
-. DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
+. if !\\n[#TOC_RV_SWITCH] \{\
+. nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
+. DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u
+. DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
+. SWITCH_HDRFTR_CENTER_PAD
+. \}
+. rr #TOC_RV_SWITCH
. \}
. ev HEADER
-. if \\n[#PRINT_STYLE]=1 \{ .vs 0 \}
-. if \\n[#PRINT_STYLE]=2 \{ .LS 0 \}
+. if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
. sp |\\n[#HEADER_MARGIN]u-1v
+. mk y
. ll \\n[#DOC_L_LENGTH]u
. ta \\n(.lu
-. if \\n[#PRINT_STYLE]=2 \{\
-. FAMILY \\*[$HDRFTR_FAM]
-. FT R
-. PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
-. \}
. if \\n[#PRINT_STYLE]=1 \{\
. fam C
. ft R
. ps 12\\*[$HDRFTR_SIZE_CHANGE]
. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. fam \\*[$HDRFTR_FAM]
+. ft R
+. ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
+. vs 12
+. \}
. nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
. if \\n[#CAPS_ON] \{\
. nr #CAPS_WAS_ON 1
@@ -6016,6 +7899,15 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #UNDERLINE_WAS_ON 1
. UNDERLINE OFF
. \}
+. if \\n[#PRINT_STYLE]=1 \{\
+. if \\n[#ENDNOTES]=1 \{\
+.\" Single-spaced endotes have a different lead
+. if \\n[#EN_SINGLESPACE] \{\
+. nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
+. nr #DOC_LEAD \\n[#EN_LEAD]u
+. \}
+. \}
+. \}
. ie \\n[#HEADERS_ON] \{\
. PRINT_HDRFTR
. sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
@@ -6030,6 +7922,14 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
. \}
+. if \\n[#PRINT_STYLE]=1 \{\
+. if \\n[#ENDNOTES]=1 \{\
+. if \\n[#EN_SINGLESPACE] \{\
+. nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
+. rr #RESTORE_DOC_LEAD
+. \}
+. \}
+. \}
. nr #PAGE_TOP \\n(nl
. ev
. po \\n[#L_MARGIN]u
@@ -6051,6 +7951,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
. po \\n[#Q_OFFSET]u
. \}
+. ALD \\n[#Q_LEAD_DIFF]u
. \}
. if \\n[#EPIGRAPH] \{\
. ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
@@ -6067,15 +7968,19 @@ y\\R'#DESCENDER \\n[.cdp]'
. el \{\
. ie \\n[#EPI_FITS] \{ .ns \}
. el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
-. \}
+. \}
. \}
. el \{ .ns \}
. ns
. if \\n[#COLUMNS] \{\
+. nr #FN_COUNT_FOR_COLS 0 1
+. nr #L_MARGIN \\n[#DOC_L_MARGIN]
. if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
. nr #COL_NUM 0 1
. mk dc
. po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
+. if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
. ll \\n[#COL_L_LENGTH]u
. ta \\n(.lu
. if \\n[#QUOTE] \{\
@@ -6089,11 +7994,44 @@ y\\R'#DESCENDER \\n[.cdp]'
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
. \}
. \}
+. if \\n[#RESET_FN_COUNTERS]=1 \{\
+. rr #RESET_FN_COUNTERS
+. PROCESS_FN_IN_DIVER
+. nr #FN_COUNT \\n[#SAVED_FN_COUNT] 1
+. if \\n[#COLUMNS]=1 \{ .nr #FN_COUNT_FOR_COLS \\n[#SAVED_FN_COUNT_FOR_COLS] 1 \}
+. ie \\n[#RESET_FN_NUMBER]=1 \{ .nr #FN_NUMBER \\n[#SAVED_FN_NUMBER] 1 \}
+. el \{ .nr #FN_NUMBER \\n[#FN_NUMBER] 1 \}
+. rm FN_IN_DIVER
+. if dRUNON_FN_IN_DIVER \{ .rm RUNON_FN_IN_DIVER \}
+. \}
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#SLANT_ON] \{\
. if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
. \}
. \}
+. rr #FROM_HEADER
+. rr #DEFER_SPACE_ADDED
+. if !\\n[#FN_DEPTH] \{\
+. if r#DIVERTED \{ .rr #DIVERTED \}
+. \}
+. if \\n[#MN_OVERFLOW_LEFT]=1 \{\
+. MN LEFT
+. nf
+. MN_OVERFLOW_LEFT
+. MN
+. \}
+. if \\n[#MN_OVERFLOW_RIGHT]=1 \{\
+. MN RIGHT
+. nf
+. MN_OVERFLOW_RIGHT
+. MN
+. \}
+. rm MN_OVERFLOW_LEFT
+. rr #MN_OVERFLOW_LEFT
+. rr #no-repeat-MN-left
+. rm MN_OVERFLOW_RIGHT
+. rr #MN_OVERFLOW_RIGHT
+. rr #no-repeat-MN-right
.END
\#
\# ====================================================================
@@ -6166,42 +8104,106 @@ y\\R'#DESCENDER \\n[.cdp]'
\# FINAL respects PAGENUMBER.
\#
.MAC FOOTER END
-. ev PAGE_BOTTOM
+. ev PAGE_TRANSITION
+. if \\n[MN-left]>0 \{\
+. if !\\n[#no-repeat-MN-left]=1 \{\
+. MNbottom-left
+. nr #no-repeat-MN-left 1
+. \}
+. if '\\n(.z'MN_OVERFLOW_LEFT' \{\
+. di
+. nr #MN_OVERFLOW_LEFT 1
+. rr #OVERFLOW_LEFT
+. \}
+. \}
+. if \\n[MN-right]>0 \{\
+. if (\\n[MN-right] > 0) \{\
+. if !\\n[#no-repeat-MN-right]=1 \{\
+. MNbottom-right
+. \}
+. \}
+. if '\\n(.z'MN_OVERFLOW_RIGHT' \{\
+. di
+. nr #MN_OVERFLOW_RIGHT 1
+. rr #OVERFLOW_RIGHT
+. \}
+. \}
+. ch MN_OVERFLOW_TRAP
+. nr #SAVED_LEAD \\n(.v
. nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
. if !\\n[#FN_DEFER] \{\
. nr #DIVER_DEPTH 0
-. if \\n[#FN_COUNT] \{\
-. sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u)
+. if \\n[#FN_DEPTH] \{\
+. if \\n[#DIVERTED]=3 \{ .nr #FN_DEPTH +\\n[#VFP_DIFF] \}
+. vpt 0
+. sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u-\\n[#DOC_LEAD]u)
+. vpt 1
. po \\n[#DOC_L_MARGIN]u
-. if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
+. if \\n[#COLUMNS] \{\
+. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
+. nr #FROM_FOOTER 1
+. \}
. nf
. FOOTNOTES
. rm FOOTNOTES
+. if dRUNON_FOOTNOTES \{ .rm RUNON_FOOTNOTES \}
+. if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#SAVED_LEAD]u \}
+. if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#SAVED_LEAD]u \}
. if '\\n(.z'FN_OVERFLOW' \{\
. di
. nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
. \}
+. nr #FN_COUNT_AT_FOOTER \\n[#FN_COUNT]
. nr #FN_COUNT 0
-. if \\n[#COL_NEXT] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
+. if \\n[#COL_NEXT] \{\
+. ie !\\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
+. el \{ .nr #COL_NUM \\n[#NUM_COLS] 1 \}
+. \}
. \}
+. rr #DIVERTED
. \}
-. ie \\n[#COLUMNS] \{\
+. ie \\n[#COLUMNS]=1 \{\
. ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
. el \{\
-. sp |\\n(dcu
+. ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
+. el \{ .sp |\\n(dcu \}
. po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
-. PROCESS_FN_LEFTOVER
+. nr #L_MARGIN \\n(.o
+. if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
+. LS \\n[#SAVED_LEAD]u
+. if \\n[#PREV_FN_DEFERRED] \{\
+. nr #PREV_FN_DEFERRED 2
+. \}
+. rr #RULED
. if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
. if !\\n[#QUOTE] \{ .rr #COL_NEXT \}
+. if \\n[#RESET_FN_COUNTERS]=1 \{\
+. rr #RESET_FN_COUNTERS
+. PROCESS_FN_IN_DIVER
+. LS \\n[#SAVED_LEAD]u
+. nr #FN_COUNT \\n[#FN_COUNT] 1
+. nr #FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] 1
+. rm FN_IN_DIVER
+. if dRUNON_FN_IN_DIVER \{ .rm RUNON_FN_IN_DIVER \}
+. \}
+. rr #DEFER_SPACE_ADDED
+. if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
. if \\n[#QUOTE] \{\
-. nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
-. if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
-. po \\n[#Q_OFFSET]u
+. ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
+. el \{\
+. nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
+. if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
+. po \\n[#Q_OFFSET]u
+. \}
. \}
. if \\n[#EPIGRAPH] \{\
-. nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
-. if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
-. po \\n[#EPI_OFFSET]u
+. ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
+. el \{\
+. nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
+. if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
+. po \\n[#EPI_OFFSET]u
+. \}
. \}
. ie \\n[#EPIGRAPH] \{\
. ie !\\n[#EPI_ACTIVE] \{\
@@ -6217,6 +8219,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. ev
. \}
. ns
+. rr #DIVERTED
. \}
. el \{ .DO_FOOTER \}
.END
@@ -6231,7 +8234,20 @@ y\\R'#DESCENDER \\n[.cdp]'
\# Resets CAPS and UNDERLINE if they were on.
\#
.MAC DO_FOOTER END
-. sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
+.\" Have to change position of FN_OVERFLOW_TRAP or it screws up the
+.\" placement of page numbers (or footers). It's reset to its original
+.\" position at the end of the macro.
+. if r#SAVED_FOOTER_POS \{ .ch FOOTER \\n[#SAVED_FOOTER_POS]u \}
+. rr #SAVED_FOOTER_POS
+. ie (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
+. nr #SKIP_FOOTER 1
+. \}
+. el \{\
+. vpt 0
+. sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
+. mk y
+. vpt 1
+. \}
. ev FOOTER
. po \\n[#DOC_L_MARGIN]u
. ll \\n[#DOC_L_LENGTH]u
@@ -6240,10 +8256,9 @@ y\\R'#DESCENDER \\n[.cdp]'
. FT R
. PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
. \}
+. LS \\n[#SAVED_LEAD]u
. nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
. if \\n[#CAPS_ON] \{\
. nr #CAPS_WAS_ON 1
@@ -6254,13 +8269,16 @@ y\\R'#DESCENDER \\n[.cdp]'
. UNDERLINE OFF
. \}
. ie \\n[#FOOTERS_ON] \{\
-. PRINT_HDRFTR
+. if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_HDRFTR \}
. \}
. el \{\
. if \\n[#PAGINATE] \{\
-. if \\n[#PAGE_NUM_V_POS]=2 \{ .PRINT_PAGE_NUMBER \}
+. if \\n[#PAGE_NUM_V_POS]=2 \{\
+. if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_PAGE_NUMBER \}
+. \}
. \}
. \}
+. rr #SKIP_FOOTER
. if \\n[#CAPS_WAS_ON] \{\
. CAPS
. rr #CAPS_WAS_ON
@@ -6270,7 +8288,10 @@ y\\R'#DESCENDER \\n[.cdp]'
. rr #UNDERLINE_WAS_ON
. \}
. ev
+. rr #SAVED_LEAD
. bp
+.\" This ev pops the PAGE_TRANSITION environment still active at the
+.\" end of HEADER
. ev
.END
\#
@@ -6399,65 +8420,6 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\# ---Main heads---
\#
-\# HEAD FAMILY
-\# -----------
-\# *Argument:
-\# <family to use for section titles (main heads)>
-\# *Function:
-\# Creates or modifies string $HEAD_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC HEAD_FAMILY END
-. ds $HEAD_FAM \\$1
-.END
-\#
-\#
-\# HEAD FONT
-\# ---------
-\# *Argument:
-\# <font to use for section titles (main heads)>
-\# *Function:
-\# Creates or modifies string $HEAD_FT.
-\# *Notes:
-\# Default is bold.
-\#
-.MAC HEAD_FONT END
-. ds $HEAD_FT \\$1
-.END
-\#
-\#
-\# HEAD SIZE
-\# ---------
-\# *Argument:
-\# <+|- number of points by which to in/decrease point size of
-\# section titles (relative to running text)>
-\# *Function:
-\# Creates or modifies string $HEAD_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a - or + sign with no space afterwards.
-\# Fractional point sizes are allowed.
-\# Default +1 for printstyle TYPESET; +0 for TYPEWRITE.
-\#
-.MAC HEAD_SIZE END
-. ds $HEAD_SIZE_CHANGE \\$1
-.END
-\#
-\#
-\# HEAD QUAD
-\# ---------
-\# *Arguments:
-\# L | LEFT | R | RIGHT | C | CENTER | CENTRE
-\# *Function:
-\# Creates or modifies string $HEAD_QUAD.
-\# *Notes:
-\# Default is CENTER.
-\#
-.MAC HEAD_QUAD END
-. ds $HEAD_QUAD \\$1
-.END
-\#
-\#
\# HEAD CAPS
\# ---------
\# *Arguments:
@@ -6519,7 +8481,71 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
.MAC HEAD END
. br
+.\" Collect head for TOC.
. nr #ARG_NUM 0 1
+. nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
+. af #TOC_ENTRY_PN \\g[#PAGENUMBER]
+. while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
+. ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
+. as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\\|
+. \}
+. el \{\
+.\" Note that in the .as lines, below, \ at the end has a literal
+.\" space after it.
+. ie \\n[#NUMBER_HEAD] \{\
+. ie \\n[#ARG_NUM]=0 \{\
+. as $TOC_HEAD_ITEM \\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\
+. nr #HEAD_NUM \\n-[#HEAD_NUM]
+. \}
+. el \{\
+. as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\
+. \}
+. \}
+. el \{\
+. as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\
+. \}
+. \}
+.\}
+.\" Note the use of \!, which transparently embeds the macros used
+.\" in the TOC_ENTRIES diversion. The elements they control must be
+.\" processed literally when the diversion is output.
+. ev TOC_EV
+. da TOC_ENTRIES
+. if \\n[#PRINT_STYLE]=1 \{\
+\!. fam C
+\!. ft R
+\!. ps 12
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_HEAD_FAM]
+\!. FT \\*[$TOC_HEAD_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
+. \}
+\!. TRAP OFF
+. ie \\n[#PRINT_STYLE]=1 \{\
+\!. PAD "\\h'2m'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN_TYPEWRITE]"
+. \}
+. el \{\
+\!. PAD "\\h'\\n[#TOC_HEAD_INDENT]u'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN]"
+. \}
+\!. EOL
+\!. ST 100 L
+\!. ST 101 R
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_PN_FAM]
+\!. FT \\*[$TOC_PN_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
+. \}
+\!. TAB 100
+\!. PRINT \\*[LEADER]
+\!. TN
+\!. TRAP
+\!. PRINT \\n[#TOC_ENTRY_PN]
+\!. TQ
+. di
+. ev
+.\" End collection of head for TOC
+.\" Process head
. nr #HEAD 1
. ev HEAD
. ll \\n[#L_LENGTH]u
@@ -6531,9 +8557,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. CHECK_INDENT
. QUAD \\*[$HEAD_QUAD]
. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
. vs \\n[#DOC_LEAD]u
. UNDERLINE OFF
. \}
@@ -6545,13 +8569,13 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. if r#QUOTE \{ .rr #QUOTE \}
. if r#EPIGRAPH \{ .rr #EPIGRAPH \}
-. if \\n[#PRINT_STYLE]=1 \{ .ne 3 \}
+. if \\n[#PRINT_STYLE]=1 \{ .ne \\n[#NUM_ARGS]+2 \}
. if \\n[#PRINT_STYLE]=2 \{\
-. ie \\n[#HEAD_SPACE] \{ .ne 4 \}
-. el \{ .ne 3 \}
+. ie \\n[#HEAD_SPACE] \{ .ne \\n[#NUM_ARGS]+3 \}
+. el \{ .ne \\n[#NUM_ARGS]+2 \}
. \}
. ie \\n[#START] \{\
-. if \\n[#DOC_HEADER]=0 \{ . \}
+. if \\n[#DOC_HEADER]=0 \{ .RLD 1v \}
. \}
. el \{\
. if \\n[#PRINT_STYLE]=1 \{\
@@ -6574,7 +8598,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. el \{ .ALD \\n[#DOC_LEAD]u \}
. \}
. if \\n[#END_QUOTE] \{\
-. if !\\n[#Q_FITS] \{\
+. if !\\n[#Q_FITS] \{\
. RLD \\n[#DOC_LEAD]u
. if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
. \}
@@ -6588,7 +8612,17 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. \}
+.\" Print head
+. nr #ARG_NUM 0 1
. if \\n[#HEAD_CAPS] \{ .CAPS \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. if \\n[#HEAD_COLOR]=1 \{\
+. TRAP OFF
+. COLOR \\*[$HEAD_COLOR]
+. EOL
+. TRAP
+. \}
+. \}
. while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
. ie \\n[#NUMBER_HEAD] \{\
. ie \\n[#ARG_NUM]=0 \{\
@@ -6610,7 +8644,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
. br
. \}
-. \}
+.\}
. REMOVE_INDENT
. CAPS OFF
. ev
@@ -6626,71 +8660,13 @@ y\\R'#DESCENDER \\n[.cdp]'
. if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
. if r#PP_ACTIVE \{ .rr #PP_ACTIVE \}
. rr #ARG_NUM
+. rm $TOC_HEAD_ITEM
. nr #PP 0
.END
\#
\#
\# ---Subheads---
\#
-\# SUBHEAD FAMILY
-\# --------------
-\# *Argument:
-\# <family to use in subheads>
-\# *Function:
-\# Creates or modifies string $SH_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC SUBHEAD_FAMILY END
-. ds $SH_FAM \\$1
-.END
-\#
-\#
-\# SUBHEAD FONT
-\# --------------
-\# *Argument:
-\# <font to use in subheads>
-\# *Function:
-\# Creates or modifies string $SH_FT.
-\# *Notes:
-\# Default is bold.
-\#
-.MAC SUBHEAD_FONT END
-. ds $SH_FT \\$1
-.END
-\#
-\#
-\# SUBHEAD SIZE
-\# ------------
-\# *Argument:
-\# <+|- number of points by which to in/decrease point size of subheads
-\# (relative to running text)>
-\# *Function:
-\# Creates or modifies string $SH_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign. No space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
-\#
-.MAC SUBHEAD_SIZE END
-. ds $SH_SIZE_CHANGE \\$1
-.END
-\#
-\#
-\# SUBHEAD QUAD
-\# ------------
-\# *Argument:
-\# L | LEFT | R | RIGHT | C | CENTER | CENTRE
-\# *Function:
-\# Creates or modifies string $SH_QUAD.
-\# *Notes:
-\# Default is LEFT for both TYPESET and TYPEWRITE.
-\#
-.MAC SUBHEAD_QUAD END
-. ds $SH_QUAD \\$1
-.END
-\#
-\#
\# SUBHEAD
\# -------
\# *Arguments:
@@ -6707,6 +8683,70 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
.MAC SUBHEAD END
. br
+.\" Collect subhead for TOC.
+. nr #ARG_NUM 0 1
+. nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
+. while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
+. ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
+. as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\\|
+. \}
+. el \{\
+.\" Note that in the .as lines, below, \ at the end has a literal
+.\" space after it.
+. ie \\n[#NUMBER_SH] \{\
+. ie \\n[#ARG_NUM]=0 \{\
+. as $TOC_SH_ITEM \\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]\
+. nr #SH_NUM \\n-[#SH_NUM]
+. \}
+. el \{\
+. as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\
+. \}
+. \}
+. el \{\
+. as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\
+. \}
+. \}
+.\}
+.\" Note the use of \!, which transparently embeds the macros used
+.\" in the TOC_ENTRIES diversion. The elements they control must be
+.\" processed literally when the diversion is output.
+. ev TOC_EV
+. da TOC_ENTRIES
+. if \\n[#PRINT_STYLE]=1 \{\
+\!. fam C
+\!. ft R
+\!. ps 12
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_SH_FAM]
+\!. FT \\*[$TOC_SH_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
+. \}
+\!. TRAP OFF
+. ie \\n[#PRINT_STYLE]=1 \{\
+\!. PAD "\\h'4m'\\*[$TOC_SH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
+. \}
+. el \{\
+\!. PAD "\\h'\\n[#TOC_SH_INDENT]u'\\*[$TOC_SH_ITEM]\\*[$TOC_PN]"
+. \}
+\!. EOL
+\!. ST 100 L
+\!. ST 101 R
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_PN_FAM]
+\!. FT \\*[$TOC_PN_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
+. \}
+\!. TAB 100
+\!. PRINT \\*[LEADER]
+\!. TN
+\!. TRAP
+\!. PRINT \\n[#TOC_ENTRY_PN]
+\!. TQ
+. di
+. ev
+.\" End collection of head for TOC
+.\" Process subhead
. nr #ARG_NUM 0 1
. if r#QUOTE \{ .rr #QUOTE \}
. if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
@@ -6719,9 +8759,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. CHECK_INDENT
. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
. vs \\n[#DOC_LEAD]u
. QUAD \\*[$SH_QUAD]
. UNDERLINE OFF
@@ -6735,9 +8773,9 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
. if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
-. ie \\n[#START] \{ . \}
+. ie \\n[#START] \{ .RLD 1v \}
. el \{\
-. ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]u*2u) ) \{\
+. ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]*(\\n[#NUM_ARGS]+1)) ) \{\
. ie \\n[#COLUMNS] \{ .COL_NEXT \}
. el \{ .bp \}
. \}
@@ -6759,6 +8797,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. \}
+.\" Print subhead
. if \\n[#PRINT_STYLE]=1 \{\
. while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
. ie \\n[#NUMBER_SH] \{\
@@ -6786,12 +8825,13 @@ y\\R'#DESCENDER \\n[.cdp]'
. UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
. br
. \}
-. \}
+.\}
. \}
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
+. if \\n[#SH_COLOR]=1 \{ .COLOR \\*[$SH_COLOR] \}
. ie \\n[#PP_SPACE]=0 \{\
. while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
. ie \\n[#NUMBER_SH] \{\
@@ -6818,7 +8858,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
. br
. \}
-. \}
+.\}
. \}
. el \{\
. ALD \\n[#DOC_LEAD]u
@@ -6827,7 +8867,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#EPIGRAPH] \{ .RLD \\n[#DOC_LEAD]u \}
. while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
. PRINT "\\$[\\n+[#ARG_NUM]]
-. \}
+.\}
. ALD \\n[#DOC_LEAD]u
. \}
. \}
@@ -6839,57 +8879,13 @@ y\\R'#DESCENDER \\n[.cdp]'
. if r#Q_FITS \{ .rr #Q_FITS \}
. if r#END_QUOTE \{ .rr #END_QUOTE \}
. if r#LINEBREAK \{ .rr #LINEBREAK \}
+. rm $TOC_SH_ITEM
. nr #PP 0
. nr #HEAD 2
.END
\#
\# ---Paragraph heads---
\#
-\# PARAHEAD FAMILY
-\# ---------------
-\# *Argument:
-\# <family to use in paraheads>
-\# *Function:
-\# Creates or modifies string $PH_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC PARAHEAD_FAMILY END
-. ds $PH_FAM \\$1
-.END
-\#
-\#
-\# PARAHEAD FONT
-\# -------------
-\# *Argument:
-\# <font to use in paraheads>
-\# *Function:
-\# Creates or modifies string $PH_FT.
-\# *Notes:
-\# Default is bold italic for TYPESET; underlined for TYPEWRITE.
-\#
-.MAC PARAHEAD_FONT END
-. ds $PH_FT \\$1
-.END
-\#
-\#
-\# PARAHEAD SIZE
-\# -------------
-\# *Argument:
-\# <+|- number of points by which to in/decrease point size of subheads
-\# (relative to running text)>
-\# *Function:
-\# Creates or modifies string $PH_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign. No space afterwards.
-\# Fractional point sizes are allowed. No unit of measure, please.
-\# Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
-\#
-.MAC PARAHEAD_SIZE END
-. ds $PH_SIZE_CHANGE \\$1
-.END
-\#
-\#
\# PARAHEAD INDENT
\# ---------------
\# *Argument:
@@ -6915,6 +8911,52 @@ y\\R'#DESCENDER \\n[.cdp]'
\# PARAHEAD *must* come after PP.
\#
.MAC PARAHEAD END
+.\" Collect parahead for TOC.
+. nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
+. ie \\n[#NUMBER_PH] \{\
+. ds $TOC_PH_ITEM \\n+[#PH_NUM].\0\\$1\\|
+. nr #PH_NUM \\n-[#PH_NUM]
+. \}
+. el \{\
+. ds $TOC_PH_ITEM \\$1\\|
+. \}
+. ev TOC_EV
+. da TOC_ENTRIES
+. if \\n[#PRINT_STYLE]=1 \{\
+\!. fam C
+\!. ft R
+\!. ps 12
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_PH_FAM]
+\!. FT \\*[$TOC_PH_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PH_SIZE_CHANGE]
+. \}
+\!. TRAP OFF
+. ie \\n[#PRINT_STYLE]=1 \{\
+\!. PAD "\\h'6m'\\*[$TOC_PH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
+. \}
+. el \{\
+\!. PAD "\\h'\\n[#TOC_PH_INDENT]u'\\*[$TOC_PH_ITEM]\\*[$TOC_PN]"
+. \}
+\!. EOL
+\!. ST 100 L
+\!. ST 101 R
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_PN_FAM]
+\!. FT \\*[$TOC_PN_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
+. \}
+\!. TAB 100
+\!. PRINT \\*[LEADER]
+\!. TN
+\!. TRAP
+\!. PRINT \\n[#TOC_ENTRY_PN]
+\!. TQ
+. di
+. ev
+.\" End collection of parahead for TOC
+.\" Process parahead
. if \\n[#SLANT_ON] \{\
. nr #SLANT_WAS_ON 1
\E*[SLANTX]
@@ -6926,9 +8968,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. el \{ .ti \\n[#PH_INDENT]u \}
. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
. UNDERLINE OFF
. ie \\n[#NUMBER_PH] \{\
. if \\n[#NUMBER_HEAD] \{\
@@ -6970,38 +9010,41 @@ y\\R'#DESCENDER \\n[.cdp]'
. FAM \\*[$PH_FAM]
. FT \\*[$PH_FT]
. PT_SIZE \\*[$PH_SIZE_CHANGE]
-. ie \\n[#NUMBER_PH] \{\
-. if \\n[#NUMBER_HEAD] \{\
+. if \\n[#PH_COLOR]=1 \{ .COLOR \\*[$PH_COLOR] \}
+. ie \\n[#NUMBER_PH] \{\
+. if \\n[#NUMBER_HEAD] \{\
+. ie \\n[#NUMBER_SH] \{\
+. PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
+. \}
+. el \{\
+. PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
+. \}
+. \}
. ie \\n[#NUMBER_SH] \{\
-. PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
+. if !\\n[#NUMBERED] \{\
+. PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
+. \}
. \}
. el \{\
-. PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
-. \}
-. \}
-. ie \\n[#NUMBER_SH] \{\
-. if !\\n[#NUMBERED] \{\
-. PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
+. if !\\n[#NUMBERED] \{\
+. PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
+. \}
. \}
. \}
. el \{\
-. if !\\n[#NUMBERED] \{\
-. PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
-. \}
+. PRINT "\\$1\h'.6m'\c"
. \}
. \}
-. el \{\
-. PRINT "\\$1\h'.6m'\c"
-. \}
-. FAMILY \\*[$DOC_FAM]
-. FT \\*[$PP_FT]
-. PT_SIZE \\n[#DOC_PT_SIZE]u
-. if \\n[#SLANT_WAS_ON] \{\
-. rr #SLANT_WAS_ON 1
+. FAMILY \\*[$DOC_FAM]
+. FT \\*[$PP_FT]
+. PT_SIZE \\n[#DOC_PT_SIZE]u
+. if \\n[#PH_COLOR]=1 \m[]\c
+. if \\n[#SLANT_WAS_ON] \{\
+. rr #SLANT_WAS_ON
\E*[SLANT]\c
-. \}
. \}
. rr #NUMBERED
+. rm $TOC_PH_ITEM
.END
\#
\#
@@ -7032,7 +9075,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. while \\$2>\\n[#REPEAT] \{\
. as $LINEBREAK_CHAR "\\ \\$1
. nr #REPEAT \\n[#REPEAT]+1
-. \}
+.\}
. rr #REPEAT
.END
\#
@@ -7059,10 +9102,13 @@ y\\R'#DESCENDER \\n[.cdp]'
. ie \\n[#END_QUOTE] \{ . \}
. el \{ .ALD \\n[#DOC_LEAD]u \}
. \}
+. ev LINEBREAK
+. evc 0
. CENTER
-. PRINT \\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'
+. PRINT \m[\\*[$LINEBREAK_COLOR]]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\m[]
. if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
. if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
+. ev
. QUAD \\*[$DOC_QUAD]
. \}
. nr #LINEBREAK 1
@@ -7165,30 +9211,22 @@ y\\R'#DESCENDER \\n[.cdp]'
. br
. if \\n[#DOC_TYPE]=4 \{\
. if !'\\n(.z'' \{ .di \}
-. if \\n[#DATE] \{\
-. nf
-. DATE
-. QUAD \\*[$DOC_QUAD]
-. ALD \\n[#DOC_LEAD]u*2u
-. rr #DATE
-. \}
-. if \\n[#TO] \{\
-. nf
-. TO_ADDRESS
-. ALD \\n[#DOC_LEAD]u
-. rr #TO
-. \}
-. if \\n[#FROM] \{\
-. nf
-. FROM_ADDRESS
-. ALD \\n[#DOC_LEAD]u
-. rr #FROM
-. \}
-. if \\n[#GREETING] \{\
-. nf
-. GREETING
-. ALD \\n[#DOC_LEAD]u
-. rr #GREETING
+. nr #TOTAL_FIELDS \\n[#FIELD]
+. nr #FIELD 0 1
+. nr #NUM_FIELDS 0 1
+. if \\n[#TOTAL_FIELDS]>0 \{\
+. while \\n+[#NUM_FIELDS]<=\\n[#TOTAL_FIELDS] \{\
+. nf
+. LETTERHEAD\\n+[#FIELD]
+. QUAD \\*[$DOC_QUAD]
+. ALD \\n[#DOC_LEAD]u
+. if \\n[#DATE_FIRST]=1 \{ .ALD \\n[#DOC_LEAD]u \}
+. rr #DATE_FIRST
+. rm LETTERHEAD\\n[#FIELD]
+.\}
+. rr #FIELD
+. rr #NUM_FIELDS
+. rr #TOTAL_FIELDS
. \}
. \}
. rr #PP_ACTIVE
@@ -7202,14 +9240,16 @@ y\\R'#DESCENDER \\n[.cdp]'
. br
. if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
. if \\n[#COLUMNS] \{\
-. if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
+. if !\\n[#ENDNOTE] \{\
+. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
+. \}
. \}
. if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
. ie \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
-. vs \\n[#DOC_LEAD]u
+. TYPEWRITER
+. ie \\n[#ENDNOTE] \{ .vs \\n[#EN_LEAD]u \}
+. el \{ .vs \\n[#DOC_LEAD]u \}
. QUAD \\*[$DOC_QUAD]
. UNDERLINE OFF
. if \\n[#SLANT_ON] \{\
@@ -7221,7 +9261,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. FAMILY \\*[$EN_FAM]
. FT \\*[$EN_FT]
. PT_SIZE \\n[#EN_PS]u
-. LS \\n[#DOC_LEAD]u
+. vs \\n[#EN_LEAD]u
. QUAD \\*[$EN_QUAD]
. \}
. el \{\
@@ -7257,9 +9297,20 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#PP_SPACE] \{\
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#END_QUOTE] \{\
+. ALD \\n[#DOC_LEAD]u
. rr #END_QUOTE
+. nr #NO_SPACE 1
+. nr #BASELINE_MARK \\n(nl
+. \}
+. el \{\
+. if \\n[#NO_SPACE]=1 \{\
+. rr #NO_SPACE
+. \}
+. if !\\n(nl=\\n[#BASELINE_MARK] \{\
+. ALD \\n[#DOC_LEAD]u
+. rr #BASELINE_MARK
+. \}
. \}
-. el \{ .ALD \\n[#DOC_LEAD]u \}
. \}
. \}
. ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
@@ -7276,8 +9327,8 @@ y\\R'#DESCENDER \\n[.cdp]'
. if r#Q_FITS \{ .rr #Q_FITS \}
. if r#LINEBREAK \{ .rr #LINEBREAK \}
. if \\n[#ENDNOTE] \{\
-. ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
-. el \{ .PARA_SPACE OFF \}
+. ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
+. el \{ .PARA_SPACE OFF \}
. \}
. if \\n[#CONDENSE] \{\
\E*[COND]\c
@@ -7321,52 +9372,7 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\# +++QUOTES+++
\#
-\# ---Line for line (poetic) quotes---
-\#
-\# QUOTE FAMILY
-\# ------------
-\# *Argument:
-\# <family to use in line for line quotes>
-\# *Function:
-\# Creates or modifies string $QUOTE_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC QUOTE_FAMILY END
-. ds $QUOTE_FAM \\$1
-.END
-\#
-\#
-\# QUOTE FONT
-\# ----------
-\# *Argument:
-\# <font to use in line for line quotes>
-\# *Function:
-\# Creates or modifies string $QUOTE_FT.
-\# *Notes:
-\# Default is italic for TYPESET.
-\#
-.MAC QUOTE_FONT END
-. ds $QUOTE_FT \\$1
-.END
-\#
-\#
-\# QUOTE SIZE
-\# ----------
-\# *Argument:
-\# <-|+ number of points by which to de/increase point size of
-\# line for line quotes (relative to running text)>
-\# *Function:
-\# Creates or modifies string $QUOTE_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a - or + sign with no space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is +0.
-\#
-.MAC QUOTE_SIZE END
-. ds $QUOTE_SIZE_CHANGE \\$1
-.END
-\#
+\# ---Line for line quotes, i.e. poetry or code snippets---
\#
\# UNDERLINE QUOTES
\# ----------------
@@ -7399,6 +9405,24 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
+\# QUOTE_AUTOLEAD
+\# --------------
+\# *Arguments:
+\# <autolead value>
+\# *Function:
+\# Sets autolead for quotes and/or blockquotes.
+\#
+.MAC QUOTE_AUTOLEAD END
+. if '\\$0'QUOTE_AUTOLEAD' \{ .nr #Q_AUTOLEAD \\$1 \}
+. if '\\$0'BLOCKQUOTE_AUTOLEAD' \{ .nr #BQ_AUTOLEAD \\$1 \}
+. if '\\$0'ENDNOTE_QUOTE_AUTOLEAD' \{ .nr #EN_Q_AUTOLEAD \\$1 \}
+. if '\\$0'ENDNOTE_BLOCKQUOTE_AUTOLEAD' \{ .nr #EN_BQ_AUTOLEAD \\$1 \}
+.END
+\#
+.ALIAS BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
+.ALIAS ENDNOTE_QUOTE_AUTOLEAD QUOTE_AUTOLEAD
+.ALIAS ENDNOTE_BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
+\#
\# ALWAYS FULLSPACE QUOTES
\# -----------------------
\# *Arguments:
@@ -7428,22 +9452,32 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
.MAC QUOTE END
. br
-\# **Uncomment the next line to prevent orphaned quote lines.
-\#. ne 1
+. if \\n[#LINENUMBERS]=1 \{\
+. nr #LINENUMBERS 2
+. nr #NEXT_LN \\n(ln
+. nm
+. \}
. ie '\\$1'' \{\
. ev QUOTE
+. if \\n[#LINENUMBERS]=2 \{\
+. if \\n[#SILENT_QUOTE_LN]=1 \{ .nm \\n[#NEXT_LN] 1000 -4 \}
+. \}
+. nr #IN_DIVER 1
. nr #QUOTE 1
. di P_QUOTE
. ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
+. if \\n[#LINENUMBERS]=2 \{\
+. if \\n[#QUOTE_LN]=1 \{\
+. nm \\n(ln "" \\*[$Q_LN_GUTTER] -3-\\*[$Q_LN_GUTTER]
+. \}
+. \}
. ta \\n(.lu
. if \\n[#COLUMNS] \{\
. ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
. ta \\n(.lu
. \}
. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
. vs \\n[#DOC_LEAD]u
. LEFT
. \}
@@ -7451,8 +9485,35 @@ y\\R'#DESCENDER \\n[.cdp]'
. FAMILY \\*[$QUOTE_FAM]
. FT \\*[$QUOTE_FT]
. PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
-. LS \\n[#DOC_LEAD]u
+. ie !r#Q_AUTOLEAD \{ .LS \\n[#Q_LEAD]u \}
+. el \{\
+. AUTOLEAD \\n[#Q_AUTOLEAD]
+. nr #Q_LEAD \\n(.v
+. \}
+. if \\n[#ENDNOTE] \{\
+. PT_SIZE \\n[#EN_PS]u\\*[$QUOTE_SIZE_CHANGE]
+. ie !r#EN_Q_AUTOLEAD \{ .LS \\n[#EN_Q_LEAD]u \}
+. el \{\
+. AUTOLEAD \\n[#EN_Q_AUTOLEAD]
+. nr #EN_Q_LEAD \\n(.v
+. \}
+. \}
+. nr #Q_LEAD_REAL \\n(.v
. LEFT
+. if \\n[#QUOTE_COLOR]=1 \{\
+. nf
+\m[\\*[$QUOTE_COLOR]]
+. EOL
+. \}
+. \}
+. if \\n[#LINENUMBERS]=2 \{\
+. ie \\n[#QUOTE_LN]=1 \{\
+. if '\\*[$Q_LN_GUTTER]'' .ds $Q_LN_GUTTER \\*[$LN_GUTTER]
+. nm \\n(ln "" \\*[$Q_LN_GUTTER] -3-\\*[$Q_LN_GUTTER]
+. \}
+. el \{\
+. if !\\n[#SILENT_QUOTE_LN] \{ .NUMBER_LINES OFF \}
+. \}
. \}
. nr #Q_TOP \\n(nl
. if \\n[#PRINT_STYLE]=1 \{\
@@ -7464,75 +9525,15 @@ y\\R'#DESCENDER \\n[.cdp]'
. el \{ .DO_QUOTE \}
.END
\#
-\#
\# ---Blockquotes---
\#
-\# BLOCKQUOTE FAMILY
-\# -----------------
-\# *Argument:
-\# <family to use in blockquotes>
-\# *Function:
-\# Creates or modifies string $BQUOTE_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC BLOCKQUOTE_FAMILY END
-. ds $BQUOTE_FAM \\$1
-.END
-\#
-\#
-\# BLOCKQUOTE FONT
-\# ---------------
-\# *Argument:
-\# <font to use in blockquotes>
-\# *Function:
-\# Creates or modifies string $BQUOTE_FT.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC BLOCKQUOTE_FONT END
-. ds $BQUOTE_FT \\$1
-.END
-\#
-\#
-\# BLOCKQUOTE SIZE
-\# ---------------
-\# *Argument:
-\# <-|+ number of points by which to de/increase point size of blockquotes
-\# (relative to running text)>
-\# *Function:
-\# Creates or modifies string $BQUOTE_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a - or + sign with no space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is -1 for printstyle TYPESET; +0 for TYPEWRITE.
-\#
-.MAC BLOCKQUOTE_SIZE END
-. ds $BQUOTE_SIZE_CHANGE \\$1
-.END
-\#
-\#
-\# BLOCKQUOTE QUAD
-\# ---------------
-\# *Arguments:
-\# <quad to use in blockquotes>
-\# *Function:
-\# Creates or modifies string $BQUOTE_QUAD.
-\# *Notes:
-\# Default is LEFT.
-\#
-.MAC BLOCKQUOTE_QUAD END
-. ds $BQUOTE_QUAD \\$1
-.END
-\#
-\#
\# BLOCKQUOTE
\# ----------
\# *Arguments:
\# <none> | <anything>
\# *Function:
\# Indents quoted text in fill mode and shortens line length
-\# accordingly, or turns BLOCKQUOTE off.
+\# equivalently, or turns BLOCKQUOTE off.
\# *Notes:
\# Owing to the need to bottom align TYPESET pages, quoted text gets
\# diverted so its depth can be measured (in DO_QUOTE) for determining
@@ -7543,8 +9544,17 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
.MAC BLOCKQUOTE END
. br
+. if \\n[#LINENUMBERS]=1 \{\
+. nr #LINENUMBERS 2
+. nr #NEXT_LN \\n(ln
+. nm
+. \}
. ie '\\$1'' \{\
. ev BLOCKQUOTE
+. if \\n[#LINENUMBERS]=2 \{\
+. if \\n[#SILENT_BQUOTE_LN]=1 \{ .nm \\n[#NEXT_LN] 1000 -4 \}
+. \}
+. nr #IN_DIVER 1
. nr #QUOTE 2
. nr #PP_STYLE 2
. nr #Q_PP 0
@@ -7573,10 +9583,8 @@ y\\R'#DESCENDER \\n[.cdp]'
. ta \\n(.lu
. \}
. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
-. vs \\n[#DOC_LEAD]u
+. TYPEWRITER
+. vs \\n[#DOC_LEAD]u
. QUAD LEFT
. HY OFF
. \}
@@ -7584,12 +9592,38 @@ y\\R'#DESCENDER \\n[.cdp]'
. FAMILY \\*[$BQUOTE_FAM]
. FT \\*[$BQUOTE_FT]
. PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
-. LS \\n[#DOC_LEAD]u
+. ie !\\n[#BQ_AUTOLEAD] \{ .LS \\n[#BQ_LEAD]u \}
+. el \{\
+. AUTOLEAD \\n[#BQ_AUTOLEAD]
+. nr #BQ_LEAD \\n(.v
+. \}
. if \\n[#ENDNOTE] \{\
. PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
+. ie !r#EN_BQ_AUTOLEAD \{ .LS \\n[#EN_BQ_LEAD]u \}
+. el \{\
+. AUTOLEAD \\n[#EN_BQ_AUTOLEAD]
+. nr #EN_BQ_LEAD \\n(.v
+. \}
+. \}
+. nr #Q_LEAD_REAL \\n(.v
+. if \\n[#BQUOTE_COLOR]=1 \{\
+. nf
+\m[\\*[$BQUOTE_COLOR]]
+. EOL
+. \}
+. QUAD \\*[$BQUOTE_QUAD]
+. nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
+. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
+. hy 14
+. \}
+. if \\n[#LINENUMBERS]=2 \{\
+. ie \\n[#BQUOTE_LN]=1 \{\
+. if '\\*[$BQ_LN_GUTTER]'' .ds $BQ_LN_GUTTER \\*[$LN_GUTTER]
+. nm \\n(ln "" \\*[$BQ_LN_GUTTER] -3-\\*[$BQ_LN_GUTTER]
+. \}
+. el \{\
+. if !\\n[#SILENT_BQUOTE_LN] \{ .NUMBER_LINES OFF \}
. \}
-. QUAD \\*[$BQUOTE_QUAD]
-. HY
. \}
. nr #Q_TOP \\n(nl
. if \\n[#INDENT_FIRST_PARAS] \{\
@@ -7615,7 +9649,7 @@ y\\R'#DESCENDER \\n[.cdp]'
\# <none>
\# *Function:
\# Ends the diversion P_QUOTE or B_QUOTE. Spaces them according to
-\# PRINT_STYLE, whether there's inter-paragraph spacing, and page
+\# PRINTSTYLE, whether there's inter-paragraph spacing, and page
\# position. TYPEWRITE treats spacing the same way in all circumstance
\# (viz. an extra line space). TYPESET puts in only half
\# line spaces if the entire quote plus 1 line of body under the quote
@@ -7623,15 +9657,39 @@ y\\R'#DESCENDER \\n[.cdp]'
\# line. (This is to ensure the page remains bottom aligned).
\#
.MAC DO_QUOTE END
+. br
+. if \\n[#DIVER_LN_OFF] \{\
+\!. NUMBER_LINES OFF
+. rr #DIVER_LN_OFF
+. \}
. di
+. rr #IN_DIVER
+. if \\n[#RESET_FN_COUNTERS]=2 \{\
+. if !\\n[#FN_COUNT]=1 \{\
+. if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
+. DIVER_FN_2_POST
+. rr #RESET_FN_COUNTERS
+. \}
+. \}
+. \}
+. nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
+. nr #DONE_ONCE 0 1
. REMOVE_INDENT
. ev
-\# **Change *1 to *2 in next line to prevent orphans after quotes
+. nr #Q_DEPTH (\\n[#DIVER_DEPTH]-\\n[#Q_LEAD_REAL])+\\n[#LEAD]
+. nr #Q_LEAD_DIFF \\n[#LEAD]-\\n[#Q_LEAD_REAL]
+. SILENT
+. br
+. nf
+. nr #CURRENT_V_POS \\n(nl+\\n[#Q_LEAD_DIFF]+(\\n[#DIVER_DEPTH]-\\n[#Q_DEPTH_REAL])
+. SHIM
+. SILENT OFF
+. nr #Q_SPACE_ADJ \\n[#SHIM]/2
+. nr #TRAP \\n(.t-1
. if \\n[#ENDNOTE] \{\
. nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
. ALWAYS_FULLSPACE_QUOTES
. \}
-. nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#START]=1 \{ . \}
. if \\n[#START]=0 \{\
@@ -7650,32 +9708,16 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. el \{\
-. ie \\n[#Q_DEPTH]<\\n[#TRAP_DISTANCE] \{\
-. nr #Q_FITS 1
-. ie \\n[#HEAD]=1 \{ . \}
+. ie \\n[#Q_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
+. ie (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_DEPTH]<\\n[#DOC_LEAD] \{\
+. Q_NOFIT
+. \}
. el \{\
-. ie \\n[#START] \{ . \}
-. el \{\
-. ie \\n[#FULLSPACE_QUOTES] \{\
-. ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
-. el \{ .ALD \\n[#DOC_LEAD]u \}
-. \}
-. el \{\
-. ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u/2u \}
-. el \{ .ALD \\n[#DOC_LEAD]u/2u \}
-. \}
-. \}
+. Q_FITS
. \}
. \}
. el \{\
-. rr #Q_FITS
-. ie r#HEAD \{\
-. if \\n[#HEAD]=1 \{ . \}
-. \}
-. el \{\
-. ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
-. el \{ .ALD \\n[#DOC_LEAD]u \}
-. \}
+. Q_NOFIT
. \}
. \}
. \}
@@ -7687,6 +9729,13 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#ENDNOTE] \{\
. in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
. \}
+. ie \\n[#START]=1 \{\
+. ie !\\n[#Q_LEAD_DIFF]<0 \{ .ALD \\n[#Q_SPACE_ADJ]u \}
+. el \{ .RLD 0-\\n[#Q_LEAD_DIFF]u \}
+. \}
+. el \{\
+. ALD \\n[#Q_SPACE_ADJ]u
+. \}
. if \\n[#QUOTE]=1 \{\
. nf
. P_QUOTE
@@ -7701,32 +9750,57 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. ie \\n[#START] \{\
-. ie \\n[#PP_SPACE] \{ . \}
-. el \{ .ALD \\n[#DOC_LEAD]u \}
+. ie \\n[#PP_SPACE] \{\
+.
+. \}
+. el \{\
+. ALD \\n[#DOC_LEAD]u
+. SHIM
+. \}
. \}
. el \{\
. ie \\n[#PP_SPACE] \{ . \}
. el \{\
-. ie \\n[#HEAD]=1 \{ .ALD \\n[#DOC_LEAD]u \}
+. ie \\n[#HEAD]=1 \{\
+. ALD \\n[#DOC_LEAD]u
+. SHIM
+. \}
. el \{\
+. ie \\n[#FULLSPACE_QUOTES] \{\
+. ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
+. el \{ .ALD \\n[#DOC_LEAD]u \}
+. \}
+. el \{ .ALD (\\n[#DOC_LEAD]u/2u) \}
. ie \\n[#Q_FITS] \{\
-. ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
-. nr #Q_AT_TOP 1
-. ALD \\n[#DOC_LEAD]u
-. \}
-. el \{\
-. ie \\n[#FULLSPACE_QUOTES] \{ .ALD \\n[#DOC_LEAD]u \}
-. el \{ .ALD \\n[#DOC_LEAD]u/2u \}
-. \}
+. ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
+. nr #Q_AT_TOP 1
+. nr #DELAY_SHIM 1
+. \}
+. el \{ .SHIM \}
+. \}
+. el \{\
+. SHIM
+.\" Make sure that Q_LEAD_DIFF is not added to the first line of
+.\" normal text at the top of any page following output of a quote
+.\" whose last line falls on B_MARGIN of the previous page.
+. if \\n(nl=(\\n[#T_MARGIN]-\\n[#DOC_LEAD]+\\n[#Q_LEAD_DIFF]) \{\
+. PRINT \&
+. br
+. sp -1v-\\n[#Q_LEAD_DIFF]u
+. \}
. \}
-. el \{ .ALD \\n[#DOC_LEAD]u \}
. \}
. \}
. \}
. \}
+. if \\n[#LINENUMBERS]=2 \{\
+. nr #LINENUMBERS 1
+. ie \\n[#RESTORE_LN_NUM]=1 \{ .nm \\n[#NEXT_LN] \}
+. el \{ .nm +0 \}
+. \}
. if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
-. if r#HEAD \{ .rr #HEAD \}
-. if r#EPIGRAPH \{ .rr #EPIGRAPH \}
+. if r#HEAD \{ .rr #HEAD \}
+. if r#EPIGRAPH \{ .rr #EPIGRAPH \}
. rr #Q_PP
. rr #LINEBREAK
. nr #PP_STYLE 1
@@ -7736,7 +9810,10 @@ y\\R'#DESCENDER \\n[.cdp]'
. in \\n[#EN_TEXT_INDENT]u
. \}
. if \\n[#COLUMNS] \{\
-. if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
+. if !\\n[#ENDNOTE] \{\
+. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
+. \}
. if \\n[#ENDNOTE] \{\
. in \\n[#EN_TEXT_INDENT]u
. \}
@@ -7755,6 +9832,88 @@ y\\R'#DESCENDER \\n[.cdp]'
. ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
. QUAD \\*[EN_QUAD]
. \}
+. if r#DELAY_SHIM \{\
+. SHIM
+. rr #DELAY_SHIM
+. \}
+.END
+\#
+\#
+\# Utility macros for DO_QUOTE
+\# ---------------------------
+\#
+.MAC Q_FITS END
+. nr #Q_FITS 1
+. ie \\n[#HEAD]=1 \{\
+. ALD \\n[#Q_LEAD_DIFF]u
+. \}
+. el \{\
+. ie \\n[#START] \{ . \}
+. el \{\
+. ie \\n[#FULLSPACE_QUOTES] \{\
+. ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
+. el \{ .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
+. \}
+. el \{\
+.\" This seems to be the only way to get the baseline of quotes that start
+.\" at the top of the page to fall on the first line of the "grid" (i.e on
+.\" the first legal baseline of the page).
+. ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
+. if \\n[#QUOTE]=1 \{\
+. rn P_QUOTE Q_TEMP
+. di P_QUOTE
+. vs \\n[#Q_LEAD]u
+. PRINT \&
+. sp -1v+\\n[#Q_LEAD_DIFF]u
+. Q_TEMP
+. di
+. \}
+. if \\n[#QUOTE]=2 \{\
+. rn B_QUOTE Q_TEMP
+. di B_QUOTE
+. vs \\n[#BQ_LEAD]u
+. PRINT \&
+. sp -1v+\\n[#Q_LEAD_DIFF]u
+. Q_TEMP
+. di
+. \}
+. rm Q_TEMP
+. \}
+. el \{\
+. ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_LEAD_DIFF]u
+. \}
+. \}
+. \}
+. if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
+. \}
+.END
+\#
+.MAC Q_NOFIT END
+. rr #Q_FITS
+. ie r#HEAD \{\
+. if \\n[#HEAD]=1 \{ . \}
+. \}
+. el \{\
+. ie \\n[#FULLSPACE_QUOTES] \{\
+. ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
+. el \{ .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
+. \}
+. el \{ .ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_LEAD_DIFF]u \}
+. nr #Q_PARTIAL_DEPTH 0 \\n[#Q_LEAD_REAL]
+. while \\n+[#Q_PARTIAL_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
+.
+.\}
+. nr #Q_PARTIAL_DEPTH -\\n[#Q_LEAD_REAL]
+. nr #Q_SPACE_ADJ (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_PARTIAL_DEPTH]+\\n[#Q_LEAD_DIFF]u
+.\" Hack to deal with the fact that even though the above routine
+.\" makes the bottom line of the quote fall exactly on the bottom
+.\" margin when traps are disabled, it refuses to do so when traps
+.\" are on. The difference by which it's off is #Q_LEAD_DIFF
+.\" (the +\\n[#Q_LEAD_DIFF] at the end of the line, above). Hack
+.\" solution: temporarily lower the FOOTER trap position.
+. nr #SAVED_FOOTER_POS \\n[#VARIABLE_FOOTER_POS]
+. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+.25v
+. \}
.END
\#
\# ====================================================================
@@ -7780,7 +9939,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #BROKEN_QUOTE 1
. REMOVE_INDENT
. ev
-. nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
+. nr #Q_DEPTH \\n[#DIVER_DEPTH]+\\n[#LEAD]
. if \\n[#PRINT_STYLE]=1 \{\
. if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
. if \\n[#HEAD] \{\
@@ -7808,7 +9967,6 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#QUOTE]=1 \{\
. nf
. P_QUOTE
-. if !\\n[#START] \{ .rr #QUOTE \}
. \}
. if \\n[#QUOTE]=2 \{\
. nf
@@ -7826,7 +9984,10 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. po \\n[#L_MARGIN]u
-. if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
+. if \\n[#COLUMNS] \{\
+. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
+. nr #L_MARGIN \\n(.o
+. \}
. QUAD \\*[$DOC_QUAD]
. sp |\\n[#PAGE_LENGTH]u \" To trip footer/header
. BLOCKQUOTE
@@ -7841,9 +10002,8 @@ y\\R'#DESCENDER \\n[.cdp]'
\# *Arguments:
\# <none> | <anything>
\# *Function:
-\# Turns page numbering off or on.
+\# Turns page numbering off or on during document processing.
\# *Notes:
-\# Page numbering is on by default with .PAPER.
\# Default is on.
\#
.MAC PAGINATE END
@@ -7852,48 +10012,33 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
-\# PAGENUMBER FAMILY
-\# -----------------
+\# SUSPEND PAGINATION (before ENDNOTES)
+\# ------------------
\# *Argument:
-\# <family to use for page numbers>
-\# *Function:
-\# Creates or modifies string $PAGE_NUM_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC PAGENUM_FAMILY END
-. ds $PAGE_NUM_FAM \\$1
-.END
-\#
-\#
-\# PAGE NUMBER FONT
-\# ----------------
-\# *Arguments:
-\# <font to use for page numbers>
+\# <none>
\# *Function:
-\# Creates or modifies string $PAGE_NUM_FT.
+\# Creates register #SUSPEND_PAGINATION
\# *Notes:
-\# Default is same as running text.
+\# Useful only to suspend pagination before outputting endnotes.
\#
-.MAC PAGENUM_FONT END
-. ds $PAGE_NUM_FT \\$1
+.MAC SUSPEND_PAGINATION END
+. nr #SUSPEND_PAGINATION 1
.END
\#
-\#
-\# PAGE NUMBER SIZE
-\# ----------------
+\# RESTORE PAGINATION (after ENDNOTES)
+\# ------------------
\# *Argument:
-\# <+|- number of points by which to in/decrease point size of
-\# page numbers (relative to running text)>
+\# <none>
\# *Function:
-\# Creates or modifies string $PAGE_NUM_SIZE_CHANGE.
+\# Removes register #SUSPEND_PAGINATION. Creates register
+\# #DEFER_PAGINATION
\# *Notes:
-\# Must be preceded by a +|- sign with no space afterward.
-\# Fractional point sizes are allowed.
-\# Default is +0.
+\# Useful only to restore pagination after outputting endnotes.
\#
-.MAC PAGENUM_SIZE END
-. ds $PAGE_NUM_SIZE_CHANGE \\$1
+.MAC RESTORE_PAGINATION END
+. rr #SUSPEND_PAGINATION
+. if \\n[#PAGE_NUM_V_POS]=1 \{ .PAGINATE \}
+. if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #DEFER_PAGINATION 1 \}
.END
\#
\#
@@ -7967,15 +10112,25 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
+.MAC PN_WITH_HYPHENS END
+. nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
+. ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
+. PRINT \m[\\*[$PAGENUM_COLOR]]\\*[$HYPHEN]\|\\n[#PAGENUMBER]\|\\*[$HYPHEN]
+.br
+.END
+\#
+\#
\# PRINT PAGE NUMBER
\# -----------------
\# *Arguments:
\# <none>
\# *Function:
-\# Prints page number if PAGEINATE=1.
+\# Prints page number if PAGINATE=1.
\#
.MAC PRINT_PAGE_NUMBER END
. ev PAGENUMBER
+. nf
+. na
. po \\n[#DOC_L_MARGIN]u
. ll \\n[#DOC_L_LENGTH]u
. ta \\n(.lu
@@ -7983,9 +10138,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. FT \\*[$PAGE_NUM_FT]
. PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
. \}
. if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
. if o \{\
@@ -7993,23 +10146,69 @@ y\\R'#DESCENDER \\n[.cdp]'
. el \{ .RIGHT \}
. \}
. if e \{\
-. ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
-. el \{ .LEFT \}
+. ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
+. el \{ .LEFT \}
. \}
-. if \\n[#PAGE_NUM_H_POS]=2 \{.CENTER \}
+. if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
. if \\n[#RECTO_VERSO]=0 \{\
. if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
. if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
. if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT \}
. \}
. nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
+. if \\n[#EN_FIRST_PAGE] \{\
+. if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
+. rr #EN_FIRST_PAGE
+. \}
+. if \\n[#BIB_FIRST_PAGE] \{\
+. if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN] \}
+. rr #BIB_FIRST_PAGE
+. \}
+. if \\n[#TOC_FIRST_PAGE] \{\
+. PAGENUMBER 1
+. rr #TOC_FIRST_PAGE
+. \}
. ie \\n[#DRAFT_WITH_PAGENUM] \{\
-. ie !\\n[#REVISION] \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT] / \\n[#PAGENUMBER]" \}
-. el \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT], \\*[$REVISION_STRING] \\n[#REVISION] / \\n[#PAGENUMBER]" \}
+. ie '\\*[$REVISION]'' \{\
+. PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT] / \\n[#PAGENUMBER]"
+. \}
+. el \{\
+. ie '\\*[$DRAFT]'' \{\
+. PRINT "\\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
+. \}
+. el \{\
+. PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT], \\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
+. \}
+. \}
. \}
. el \{\
-. ie \\n[#PAGE_NUM_HYPHENS] \{ .PRINT "- \\n[#PAGENUMBER] -" \}
-. el \{ .PRINT "\\n[#PAGENUMBER]" \}
+. ie \\n[#PAGE_NUM_HYPHENS] \{\
+. if '\\*[$PAGENUM_STYLE]'DIGIT' \{\
+. di NULL
+1\\R'#CAP_HEIGHT \\n[.cht]'
+. di
+. PN_WITH_HYPHENS
+. \}
+. if '\\*[$PAGENUM_STYLE]'ROMAN' \{\
+. di NULL
+I\\R'#CAP_HEIGHT \\n[.cht]'
+. di
+. PN_WITH_HYPHENS
+. \}
+. if '\\*[$PAGENUM_STYLE]'ALPHA' \{\
+. di NULL
+E\\R'#CAP_HEIGHT \\n[.cht]'
+. di
+. PN_WITH_HYPHENS
+. \}
+. if '\\*[$PAGENUM_STYLE]'roman' \{\
+. PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
+. \}
+. if '\\*[$PAGENUM_STYLE]'alpha' \{\
+. PRINT "\m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-"
+. \}
+. \}
+. el \{ .PRINT "\m[\\*[$PAGENUM_COLOR]]\\n[#PAGENUMBER]" \}
. \}
. ev
.END
@@ -8018,50 +10217,14 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\# +++FOOTNOTES+++
\#
-\# FOOTNOTE FAMILY
-\# --------------
-\# *Argument:
-\# <family to use in footnotes>
-\# *Function:
-\# Creates or modifies string $FN_FAM.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC FOOTNOTE_FAMILY END
-. ds $FN_FAM \\$1
-.END
-\#
-\#
-\# FOOTNOTE FONT
-\# --------------
-\# *Argument:
-\# <font to use in footnotes>
-\# *Function:
-\# Creates or modifies string $FN_FT.
-\# *Notes:
-\# Default is roman.
-\#
-.MAC FOOTNOTE_FONT END
-. ds $FN_FT \\$1
-.END
-\#
-\#
-\# FOOTNOTE SIZE
-\# ------------
-\# *Argument:
-\# <+|- number of points by which to in/decrease point size of footnotes
-\# (relative to running text)>
-\# *Function:
-\# Creates or modifies string $FN_SIZE_CHANGE.
-\# *Notes:
-\# Must be preceded by a +|- sign. No space afterwards.
-\# Fractional point sizes are allowed.
-\# Default is -2 for printstyle TYPESET; +0 for TYPEWRITE.
-\#
-.MAC FOOTNOTE_SIZE END
-. ds $FN_SIZE_CHANGE \\$1
-.END
-\#
+.ig
+Mom's footnote handling is baroque, to say the least. There are
+redundancies in a number of the macros involved, as well as some
+registers that probably don't get used anymore. The baggage is left
+in in case some new footnote oddity/challenge gets thrown my way.
+
+The macros are heavily commented.
+..
\#
\# FOOTNOTE AUTOLEAD
\# -----------------
@@ -8077,20 +10240,6 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
-\# FOOTNOTE QUAD
-\# -------------
-\# *Arguments:
-\# <quad to use in footnotes>
-\# *Function:
-\# Creates or modifies string $FN_QUAD.
-\# *Notes:
-\# Default is same as running text.
-\#
-.MAC FOOTNOTE_QUAD END
-. ds $FN_QUAD \\$1
-.END
-\#
-\#
\# FOOTNOTE MARKERS
\# ----------------
\# *Arguments:
@@ -8109,23 +10258,129 @@ y\\R'#DESCENDER \\n[.cdp]'
\# FOOTNOTE MARKER STYLE
\# ---------------------
\# *Arguments:
-\# STAR | NUMBER
+\# STAR | NUMBER | LINE
\# *Function:
\# Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
\# the style of footnote markers.
\# *Notes:
-\# 1=STAR; 2=NUMBER. Default is STAR.
+\# 1=STAR; 2=NUMBER; 3=LINE. LINE means "use output line numbers".
+\# Default is STAR.
\#
.MAC FOOTNOTE_MARKER_STYLE END
. if '\\$1'STAR' \{\
+. if \\n[#FN_MARKER_STYLE]=3 \{\
+. if !\\n[#NEWPAGE]=1 \{\
+. tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is LINE.
+. tm1 " You cannot change footnote marker style without
+. tm1 " first breaking to a new page with NEWPAGE.
+. tm1 " Ignoring request FOOTNOTE_MARKER_STYLE STAR at line \\n(.c.
+. return
+. \}
+. \}
+. if \\n[#RUN_ON]=1 \{\
+. tm1 "[mom]: FOOTNOTE_MARKER_STYLE STAR at line \\n(.c is incompatible
+. tm1 " with RUN_ON footnotes. Ignoring request.
+. return
+. \}
. nr #FN_MARKER_STYLE 1
+. if \\n[#NEWPAGE]=1 \{ .rr #NEWPAGE \}
+. FOOTNOTE_MARKERS
. \}
. if '\\$1'NUMBER' \{\
+. if \\n[#FN_MARKER_STYLE]=3 \{\
+. if !\\n[#NEWPAGE]=1 \{\
+. tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is NUMBER.
+. tm1 " You cannot change footnote marker style without
+. tm1 " first breaking to a new page with NEWPAGE.
+. tm1 " Ignoring request FOOTNOTE_MARKER_STYLE NUMBER at line \\n(.c.
+. return
+. \}
+. \}
+. if \\n[#RUN_ON]=1 \{\
+. tm1 "[mom]: FOOTNOTE_MARKER_STYLE NUMBER at line \\n(.c is incompatible
+. tm1 " with RUN_ON footnotes. Ignoring request.
+. return
+. \}
. nr #FN_MARKER_STYLE 2
+. if \\n[#NEWPAGE]=1 \{ .rr #NEWPAGE \}
+. FOOTNOTE_MARKERS
+. \}
+. if '\\$1'LINE' \{\
+. nr #FN_MARKER_STYLE 3
+. FOOTNOTE_MARKERS OFF
+. if !\\n[#FN_LN_SEP] \{\
+. if !\\n[#FN_LN_BRACKETS] \{ .FOOTNOTE_LINENUMBER_BRACKETS SQUARE \}
+. \}
. \}
.END
\#
\#
+\# FOOTNOTE LINENUMBER MARK
+\# ------------------------
+\# *Function:
+\# This string, when called inline, stores the current output line
+\# number in register #FN_MARK for use with FOOTNOTE.
+\#
+.ds FN-MARK \R'#FN_MARK \En(ln'
+\#
+\#
+\# FOOTNOTE LINENUMBER SEPARATOR
+\# -----------------------------
+\# *Argument:
+\# <user-defined separator>
+\# *Function:
+\# Stores user-defined separator (for use then
+\# FOOTNOTE_MARKER_STYLE is LINE) in string $FN_LN_SEP. The
+\# separator is intended to be used when the user wishes a
+\# separator, rather than the choice of brackets offered by
+\# FOOTNOTE_LINENUMBER_BRACKETS.
+\#
+.MAC FOOTNOTE_LINENUMBER_SEPARATOR END
+. rr #FN_LN_BRACKETS
+. nr #FN_LN_SEP 1
+. ds $FN_LN_SEP "\\$1
+.END
+\#
+\#
+\# FOOTNOTE LINENUMBER BRACKETS
+\# ----------------------------
+\# *Argument:
+\# PARENS | SQUARE | BRACES or ( | [ | {
+\# *Function:
+\# Sets register #FN_LN_BRACKETS to 1, and creates strings
+\# $FN_OPEN_BRACKET and $FN_CLOSE_BRACKET according to the given
+\# argument.
+\#
+.MAC FOOTNOTE_LINENUMBER_BRACKETS END
+. rr #FN_LN_SEP
+. nr #FN_LN_BRACKETS 1
+. if '\\$1'PARENS' \{\
+. ds $FN_OPEN_BRACKET (
+. ds $FN_CLOSE_BRACKET )
+. \}
+. if '\\$1'(' \{\
+. ds $FN_OPEN_BRACKET (
+. ds $FN_CLOSE_BRACKET )
+. \}
+. if '\\$1'SQUARE' \{\
+. ds $FN_OPEN_BRACKET [
+. ds $FN_CLOSE_BRACKET ]
+. \}
+. if '\\$1'[' \{\
+. ds $FN_OPEN_BRACKET [
+. ds $FN_CLOSE_BRACKET ]
+. \}
+. if '\\$1'BRACES' \{\
+. ds $FN_OPEN_BRACKET {
+. ds $FN_CLOSE_BRACKET }
+. \}
+. if '\\$1'{' \{\
+. ds $FN_OPEN_BRACKET {
+. ds $FN_CLOSE_BRACKET }
+. \}
+.END
+\#
+\#
\# RESET FOOTNOTE NUMBER
\# ---------------------
\# *Arguments:
@@ -8188,10 +10443,10 @@ y\\R'#DESCENDER \\n[.cdp]'
.MAC FOOTNOTE_RULE END
. ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
. if \\n[#FN_RULE]=0 \{ .RLD 1v \}
-\!. PT_SIZE 12 \"Not sure why these have to be transparently embedded, but they do.
+\!. PT_SIZE 12
. RLD 1v
. LEFT
-. PRINT \\v'-\\n[#FN_RULE_ADJ]u'\\l'\\n[#FN_RULE_LENGTH]u'\\v'+\\n[#FN_RULE_ADJ]u'
+. PRINT \v'-\\n[#FN_RULE_ADJ]u'\l'\\n[#FN_RULE_LENGTH]u'\v'+\\n[#FN_RULE_ADJ]u'
\!. PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
. QUAD \\*[$FN_QUAD]
. \}
@@ -8202,10 +10457,76 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
+\# FOOTNOTE SPACING
+\# ----------------
+\# *Arguments:
+\# <per item post footnote spacing> | <anything>
+\# *Function:
+\# Enables printing of post footnote spacing.
+\# *Notes:
+\# Default is no space.
+\#
+.MAC FOOTNOTE_SPACING END
+. ie \B'\\$1' \{ .nr #FN_SPACE (\\$1) \}
+. el \{ .nr #FN_SPACE 0 \}
+.END
+\#
+\#
+\# RUN ON FOOTNOTES
+\# ----------------
+\# *Arguments:
+\# <none> | <anything>
+\# *Function:
+\# Toggles run-on footnotes on or off.
+\#
+.MAC FOOTNOTES_RUN_ON END
+. ie '\\$1'' \{\
+. if \\n[#FN_COUNT]>0 \{\
+. tm1 "[mom]: Switching to run-on footnotes at line \\n(.c will cause
+. tm1 " you to loose footnotes already formatted for this page.
+. tm1 " Ignoring request FOOTNOTES_RUN_ON.
+. rr #RUN_ON
+. return
+. \}
+. nr #RUN_ON 1
+. if \\n[#FN_MARKER_STYLE]=1 \{ .RUNON_WARNING \}
+. if \\n[#FN_MARKER_STYLE]=2 \{ .RUNON_WARNING \}
+. \}
+. el \{\
+. if \\n[#FN_COUNT]>0 \{\
+. if \\n[#RUN_ON]=1 \{\
+. tm1 "[mom]: Switching off run-on footnotes at line \\n(.c will cause
+. tm1 " you to loose footnotes already formatted for this page.
+. tm1 " Ignoring request FOOTNOTES_RUN_ON \\$1.
+. return
+. \}
+. \}
+. rr #RUN_ON
+. \}
+.END
+\#
+\#
+.MAC RUNON_WARNING END
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. tm1 "[mom]: The footnote marker style active at line \\n(.c is STAR,
+. tm1 " which is incompatible with run-on footnotes. Please change
+. tm1 " the footnote marker style to LINE. Continuing to process,
+. tm1 " but ignoring request FOOTNOTES_RUN_ON.
+. rr #RUN_ON
+. \}
+. if \\n[#FN_MARKER_STYLE]=2 \{\
+. tm1 "[mom]: The footnote marker style active at line \\n(.c is NUMBER,
+. tm1 " which is incompatible with run-on footnotes. Please change
+. tm1 " the footnote marker style to LINE. Continuing to process,
+. tm1 " but ignoring request FOOTNOTES_RUN_ON.
+. rr #RUN_ON
+. \}
+.END
+\#
\# FOOTNOTE
\# --------
\# *Arguments:
-\# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value> > | <anything>
+\# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value> | <anything>
\# *Function:
\# Begins collecting and diverting footnote text if no argument
\# given. Otherwise, ends diversion FOOTNOTES, measures footnote
@@ -8215,14 +10536,125 @@ y\\R'#DESCENDER \\n[.cdp]'
\# or the footnote marker will be spaced away from the word it
\# should be joined to.
\#
-\# If FOOTNOTES is invoked with INDENT, the footnote will
+\# If FOOTNOTE is invoked with INDENT, the footnote will
\# be indented. An indent style and an indent value must be given.
\# Subsequent footnotes will NOT be indented; INDENT must be given
\# for each footnote the user wants indented.
\#
.MAC FOOTNOTE END
+. if !\\n(.u \{ .nr #ADD_BREAK 1 \}
. ie '\\$1'' \{\
+. if \\n[#FN_MARKER_STYLE]=3 \{\
+. if !\\n[#LINENUMBERS] \{\
+. tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
+. tm1 " FOOTNOTE_MARKER_STYLE is LINE.
+. ab Aborting on FOOTNOTE at line \\n(.c.
+. \}
+. if \\n[#FN_MARK]=0 \{ .nr #FN_MARK \\n(ln \}
+. nr #FN_MARK_2 \\n(ln
+. if '\\n(.z'P_QUOTE' \{\
+. nr #FN_MARK -1
+. nr #FN_MARK_2 -1
+. \}
+. if \\n[#IN_DIVER]=1 \{\
+. if '\\n(.z'P_QUOTE' \{\
+. if !\\n[#QUOTE_LN]=1 \{\
+. if !\\n[#SILENT_QUOTE_LN]=1 \{\
+. tm1 "[mom]: You have requested a line-numbered footnote inside a
+. tm1 " QUOTE at line \\n(.c, but line-numbering has not been enabled
+. tm1 " for QUOTES. Printing footnote with label "0".
+. rr #FN_MARK
+. rr #FN_MARK_2
+. \}
+. \}
+. \}
+. if '\\n(.z'B_QUOTE' \{\
+. if !\\n[#BQUOTE_LN]=1 \{\
+. if !\\n[#SILENT_BQUOTE_LN]=1 \{\
+. tm1 "[mom]: You have requested a line-numbered footnote inside a
+. tm1 " BLOCKQUOTE at line \\n(.c, but line-numbering has not been enabled
+. tm1 " for BLOCKQUOTES. Printing footnote with label "0".
+. rr #FN_MARK
+. rr #FN_MARK_2
+. \}
+. \}
+. \}
+. \}
+. \}
+.\" Begin processing footnotes that occur inside QUOTE, BLOCKQUOTE
+.\" or EPIGRAPH.
+. if \\n[#IN_DIVER]=1 \{\
+. nr #PAGE_POS \\n(nl+\\n(.d+\\n[#DOC_LEAD]
+. nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS]-1)
+. nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
+.\" Are we on a "defer" line? If so, defer the text of the footnote.
+. ie \\n[#SPACE_TO_FOOTER]=\\n[#DOC_LEAD]:\\n[#SPACE_TO_FOOTER]=0 \{\
+. nr #DIVER_FN 2 \" treat like a normal deferred footnote
+. \}
+. el \{\
+. nr #DIVER_FN 2 \" treat like a normal footnote
+. \}
+. if \\n[#PAGE_POS]>\\n[#FOOTER_POS] \{\
+. nr #DIVER_FN 1 \" move this footnote
+. \}
+.\" Test for situation where, because a final line of QUOTE, BLOCKQUOTE
+.\" or EPIGRAPH isn't yet adjusted at this point, the last word on the
+.\" line may *seem* to belong to the final line of the page, but will,
+.\" in fact, become the first word of the subsequent page. In such
+.\" circumstances, we want the the footnote to be treated as a "moved"
+.\" diversion footnote.
+. if \\n(.k>\\n(.l \{ .nr #DIVER_FN 1 \}
+. if r#DIVER_FN \{\
+. if !\\n[#DIVER_FN]=2 \{ .\\n+[#DONE_ONCE] \}
+.\" A footnote inside a diversion will become the 1st footnote on the
+.\" following page/column.
+. if \\n[#DIVER_FN]=1 \{ .DIVER_FN_1_PRE \}
+.\" A footnote inside a diversion that should be treated like a
+.\" normal footnote (including defers.)
+. if \\n[#DIVER_FN]=2 \{ .DIVER_FN_2_PRE \}
+. \}
+. nr #SAVED_FN_COUNT \\n[#FN_COUNT]+1
+. nr #SAVED_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]+1
+. \}
+.\" End processing footnotes that occur inside QUOTE, BLOCKQUOTE or
+.\" EPIGRAPH.
+.\"
+.\" Test for situation where, because a final line of running text
+.\" isn't yet adjusted at this point, the last word on the line may
+.\" *seem* to belong to the final line of the page, but will, in
+.\" fact, become the first word of the subsequent page. In such
+.\" circumstances, we want the the footnote marker in running text to
+.\" be the correct one for the 1st footnote on the page.
+. if \\n(.k>\\n(.l \{\
+. if (\\n(nl+\\n[#DOC_LEAD])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. nr #FN_COUNT_FOR_COLS 0 1
+. \}
+. if \\n[#FN_MARKER_STYLE]=2 \{\
+. if \\n[#RESET_FN_NUMBER] \{\
+. nr #FN_NUMBER 0 1
+. nr #NOT_YET_ADJUSTED 1
+. \}
+. \}
+. \}
+. \}
+. el \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. nr #FN_COUNT 0 1
+. \}
+. if \\n[#FN_MARKER_STYLE]=2 \{\
+. if \\n[#RESET_FN_NUMBER] \{\
+. nr #FN_NUMBER 0 1
+. nr #NOT_YET_ADJUSTED 1
+. \}
+. \}
+. \}
+. \}
+. \}
. if \\n[#FN_MARKERS] \{\
+.\" Housekeeping
. if \\n[#CONDENSE] \{ \*[CONDX]\c \}
. if \\n[#EXTEND] \{ \*[EXTX]\c \}
. if \\n[#PRINT_STYLE]=1 \{\
@@ -8231,48 +10663,75 @@ y\\R'#DESCENDER \\n[.cdp]'
. UNDERLINE OFF
. \}
. \}
+.\" Add footnote markers to running text...
. if !\\n[#NO_FN_MARKER] \{\
-. if \\n[#FN_MARKER_STYLE]=1 \{\
-. ie \\n[#FN_COUNT_FOR_COLS] \{\
-. if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU3]* \}
-. if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU3]\(dg \}
-. if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \*[BU3]** \}
-. if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
-. if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU3]*** \}
-. if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
-. if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU3]**** \}
-. if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
-. if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \*[BU3]***** \}
-. if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg \}
-. \}
-. el \{\
-. if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU3]* \}
-. if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU3]\(dg \}
-. if \\n[#FN_COUNT]=2 \{ .PRINT \*[BU3]** \}
-. if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
-. if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU3]*** \}
-. if \\n[#FN_COUNT]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
-. if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU3]**** \}
-. if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
-. if \\n[#FN_COUNT]=8 \{ .PRINT \*[BU3]***** \}
-. if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg\(dg \}
-. \}
-. \}
-. if \\n[#FN_MARKER_STYLE]=2 \{\
-. if \\n[#PRINT_STYLE]=1 \{ .PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#FN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2" \}
-. if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]" \}
-. \}
-. \}
-. \}
-. nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-(\\n(nl+1v)
+.\" ...but not if TERMINATE has not been called
+. if !r#TERMINATE \{\
+.\" Marker style star/dagger/double-dagger
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+.\" Columnar docs either move col to col, or last col to next page.
+.\" They require their own special FN_COUNT because regular FN_COUNT
+.\" is used to figure out things like whether or not to put a rule
+.\" above footnotes (in addition to keeping track of the footnote
+.\" count in non-columnar docs).
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU2]*\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU1]\(dg\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dd\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU2]**\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU1]\(dg\(dg\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dd\(dd\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU2]***\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dd\(dd\(dd\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU2]****\c \}
+. \}
+. el \{\
+. if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU2]*\c \}
+. if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU1]\(dg\c \}
+. if \\n[#FN_COUNT]=2 \{ .PRINT \(dd\c \}
+. if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU2]**\c \}
+. if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU1]\(dg\(dg\c \}
+. if \\n[#FN_COUNT]=5 \{ .PRINT \(dd\(dd\c \}
+. if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU2]***\c \}
+. if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg\c \}
+. if \\n[#FN_COUNT]=8 \{ .PRINT \(dd\(dd\(dd\c \}
+. if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU2]****\c \}
+. \}
+. \}
+.\" Marker style superscript numbers
+. if \\n[#FN_MARKER_STYLE]=2 \{\
+. if \\n[#PRINT_STYLE]=1 \{ .PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#FN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c" \}
+. if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]\c" \}
+. \}
+. \}
+. \}
+. \}
+.\" More housekeeping
+.\"
+.\" #SPACE_REMAINING is the space left between where we are
+.\" on the page and the bottom margin. It's used to determine whether
+.\" or not the footnote will overflow, and how many lines of
+.\" footnotes will fit on the page if some have to overflow.
+. ie \\n[#DIVER_FN]=2 \{\
+. nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-(\\n[#PAGE_POS])
+. \}
+. el \{\
+. nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n(nl
+. \}
+. if \\n[#FROM_DIVERT_FN]=1 \{\
+. nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]
+. rr #FROM_DIVERT_FN
+. \}
. nr #PP_STYLE_PREV \\n[#PP_STYLE]
. nr #PP_STYLE 2
. if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
. INDENT_FIRST_PARAS
+.\" Prepare FOOTNOTE to receive footnote text.
. ev FOOTNOTES
. ll \\n[#DOC_L_LENGTH]u
. ta \\n(.lu
-. if \\n[#COLUMNS] \{\
+. if \\n[#COLUMNS]=1 \{\
. ll \\n[#COL_L_LENGTH]u
. ta \\n(.lu
. \}
@@ -8290,64 +10749,193 @@ y\\R'#DESCENDER \\n[.cdp]'
. AUTOLEAD \\n[#FN_AUTOLEAD]
. QUAD \\*[$FN_QUAD]
. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
-. ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
-. el \{ .vs \\n[#DOC_LEAD]u/2u \}
+. TYPEWRITER
+. ie \\n[#SINGLE_SPACE] \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
+. el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
. QUAD LEFT
. HY OFF
. \}
. nr #FN_LEAD \\n[#LEAD]
-. da FOOTNOTES
+.\" Begin diversion FOOTNOTES or FN_IN_DIVER
+. ie r#COUNTERS_RESET \{\
+. ie \\n[#DONE_ONCE]=1 \{\
+. ie \\n[#RUN_ON] \{\
+. di RUNON_FN_IN_DIVER
+. nr #RUNON_FN_IN_DIVER 1
+. \}
+. el \{ .di FN_IN_DIVER \}
+. \}
+. el \{\
+. ie \\n[#RUN_ON] \{\
+. da RUNON_FN_IN_DIVER
+. nr #RUNON_FN_IN_DIVER 1
+. \}
+. el \{ .da FN_IN_DIVER \}
+. \}
+. \\n+[#DONE_ONCE]
+. \}
+. el \{\
+. ie \\n[#RUN_ON] \{\
+. da RUNON_FOOTNOTES
+. nr #RUNON_FOOTNOTES 1
+. \}
+. el \{ .da FOOTNOTES \}
+. \}
+. if \\n[#FOOTNOTE_COLOR]=1 \{\
+. TRAP OFF
+. nf
+\m[\\*[$FOOTNOTE_COLOR]]
+. EOL
+. fi
+. TRAP
+. \}
. if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
+.\" When a deferred footnote is also the 1st footnote on the page,
+.\" and when the page it's output on also has footnotes, some
+.\" whitespace is needed between the deferred footnote and the
+.\" first footnote belonging to the output page so that there's
+.\" no confusion when two stars (or two number 1s) appear in
+.\" footnotes...
. if \\n[#FN_DEFER_SPACE] \{\
-. if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
-. if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
+.\" ...but only add the extra space if TERMINATE has not been called
+. if !r#TERMINATE \{\
+.\" ...and not if defer space has already been added
+. if !\\n[#DEFER_SPACE_ADDED] \{\
+.\" ...and not if the footnote count the last time we checked for
+.\" a defer situation inside a diversion is greater than 1.
+. if !\\n[#SAVED_DIVER_FN_COUNT]>1 \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
+. if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
+. nr #DEFER_SPACE_ADDED 1
+. \}
+. \}
+. \}
. rr #FN_DEFER_SPACE
+. rr #SAVED_DIVER_FN_COUNT
. \}
+. if \\n[#DIVERTED]=3 \{\
+. if \\n[#FN_COUNT]>0 \{\
+\!. RLD 1v
+. \}
+. \}
+.\" Add footnote rule (or, if no rule, some whitespace).
+.\" N.B.- this line increments #FN_COUNT each and every time FOOTNOTE
+.\" is run.
. if \\n+[#FN_COUNT]=1 \{\
-. if !\\n[#FN_DEPTH] \{\
-. if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
-. ie \\n[#FN_RULE] \{ .PRINT_FOOTNOTE_RULE \}
-. el \{ .ALD 1v \}
+.\" If a footnote is called in a diversion, and the footnote has to
+.\" be moved, don't put in the rule now (it's taken care of when
+.\" FN_IN_DIVER is output into FOOTNOTE in PROCESS_FN_IN_DIVER).
+. if !\\n[#DONT_RULE_ME]=1 \{\
+. if !\\n[#FN_DEPTH] \{\
+. if \\n[#PRINT_STYLE]=1 \{\
+. if !\\n[#RUN_ON] \{ .ALD \\n[#DOC_LEAD]u \}
+. \}
+. ie \\n[#FN_RULE]=1 \{\
+. if !\\n[#RUN_ON] \{ .PRINT_FOOTNOTE_RULE \}
+. \}
+. el \{ .ALD 1v \}
+. nr #RULED 1
+. \}
. \}
. \}
-. if \\n[#FN_MARKERS] \{\
+. rr #DONT_RULE_ME
+.\" Add footnote markers to footnote text...
+. ie \\n[#FN_MARKERS] \{\
+. if \\n[#FN_SPACE]>0 \{\
+. if \\n[#FN_COUNT]>0 \{\
+. ALD \\n[#FN_SPACE]u
+. \}
+. \}
. if !\\n[#NO_FN_MARKER] \{\
-. if \\n[#FN_MARKER_STYLE]=1 \{\
-. ie \\n+[#FN_COUNT_FOR_COLS] \{\
-. if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT *\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dg\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT **\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \(dg\(dg\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT ***\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \(dg\(dg\(dg\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT ****\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dg\(dg\(dg\(dg\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT *****\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
-. \}
-. el \{\
-. if \\n[#FN_COUNT]=1 \{ .PRINT *\c \}
-. if \\n[#FN_COUNT]=2 \{ .PRINT \(dg\c \}
-. if \\n[#FN_COUNT]=3 \{ .PRINT **\c \}
-. if \\n[#FN_COUNT]=4 \{ .PRINT \(dg\(dg\c \}
-. if \\n[#FN_COUNT]=5 \{ .PRINT ***\c \}
-. if \\n[#FN_COUNT]=6 \{ .PRINT \(dg\(dg\(dg\c \}
-. if \\n[#FN_COUNT]=7 \{ .PRINT ****\c \}
-. if \\n[#FN_COUNT]=8 \{ .PRINT \(dg\(dg\(dg\(dg\c \}
-. if \\n[#FN_COUNT]=9 \{ .PRINT *****\c \}
-. if \\n[#FN_COUNT]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
-. \}
-. \}
-. if \\n[#FN_MARKER_STYLE]=2 \{\
-. if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
-. if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\c" \}
-. \}
-. \}
-. \}
+.\" ...but not if TERMINATE has been called.
+. if !r#TERMINATE \{\
+. if \\n[#REF]=1 \{\
+\!. in +\\*[$REF_FN_INDENT]
+\!. ti -\\*[$REF_FN_INDENT]
+. \}
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. \\n+[#FN_COUNT_FOR_COLS]
+. if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT *\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dg\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \(dd\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT **\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dg\(dg\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \(dd\(dd\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT ***\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dg\(dg\(dg\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \(dd\(dd\(dd\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT ****\c \}
+. \}
+. el \{\
+. if \\n[#FN_COUNT]=1 \{ .PRINT *\c \}
+. if \\n[#FN_COUNT]=2 \{ .PRINT \(dg\c \}
+. if \\n[#FN_COUNT]=3 \{ .PRINT \(dd\c \}
+. if \\n[#FN_COUNT]=4 \{ .PRINT **\c \}
+. if \\n[#FN_COUNT]=5 \{ .PRINT \(dg\(dg\c \}
+. if \\n[#FN_COUNT]=6 \{ .PRINT \(dd\(dd\c \}
+. if \\n[#FN_COUNT]=7 \{ .PRINT ***\c \}
+. if \\n[#FN_COUNT]=8 \{ .PRINT \(dg\(dg\(dg\c \}
+. if \\n[#FN_COUNT]=9 \{ .PRINT \(dd\(dd\(dd\c \}
+. if \\n[#FN_COUNT]=10 \{ .PRINT ****\c \}
+. \}
+. \}
+. if \\n[#FN_MARKER_STYLE]=2 \{\
+. if \\n[#COLUMNS]=1 \{\
+. \\n+[#FN_COUNT_FOR_COLS]
+. \}
+. if \\n[#NOT_YET_ADJUSTED]=1 \{\
+. nr #FN_NUMBER 1 1
+. rr #NOT_YET_ADJUSTED
+. \}
+. if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
+. if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\*[FU 2]\c" \}
+. \}
+. \}
+. \}
+. \}
+. el \{\
+.\" Line-numbered footnotes handling
+. if \\n[#FN_MARKER_STYLE]=3 \{\
+. if \\n[#FN_SPACE]>0 \{\
+. if !\\n[#RUN_ON]=1 \{\
+. if \\n[#FN_COUNT]>0 \{\
+. ALD \\n[#FN_SPACE]u
+. \}
+. \}
+. \}
+. if \\n[#REF]=1 \{\
+. if !\\n[#RUN_ON]=1 \{\
+\!. in +\\*[$REF_FN_INDENT]
+\!. ti -\\*[$REF_FN_INDENT]
+. \}
+. \}
+. ie \\n[#FN_LN_BRACKETS]=1 \{\
+. ds $FN_LINENUMBER \v'-.085m'\\*[$FN_OPEN_BRACKET]\v'.085m'
+. ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \{\
+. as $FN_LINENUMBER \\n[#FN_MARK]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m' \"
+. \}
+. el \{\
+. as $FN_LINENUMBER \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m' \"
+. \}
+. \}
+. el \{\
+. ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \{\
+. ds $FN_LINENUMBER \\n[#FN_MARK]\\*[$FN_LN_SEP]
+. \}
+. el \{\
+. ds $FN_LINENUMBER \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\\*[$FN_LN_SEP]
+. \}
+. \}
+. if !\\n[#NO_FN_MARKER] \{\
+. PRINT \\*[$FN_LINENUMBER]\c
+. \}
+. rm $FN_LINENUMBER
+. nr #FN_MARK 0
+. \}
+. \}
. \}
+.\" If INDENT arg is passed to FOOTNOTE, calculate the indent...
. el \{\
. ie '\\$1'INDENT' \{\
. ev FOOTNOTES
@@ -8368,12 +10956,36 @@ y\\R'#DESCENDER \\n[.cdp]'
. in \\n[#FN_BL_INDENT]u
. \}
. ev
+.\" ...then re-run FOOTNOTE without an argument.
. FOOTNOTE
. \}
. el \{\
. br
+.\" Add "defer space" if the previously diverted footnote was the
+.\" 1st footnote proper to its page (i.e. it looks like a deferred
+.\" footnote but it's really an overflow).
+. if \\n[#DIVERTED] \{\
+. if \\n[#PREV_FN_DEFERRED]=1 \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{ .ALD \\n[#FN_LEAD]u \}
+. if \\n[#RESET_FN_NUMBER] \{ .ALD \\n[#FN_LEAD]u \}
+. nr #PREV_FN_DEFERRED 2
+. \}
+. \}
+. if \\n[#REF]=1 \{\
+\!. in
+. \}
+.\" Terminate FOOTNOTES or FN_IN_DIVER diversion
. di
-. in 0 \"Turn off indent possibly set by FOOTNOTE INDENT...
+. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
+. hy 14
+.\" More housekeeping
+.\" Turn off indent possibly set by FOOTNOTE INDENT
+. in 0
+.\" Restore sentence spacing
+. if \\n[#PRINT_STYLE]=2 \{\
+. if d$RESTORE_SS_VAR \{ .SS \\*[$RESTORE_SS_VAR] \}
+. rm $RESTORE_SS_VAR
+. \}
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#UNDERLINE_WAS_ON] \{\
. UNDERLINE
@@ -8386,124 +10998,555 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #PP_STYLE \\n[#PP_STYLE_PREV]
. if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
. rr #INDENT_FIRSTS
-. nr #FN_DEPTH +\\n[#DIVER_DEPTH]
-. if \\n[#FN_DEFER] \{\
-. nr #FN_DEFER_SPACE 1
-. rr #FN_DEFER
+.\" Calculate footnote depth, but not if #COUNTERS_RESET (created in
+.\" DIVER_FN_1_PRE) to instruct FOOTNOTES to skip this step for now
+.\" (it's taken care of when FN_IN_DIVER is output into FOOTNOTES in
+.\" PROCESS_FN_IN_DIVER).
+. ie r#COUNTERS_RESET \{\
+. rr #COUNTERS_RESET
. \}
-. if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
-. ie \\n[#SPACE_REMAINING]<(\\n[#LEAD]*2) \{ .nr #FN_DEFER 1 \}
-. el \{\
-. nr #FN_LINES 0 1
-. while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
-. nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
+. el \{\
+. nr #GET_DEPTH 1
+.\" If the footnote is the 1st on the page and it falls too close
+.\" to the bottom margin, defer the footnote text to the next page...
+. if (\\n[#SPACE_REMAINING]-1)<=(\\n[#DOC_LEAD]) \{\
+.\" ...but not if PROCESS_FN_LEFTOVER has set #PREV_FN_DEFERRED to 1
+. if !\\n[#PREV_FN_DEFERRED]=1 \{\
+. nr #FN_DEFER 1
+. nr #FN_DEPTH +\\n[#DIVER_DEPTH]
+. rr #GET_DEPTH
+.\" This is required so that the defer space clause can distinguish
+.\" a real #FN_COUNT=1 from one generated if FOOTNOTE is run inside
+.\" QUOTE, BLOCKQUOTE or EPIGRAPH
+. if \\n[#DIVER_FN]=2 \{\
+. nr #SAVED_DIVER_FN_COUNT \\n[#FN_COUNT]
+. rr #DIVER_FN
+. \}
+. \}
+. \}
+.\" Calculate the footnote depth.
+. if \\n[#GET_DEPTH]=1 \{\
+.\" Save the previous footnote depth (for use when there will be
+.\" some overflowed footnote text).
+. nr #SAVED_FN_DEPTH_1 \\n[#FN_DEPTH]
+.\" Add the depth of the current footnote to any already existent
+.\" footnotes.
+. nr #FN_DEPTH +\\n[#DIVER_DEPTH]
+.\" Special handling for run-on footnotes
+. if \\n[#RUN_ON]=1 \{\
+. if \\n[#RUNON_FOOTNOTES] \{\
+. unformat RUNON_FOOTNOTES
+. \}
+. if \\n[#RUNON_FN_IN_DIVER] \{\
+. unformat RUNON_FN_IN_DIVER
+. \}
+. ev FOOTNOTES
+.\" Recreate FOOTNOTES with rule followed by text of unformatted
+.\" run-on footnotes.
+. di FOOTNOTES
+. ie \\n[#FN_RULE]=0 \{ .RLD 1v \}
+. el \{\
+. PRINT \v'-\\n[#FN_RULE_ADJ]u'\l'\\n[#FN_RULE_LENGTH]u'\v'+\\n[#FN_RULE_ADJ]u'
+. \}
+. br
+. if \\n[#RUNON_FOOTNOTES] \{\
+. RUNON_FOOTNOTES
+. rr #RUNON_FOOTNOTES
+. \}
+. if \\n[#RUNON_FN_IN_DIVER] \{\
+. RUNON_FN_IN_DIVER
+. rr #RUNON_FN_IN_DIVER
+. \}
+. br
+. di
+. ev
+. nr #FN_DEPTH \\n[#DIVER_DEPTH]
+. nr #SAVED_VFP 0+\\n[#VARIABLE_FOOTER_POS]
+. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
+. \}
+.\" Save the new depth
+. nr #SAVED_FN_DEPTH_2 \\n[#FN_DEPTH]
+.\" Signal that defer space should be added when PROCESS_FN_LEFTOVER
+.\" processes deferred footnotes.
+. if \\n[#FN_DEFER] \{\
+. if \\n[#FN_COUNT]=2 \{\
+. ie \\n[#COLUMNS] \{\
+. if !\\n[#FROM_FOOTER] \{\
+. if \\n[#FN_DEFER]=1 \{ .nr #FN_DEFER_SPACE 1 \}
+. if \\n[#FN_COUNT_FOR_COLS]>=1 \{ .rr #FN_DEFER_SPACE \}
+. if \\n[#FROM_HEADER] \{ .nr #FN_DEFER_SPACE 1 \}
+. \}
+. \}
+. el \{\
+. nr #FN_DEFER_SPACE 1
+. \}
+. \}
+. rr #FN_DEFER
+. \}
+.\" If the depth of the whole footnote won't fit in the space
+.\" between where we are on the page and the bottom margin, calculate
+.\" how much of it will fit.
+. if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
+. nr #FN_LINES 0 1
+. while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
+. nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
+.\}
+. nr #VFP_DIFF \\n[#FN_DEPTH]-\\n[#SAVED_FN_DEPTH_1]
+. nr #OVERFLOW 1
+.\" Very occasionally, #VFP_DIFF, on a 1st footnote that isn't to
+.\" be deferred, comes up with a depth equal to exactly 1 line
+.\" of footnotes, i.e. enough room to print the rule and nothing
+.\" else. The following tests for such a condition, and rather than
+.\" attempting to treat the footnote as an overflow, it tells mom to
+.\" treat it as a special kind of deferred footnote (#FN_DEFER 2).
+. if \\n[#SAVED_FN_DEPTH_1]=0 \{\
+. if \\n[#FN_DEPTH]=\\n[#FN_LEAD] \{\
+. nr #FN_DEFER 2
+. nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_2]
+. rr #OVERFLOW
+. \}
+. \}
+. \}
+.\" Calculate VFP based on whether the footnote overflows, or is to
+.\" be treated normally.
+. ie \\n[#OVERFLOW]=1 \{\
+. if \\n[#RUN_ON] \{\
+. rr #VARIABLE_FOOTER_POS
+. nr #VARIABLE_FOOTER_POS \\n[#SAVED_VFP]
+. \}
+. ie \\n[#FN_COUNT]=1 \{\
+. ie \\n[#RULED]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. ie \\n[#FROM_FOOTER] \{\
+. ie \\n[#FN_COUNT_FOR_COLS]>1 \{\
+. nr #FN_DEPTH -\\n[#FN_DEPTH]
+. if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
+. if !\\n[#PREV_FN_DEFERRED]=1 \{\
+. nr #FN_DEPTH -\\n[#VFP_DIFF]
+. \}
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
+. if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
+. \}
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
+. \}
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
+. \}
+. \}
+. el \{ .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]) \}
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
+. if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
+. if !\\n[#PREV_FN_DEFERRED]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if !\\n[#FROM_FOOTER] \{\
+.
+. \}
+. \}
+. el \{\
+. nr #FN_DEPTH -\\n[#VFP_DIFF]
+. \}
+. \}
+. if \\n[#DIVERTED]=3 \{\
+. if !\\n[#PREV_FN_DEFERRED] \{\
+. if !\\n[#FROM_FOOTER] \{\
+. if \\n[#FN_COUNT]=1 \{\
+. if !\\n[#VFP_DIFF] \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. da FOOTNOTES
+\!. ALD \\n[#FN_LEAD]u
+. di
+. \}
+. if \\n[#RESET_FN_NUMBER] \{\
+. da FOOTNOTES
+\!. ALD \\n[#FN_LEAD]u
+. di
+. \}
+. \}
+. \}
+. \}
+. \}
+. \}
+. \}
+. nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
+. nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
+. nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
+. \}
+. rr #OVERFLOW
+. rr #RULED
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
+. if \\n[#PREV_FN_DEFERRED]=1 \{\
+. if \\n[#DIVERTED] \{\
+. if !\\n[#FN_DEPTH]=\\n[#SAVED_FN_DEPTH_1] \{\
+. nr #FN_DEPTH +\\n[#FN_LEAD]
+. nr #VARIABLE_FOOTER_POS -\\n[#FN_LEAD]
+. rr #PREV_FN_DEFERRED
+. \}
+. \}
+. \}
+. if \\n[#FN_COUNT]>1 \{\
+. nr #NO_BACK_UP 1
+. rr #DIVERTED
+. rr #RULED
+. \}
. \}
. \}
-. \}
-. nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
-. if \\n[#FN_COUNT]=1 \{ .nr #VARIABLE_FOOTER_POS -1v \}
. \}
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
-. if (\\n(nl+1v)>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
-. ch FOOTER \\n(nlu+1v
+.\" See VFP_CHECK for an explanation of the next lines.
+.\" The trap has to be removed, prior to setting it, each time
+.\" FOOTNOTE is run.
+. if \\n[#PRINT_STYLE]=2 \{\
+. ch VFP_CHECK
+. wh \\n[#VARIABLE_FOOTER_POS]u-\\n[#DOC_LEAD]u VFP_CHECK
. \}
+.\" If we have a footnote whose text has to be deferred to the next
+.\" page, reset the FOOTER trap to its original location.
. if \\n[#FN_DEFER] \{\
. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
. \}
. \}
-. nr #NO_FN_MARKER 0
+. nr #NO_FN_MARKER 0
+. \}
+. if \\n[#ADD_BREAK] \{\
+. br
+. rr #ADD_BREAK
+. \}
.END
\#
+\# Utility macros to manage footnotes that occur inside diversions
+\# ---------------------------------------------------------------
\#
-.MAC FN_OVERFLOW_TRAP END
-. if \\n[#FN_COUNT] \{\
-. di FN_OVERFLOW
-. \}
+.ig
+There are some redundancies here; they're left in in case unforeseen
+footnote situations crop up in the future that might require
+manipulation of them.
+..
+\#
+\# 1. Pre-footnote processing for footnotes in diversions
+\#
+\# a) A footnote inside a diversion will be moved entirely (marker
+\# in running text and text of footnote) to the next page/column.
+\#
+.MAC DIVER_FN_1_PRE END
+. nr #RESET_FN_COUNTERS 1
+. nr #COUNTERS_RESET 1
+. if \\n[#DONE_ONCE]=1 \{\
+. if \\n[#FN_DEFER] \{\
+. if \\n[#SAVED_DIVER_FN_COUNT]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_DEFER_SPACE 1 \}
+. \}
+. el \{\
+. nr #FN_DEFER_SPACE 1
+. \}
+. \}
+. \}
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. if \\n[#FN_COUNT]>0 \{ .nr #FN_COUNT 0 1 \}
+. if \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. nr #FN_COUNT_FOR_COLS 0 1
+. \}
+. \}
+. \}
+. if \\n[#FN_MARKER_STYLE]=2 \{\
+. if \\n[#RESET_FN_NUMBER]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
+. \}
+. el \{\
+. nr #FN_NUMBER 0 1
+. \}
+. \}
+. \}
+. \}
.END
\#
+\# b) Treat as a normal footnote, including defers.
\#
-.MAC DIVERT_FN_LEFTOVER END
-. nr #NO_FN_MARKER 1
-. nr #OVERFLOW 1
-. FOOTNOTE
-. nf
-. FN_OVERFLOW
-. FOOTNOTE OFF
-. rr #FN_OVERFLOW_DEPTH
+.MAC DIVER_FN_2_PRE END
+. nr #RESET_FN_COUNTERS 2
.END
\#
+\# 2. Post-footnote processing for footnotes in diversions
+\#
+\# Even when a footnote inside a diversion is treated as
+\# "normal," some manipulation of registers is required. The
+\# macro is called in DO_QUOTE (i.e. at the termination of
+\# quotes and blockquotes) and in DO_EPIGRAPH.
+\#
+.MAC DIVER_FN_2_POST END
+. if \\n[#DONE_ONCE]=1 \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. if \\n[#FN_COUNT]=0 \{\
+. nr #DONT_RULE_ME 1
+. \}
+. if \\n[#FN_COUNT]>0 \{\
+. nr #FN_COUNT 0 1
+. \}
+. if \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT_FOR_COLS 0 1 \}
+. if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. \}
+. \}
+. \}
+. if \\n[#FN_MARKER_STYLE]=2 \{\
+. if \\n[#FN_COUNT]=0 \{\
+. nr #DONT_RULE_ME 1
+. \}
+. if \\n[#FN_COUNT]>0 \{\
+. nr #FN_COUNT 0 1
+. \}
+. if \\n[#RESET_FN_NUMBER]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
+. \}
+. el \{\
+. nr #FN_NUMBER 0 1
+. \}
+. \}
+. \}
+. \}
+.END
+\#
+\# The main macros that handle footnote processing.
+\# -----------------------------------------------
+\#
+.ig
+Sometimes, #VARIABLE_FOOTER_POS sets FOOTER at a location that gives
+the impression another line of running text could fit on the page.
+VFP_CHECK is always set to the line just above the one where FOOTER
+will be sprung, and checks for this condition. If it exists, FOOTER
+is set one line lower on the page, thus squeezing in an extra line
+of running text. This is a judgment call on my part, but seems to
+work well. If there are problems (e.g. footnotes really do look
+jammed), the user should probably adjust FOOTNOTE_AUTOLEAD and/or
+FOOTNOTE_RULE_ADJ.
+
+The macro has to be run in its own environment, otherwise the first
+word of the last line before the footnotes gets chopped.
+..
+\#
+.MAC VFP_CHECK END
+. ev VFP_CHECK
+.\" The trap also has to be removed each time VFP_CHECK is run
+. if \\n[#PRINT_STYLE]=2 \{\
+. ch VFP_CHECK
+. SIZESPECS
+. ie !\\n[#IN_DIVER] \{ .nr #PAGE_POS \\n(nl \}
+. el \{ .nr #PAGE_POS \\n(nl+\\n(.d+(\\n[#DOC_LEAD]) \}
+. nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS])
+. nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
+. nr #FN_GAP \\n[#SPACE_TO_FOOTER]%\\n[#DOC_LEAD]
+. if !\\n[#FN_GAP]<0 \{\
+. if \\n[#FN_GAP]<\\n[#DOC_LEAD] \{\
+. ie (\\n[#PAGE_POS]+(\\n[#FN_DEPTH]+\\n[#FN_GAP]))>(\\n[#VISUAL_B_MARGIN]) \{\
+. nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
+. \}
+. el \{\
+. ie \\n[#DOC_LEAD]-\\n[#FN_GAP]<\\n[#DESCENDER] \{\
+. nr #VARIABLE_FOOTER_POS +\\n[#DOC_LEAD]
+. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
+. \}
+. \}
+. \}
+. \}
+. \}
+. ev
+.END
+\#
+.ig
+FN_OVERFLOW_TRAP starts off "underneath" FOOTER, but is revealed
+as #VARIABLE_FOOTER_POSITION changes the position of FOOTER.
+FN_OVERFLOW_TRAP simply starts diversion FN_OVERFLOW to "catch"
+the overflow. The diversion is ended in FOOTER, immediately after
+FOOTER outputs the diversion, FOOTNOTES, before PROCESS_FN_LEFTOVER
+is run (either in HEADER, or in FOOTER if moving col to col).
+..
+\#
+.MAC FN_OVERFLOW_TRAP END
+. if \\n[#FN_COUNT] \{\
+. di FN_OVERFLOW
+. ie !\\n[#NO_BACK_UP]=1 \{\
+. if \\n[#PREV_FN_DEFERRED] \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#FROM_FOOTER] \{\
+. if \\n[#PREV_FN_DEFERRED] \{\
+. if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. rr #PREV_FN_DEFERRED
+. \}
+. \}
+. \}
+. if !\\n[#FROM_FOOTER] \{\
+. if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. if !\\n[#LAST_FN_COUNT_FOR_COLS]>1 \{\
+\!. RLD \\n[#FN_LEAD]u
+. \}
+. \}
+. \}
+. \}
+. el \{\
+\!. RLD \\n[#FN_LEAD]u
+. \}
+. \}
+. \}
+. el \{\
+. rr #NO_BACK_UP
+. rr #PREV_FN_DEFERRED
+. \}
+. \}
+.\" When #FROM_DIVERT_FN is 1, it signals to FOOTNOTE, when run from
+.\" within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING to the total
+.\" area allowable for running text.
+. nr #FROM_DIVERT_FN 1
+.END
+\#
+.ig
+PROCESS_FN_LEFTOVER is called at the top of HEADER, and in
+FOOTER if we're moving from one column to the next (i.e. after
+outputting FOOTNOTES). It checks for whether we have a "deferred
+footnote" situation, and resets counters and number registers
+accordingly. Lastly, if we have some footnote overflow, it calls
+DIVERT_FN_OVERFLOW.
+..
\#
.MAC PROCESS_FN_LEFTOVER END
+. if \\n[#PREV_FN_DEFERRED]=2 \{\
+. if \\n[#FN_COUNT_AT_FOOTER]>1 \{ .rr #PREV_FN_DEFERRED \}
+. \}
. if !\\n[#FN_DEFER] \{\
. nr #FN_COUNT 0 1
. nr #FN_DEPTH 0
. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
. \}
-. if \\n[#FN_DEFER] \{\
-. nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]+\\n[#DOC_LEAD])
+. if r#FN_DEFER \{\
+. if \\n[#FN_DEFER]=1 \{\
+. nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
+. \}
+. if \\n[#FN_DEFER]=2 \{\
+. nr #FN_DEPTH 0
+. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
+. \}
. \}
. nr #SPACE_REMAINING 0
. ch FOOTER -\\n[#B_MARGIN]u
. if \\n[#FN_DEFER] \{\
. nr #NO_FN_MARKER 1
-. da FOOTNOTES
-. di
. FOOTNOTE
. nf
. FOOTNOTE OFF
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. if !\\n[#FROM_FOOTER] \{\
+. if \\n[#FN_COUNT_FOR_COLS]=1 \{ .nr #PREV_FN_DEFERRED 1 \}
+. \}
+. \}
+. \}
+. el \{ .nr #PREV_FN_DEFERRED 1 \}
. \}
. if !\\n[#FN_DEFER] \{\
. if \\n[#FN_OVERFLOW_DEPTH] \{\
-. DIVERT_FN_LEFTOVER
+. DIVERT_FN_LEFTOVER
+. \}
+. \}
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]>1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT 0 1 \}
. \}
. \}
-. nr #FN_COUNT 0 1
+. el \{ .nr #FN_COUNT 0 1 \}
+. if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
+. rr #FROM_DIVERT_FN
.END
\#
+.ig
+DIVERT_FN_LEFTOVER is called in PROCESS_FN_LEFTOVER (at
+the top of HEADER, and in FOOTER if we're moving from one column
+to the next).
+..
\#
-\# ====================================================================
-\#
-\# +++ENDNOTES+++
-\#
-\# When endnotes are output, the spacing between the notes is always 1
-\# extra linespace. This can have bottom margin consequences. If this
-\# doesn't bother you, don't worry about it. If it does bother you, and
-\# you want to adjust the spacing between any two endnotes (as they're
-\# output), make the spacing adjustments (.ALD/.RLD) at the *end* of
-\# endnotes (i.e. just before .ENDNOTE OFF), not at the top.
-\#
-\# Endnotes must be output manually with .ENDNOTES. This allows user
-\# the flexibility to output endnotes at the end of each collated
-\# document, or to output them at the end of the entire document.
+.MAC DIVERT_FN_LEFTOVER END
+. nr #NO_FN_MARKER 1
+. nr #DIVERTED 1
+. FOOTNOTE
+. nf
+. FN_OVERFLOW
+. FOOTNOTE OFF
+. if \\n[#PREV_FN_DEFERRED] \{\
+. nr #FN_DEPTH -\\n[#FN_LEAD]
+. nr #VARIABLE_FOOTER_POS +\\n[#FN_LEAD]
+. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+. if \\n[#PREV_FN_DEFERRED]=2 \{\
+. nr #PREV_FN_DEFERRED 1
+. rr #DIVERTED
+. \}
+. \}
+. rr #FN_OVERFLOW_DEPTH
+.END
\#
-\# ENDNOTE FAMILY
-\# --------------
-\# *Argument:
-\# <family to use in endnotes>
-\# *Function:
-\# Creates or modifies string $EN_FAM.
-\# *Notes:
-\# Default is same as running text in body of document.
+.ig
+This is a special macro to deal with footnotes that are set inside
+diversions (QUOTE, BLOCKQUOTE and EPIGRAPH). It's called in HEADER
+(and in FOOTER, if we're moving from column to column), and comes
+after PROCESS_FOOTNOTE_LEFTOVER in those two macros.
+..
\#
-.MAC ENDNOTE_FAMILY END
-. ds $EN_FAM \\$1
+.MAC PROCESS_FN_IN_DIVER END
+. nr #SPACE_REMAINING 0
+. ch FOOTER -\\n[#B_MARGIN]u
+. nr #NO_FN_MARKER 1
+. if !\\n[#RESET_FN_COUNTERS]=2 \{\
+. rr #RESET_FN_COUNTERS
+. \}
+. FOOTNOTE
+. if \\n[#FN_OVERFLOW_DEPTH] \{ .nf \}
+. ie dRUNON_FN_IN_DIVER \{\
+. RUNON_FN_IN_DIVER
+. rm RUNON_FN_IN_DIVER
+. \}
+. el \{\
+. nf
+. FN_IN_DIVER
+. \}
+. FOOTNOTE OFF
+. rr #DIVER_FN
.END
\#
+\# ====================================================================
\#
-\# ENDNOTE FONT
-\# ------------
-\# *Argument:
-\# <font to use in endnotes>
-\# *Function:
-\# Creates or modifies string $EN_FT.
-\# *Notes:
-\# Default is roman.
-\#
-.MAC ENDNOTE_FONT END
-. ds $EN_FT \\$1
-.END
+\# +++ENDNOTES+++
\#
+.ig
+When endnotes are output, the spacing between the notes is always
+1 extra linespace. This can have bottom margin consequences. If
+this doesn't bother you, don't worry about it. If it does bother
+you, and you want to adjust the spacing between any two endnotes (as
+they're output), make the spacing adjustments (.ALD/.RLD) at the
+*end* of endnotes (i.e. just before .ENDNOTE OFF), not at the top.
+
+Endnotes must be output manually with .ENDNOTES. This allows user
+the flexibility to output endnotes at the end of each collated
+document, or to output them at the end of the entire document.
+..
+\#
+\# Control macros
\#
\# ENDNOTE POINT SIZE
\# ------------------
@@ -8533,28 +11576,37 @@ y\\R'#DESCENDER \\n[.cdp]'
\# ENDNOTE LEAD
\# ------------
\# *Argument:
-\# <base leading to use in endnotes>
+\# <base leading to use in endnotes> [ ADJUST ]
\# *Function:
-\# Creates or modifies register #EN_LEAD.
+\# Creates or modifies register #EN_LEAD. Creates or removes
+\# register #ADJ_EN_LEAD. Stores arguments in strings if ENDNOTE_LEAD
+\# set before START.
\# *Notes:
-\# Default is 13.5 points for TYPESET; 24 for TYPEWRITE.
+\# Default is 14 points for TYPESET, adjusted; 24 for TYPEWRITE.
\#
.MAC ENDNOTE_LEAD END
+. if !\\n[#OK_PROCESS_LEAD] \{\
+. ds $EN_LEAD \\$1
+. if !'\\$2'' \{\
+. ds $ADJUST_EN_LEAD \\$2
+. \}
+. return
+. \}
+. rr #ADJ_EN_LEAD
. nr #EN_LEAD (p;\\$1)
-.END
-\#
-\#
-\# ENDNOTE QUAD
-\# ------------
-\# *Argument:
-\# LEFT | L | CENTER | C | RIGHT | R | JUSTIFY | J
-\# *Function:
-\# Creates or modifies string $EN_QUAD.
-\# *Notes:
-\# Default is justified for TYPESET, left for TYPEWRITE.
-\#
-.MAC ENDNOTE_QUAD END
-. ds $EN_QUAD \\$1
+. if '\\$2'ADJUST' \{\
+. nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
+. nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
+. nr #ADJ_DOC_LEAD 1
+. nr #ADJ_EN_LEAD 1
+. nr #NO_TRAP_RESET 1
+. DOC_LEAD \\n[#EN_LEAD]u ADJUST
+. nr #EN_LEAD \\n[#DOC_LEAD]
+. DOC_LEAD \\n[#ORIG_DOC_LEAD]u
+. rr #NO_TRAP_RESET
+. nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
+. rr #ORIG_DOC_LEAD
+. \}
.END
\#
\#
@@ -8583,70 +11635,13 @@ y\\R'#DESCENDER \\n[.cdp]'
\# *Function:
\# Creates or modifies string $EN_STRING.
\# *Notes:
-\# Default is "ENDNOTES"
+\# Default is "Endnotes"
\#
.MAC ENDNOTE_STRING END
. ds $EN_STRING \\$1
.END
\#
\#
-\# ENDNOTE STRING FAMILY
-\# ---------------------
-\# *Argument:
-\# <family to use for endnote string>
-\# *Function:
-\# Creates or modifies string $EN_STRING_FAM.
-\# *Notes:
-\# Default is same as running text in body of document.
-\#
-.MAC ENDNOTE_STRING_FAMILY END
-. ds $EN_STRING_FAM \\$1
-.END
-\#
-\#
-\# ENDNOTE STRING FONT
-\# -------------------
-\# *Argument:
-\# <font to use for endnote string>
-\# *Function:
-\# Creates or modifies string $EN_FT.
-\# *Notes:
-\# Default is BOLD for TYPEWRITE; roman for TYPESET
-\#
-.MAC ENDNOTE_STRING_FONT END
-. ds $EN_STRING_FT \\$1
-.END
-\#
-\#
-\# ENDNOTE STRING SIZE
-\# -------------------
-\# *Argument:
-\# <+|- number of points by which to in/decrease endnote string
-\# (relative to base endnote size)>
-\# *Function:
-\# Creates or modifies string $EN_STRING_SIZE_CHANGE.
-\# *Notes:
-\# Default is +1 for TYPESET.
-\#
-.MAC ENDNOTE_STRING_SIZE END \"Default for TYPESET is +1
-. ds $EN_STRING_SIZE_CHANGE \\$1
-.END
-\#
-\#
-\# ENDNOTE STRING QUAD
-\# -------------------
-\# *Argument:
-\# LEFT | L | CENTER | C | RIGHT | R
-\# *Function:
-\# Creates or modifies string $EN_STRING_QUAD.
-\# *Notes:
-\# Default is centered.
-\#
-.MAC ENDNOTE_STRING_QUAD END
-. ds $EN_STRING_QUAD \\$1
-.END
-\#
-\#
\# ENDNOTE STRING UNDERSCORE
\# -------------------------
\# *Arguments:
@@ -8661,11 +11656,32 @@ y\\R'#DESCENDER \\n[.cdp]'
. ie '\\$1'' \{ .nr #EN_STRING_UNDERSCORE 1 \}
. el \{\
. ie '\\$1'2' \{ .nr #EN_STRING_UNDERSCORE 2 \}
-. el \{ .rr #EN_STRING_UNDERSCORE \}
+. el \{ .nr #EN_STRING_UNDERSCORE 0 \}
. \}
.END
\#
\#
+\# ENDNOTE STRING CAPS
+\# -------------------
+\# *Arguments:
+\# <none> | <anything>
+\# *Function:
+\# Turns capitalization of the endnotes pages title string
+\# "Endnotes" on or off.
+\# *Notes:
+\# Users may want the endnotes pages title string to be in caps,
+\# but the toc entry for endnotes in lower case. If the argument
+\# to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
+\# turned on, this is exactly what will happen.
+\#
+\# Default is on.
+\#
+.MAC ENDNOTE_STRING_CAPS END
+. ie '\\$1'' \{ .nr #EN_STRING_CAPS 1 \}
+. el \{ .rr #EN_STRING_CAPS \}
+.END
+\#
+\#
\# ENDNOTE TITLE
\# -------------
\# *Argument:
@@ -8680,133 +11696,128 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
-\# ENDNOTE TITLE FAMILY
-\# --------------------
-\# *Argument:
-\# <family to use for endnote title>
-\# *Function:
-\# Creates string $EN_TITLE_FAM.
-\# *Notes:
-\# Default is same as running text of document.
-\#
-.MAC ENDNOTE_TITLE_FAMILY END
-. ds $EN_TITLE_FAM \\$1
+.MAC ENDNOTE_TITLE_SPACE END
+. nr #EN_TITLE_SPACE (\\$1)
.END
\#
\#
-\# ENDNOTE TITLE FONT
-\# ------------------
-\# *Argument:
-\# <font to use for endnote title>
-\# *Function:
-\# Creates string $EN_TITLE_FT.
-\# *Notes:
-\# Default is bold for TYPESET; roman for TYPEWRITE.
-\#
-.MAC ENDNOTE_TITLE_FONT END
-. ds $EN_TITLE_FT \\$1
-.END
-\#
-\#
-\# ENDNOTE TITLE SIZE
-\# ------------------
+\# ENDNOTE TITLE UNDERSCORE
+\# ------------------------
\# *Argument:
-\# <+|- number of points by which to in/decrease endnote title
-\# (relative to base endnote size)>
+\# toggle
\# *Function:
-\# Creates string $EN_TITLE_SIZE_CHANGE.
+\# Creates or removes register #EN_TITLE_UNDERSCORE.
\# *Notes:
-\# Default is 0 (i.e. title same size as text of endnotes).
+\# Default is to underscore the endnote titles.
\#
-.MAC ENDNOTE_TITLE_SIZE END
-. ds $EN_TITLE_SIZE_CHANGE \\$1
+.MAC ENDNOTE_TITLE_UNDERSCORE END
+. ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
+. el \{ .rr #EN_TITLE_UNDERSCORE \}
.END
\#
\#
-\# ENDNOTE TITLE QUAD
-\# ------------------
-\# *Argument:
-\# <quad direction of endnote title>
+\# ENDNOTE MARKER STYLE
+\# --------------------
+\# *Arguments:
+\# NUMBER | LINE
\# *Function:
-\# Creates string $EN_TITLE_QUAD.
+\# Sets register #EN_MARKER_STYLE, used in ENDNOTE to determine
+\# the style of endnote markers (labels).
\# *Notes:
-\# Default is left.
+\# 1=NUMBER; 2=LINE. LINE means "use output line numbers".
+\# Default is NUMBER.
\#
-.MAC ENDNOTE_TITLE_QUAD END
-. ds $EN_TITLE_QUAD \\$1
+.MAC ENDNOTE_MARKER_STYLE END
+. if '\\$1'NUMBER' \{\
+. nr #EN_MARKER_STYLE 1
+. \}
+. if '\\$1'LINE' \{\
+. nr #EN_MARKER_STYLE 2
+. if !\\n[#EN_LN_SEP] \{\
+. if !\\n[#EN_LN_BRACKETS] \{ .ENDNOTE_LINENUMBER_BRACKETS SQUARE \}
+. \}
+. \}
.END
\#
\#
-\# ENDNOTE TITLE UNDERSCORE
-\# ------------------------
-\# *Argument:
-\# toggle
+\# ENDNOTE LINENUMBER MARK
+\# -----------------------
\# *Function:
-\# Creates or removes register #EN_TITLE_UNDERSCORE.
-\# *Notes:
-\# Default is to underscore the endnote titles.
+\# This string, when called inline, stores the current output line
+\# number in register #EN_MARK for use with ENDNOTE.
\#
-.MAC ENDNOTE_TITLE_UNDERSCORE END
-. ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
-. el \{ .rr #EN_TITLE_UNDERSCORE \}
-.END
+.ds EN-MARK \R'#EN_MARK \En(ln'
\#
\#
-\# ENDNOTE NUMBER FAMILY
-\# ---------------------
+\# ENDNOTE LINENUMBER SEPARATOR
+\# ----------------------------
\# *Argument:
-\# <family to use for endnote numbers on endnotes page>
+\# <user-defined separator>
\# *Function:
-\# Creates string $EN_NUMBER_FAM.
-\# *Notes:
-\# Default is same as running text of document.
+\# Stores user-defined separator (for use then
+\# ENDNOTE_MARKER_STYLE is LINE) in string $EN_LN_SEP. The
+\# separator is intended to be used when the user wishes a
+\# separator, rather than the choice of brackets offered by
+\# ENDNOTE_LINENUMBER_BRACKETS.
\#
-\# Family, font, and size of endnote numbers applies only to the
-\# numbers as they appear on the endnotes page(s). The superscript
-\# numbers that appear in running text are unaffected.
-\#
-.MAC ENDNOTE_NUMBER_FAMILY END
-. ds $EN_NUMBER_FAM \\$1
+.MAC ENDNOTE_LINENUMBER_SEPARATOR END
+. rr #EN_LN_BRACKETS
+. nr #EN_LN_SEP 1
+. ds $EN_LN_SEP "\\$1
.END
\#
\#
-\# ENDNOTE NUMBER FONT
-\# -------------------
+\# ENDNOTE LINENUMBER BRACKETS
+\# ---------------------------
\# *Argument:
-\# <font to use for endnote numbers on endnotes page>
+\# PARENS | SQUARE | BRACES or ( | [ | {
\# *Function:
-\# Creates string $EN_NUMBER_FT.
-\# *Notes:
-\# Default is bold for TYPESET; roman for TYPEWRITE.
-\#
-\# Family, font, and size of endnote numbers applies only to the
-\# numbers as they appear on the endnotes page(s). The superscript
-\# numbers that appear in running text are unaffected.
+\# Sets register #EN_LN_BRACKETS to 1, and creates strings
+\# $EN_OPEN_BRACKET and $EN_CLOSE_BRACKET according to the given argument.
\#
-.MAC ENDNOTE_NUMBER_FONT END \"Default for TYPESET is bold
-. ds $EN_NUMBER_FT \\$1
+.MAC ENDNOTE_LINENUMBER_BRACKETS END
+. rr #EN_LN_SEP
+. nr #EN_LN_BRACKETS 1
+. if '\\$1'PARENS' \{\
+. ds $EN_OPEN_BRACKET (
+. ds $EN_CLOSE_BRACKET )
+. \}
+. if '\\$1'(' \{\
+. ds $EN_OPEN_BRACKET (
+. ds $EN_CLOSE_BRACKET )
+. \}
+. if '\\$1'SQUARE' \{\
+. ds $EN_OPEN_BRACKET [
+. ds $EN_CLOSE_BRACKET ]
+. \}
+. if '\\$1'[' \{\
+. ds $EN_OPEN_BRACKET [
+. ds $EN_CLOSE_BRACKET ]
+. \}
+. if '\\$1'BRACES' \{\
+. ds $EN_OPEN_BRACKET {
+. ds $EN_CLOSE_BRACKET }
+. \}
+. if '\\$1'{' \{\
+. ds $EN_OPEN_BRACKET {
+. ds $EN_CLOSE_BRACKET }
+. \}
.END
\#
\#
-\# ENDNOTE NUMBER SIZE
-\# -------------------
+\# ENDNOTE LINENUMBER GAP
+\# ----------------------
\# *Argument:
-\# <+|- number of points by which to in/decrease endnote numbers
-\# (relative to base endnote size)>
+\# <space between line-number labels and endnotes text>
\# *Function:
-\# Creates string $EN_NUMBER_SIZE_CHANGE.
-\# *Notes:
-\# Default is 0.
-\#
-\# Family, font, and size of endnote numbers applies only to the
-\# numbers as they appear on the endnotes page(s). The superscript
-\# numbers that appear in running text are unaffected.
+\# Defines string $EN_LN_GAP, used during printing of line-number
+\# labels in ENDNOTE.
\#
-.MAC ENDNOTE_NUMBER_SIZE END \"Default for TYPESET is 0
-. ds $EN_NUMBER_SIZE_CHANGE \\$1
+.MAC ENDNOTE_LINENUMBER_GAP END
+. ds $EN_LN_GAP \\$1
.END
\#
-\#
+\#
\# ENDNOTE NUMBERS ALIGN RIGHT
\# ---------------------------
\# *Argument:
@@ -8856,6 +11867,144 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
+\# TURN OFF COLUMN MODE FOR ENDNOTES
+\# ---------------------------------
+\# *Argument:
+\# <none> | <anything>
+\# *Function:
+\# Creates or removes register #EN_NO_COLS
+\# *Notes:
+\# Allows user to tell mom not to set endnotes in columnar
+\# documents in columns. Default is to set endnotes in columns.
+\#
+.MAC ENDNOTES_NO_COLUMNS END
+. ie '\\$1'' \{ .nr #EN_NO_COLS 1 \}
+. el \{ .rr #EN_NO_COLS \}
+.END
+\#
+\#
+\# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
+\# -------------------------------------------
+\# *Argument:
+\# <none> | <anything>
+\# *Function:
+\# Creates or removes register #EN_NO_FIRST_PN
+\# *Notes:
+\# For use if FOOTERS are on. Tells ENDNOTES not to put a page
+\# number on the first endnotes page. Some users may want this.
+\# Default is to print a page number at the top of the first
+\# endnotes page when footers are on.
+\#
+.MAC ENDNOTES_NO_FIRST_PAGENUM END
+. ie '\\$1'' \{ .nr #EN_NO_FIRST_PN 1 \}
+. el \{ .rr #EN_NO_FIRST_PN \}
+.END
+\#
+\#
+\# PAGE HEADERS ON ENDNOTES PAGES
+\# ------------------------------
+\# *Argument:
+\# <none> | ALL
+\# *Function:
+\# Creates or removes register #EN_ALLOWS_HEADERS or
+\# #EN_ALLOWS_HEADERS_ALL
+\# *Notes:
+\# Whether ENDNOTES puts a page header at the top of endnotes
+\# pages if page headers are used throughout the document.
+\# Default is to insert the page headers, but not on the first
+\# page. If the optional argument ALL is given, ENDNOTES puts a
+\# page header on the first page as well.
+\#
+.MAC ENDNOTES_ALLOWS_HEADERS END
+. ie '\\$1'' \{ .nr #EN_ALLOWS_HEADERS 1 \}
+. el \{\
+. ie '\\$1'ALL' \{\
+. nr #EN_ALLOWS_HEADERS 1
+. nr #EN_ALLOWS_HEADERS_ALL 1
+. \}
+. el \{\
+. rr #EN_ALLOWS_HEADERS
+. rr #EN_ALLOWS_HEADERS_ALL
+. \}
+. \}
+.END
+\#
+\#
+\# ENDNOTES PAGES PAGE NUMBERING STYLE
+\# -----------------------------------
+\# *Argument:
+\# DIGIT | ROMAN | roman | ALPHA | alpha
+\# *Function:
+\# Creates or modifies $EN_PN_STYLE.
+\# *Notes:
+\# Allows user to define what style should be used for endnotes
+\# pages page numbering. Arguments are the same as for
+\# PAGENUM_STYLE.
+\#
+\# Default is DIGIT.
+\#
+.MAC ENDNOTES_PAGENUM_STYLE END
+. ds $EN_PN_STYLE \\$1
+.END
+\#
+\#
+\# FIRST PAGE NUMBER FOR ENDNOTES
+\# ------------------------------
+\# *Argument:
+\# <page number that appears on page 1 of endnotes pages>
+\# *Function:
+\# Creates or modifies string $EN_FIRST_PN
+\# *Notes:
+\# To be used with caution, only if all endnotes
+\# are to be output at once, i.e. not at the end of the separate
+\# docs of a collated doc
+\#
+.MAC ENDNOTES_FIRST_PAGENUMBER END
+. nr #EN_FIRST_PN \\$1
+.END
+\#
+\# SINGLESPACE ENDNOTES
+\# --------------------
+\# *Argument:
+\# <none> | <anything>
+\# *Function:
+\# Sets lead of endnotes pages in TYPEWRITE to 12 points,
+\# adjusted.
+\# *Notes:
+\# Default is to double-space endnotes pages.
+\#
+.MAC SINGLESPACE_ENDNOTES END
+. if \\n[#PRINT_STYLE]=1 \{\
+. ie \\n[#SINGLE_SPACE] \{\
+. nr #EN_SINGLESPACE 1
+. rr #IGNORE
+. if \\n[#OK_PROCESS_LEAD] \{\
+. ENDNOTE_LEAD 12 ADJUST
+. nr #IGNORE 1
+. \}
+. \}
+. el \{\
+. ie '\\$1'' \{\
+. nr #EN_SINGLESPACE 1
+. rr #IGNORE
+. if \\n[#OK_PROCESS_LEAD] \{\
+. ENDNOTE_LEAD 12 ADJUST
+. nr #IGNORE 1
+. \}
+. \}
+. el \{\
+. rr #EN_SINGLESPACE
+. rr #IGNORE
+. if \\n[#OK_PROCESS_LEAD] \{\
+. ENDNOTE_LEAD 24 ADJUST
+. nr #IGNORE 1
+. \}
+. \}
+. \}
+. \}
+.END
+\#
+\#
\# ENDNOTE PARAGRAPH SPACE
\# -----------------------
\# *Argument:
@@ -8879,55 +12028,67 @@ y\\R'#DESCENDER \\n[.cdp]'
\# Places superscript endnote number in text, then collects and
\# processes endnote in diversion END_NOTES.
\# *Notes:
-\# \c must be appended to the word immediately preceding .ENDNOTE.
+\# \c must be appended to the word immediately preceding .ENDNOTE
+\# when ENDNOTE_MARKER_STYLE is NUMBER.
\#
.MAC ENDNOTE END
+. if !\\n(.u \{ .nr #ADD_BREAK 1 \}
. ie '\\$1'' \{\
. nr #ENDNOTE 1
-. if \\n[#CONDENSE] \{ \*[CONDX]\c \}
-. if \\n[#EXTEND] \{ \*[EXTX]\c \}
-. if \\n[#PRINT_STYLE]=1 \{\
-. if \\n[#UNDERLINE_ON] \{\
-. nr #UNDERLINE_WAS_ON 1
-. UNDERLINE OFF
-. \}
-. if \\n[#SLANT_ON] \{\
-. nr #SLANT_WAS_ON 1
+. if \\n[#EN_MARKER_STYLE]=1 \{\
+. if \\n[#CONDENSE] \{ \*[CONDX]\c \}
+. if \\n[#EXTEND] \{ \*[EXTX]\c \}
+. if \\n[#PRINT_STYLE]=1 \{\
+. if \\n[#UNDERLINE_ON] \{\
+. nr #UNDERLINE_WAS_ON 1
+. UNDERLINE OFF
+. \}
+. if \\n[#SLANT_ON] \{\
+. nr #SLANT_WAS_ON 1
\*[SLANTX]\c
+. \}
+. PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
+. \}
+. if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]\c" \}
+. \}
+. if \\n[#EN_MARKER_STYLE]=2 \{\
+. if !\\n[#LINENUMBERS] \{\
+. tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
+. tm1 " ENDNOTE_MARKER_STYLE is LINE.
+. ab Aborting on ENDNOTE at line \\n(.c.
+. \}
+. if \\n[#EN_MARK]=0 \{ .nr #EN_MARK \\n(ln \}
+. nr #EN_MARK_2 \\n(ln
+. if '\\n(.z'P_QUOTE' \{\
+. nr #EN_MARK -1
+. nr #EN_MARK_2 -1
. \}
-. PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2"
. \}
-. if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]" \}
-. nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
. nr #PP_STYLE_PREV \\n[#PP_STYLE]
. nr #PP_STYLE 1
. if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
. INDENT_FIRST_PARAS
. ev EN
. da END_NOTES
-. nr #NO_TRAP_RESET 1
-. if \\n[#PRINT_STYLE]=2 \{ .DOC_LEAD \\n[#EN_LEAD]u ADJUST \}
-. rr #NO_TRAP_RESET
-. vs \\n[#DOC_LEAD]u
. LL \\n[#DOC_L_LENGTH]u
. ta \\n(.lu
. if \\n[#COLUMNS] \{\
-. LL \\n[#COL_L_LENGTH]u
+. ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
+. el \{ .LL \\n[#COL_L_LENGTH]u \}
. ta \\n(.lu
. \}
+. vs \\n[#EN_LEAD]u
. if \\n[#EN_NUMBER]=1 \{\
-\!. ne 3
-. if !'\\*[$EN_STRING]'' \{ .sp \}
+\!. ne 3
. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. FAMILY \\*[$EN_TITLE_FAM]
. FT \\*[$EN_TITLE_FT]
. PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
. \}
+. sp
. if !'\\*[$EN_TITLE]'' \{\
. if '\\*[$EN_TITLE_QUAD]'L' \{ .LEFT \}
. if '\\*[$EN_TITLE_QUAD]'LEFT' \{ .LEFT \}
@@ -8944,80 +12105,126 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. \}
-. ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
-. ie \\n[#EN_NUMBER]=1 \{\
-. if !'\\*[$EN_TITLE]'' \{ .sp \}
-. \}
-. el \{ .sp \}
-\!. TRAP OFF
-. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
-. \}
-. if \\n[#PRINT_STYLE]=2 \{\
+. ie \\n[#EN_NUMBER]=1 \{\
+. if !'\\*[$EN_TITLE]'' \{ .sp \}
+. \}
+. el \{ .sp \}
+. if \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. if \\n[#EN_MARKER_STYLE]=1 \{\
. FAMILY \\*[$EN_NUMBER_FAM]
. FT \\*[$EN_NUMBER_FT]
. PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
. \}
-. nr #RESET_L_LENGTH \\n(.l
-. nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
-. ll \\n[#EN_NUMBER_L_LENGTH]u
-. RIGHT
-\En[#EN_NUMBER].
-. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
+. if \\n[#EN_MARKER_STYLE]=2 \{\
+. FAMILY \\*[$EN_LN_FAM]
+. FT \\*[$EN_LN_FT]
+. PT_SIZE \\n[#EN_PS]u\\*[$EN_LN_SIZE_CHANGE]
. \}
-. if \\n[#PRINT_STYLE]=2 \{\
-. FAMILY \\*[$EN_FAM]
-. FT \\*[$EN_FT]
-. PT_SIZE \\n[#EN_PS]u
+. \}
+. if \\n[#EN_MARKER_STYLE]=2 \{\
+. ENDNOTE_NUMBERS_ALIGN_LEFT
+. ie \\n[#EN_LN_BRACKETS]=1 \{\
+. ds $EN_LINENUMBER \v'-.085m'\\*[$EN_OPEN_BRACKET]\v'.085m'
+. ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \{\
+. as $EN_LINENUMBER \\n[#EN_MARK]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m' \"
+. \}
+. el \{\
+. as $EN_LINENUMBER \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m' \"
+. \}
+. \}
+. el \{\
+. ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \{\
+. ds $EN_LINENUMBER \\n[#EN_MARK]\\*[$EN_LN_SEP]
+. \}
+. el \{\
+. ds $EN_LINENUMBER \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\\*[$EN_LN_SEP]
+. \}
. \}
-. EL
-. ll \\n[#RESET_L_LENGTH]u
-. in \\n[#EN_NUMBER_L_LENGTH]u+\w'.\0'u
-. nr #EN_TEXT_INDENT \\n(.i
-. QUAD \\*[$EN_QUAD]
-\!. TRAP
+. nr #EN_MARK 0
+. \}
+\!. TRAP OFF
+. nr #RESET_L_LENGTH \\n(.l
+. ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
+. nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
+. RIGHT
. \}
. el \{\
-. ie \\n[#EN_NUMBER]=1 \{\
-. if !'\\*[$EN_TITLE]'' \{ .sp \}
-. \}
-. el \{ .sp \}
-. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
+. nr #EN_NUMBER_L_LENGTH \w'\En[#EN_NUMBER].\0'
+. LEFT
+. \}
+. if \\n[#EN_MARKER_STYLE]=2 \{\
+. if !\\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
+. nr #EN_NUMBER_L_LENGTH \w'\\*[$EN_LINENUMBER]'+\\*[$EN_LN_GAP]
+. LEFT
. \}
-. if \\n[#PRINT_STYLE]=2 \{\
-. FAMILY \\*[$EN_NUMBER_FAM]
-. FT \\*[$EN_NUMBER_FT]
-. PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
+. \}
+. ll \\n[#EN_NUMBER_L_LENGTH]u
+. if \\n[#EN_MARKER_STYLE]=1 \{\
+\En[#EN_NUMBER].
+. \}
+. if \\n[#EN_MARKER_STYLE]=2 \{\
+\\*[$EN_LINENUMBER]
+. rm $EN_LINENUMBER
+. \}
+. EOL
+. ll \\n[#RESET_L_LENGTH]u
+. nr #EN_FIGURE_SPACE \w'\0.'
+. ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
+. in \\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_FIGURE_SPACE]u
+. \}
+. el \{\
+. ti \\n[#EN_NUMBER_L_LENGTH]u
+. \}
+. nr #EN_TEXT_INDENT \\n(.i
+. QUAD \\*[$EN_QUAD]
+\!. TRAP
+. if \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. FAMILY \\*[$EN_FAM]
+. FT \\*[$EN_FT]
+. PT_SIZE \\n[#EN_PS]u
+. \}
+. if \\n[#REF]=1 \{\
+. ie !\\n[#EN_MARKER_STYLE]=2 \{\
+. if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
+. in \\*[$REF_EN_INDENT]
+. ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u)
+. \}
+. if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
+. in \\*[$REF_EN_INDENT]
+. ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u-\\n[#EN_FIGURE_SPACE]u)
+. \}
. \}
-. QUAD \\*[$EN_QUAD]
-\En[#EN_NUMBER].\0\c
-. if \\n[#PRINT_STYLE]=2 \{\
-. FAMILY \\*[$EN_FAM]
-. FT \\*[$EN_FT]
-. PT_SIZE \\n[#EN_PS]u
+. el \{\
+. if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
+. in \\*[$REF_EN_INDENT]
+. ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u)
+. \}
. \}
. \}
. \}
. el \{\
. br
-. if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
. in 0
+. if \\n[#EN_MARKER_STYLE]=2 \{\
+\!. in 0
. \}
. di
-. DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
+.\" Restore sentence spacing
+. if \\n[#PRINT_STYLE]=2 \{\
+. if d$RESTORE_SS_VAR \{ .SS \\*[$RESTORE_SS_VAR] \}
+. rm $RESTORE_SS_VAR
+. \}
+. ev
. nr #PP_STYLE \\n[#PP_STYLE_PREV]
. if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
. rr #INDENT_FIRSTS
. rr #ENDNOTE
-. ev
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#UNDERLINE_WAS_ON] \{\
. rr #UNDERLINE_WAS_ON
@@ -9029,6 +12236,10 @@ y\\R'#DESCENDER \\n[.cdp]'
\*[SLANT]\c
. \}
. \}
+. if \\n[#ADD_BREAK] \{\
+. br
+. rr #ADD_BREAK
+. \}
.END
\#
\#
@@ -9042,26 +12253,137 @@ y\\R'#DESCENDER \\n[.cdp]'
\# with endnotes, then outputs diversion END_NOTES.
\#
.MAC ENDNOTES END
-. if \\n[#DOC_TYPE]=2 \{\
+. nr #ENDNOTES 1
+. nr #EN_FIRST_PAGE 1
+. nr #HEADER_STATE \\n[#HEADERS_ON]
+. ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
+. if \\n[#LINENUMBERS]=1 \{\
+. NUMBER_LINES OFF
+. nr #LINENUMBERS 2
+. \}
+. if \\n[#HEADERS_ON]=1 \{\
+. if !\\n[#EN_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
+. \}
+. if \\n[#HEADER_STATE]=1 \{\
. ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
-. el \{ .HDRFTR_CENTER \}
+. el \{ .rm $HDRFTR_CENTER \}
+. \}
+. ie !\\n[#SUSPEND_PAGINATION] \{\
+. if \\n[#PAGINATE]=1 \{\
+. if \\n[#PAGE_NUM_V_POS]=1 \{\
+. PAGENUM_STYLE \\*[$EN_PN_STYLE]
+. if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN]-1 \}
+. if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
+. \}
+. \}
+. \}
+. el \{\
+. ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
+. el \{ .nr #PAGINATE 0 \}
+. \}
+. if \\n[#FOOTERS_ON]=1 \{\
+. if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
. \}
. NEWPAGE
-. nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
-. if \\n[#PRINT_STYLE]=2 \{ .DOC_LEAD \\n[#EN_LEAD]u ADJUST \}
+. if \\n[#FOOTERS_ON]=1 \{\
+. ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
+. rm $HDRFTR_CENTER_OLD
+. rm $HDRFTR_CENTER_NEW
+. \}
+. ie !\\n[#SUSPEND_PAGINATION] \{\
+. if \\n[#PAGE_NUM_V_POS]=1 \{\
+. if r#EN_NO_FIRST_PN \{\
+. if \\n[#PAGINATION_STATE]=1 \{\
+. nr #PAGINATE 1
+. \}
+. \}
+. \}
+. \}
+. el \{\
+. if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
+. \}
+. rr #PAGINATION_STATE
+. PAGENUM_STYLE \\*[$EN_PN_STYLE]
+. if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
+. if \\n[#HEADER_STATE]=1 \{\
+. if \\n[#EN_ALLOWS_HEADERS] \{ .HEADERS \}
+. \}
+.\" Collect endnotes title string for TOC
+. nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
+. af #TOC_ENTRY_PN \\g[#PAGENUMBER]
+. ds $TOC_TITLE_ITEM \\*[$EN_STRING]\\|
+. ev TOC_EV
+. da TOC_ENTRIES
+. if \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_TITLE_FAM]
+\!. FT \\*[$TOC_TITLE_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
+. \}
+\!. TRAP OFF
+. ie \\n[#PRINT_STYLE]=1 \{\
+\!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
+. \}
+. el \{\
+\!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
+. \}
+\!. EOL
+\!. ST 100 L
+\!. ST 101 R
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_PN_FAM]
+\!. FT \\*[$TOC_PN_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
+. \}
+\!. TAB 100
+\!. PRINT \\*[LEADER]
+\!. TN
+\!. TRAP
+\!. PRINT \\n[#TOC_ENTRY_PN]
+\!. TQ
+. di
+. ev
+.\" End collection of endnotes title string for TOC
+.\" Process endnotes
+. if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#EN_LEAD]u \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. if \\n[#EN_NO_COLS] \{\
+. if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
+. nr #COLUMNS 0
+. \}
+. nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
+. ie \\n[#ADJ_EN_LEAD] \{\
+. nr #DOC_LEAD \\n[#EN_LEAD]
+. \}
+. el \{ .DOC_LEAD \\n[#EN_LEAD]u \}
+. \}
+. PRINT \&
+. ie r#EN_TITLE_SPACE \{ .sp |\\n[#EN_TITLE_SPACE]u \}
+. el \{ .sp |\\n[#T_MARGIN]u \}
+. mk ec
. if \\n[#SLANT_ON] \{\
\*[SLANTX]\c
. \}
+. ev ENDNOTES
. if !'\\*[$EN_STRING]'' \{\
. if \\n[#PRINT_STYLE]=1 \{\
-. fam C
-. ft R
-. ps 12
+. TYPEWRITER
+. vs \\n[#EN_LEAD]u
. \}
. if \\n[#PRINT_STYLE]=2 \{\
+. LL \\n[#DOC_L_LENGTH]u
+. ta \\n(.lu
+. if \\n[#COLUMNS] \{\
+. ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
+. el \{ .LL \\n[#COL_L_LENGTH]u \}
+. ta \\n(.lu
+. \}
. FAMILY \\*[$EN_STRING_FAM]
. FT \\*[$EN_STRING_FT]
. PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
+. vs \\n[#EN_LEAD]u
. \}
. if '\\*[$EN_STRING_QUAD]'L' \{ .LEFT \}
. if '\\*[$EN_STRING_QUAD]'LEFT' \{ .LEFT \}
@@ -9070,7 +12392,8 @@ y\\R'#DESCENDER \\n[.cdp]'
. if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
. if '\\*[$EN_STRING_QUAD]'R' \{ .RIGHT \}
. if '\\*[$EN_STRING_QUAD]'RIGHT' \{ .RIGHT \}
-. EL
+. EOL
+. if \\n[#EN_STRING_CAPS] \{ .CAPS \}
. ie \\n[#EN_STRING_UNDERSCORE] \{\
. ie \\n[#EN_STRING_UNDERSCORE]=2 \{\
. UNDERSCORE2 "\\*[$EN_STRING]
@@ -9083,14 +12406,785 @@ y\\R'#DESCENDER \\n[.cdp]'
. PRINT "\\*[$EN_STRING]
. \}
. \}
-. ev EN
+. CAPS OFF
+. if \\n[#PRINT_STYLE]=1 \{\
+. ie \\n[#SINGLE_SPACE]=1 \{\
+. ALD \\n[#EN_LEAD]u*2u
+. \}
+. el \{\
+. ie \\n[#EN_SINGLESPACE]=1 \{\
+. ALD \\n[#EN_LEAD]u*2
+. \}
+. el \{\
+.
+. \}
+. \}
+. \}
+. if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#EN_LEAD]u \}
+. QUAD \\*[$EN_QUAD]
. nf
-. vs \\n[#DOC_LEAD]u
. END_NOTES
. br
. ev
. rm END_NOTES
-. DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
+. if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#DOC_LEAD]u \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. ie \\n[#ADJ_EN_LEAD] \{\
+. nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
+. \}
+. el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
+. rr #RESTORE_DOC_LEAD
+. \}
+. if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
+. if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
+. if \\n[#LINENUMBERS]=2 \{\
+. NUMBER_LINES RESUME
+. nr #LINENUMBERS 1
+. \}
+. rr #ENDNOTES
+.END
+\#
+\# ====================================================================
+\#
+\# +++BIBLIOGRAPHY+++
+\#
+.ig
+Mom treats bibliographies and endnotes very similarly. The chief
+difference is that endnotes are collected and formatted inside a
+diversion, while bibliographies are built "by hand." ENDNOTES sets
+up the endnotes page and outputs the formatted diversion.
+BIBLIOGRAPHY sets up the bibliography page, then awaits refer
+commands.
+
+All of the bibliography control macros have their exact
+counterparts in the endnotes control macros. It was tempting to do
+fancy stuff with aliases to avoid the repetition, but for reasons
+of my own sanity, and for the benefit of anyone wanting to play
+around with the bibliography control macros, I decided to keep them
+separate.
+
+Because the bibliography control macros all have endnotes
+equivalents, refer to the appropriate, similar endnote macro for
+Arguments, Function and Notes.
+..
+\# Bibliography control macros
+\#
+.MAC BIBLIOGRAPHY_PT_SIZE END
+. nr #BIB_PS (p;\\$1)
+.END
+\#
+.MAC BIBLIOGRAPHY_LEAD END
+. if !\\n[#OK_PROCESS_LEAD] \{\
+. ds $BIB_LEAD \\$1
+. if !'\\$2'' \{\
+. ds $ADJUST_BIB_LEAD \\$2
+. \}
+. return
+. \}
+. rr #ADJ_BIB_LEAD
+. nr #BIB_LEAD (p;\\$1)
+. if '\\$2'ADJUST' \{\
+. nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
+. nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
+. nr #ADJ_DOC_LEAD 1
+. nr #ADJ_BIB_LEAD 1
+. nr #NO_TRAP_RESET 1
+. DOC_LEAD \\n[#BIB_LEAD]u ADJUST
+. nr #BIB_LEAD \\n[#DOC_LEAD]
+. DOC_LEAD \\n[#ORIG_DOC_LEAD]u
+. rr #NO_TRAP_RESET
+. nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
+. rr #ORIG_DOC_LEAD
+. \}
+.END
+\#
+.MAC BIBLIOGRAPHY_HDRFTR_CENTER END
+. ie '\\$1'' \{ .nr #BIB_HDRFTR_CENTER 1 \}
+. el \{ .rr #BIB_HDRFTR_CENTER \}
+.END
+\#
+.MAC BIBLIOGRAPHY_STRING END
+. ds $BIB_STRING \\$1
+.END
+\#
+.MAC BIBLIOGRAPHY_STRING_UNDERSCORE END
+. ie '\\$1'' \{ .nr #BIB_STRING_UNDERSCORE 1 \}
+. el \{\
+. ie '\\$1'2' \{ .nr #BIB_STRING_UNDERSCORE 2 \}
+. el \{ .nr #BIB_STRING_UNDERSCORE 0 \}
+. \}
+.END
+\#
+.MAC BIBLIOGRAPHY_STRING_CAPS END
+. ie '\\$1'' \{ .nr #BIB_STRING_CAPS 1 \}
+. el \{ .rr #BIB_STRING_CAPS \}
+.END
+\#
+.MAC BIBLIOGRAPHY_NO_COLUMNS END
+. ie '\\$1'' \{ .nr #BIB_NO_COLS 1 \}
+. el \{ .rr #BIB_NO_COLS \}
+.END
+\#
+.MAC BIBLIOGRAPHY_NO_FIRST_PAGENUM END
+. ie '\\$1'' \{ .nr #BIB_NO_FIRST_PN 1 \}
+. el \{ .rr #BIB_NO_FIRST_PN \}
+.END
+\#
+.MAC BIBLIOGRAPHY_ALLOWS_HEADERS END
+. ie '\\$1'' \{ .nr #BIB_ALLOWS_HEADERS 1 \}
+. el \{\
+. ie '\\$1'ALL' \{\
+. nr #BIB_ALLOWS_HEADERS 1
+. nr #BIB_ALLOWS_HEADERS_ALL 1
+. \}
+. el \{\
+. rr #BIB_ALLOWS_HEADERS
+. rr #BIB_ALLOWS_HEADERS_ALL
+. \}
+. \}
+.END
+\#
+.MAC BIBLIOGRAPHY_PAGENUM_STYLE END
+. ds $BIB_PN_STYLE \\$1
+.END
+\#
+.MAC BIBLIOGRAPHY_FIRST_PAGENUMBER END
+. nr #BIB_FIRST_PN \\$1
+.END
+\#
+.MAC SINGLESPACE_BIBLIOGRAPHY END
+. if \\n[#PRINT_STYLE]=1 \{\
+. ie \\n[#SINGLE_SPACE] \{\
+. nr #BIB_SINGLESPACE 1
+. rr #IGNORE
+. if \\n[#OK_PROCESS_LEAD] \{\
+. BIBLIOGRAPHY_LEAD 12 ADJUST
+. nr #IGNORE 1
+. \}
+. \}
+. el \{\
+. ie '\\$1'' \{\
+. nr #BIB_SINGLESPACE 1
+. rr #IGNORE
+. if \\n[#OK_PROCESS_LEAD] \{\
+. BIBLIOGRAPHY_LEAD 12 ADJUST
+. nr #IGNORE 1
+. \}
+. \}
+. el \{\
+. rr #BIB_SINGLESPACE
+. rr #IGNORE
+. if \\n[#OK_PROCESS_LEAD] \{\
+. BIBLIOGRAPHY_LEAD 24 ADJUST
+. nr #IGNORE 1
+. \}
+. \}
+. \}
+. \}
+.END
+\#
+\#
+\# Style for outputting collected bibliographic references
+\# -------------------------------------------------------
+\# *Argument:
+\# LIST | PLAIN [ <list separator> ] [ <list prefix> ]
+\# *Function:
+\# Sets #BIB_LIST to 1 for numbered list style, 0 for plain output
+\# *Notes:
+\# Technically, user is supposed to enter PLAIN if s/he wants an
+\# unumbered bibliography, but the el clause says "any arg but
+\# LIST means unumbered." Effectively, any arg but LIST produces
+\# a "plain" bibliographic list.
+\#
+\# The 2nd and 3rd args have the same options as the 2nd arg to LIST.
+\#
+.MAC BIBLIOGRAPHY_TYPE END
+. ie '\\$1'LIST' \{\
+. nr #BIB_LIST 1
+. ie '\\$2'' \{\
+. if '\\*[$BIB_LIST_SEPARATOR]'' .ds $BIB_LIST_SEPARATOR .
+. \}
+. el .ds $BIB_LIST_SEPARATOR \\$2
+. ie '\\$3'' .ds $BIB_LIST_PREFIX
+. el .ds $BIB_LIST_PREFIX \\$3
+. \}
+. el \{ .nr #BIB_LIST 0 \}
+.END
+\#
+\# Spacing between items in bibliographies
+\# ---------------------------------------
+\# *Argument:
+\# <amount of space>
+\# *Function:
+\# Gets value for #BIB_SPACE in units.
+\# *Notes:
+\# Requires a unit of measure.
+\#
+.MAC BIBLIOGRAPHY_SPACING END
+. ds $BIB_SPACE \\$1
+. if \\n[#BIB_LEAD]=0 \{\
+. nr #DEFER_BIB_SPACING 1
+. return
+. \}
+. ds $EVAL_BIB_SPACE \\*[$BIB_SPACE]
+. substring $EVAL_BIB_SPACE -1
+. ie '\\*[$EVAL_BIB_SPACE]'v' \{\
+. substring $BIB_SPACE 0 0
+. nr #BIB_SPACE \\n[#BIB_LEAD]*\\*[$BIB_SPACE]
+. \}
+. el \{\
+. nr #BIB_SPACE (\\$1)
+. \}
+.END
+\#
+\# Set up bibliography page
+\# ------------------------
+\# *Function:
+\# Sets up a new page, with title, ready to accept the output
+\# of refer's $LIST$ or .R1 bibliography .R2
+\# *Notes:
+\# Bibliography pages are set up almost identically to endnotes pages.
+\#
+.MAC BIBLIOGRAPHY END
+. nr #BIBLIOGRAPHY 1
+. nr #BIB_FIRST_PAGE 1
+. nr #HEADER_STATE \\n[#HEADERS_ON]
+. ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
+. if \\n[#LINENUMBERS]=1 \{\
+. NUMBER_LINES OFF
+. nr #LINENUMBERS 2
+. \}
+. if \\n[#HEADERS_ON]=1 \{\
+. if !\\n[#BIB_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
+. \}
+. if \\n[#HEADER_STATE]=1 \{\
+. ie \\n[#BIB_HDRFTR_CENTER]=1 \{ . \}
+. el \{ .rm $HDRFTR_CENTER \}
+. \}
+. ie !\\n[#SUSPEND_PAGINATION] \{\
+. if \\n[#PAGINATE]=1 \{\
+. if \\n[#PAGE_NUM_V_POS]=1 \{\
+. PAGENUM_STYLE \\*[$BIB_PN_STYLE]
+. if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN]-1 \}
+. if r#BIB_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
+. \}
+. \}
+. \}
+. el \{\
+. ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
+. el \{ .nr #PAGINATE 0 \}
+. \}
+. if \\n[#FOOTERS_ON]=1 \{\
+. if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
+. \}
+. NEWPAGE
+. if \\n[#FOOTERS_ON]=1 \{\
+. ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
+. rm $HDRFTR_CENTER_OLD
+. rm $HDRFTR_CENTER_NEW
+. \}
+. ie !\\n[#SUSPEND_PAGINATION] \{\
+. if \\n[#PAGE_NUM_V_POS]=1 \{\
+. if r#BIB_NO_FIRST_PN \{\
+. if \\n[#PAGINATION_STATE]=1 \{\
+. nr #PAGINATE 1
+. \}
+. \}
+. \}
+. \}
+. el \{\
+. if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
+. \}
+. rr #PAGINATION_STATE
+. PAGENUM_STYLE \\*[$BIB_PN_STYLE]
+. if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN] \}
+. if \\n[#HEADER_STATE]=1 \{\
+. if \\n[#BIB_ALLOWS_HEADERS] \{ .HEADERS \}
+. \}
+.\" Collect bibliography title string for TOC
+. nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
+. af #TOC_ENTRY_PN \\g[#PAGENUMBER]
+. ds $TOC_TITLE_ITEM \\*[$BIB_STRING]\\|
+. ev TOC_EV
+. da TOC_ENTRIES
+. if \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_TITLE_FAM]
+\!. FT \\*[$TOC_TITLE_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
+. \}
+\!. TRAP OFF
+. ie \\n[#PRINT_STYLE]=1 \{\
+\!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
+. \}
+. el \{\
+\!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
+. \}
+\!. EOL
+\!. ST 100 L
+\!. ST 101 R
+. if \\n[#PRINT_STYLE]=2 \{\
+\!. FAMILY \\*[$TOC_PN_FAM]
+\!. FT \\*[$TOC_PN_FT]
+\!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
+. \}
+\!. TAB 100
+\!. PRINT \\*[LEADER]
+\!. TN
+\!. TRAP
+\!. PRINT \\n[#TOC_ENTRY_PN]
+\!. TQ
+. di
+. ev
+.\" End collection of bibliography title string for TOC
+.\" Process bibliography
+. if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#BIB_LEAD]u \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. if \\n[#BIB_NO_COLS] \{\
+. if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
+. nr #COLUMNS 0
+. \}
+. nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
+. ie \\n[#ADJ_BIB_LEAD] \{\
+. nr #DOC_LEAD \\n[#BIB_LEAD]
+. \}
+. el \{ .DOC_LEAD \\n[#BIB_LEAD]u \}
+. \}
+. PRINT \&
+. ie r#BIB_TITLE_SPACE \{ .sp |\\n[#BIB_TITLE_SPACE]u \}
+. el \{ .sp |\\n[#T_MARGIN]u \}
+. mk ec
+. if \\n[#SLANT_ON] \{\
+\*[SLANTX]\c
+. \}
+. if !'\\*[$BIB_STRING]'' \{\
+. if \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. vs \\n[#BIB_LEAD]u
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. LL \\n[#DOC_L_LENGTH]u
+. ta \\n(.lu
+. if \\n[#COLUMNS] \{\
+. ie \\n[#BIB_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
+. el \{ .LL \\n[#COL_L_LENGTH]u \}
+. ta \\n(.lu
+. \}
+. FAMILY \\*[$BIB_STRING_FAM]
+. FT \\*[$BIB_STRING_FT]
+. PT_SIZE \\n[#BIB_PS]u\\*[$BIB_STRING_SIZE_CHANGE]
+. vs \\n[#BIB_LEAD]u
+. \}
+. if '\\*[$BIB_STRING_QUAD]'L' \{ .LEFT \}
+. if '\\*[$BIB_STRING_QUAD]'LEFT' \{ .LEFT \}
+. if '\\*[$EN_STRING_QUAD]'C' \{ .CENTER \}
+. if '\\*[$BIB_STRING_QUAD]'CENTER' \{ .CENTER \}
+. if '\\*[$BIB_STRING_QUAD]'CENTRE' \{ .CENTER \}
+. if '\\*[$BIB_STRING_QUAD]'R' \{ .RIGHT \}
+. if '\\*[$BIB_STRING_QUAD]'RIGHT' \{ .RIGHT \}
+. EOL
+. if \\n[#BIB_STRING_CAPS] \{ .CAPS \}
+. ie \\n[#BIB_STRING_UNDERSCORE] \{\
+. ie \\n[#BIB_STRING_UNDERSCORE]=2 \{\
+. UNDERSCORE2 "\\*[$BIB_STRING]
+. \}
+. el \{\
+. UNDERSCORE "\\*[$BIB_STRING]
+. \}
+. \}
+. el \{\
+. PRINT "\\*[$BIB_STRING]
+. \}
+. \}
+. CAPS OFF
+. FAMILY \\*[$BIB_FAMILY]
+. FT \\*[$BIB_FT]
+. PT_SIZE -\\*[$BIB_STRING_SIZE_CHANGE]
+. if \\n[#PRINT_STYLE]=1 \{\
+. ie \\n[#SINGLE_SPACE]=1 \{\
+. ALD \\n[#BIB_LEAD]*3u
+. \}
+. el \{\
+. ie \\n[#BIB_SINGLESPACE]=1 \{\
+. ALD \\n[#BIB_LEAD]u*3u
+. \}
+. el \{\
+. ALD \\n[#BIB_LEAD]u
+. \}
+. \}
+. \}
+. if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#BIB_LEAD]u*2u \}
+. QUAD \\*[$BIB_QUAD]
+. if \\n[#PRINT_STYLE]=1 \{\
+. ie \\n[#SINGLE_SPACE]=1 \{\
+. vs \\n[#BIB_LEAD]u
+. \}
+. el \{\
+. ie \\n[#BIB_SINGLESPACE]=1 \{\
+. vs \\n[#BIB_LEAD]u
+. \}
+. el \{\
+. vs \\n[#BIB_LEAD]u
+. \}
+. \}
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. ie \\n[#ADJ_BIB_LEAD] \{\
+. nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
+. \}
+. el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
+. rr #RESTORE_DOC_LEAD
+. \}
+. if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
+. if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
+. rr #BIBLIOGRAPHY
+. if \\n[#LINENUMBERS]=2 \{\
+. NUMBER_LINES RESUME
+. nr #LINENUMBERS 1
+. \}
+.END
+\#
+\# ====================================================================
+\#
+\# +++TABLE OF CONTENTS+++
+\#
+\# Strings to allocate space for leaders and entry page numbers
+\#
+.ds $TOC_PN \\*[ST100]\\F[\\*[$TOC_PN_FAM]]\\f[\\*[$TOC_PN_FT]]\\s[\\n[#TOC_PS]u]#\\*[ST100X]\\*[ST101]\\s[\\*[$TOC_PN_SIZE_CHANGE]]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\*[ST101X]
+.ds $TOC_PN_TYPEWRITE \\*[ST100]#\\*[ST100X]\\*[ST101]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST101X]
+\#
+\# TOC ENTRIES PAGE NUMBERS PADDING
+\# --------------------------------
+\# *Argument:
+\# <number of placeholders for toc entries page numbers>
+\# *Function:
+\# Creates or modifies register #TOC_PN_PADDING.
+\# *Notes:
+\# "Placeholders" is the maximum number of digits in a page
+\# number numeral.
+\#
+\# Default is 3.
+\#
+.MAC TOC_PADDING END
+. nr #TOC_PN_PADDING \\$1
+.END
+\#
+\#
+\# PAGINATE TOC
+\# ------------
+\# *Argument:
+\# <none> | <anything>
+\# *Function:
+\# Creates or removes register #PAGINATE_TOC.
+\# *Notes:
+\# Default is to paginate toc.
+\#
+.MAC PAGINATE_TOC END
+. ie '\\$1'' \{ .nr #PAGINATE_TOC 1 \}
+. el \{ .nr #PAGINATE_TOC 0 \}
+.END
+\#
+\#
+\# TOC POINT SIZE
+\# --------------
+\# *Argument:
+\# <base point size for toc pages>
+\# *Function:
+\# Creates or modifies register #TOC_PS.
+\# *Notes:
+\# This size control macro differs from other size control macros
+\# in that it sets an absolute point size, not a relative one.
+\# See notes for ENDNOTE_PT_SIZE for explanation. No unit of
+\# measure required.
+\#
+\# No unit of measure required (points assumed). Default is 11.5
+\# for TYPESET.
+\#
+.MAC TOC_PT_SIZE END
+. nr #TOC_PS (p;\\$1)
+.END
+\#
+\#
+\# TOC LEADING
+\# -----------
+\# *Argument:
+\# <leading for toc pages> [ADJUST]
+\# *Function:
+\# Creates or modifies register #TOC_LEAD. If optional ADJUST
+\# given, adjusts lead to fill page. If #OK_PROCESS_LEAD doesn't
+\# exist, stores arguments for when it's okay to run the macro.
+\# *Notes:
+\# No unit of measure required (points assumed).
+\#
+\# Default is same as DOC_LEAD.
+\#
+.MAC TOC_LEAD END
+. if !\\n[#OK_PROCESS_LEAD] \{\
+. ds $TOC_LEAD \\$1
+. if !'\\$2'' \{\
+. ds $ADJUST_TOC_LEAD \\$2
+. \}
+. return
+. \}
+. rr #ADJ_TOC_LEAD
+. nr #TOC_LEAD (p;\\$1)
+. if '\\$2'ADJUST' \{\
+. nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
+. nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
+. nr #ADJ_DOC_LEAD 1
+. nr #ADJ_TOC_LEAD 1
+. nr #NO_TRAP_RESET 1
+. DOC_LEAD \\n[#TOC_LEAD]u ADJUST
+. nr #TOC_LEAD \\n[#DOC_LEAD]
+. DOC_LEAD \\n[#ORIG_DOC_LEAD]u
+. rr #NO_TRAP_RESET
+. nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
+. rr #ORIG_DOC_LEAD
+. \}
+.END
+\#
+\#
+\# TOC PAGES PAGE-NUMBERING STYLE
+\# ------------------------------
+\# *Argument:
+\# DIGIT | ROMAN | roman | ALPHA | alpha
+\# *Function:
+\# Creates or modifies string $TOC_PN_STYLE
+\# *Notes:
+\# Page numbering style for page numbers that appear in the
+\# headers/footers of toc pages. See notes for PAGENUM_STYLE.
+\#
+\# Default is roman.
+\#
+.MAC TOC_PAGENUM_STYLE END
+. ds $TOC_PN_STYLE \\$1
+.END
+\#
+\#
+\# TOC RECTO_VERSO SWITCH
+\# ----------------------
+\# *Argument:
+\# <none> | <anything>
+\# *Function:
+\# Creates or removes register #TOC_RV_SWITCH
+\# *Notes:
+\# Allows switching of L/R margins if a doc is recto/verso and
+\# the first toc page happens to fall the wrong way
+\#
+.MAC TOC_RV_SWITCH END
+. ie '\\$1'' \{ .nr #TOC_RV_SWITCH 1 \}
+. el \{ .rr #TOC_RV_SWITCH \}
+.END
+\#
+\# - for TOC "doc header" (i.e. "Contents")
+\#
+\# TOC HEADER STRING
+\# -----------------
+\# *Argument:
+\# <string for "doc header" of first toc page>
+\# *Function:
+\# Creates or modifies string $TOC_HEADER_STRING
+\# *Notes:
+\# Default is "Contents".
+\#
+.MAC TOC_HEADER_STRING END
+. ds $TOC_HEADER_STRING \\$1
+.END
+\#
+\# - for TOC entries page number numerals
+\#
+\# Control macros for toc doc titles, heads, subheads and paraheads
+\# ----------------------------------------------------------------
+\#
+\# All these control macros behave the same way, setting the family,
+\# font, point size and indent from the left margin of the different
+\# kinds of entries that can appear in the toc. The way they
+\# operate is identical to all other _FAMILY, _FONT and _SIZE
+\# control macros. _INDENT takes an absolute value.
+\# TOC_APPENDS_AUTHORS is unique in this section.
+\#
+\# - for title entries
+\#
+.MAC TOC_TITLE_INDENT END
+. nr #TOC_TITLE_INDENT (\\$1)
+.END
+\#
+\#
+.MAC TOC_TITLE_ENTRY END
+. nr #USER_SET_TITLE_ITEM 1
+. ds $USER_SET_TITLE_ITEM \\$1
+.END
+\#
+\#
+\# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
+\# -----------------------------------------
+\# *Argument:
+\# <none> | <name(s) of author(s) as they should appear in toc doc title entries>
+\# *Function:
+\# Creates register #TOC_AUTHORS (to tell TOC to append authors
+\# to toc doc title entries). Optionally creates string
+\# $TOC_AUTHORS.
+\# *Notes:
+\# Normally, TOC does not append the author(s) to a toc doc title
+\# entry. This special macro instructs TOC to do so.
+\#
+\# If user has multiple authors for each doc when collating,
+\# TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
+\# COLLATE and START in each doc. Otherwise, mom prints only the
+\# first author given to AUTHOR.
+\#
+.MAC TOC_APPENDS_AUTHOR END
+. nr #TOC_AUTHORS 1
+. if !'\\$1'' \{\
+. ds $TOC_AUTHORS \\$1
+. \}
+.END
+\#
+\# - for head entries
+\#
+.MAC TOC_HEAD_INDENT END
+. nr #TOC_HEAD_INDENT (\\$1)
+.END
+\#
+\# - for subhead entries
+\#
+.MAC TOC_SUBHEAD_INDENT END
+. nr #TOC_SH_INDENT (\\$1)
+.END
+\#
+\# - for parahead entries
+\#
+.MAC TOC_PARAHEAD_INDENT END
+. nr #TOC_PH_INDENT (\\$1)
+.END
+\#
+\#
+.MAC TOC END
+. if \\n[#LINENUMBERS]=1 \{\
+. NUMBER_LINES OFF
+. nr #LINENUMBERS 2
+. \}
+. if !r#PAGINATE_TOC \{ .PAGINATE_TOC \}
+. nr #TOC_FIRST_PAGE 1
+. if \\n[#FINIS] \{\
+. if \\n[#FOOTERS_WERE_ON] \{\
+. FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
+. \}
+. \}
+. if \\n[#FOOTERS_ON]=1 \{\
+. if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
+. ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
+. el \{ .PAGINATION OFF \}
+. \}
+. if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS OFF \} \" But have to turn FOOTERS off again so they don't print when FINIS was called
+. COLLATE
+. if \\n[#FINIS] \{\
+. if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \} \" Finally, turn footers on if they were on
+. rr #FOOTERS_WERE_ON
+. if \\n[#PAGINATION_WAS_ON] \{\
+. nr #PAGINATE 1
+. rr #PAGINATION_WAS_ON
+. \}
+. rr #FINIS
+. \}
+. ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
+. el \{ .PAGINATION OFF \}
+. if \\n[#FOOTERS_ON]=1 \{\
+. ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
+. rm $HDRFTR_CENTER_OLD
+. rm $HDRFTR_CENTER_NEW
+. \}
+. rr #COLLATED_DOC
+. DOCHEADER OFF
+. PAGENUMBER 1
+. if \\n[#PRINT_STYLE]=1 \{\
+. rr #IGNORE
+. DOC_LEAD 24 ADJUST
+. nr #IGNORE 1
+. \}
+. if \\n[#LINENUMBERS]=2 \{ .nr #LINENUMBERS 3 \}
+. START
+. PP
+. nr #COLUMNS 0
+. if \\n[#PRINT_STYLE]=2 \{\
+. ie r#ADJ_TOC_LEAD \{\
+. nr #NO_TRAP_RESET 1
+. DOC_LEAD \\n[#TOC_LEAD]u ADJUST
+. rr #NO_TRAP_RESET
+. \}
+. el \{ .DOC_LEAD \\n[#TOC_LEAD]u \}
+. \}
+. sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
+. if \\n[#SLANT_ON] \{\
+\*[SLANTX]\c
+. \}
+. DOC_LINE_LENGTH \\n[#DOC_L_LENGTH]u
+. QUAD \\*[$TOC_HEADER_QUAD]
+. PAGENUM_STYLE \\*[$TOC_PN_STYLE]
+. if \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. FAMILY \\*[$TOC_HEADER_FAM]
+. FT \\*[$TOC_HEADER_FT]
+. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
+. \}
+. ie \\n[#PRINT_STYLE]=1 \{\
+. CAPS
+. UNDERLINE
+. PRINT "\\*[$TOC_HEADER_STRING]"
+. UNDERLINE OFF
+. CAPS OFF
+. \}
+. el \{\
+. PRINT "\\*[$TOC_HEADER_STRING]"
+. \}
+. LEFT
+. SP
+.\" In collated docs, this bit inserts the first doc's title
+.\" underneath the TOC header, before the TOC_ENTRIES diversion
+.\" gets output.
+. nf
+. if d$FIRST_DOC_TITLE \{\
+. nr #RESTORE_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
+. TOC_PADDING \\n[#FIRST_DOC_TOC_PN_PADDING]
+. if \\n[#PRINT_STYLE]=2 \{\
+. FAMILY \\*[$TOC_TITLE_FAM]
+. FT \\*[$TOC_TITLE_FT]
+. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
+. \}
+. ie \\n[#PRINT_STYLE]=1 \{\
+. PAD "\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN_TYPEWRITE]"
+. \}
+. el \{\
+. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN]"
+. \}
+. EOL
+. ST 100 L
+. ST 101 R
+. if \\n[#PRINT_STYLE]=2 \{\
+. FAMILY \\*[$TOC_PN_FAM]
+. FT \\*[$TOC_PN_FT]
+. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
+. \}
+. TAB 100
+. PRINT \\*[LEADER]
+. TN
+. PRINT \\n[#FIRST_DOC_TITLE_PN]
+. TQ
+. \}
+. TOC_PADDING \\n[#RESTORE_TOC_PN_PADDING]
+. nf
+. TOC_ENTRIES
+. br
+. rr #TOC
+. if \\n[#LINENUMBERS]=3 \{\
+. NUMBER_LINES RESUME
+. nr #LINENUMBERS 1
+. nn 1
+. \}
.END
\#
\# ====================================================================
@@ -9118,6 +13212,9 @@ y\\R'#DESCENDER \\n[.cdp]'
. while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
. nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
. nr #COL_TOTAL \\n+[#COL_TOTAL]
+.\}
+. if \\n[#NUM_COLS]=1 \{\
+. if !\\n[#COLLATE]=1 \{ .MN_INIT \}
. \}
. rr #COL_TOTAL
. rr #COL_NUM
@@ -9150,6 +13247,699 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\# ====================================================================
\#
+\# +++LISTS+++
+\#
+\# LIST
+\# ----
+\# *Arguments:
+\# [ BULLET | DASH | DIGIT | alpha | ALPHA | roman | ROMAN | USER ] [ <separator> | NONE ] [ <prefix> ] [ <anything> ]
+\# *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.
+\#
+\# <anything> moves back one list level intuitively, or exits lists
+\# completely if the level in which it's invoked is the first.
+\#
+.MAC LIST END
+. ds $1ST_LETTER \\$1
+. substring $1ST_LETTER 0 0
+. if '\\*[$1ST_LETTER]'r' .ds $1ST_LETTER R
+. ie '\\*[$1ST_LETTER]'R' \{\
+. ds $LAST_CHAR \\$1
+. substring $LAST_CHAR -1
+. if !\B'\\*[$LAST_CHAR]' \{\
+. tm1 "[mom]: You must append a number to the \\$1 argument to LIST at line \\n(.c.
+. tm1 " The number should be the total number of items in this list.
+. tm1 " See the documentation.
+. ab Aborting LIST
+. \}
+. ds $ROMAN_WIDTH \\$1
+. substring $ROMAN_WIDTH 1
+. while !\B'\\*[$ROMAN_WIDTH]' \{\
+. substring $ROMAN_WIDTH 1
+.\}
+. length #ROMAN_LENGTH \\*[$ROMAN_WIDTH]
+. ds $LIST_ARG_1 \\$1
+. substring $LIST_ARG_1 0 -(\\n[#ROMAN_LENGTH]+1)
+. \}
+. el \{\
+. ds $LIST_ARG_1 \\$1
+. \}
+. 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 $ENUMERATOR_TYPE\\n[#DEPTH] other
+. ds $SEPARATOR
+. \}
+. if \\n[#NUM_ARGS]>0 \{\
+. rr #ARGS_TO_LIST \" Clear this before processing arg 1.
+. if '\\*[$LIST_ARG_1]'DASH' \{\
+. nr #ARGS_TO_LIST 1
+. ds $ENUMERATOR\\n+[#DEPTH] \(en
+. ds $ENUMERATOR_TYPE\\n[#DEPTH] other
+. ds $SEPARATOR\\n[#DEPTH]
+. \}
+. if '\\*[$LIST_ARG_1]'BULLET' \{\
+. nr #ARGS_TO_LIST 1
+. ds $ENUMERATOR\\n+[#DEPTH] \(bu
+. ds $ENUMERATOR_TYPE\\n[#DEPTH] other
+. ds $SEPARATOR\\n[#DEPTH]
+. \}
+. if '\\*[$LIST_ARG_1]'DIGIT' \{\
+. nr #ARGS_TO_LIST 1
+. nr #ENUMERATOR\\n+[#DEPTH] 0 1
+. ds $ENUMERATOR_TYPE\\n[#DEPTH] register
+. ds $SEPARATOR\\n[#DEPTH] .
+. ds $PREFIX\\n[#DEPTH]
+. if \\n[#NUM_ARGS]>=2 \{\
+. ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
+. el .ds $SEPARATOR\\n[#DEPTH] \\$2
+. if \\n[#NUM_ARGS]=3 \{\
+. ds $PREFIX\\n[#DEPTH] \\$3
+. \}
+. \}
+. \}
+. if '\\*[$LIST_ARG_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] )
+. ds $PREFIX\\n[#DEPTH]
+. if \\n[#NUM_ARGS]>=2 \{\
+. ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
+. el .ds $SEPARATOR\\n[#DEPTH] \\$2
+. if \\n[#NUM_ARGS]=3 \{\
+. ds $PREFIX\\n[#DEPTH] \\$3
+. \}
+. \}
+. \}
+. if '\\*[$LIST_ARG_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] )
+. ds $PREFIX\\n[#DEPTH]
+. if \\n[#NUM_ARGS]>=2 \{\
+. ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
+. el .ds $SEPARATOR\\n[#DEPTH] \\$2
+. if \\n[#NUM_ARGS]=3 \{\
+. ds $PREFIX\\n[#DEPTH] \\$3
+. \}
+. \}
+. \}
+. if '\\*[$1ST_LETTER]'R' \{\
+. nr #ARGS_TO_LIST 1
+. nr #ENUMERATOR\\n+[#DEPTH] 0 1
+. if '\\*[$LIST_ARG_1]'roman' \{\
+. af #ENUMERATOR\\n[#DEPTH] i
+. \}
+. if '\\*[$LIST_ARG_1]'ROMAN' \{\
+. af #ENUMERATOR\\n[#DEPTH] I
+. \}
+. ds $ENUMERATOR_TYPE\\n[#DEPTH] roman
+. ds $SEPARATOR\\n[#DEPTH] )
+. ds $PREFIX\\n[#DEPTH]
+. if \\n[#NUM_ARGS]>=2 \{\
+. ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
+. el .ds $SEPARATOR\\n[#DEPTH] \\$2
+. if \\n[#NUM_ARGS]=3 \{\
+. ds $PREFIX\\n[#DEPTH] \\$3
+. \}
+. \}
+. \}
+. if '\\*[$LIST_ARG_1]'USER' \{\
+. nr #ARGS_TO_LIST 1
+. ds $ENUMERATOR\\n+[#DEPTH] \\$2
+. ds $ENUMERATOR_TYPE\\n[#DEPTH] other
+. ds $SEPARATOR\\n[#DEPTH]
+. ds $PREFIX\\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]
+. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]m\\*[$SEPARATOR\\n[#DEPTH]]\ '
+. if '\\*[$LIST_ARG_1]'ALPHA'\{\
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]M\\*[$SEPARATOR\\n[#DEPTH]]\ '
+. \}
+. \}
+. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
+. GET_ROMAN_INDENT
+. \}
+. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \{\
+. 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
+. if \\n[#LINENUMBERS]=1 \{\
+. NUMBER_LINES OFF
+. nr #LINENUMBERS 2
+. \}
+. if \\n[#KERN]=1 \{\
+. nr #KERN_WAS_ON 1
+. 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
+. if '\\*[$SEPARATOR\\n[#DEPTH]]')' \{ .nr #SEP_TYPE 1 \}
+. if '\\*[$SEPARATOR\\n[#DEPTH]]']' \{ .nr #SEP_TYPE 1 \}
+. if '\\*[$SEPARATOR\\n[#DEPTH]]'}' \{ .nr #SEP_TYPE 1 \}
+. ie \\n[#IN_BIB_LIST]=1 \{\
+. ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
+. ie \\n[#SEP_TYPE]=1 \{\
+. PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
+. \}
+. el \{\
+. PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+. el \{\
+. ie \\n[#SEP_TYPE]=1 \{\
+. PRINT \h'-\w'\0'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
+. \}
+. el \{\
+. PRINT \h'-\w'\0'u'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+. \}
+. el \{\
+. ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
+.\" DIGIT
+. ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
+. ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
+. ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
+. ie \\n[#SEP_TYPE]=1 \{\
+. PRINT \0\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
+. \}
+. el \{\
+. PRINT \0\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+. el \{\
+. ie \\n[#SEP_TYPE]=1 \{\
+. PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
+. \}
+. el \{\
+. PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+. \}
+. el \{\
+. ie \\n[#SEP_TYPE]=1 \{\
+. PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
+. \}
+. el \{\
+. PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+. \}
+. el \{\
+.\" ALPHA
+. ie '\\g[#ENUMERATOR\\n[#DEPTH]]'A' \{\
+. ie \\n[#SEP_TYPE]=1 \{\
+. PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
+. \}
+. el \{\
+. PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+.\" alpha
+. el \{\
+. PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+. \}
+. \}
+. el \{\
+. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
+. ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
+.\" ROMAN I, padded
+. ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
+. ie \\n[#SEP_TYPE]=1 \{\
+. PRINT "\h'\\n[#LIST_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\n[#SEPARATOR\\n[#DEPTH]]\ 'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
+. \}
+. el \{\
+. PRINT "\h'\\n[#LIST_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\n[#SEPARATOR\\n[#DEPTH]]\ 'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+.\" roman i, padded
+. el \{\
+. PRINT "\h'\\n[#LIST_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\n[#SEPARATOR\\n[#DEPTH]]\ 'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+.\" No pad
+. el \{\
+.\" ROMAN I, no pad
+. ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
+. ie \\n[#SEP_TYPE]=1 \{\
+. PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
+. \}
+. el \{\
+. PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+.\" roman i, no pad
+. el \{\
+. PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+. \}
+. if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \{\
+. PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+. \}
+. \}
+. rr #SEP_TYPE
+. EOL
+. if \\n[#REF]=1 \{\
+. IL +\\*[$REF_BIB_INDENT]
+. ti \\n[#L_INDENT]u-\\*[$REF_BIB_INDENT]
+. \}
+. TRAP
+. if \\n[#KERN_WAS_ON]=1 \{\
+. KERN
+. rr #KERN_WAS_ON
+. \}
+. if \\n[#LINENUMBERS]=2 \{\
+. NUMBER_LINES RESUME
+. nr #LINENUMBERS 1
+. \}
+.END
+\#
+\# A utility macro that determines the space to reserve for
+\# roman numeral enumerated lists. Limit is 20 roman numerals
+\# per list. If this isn't enough, the user can add to the
+\# macro.
+\#
+.MAC GET_ROMAN_INDENT END
+. if '\\*[$LIST_ARG_1]'roman' \{\
+. if '\\*[$ROMAN_WIDTH]'1' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 1
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]i\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'2' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 2
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]ii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'3' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 3
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'4' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 4
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'5' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 5
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'6' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 6
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'7' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 7
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]vii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'8' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 8
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'9' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 9
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'10' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 10
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'11' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 11
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'12' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 12
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'13' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 13
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'14' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 14
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'15' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 15
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'16' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 16
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'17' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 17
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xvii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'18' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 18
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'19' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 19
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'20' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 20
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. \}
+. if '\\*[$LIST_ARG_1]'ROMAN' \{\
+. if '\\*[$ROMAN_WIDTH]'1' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 1
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]I\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'2' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 2
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]II\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'3' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 3
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]III\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'4' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 4
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'5' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 5
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'6' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 6
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'7' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 7
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'8' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 8
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'9' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 9
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'10' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 10
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'11' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 11
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'12' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 12
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'13' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 13
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'14' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 14
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'15' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 15
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'16' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 16
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'17' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 17
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'18' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 18
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'19' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 19
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. if '\\*[$ROMAN_WIDTH]'20' \{\
+. ds $ROMAN_WIDTH\\n[#DEPTH] 20
+. nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
+. \}
+. \}
+.END
+\#
+\# SHIFT LIST
+\# ----------
+\# *Arguments:
+\# <amount by which to indent a list to the right>
+\# *Function:
+\# Adds the value of the arg to the current list's indent.
+\# *Notes:
+\# Requires a unit of measure.
+\#
+.MAC SHIFT_LIST END
+. ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
+. nr #SHIFT_LIST\\n[#DEPTH] (\\$1)
+. nr #LIST_INDENT\\n[#DEPTH] \\n(.i+\\n[#L_INDENT]+\\n[#SHIFT_LIST\\n[#DEPTH]]
+. nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]
+. \}
+. el \{\
+. 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 \}
+. \}
+. if '\\g[#ENUMERATOR\\n[#DEPTH]]'i' \{\
+. if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
+. \}
+. if '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
+. 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
+. ie '\\$1'' \{ .nr #ENUMERATOR\\n[#DEPTH] 0 1 \}
+. el \{ .nr #ENUMERATOR\\n[#DEPTH] \\$1-1 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
+. \}
+. nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]]
+. nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]]
+.END
+\#
+\# ====================================================================
+\#
\# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
\#
\# COLLATE
@@ -9178,15 +13968,207 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. IQ CLEAR
. TQ
+.\" Collect first doc's title for TOC
+. if \\n[#COLLATED_DOC]=0 \{\
+. ie \\n[#USER_SET_TITLE_ITEM] \{\
+. ds $FIRST_DOC_TITLE \\*[$USER_SET_TITLE_ITEM]\\|
+. rr #USER_SET_TITLE_ITEM
+. rm $USER_SET_TITLE_ITEM
+. \}
+. el \{\
+. ie \\n[#DOC_TYPE]=2 \{\
+. ie '\\*[$CHAPTER_TITLE]'' \{\
+. ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
+. \}
+. el \{\
+. ie '\\*[$CHAPTER]'' \{\
+. ds $FIRST_DOC_TITLE \\*[$CHAPTER_TITLE]\\|
+. \}
+. el \{\
+. ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
+. \}
+. \}
+. \}
+. el \{\
+. ds $FIRST_DOC_TITLE \\*[$TITLE]\\|
+. \}
+. \}
+. if \\n[#TOC_AUTHORS]=1 \{\
+. ie '\\*[$TOC_AUTHORS]'' \{\
+. as $FIRST_DOC_TITLE /\\|\\*[$AUTHOR_1]\\|
+. \}
+. el \{\
+. as $FIRST_DOC_TITLE /\\|\\*[$TOC_AUTHORS]\\|
+. rm $TOC_AUTHORS
+. \}
+. \}
+. nr #COLLATED_DOC 1
+. \}
+.\" End title collection for TOC
. LL \\n[#DOC_L_LENGTH]u
. QUAD $DOC_QUAD
+. nr #SAVED_DOC_LEAD \\n[#DOC_LEAD]
. LS \\n[#DOC_LEAD]u
\*[SLANTX]
\*[CONDX]
\*[EXTX]
' NEWPAGE
-. rr #PAGENUM_STYLE_SET
+. if \\n[#DEFER_PAGINATION] \{ .PAGINATE \}
+. if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
+. PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
+. rm $RESTORE_PAGENUM_STYLE
+. \}
. rm $EN_TITLE
+. rr #PAGENUM_STYLE_SET
+.END
+\#
+\#
+\# NUMBER_LINES
+\# ------------
+\# *Arguments:
+\# <starting line number> [ <increment> [ <gutter> ] ]
+\# or
+\# <anything> | RESUME
+\# *Function:
+\# Begin, suspend/turn off, or resume numbering of output lines.
+\#
+.MAC NUMBER_LINES END
+. br
+. if '\\n(.z'EPI_TEXT' \{ .return \}
+. if '\\$1'' \{\
+. tm1 "[mom]: NUMBER_LINES at line \\n(.c has no argument.
+. tm1 " Most likely, you have forgotten to give it a starting line number.
+. ab Aborting on NUMBER_LINES.
+. \}
+. if !\\n[#LINENUMBERS]=2 \{ .nr #LINENUMBERS 1 \}
+.\" Test whether the first arg is a digit.
+. if \B'\\$1' \{\
+. nr #LN \\$1
+. ds $LN_NUM \\$1
+. if !'\\n(.z'' \{ .nr #RESTORE_LN_NUM 1 \}
+. ie '\\$2'' \{\
+. if '\\*[$LN_INC]'' .ds $LN_INC 1
+. \}
+. el .ds $LN_INC \\$2
+. ie '\\$3'' \{\
+. if '\\*[$LN_GUTTER]'' .ds $LN_GUTTER 2
+. \}
+. el .ds $LN_GUTTER \\$3
+. \}
+. ie !\\n[#LN] \{\
+.\" In other words, the first arg was not a digit.
+. rr #LN
+. ie '\\$1'RESUME' \{\
+. nm +0
+. \}
+. el \{\
+. nm
+. if !\\n[#LINENUMBERS]=2 \{ .rr #LINENUMBERS \}
+. \}
+. \}
+. el \{\
+. nm \\*[$LN_NUM] \\*[$LN_INC] \\*[$LN_GUTTER] -3-\\*[$LN_GUTTER]
+. if !'\\n(.z'' \{ .nr #DIVER_LN_OFF 1 \}
+. \}
+. rr #LN
+.END
+\#
+\#
+\# NUMBER QUOTE AND BLOCKQUOTE LINES AS PART OF RUNNING TEXT
+\# ---------------------------------------------------------
+\# *Argument:
+\# <gutter> | <anything>
+\# *Function:
+\# Sets #(B)QUOTE_LN to 1 if no argument, or a single numeric
+\# argument, is given; otherwise, turns (BLOCK)QUOTE linenumbering
+\# off.
+\# *Notes:
+\# #(B)QUOTE is checked for in QUOTE and BLOCKQUOTE.
+\# The single numeric argument allows establishing a different gutter from
+\# the one used for line numbers in running text.
+\#
+.MAC NUMBER_QUOTE_LINES END
+. ie \\n[#NUM_ARGS]=0 \{ .nr #QUOTE_LN 1 \}
+. el \{\
+. ie \B'\\$1' \{\
+. nr #QUOTE_LN 1
+. ds $Q_LN_GUTTER \\$1
+. \}
+. el \{\
+. ie '\\$1'SILENT' \{ .nr #SILENT_QUOTE_LN 1 \}
+. el \{\
+. rr #QUOTE_LN
+. rr #SILENT_QUOTE_LN
+. \}
+. \}
+. \}
+.END
+\#
+\#
+.MAC NUMBER_BLOCKQUOTE_LINES END
+. ie \\n[#NUM_ARGS]=0 \{ .nr #BQUOTE_LN 1 \}
+. el \{\
+. ie \B'\\$1' \{\
+. nr #BQUOTE_LN 1
+. ds $BQ_LN_GUTTER \\$1
+. \}
+. el \{\
+. ie '\\$1'SILENT' \{ .nr #SILENT_BQUOTE_LN 1 \}
+. el \{\
+. rr #BQUOTE_LN
+. rr #SILENT_BQUOTE_LN
+. \}
+. \}
+. \}
+.END
+\#
+\# OUTPUT BLANK PAGES
+\# ------------------
+\# *Argument:
+\# <number of blank pages to output>
+\# *Function:
+\# Outputs blank pages.
+\# *Notes:
+\# If recto/verso, each page is recto/verso, even if there's
+\# nothing on it.
+\#
+\# The argument to BLANKPAGE is non-optional.
+\#
+.MAC BLANKPAGE END
+. nr #HOW_MANY \\$1
+. nr #PAGES 0 1
+. while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
+. if \\n[#HEADERS_ON]=1 \{\
+. nr #HEADERS_WERE_ON 1
+. HEADERS OFF
+. \}
+. if \\n[#PAGE_NUM_V_POS]=1 \{\
+. if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
+. PAGINATION OFF
+. \}
+. NEWPAGE
+. PRINT \&
+. if \\n[#FOOTERS_ON]=1 \{\
+. nr #FOOTERS_WERE_ON 1
+. FOOTERS OFF
+. \}
+. if \\n[#PAGE_NUM_V_POS]=2 \{\
+. if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
+. PAGINATION OFF
+. \}
+. if \\n[#HEADERS_WERE_ON] \{ .HEADERS \}
+. if \\n[#PAGE_NUM_V_POS]=1 \{\
+. if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
+. \}
+.\}
+. NEWPAGE
+. if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \}
+. if \\n[#PAGE_NUM_V_POS]=2 \{\
+. if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
+. \}
+. rr #HEADERS_WERE_ON
+. rr #FOOTERS_WERE_ON
+. rr #PAGINATE_WAS_ON
.END
\#
\#
@@ -9196,48 +14178,73 @@ y\\R'#DESCENDER \\n[.cdp]'
\# <none>
\# *Function:
\# Sets header/footer/footnotes/etc... traps.
-\# Calculates the number of lines that actually fit on a
+\#
+\# Calculates the number of lines that actually fit on a
\# page based on #B_MARGIN and resets page bottom trap to coincide
-\# with the depth of that number of lines , or, if #ADJ_DOC_LEAD=1,
+\# with the depth of that number of lines, or, if #ADJ_DOC_LEAD=1,
\# adjusts #DOC_LEAD so that the last line of text on a page falls
\# exactly on #B_MARGIN.
\#
.MAC TRAPS END
-\# *Remove all header/footer traps
+.\" Remove all header/footer traps
. if !\\n[#NO_TRAP_RESET] \{\
. ch DO_T_MARGIN
. ch DO_B_MARGIN
. ch HEADER
. ch FOOTER
-\# *Plant header trap
+. ch FN_OVERFLOW_TRAP
+.\" Plant header trap
. wh 0 HEADER
. \}
-\# *Adjust lead so last line of text falls on B_MARGIN,...
-. ie \\n[#ADJ_DOC_LEAD] \{\
+.\" Adjust lead so last line of text falls on B_MARGIN,...
+. ie \\n[#ADJ_DOC_LEAD]=1 \{\
. nr #LINES_PER_PAGE 0 1
. nr #DOC_LEAD_ADJ 0 1
-. nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
-. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
+. nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#ORIGINAL_B_MARGIN]-1v
+.\" Get the number of unadjusted lines that fit on the page; always a
+.\" bit short of the bottom margin
+. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
+.
+.\}
. nr #LINES_PER_PAGE -1
-. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
+.\" Add machine units, 1 at a time, increasing the leading until the
+.\" new leading fills the page properly
+. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
+.
+.\}
. DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
-. \}
-\# *...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
-\# *on the page.
+.\" The "visual" bottom margin is what \n(nl would report on the
+.\" last line before the FOOTER trap is sprung
+. nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD])
+.\" Get the difference between #B_MARGIN and #VISUAL_B_MARGIN
+. nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
+.\" Set #B_MARGIN to 1 machine unit lower on the page than #VISUAL_B_MARGIN
+. nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
+.\" Set the FN_OVERFLOW_TRAP position
+. nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
+. if \\n[#PRINT_STYLE]=1 .nr #FN_OVERFLOW_TRAP_POS \\n[#ORIGINAL_B_MARGIN]u
+. \}
+.\" ...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
+.\" on the page.
. el \{\
. nr #LINES_PER_PAGE 0 1
. nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
-. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
-. nr #B_MARGIN \\n[#PAGE_LENGTH]-(\\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n[#LINES_PER_PAGE]))
+. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
+.
+.\}
+. nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD]-1v)
+. nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
+. nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
+. nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
. \}
-\# *Set footer and footnote overflow traps
+.\" Set footer and footnote overflow traps
. if !\\n[#NO_TRAP_RESET] \{\
. nr #FN_COUNT 0 1
. nr #SPACE_REMAINING 0
. nr #FN_DEPTH 0
. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
-. wh 12i FOOTER
-. wh -\\n[#B_MARGIN]u FN_OVERFLOW_TRAP
+. wh 20i FOOTER
+. wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
. ch FOOTER -\\n[#B_MARGIN]u
. \}
.END
@@ -9278,7 +14285,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
. ll -\\n[#BR_INDENT]u
. ta \\n(.lu
-. \}
+. \}
. el \{\
. ll -(\\n[#BR_INDENT]u/2u)
. ta \\n(.lu
@@ -9314,7 +14321,66 @@ y\\R'#DESCENDER \\n[.cdp]'
.END
\#
\#
+\# This .em (for all DOC_TYPEs except 4 [LETTER]) ensures that
+\# deferred footnotes that happen on the 2nd to last page get
+\# output.
\#
+.MAC TERMINATE END
+. ie \\n[#FN_DEPTH] \{\
+. ie \\n[#FN_DEFER] \{\
+. br
+. nr #TERMINATE 1
+. FOOTNOTE
+. nf
+. FOOTNOTE OFF
+. \}
+. el \{\
+. br
+. ch FN_OVERFLOW_TRAP
+. DO_B_MARGIN
+. \}
+. \}
+. el \{\
+. br
+. ch FN_OVERFLOW_TRAP
+. DO_B_MARGIN
+. \}
+.END
+\#
+\# END MACRO FOR LETTERS
+\# ---------------------
+\# *Arguments:
+\# none
+\# *Function:
+\# The .em macro executed at the end of letters. Turns footers
+\# and pagination off, terminates and outputs diversion CLOSING
+\# (indented with the author's name underneath).
+\#
+.MAC ALL_DONE END
+. br
+. FOOTERS OFF
+. PAGINATION OFF
+. if \\n[#DOC_TYPE]=4 \{\
+. br
+. if !'\\n(.z'' \{ .di \}
+. IQ CLEAR
+. TQ
+. TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
+. ALD \\n[#DOC_LEAD]u*2u
+. TAB 1
+. if \\n[#CLOSING] \{\
+. nf
+. CLOSING
+. \}
+. ALD \\n[#DOC_LEAD]u*3u
+. PRINT \\*[$AUTHOR_1]
+. \}
+. DO_FOOTER
+.END
+\#
+\# Set up a default papersize of US letter
+\#
+.PAPER LETTER
\#
\# ====================================================================
\#
@@ -9323,115 +14389,1501 @@ y\\R'#DESCENDER \\n[.cdp]'
\# Aliases to make life easier for users: synonyms, short forms
\# and alternate spellings.
\#
-\# Macros
-\# ------
-.ALIAS BREAK_BLOCKQUOTE BREAK_QUOTE
-.ALIAS BREAK_CITATION BREAK_QUOTE
-.ALIAS BREAK_CITE BREAK_QUOTE
-.ALIAS CITATION BLOCKQUOTE
-.ALIAS CITE BLOCKQUOTE
-.ALIAS DOC_R_MARGIN DOC_RIGHT_MARGIN
-.ALIAS DOC_L_MARGIN DOC_LEFT_MARGIN
-.ALIAS DOC_L_LENGTH DOC_LINE_LENGTH
-.ALIAS DOC_RMARGIN DOC_RIGHT_MARGIN
-.ALIAS DOC_LMARGIN DOC_LEFT_MARGIN
-.ALIAS DOC_LLENGTH DOC_LINE_LENGTH
-.ALIAS DOC_FAM DOC_FAMILY
-.ALIAS FILL QUAD
-.ALIAS PP_FT PP_FONT
-.ALIAS DOC_PS DOC_PT_SIZE
-.ALIAS DOC_LS DOC_LEAD
-.ALIAS PAGENUM PAGENUMBER
-.ALIAS PAGINATION PAGINATE
+.ALIAS BREAK_BLOCKQUOTE BREAK_QUOTE
+.ALIAS BREAK_CITATION BREAK_QUOTE
+.ALIAS BREAK_CITE BREAK_QUOTE
+.ALIAS BLOCKQUOTE_INDENT QUOTE_INDENT
+.ALIAS CITATION BLOCKQUOTE
+.ALIAS CITATION_FAMILY BLOCKQUOTE_FAMILY
+.ALIAS CITATION_FONT BLOCKQUOTE_FONT
+.ALIAS CITATION_SIZE BLOCKQUOTE_SIZE
+.ALIAS CITATION_COLOR BLOCKQUOTE_COLOR
+.ALIAS CITATION_QUAD BLOCKQUOTE_QUAD
+.ALIAS CITE BLOCKQUOTE
+.ALIAS CITE_FAMILY BLOCKQUOTE_FAMILY
+.ALIAS CITE_FONT BLOCKQUOTE_FONT
+.ALIAS CITE_SIZE BLOCKQUOTE_SIZE
+.ALIAS CITE_COLOR BLOCKQUOTE_COLOR
+.ALIAS CITE_QUAD BLOCKQUOTE_QUAD
+.ALIAS DOC_R_MARGIN DOC_RIGHT_MARGIN
+.ALIAS DOC_L_MARGIN DOC_LEFT_MARGIN
+.ALIAS DOC_L_LENGTH DOC_LINE_LENGTH
+.ALIAS DOC_RMARGIN DOC_RIGHT_MARGIN
+.ALIAS DOC_LMARGIN DOC_LEFT_MARGIN
+.ALIAS DOC_LLENGTH DOC_LINE_LENGTH
+.ALIAS DOC_FAM DOC_FAMILY
+.ALIAS DOC_LS DOC_LEAD
+.ALIAS DOC_PS DOC_PT_SIZE
+.ALIAS FILL QUAD
+.ALIAS PAGENUM PAGENUMBER
+.ALIAS PAGINATION PAGINATE
+.ALIAS PP_FT PP_FONT
+.ALIAS REF_INDENT INDENT_REFS
+.ALIAS TOC_PS TOC_PT_SIZE
+\#
+\# HEADER and FOOTER macros
+\# ------------------------
+\# Because the type-style of headers and footers are managed
+\# identically, and the type-style macros (_<type parameter>) all
+\# require the correct name of the calling macro, it's necessary
+\# to create HEADER_ and FOOTER_ macros here. They're basically
+\# "aliases" of HDRFTR_, but required because you can't alias an
+\# alias.
+\#
+.MAC FOOTER_CENTER_COLOR END
+. HDRFTR_CENTER_COLOR \\$1
+.END
+\#
+.MAC FOOTER_CENTER_COLOUR END
+. HDRFTR_CENTER_COLOR \\$1
+.END
+\#
+.MAC FOOTER_CENTER_FAM END
+. HDRFTR_CENTER_FAMILY \\$1
+.END
+\#
+.MAC FOOTER_CENTER_FAMILY END
+. HDRFTR_CENTER_FAMILY \\$1
+.END
+\#
+.MAC FOOTER_CENTER_FONT END
+. HDRFTR_CENTER_FONT \\$1
+.END
+\#
+.MAC FOOTER_CENTER_FT END
+. HDRFTR_CENTER_FONT \\$1
+.END
+\#
+.MAC FOOTER_CENTER_PS END
+. HDRFTR_CENTER_SIZE \\$1
+.END
+\#
+.MAC FOOTER_CENTER_SIZE END
+. HDRFTR_CENTER_SIZE \\$1
+.END
+\#
+.MAC FOOTER_CENTRE_CAPS END
+. HDRFTR_CENTER_CAPS \\$1
+.END
+\#
+.MAC FOOTER_CENTRE_COLOR END
+. HDRFTR_CENTRE_COLOR \\$1
+.END
+\#
+.MAC FOOTER_CENTRE_COLOUR END
+. HDRFTR_CENTRE_COLOR \\$1
+.END
+\#
+.MAC FOOTER_CENTRE_FAM END
+. HDRFTR_CENTER_FAMILY \\$1
+.END
+\#
+.MAC FOOTER_CENTRE_FAMILY END
+. HDRFTR_CENTER_FAMILY \\$1
+.END
+\#
+.MAC FOOTER_CENTRE_FONT END
+. HDRFTR_CENTER_FONT \\$1
+.END
+\#
+.MAC FOOTER_CENTRE_FT END
+. HDRFTR_CENTER_FONT \\$1
+.END
+\#
+.MAC FOOTER_CENTRE_PS END
+. HDRFTR_CENTER_SIZE \\$1
+.END
+\#
+.MAC FOOTER_CENTRE_SIZE END
+. HDRFTR_CENTER_SIZE \\$1
+.END
+\#
+.MAC FOOTER_COLOR END
+. HDRFTR_COLOR \\$1
+.END
+\#
+.MAC FOOTER_COLOUR END
+. HDRFTR_COLOR \\$1
+.END
+\#
+.MAC FOOTER_FAM END
+. HDRFTR_FAMILY \\$1
+.END
+\#
+.MAC FOOTER_FAMILY END
+. HDRFTR_FAMILY \\$1
+.END
+\#
+.MAC FOOTER_LEFT_COLOR END
+. HDRFTR_LEFT_COLOR \\$1
+.END
+\#
+.MAC FOOTER_LEFT_COLOUR END
+. HDRFTR_LEFT_COLOR \\$1
+.END
+\#
+.MAC FOOTER_LEFT_FAM END
+. HDRFTR_LEFT_FAMILY \\$1
+.END
+\#
+.MAC FOOTER_LEFT_FAMILY END
+. HDRFTR_LEFT_FAMILY \\$1
+.END
+\#
+.MAC FOOTER_LEFT_FONT END
+. HDRFTR_LEFT_FONT \\$1
+.END
+\#
+.MAC FOOTER_LEFT_FT END
+. HDRFTR_LEFT_FONT \\$1
+.END
+\#
+.MAC FOOTER_LEFT_PS END
+. HDRFTR_LEFT_SIZE \\$1
+.END
+\#
+.MAC FOOTER_LEFT_SIZE END
+. HDRFTR_LEFT_SIZE \\$1
+.END
+\#
+.MAC FOOTER_RIGHT_COLOR END
+. HDRFTR_RIGHT_COLOR \\$1
+.END
+\#
+.MAC FOOTER_RIGHT_COLOUR END
+. HDRFTR_RIGHT_COLOR \\$1
+.END
+\#
+.MAC FOOTER_RIGHT_FAM END
+. HDRFTR_RIGHT_FAMILY \\$1
+.END
+\#
+.MAC FOOTER_RIGHT_FAMILY END
+. HDRFTR_RIGHT_FAMILY \\$1
+.END
+\#
+.MAC FOOTER_RIGHT_FONT END
+. HDRFTR_RIGHT_FONT \\$1
+.END
+\#
+.MAC FOOTER_RIGHT_FT END
+. HDRFTR_RIGHT_FONT \\$1
+.END
+\#
+.MAC FOOTER_RIGHT_PS END
+. HDRFTR_RIGHT_SIZE \\$1
+.END
+\#
+.MAC FOOTER_RIGHT_SIZE END
+. HDRFTR_RIGHT_SIZE \\$1
+.END
+\#
+.MAC FOOTER_RULE_COLOR END
+. HDRFTR_RULE_COLOR \\$1
+.END
+\#
+.MAC FOOTER_SIZE END
+. HDRFTR_SIZE \\$1
+.END
+\#
+.MAC HEADER_CENTER_COLOR END
+. HDRFTR_CENTER_COLOR \\$1
+.END
+\#
+.MAC HEADER_CENTER_COLOUR END
+. HDRFTR_CENTER_COLOR \\$1
+.END
+\#
+.MAC HEADER_CENTER_FAM END
+. HDRFTR_CENTER_FAMILY \\$1
+.END
+\#
+.MAC HEADER_CENTER_FAMILY END
+. HDRFTR_CENTER_FAMILY \\$1
+.END
+\#
+.MAC HEADER_CENTER_FONT END
+. HDRFTR_CENTER_FONT \\$1
+.END
+\#
+.MAC HEADER_CENTER_FT END
+. HDRFTR_CENTER_FONT \\$1
+.END
+\#
+.MAC HEADER_CENTER_PS END
+. HDRFTR_CENTER_SIZE \\$1
+.END
+\#
+.MAC HEADER_CENTER_SIZE END
+. HDRFTR_CENTER_SIZE \\$1
+.END
+\#
+.MAC HEADER_CENTRE_COLOR END
+. HDRFTR_CENTRE_COLOR \\$1
+.END
+\#
+.MAC HEADER_CENTRE_COLOUR END
+. HDRFTR_CENTRE_COLOR \\$1
+.END
+\#
+.MAC HEADER_CENTRE_FAM END
+. HDRFTR_CENTER_FAMILY \\$1
+.END
+\#
+.MAC HEADER_CENTRE_FAMILY END
+. HDRFTR_CENTER_FAMILY \\$1
+.END
+\#
+.MAC HEADER_CENTRE_FONT END
+. HDRFTR_CENTER_FONT \\$1
+.END
+\#
+.MAC HEADER_CENTRE_FT END
+. HDRFTR_CENTER_FONT \\$1
+.END
+\#
+.MAC HEADER_CENTRE_PS END
+. HDRFTR_CENTER_SIZE \\$1
+.END
+\#
+.MAC HEADER_CENTRE_SIZE END
+. HDRFTR_CENTER_SIZE \\$1
+.END
+\#
+.MAC HEADER_COLOR END
+. HDRFTR_COLOR \\$1
+.END
+\#
+.MAC HEADER_COLOUR END
+. HDRFTR_COLOR \\$1
+.END
+\#
+.MAC HEADER_FAM END
+. HDRFTR_FAMILY \\$1
+.END
+\#
+.MAC HEADER_FAMILY END
+. HDRFTR_FAMILY \\$1
+.END
+\#
+.MAC HEADER_LEFT_COLOR END
+. HDRFTR_LEFT_COLOR \\$1
+.END
+\#
+.MAC HEADER_LEFT_COLOUR END
+. HDRFTR_LEFT_COLOR \\$1
+.END
+\#
+.MAC HEADER_LEFT_FAM END
+. HDRFTR_LEFT_FAMILY \\$1
+.END
+\#
+.MAC HEADER_LEFT_FAMILY END
+. HDRFTR_LEFT_FAMILY \\$1
+.END
+\#
+.MAC HEADER_LEFT_FONT END
+. HDRFTR_LEFT_FONT \\$1
+.END
+\#
+.MAC HEADER_LEFT_FT END
+. HDRFTR_LEFT_FONT \\$1
+.END
+\#
+.MAC HEADER_LEFT_PS END
+. HDRFTR_LEFT_SIZE \\$1
+.END
+\#
+.MAC HEADER_LEFT_SIZE END
+. HDRFTR_LEFT_SIZE \\$1
+.END
+\#
+.MAC HEADER_RIGHT_COLOR END
+. HDRFTR_RIGHT_COLOR \\$1
+.END
+\#
+.MAC HEADER_RIGHT_COLOUR END
+. HDRFTR_RIGHT_COLOR \\$1
+.END
+\#
+.MAC HEADER_RIGHT_FAM END
+. HDRFTR_RIGHT_FAMILY \\$1
+.END
+\#
+.MAC HEADER_RIGHT_FAMILY END
+. HDRFTR_RIGHT_FAMILY \\$1
+.END
+\#
+.MAC HEADER_RIGHT_FONT END
+. HDRFTR_RIGHT_FONT \\$1
+.END
+\#
+.MAC HEADER_RIGHT_FT END
+. HDRFTR_RIGHT_FONT \\$1
+.END
+\#
+.MAC HEADER_RIGHT_PS END
+. HDRFTR_RIGHT_SIZE \\$1
+.END
+\#
+.MAC HEADER_RIGHT_SIZE END
+. HDRFTR_RIGHT_SIZE \\$1
+.END
+\#
+.MAC HEADER_RULE_COLOR END
+. HDRFTR_RULE_COLOR \\$1
+.END
+\#
+.MAC HEADER_SIZE END
+. HDRFTR_SIZE \\$1
+.END
\#
\# HEADER and FOOTER aliases for HDRFTR macros.
\#
-.ALIAS ENDNOTES_HEADER_CENTER ENDNOTES_HDRFTR_CENTER
-.ALIAS HEADER_FAMILY HDRFTR_FAMILY
-.ALIAS HEADER_FAM HDRFTR_FAMILY
-.ALIAS HEADER_SIZE HDRFTR_SIZE
-.ALIAS HEADER_PLAIN HDRFTR_PLAIN
-.ALIAS HEADER_RULE_GAP HDRFTR_RULE_GAP
-.ALIAS HEADER_RULE HDRFTR_RULE
-.ALIAS HEADER_LEFT HDRFTR_LEFT
-.ALIAS HEADER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
-.ALIAS HEADER_LEFT_FAM HDRFTR_LEFT_FAMILY
-.ALIAS HEADER_LEFT_FONT HDRFTR_LEFT_FONT
-.ALIAS HEADER_LEFT_FT HDRFTR_LEFT_FONT
-.ALIAS HEADER_LEFT_SIZE HDRFTR_LEFT_SIZE
-.ALIAS HEADER_LEFT_PS HDRFTR_LEFT_SIZE
-.ALIAS HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS
-.ALIAS HEADER_CENTER HDRFTR_CENTER
-.ALIAS HEADER_CENTRE HDRFTR_CENTER
-.ALIAS HEADER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
-.ALIAS HEADER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
-.ALIAS HEADER_CENTER_FAM HDRFTR_CENTER_FAMILY
-.ALIAS HEADER_CENTRE_FAM HDRFTR_CENTER_FAMILY
-.ALIAS HEADER_CENTER_FONT HDRFTR_CENTER_FONT
-.ALIAS HEADER_CENTRE_FONT HDRFTR_CENTER_FONT
-.ALIAS HEADER_CENTER_FT HDRFTR_CENTER_FONT
-.ALIAS HEADER_CENTRE_FT HDRFTR_CENTER_FONT
-.ALIAS HEADER_CENTER_SIZE HDRFTR_CENTER_SIZE
-.ALIAS HEADER_CENTRE_SIZE HDRFTR_CENTER_SIZE
-.ALIAS HEADER_CENTER_PS HDRFTR_CENTER_SIZE
-.ALIAS HEADER_CENTRE_PS HDRFTR_CENTER_SIZE
-.ALIAS HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS
-.ALIAS HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS
-.ALIAS HEADER_RIGHT HDRFTR_RIGHT
-.ALIAS HEADER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
-.ALIAS HEADER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
-.ALIAS HEADER_RIGHT_FONT HDRFTR_RIGHT_FONT
-.ALIAS HEADER_RIGHT_FT HDRFTR_RIGHT_FONT
-.ALIAS HEADER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
-.ALIAS HEADER_RIGHT_PS HDRFTR_RIGHT_SIZE
-.ALIAS HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
-.ALIAS HEADER_RECTO HDRFTR_RECTO
-.ALIAS HEADER_VERSO HDRFTR_VERSO
-.ALIAS ENDNOTES_FOOTER_CENTER ENDNOTES_HDRFTR_CENTER
-.ALIAS FOOTER_FAMILY HDRFTR_FAMILY
-.ALIAS FOOTER_FAM HDRFTR_FAMILY
-.ALIAS FOOTER_SIZE HDRFTR_SIZE
-.ALIAS FOOTER_PLAIN HDRFTR_PLAIN
-.ALIAS FOOTER_RULE_GAP HDRFTR_RULE_GAP
-.ALIAS FOOTER_RULE HDRFTR_RULE
-.ALIAS FOOTER_LEFT HDRFTR_LEFT
-.ALIAS FOOTER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
-.ALIAS FOOTER_LEFT_FAM HDRFTR_LEFT_FAMILY
-.ALIAS FOOTER_LEFT_FONT HDRFTR_LEFT_FONT
-.ALIAS FOOTER_LEFT_FT HDRFTR_LEFT_FONT
-.ALIAS FOOTER_LEFT_SIZE HDRFTR_LEFT_SIZE
-.ALIAS FOOTER_LEFT_PS HDRFTR_LEFT_SIZE
-.ALIAS FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS
-.ALIAS FOOTER_CENTER HDRFTR_CENTER
-.ALIAS FOOTER_CENTRE HDRFTR_CENTER
-.ALIAS FOOTER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
-.ALIAS FOOTER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
-.ALIAS FOOTER_CENTER_FAM HDRFTR_CENTER_FAMILY
-.ALIAS FOOTER_CENTRE_FAM HDRFTR_CENTER_FAMILY
-.ALIAS FOOTER_CENTER_FONT HDRFTR_CENTER_FONT
-.ALIAS FOOTER_CENTRE_FONT HDRFTR_CENTER_FONT
-.ALIAS FOOTER_CENTER_FT HDRFTR_CENTER_FONT
-.ALIAS FOOTER_CENTRE_FT HDRFTR_CENTER_FONT
-.ALIAS FOOTER_CENTER_SIZE HDRFTR_CENTER_SIZE
-.ALIAS FOOTER_CENTRE_SIZE HDRFTR_CENTER_SIZE
-.ALIAS FOOTER_CENTER_PS HDRFTR_CENTER_SIZE
-.ALIAS FOOTER_CENTRE_PS HDRFTR_CENTER_SIZE
-.ALIAS FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS
-.ALIAS FOOTER_CENTRE_CAPS HDRFTR_CENTER_CAPS
-.ALIAS FOOTER_RIGHT HDRFTR_RIGHT
-.ALIAS FOOTER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
-.ALIAS FOOTER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
-.ALIAS FOOTER_RIGHT_FONT HDRFTR_RIGHT_FONT
-.ALIAS FOOTER_RIGHT_FT HDRFTR_RIGHT_FONT
-.ALIAS FOOTER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
-.ALIAS FOOTER_RIGHT_PS HDRFTR_RIGHT_SIZE
-.ALIAS FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
-.ALIAS FOOTER_RECTO HDRFTR_RECTO
-.ALIAS FOOTER_VERSO HDRFTR_VERSO
-.ALIAS SWITCH_HEADERS SWITCH_HDRFTR
-.ALIAS SWITCH_FOOTERS SWITCH_HDRFTR
-\#
-\# SUPPORT ALIASES
-\#
-.ALIAS COL_BREAK COL_NEXT
-.ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE
+.ALIAS BIBLIOGRAPHY_FOOTER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
+.ALIAS BIBLIOGRAPHY_FOOTER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
+.ALIAS BIBLIOGRAPHY_HEADER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
+.ALIAS BIBLIOGRAPHY_HEADER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
+.ALIAS ENDNOTES_FOOTER_CENTER ENDNOTES_HDRFTR_CENTER
+.ALIAS ENDNOTES_FOOTER_CENTRE ENDNOTES_HDRFTR_CENTRE
+.ALIAS ENDNOTES_HEADER_CENTER ENDNOTES_HDRFTR_CENTER
+.ALIAS ENDNOTES_HEADER_CENTRE ENDNOTES_HDRFTR_CENTRE
+.ALIAS FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS
+.ALIAS FOOTER_CENTER HDRFTR_CENTER
+.ALIAS FOOTER_CENTER_PAD HDRFTR_CENTER_PAD
+.ALIAS FOOTER_CENTRE HDRFTR_CENTER
+.ALIAS FOOTER_CENTRE_PAD HDRFTR_CENTER_PAD
+.ALIAS FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS
+.ALIAS FOOTER_LEFT HDRFTR_LEFT
+.ALIAS FOOTER_PLAIN HDRFTR_PLAIN
+.ALIAS FOOTER_RECTO HDRFTR_RECTO
+.ALIAS FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
+.ALIAS FOOTER_RIGHT HDRFTR_RIGHT
+.ALIAS FOOTER_RULE_GAP HDRFTR_RULE_GAP
+.ALIAS FOOTER_RULE HDRFTR_RULE
+.ALIAS FOOTER_VERSO HDRFTR_VERSO
+.ALIAS HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS
+.ALIAS HEADER_CENTER HDRFTR_CENTER
+.ALIAS HEADER_CENTER_PAD HDRFTR_CENTER_PAD
+.ALIAS HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS
+.ALIAS HEADER_CENTRE HDRFTR_CENTER
+.ALIAS HEADER_CENTRE_PAD HDRFTR_CENTER_PAD
+.ALIAS HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS
+.ALIAS HEADER_LEFT HDRFTR_LEFT
+.ALIAS HEADER_PLAIN HDRFTR_PLAIN
+.ALIAS HEADER_RECTO HDRFTR_RECTO
+.ALIAS HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
+.ALIAS HEADER_RIGHT HDRFTR_RIGHT
+.ALIAS HEADER_RULE_GAP HDRFTR_RULE_GAP
+.ALIAS HEADER_RULE HDRFTR_RULE
+.ALIAS HEADER_VERSO HDRFTR_VERSO
+.ALIAS SWITCH_FOOTERS SWITCH_HDRFTR
+.ALIAS SWITCH_HEADERS SWITCH_HDRFTR
+\#
+\# Type-style aliases
+\#
+.ALIAS AUTHOR_FAMILY _FAMILY
+.ALIAS BIBLIOGRAPHY_FAMILY _FAMILY
+.ALIAS BIBLIOGRAPHY_STRING_FAMILY _FAMILY
+.ALIAS BLOCKQUOTE_FAMILY _FAMILY
+.ALIAS CHAPTER_TITLE_FAMILY _FAMILY
+.ALIAS COVER_AUTHOR_FAMILY _FAMILY
+.ALIAS COVER_CHAPTER_TITLE_FAMILY _FAMILY
+.ALIAS COVER_COPYRIGHT_FAMILY _FAMILY
+.ALIAS COVER_DOCTYPE_FAMILY _FAMILY
+.ALIAS COVER_FAMILY _FAMILY
+.ALIAS COVER_SUBTITLE_FAMILY _FAMILY
+.ALIAS COVER_TITLE_FAMILY _FAMILY
+.ALIAS DOC_COVER_AUTHOR_FAMILY _FAMILY
+.ALIAS DOC_COVER_CHAPTER_TITLE_FAMILY _FAMILY
+.ALIAS DOC_COVER_COPYRIGHT_FAMILY _FAMILY
+.ALIAS DOC_COVER_DOCTYPE_FAMILY _FAMILY
+.ALIAS DOC_COVER_FAMILY _FAMILY
+.ALIAS DOC_COVER_SUBTITLE_FAMILY _FAMILY
+.ALIAS DOC_COVER_TITLE_FAMILY _FAMILY
+.ALIAS DOCHEADER_FAMILY _FAMILY
+.ALIAS DOCTYPE_FAMILY _FAMILY
+.ALIAS ENDNOTE_FAMILY _FAMILY
+.ALIAS ENDNOTE_NUMBER_FAMILY _FAMILY
+.ALIAS ENDNOTE_LINENUMBER_FAMILY _FAMILY
+.ALIAS ENDNOTE_STRING_FAMILY _FAMILY
+.ALIAS ENDNOTE_TITLE_FAMILY _FAMILY
+.ALIAS EPIGRAPH_FAMILY _FAMILY
+.ALIAS FOOTNOTE_FAMILY _FAMILY
+.ALIAS HDRFTR_CENTER_FAMILY _FAMILY
+.ALIAS HDRFTR_FAMILY _FAMILY
+.ALIAS HDRFTR_LEFT_FAMILY _FAMILY
+.ALIAS HDRFTR_RIGHT_FAMILY _FAMILY
+.ALIAS HEAD_FAMILY _FAMILY
+.ALIAS PAGENUM_FAMILY _FAMILY
+.ALIAS PARAHEAD_FAMILY _FAMILY
+.ALIAS QUOTE_FAMILY _FAMILY
+.ALIAS SUBHEAD_FAMILY _FAMILY
+.ALIAS SUBTITLE_FAMILY _FAMILY
+.ALIAS TITLE_FAMILY _FAMILY
+.ALIAS TOC_FAM _FAMILY
+.ALIAS TOC_FAMILY _FAMILY
+.ALIAS TOC_HEADER_FAMILY _FAMILY
+.ALIAS TOC_HEAD_FAMILY _FAMILY
+.ALIAS TOC_PARAHEAD_FAMILY _FAMILY
+.ALIAS TOC_PN_FAMILY _FAMILY
+.ALIAS TOC_SUBHEAD_FAMILY _FAMILY
+.ALIAS TOC_TITLE_FAMILY _FAMILY
+\#
+.ALIAS AUTHOR_FONT _FONT
+.ALIAS BIBLIOGRAPHY_STRING_FONT _FONT
+.ALIAS BIBLIOGRAPHY_FONT _FONT
+.ALIAS BLOCKQUOTE_FONT _FONT
+.ALIAS CHAPTER_TITLE_FONT _FONT
+.ALIAS COVER_AUTHOR_FONT _FONT
+.ALIAS COVER_CHAPTER_TITLE_FONT _FONT
+.ALIAS COVER_COPYRIGHT_FONT _FONT
+.ALIAS COVER_DOCTYPE_FONT _FONT
+.ALIAS COVER_SUBTITLE_FONT _FONT
+.ALIAS COVER_TITLE_FONT _FONT
+.ALIAS DOC_COVER_AUTHOR_FONT _FONT
+.ALIAS DOC_COVER_CHAPTER_TITLE_FONT _FONT
+.ALIAS DOC_COVER_COPYRIGHT_FONT _FONT
+.ALIAS DOC_COVER_DOCTYPE_FONT _FONT
+.ALIAS DOC_COVER_SUBTITLE_FONT _FONT
+.ALIAS DOC_COVER_TITLE_FONT _FONT
+.ALIAS DOCTYPE_FONT _FONT
+.ALIAS ENDNOTE_FONT _FONT
+.ALIAS ENDNOTE_NUMBER_FONT _FONT
+.ALIAS ENDNOTE_LINENUMBER_FONT _FONT
+.ALIAS ENDNOTE_STRING_FONT _FONT
+.ALIAS ENDNOTE_TITLE_FONT _FONT
+.ALIAS EPIGRAPH_FONT _FONT
+.ALIAS FOOTNOTE_FONT _FONT
+.ALIAS HDRFTR_CENTER_FONT _FONT
+.ALIAS HDRFTR_LEFT_FONT _FONT
+.ALIAS HDRFTR_RIGHT_FONT _FONT
+.ALIAS HEAD_FONT _FONT
+.ALIAS PAGENUM_FONT _FONT
+.ALIAS PARAHEAD_FONT _FONT
+.ALIAS QUOTE_FONT _FONT
+.ALIAS SUBHEAD_FONT _FONT
+.ALIAS SUBTITLE_FONT _FONT
+.ALIAS TITLE_FONT _FONT
+.ALIAS TOC_HEADER_FONT _FONT
+.ALIAS TOC_HEAD_FONT _FONT
+.ALIAS TOC_PARAHEAD_FONT _FONT
+.ALIAS TOC_PN_FONT _FONT
+.ALIAS TOC_SUBHEAD_FONT _FONT
+.ALIAS TOC_TITLE_FONT _FONT
+\#
+.ALIAS AUTHOR_SIZE _SIZE
+.ALIAS BIBLIOGRAPHY_STRING_SIZE _SIZE
+.ALIAS BLOCKQUOTE_SIZE _SIZE
+.ALIAS CHAPTER_TITLE_SIZE _SIZE
+.ALIAS COVER_AUTHOR_SIZE _SIZE
+.ALIAS COVER_CHAPTER_TITLE_SIZE _SIZE
+.ALIAS COVER_COPYRIGHT_SIZE _SIZE
+.ALIAS COVER_DOCTYPE_SIZE _SIZE
+.ALIAS COVER_SUBTITLE_SIZE _SIZE
+.ALIAS COVER_TITLE_SIZE _SIZE
+.ALIAS DOC_COVER_AUTHOR_SIZE _SIZE
+.ALIAS DOC_COVER_CHAPTER_TITLE_SIZE _SIZE
+.ALIAS DOC_COVER_COPYRIGHT_SIZE _SIZE
+.ALIAS DOC_COVER_DOCTYPE_SIZE _SIZE
+.ALIAS DOC_COVER_SUBTITLE_SIZE _SIZE
+.ALIAS DOC_COVER_TITLE_SIZE _SIZE
+.ALIAS DOCTYPE_SIZE _SIZE
+.ALIAS ENDNOTE_NUMBER_SIZE _SIZE
+.ALIAS ENDNOTE_LINENUMBER_SIZE _SIZE
+.ALIAS ENDNOTE_STRING_SIZE _SIZE
+.ALIAS ENDNOTE_TITLE_SIZE _SIZE
+.ALIAS EPIGRAPH_SIZE _SIZE
+.ALIAS FOOTNOTE_SIZE _SIZE
+.ALIAS HDRFTR_CENTER_SIZE _SIZE
+.ALIAS HDRFTR_LEFT_SIZE _SIZE
+.ALIAS HDRFTR_RIGHT_SIZE _SIZE
+.ALIAS HDRFTR_SIZE _SIZE
+.ALIAS HEAD_SIZE _SIZE
+.ALIAS PAGENUM_SIZE _SIZE
+.ALIAS PARAHEAD_SIZE _SIZE
+.ALIAS QUOTE_SIZE _SIZE
+.ALIAS SUBHEAD_SIZE _SIZE
+.ALIAS SUBTITLE_SIZE _SIZE
+.ALIAS TITLE_SIZE _SIZE
+.ALIAS TOC_HEADER_SIZE _SIZE
+.ALIAS TOC_HEAD_SIZE _SIZE
+.ALIAS TOC_PARAHEAD_SIZE _SIZE
+.ALIAS TOC_PN_SIZE _SIZE
+.ALIAS TOC_SUBHEAD_SIZE _SIZE
+.ALIAS TOC_TITLE_SIZE _SIZE
+\#
+.ALIAS ATTRIBUTE_COLOR _COLOR
+.ALIAS AUTHOR_COLOR _COLOR
+.ALIAS BLOCKQUOTE_COLOR _COLOR
+.ALIAS CHAPTER_TITLE_COLOR _COLOR
+.ALIAS COVER_ATTRIBUTE_COLOR _COLOR
+.ALIAS COVER_AUTHOR_COLOR _COLOR
+.ALIAS COVER_CHAPTER_TITLE_COLOR _COLOR
+.ALIAS COVER_COLOR _COLOR
+.ALIAS COVER_COPYRIGHT_COLOR _COLOR
+.ALIAS COVER_DOCTYPE_COLOR _COLOR
+.ALIAS COVER_MISC_COLOR _COLOR
+.ALIAS COVER_SUBTITLE_COLOR _COLOR
+.ALIAS COVER_TITLE_COLOR _COLOR
+.ALIAS DOC_COVER_ATTRIBUTE_COLOR _COLOR
+.ALIAS DOC_COVER_AUTHOR_COLOR _COLOR
+.ALIAS DOC_COVER_CHAPTER_TITLE_COLOR _COLOR
+.ALIAS DOC_COVER_COLOR _COLOR
+.ALIAS DOC_COVER_COPYRIGHT_COLOR _COLOR
+.ALIAS DOC_COVER_DOCTYPE_COLOR _COLOR
+.ALIAS DOC_COVER_MISC_COLOR _COLOR
+.ALIAS DOC_COVER_SUBTITLE_COLOR _COLOR
+.ALIAS DOC_COVER_TITLE_COLOR _COLOR
+.ALIAS DOCHEADER_COLOR _COLOR
+.ALIAS DOCTYPE_COLOR _COLOR
+.ALIAS EPIGRAPH_COLOR _COLOR
+.ALIAS FINIS_COLOR _COLOR
+.ALIAS FOOTNOTE_COLOR _COLOR
+.ALIAS HDRFTR_CENTER_COLOR _COLOR
+.ALIAS HDRFTR_COLOR _COLOR
+.ALIAS HDRFTR_LEFT_COLOR _COLOR
+.ALIAS HDRFTR_RIGHT_COLOR _COLOR
+.ALIAS HDRFTR_RULE_COLOR _COLOR
+.ALIAS HEAD_COLOR _COLOR
+.ALIAS LINEBREAK_COLOR _COLOR
+.ALIAS PAGENUM_COLOR _COLOR
+.ALIAS PARAHEAD_COLOR _COLOR
+.ALIAS QUOTE_COLOR _COLOR
+.ALIAS SUBHEAD_COLOR _COLOR
+.ALIAS SUBTITLE_COLOR _COLOR
+.ALIAS TITLE_COLOR _COLOR
+\#
+.ALIAS BIBLIOGRAPHY_QUAD _QUAD
+.ALIAS BIBLIOGRAPHY_STRING_QUAD _QUAD
+.ALIAS BLOCKQUOTE_QUAD _QUAD
+.ALIAS COVER_COPYRIGHT_QUAD _QUAD
+.ALIAS COVER_MISC_QUAD _QUAD
+.ALIAS DOC_COVER_COPYRIGHT_QUAD _QUAD
+.ALIAS DOC_COVER_MISC_QUAD _QUAD
+.ALIAS DOC_QUAD _QUAD
+.ALIAS ENDNOTE_QUAD _QUAD
+.ALIAS ENDNOTE_STRING_QUAD _QUAD
+.ALIAS ENDNOTE_TITLE_QUAD _QUAD
+.ALIAS EPIGRAPH_QUAD _QUAD
+.ALIAS FOOTNOTE_QUAD _QUAD
+.ALIAS HEAD_QUAD _QUAD
+.ALIAS SUBHEAD_QUAD _QUAD
+.ALIAS TOC_HEADER_QUAD _QUAD
+\#
+\# Support aliases
+\#
+.ALIAS COL_BREAK COL_NEXT
+.ALIAS DOC_COVER_ADVANCE COVER_ADVANCE
+.ALIAS DOC_COVER COVER
+.ALIAS DOC_COVERS COVERS
+.ALIAS DOC_COVER_LEAD COVER_LEAD
+.ALIAS DOC_COVERTITLE COVERTITLE
+.ALIAS DO_DOC_COVER DO_COVER
+.ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE
+\#
+\# Miscellaneous aliases
+.ALIAS SECTION LINEBREAK
+.ALIAS SECTION_CHAR LINEBREAK_CHAR
+\#
+\# Miscellaneous macros to take care of backward compatibility
+\# -----------------------------------------------------------
+\#
+\# As of 1.1.9, EL and TN got changed to make TRAP...TRAP OFF
+\# unnecessary for users. However, I used both macros extensively
+\# throughout this file (in conjunction with TRAP...TRAP OFF).
+\# EOL is the "old" EL, for the personal use of om.tmac
+\#
+.MAC EOL END
+. br
+. sp -1v
+.END
+\#
+\# REFER SUPPORT
+\# -------------
+\#
+\# Footnote references
+\# -------------------
+\# *Function:
+\# Instruct REF to put references in footnotes.
+\#
+.MAC FOOTNOTE_REFS END
+. if r#EN_REF \{ .rr #EN_REF \}
+. nr #FN_REF 1
+.END
+\#
+\# Endnote references
+\# ------------------
+\# *Function:
+\# Instruct REF to collect references for endnotes output.
+\#
+.MAC ENDNOTE_REFS END
+. if r#FN_REF \{ .rr #FN_REF \}
+. nr #EN_REF 1
+.END
+\#
+\# Prepare mom for a reference
+\# ---------------------------
+\# *Argument:
+\# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value>
+\# *Function:
+\# Calls FOOTNOTE or ENDNOTE, depending on whether #REF_FN or
+\# #REF_EN is set to 1.
+\# *Notes:
+\# For convenience, REF is a toggle.
+\#
+\# REF optionally takes the same arguments as FOOTNOTE, allowing
+\# users to indent references that go in footnotes when footnote
+\# indenting is required. FOOTNOTE_REFS must be on for this.
+\#
+.MAC REF END
+. ie \\n[#FN_REF]+\\n[#EN_REF]=0 \{\
+. if !\\n[#REF_WARNING]=1 \{\
+. tm1 "[mom]: Before REF at line \\n(.c, neither FOOTNOTE_REFS nor ENDNOTE_REFS
+. tm1 " has been selected. If "sort" and "accumulate" are in your refer
+. tm1 " commands, references will be collected for later output with $LIST$.
+. tm1 " Otherwise, they will disappear.
+. nr #REF_WARNING 1
+. \}
+. \}
+. el \{\
+. ie \\n[#REF]=1 \{\
+. if \\n[#FN_REF]=1 \{ .FOOTNOTE OFF \}
+. if \\n[#EN_REF]=1 \{ .ENDNOTE OFF \}
+. rr #REF
+. \}
+. el \{\
+. rr #REF_WARNING
+. nr #REF 1
+. if \\n[#FN_REF]=1 \{ .FOOTNOTE \\$1 \\$2 \\$3 \}
+. if \\n[#EN_REF]=1 \{ .ENDNOTE \}
+. \}
+. \}
+.END
+\#
+\# Embedded references in text (with brackets)
+\# -------------------------------------------
+\#
+.MAC REF_BRACKETS_START END
+. ds $CURRENT_EV \\n[.ev]
+. ev REFERENCE
+. evc \\*[$CURRENT_EV]
+. di REFERENCE
+.END
+\#
+.MAC REF_BRACKETS_END END
+. br
+. di
+. ev
+. chop REFERENCE
+. unformat REFERENCE
+. if '\\$0'REF)' \{ .nop (\\*[REFERENCE]) \}
+. if '\\$0'REF]' \{ .nop [\\*[REFERENCE]] \}
+. if '\\$0'REF}' \{ .nop {\\*[REFERENCE]} \}
+.END
+\#
+\# These three pairs of aliases allow users to embed references in
+\# text and have them surrounded by (), [] or {}.
+\#
+.ALIAS REF( REF_BRACKETS_START
+.ALIAS REF) REF_BRACKETS_END
+\#
+.ALIAS REF[ REF_BRACKETS_START
+.ALIAS REF{ REF_BRACKETS_START
+\#
+.ALIAS REF} REF_BRACKETS_END
+.ALIAS REF] REF_BRACKETS_END
+\#
+\# Second-line indent for refs
+\# ---------------------------
+\# *Argument:
+\# FOOTNOTE | ENDNOTE | BIBLIO <indent for 2nd and subsequent lines of discrete reference entries>
+\# *Function:
+\# Sets strings $REF_FN_INDENT, $REF_EN_INDENT or $REF_BIB_INDENT.
+\# *Notes:
+\# Indent value requires a unit of measure.
+\#
+.MAC INDENT_REFS END
+. if '\\$1'FOOTNOTE' .ds $REF_FN_INDENT \\$2
+. if '\\$1'ENDNOTE' .ds $REF_EN_INDENT \\$2
+. if '\\$1'BIBLIO' .ds $REF_BIB_INDENT \\$2
+.END
+\#
+\# Hyphenation of references
+\# -------------------------
+\# *Argument:
+\# <none> | <anything>
+\# *Function:
+\# Sets register #REF_HYPHENATE
+\#
+.MAC HYPHENATE_REFS END
+. ie '\\$1'' \{ .nr #REF_HYPHENATE 1 \}
+. el \{\
+. if r#REF_HY \{ .rr #REF_HY \}
+. \}
+.END
+\#
+.ig
+The remainder of the definitions in this section are modified
+versions of the definitions found in the refer module of s.tmac.
+..
+\#
+\# This one is directly from s.tmac.
+.de @error
+.tm \\n(.F:\\n(.c: macro error: \\$*
+..
+\#
+.ig
+The following strings define the order of entries for different
+types of references. Each letter in the string refers to a database
+field (A for author, T1/T2 for article and book titles, etc).
+Mom is set up for MLA-style bibliographies. Other styles can be
+implemented here by re-ordering the fields.
+..
+\# Book - type 2
+.ds ref*spec!2 Q A T1 d t l r E S e V a C I D P O
+\# Article within book - type 3
+.ds ref*spec!3 Q A T2 B d t l r E S e V a C I D P O
+\# Journal article - type 1
+.ds ref*spec!1 Q A T2 J S N D P O
+\# Tech report - type 4
+.ds ref*spec!4 Q A T1 R G C I D P O
+\# Internet site - type 0
+.ds ref*spec!0 Q A T2 s E c d o a u O
+\#
+\# Refer's "1st" macro. Since it is possible to define database
+\# fields using any single letter, we remove all possible string
+\# definitions of the form [X and [x
+\#
+.de ]-
+.rm [A [B [C [D [E [F [G [H [I [J [K [L [M \
+ [N [O [P [Q [R [S [T [U [V [W [X [Y [Z \
+. [a [b [c [d [e [f [g [h [i [j [k [l [m \
+ [n [o [p [q [r [s [t [u [v [w [x [y [z
+.rm ref*string
+.rr ref*type
+..
+\#
+\# Refer's "2nd" macro; builds up a reference with ref*build, and
+\# prints it with ref*print.
+\#
+.de ][
+.nr ref*type \\$1
+.if \\n[ref*type]=3 \{\
+. if !'\\*([R'' \{\
+. nr ref*type 4
+. ds ref*spec!4 Q A T2 B R C I D P O
+. \}
+. if !'\\*([G'' \{\
+. nr ref*type 4
+. ds ref*spec!4 Q A T2 B G C I D P O
+. \}
+.\}
+.if r [T \{\
+. als [T1 [T
+. als [T2 [T
+.\}
+.ie d ref*spec!\\n[ref*type] .ref*build \\*[ref*spec!\\n[ref*type]]
+.el \{\
+. @error unknown reference type `\\n[ref*type]'
+. ref*build \\*[ref*spec!0]
+.\}
+.if !\\n[.hy]=0 \{\
+.nr #RESTORE_HY \\n[.hy]
+.if !r#REF_HY .nh
+.\}
+.ref*print
+.if !\\n[#RESTORE_HY]=0 .hy \\n[#RESTORE_HY]
+.rr #RESTORE_HY
+.rm ref*string
+.rm [F [T1 [T2
+..
+\#
+\# Refer's "3rd" macros, which set up and terminate the output
+\# of collected references
+\#
+.de ]<
+.als ref*print ref*end-print
+.nr #REF 1
+.if \\n[#BIB_LIST]=1 \{\
+. nr #IN_BIB_LIST 1
+. LIST DIGIT \\*[$BIB_LIST_SEPARATOR] \\*[$BIB_LIST_PREFIX]
+.\}
+..
+\#
+.de ]>
+.LIST OFF
+.rr #REF
+.rr #IN_BIB_LIST
+.als ref*print ref*normal-print
+..
+\#
+\# Output
+\# ------
+\#
+\# Output normal, non-collected refs
+\#
+.de ref*normal-print
+.nr #CURRENT_HY \\n[.hy]
+\\*[ref*string]
+..
+\#
+\# Output collected refs
+\#
+.de ref*end-print
+.\" 10 is abritrary
+.nn 10
+.ie \\n[#BIB_LIST]=0 \{\
+.in +\\*[$REF_BIB_INDENT]
+.ti -\\*[$REF_BIB_INDENT]
+.\}
+.el .ITEM
+\\*[ref*string]
+.sp \\n[#BIB_SPACE]u
+.ie \\n[#BIB_LIST]=0 .in
+.el .IL -\\*[$REF_BIB_INDENT]u
+.nn 0
+..
+\#
+.als ref*print ref*normal-print
+\#
+\# Build up the ref*string
+\#
+.ig
+Correct MLA "typewritten" style (printstyle TYPEWRITE) demands
+two spaces after each period. The spaces are hardwired into the
+string definitions (ref*add-<x>), so we have to make sure that there
+aren't two spaces when the printstyle is TYPESET. Since I find that
+references look a bit crowded with 0 sentence space, I've bumped it
+up to +4. User's sentence spacing is reset in FOOTNOTES and ENDNOTES.
+..
+\#
+.de ref*build
+.if \\n[#PRINT_STYLE]=2 \{\
+. ds $RESTORE_SS_VAR \\*[$SS_VAR]
+. SS +4
+.\}
+.rm ref*string ref*post-punct
+.nr ref*suppress-period 1
+.while \\n[.$] \{\
+. if d [\\$1 \{\
+. ie d ref*add-\\$1 .ref*add-\\$1
+. el .ref*add-dflt \\$1
+. \}
+. shift
+.\}
+.\" now add a final period
+.ie d ref*string \{\
+. if !\\n[ref*suppress-period] .as ref*string .
+. if d ref*post-punct \{\
+. as ref*string "\\*[ref*post-punct]
+. rm ref*post-punct
+. \}
+.\}
+.el .ds ref*string
+..
+\#
+\# The following macros determine how entries are formatted WRT
+\# punctuation, type style, additional strings, etc.
+\#
+.ig
+o First argument is the database field letter.
+o Second argument is the punctuation character to use to separate this
+ field from the previous field.
+o Third argument is a string with which to prefix this field.
+o Fourth argument is a string with which to postfix this field.
+o Fifth argument is a string to add after the punctuation character
+ supplied by the next field.
+..
+\#
+\# %A Author(s)
+.de ref*add-A
+.ref*field A ,
+.if r [A .nr ref*suppress-period \\n([A
+..
+\# %T Title (generic)
+.de ref*add-T1
+.ref*field T . " \E*[IT]" "" \E*[PREV]
+.if \\n([T .nr ref*suppress-period \\n([T
+..
+\# %T Title of a chapter or article
+.de ref*add-T2
+.ref*field T . " \(lq" "" "\(rq"
+.if \\n([T .nr ref*suppress-period \\n([T
+..
+\# %B Book title (when citing an article from a book)
+.de ref*add-B
+.ie \\n([T .ref*field B "" ".\E*[IT]" "" \E*[PREV]
+.el .ref*field B . " \E*[IT]" "" \E*[PREV]
+\# refer doesn't set reg [T to 1 for these book titles, so we do it here
+.ds eval*[B \\*([B
+.substring eval*[B -1
+.rr [T
+.if '\\*[eval*[B]'!' .nr [T 1
+.if '\\*[eval*[B]'?' .nr [T 1
+.rm eval*[B
+..
+\# %R Report number for technical reports
+.de ref*add-R
+.ref*field R . " "
+..
+\# %J Journal name
+.de ref*add-J
+.ie \\n([T .ref*field J "" " \E*[IT]" "" \E*[PREV]
+.el .ref*field J . " \E*[IT]" "" \E*[PREV]
+..
+\# %E Editor(s)
+.de ref*add-E
+.ie !\\n[ref*type]=0 \{\
+. ie \\n([E>0 \{\
+. ie \\n([T .ref*field E "" " Eds. "
+. el .ref*field E . " Eds. "
+. \}
+. el \{\
+. ie \\n([T .ref*field E "" " Ed. "
+. el .ref*field E . " Ed. "
+. \}
+.\}
+.el \{\
+. ie \\n([T .ref*field E "" " "
+. el .ref*field E . " "
+.\}
+.rr [T
+..
+\# %e Edition
+.de ref*add-e
+.ie \\n([T .ref*field e "" " " " edition"
+.el .ref*field e . " " " edition"
+.rr [T
+..
+\# %V Volume (of a journal, or series of books)
+.de ref*add-V
+.if \\n[ref*type]=1 \{\
+. ref*field V
+.\}
+.if \\n[ref*type]=2 \{\
+. ie \\n([T .ref*field V "" " "
+. el .ref*field V . " "
+.\}
+.if \\n[ref*type]=3 \{\
+. ie \\n([T .ref*field V "" " "
+. el .ref*field V . " "
+.\}
+.rr [T
+..
+\# %N Journal number
+.de ref*add-N
+.ref*field N
+..
+\# %S Series (books or journals)
+.de ref*add-S
+.if \\n[ref*type]=1 \{\
+. ref*field S
+.\}
+.if \\n[ref*type]=2 \{\
+. ie \\n([T .ref*field S "" " "
+. el .ref*field S . " "
+.\}
+.if \\n[ref*type]=3 \{\
+. ie \\n([T .ref*field S "" " "
+. el .ref*field S . " "
+.\}
+.rr [T
+\# refer doesn't set reg [T to 1 for series titles, so we do it here
+.ds eval*[S \\*([S
+.substring eval*[S -1
+.if '\\*[eval*[S]'!' .nr [T 1
+.if '\\*[eval*[S]'?' .nr [T 1
+.rm eval*[S
+..
+\# %C City
+.de ref*add-C
+.ie \\n([T .ref*field C "" " "
+.el .ref*field C . " "
+.rr [T
+..
+\# %I Publisher (I stands for Issuer)
+.de ref*add-I
+.ie !'\\*([C'' .ref*field I :
+.el \{\
+. ie \\n([T .ref*field I "" " "
+. el .ref*field I . " "
+.\}
+.rr [T
+..
+\# %D Date of publication
+.de ref*add-D
+.if \\n[ref*type]=1 \{\
+. ie !'\\*([V''.ref*field D "" "(" ")"
+. el .ref*field D
+.\}
+.if \\n[ref*type]=2 .ref*field D ,
+.if \\n[ref*type]=3 \{\
+. ie '\\*([C'' \{\
+. ie '\\*([I'' .ref*field D . " "
+. el .ref*field D ,
+. \}
+. el .ref*field D ,
+.\}
+.if \\n[ref*type]=4 .ref*field D ,
+..
+\# %P Page number(s)
+.de ref*add-P
+.ie \\n[ref*type]=1 .ref*field P :
+.el .ref*field P . " "
+..
+\# %G Gov't. ordering number
+.de ref*add-G
+.ref*field G . " "
+..
+\# %O Other (usually goes at end of ref)
+.de ref*add-O
+.ref*field O . " "
+.ie r [O .nr ref*suppress-period \\n([O
+.el .nr ref*suppress-period 1
+..
+\#
+.de ref*add-dflt
+.ref*field \\$1 ,
+..
+\#
+\# Book reprints
+\# -------------
+\# %d date of publication (the orignal date of publication)
+.de ref*add-d
+.ie \\n([T .ref*field d "" " "
+.el .ref*field d . " "
+.rr [T
+..
+\# %a additions (such as a new intro to reprints)
+.de ref*add-a
+.ie \\n([T .ref*field a "" " "
+.el .ref*field a . " "
+.rr [T
+..
+\# %t title, if different from original title (the T field, which s/b
+\# the original title)
+.de ref*add-t
+.ie \\n([T .ref*field t "" " Rpt. as \E*[IT]" "" \E*[PREV]
+.el .ref*field t . " Rpt. as \E*[IT]" "" \E*[PREV]
+.rr [T
+..
+\#
+\# Translated works
+\# ----------------
+\# %l Trans(l)ator
+.de ref*add-l
+.ie \\n([T .ref*field l "" " Trans. "
+.el .ref*field l . " Trans. "
+.rr [T
+..
+\# %r Translato(r) and edito(r)
+.de ref*add-r
+.ie \\n([T .ref*field r "" " Trans. and Ed. "
+.el .ref*field r . " Trans. and Ed. "
+.rr [T
+..
+\#
+\# Internet
+\# --------
+\# %s Site name
+.de ref*add-s
+.ie \\n([s .ref*field s "" ".\E*[IT]" "" \E*[PREV]
+.el .ref*field s . " \E*[IT]" "" \E*[PREV]
+.\" refer doesn't set reg [T to 1 for these book titles, so we do it here
+.ds eval*[s \\*([s
+.substring eval*[s -1
+.rr [T
+.if '\\*[eval*[s]'!' .nr [T 1
+.if '\\*[eval*[s]'?' .nr [T 1
+.rm eval*[s
+..
+\# %c content of site, if unclear (i.e. advertisement, cartoon,
+\# interview, etc.)
+.de ref*add-c
+.ie \\n([T .ref*field c "" " "
+.el .ref*field c . " "
+.rr [T
+..
+\# %o organization, group or sponsor of site
+.de ref*add-o
+.ie \\n([T .ref*field o "" " "
+.el .ref*field o . " "
+.rr [T
+..
+\# %a access date, i.e. the date you read it
+.de ref*add-a
+.ie \\n([T .ref*field a "" " "
+.el .ref*field a . " "
+.rr [T
+..
+\# %u URL
+.de ref*add-u
+.ref*field u "" " <" ">"
+.rr [T
+..
+\#
+\# Build up reference string from ref*add-<x> macros.
+\#
+.de ref*field
+.if d ref*string \{\
+. ie d ref*post-punct \{\
+. as ref*string "\\$2\\*[ref*post-punct] \"
+. rm ref*post-punct
+. \}
+. el .as ref*string "\\$2 \"
+.\}
+.as ref*string "\\$3\\*([\\$1\\$4
+.if \\n[.$]>4 .ds ref*post-punct "\\$5
+.nr ref*suppress-period 0
+..
+\#
+\# MARGIN NOTES
+\# ------------
+\# This is a wrapper for MNinit.
+\#
+\# I could use a 'while' loop to assign args to strings, but too many
+\# 'while' loops are slowing things down.
+\#
+.MAC MN_INIT END
+. if !'\\$1'rerun' \{\
+. ds $MN-arg1 \\$1
+. ds $MN-arg2 \\$2
+. ds $MN-arg3 \\$3
+. ds $MN-arg4 \\$4
+. ds $MN-arg5 \\$5
+. ds $MN-arg6 \\$6
+. ds $MN-arg7 \\$7
+. ds $MN-arg8 \\$8
+. ds $MN-arg9 \\$9
+. \}
+. ie \\n[#START_FOR_MNinit]=0 \{\
+. nr #MNinit_DEFERRED 1
+. nr #START_FOR_MNinit 1
+. return
+. \}
+. el \{\
+. MNinit \\*[$MN-arg1] \\*[$MN-arg2] \\*[$MN-arg3] \\*[$MN-arg4] \\*[$MN-arg5] \\*[$MN-arg6] \\*[$MN-arg7] \\*[$MN-arg8] \\*[$MN-arg9]
+. \}
+.END
+\#
+.MAC MN_OVERFLOW_TRAP END
+. if \\n[#OVERFLOW_LEFT]=1 \{\
+. nr #no-repeat-MN-left 1
+. di MN_OVERFLOW_LEFT
+. \}
+. if \\n[#OVERFLOW_RIGHT]=1 \{\
+. nr #no-repeat-MN-right 1
+. di MN_OVERFLOW_RIGHT
+. \}
+. rr #OVERFLOW_LEFT
+. rr #OVERFLOW_RIGHT
+.END
+\#
+.ig
+The remainder of the margin notes macros and routines are adapted
+from Werner Lemberg's MN.tmac.
+..
+\#
+\# MNinit
+\# ------
+\# Usage:
+\# MNinit [ragged|symmetric] \
+\# left-width right-width separation \
+\# font fontsize vertical-spacing \
+\# color hyphenation-flags
+\#
+\# Initialize margin notes. Empty arguments (denoted with "") set
+\# default values. If the first argument is the string `ragged',
+\# left and right margin notes are printed ragged-right. If it is
+\# `symmetric', left margin notes are printed ragged-left and right
+\# margin notes ragged-right. If omitted, margin notes are left
+\# and right adjusted.
+\#
+\#
+.de MNinit
+. nr #MNinit 1
+. ds MN-left-ad b\"
+. ds MN-right-ad b\"
+. if '\\$1'RAGGED' \{\
+. ds MN-left-ad l\"
+. ds MN-right-ad l\"
+. shift
+. \}
+. if '\\$1'SYMMETRIC' \{\
+. ds MN-left-ad r\"
+. ds MN-right-ad l\"
+. shift
+. \}
+. ie \B'\\$3' \
+. nr MN-sep (n;\\$3)
+. el \
+. nr MN-sep 1m
+. if ((\\n[.o] - \\n[MN-sep]) < 1n) \
+. ab MN: Left margin too small (<1n) for requested margin notes separation.
+. ie \B'\\$1' \{\
+. nr MN-left-width (n;\\$1)
+. nr MN-left-start (\\n[.o] - \\n[MN-sep] - \\n[MN-left-width])
+. \}
+. el \{\
+. nr MN-left-width (\\n[.o] - \\n[MN-sep])
+. nr MN-left-start 0
+. \}
+. if (\\n[MN-left-start] < 0) \
+. ab MN: Left margin too small for requested margin notes settings.
+. if (\\n[MN-left-width] < 1n) \
+. ab MN: Left margin notes width too small (<1n).
+.
+. ie \B'\\$2' \{\
+. nr MN-right-width (n;\\$2)
+. nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
+. if \\n[#COLUMNS]=1 \{\
+. if !\\n[#NUM_COLS]=1 \{\
+. nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
+. \}
+. \}
+. \}
+. el \{\
+. nr MN-right-width \\n[MN-left-width]
+. nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
+. if \\n[#COLUMNS]=1 \{\
+. if !\\n[#NUM_COLS]=1 \{\
+. nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
+. \}
+. \}
+. \}
+. ie \A'\\$4' \{\
+. ds MN-font \\$4\"
+. if \\n[#PRINT_STYLE]=1 .ds MN-font CR
+. \}
+. el \{\
+. ds MN-font \\*[$PP_FT]
+. if \\n[#PRINT_STYLE]=1 .ds MN-font CR
+. \}
+. ie \B'\\$5' \{\
+. ps \\$5
+. nr MN-size \\n[.ps]
+. ps
+. if \\n[#PRINT_STYLE]=1 \{\
+. ps 12
+. nr MN-size \\n[.ps]
+. ps
+. \}
+. \}
+. el \{\
+. nr MN-size \\n[#DOC_PT_SIZE]
+. \}
+. ie \B'\\$6' \{\
+' vs \\$6
+. nr MN-spacing \\n(.v
+' vs
+. if '\\$6'DOC' \{ .nr MN-spacing \\n[#DOC_LEAD] \}
+. if \\n[#PRINT_STYLE]=1 \{\
+. nr MN-spacing \\n[#DOC_LEAD]
+. \}
+. \}
+. el \{\
+. nr MN-spacing \\n[#DOC_LEAD]
+. \}
+. ie \A'\\$7' \
+. if !\\n[#PRINT_STYLE]=1 .ds MN-color \\$7\"
+. el \
+. if !\\n[#PRINT_STYLE]=1 .ds MN-color
+. ie \B'\\$8' \
+. nr MN-hy \\$8
+. el \
+. nr MN-hy \\n[.hy]
+. ev MNbottom-left-env
+. if \A'\\*[MN-font]' \
+. ft \\*[MN-font]
+. if \\n[MN-size] \
+. ps \\n[MN-size]u
+. if \\n[MN-spacing] \
+. vs \\n[MN-spacing]u
+. ll \\n[MN-left-width]u
+. ad \\*[MN-left-ad]
+. hy \\n[MN-hy]
+' in 0
+. nop \m[\\*[MN-color]]\c
+. ev
+. ev MNbottom-right-env
+. if \A'\\*[MN-font]' \
+. ft \\*[MN-font]
+. if \\n[MN-size] \
+. ps \\n[MN-size]u
+. if \\n[MN-spacing] \
+. vs \\n[MN-spacing]u
+. ll \\n[MN-right-width]u
+. ad \\*[MN-right-ad]
+. hy \\n[MN-hy]
+' in 0
+. nop \m[\\*[MN-color]]\c
+. ev
+. nr MN-active 0
+..
+\# MN
+\# --
+\# Usage:
+\#
+\# MN LEFT|RIGHT
+\# margin note text
+\# MN
+\#
+\# With a parameter, start a margin note, otherwise end a margin note.
+\# If the parameter is the string `left', define a left margin note,
+\# otherwise define a right margin note.
+\#
+.de MN
+.ds MN-dir \\$1
+.if \\n[#COLUMNS]=1 \{\
+. if \\n[#NUM_COLS]>2 \{\
+. tm MN: More than two columns. Ignoring margin notes.
+. return
+. \}
+. if !\\n[#NUM_COLS]=1 \{\
+. ie \\n[#COL_NUM]=1 .ds MN-dir LEFT
+. el .ds MN-dir RIGHT
+. \}
+.\}
+. if !\\n[#MNinit]=1 \{\
+. tm MN: You must set parameters with MN_INIT before using MN.
+. ab Aborting
+. \}
+. ie !'\\$1'' \{\
+. if \\n[MN-active] \{\
+. tm MN: Can't handle nested margin notes.
+. return
+. \}
+. nr MN-active 1
+. ev MN-env
+. ie '\\*[MN-dir]'LEFT' \{\
+. nr MN-left +1
+. ds MN-curr l-\\n[MN-left]\"
+. evc MNbottom-left-env
+. \}
+. el \{\
+. nr MN-right +1
+. ds MN-curr r-\\n[MN-right]\"
+. evc MNbottom-right-env
+. \}
+. mk MN-mk-\\*[MN-curr]
+. di MN-div-\\*[MN-curr]
+. \}
+. el \{\
+. if \\n[MN-active] \{\
+. br
+. di
+. nr MN-div-\\*[MN-curr]-depth \\n(dn
+. ev
+. \}
+. nr MN-active 0
+. \}
+..
+\#
+\# MNtop
+\# -----
+\# Resets these registers (called in HEADER)
+.de MNtop
+. nr MN-left 0
+. nr MN-right 0
+. nr MN-active 0
+..
+\#
+\# MNbottom-left
+\# -------------
+\# The "left" half of Werner's original MNbottom.
+\#
+.de MNbottom-left
+. nr MN-curr 0
+. nr MN-last-pos 0
+. nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
+. vpt 0
+. mk MN-curr-pos
+. if \\n[MN-active] \{\
+. di
+. tm MN: Margin note finished by new page. Ignored.
+. \}
+. po \\n[MN-left-start]u
+. ev MNbottom-left-env
+. nr #P \\n%+\\n[#PAGE_NUM_ADJ]
+. while (\\n[MN-curr] < \\n[MN-left]) \{\
+. nr MN-curr +1
+. ie (\\n[MN-last-pos] < \\n[MN-mk-l-\\n[MN-curr]]) \
+. sp |\\n[MN-mk-l-\\n[MN-curr]]u+\\n[MN-lead-adj]u
+. el \{\
+. nr MN-shifted 1
+. sp 1v
+. SHIM
+. if \\n[#SHIM]u>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
+. tm MN: Warning: Left margin note #\\n[MN-curr] on page \\n[#P] shifted down.
+. \}
+.\" If last margin note doesn't fit
+. if ( (\\n(nl+\\n[MN-div-l-\\n[MN-curr]-depth]) > (\\n(.p+\\n[#VARIABLE_FOOTER_POS]) ) \{\
+. if \\n[MN-shifted]=1 \{\
+. sp -(1v+\\n[#SHIM]u)
+. rm MN-div-l-\\n[MN-curr]
+. tm1 "[mom]: No room to start left margin note #\\n[MN-curr] on page \\n[#P] on page \\n[#P].
+. tm1 " Ignoring margin note.
+. rr MN-shifted
+. \}
+. nr #no-repeat-MN-left 1
+. nr #OVERFLOW_LEFT 1
+. wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
+. vpt 1
+. \}
+. MN-div-l-\\n[MN-curr]
+. br
+. nr MN-last-pos \\n[nl]
+.\}
+. ev
+. po
+. if !\\n[#no-repeat-MN-left]=1 \{\
+. if \\n[MN-right]=0 .vpt 1
+. \}
+..
+\#
+\# MNbottom-right
+\# --------------
+\# The "right" half of Werner's original MNbottom.
+\#
+.de MNbottom-right
+. nr MN-curr 0
+. nr MN-last-pos 0
+. nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
+. vpt 0
+. po \\n[MN-right-start]u
+. ev MNbottom-right-env
+. nr #P \\n%+\\n[#PAGE_NUM_ADJ]
+. while (\\n[MN-curr] < \\n[MN-right]) \{\
+. nr MN-curr +1
+. ie (\\n[MN-last-pos] < \\n[MN-mk-r-\\n[MN-curr]]) \
+. sp |\\n[MN-mk-r-\\n[MN-curr]]u+\\n[MN-lead-adj]u
+. el \{\
+. nr MN-shifted 1
+. sp 1v
+. SHIM
+. tm MN: Warning: Right margin note #\\n[MN-curr] on page \\n[#P] shifted down.
+. \}
+.\" If last margin note doesn't fit
+. if ( (\\n(nl+\\n[MN-div-r-\\n[MN-curr]-depth]) > (\\n(.p+\\n[#VARIABLE_FOOTER_POS]) ) \{\
+. if \\n[MN-shifted]=1 \{\
+. sp -(1v+\\n[#SHIM]u)
+. rm MN-div-r-\\n[MN-curr]
+. tm1 "[mom]: No room to start right margin note #\\n[MN-curr] on page \\n[#P] on page \\n[#P].
+. tm1 " Ignoring margin note.
+. rr MN-shifted
+. \}
+. nr #no-repeat-MN-right 1
+. nr #OVERFLOW_RIGHT 1
+. wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
+. vpt 1
+. \}
+. MN-div-r-\\n[MN-curr]
+. br
+. nr MN-last-pos \\n[nl]
+.\}
+. ev
+. po
+' sp |\\n[MN-curr-pos]u
+. if !\\n[#no-repeat-MN-right]=1 .vpt 1
+..
diff --git a/contrib/groff/contrib/pdfmark/ChangeLog b/contrib/groff/contrib/pdfmark/ChangeLog
new file mode 100644
index 000000000000..97417ccc8368
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/ChangeLog
@@ -0,0 +1,137 @@
+2005-06-22 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ pdfroff.sh portability enhancement.
+
+ * pdfroff.sh: (ARGLIST): Variable removed.
+ (GROFF_STYLE): Use it for all groff invocations.
+ (INPUT_FILES): Pass to all groff invocations, instead of ARGLIST.
+ (CS_MACRO, CE_MACRO): Initialize independently.
+ (CS_FILTER): Simplify quoting; it used to confuse some shells.
+ (Source): CVS keyword removed; replaced by...
+ (RCSfile, Revision): these.
+
+2005-06-17 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ * pdfroff.sh: (MATCH): Correct quoting.
+ (Source): Add terminating `$' on CVS keyword.
+
+2005-06-17 Zvezdan Petkovic <zpetkovic@acm.org>
+
+ * Makefile.sub: (RM): Define as `rm -f', for `make' programs
+ which don't predefine it.
+
+2005-06-16 Bernd Warken
+
+ * pdfroff.sh: (NULLDEV): Correct misspelled instance of NULDEV.
+
+2005-05-28 Werner LEMBERG <wl@gnu.org>
+
+ * Makefile.sub (.ms.pdf): Use `--stylesheet', not `--style'.
+
+2005-05-17 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ Improve portability of `pdfroff' shell script.
+
+ * pdfroff.sh: Add space in shebang, conforming to portability
+ guidelines in `autoconf' docs.
+ (searchpath): New shell function; use it instead of `type' command
+ to locate prerequisite helper programs.
+
+ * pdfroff.man: Document influence of `OSTYPE' and `PATH_SEPARATOR'
+ environment variables.
+
+ * Makefile.sub: (pdfroff): Make it depend on SH_DEPS_SED_SCRIPT,
+ from arch/misc/shdeps.sh; use it to customize PATH_SEPARATOR
+ initialization code for `searchpath' function in pdfroff.sh.
+
+2005-05-16 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ Interim documentation update.
+
+ * pdfmark.ms: (GROFF-WEBSITE): New string; use it in references and
+ examples.
+ (Section 2.5): Add definitions of D and Z operators, for use with
+ pdfhref macro.
+ (Section 2.5.4): Complete description of pdfhref macro usage for
+ `Linking to Internet Resources'; provide examples.
+
+2005-05-14 Nick Stoughton <nick@usenix.org>
+
+ * pdfmark.tmac (LB): Renamed to ...
+ (PDFLB): This to avoid conflicts with mm's LB macro.
+
+2005-05-02 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ Handle parsing anomalies in Cygwin's `ash', and similar, shells.
+
+ * pdfroff.sh: ($CAT, $GREP, $SED, $GROFF, $DIFF): Avoid interpreting
+ misdirected error messages, which `type' sends to `stdout' in some
+ shells, as a successful program file match.
+
+ ($AWK, $GS): Likewise; also ensure that multiple choice match
+ prototypes are eval'ed as such, in case token splitting occurs
+ before variable expansion.
+
+2005-04-24 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ Add support for folded outlines in PDF documents.
+
+ * pdfmark.tmac (PDFOUTLINE.FOLDLEVEL): New register.
+ (pdf:bm.emit): Use it.
+
+ * pdfmark.ms: Document it.
+
+2005-03-25 Werner LEMBERG <wl@gnu.org>
+
+ * Makefile.in: Removed.
+
+2005-03-24 Werner LEMBERG <wl@gnu.org>
+
+ * Makefile: Renamed to...
+ * Makefile.in: This.
+
+2005-03-22 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ * pdfroff.sh: Eliminate invalid program reference to $AWK, when
+ invoked with `--no-reference-dictionary' option.
+
+2005-03-02 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ * contrib/pdfmark/Makefile.sub (install_data): Use $(INSTALL_SCRIPT)
+ to install `pdfroff'.
+ * contrib/pdfmark/pdfroff.man (opte): New macro.
+ Use it to remove spurious equal signs from SYNOPSIS.
+
+2005-02-28 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ Provide `pdfroff' shell script, and manpage to document it;
+ runs multiple groff passes, to format PDF documents.
+
+ * pdfroff.sh: New shell script template;
+ * pdfroff.man: New man page to document it.
+
+ Integrate `pdfmark' into normal groff build system;
+ install macro `pdfmark' packages, build and install `pdfroff',
+ and PDF format documentation.
+
+ * Makefile.sub: Rewritten.
+ * pdfmark.tmac: Modified.
+ (pdfhref): New macro operators, `D' and `Z'.
+ (pdf*href-D, pdf*href-Z): New macros: implement them.
+ (pdf*href.mark.resolve, pdf*href.mark.emit, pdf*href.mark.flush):
+ Modified macro algorithm, to eliminate inconsistencies between
+ `grohtml' representations of `opminy' from differing groff versions.
+ (pdf*href.mark, pdf*href.mark.release, pdf*href.mark.close):
+ deleted (redundant macros).
+ (PDFHREF.LEADING): Default value changed (was 2.5p; now -1.0p).
+ Global comment updates.
+
+ * TODO: Updated.
+
+2004-12-10 Werner LEMBERG <wl@gnu.org>
+
+ * TODO: Updated.
+
+2004-12-08 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ First import of pdfmark files.
diff --git a/contrib/groff/contrib/pdfmark/Makefile.sub b/contrib/groff/contrib/pdfmark/Makefile.sub
new file mode 100644
index 000000000000..39376007c997
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/Makefile.sub
@@ -0,0 +1,114 @@
+# Copyright (C) 2005, Free Software Foundation, Inc.
+# Written by Keith Marshall (keith.d.marshall@ntlworld.com)
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with groff; see the file COPYING. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+MAN1=\
+ pdfroff.n
+
+CMDFILES=\
+ pdfroff
+
+TMACFILES=\
+ pdfmark.tmac \
+ spdf.tmac
+
+PDFDOCFILES=\
+ pdfmark.pdf
+
+CLEANADD=\
+ gnu.eps \
+ $(PDFDOCFILES) \
+ $(CMDFILES)
+
+# Some `makes' don't predefine RM...
+RM=rm -f
+
+GROFF_BIN_DIR=$(top_builddir)/src/roff/groff
+GROFF_OTHER_BIN_DIRS=\
+ $(top_builddir)/src/roff/troff \
+ $(top_builddir)/src/devices/grops
+GROFF_BIN_DIRS=$(GROFF_BIN_DIR) $(GROFF_OTHER_BIN_DIRS)
+GROFF_BIN_PATH=`echo $(GROFF_BIN_DIRS) | sed -e 's| *|$(SH_SEP)|g'`
+
+FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
+MFLAG=-M$(srcdir) -M$(top_builddir)/tmac -M$(top_srcdir)/tmac
+PFLAG=-dpaper=$(PAGE) -P-p$(PAGE)
+
+PDFROFF=\
+ export GROFF_COMMAND_PREFIX; GROFF_COMMAND_PREFIX=''; \
+ export GROFF_BIN_DIR; GROFF_BIN_DIR=$(GROFF_BIN_DIR); \
+ export GROFF_BIN_PATH; GROFF_BIN_PATH=$(GROFF_BIN_PATH); \
+ ./pdfroff $(FFLAG) $(MFLAG) $(PFLAG)
+
+.SUFFIXES: .ms .pdf
+.ms.pdf:
+ $(RM) $@
+ $(PDFROFF) -mspdf --stylesheet=$(srcdir)/cover.ms $< >$@
+
+all: pdfroff $(make_pdfdoc)
+
+pdfdoc: gnu.eps $(PDFDOCFILES)
+
+gnu.eps:
+ if test -f $(top_srcdir)/doc/gnu.eps; then \
+ cp $(top_srcdir)/doc/gnu.eps . ; \
+ elif test -f $(top_builddir)/doc/gnu.eps; then \
+ cp $(top_builddir)/doc/gnu.eps . ; \
+ else \
+ xpmtoppm $(top_srcdir)/doc/gnu.xpm | pnmdepth 15 | \
+ $(pnmtops_nosetpage) -noturn -rle >$@ ; \
+ fi
+
+pdfroff: pdfroff.sh $(SH_DEPS_SED_SCRIPT)
+ $(RM) $@
+ sed -f $(SH_DEPS_SED_SCRIPT) \
+ -e "s|@VERSION@|$(version)$(revision)|" \
+ -e "s|@GROFF_AWK_INTERPRETERS@|$(ALT_AWK_PROGS)|" \
+ -e "s|@GROFF_GHOSTSCRIPT_INTERPRETERS@|$(ALT_GHOSTSCRIPT_PROGS)|" \
+ -e "s|@GROFF_BIN_DIR@|$(bindir)|" $(srcdir)/pdfroff.sh >$@
+ chmod +x $@
+
+install_data: $(make_install_pdfdoc)
+ -test -d $(bindir) || $(mkinstalldirs) $(bindir)
+ for f in $(CMDFILES); do \
+ $(RM) $(bindir)/$$f; \
+ $(INSTALL_SCRIPT) $$f $(bindir)/$$f; \
+ done
+ -test -d $(tmacdir) || $(mkinstalldirs) $(tmacdir)
+ for f in $(TMACFILES); do \
+ $(RM) $(tmacdir)/$$f; \
+ $(INSTALL_DATA) $(srcdir)/$$f $(tmacdir)/$$f; \
+ done
+
+install_pdfdoc:
+ -test -d $(pdfdocdir) || $(mkinstalldirs) $(pdfdocdir)
+ for f in $(PDFDOCFILES); do \
+ $(RM) $(pdfdocdir)/$$f; \
+ $(INSTALL_DATA) $$f $(pdfdocdir)/$$f; \
+ done
+
+uninstall_sub:
+ for f in $(CMDFILES); do \
+ $(RM) $(bindir)/$$f; \
+ done
+ for f in $(TMACFILES); do \
+ $(RM) $(tmacdir)/$$f; \
+ done
+ for f in $(PDFDOCFILES); do \
+ $(RM) $(pdfdocdir)/$$f; \
+ done
diff --git a/contrib/groff/contrib/pdfmark/PROBLEMS b/contrib/groff/contrib/pdfmark/PROBLEMS
new file mode 100644
index 000000000000..2fa848bdc447
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/PROBLEMS
@@ -0,0 +1,25 @@
+Known PROBLEMS in pdfmark.tmac
+==============================
+
+Bounding boxes for link hot-spots which straddle a page break
+are not computed correctly.
+
+*** Resolved: 06-Dec-2004 (KDM): pdfmark.tmac.patch-20041206 ***
+
+--------
+
+Documents including a large number of cross references may fail,
+with an 'input stack limit exceeded' error.
+
+*** Resolved: 27-Sep-2004 (KDM): pdfmark.tmac.patch-20040927 ***
+
+--------
+
+Links placed in diversions, such as footnotes or floating keeps,
+resolve to the wrong destinations; (mapping order becomes confused
+between links in diversion, and links in running text following
+the diversion).
+
+--------
+
+Annotations placed by .pdfnote cannot exceed about 200 chars.
diff --git a/contrib/groff/contrib/pdfmark/README b/contrib/groff/contrib/pdfmark/README
new file mode 100644
index 000000000000..276d610fae4e
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/README
@@ -0,0 +1,50 @@
+README for pdfmark.tmac
+=======================
+
+Copyright (C) 2004, Free Software Foundation Inc.
+Contributed by Keith Marshall (keith.d.marshall@ntlworld.com)
+
+This is free software. See file COPYING, for copying permissions,
+and warranty disclaimer.
+
+This is a preview release of a proposed pdfmark.tmac macro package,
+for use with GNU troff (groff). It is not yet complete, and should
+be considered as an alpha release; there are a few problems to be
+resolved (see file PROBLEMS).
+
+Partial documentation is provided, in groff-ms format. To convert
+this to PDF format, you will require a working groff installation,
+a working ghostscript installation, with the gs command in your PATH,
+and a GNU-compatible make. The tarball should be unpacked in the
+top directory of your groff source tree, then:
+
+ cd <groff-current>/contrib/pdfmark
+ make pdfmark
+
+where <groff-current> is the top directory of your current groff
+source tree.
+
+Included in this package, are:
+
+ pdfmark.tmac -- the core pdfmark macro set
+ spdf.tmac -- a rudimentary set of bindings for ms macros
+ pdfmark.ms -- preliminary documentation
+ cover.ms -- a template for the documentation cover sheet
+ gnu.eps -- the groff logo, copied from the groff distribution
+ Makefile -- makefile, for formatting the documentation
+ README -- this file
+ PROBLEMS -- a list of known problems
+ TODO -- a list of planned features, not yet implemented
+
+To make the pdfmark macros generally usable, copy pdfmark.tmac to the
+'site-tmac' directory appropriate to your groff installation; (ms users
+may also wish to copy spdf.tmac). The macros may then be accessed, by
+including the '-mpdfmark' option on the groff command line; (for ms
+users, '-mspdf' is equivalent to '-ms -mpdfmark', with some extra
+macros 'thrown in').
+
+Comments, and bug reports are welcomed. Please post to the groff
+mailing list, groff@gnu.org; (you must be subscribed to this list to
+post mails). To subscribe, visit
+
+ http://lists.gnu.org/mailman/listinfo/groff
diff --git a/contrib/groff/contrib/pdfmark/TODO b/contrib/groff/contrib/pdfmark/TODO
new file mode 100644
index 000000000000..a63b14f90f59
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/TODO
@@ -0,0 +1,53 @@
+TODO items for pdfmark.tmac
+===========================
+
+Add copyright information to PDF documentation.
+
+--------
+
+Add acknowledgements and trade mark ownership notifications
+to PDF documentation.
+
+--------
+
+Provide documentation in man page and texinfo formats.
+
+--------
+
+Add comments in spdf.tmac, to clarify its operation.
+Also add commentary in pdfmark.tmac, to clarify operation of
+recent changes.
+
+--------
+
+Make Makefile generic, so 'configure' can resolve target
+system dependencies.
+
+* Comment added 2005-02-26 by Keith Marshall <keith.d.marshall@ntlworld.com>
+
+If this refers to contrib/pdfmark/Makefile, then it is addressed by the new
+`pdfroff' script; the original Makefile may be considered redundant. Local
+system dependencies are resolved by `configure', and applied to `pdfroff',
+when it is generated from `pdfroff.sh'.
+
+--------
+
+Improve Makefile.sub, to integrate pdfmark.tmac installation
+into a regular groff build. Add it to groff's Makefile.in.
+
+* Comment added 2005-02-26 by Keith Marshall <keith.d.marshall@ntlworld.com>
+
+Completed.
+
+--------
+
+Provide a `pdfmark' script (or call it `groff2pdf'?) which
+actually converts a groff input file to pdf, and which
+takes care of the necessary intermediate steps to handle
+PDF marks.
+
+* Comment added 2005-02-26 by Keith Marshall <keith.d.marshall@ntlworld.com>
+
+This facility now provided by `pdfroff' script; documented in `pdfroff.man'.
+Man page still requires an additional section, to describe use of `stylesheet'
+feature. Script also requires documentation in PDF and texinfo formats.
diff --git a/contrib/groff/contrib/pdfmark/cover.ms b/contrib/groff/contrib/pdfmark/cover.ms
new file mode 100644
index 000000000000..1fe7e542c486
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/cover.ms
@@ -0,0 +1,57 @@
+.de CS
+.if !rCO .nr CO 0
+.if !rTL .nr TL 0
+.\".nr PO*SAVED \\n[PO]
+.nr LL*SAVED \\n[LL]
+.nr HM*SAVED \\n[HM]
+.nr HM 0
+.nr PO (2.1c+\\n[CO]u)
+.nr LL 17.1c
+\&
+.nr PS*SAVED \\n[PS]
+.nr VS*SAVED \\n[VS]
+.nr PS 24
+.nr VS 30
+.CD
+.fam T
+.sp |(5.9c+\\n[TL]u)
+.als AU au@first
+..
+.de au@first
+.sp 1.5v
+.als AU au@next
+.AU \\$@
+..
+.de au@next
+.DE
+.nr PS 18
+.nr VS 18
+.CD
+.sp 0.5v
+\\$*
+..
+.de AI
+\H'-4z'\\$*\H'0'
+..
+.de CE
+.DE
+.sp |17.5c
+.PSPIC gnu.eps
+.nr PS 19
+.CD
+.fam H
+.tkf HR 10z 2p 20z 4p
+\H'-4z'A GNU MANUAL\H'0'
+.DE
+.\".nr PO \\n[PO*SAVED]
+.nr LL \\n[LL*SAVED]
+.nr PS \\n[PS*SAVED]
+.nr VS \\n[VS*SAVED]
+.nr HM \\n[HM*SAVED]
+.\".rr PO*SAVED
+.rr LL*SAVED
+.rr PS*SAVED
+.rr VS*SAVED
+.rr HM*SAVED
+.fam
+..
diff --git a/contrib/groff/contrib/pdfmark/pdfmark.ms b/contrib/groff/contrib/pdfmark/pdfmark.ms
new file mode 100644
index 000000000000..0e9f0747faed
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/pdfmark.ms
@@ -0,0 +1,2531 @@
+.\" vim: ft=groff
+.CS
+Portable Document Format
+Publishing with GNU Troff
+.AU Keith Marshall
+.AI <keith.d.marshall@ntlworld.com>
+.CE
+.\"
+.\" Specify the Internet address for the groff web site.
+.\" Currently, there are two available addresses; a copy is maintained at ...
+.\"
+.ds GROFF-WEBSITE http://www.gnu.org/software/groff
+.\"
+.\" ... but the official home site is at ...
+.\"
+.ds GROFF-WEBSITE http://groff.ffii.org
+.\"
+.\" Set the PDF default document view attribute, to ensure that the document
+.\" outline is visible, each time the document is opened in Acrobat Reader.
+.\"
+.pdfview /PageMode /UseOutlines
+.\"
+.\" Initialise the outline view to show only three heading levels,
+.\" with additional subordinate level headings folded.
+.\"
+.nr PDFOUTLINE.FOLDLEVEL 3
+.\"
+.\" Add document identification meta-data
+.\"
+.pdfinfo /Title Portable Document Format Publishing with GNU Troff
+.pdfinfo /Author Keith Marshall
+.pdfinfo /Subject Tips and Techniques for Exploiting PDF Features with GNU Troff
+.pdfinfo /Keywords groff troff PDF pdfmark
+.\"
+.\" Set the default cross reference format to indicate section numbers,
+.\" rather than page numbers, when we insert a reference pointer.
+.\"
+.ds PDFHREF.INFO section \\*[SN-NO-DOT] \\$*
+.\"
+.\" Define a macro, to print reference links WITHOUT the usual "see" prefix.
+.\"
+.de XR-NO-PREFIX
+.rn PDFHREF.PREFIX xx
+.ds PDFHREF.PREFIX
+.XR \\$@
+.rn xx PDFHREF.PREFIX
+..
+.\"
+.\" Define a string,
+.\" to insert a Registered Trade Mark symbol as a superscript.
+.\"
+.ds rg \*{\(rg\*}
+.\"
+.\" Establish the page layout.
+.\"
+.nr PO 2.5c
+.nr LL 17.0c
+.nr LT 17.0c
+.nr HY 0
+.nr FF 3
+.nr DI 5n
+.\"
+.\" Generate headers in larger point sizes, for NH levels < 4,
+.\" with point size increasing by 1.5p, for each lesser NH level.
+.\"
+.nr GROWPS 4
+.nr PSINCR 1.5p
+.\"
+.de EM
+.\".I "\s'+0.3'\\$1\s0" "\\$2" "\\$3"
+.I \\$@
+..
+.de CWB
+\\$5\fC\\$3\fP\f(CB\\$1\fP\fC\\$2\fP\\$4
+..
+.de CWI
+\\$5\fC\\$3\fP\f(CI\\$1\fP\fC\\$2\fP\\$4
+..
+.de CWBI
+\\$5\fC\\$3\fP\f[CBI]\\$1\fP\fC\\$2\fP\\$4
+..
+.ds = \f(CB\\$1\f(CR\\$4\f[CBI]\\$2\f(CR\\$3
+.\"
+.NH 1
+.\" When we use numbered section headings, we might like to automatically
+.\" insert a table of contents entry, using the text of the heading itself.
+.\" The "ms" macros don't provide any standard mechanism for doing this,
+.\" but "spdf.tmac" adds the "XN" macro, which will do it for us.
+.\"
+.\" Here's a simple example of how we might use it. In this case, the word
+.\" "Introduction" will appear both in the body of the document, as the text
+.\" of the heading, and it will be added to the table of contents, which is
+.\" subsequently "printed" using the "TC" macro; in both locations, it will
+.\" be prefixed by the section number.
+.\"
+.\" As an additional side effect, any use of "XN" will cause the table of
+.\" contents entry to be automatically reproduced, with the exception of its
+.\" page number reference, as a PDF document outline entry. Thus, the use
+.\" of "XN" to specify numbered section headings results in the automatic
+.\" creation of a numbered PDF document outline. This automatic creation
+.\" of the outline is completely transparent, and will occur regardless
+.\" of whether the "TC" macro is subsequently invoked, or not.
+.\"
+.XN Introduction
+.\"
+.\" If using an old s.tmac, without the SN-NO-DOT extension,
+.\" make sure we get SOMETHING in section number references.
+.\"
+.if !dSN-NO-DOT .als SN-NO-DOT SN
+.LP
+It might appear that it is a fairly simple matter to
+produce documents in Adobe\*(rg\~\(lqPortable\~Document\~Format\(rq,
+commonly known as PDF, using
+.CW groff ) GNU\~Troff\~(
+as the document formatter.
+Indeed,
+.CW groff 's
+default output format is the native Adobe\*(rg\~PostScript\*(rg format,
+which PDF producers such as Adobe\*(rg Acrobat\*(rg Distiller\*(rg,
+or GhostScript, expect as their input format.
+Thus, the PDF production process would seem to entail simply
+formatting the document source with
+.CW groff ,
+to produce a PostScript\*(rg version of the document,
+which can subsequently be processed by Acrobat\*(rg Distiller\*(rg
+or GhostScript, to generate the final PDF document.
+.LP
+For many PDF production requirements,
+the production cycle described above may be sufficient.
+However, this is a limited PDF production method,
+in which the resultant PDF document represents no more than
+an on screen image of the printed form of the document, if
+.CW groff 's
+PostScript\*(rg output were printed directly.
+.LP
+The Portable Document Format provides a number of features,
+which significantly enhance the experience of reading a document on screen,
+but which are of little or no value to a document which is merely printed.
+It
+.EM is
+possible to exploit these PDF features, which are described in the Adobe\*(rg
+.\"
+.de pdfmark-manual
+.\" This is an example of a resource reference specified by URI ...
+.\" We may need to refer often to the Adobe pdfmark Reference Manual,
+.\" so we create the internet link definition using a macro, to make
+.\" it reusable.
+.\"
+.\" Note also, that we protect the description of the reference by
+.\" preceding it with "--", to avoid "invalid character in name" type
+.\" error messages from groff (caused by the use of "\~").
+.\"
+.pdfhref W -D http://partners.adobe.com/asn/acrobat/docs/pdfmark.pdf \
+ -P \(lq -A \(rq\\$1 -- pdfmark\~Reference\~Manual
+..
+.pdfmark-manual ,
+with some refinement of the simple PDF production method, provided
+appropriate \(lqfeature implementing\(rq instructions can be embedded into
+.CW groff 's
+PostScript\*(rg rendering of the document.
+This, of course, implies that the original document source, which
+.CW groff
+will process to generate the PostScript\*(rg description of the document,
+must include appropriate markup to exploit the desired PDF features.
+It is this preparation of the
+.CW groff
+document source to exploit a number of these features,
+which provides the principal focus of this document.
+.LP
+The markup techniques to be described have been utilised in the production of
+the PDF version of this document itself.
+This has been formatted using
+.CW groff 's
+.CW ms
+macro package;
+thus, usage examples may be found in the document source file,
+.CW \n(.F ,
+to which comments have been added,
+to help identify appropriate markup examples for implementing PDF features,
+such as:\(en
+.QS
+.IP \(bu
+Selecting a default document view, which defines how the document will appear
+when opened in the reader application; for example, when this document is
+opened in Acrobat\*(rg\~Reader, it should display the top of the cover sheet,
+in the document view pane, while a document outline should appear to the left,
+in the \(lqBookmarks\(rq pane.
+.IP \(bu
+Adding document identification \(lqmeta\(hydata\(rq,
+which can be accessed, in Acrobat\*(rg\~Reader,
+by inspecting the \(lqFile\^/\^Document\~Properties\^/\^Summary\(rq.
+.IP \(bu
+Creating a document outline, which will be displayed in the \(lqBookmarks\(rq
+pane of Acrobat\*(rg\~Reader, such that readers may quickly navigate to any
+section of the document, simply by clicking on the associated heading
+in the outline view.
+.IP \(bu
+Embedding active links in the body of the document, such that readers may
+quickly navigate to related material at another location within the same
+document, or in another PDF document, or even to a related Internet resource,
+specified by its URI.
+.IP \(bu
+Adding annotations, in the form of \(lqsticky notes\(rq, at strategic
+points within the PDF document.
+.QE
+.LP
+All of the techniques described have been tested on
+.EM both
+GNU/Linux, and on Microsoft\*(rg Windows\(tm2000 operating platforms, using
+.CW groff
+.CW 1.19.1 ,\c
+.pdfhref L -D footnote1 -- \**
+.FS
+.pdfhref M footnote1
+Later versions should, and some earlier versions may, be equally suitable.
+See
+.pdfhref W \*[GROFF-WEBSITE]
+for information and availability of the latest version.
+.FE
+in association with
+.CW AFPL
+.CW GhostScript
+.CW 8.14 .\c
+.pdfhref L -D footnote2 -- \**
+.FS
+.pdfhref M footnote2
+Again, other versions may be suitable.
+See
+.pdfhref W http://ghostscript.com
+for information and availability.
+.FE
+Other tools employed, which should be readily available on
+.EM any
+.SM
+UNIX\(tm
+.LG
+or GNU/Linux system, are
+.CW sed ,
+.CW awk
+and
+.CW make ,
+together with an appropriate text editor, for creating and marking up the
+.CW groff
+input files.
+These additional utilities are not provided, as standard,
+on the Microsoft\*(rg Windows\(tm platform,
+but several third party implementations are available.
+Some worth considering include the MKS\*(rg\~Toolkit,\**
+.FS
+A commercial offering; see
+.pdfhref W http://mkssoftware.com/products/tk/default.asp
+for information.
+.FE
+Cygwin,\**
+.FS
+A
+.EM free
+but comprehensive
+.SM
+POSIX
+.LG
+emulation environment and
+.SM
+UNIX\(tm
+.LG
+toolkit for 32\(hybit Microsoft\*(rg Windows\(tm platforms; see
+.pdfhref W http://cygwin.com
+for information and download.
+.FE
+or MSYS.\**
+.FS
+Another free, but minimal suite of common
+.SM
+UNIX\(tm
+.LG
+tools for 32\(hybit Microsoft\*(rg Windows\(tm, available for download from
+.pdfhref W -A ; http://www.mingw.org
+it
+.EM does
+include those tools listed above,
+and is the package which was actually used when performing the Windows\(tm2000
+platform tests referred to in the text.
+.FE
+This list is by no means exhaustive, and should in no way be construed as an
+endorsement of any of these packages, nor to imply that other similar packages,
+which may be available, are in any way inferior to them.
+.bp
+.NH 1
+.\" We may wish a section heading to represent a named destination,
+.\" so that we can create a linked reference to it, from some other
+.\" part of the PDF document, (or even from another PDF document).
+.\"
+.\" Here we use the "-N" option of the "XN" macro, to create a named
+.\" PDF link destination, at the location of the heading. Notice that
+.\" we also use the "--" marker to separate the heading text from the
+.\" preceding option specification; it is not strictly necessary in
+.\" this case, but it does help to set off the heading text from the
+.\" option specification.
+.\"
+.XN -N pdf-features -- Exploiting PDF Document Features
+.LP
+To establish a consistent framework for adding PDF features, a
+.CW groff
+macro package, named
+.CW pdfmark.tmac ,
+has been provided.
+Thus, to incorporate PDF features in a document,
+the appropriate macro calls, as described below, may be placed in the
+.CW groff
+document source, which should then be processed with a
+.CW groff
+command of the form
+.QP
+.fam C
+groff -Tps [-m
+.I name "] -m"
+.B pdfmark
+.I options \& [-
+.I "file ..." \& "...] "
+.LP
+It may be noted that the
+.CW pdfmark
+macros have no dependencies on, and no known conflicts with,
+any other
+.CW groff
+macro package; thus, users are free to use any other macro package,
+of their choice, to format their documents, while also using the
+.CW pdfmark
+macros to add PDF features.
+.NH 2
+.XN -N pdfmark-operator -- The \F[C]pdfmark\F[] Operator
+.LP
+All PDF features are implemented by embedding instances of the
+.B \F[C]pdfmark\F[]
+operator, as described in the Adobe\*(rg
+.pdfmark-manual ,
+into
+.CW groff 's
+PostScript\*(rg output stream.
+To facilitate the use of this operator, the
+.CW pdfmark
+macro package defines the primitive
+.CW pdfmark
+macro; it simply emits its argument list,
+as arguments to a
+.CW pdfmark
+operator, in the PostScript\*(rg output stream.
+.LP
+.pdfhref M -N pdfmark-example
+To illustrate the use of the
+.CW pdfmark
+macro, the following is a much simplified example of how a bookmark
+may be added to a PDF document outline
+.QP
+.CW ".pdfmark \e"
+.RS 4
+.nf
+.fam C
+/Count 2 \e
+/Title (An Example of a Bookmark with Two Children) \e
+/View [/FitH \en[PDFPAGE.Y]] \e
+/OUT
+.RE
+.LP
+In general, users should rarely need to use the
+.CW pdfmark
+macro directly.
+In particular, the above example is too simple for general use; it
+.EM will
+create a bookmark, but it does
+.EM not
+address the issues of setting the proper value for the
+.CW /Count
+key, nor of computing the
+.CW PDFPAGE.Y
+value used in the
+.CW /View
+key. The
+.CW pdfmark
+macro package includes a more robust mechanism for creating bookmarks,
+.\"
+.\" Here is an example of how a local reference may be planted,
+.\" using the automatic formatting feature of the "pdfhref" macro.
+.\"
+.\" This is a forward reference to the named destination "add-outline",
+.\" which is defined below, using the "XN" wrapper macro, from the
+.\" "spdf.tmac" macro package. The automatically formatted reference
+.\" will be enclosed in parentheses, as specified by the use of
+.\" "-P" and "-A" options.
+.\"
+.pdfhref L -P ( -A ), -D add-outline
+.\"
+which addresses these issues automatically.
+Nevertheless, the
+.CW pdfmark
+macro may be useful to users wishing to implement more advanced PDF features,
+than those currently supported directly by the
+.CW pdfmark
+macro package.
+.NH 2
+.XN -N docview -- Selecting an Initial Document View
+.LP
+By default,
+when a PDF document is opened,
+the first page will be displayed,
+at the default magnification set for the reader,
+and outline and thumbnail views will be hidden.
+When using a PDF reader,
+such as Acrobat\*(rg\~Reader,
+which supports the
+.CW /DOCVIEW
+class of the
+.CW pdfmark
+operator,
+these default initial view settings may be overridden,
+using the
+.CW pdfview
+macro.
+For example
+.QP
+.CW ".pdfview /PageMode /UseOutlines"
+.LP
+will cause Acrobat\*(rg\~Reader to open the document outline view,
+to the left of the normal page view,
+while
+.QP
+.CW ".pdfview /PageMode /UseThumbs"
+.LP
+will open the thumbnail view instead.
+.LP
+Note that the two
+.CW /PageMode
+examples, above, are mutually exclusive \(em it is not possible to have
+.EM both
+outline and thumbnail views open simultaneously.
+However, it
+.EM is
+permitted to add
+.CW /Page
+and
+.CW /View
+keys, to force the document to open at a page other than the first,
+or to change the magnification at which the document is initially displayed;
+see the
+.pdfmark-manual
+for more information.
+.LP
+It should be noted that the view controlling meta\(hydata, defined by the
+.CW pdfview
+macro, is not written immediately to the PostScript\*(rg output stream,
+but is stored in an internal meta\(hydata \(lqcache\(rq,
+(simply implemented as a
+.CW groff
+diversion).
+This \(lqcached\(lq meta\(hydata must be written out later, by invoking the
+.CW pdfsync
+macro,
+.\"
+.\" Here is another example of how we may introduce a forward reference.
+.\" This time we are using the shorter notation afforded by the "XR" macro
+.\" provided by "spdf.tmac"; this example is equivalent to the native
+.\" "pdfmark.tmac" form
+.\" .pdfhref L -D pdfsync -P ( -A ).
+.\"
+.XR pdfsync ). (
+.\"
+.NH 2
+.XN -N docinfo -- Adding Document Identification Meta-Data
+.LP
+In addition to the
+.CW /DOCVIEW
+class of meta\(hydata described above,
+.XR docview ), (
+we may also wish to include document identification meta\(hydata,
+which belongs to the PDF
+.CW /DOCINFO
+class.
+.LP
+To do this, we use the
+.CW pdfinfo
+macro.
+As an example of how it is used,
+the identification meta\(hydata attached to this document
+was specified using a macro sequence similar to:\(en
+.DS I
+.CW
+\&.pdfinfo /Title PDF Document Publishing with GNU Troff
+\&.pdfinfo /Author Keith Marshall
+\&.pdfinfo /Subject How to Exploit PDF Features with GNU Troff
+\&.pdfinfo /Keywords groff troff PDF pdfmark
+.DE
+Notice that the
+.CW pdfinfo
+macro is repeated, once for each
+.CW /DOCINFO
+record to be placed in the document.
+In each case, the first argument is the name of the applicable
+.CW /DOCINFO
+key, which
+.EM must
+be named with an initial solidus character;
+all additional arguments are collected together,
+to define the value to be associated with the specified key.
+.LP
+As is the case with the
+.CW pdfview
+macro,
+.XR docview ), (
+the
+.CW /DOCINFO
+records specified with the
+.CW pdfinfo
+macro are not immediately written to the PostScript\*(rg output stream;
+they are stored in the same meta\(hydata cache as
+.CW /DOCVIEW
+specifications, until this cache is explicitly flushed,
+by invoking the
+.CW pdfsync
+macro,
+.XR pdfsync ). (
+.NH 2
+.XN -N add-outline -- Creating a Document Outline
+.LP
+A PDF document outline comprises a table of references,
+to \(lqbookmarked\(rq locations within the document.
+When the document is viewed in an \(lqoutline\~aware\(rq PDF document reader,
+such as Adobe\*(rg Acrobat\*(rg Reader,
+this table of \(lqbookmarks\(rq may be displayed in a document outline pane,
+or \(lqBookmarks\(rq pane, to the left of the main document view.
+Individual references in the outline view may then be selected,
+by clicking with the mouse,
+to jump directly to the associated marked location in the document view.
+.LP
+The document outline may be considered as a collection of \(lqhypertext\(rq
+references to \(lqbookmarked\(rq locations within the document.
+The
+.CW pdfmark
+macro package provides a single generalised macro,
+.CW pdfhref ,
+for creating and linking to \(lqhypertext\(rq reference marks.
+This macro will be described more comprehensively in a later section,
+.XR pdfhref ); (
+the description here is restricted to its use for defining document outline entries.
+.NH 3
+.XN -N basic-outline -- A Basic Document Outline
+.LP
+In its most basic form, the document outline comprises a structured list of headings,
+each associated with a marked location, or \(lqbookmark\(rq, in the document text,
+and a specification for how that marked location should be displayed,
+when this bookmark is selected.
+.LP
+To create a PDF bookmark, the
+.CW pdfhref
+macro is used,
+at the point in the document where the bookmark is to be placed,
+in the form
+.QP
+.fam C
+.B ".pdfhref O"
+.I level > <
+.I "descriptive text ..."
+.LP
+in which the reference class
+.CWB O \& \& \(rq \(lq
+stipulates that this is an outline reference.
+.LP
+Alternatively, for those users who may prefer to think of a document outline
+simply as a collection of bookmarks, the
+.CW pdfbookmark
+macro is also provided \(em indeed,
+.CW pdfhref
+invokes it, when processing the
+.CWB O \& \& \(rq \(lq
+reference class operator.
+It may be invoked directly, in the form
+.QP
+.fam C
+.B .pdfbookmark
+.I level > <
+.I "descriptive text ..."
+.LP
+Irrespective of which of the above macro forms is employed, the
+.CWI level > <
+argument is required.
+It is a numeric argument, defining the nesting level of the \(lqbookmark\(rq
+in the outline hierarchy, with one being the topmost level.
+Its function may be considered analagous to the
+.EM "heading level"
+of the document's section headings,
+for example, as specified with the
+.CW NH
+macro, if using the
+.CW ms
+macros to format the document.
+.LP
+All further arguments, following the
+.CWI level > <
+argument, are collected together, to specify the heading text which will appear
+in the document's outline view.
+Thus, the outline entry for this section of this document,
+which has a level three heading,
+might be specified as
+.QP
+.CW
+\&.pdfhref O 3 \*(SN A Basic Document Outline
+.LP
+or, in the alternative form using the
+.CW pdfbookmark
+macro, as
+.QP
+.CW
+\&.pdfbookmark 3 \*(SN A Basic Document Outline
+.NH 3
+.XN Hierarchical Structure in a Document Outline
+.LP
+When a document outline is created, using the
+.CW pdfhref
+macro as described in
+.\"
+.\" Here is an example of how we can temporarily modify the format of
+.\" a reference link, in this case to indicate only the section number
+.\" of the link target, in the form "section #", (or, if we define
+.\" "SECREF.BEGIN" before the call, its content followed by the
+.\" section number).
+.\"
+.\" We first define a macro, which will get the reference data from
+.\" pdfhref, as arguments, and will return the formatted output, as we
+.\" require it, the string "PDFHREF.TEXT".
+.\"
+.de SECREF
+.while \\n(.$ \{\
+. ie '\\$1'section' \{\
+. if !dSECREF.BEGIN .ds SECREF.BEGIN \\$1
+. ds PDFHREF.TEXT \\*[SECREF.BEGIN]\~\\$2
+. rm SECREF.BEGIN
+. shift \\n(.$
+. \}
+. el .shift
+. \}
+..
+.\" We now tell "pdfhref" to use our formatting macro, in place of
+.\" its builtin default formatter, before we specify the reference.
+.\"
+.pdfhref F SECREF
+.pdfhref L -A , -D basic-outline
+.\"
+.\" At this point, we would normally revert the "pdfhref" formatter
+.\" to use its default, built in macro. However, in this particular
+.\" case, we want to use our custom format one more time, before we
+.\" revert it, so we will omit the reversion step this time.
+.\"
+and any entry is added at a nesting level greater than one,
+then a hierarchical structure is automatically defined for the outline.
+However, as was noted in the simplified
+.pdfhref L -D pdfmark-example -- example
+in
+.pdfhref L -A , -D pdfmark-operator
+.\"
+.\" And now, we revert to default "pdfhref" formatting behaviour,
+.\" by completing the call we delayed above.
+.\"
+.pdfhref F
+.\"
+the data required by the
+.CW pdfmark
+operator to create the outline entry may not be fully defined,
+when the outline reference is defined in the
+.CW groff
+document source.
+Specifically, when the outline entry is created, its
+.CW /Count
+key must be assigned a value equal to the number of its subordinate entries,
+at the next inner level of the outline hierarchy;
+typically however,
+these subordinate entries will be defined
+.EM later
+in the document source, and the appropriate
+.CW /Count
+value will be unknown, when defining the parent entry.
+.LP
+To resolve this paradox, the
+.CW pdfhref
+macro creates the outline entry in two distinct phases \(em
+a destination marker is placed in the PostScript\*(rg output stream immediately,
+when the outline reference is defined,
+but the actual outline entry is stored in an internal \(lqoutline cache\(rq,
+until its subordinate hierarchy has been fully defined;
+it can then be inserted in the output stream, with its
+.CW /Count
+value correctly assigned.
+Effectively, to ensure integrity of the document outline structure,
+this means that each top level outline entry, and
+.EM all
+of its subordinates, are retained in the cache, until the
+.EM next
+top level entry is defined.
+.LP
+One potential problem, which arises from the use of the \(lqoutline cache\(rq,
+is that, at the end of any document formatting run, the last top level outline entry,
+and any subordinates defined after it, will remain in the cache, and will
+.EM not
+be automatically written to the output stream.
+To avoid this problem, the user should follow the guidelines given in
+.\"
+.\" Here is a more conventional example of how to temporarily change
+.\" to the format used to display reference links. We will again use
+.\" the "SECREF" format, which we defined above, but on this occasion
+.\" we will immediately revert to the default format, after the link
+.\" has been placed.
+.\"
+.pdfhref F SECREF
+.pdfhref L -D pdfsync -A ,
+.pdfhref F
+.\"
+to synchronise the output state with the cache state,
+.XR pdfsync ), (
+at the end of the
+.CW groff
+formatting run.
+.NH 3
+.XN -N outline-view -- Associating a Document View with an Outline Reference
+.LP
+Each \(lqbookmark\(rq entry, in a PDF document outline,
+is associated with a specific document view.
+When the reader selects any outline entry,
+the document view changes to display the document context
+associated with that entry.
+.LP
+The document view specification,
+to be associated with any document outline entry,
+is established at the time when the outline entry is created.
+However, rather than requiring that each individual use of the
+.CW pdhref
+macro, to create an outline entry,
+should include its own view specification,
+the actual specification assigned to each entry is derived from
+a generalised specification defined in the string
+.CW PDFBOOKMARK.VIEW ,
+together with the setting of the numeric register
+.CW PDFHREF.VIEW.LEADING ,
+which determine the effective view specification as follows:\(en
+.QS
+.IP \*[= PDFBOOKMARK.VIEW]
+Establishes the magnification at which the document will be viewed,
+at the location of the \(lqbookmark\(rq; by default, it is defined by
+.RS
+.QP
+.CW ".ds PDFBOOKMARK.VIEW /FitH \e\en[PDFPAGE.Y] u"
+.RE
+.IP
+which displays the associated document view,
+with the \(lqbookmark\(rq location positioned at the top of the display window,
+and with the magnification set to fit the page width to the width of the window.
+.IP \*[= PDFHREF.VIEW.LEADING]
+Specifies additional spacing,
+to be placed between the top of the display window
+and the actual location of the \(lqbookmark\(rq on the displayed page view.
+By default, it is set as
+.RS
+.QP
+.CW ".nr PDFHREF.VIEW.LEADING 5.0p"
+.RE
+.IP
+Note that
+.CW PDFHREF.VIEW.LEADING
+does not represent true \(lqleading\(rq, in the typographical sense,
+since any preceding text, set in the specified display space,
+will be visible at the top of the document viewing window,
+when the reference is selected.
+.IP
+Also note that the specification of
+.CW PDFHREF.VIEW.LEADING
+is shared by
+.EM all
+reference views defined by the
+.CW pdfhref
+macro; whereas
+.CW PDFBOOKMARK.VIEW
+is applied exclusively to outline references,
+there is no independent
+.CW PDFBOOKMARK.VIEW.LEADING
+specification.
+.QE
+.LP
+If desired, the view specification may be changed, by redefining the string
+.CW PDFBOOKMARK.VIEW ,
+and possibly also the numeric register
+.CW PDFHREF.VIEW.LEADING .
+Any alternative definition for
+.CW PDFBOOKMARK.VIEW
+.EM must
+be specified in terms of valid view specification parameters,
+as described in the Adobe\*(rg
+.pdfmark-manual .
+.LP
+Note the use of the register
+.CW PDFPAGE.Y ,
+in the default definition of
+.CW PDFBOOKMARK.VIEW
+above.
+This register is computed by
+.CW pdfhref ,
+when creating an outline entry;
+it specifies the vertical position of the \(lqbookmark\(rq,
+in basic
+.CW groff
+units, relative to the
+.EM bottom
+edge of the document page on which it is defined,
+and is followed, in the
+.CW PDFBOOKMARK.VIEW
+definition, by the
+.CW grops
+.CW u \(rq \(lq
+operator, to convert it to PostScript\*(rg units on output.
+It may be used in any redefined specification for
+.CW PDFBOOKMARK.VIEW ,
+(or in the analogous definition of
+.CW PDFHREF.VIEW ,
+described in
+.XR-NO-PREFIX pdfhref-view ),
+but
+.EM not
+in any other context,
+since its value is undefined outside the scope of the
+.CW pdfhref
+macro.
+.LP
+Since
+.CW PDFPAGE.Y
+is computed relative to the
+.EM bottom
+of the PDF output page,
+it is important to ensure that the page length specified to
+.CW troff
+correctly matches the size of the logical PDF page.
+This is most effectively ensured,
+by providing
+.EM identical
+page size specifications to
+.CW groff ,
+.CW grops
+and to the PostScript\*(rg to PDF converter employed,
+and avoiding any page length changes within the document source.
+.LP
+Also note that
+.CW PDFPAGE.Y
+is the only automatically computed \(lqbookmark\(rq location parameter;
+if the user redefines
+.CW PDFBOOKMARK.VIEW ,
+and the modified view specification requires any other positional parameters,
+then the user
+.EM must
+ensure that these are computed
+.EM before
+invoking the
+.CW pdfhref
+macro.
+.NH 3
+.XN -N outline-folding -- Folding the Outline to Conceal Less Significant Headings
+.LP
+When a document incorporates many subheadings,
+at deeply nested levels,
+it may be desirable to \(lqfold\(rq the outline
+such that only the major heading levels are initially visible,
+yet making the inferior subheadings accessible,
+by allowing the reader to expand the view of any heading branch on demand.
+.LP
+The
+.CW pdfmark
+macros support this capability,
+through the setting of the
+.CW PDFOUTLINE.FOLDLEVEL
+register.
+This register should be set to the number of heading levels
+which it is desired to show in expanded form, in the
+.EM initial
+document outline display;
+all subheadings at deeper levels will still be added to the outline,
+but will not become visible until the outline branch containing them is expanded.
+'ne 5
+For example, the setting used in this document:
+.QS
+.LD
+.fam C
+\&.\e" Initialise the outline view to show only three heading levels,
+\&.\e" with additional subordinate level headings folded.
+\&.\e"
+\&.nr PDFOUTLINE.FOLDLEVEL 3
+.DE
+.QE
+.LP
+results in only the first three levels of headings being displayed
+in the document outline,
+.EM until
+the reader chooses to expand the view,
+and so reveal the lower level headings in any outline branch.
+.LP
+The initial default setting of
+.CW PDFOUTLINE.FOLDLEVEL ,
+if the document author does not choose to change it,
+is 10,000.
+This is orders of magnitude greater than the maximum heading level
+which is likely to be used in any document;
+thus the default behaviour will be to show document outlines fully expanded,
+to display all headings defined,
+at all levels within each document.
+.LP
+The setting of
+.CW PDFOUTLINE.FOLDLEVEL
+may be changed at any time;
+however, the effect of each such change may be difficult to predict,
+since it is applied not only to outline entries which are defined
+.EM after
+the setting is changed,
+but also to any entries which remain in the outline cache,
+.EM at
+this time.
+Therefore, it is recommended that
+.CW PDFOUTLINE.FOLDLEVEL
+should be set
+.EM once ,
+at the start of each document;
+if it
+.EM is
+deemed necessary to change it at any other time,
+the outline cache should be flushed,
+.XR pdfsync ), (
+.EM immediately
+before the change,
+which should immediately preceed a level one heading.
+.NH 3
+.XN -N multipart-outline -- Outlines for Multipart Documents
+.LP
+When a document outline is created, using the
+.CW pdfhref
+macro, each reference mark is automatically assigned a name,
+composed of a fixed stem followed by a serially generated numeric qualifier.
+This ensures that, for each single part document, every outline reference
+has a uniquely named destination.
+.LP
+As the overall size of the PDF document increases,
+it may become convenient to divide it into smaller,
+individually formatted PostScript\*(rg components,
+which are then assembled, in the appropriate order,
+to create a composite PDF document.
+While this strategy may simplify the overall process of creating and
+editing larger documents, it does introduce a problem in creating
+an overall document outline,
+since each individual PostScript\*(rg component will be assigned
+duplicated sequences of \(lqbookmark\(rq names,
+with each name ultimately referring to multiple locations in the composite document.
+To avoid such reference naming conflicts, the
+.CW pdfhref
+macro allows the user to specify a \(lqtag\(rq,
+which is appended to the automatically generated \(lqbookmark\(rq name;
+this may be used as a discriminating mark, to distinguish otherwise
+similarly named destinations, in different sections of the composite document.
+.LP
+To create a \(lqtagged\(rq document outline,
+the syntax for invocation of the
+.CW pdfhref
+macro is modified, by the inclusion of an optional \(lqtag\(rq specification,
+.EM before
+the nesting level argument, i.e.
+.QP
+.fam C
+.B ".pdfhref O"
+.B -T \& [
+.I tag >] <
+.I level > <
+.I "descriptive text ..."
+.LP
+The optional
+.CWI tag > <
+argument may be composed of any characters of the user's choice;
+however, its initial character
+.EM "must not"
+be any decimal digit, and ideally it should be kept short
+\(em one or two characters at most.
+.LP
+By employing a different tag in each section,
+the user can ensure that \(lqbookmark\(rq names remain unique,
+throughout all the sections of a composite document.
+For example, when using the
+.CW spdf.tmac
+macro package, which adds
+.CW pdfmark
+capabilities to the standard
+.CW ms
+package,
+.XR using-spdf ), (
+the table of contents is collected into a separate PostScript\*(rg section
+from the main body of the document.
+In the \(lqbody\(rq section, the document outline is \(lquntagged\(rq,
+but in the \(lqTable\~of\~Contents\(rq section, a modified version of the
+.CW TC
+macro adds an outline entry for the start of the \(lqTable\~of\~Contents\(rq,
+invoking the
+.CW pdfhref
+macro as
+.QP
+.CW ".pdfhref O -T T 1 \e\e*[TOC]"
+.LP
+to tag the associated outline destination name with the single character suffix,
+.CW T \(rq. \(lq
+Alternatively, as in the case of the basic outline,
+.XR basic-outline ), (
+this may equally well be specified as
+.QP
+.CW ".pdfbookmark -T T 1 \e\e*[TOC]"
+.NH 3
+.XN Delegation of the Outline Definition
+.LP
+Since the most common use of a document outline
+is to provide a quick method of navigating through a document,
+using active \(lqhypertext\(rq links to chapter and section headings,
+it may be convenient to delegate the responsibility of creating the outline
+to a higher level macro, which is itself used to
+define and format the section headings.
+This approach has been adopted in the
+.CW spdf.tmac
+package, to be described later,
+.XR using-spdf ). (
+.LP
+When such an approach is adopted,
+the user will rarely, if ever, invoke the
+.CW pdfhref
+macro directly, to create a document outline.
+For example, the structure and content of the outline for this document
+has been exclusively defined, using a combination of the
+.CW NH
+macro, from the
+.CW ms
+package, to establish the structure, and the
+.CW XN
+macro from
+.CW spdf.tmac ,
+to define the content.
+In this case,
+the responsibility for invoking the
+.CW pdfhref
+macro, to create the document outline,
+is delegated to the
+.CW XN
+macro.
+.NH 2
+.XN -N pdfhref -- Adding Reference Marks and Links
+.LP
+.pdfhref F SECREF
+.ds SECREF.BEGIN Section
+.pdfhref L -D add-outline
+.pdfhref F
+has shown how the
+.CW pdfhref
+macro may be used to create a PDF document outline.
+While this is undoubtedly a powerful capability,
+it is by no means the only trick in the repertoire of this versatile macro.
+.LP
+The macro name,
+.CW pdfhref ,
+which is a contraction of \(lqPDF HyperText Reference\(rq,
+indicates that the general purpose of this macro is to define
+.EM any
+type of dynamic reference mark, within a PDF document.
+Its generalised usage syntax takes the form
+.QP
+.fam C
+.B .pdfhref
+.BI class > <
+.I "-options ...\&" ] [
+[--]
+.I "descriptive text ...\&" ] [
+.LP
+where
+.CW <\f(CIclass\fP>
+represents a required single character argument,
+which defines the specific reference operation to be performed,
+and may be selected from:\(en
+.QS
+.IP \*[= O]
+Add an entry to the document outline.
+This operation has been described earlier,
+.XR add-outline ). (
+.IP \*[= M]
+Place a \(lqnamed destination\(rq reference mark at the current output position,
+in the current PDF document,
+.XR mark-dest ). (
+.IP \*[= D]
+Specify the content of a PDF document reference dictionary entry;
+typically, such entries are generated automatically,
+by transformation of the intermediate output resulting from the use of
+.CW pdfhref
+.CWB M \& \& \(rq, \(lq
+with the
+.CWB -X \& \& \(rq \(lq
+modifier,
+.XR create-map ); (
+however, it is also possible to specify such entries manually,
+.XR user-format ). (
+.IP \*[= L]
+Insert an active link to a named destination,
+.XR link-named ), (
+at the current output position in the current PDF document,
+such that when the reader clicks on the link text,
+the document view changes to show the location of the named destination.
+.IP \*[= W]
+Insert an active link to a \(lqweb\(rq resource,
+.XR add-weblink ), (
+at the current output position in the current PDF document.
+This is effectively the same as using the
+.CWB L \& \& \(rq \(lq
+operator to establish a link to a named destination in another PDF document,
+.XR link-extern ), (
+except that in this case, the destination is specified by a
+\(lquniform resource identifier\(rq, or
+.CW URI ;
+this may represent any Internet or local resource
+which can be specified in this manner.
+.IP \*[= F]
+Specify a user defined macro, to be called by
+.CW pdfhref ,
+when formatting the text in the active region of a link,
+.XR set-format ). (
+.IP \*[= Z]
+Define the absolute position on the physical PDF output page,
+where the \(lqhot\(hyspot\(rq associated with an active link is to be placed.
+Invoked in pairs, marking the starting and ending PDF page co\(hyordinates
+for each link \(lqhot\(hyspot\(rq, this operator is rarely, if ever,
+specified directly by the user;
+rather, appropriate
+.CW pdfhref
+.CWB Z \& \& \(rq \(lq
+specifications are inserted automatically into the document reference map
+during the PDF document formatting process,
+.XR create-map ). (
+.IP \*[= I]
+Initialise support for
+.CW pdfhref
+features.
+The current
+.CW pdfhref
+implementation provides only one such feature which requires initialisation
+\(em a helper macro which must be attached to a user supplied page trap handler,
+in order to support mapping of reference \(lqhot\(hyspots\(rq
+which extend through a page transition;
+.XR page-trap ). (
+.QE
+.NH 3
+.XN Optional Features of the \F[C]pdfhref\F[] Macro
+.LP
+The behaviour of a number of the
+.CW pdfhref
+macro operations can be modified,
+by including
+.EM "option specifiers" \(rq \(lq
+after the operation specifying argument,
+but
+.EM before
+any other arguments normally associated with the operation.
+In
+.EM all
+cases, an option is specified by an
+.EM "option flag" \(rq, \(lq
+comprising an initial hyphen,
+followed by one or two option identifying characters.
+Additionally,
+.EM some
+options require
+.EM "exactly one"
+option argument;
+for these options, the argument
+.EM must
+be specified, and it
+.EM must
+be separated from the preceding option flag by one or more
+.EM spaces ,
+(tabs
+.EM "must not"
+be used).
+It may be noted that this paradigm for specifying options
+is reminiscent of most
+.SM
+UNIX\(tm
+.LG
+shells; however, in the case of the
+.CW pdfhref
+macro, omission of the space separating an option flag from its argument is
+.EM never
+permitted.
+.LP
+A list of
+.EM all
+general purpose options supported by the
+.CW pdfhref
+macro is given below.
+Note that not all options are supported for all
+.CW pdfhref
+operations; the operations affected by each option are noted in the list.
+For
+.EM most
+operations, if an unsupported option is specified,
+it will be silently ignored; however, this behaviour should
+not be relied upon.
+.LP
+The general purpose options, supported by the
+.CW pdfhref
+macro, are:\(en
+.QS
+.IP \*[= -N\0 name > <]
+Allows the
+.CWI name > <
+associated with a PDF reference destination
+to be defined independently from the following text,
+which describes the reference.
+This option affects only the
+.CWB M \& \& \(rq \(lq
+operation of the
+.CW pdfhref
+macro,
+.XR mark-dest ). (
+.IP \*[= -E]
+Also used exclusively with the
+.CWB M \& \& \(rq \(lq
+operator, the
+.CWB -E
+option causes any specified
+.CWI descriptive \& \& \~\c
+.CWI text
+arguments,
+.XR mark-dest ), (
+to be copied, or
+.EM echoed ,
+in the body text of the document,
+at the point where the reference mark is defined;
+(without the
+.CWB -E
+option, such
+.CWI descriptive \& \& \~\c
+.CWI text
+will appear
+.EM only
+at points where links to the reference mark are placed,
+and where the standard reference display format,
+.XR set-format ), (
+is used).
+.IP \*[= -D\0 dest > <]
+Specifies the
+.CW URI ,
+or the destination name associated with a PDF active link,
+independently of the following text,
+which describes the link and demarcates the link \(lqhot\(hyspot\(rq.
+This option affects the behaviour of the
+.CW pdfhref
+macro's
+.CWB L \& \& \(rq \(lq
+and
+.CWB W \& \& \(rq \(lq
+operations.
+.IP
+When used with the
+.CWB L \& \& \(rq \(lq
+operator, the
+.CWI dest > <
+argument must specify a PDF \(lqnamed destination\(rq,
+as defined using
+.CW pdfhref
+with the
+.CWB M \& \& \(rq \(lq
+operator.
+.IP
+When used with the
+.CWB W \& \& \(rq \(lq
+operator,
+.CWI dest > <
+must specify a link destination in the form of a
+\(lquniform resource identifier\(rq, or
+.CW URI ,
+.XR add-weblink ). (
+.IP \*[= -F\0 file > <]
+When used with the
+.CWB L \& \& \(rq \(lq
+.CW pdfhref
+operator,
+.CWI file > <
+specifies an external PDF file in which the named destination
+for the link reference is defined.
+This option
+.EM must
+be specified with the
+.CWB L \& \& \(rq \(lq
+operator,
+to create a link to a destination in a different PDF document;
+when the
+.CWB L \& \& \(rq \(lq
+operator is used
+.EM without
+this option, the link destination is assumed to be defined
+within the same document.
+.IP \*[= -P\0 \(dqprefix\(hytext\(dq > <]
+Specifies
+.CWI \(dqprefix\(hytext\(dq > <
+to be attached to the
+.EM start
+of the text describing an active PDF document link,
+with no intervening space, but without itself being included in the
+active area of the link \(lqhot\(hyspot\(rq;
+it is effective with the
+.CWB L \& \& \(rq \(lq
+and
+.CWB W \& \& \(rq \(lq
+.CW pdfhref
+operators.
+.IP
+Typically, this option would be used to insert punctuation before
+the link \(lqhot\(hyspot\(rq.
+Thus, there is little reason for the inclusion of spaces in
+.CWI \(dqprefix\(hytext\(dq > < ;
+however, if such space is required, then the enclosing double quotes
+.EM must
+be specified, as indicated.
+.IP \*[= -A\0 \(dqaffixed\(hytext\(dq > <]
+Specifies
+.CWI \(dqaffixed\(hytext\(dq > <
+to be attached to the
+.EM end
+of the text describing an active PDF document link,
+with no intervening space, but without itself being included in the
+active area of the link \(lqhot\(hyspot\(rq;
+it is effective with the
+.CWB L \& \& \(rq \(lq
+and
+.CWB W \& \& \(rq \(lq
+.CW pdfhref
+operators.
+.IP
+Typically, this option would be used to insert punctuation after
+the link \(lqhot\(hyspot\(rq.
+Thus, there is little reason for the inclusion of spaces in
+.CWI \(dqaffixed\(hytext\(dq > < ;
+however, if such space is required, then the enclosing double quotes
+.EM must
+be specified, as indicated.
+.IP \*[= -T\0 tag > <]
+When specified with the
+.CWB O \& \& \(rq \(lq
+operator,
+.CWI tag > <
+is appended to the \(lqbookmark\(rq name assigned to the generated outline entry.
+This option is
+.EM required ,
+to distinguish between the series of \(lqbookmark\(rq names generated in
+individual passes of the
+.CW groff
+formatter, when the final PDF document is to be assembled
+from a number of separately formatted components;
+.XR multipart-outline ). (
+.IP \*[= -X]
+This
+.CW pdfhref
+option is used with either the
+.CWB M \& \& \(rq \(lq
+operator, or with the
+.CWB L \& \& \(rq \(lq
+operator.
+.IP
+When used with the
+.CWB M \& \& \(rq \(lq
+operator,
+.XR mark-dest ), (
+it ensures that a cross reference record for the marked destination
+will be included in the document reference map,
+.XR export-map ). (
+.IP
+When used with the
+.CWB L \& \& \(rq \(lq
+operator,
+.XR link-named ), (
+it causes the reference to be displayed in the standard cross reference format,
+.XR set-format ), (
+but substituting the
+.CWI descriptive \& \& \~\c
+.CWI text
+specified in the
+.CW pdfhref \& \(lq
+.CW L \(rq
+argument list,
+for the description specified in the document reference map.
+.IP \*[= --]
+Marks the end of the option specifiers.
+This may be used with all
+.CW pdfhref
+operations which accept options, to prevent
+.CW pdfhref
+from interpreting any following arguments as option specifiers,
+even if they would otherwise be interpreted as such.
+It is also useful when the argument list to
+.CW pdfhref
+contains special characters \(em any special character,
+which is not legal in a
+.CW groff
+macro name, will cause a parsing error, if
+.CW pdfhref
+attempts to match it as a possible option flag;
+using the
+.CW -- \(rq \(lq
+flag prevents this, so suppressing the
+.CW groff
+warning message, which would otherwise ensue.
+.IP
+Using this flag after
+.EM all
+sequences of macro options is recommended,
+even when it is not strictly necessary,
+if only for the entirely cosmetic benefit of visually separating
+the main argument list from the sequence of preceding options.
+.QE
+.LP
+In addition to the
+.CW pdfhref
+options listed above, a supplementary set of two character options are defined.
+These supplementary options, listed below, are intended for use with the
+.CWB L \& \& \(rq \(lq
+operator, in conjunction with the
+.CWB -F \& \& \~\c
+.CWBI file > <
+option, to specify alternate file names,
+in formats compatible with the file naming conventions
+of alternate operating systems;
+they will be silently ignored, if used in any other context.
+.LP
+The supported alternate file name options,
+which are ignored if the
+.CWB -F \& \& \~\c
+.CWBI file > <
+option is not specified, are:\(en
+.QS
+.IP \*[= -DF\0 dos\(hyfile > <]
+Specifies the name of the file in which a link destination is defined,
+using the file naming semantics of the
+.CW MS\(hyDOS \*(rg
+operating system.
+When the PDF document is read on a machine
+where the operating system uses the
+.CW MS\(hyDOS \*(rg
+file system, then
+.CWI dos\(hyfile > <
+is used as the name of the file containing the reference destination,
+overriding the
+.CWI file > <
+argument specified with the
+.CWB -F
+option.
+.IP \*[= -MF\0 mac\(hyfile > <]
+Specifies the name of the file in which a link destination is defined,
+using the file naming semantics of the
+.CW Apple \*(rg
+.CW Macintosh \*(rg
+operating system.
+When the PDF document is read on a machine
+where the operating system uses the
+.CW Macintosh \*(rg
+file system, then
+.CWI mac\(hyfile > <
+is used as the name of the file containing the reference destination,
+overriding the
+.CWI file > <
+argument specified with the
+.CWB -F
+option.
+.IP \*[= -UF\0 unix\(hyfile > <]
+Specifies the name of the file in which a link destination is defined,
+using the file naming semantics of the
+.CW UNIX \(tm
+operating system.
+When the PDF document is read on a machine
+where the operating system uses
+.CW POSIX
+file naming semantics, then
+.CWI unix\(hyfile > <
+is used as the name of the file containing the reference destination,
+overriding the
+.CWI file > <
+argument specified with the
+.CWB -F
+option.
+.IP \*[= -WF\0 win\(hyfile > <]
+Specifies the name of the file in which a link destination is defined,
+using the file naming semantics of the
+.CW MS\(hyWindows \*(rg
+32\(hybit operating system.
+When the PDF document is read on a machine
+where the operating system uses any of the
+.CW MS\(hyWindows \*(rg
+file systems, with long file name support, then
+.CWI win\(hyfile > <
+is used as the name of the file containing the reference destination,
+overriding the
+.CWI file > <
+argument specified with the
+.CWB -F
+option.
+.QE
+.NH 3
+.XN -N mark-dest -- Marking a Reference Destination
+.LP
+The
+.CW pdfhref
+macro may be used to create active links to any Internet resource,
+specified by its
+.CW URI ,
+or to any \(lqnamed destination\(rq,
+either within the same document, or in another PDF document.
+Although the PDF specification allows link destinations to be defined
+in terms of a page number, and an associated view specification,
+this style of reference is not currently supported by the
+.CW pdfhref
+macro, because it is not possible to adequately bind the specification
+for the destination with the intended reference context.
+.LP
+References to Internet resources are interpreted in accordance with the
+.CW W3C
+standard for defining a
+.CW URI ;
+hence the only prerequisite, for creating a link to any Internet resource,
+is that the
+.CW URI
+be properly specified, when declaring the reference;
+.XR add-weblink ). (
+In the case of references to \(lqnamed destinations\(rq in PDF documents,
+however, it is necessary to provide a mechanism for creating such
+\(lqnamed destinations\(rq.
+This may be accomplished, by invoking the
+.CW pdfhref
+macro in the form
+.QP
+.fam C
+.B ".pdfhref M"
+.B -N \& [
+.I name >] <
+.B -X ] [
+.B -E ] [
+.I "descriptive text ...\&" ] [
+.LP
+This creates a \(lqnamed destination\(rq reference mark, with its name specified by
+.CWI name > < ,
+or, if the
+.CWB -N
+option is not specified, by the first word of
+.CWI descriptive \& \& \~\c
+.CWI text \& \& ;
+(note that this imposes the restriction that,
+if the
+.CWB -N
+option is omitted, then
+.EM "at least"
+one word of
+.CWI descriptive \& \& \~\c
+.CWI text
+.EM must
+be specified).
+Additionally, a reference view will be automatically defined,
+and associated with the reference mark,
+.XR pdfhref-view ), (
+.\" and, if any
+.\" .CWI descriptive
+.\" .CWI text
+.\" is specified, or the
+and, if the
+.CWB -X
+option is specified, and no document cross reference map has been imported,
+.XR import-map ), (
+then a cross reference mapping record,
+.XR export-map ), (
+will be written to the
+.CW stdout
+stream;
+this may be captured, and subsequently used to generate a cross reference map
+for the document,
+.XR create-map ). (
+.LP
+When a \(lqnamed destination\(rq reference mark is created, using the
+.CW pdfhref
+macro's
+.CWB M \& \& \(rq \(lq
+operator, there is normally no visible effect in the formatted document; any
+.CWI descriptive \& \& \~\c
+.CWI text
+which is specified will simply be stored in the cross reference map,
+for use when a link to the reference mark is created.
+This default behaviour may be changed, by specifying the
+.CWB -E
+option, which causes any specified
+.CWI descriptive \& \& \~\c
+.CWI text
+to be \(lqechoed\(rq in the document text,
+at the point where the reference mark is placed,
+in addition to its inclusion in the cross reference map.
+.NH 4
+.XN -N export-map -- Mapping a Destination for Cross Referencing
+.LP
+Effective cross referencing of
+.EM any
+document formatted by
+.CW groff
+requires multiple pass formatting.
+Details of how this multiple pass formatting may be accomplished,
+when working with the
+.CW pdfmark
+macros, will be discussed later,
+.XR do-xref ); (
+at this stage, the discussion will be restricted to the initial preparation,
+which is required at the time when the cross reference destinations are defined.
+.LP
+The first stage, in the process of cross referencing a document,
+is the generation of a cross reference map.
+Again, the details of
+.EM how
+the cross reference map is generated will be discussed in
+.pdfhref F SECREF L -D do-xref -A ;
+.pdfhref F
+however, it is important to recognise that
+.EM what
+content is included in the cross reference map is established
+when the reference destination is defined \(em it is derived
+from the reference data exported on the
+.CW stderr
+stream by the
+.CW pdfhref
+macro, when it is invoked with the
+.CWB M \& \& \(rq \(lq
+operator, and is controlled by whatever definition of the string
+.CW PDFHREF.INFO
+is in effect, when the
+.CW pdfhref
+macro is invoked.
+.LP
+The initial default setting of
+.CW PDFHREF.INFO
+is
+.QP
+.CW ".ds PDFHREF.INFO page \e\en% \e\e$*"
+.LP
+which ensures that the cross reference map will contain
+at least a page number reference, supplemented by any
+.CWI descriptive \& \& \~\c
+.CWI text
+which is specified for the reference mark, as defined by the
+.CW pdfhref
+macro, with its
+.CWB M \& \& \(rq \(lq
+operator; this may be redefined by the user,
+to export additional cross reference information,
+or to modify the default format for cross reference links,
+.XR set-format ). (
+.NH 4
+.XN -N pdfhref-view -- Associating a Document View with a Reference Mark
+.LP
+In the same manner as each document outline reference, defined by the
+.CW pdfhref
+macro with the
+.CWB O \& \& \(rq \(lq
+operator,
+.XR add-outline ), (
+has a specific document view associated with it,
+each reference destination marked by
+.CW pdfhref
+with the
+.CWB M \& \& \(rq \(lq
+operator, requires an associated document view specification.
+.LP
+The mechanism whereby a document view is associated with a reference mark
+is entirely analogous to that employed for outline references,
+.XR outline-view ), (
+except that the
+.CW PDFHREF.VIEW
+string specification is used, in place of the
+.CW PDFBOOKMARK.VIEW
+specification.
+Thus, the reference view is defined in terms of:\(en
+.QS
+.IP \*[= PDFHREF.VIEW]
+A string,
+establishing the position of the reference mark within the viewing window,
+and the magnification at which the document will be viewed,
+at the location of the marked reference destination;
+by default, it is defined by
+.RS
+.QP
+.CW ".ds PDFHREF.VIEW /FitH \e\en[PDFPAGE.Y] u"
+.RE
+.IP
+which displays the reference destination at the top of the viewing window,
+with the magnification set to fit the page width to the width of the window.
+.IP \*[= PDFHREF.VIEW.LEADING]
+A numeric register,
+specifying additional spacing, to be placed between the top of the display
+window and the actual position at which the location of the reference
+destination appears within the window.
+This register is shared with the view specification for outline references,
+and thus has the same default initial setting,
+.RS
+.QP
+.CW ".nr PDFHREF.VIEW.LEADING 5.0p"
+.RE
+.IP
+as in the case of outline reference views.
+.IP
+Again, notice that
+.CW PDFHREF.VIEW.LEADING
+does not represent true typographic \(lqleading\(rq,
+since any preceding text, set in the specified display space,
+will be visible at the top of the viewing window,
+when the reference is selected.
+.QE
+.LP
+Just as the view associated with outline references may be changed,
+by redefining
+.CW PDFBOOKMARK.VIEW ,
+so the view associated with marked reference destinations may be changed,
+by redefining
+.CW PDFHREF.VIEW ,
+and, if desired,
+.CW PDFHREF.VIEW.LEADING ;
+such changes will become effective for all reference destinations marked
+.EM after
+these definitions are changed.
+(Notice that, since the specification of
+.CW PDFHREF.VIEW.LEADING
+is shared by both outline reference views and marked reference views,
+if it is changed, then the views for
+.EM both
+reference types are changed accordingly).
+.LP
+It may again be noted, that the
+.CW PDFPAGE.Y
+register is used in the definition of
+.CW PDFHREF.VIEW ,
+just as it is in the definition of
+.CW PDFBOOKMARK.VIEW ;
+all comments in
+.pdfhref F SECREF L -D outline-view
+.pdfhref F
+relating to its use, and indeed to page position computations in general,
+apply equally to marked reference views and to outline reference views.
+.NH 3
+.XN -N link-named -- Linking to a Marked Reference Destination
+.LP
+Any named destination, such as those marked by the
+.CW pdfhref
+macro, using it's
+.CWB M \& \& \(rq \(lq
+operator, may be referred to from any point in
+.EM any
+PDF document, using an
+.EM "active link" ;
+such active links are created by again using the
+.CW pdfhref
+macro, but in this case, with the
+.CWB L \& \& \(rq \(lq
+operator.
+This operator provides support for two distinct cases,
+depending on whether the reference destination is defined in
+the same document as the link,
+.XR link-intern ), (
+or is defined as a named destination in a different PDF document,
+.XR link-extern ). (
+.NH 4
+.XN -N link-intern -- References within a Single PDF Document
+.LP
+The general syntactic form for invoking the
+.CW pdfhref
+macro,
+when creating a link to a named destination within the same PDF document is
+.QP
+.fam C
+.B .pdfhref
+.B L
+.B -D \& [
+.BI dest-name >] <
+.B -P \& [
+.BI prefix-text >] <
+.B -A \& [
+.BI affixed-text >] <
+\e
+.br
+\0\0\0
+.B -X ] [
+.B -- ] [
+.I "descriptive text ...\&" ] [
+.LP
+where
+.CWI dest-name > <
+specifies the name of the link destination,
+as specified using the
+.CW pdfhref
+.CWB M \& \& \(rq \(lq
+operation; (it may be defined either earlier in the document,
+to create a backward reference, or later, to create a forward reference).
+.\"
+.\" Here's a example of how to add an iconic annotation.
+.\"
+.\".pdfnote -T "Internal Cross References" \
+.\" This description is rather terse, and could benefit from \
+.\" the inclusion of an example.
+.LP
+If any
+.CWI descriptive \& \& \~\c
+.CWI text
+arguments are specified, then they will be inserted into the
+.CW groff
+output stream, to define the text appearing in the \(lqhot\(hyspot\(rq
+region of the link;
+this will be printed in the link colour specified by the string,
+.CW PDFHREF.TEXT.COLOUR ,
+which is described in
+.XR-NO-PREFIX set-colour .
+If the
+.CWB -X
+option is also specified, then the
+.CWI descriptive \& \& \~\c
+.CWI text
+will be augmented, by prefacing it with page and section number indicators,
+in accordance with the reference formatting rules which are in effect,
+.XR set-format ); (
+such indicators will be included within the active link region,
+and will also be printed in the link colour.
+.LP
+Note that
+.EM either
+the
+.CWB -D \& \& \~\c
+.CWBI dest\(hyname > <
+option,
+.EM or
+the
+.CWI descriptive \& \& \~\c
+.CWI text
+arguments,
+.EM "but not both" ,
+may be omitted.
+If the
+.CWB -D \& \& \~\c
+.CWBI dest\(hyname > <
+option is omitted, then the first word of
+.CWI descriptive \& \& \~\c
+.CWI text \& \& ,
+i.e.\~all text up to but not including the first space,
+will be interpreted as the
+.CWBI dest\(hyname > <
+for the link; this text will also appear in the running text of the document,
+within the active region of the link.
+Alternatively, if the
+.CWB -D \& \& \~\c
+.CWBI dest\(hyname > <
+option
+.EM is
+specified, and
+.CWI descriptive \& \& \~\c
+.CWI text
+is not,
+then the running text which defines the reference,
+and its active region,
+will be derived from the reference description which is specified
+when the named destination is marked,
+.XR mark-dest ), (
+and will be formatted according to the reference formatting rules
+which are in effect, when the reference is placed,
+.XR set-format ); (
+in this case, it is not necessary to specify the
+.CWB -X
+option to activate automatic formatting of the reference \(em it is implied,
+by the omission of all
+.CWI descriptive \& \& \~\c
+.CWI text
+arguments.
+.LP
+The
+.CWB -P \& \& \~\c
+.CWBI prefix\(hytext > <
+and
+.CWB -A \& \& \~\c
+.CWBI affixed\(hytext > <
+options may be used to specify additional text
+which will be placed before and after the linked text respectively,
+with no intervening space.
+Such prefixed and affixed text will be printed in the normal text colour,
+and will not be included within the active region of the link.
+This feature is mostly useful for creating parenthetical references,
+or for placing punctuation adjacent to,
+but not included within,
+the text which defines the active region of the link.
+.LP
+The operation of the
+.CW pdfhref
+macro, when used with its
+.CWB L \& \& \(rq \(lq
+operator to place a link to a named PDF destination,
+may best be illustrated by an example.
+However, since the appearance of the link will be influenced by
+factors established when the named destination is marked,
+.XR mark-dest ), (
+and also by the formatting rules in effect when the link is placed,
+the presentation of a suitable exanple will be deferred,
+until the formatting mechanism has been explained,
+.XR set-format ). (
+.NH 4
+.XN -N link-extern -- References to Destinations in Other PDF Documents
+.LP
+The
+.CW pdfhref
+macro's
+.CWB L \& \& \(rq \(lq
+operator is not restricted to creating reference links
+within a single PDF document.
+When the link destination is defined in a different document,
+then the syntactic form for invoking
+.CW pdfhref
+is modified, by the addition of options to specify the
+name and location of the PDF file in which the destination is defined.
+Thus, the extended
+.CW pdfhref
+syntactic form becomes
+.QP
+.fam C
+.B .pdfhref
+.B L
+.B -F
+.BI file > <
+.B -D \& [
+.BI dest-name >] <
+\e
+.br
+\0\0\0
+.B -DF \& [
+.BI dos-file >] <
+.B -MF \& [
+.BI mac-file >] <
+.B -UF \& [
+.BI unix-file >] <
+\e
+.br
+\0\0\0
+.B -WF \& [
+.BI win-file >] <
+.B -P \& [
+.BI prefix-text >] <
+.B -A \& [
+.BI affixed-text >] <
+\e
+.br
+\0\0\0
+.B -X ] [
+.B -- ] [
+.I "descriptive text ...\&" ] [
+.LP
+where the
+.CWB -F \& \& \~\c
+.CWBI file > <
+option serves
+.EM two
+purposes: it both indicates to the
+.CW pdfhref
+macro that the specified reference destination
+is defined in an external PDF file,
+and it also specifies the normal path name,
+which is to be used to locate this file,
+when a user selects the reference.
+.LP
+In addition to the
+.CWB -F \& \& \~\c
+.CWBI file > <
+option, which
+.EM must
+be specified when referring to a destination in an external PDF file,
+the
+.CWB -DF \& \& \~\c
+.CWBI dos\(hyfile > < ,
+.CWB -MF \& \& \~\c
+.CWBI mac\(hyfile > < ,
+.CWB -UF \& \& \~\c
+.CWBI unix\(hyfile > <
+and
+.CWB -WF \& \& \~\c
+.CWBI win\(hyfile > <
+options may be used to specify the location of the file
+containing the reference destination,
+in a variety of operating system dependent formats.
+These options assign their arguments to the
+.CW /DosFile ,
+.CW /MacFile ,
+.CW /UnixFile
+and
+.CW /WinFile
+keys of the generated
+.CW pdfmark
+respectively; thus when any of these options are specified,
+.EM "in addition to"
+the
+.CWB -F \& \& \~\c
+.CWBI file > <
+option, and the document is read on the appropriate operating systems,
+then the path names specified by
+.CWBI dos\(hyfile > < ,
+.CWBI mac\(hyfile > < ,
+.CWBI unix\(hyfile > <
+and
+.CWBI win\(hyfile > <
+will be searched,
+.EM instead
+of the path name specified by
+.CWBI file > < ,
+for each of the
+.CW MS\(hyDOS \*(rg,
+.CW Apple \*(rg
+.CW Macintosh \*(rg,
+.CW UNIX \(tm
+and
+.CW MS\(hyWindows \*(rg
+operating systems, respectively; see the
+.pdfmark-manual ,
+for further details.
+.LP
+Other than the use of these additional options,
+which specify that the reference destination is in an external PDF file,
+the behaviour of the
+.CW pdfhref
+.CWB L \& \& \(rq \(lq
+operator, with the
+.CWB -F \& \& \~\c
+.CWBI file > <
+option, remains identical to its behaviour
+.EM without
+this option,
+.XR link-intern ), (
+with respect to the interpretation of other options,
+the handling of the
+.CWI descriptive \& \& \~\c
+.CWI text
+arguments, and the formatting of the displayed reference.
+.LP
+Once again, since the appearance of the reference is determined by
+factors specified in the document reference map,
+and also by the formatting rules in effect when the reference is placed,
+the presentation of an example of the placing of
+a reference to an external destination will be deferred,
+until the formatting mechanism has been explained,
+.XR set-format ). (
+.NH 3
+.XN -N add-weblink -- Linking to Internet Resources
+.LP
+In addition to supporting the creation of cross references
+to named destinations in PDF documents, the
+.CW pdfhref
+macro also has the capability to create active links to Internet resources,
+or indeed to
+.EM any
+resource which may be specified by a Uniform Resource Identifier,
+(which is usually abbreviated to the acronym \(lqURI\(rq,
+and sometimes also referred to as a Uniform Resource Locator,
+or \(lqURL\(rq).
+.LP
+Since the mechanism for creating a link to a URI differs somewhat
+from that for creating PDF references, the
+.CW pdfhref
+macro is invoked with the
+.CWB W \& \& \(rq \(lq
+(for \(lqweb\(hylink\(rq) operator, rather than the
+.CWB L \& \& \(rq \(lq
+operator; nevertheless, the invocation syntax is similar, having the form
+.QP
+.fam C
+.B .pdfhref
+.B W
+.B -D \& [
+.BI URI >] <
+.B -P \& [
+.BI prefix-text >] <
+.B -A \& [
+.BI affixed-text >] <
+\e
+.br
+\0\0\0
+.B -- ] [
+.I "descriptive text ...\&"
+.LP
+where the optional
+.CWB -D
+.CWBI URI > <
+modifier specifies the address for the target Internet resource,
+in any appropriate
+.EM "Uniform Resource Identifier"
+format, while the
+.CWI descriptive
+.CWI text
+argument specifies the text which is to appear in the \(lqhot\(hyspot\(rq
+region, and the
+.CWB -P
+.CWBI prefix\(hytext > <
+and
+.CWB -A
+.CWBI affixed\(hytext > <
+options have the same effect as in the case of local document links,
+.XR link-intern ). (
+.LP
+Notice that it is not mandatory to include the
+.CWB -D
+.CWBI URI > <
+in the link specification; if it
+.EM is
+specified, then it is not necessary for the URI to appear,
+in the running text of the document \(em the
+.CWI descriptive
+.CWI text
+argument exactly defines the text
+which will appear within the \(lqhot\(hyspot\(rq region,
+and this need not include the URI.
+However, if the
+.CWB -D \& \& \~\c
+.CWBI URI > <
+specification is omitted, then the
+.CWI descriptive
+.CWI text
+argument
+.EM must
+be an
+.EM exact
+representation of the URI, which
+.EM will ,
+therefore, appear as the entire content of the \(lqhot\(hyspot\(rq.
+For example, we could introduce a reference to
+.pdfhref W -D \*[GROFF-WEBSITE] -A , the groff web site
+in which the actual URI is concealed, by using mark up such as:\(en
+.DS I
+.CW
+For example, we could introduce a reference to
+\&.pdfhref W -D \*[GROFF-WEBSITE] -A , the groff web site
+in which the actual URI is concealed,
+.DE
+Alternatively,
+to refer the reader to the groff web site,
+making it obvious that the appropriate URI is
+.pdfhref W -A , \*[GROFF-WEBSITE]
+the requisite mark up might be:\(en
+.DS I
+.CW
+to refer the reader to the groff web site,
+making it obvious that the appropriate URI is
+\&.pdfhref W -A , \*[GROFF-WEBSITE]
+the requisite mark up might be:\e(en
+.DE
+.NH 3
+.XN -N set-format -- Establishing a Format for References
+.LP
+There are two principal aspects to be addressed,
+when defining the format to be used when displaying references.
+Firstly, it is desirable to provide a visual cue,
+to indicate that the text describing the reference is imbued
+with special properties \(em it is dynamically linked to the reference
+destination \(em and secondly, the textual content should
+describe where the link leads, and ideally,
+it should also describe the content of the reference destination.
+.LP
+The visual cue,
+that a text region defines a dynamically linked reference,
+is most commonly provided by printing the text within the active
+region in a distinctive colour.
+This technique will be employed automatically by the
+.CW pdfhref
+macro \(em
+.XR set-colour
+\(em unless the user specifically chooses to adopt, and implement,
+some alternative strategy.
+.NH 4
+.XN -N set-colour -- Using Colour to Demarcate Link Regions
+.LP
+Typically, when a PDF document contains
+.EM active
+references to other locations, either within the same document,
+or even in other documents, or on the World Wide Web,
+it is usually desirable to make the regions
+where these active links are placed stand out from the surrounding text.
+.NH 4
+.XN -N user-format -- Specifying Reference Text Explicitly
+.NH 4
+.XN -N auto-format -- Using Automatically Formatted Reference Text
+.NH 4
+.XN -N custom-format -- Customising Automatically Formatted Reference Text
+.LP
+It is incumbent on the user,
+if employing automatic formatting of the displayed reference,
+.XR set-format ), (
+to ensure that an appropriate reference definition
+is created for the reference destination,
+and is included in the reference map for the document
+in which the reference will appear;
+thus, it may be easiest to
+.EM always
+use manual formatting for external references.
+.NH 3
+.XN Problematic Links
+.LP
+Irrespective of whether a
+.CW pdfhref
+reference is placed using the
+.CWB L \& \& \(rq \(lq
+operator, or the
+.CWB W \& \& \(rq \(lq
+operator, there may be occasions when the resulting link
+does function as expected.
+A number of scenarios, which are known to be troublesome,
+are described below.
+.NH 4
+.XN -N page-trap -- Links with a Page Transition in the Active Region
+.LP
+When a link is placed near the bottom of a page,
+it is possible that its active region, or \(lqhot\(hyspot\(rq,
+may extend on to the next page.
+In this situation, a page trap macro is required
+to intercept the page transition, and to restart the mapping of
+the \(lqhot\(hyspot\(rq boundary on the new page.
+.LP
+The
+.CW pdfmark
+macro package includes a suitable page trap macro, to satisfy this requirement.
+However, to avoid pre\(hyempting any other requirement the user may have for
+a page transition trap, this is
+.EM not
+installed as an active page trap,
+unless explicitly requested by the user.
+.LP
+To enable proper handling of page transitions,
+which occur within the active regions of reference links,
+the user should:\(en
+.QS
+.nr ITEM 0 1
+.IP \n+[ITEM].
+Define a page transition macro, to provide whatever features may be required,
+when a page transition occurs \(em e.g.\& printing footnotes,
+adding page footers and headers, etc.
+This macro should end by setting the output position at the correct
+vertical page offset, where the printing of running text is to restart,
+following the page transition.
+.IP \n+[ITEM].
+Plant a trap to invoke this macro, at the appropriate vertical position
+marking the end of normal running text on each page.
+.KS
+.IP \n+[ITEM].
+Initialise the
+.CW pdfhref
+hook into this page transition trap, by invoking
+.RS
+.IP
+.fam C
+.B "pdfhref I -PT"
+.BI macro-name > <
+.LP
+where
+.CWBI macro-name > <
+is the name of the user supplied page trap macro,
+to ensure that
+.CW pdfhref
+will correctly restart mapping of active link regions,
+at the start of each new page.
+.KE
+.RE
+.QE
+.LP
+It may be observed that this initialisation of the
+.CW pdfhref
+page transition hook is, typically, required only once
+.EM before
+document formatting begins.
+Users of document formatting macro packages may reasonably expect that
+this initialisation should be performed by the macro package itself.
+Thus, writers of such macro packages which include
+.CW pdfmark
+bindings, should provide appropriate initialisation,
+so relieving the end user of this responsibility.
+The following example, abstracted from the sample
+.CW ms
+binding package,
+.CW spdf.tmac ,
+illustrates how this may be accomplished:\(en
+.DS I
+.CW
+\&.\e" groff "ms" provides the "pg@bottom" macro, which has already
+\&.\e" been installed as a page transition trap. To ensure proper
+\&.\e" mapping of "pdfhref" links which overflow the bottom of any
+\&.\e" page, we need to install the "pdfhref" page transition hook,
+\&.\e" as an addendum to this macro.
+\&.
+\&.pdfhref I -PT pg@bottom
+.DE
+.NH 2
+.XN -N add-note -- Annotating a PDF Document using Pop-Up Notes
+.NH 2
+.XN -N pdfsync -- Synchronising Output and \F[C]pdfmark\F[] Contexts
+.LP
+It has been noted previously, that the
+.CW pdfview
+macro,
+.XR docview ), (
+the
+.CW pdfinfo
+macro,
+.XR docinfo ), (
+and the
+.CW pdfhref
+macro, when used to create a document outline,
+.XR add-outline ), (
+do not immediately write their
+.CW pdfmark
+output to the PostScript\*(rg data stream;
+instead, they cache their output, in a
+.CW groff
+diversion, in the case of the
+.CW pdfview
+and
+.CW pdfinfo
+macros, or in an ordered collection of strings and numeric registers,
+in the case of the document outline,
+until a more appropriate time for copying it out.
+In the case of
+.CW pdfview
+and
+.CW pdfinfo
+\(lqmeta\(hydata\(rq,
+this \(lqmore appropriate time\(rq is explicitly chosen by the user;
+in the case of document outline data,
+.EM some
+cached data may be implicitly written out as the document outline is compiled,
+but there will
+.EM always
+be some remaining data, which must be explicitly flushed out, before the
+.CW groff
+formatting process is allowed to complete.
+.LP
+To allow the user to choose when cached
+.CW pdfmark
+data is to be flushed to the output stream, the
+.CW pdfmark
+macro package provides the
+.CW pdfsync
+macro, (to synchronise the cache and output states).
+In its simplest form, it is invoked without arguments, i.e.
+.QP
+.fam C
+.B .pdfsync
+.LP
+This form of invocation ensures that
+.EM both
+the \(lqmeta\(hydata cache\(rq, containing
+.CW pdfview
+and
+.CW pdfinfo
+data,
+.EM and
+the \(lqoutline cache\(rq,
+containing any previously uncommitted document outline data,
+are flushed; ideally, this should be included in a
+.CW groff
+\(lqend macro\(rq, to ensure that
+.EM both
+caches are flushed, before
+.CW groff
+terminates.
+.LP
+Occasionally,
+it may be desirable to flush either the \(lqmeta\(hydata cache\(rq,
+without affecting the \(lqoutline cache\(rq, or vice\(hyversa,
+at a user specified time, prior to reaching the end of the document.
+This may be accomplished, by invoking the
+.CW pdfsync
+macro with an argument, i.e.
+.QP
+.fam C
+.B ".pdfsync M"
+.LP
+to flush only the \(lqmeta\(hydata cache\(rq, or
+.QP
+.fam C
+.B ".pdfsync O"
+.LP
+to flush only the \(lqoutline cache\(rq.
+.LP
+The \(lqmeta\(hydata cache\(rq can normally be safely flushed
+in this manner, at any time
+.EM after
+output of the first page has started;
+(it may cause formatting problems,
+most notably the appearance of unwanted white space, if flushed earlier,
+or indeed, if flushed immediately after a page transition,
+but before the output of the content on the new page has commenced).
+Caution is required, however, when explicitly flushing the
+\(lqoutline cache\(rq, since if the outline is to be
+subsequently extended, then the first outline entry after flushing
+.EM must
+be specified at level 1.
+Nevertheless, such explict flushing may occasionally be necessary;
+for example, the
+.CW TC
+macro in the
+.CW spdf.tmac
+package,
+.XR using-spdf ), (
+invokes
+.CW ".pdfsync\ O" \(rq \(lq
+to ensure that the outline for the \(lqbody\(rq section of the document
+is terminated,
+.EM before
+it commences the formatting of the table of contents section.
+.bp
+.NH 1
+.XN -N pdf-layout -- PDF Document Layout
+.LP
+The
+.CW pdfmark
+macros described in the preceding section,
+.XR pdf-features ), (
+provide no inherent document formatting capability of their own.
+However,
+they may be used in conjunction with any other
+.CW groff
+macro package of the user's choice,
+to add such capability.
+.LP
+In preparing this document, the standard
+.CW ms
+macro package, supplied as a component of the GNU Troff distribution,
+has been employed.
+To facilitate the use of the
+.CW pdfmark
+macros with the
+.CW ms
+macros,
+a binding macro package,
+.CW spdf.tmac ,
+has been created.
+The use of this binding macro package is described in the following section,
+.XR using-spdf ); (
+it may also serve as an example to users of other standard
+.CW groff
+macro packages,
+as to how the
+.CW pdfmark
+macros may be employed with their chosen primary macro package.
+.NH 2
+.XN -N using-spdf -- Using \F[C]pdfmark\F[] Macros with the \F[C]ms\F[] Macro Package
+.LP
+The use of the binding macro package,
+.CW spdf.tmac ,
+allows for the use of the
+.CW pdfmark
+macros in conjunction with the
+.CW ms
+macros,
+simply by issuing a
+.CW groff
+command of the form
+.QP
+.fam C
+groff -Tps
+.B -mspdf
+.I "-options ...\&" ] [
+file(s) ...
+.LP
+When using the
+.CW spdf.tmac
+package, the
+.CW groff
+input files may be marked up using any of the standard
+.CW ms
+macros to specify document formatting,
+while PDF features may be added,
+using any of the
+.CW pdfmark
+macros described previously,
+.XR pdf-features ). (
+Additionally,
+.CW spdf.tmac
+defines a number of convenient extensions to the
+.CW ms
+macro set, to better accomodate the use of PDF features within the
+.CW ms
+formatting framework,
+and to address a number of
+.CW ms
+document layout issues,
+which require special handling when producing PDF documents.
+These additional macros,
+and the issues they are intended to address,
+are described below.
+.NH 3
+.XN \F[C]ms\F[] Section Headings in PDF Documents
+.LP
+Traditionally,
+.CW ms
+provides the
+.CW NH
+and
+.CW SH
+macros, to specify section headings.
+However,
+there is no standard mechanism for generating a
+table of contents entry based on the text of the section heading;
+neither is there any recognised standard method for establishing a
+cross reference link to the section.
+.LP
+To address this
+.CW ms
+limitation,
+.CW spdf.tmac
+defines the
+.CW XN
+macro,
+.XR xn-macro ), (
+to be used in conjunction with the
+.CW NH
+macro.
+.NH 4
+.XN -N xn-macro -- The \F[C]XN\F[] Macro
+.NH 1
+.XN The PDF Publishing Process
+.NH 2
+.XN -N do-xref -- Resolving Cross References
+.NH 3
+.XN -N create-map -- Creating a Document Reference Map
+.NH 3
+.XN -N import-map -- Deploying a Document Reference Map
+.TC
diff --git a/contrib/groff/contrib/pdfmark/pdfmark.tmac b/contrib/groff/contrib/pdfmark/pdfmark.tmac
new file mode 100644
index 000000000000..385185c42af5
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/pdfmark.tmac
@@ -0,0 +1,1562 @@
+.\" -*- nroff -*-
+.ig
+
+pdfmark.tmac
+
+Copyright (C) 2004
+ Free Software Foundation, Inc.
+ Written by Keith Marshall (keith.d.marshall@ntlworld.com)
+
+This file is part of groff.
+
+groff is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+groff is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License along
+with groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+Author's Note
+=============
+
+While I have written this macro package from scratch, much of my
+inspiration has come from discussion on the groff mailing list
+(mailto:groff@gnu.org). I am particularly indebted to:
+
+ Kees Zeelenberg, for an earlier macro package he posted,
+ a study of which helped me to get started.
+
+ Carlos J. G. Duarte and Werner Lemberg, whose discussion
+ on computation of the bounding boxes for link "hot-spots"
+ forms the basis of such computations in this package.
+..
+.if !\n(.g .ab These pdfmark macros require groff.
+.\"
+.\" Check if we have already been loaded -- do not reload
+.if d pdfmark .nx
+.\"
+.\" ======================================================================
+.\" Module PDFMARK: Insert Arbitrary PDFMARK Code in the PostScript Stream
+.\" ======================================================================
+.\"
+.\" PDFMARK output may be disabled, by zeroing the PDFOPMODE register,
+.\" ( which mimics a more generic OPMODE, if it is defined ).
+.\"
+.if rOPMODE .aln PDFOPMODE OPMODE
+.\"
+.\" but if OPMODE wasn't defined,
+.\" then make the default PDFMARK mode ENABLED.
+.\"
+.if !rPDFOPMODE .nr PDFOPMODE 1
+.\"
+.\" The "pdfmark" macro is responsible for emitting the appropriate
+.\" PostScript code.
+.\"
+.de pdfmark
+.\" ----------------------------------------------------------------
+.\" Usage:
+.\" .pdfmark text of pdfmark instruction
+.\" Macro supplies the required opening "[" and closing "pdfmark"
+.\" operator; DO NOT include them in the instruction text!
+.\" ----------------------------------------------------------------
+.\"
+.if \\n[PDFOPMODE] \X'ps:exec [\\$* pdfmark'\c
+..
+.\"
+.\" Some supporting macros defer actual pdfmark output until an
+.\" appropriate time for it to be written; the "pdfsync" macro
+.\" provides a mechanism for flushing such deferred output;
+.\" it should be called from an end macro, and at any other time
+.\" when it may be deemed necessary to flush pdfmark context.
+.\"
+.de pdfsync
+.\" ----------------------------------------------------------------
+.\" Usage:
+.\" .pdfsync buffer ...
+.\" Arguments indicate which "buffer(s)" to flush:
+.\" O -> bookmark (outline) cache
+.\" M -> document metadata diversion
+.\" If no argument, flush ALL buffers
+.\" ----------------------------------------------------------------
+.\"
+.ie \\n(.$ \{\
+. while \\n(.$ \{\
+. if '\\$1'O' .pdf:bm.sync 1
+. if '\\$1'M' \{\
+. if dpdf:metadata .pdf:metadata
+. rm pdf:metadata
+. \}
+. shift
+. \}
+. \}
+.el .pdfsync O M
+..
+.\"
+.\" some helper functions ...
+.\"
+.\" "pdf:warn" and "pdf:error" write diagnostic messages to stderr
+.\"
+.de pdf:warn
+.\" ----------------------------------------------------------
+.\" Usage:
+.\" .pdf:warn text of message
+.\" ----------------------------------------------------------
+.\"
+.tm \\n(.F:\\n(.c: macro warning: \\$*
+..
+.de pdf:error
+.\" ----------------------------------------------------------
+.\" Usage:
+.\" .pdf:error text of message
+.\" ----------------------------------------------------------
+.\"
+.tm \\n(.F:\\n(.c: macro error: \\$*
+..
+.\" "pdf:pop", assisted by "pdf*pop", allows us to retrieve register,
+.\" or string values, from a string masquerading as a data queue,
+.\" or as a stack.
+.\"
+.de pdf:pop
+.\" ----------------------------------------------------------------
+.\" Usage:
+.\" .pdf:pop <type> <to-name> <from-name>
+.\" $1 = nr for numeric register, ds for string
+.\" $2 = name of register or string to be assigned
+.\" $3 = name of string, from which data is to be retrieved
+.\" ----------------------------------------------------------------
+.\"
+.pdf*pop \\$* \\*[\\$3]
+..
+.de pdf*pop
+.ds pdf:stack \\$3
+.\\$1 \\$2 \\$4
+.shift 4
+.ie \\n(.$ .ds \\*[pdf:stack] \\$*
+.el .rm \\*[pdf:stack]
+.rm pdf:stack
+..
+.\"
+.\"
+.\" ===========================================================
+.\" Module PDFINFO: Insert MetaData Entries into a PDF Document
+.\" ===========================================================
+.\"
+.\" N.B.
+.\" Output from the macros in this module is deferred, until
+.\" subsequent invocation of .pdfsync, or .pdfexit
+.\"
+.\" ."pdfinfo" provides a general purpose form of metadata entry ...
+.\" it allows arbitrary text to be associated with any specified
+.\" metadata field name.
+.\"
+.de pdfinfo
+.\" -------------------------------------------------------------------
+.\" Usage:
+.\" .pdfinfo /FieldName field content ...
+.\" Examples:
+.\" .pdfinfo /Title A PDF Document
+.\" .pdfinfo /Author Keith Marshall
+.\" -------------------------------------------------------------------
+.\"
+.ds pdf:meta.field \\$1
+.shift
+.da pdf:metadata
+\!.pdfmark \\*[pdf:meta.field] (\\$*) /DOCINFO
+.di
+.rm pdf:meta.field
+..
+.\"
+.\" Macro "pdfview" defines a special form of metadata entry ...
+.\" it uses the /DOCVIEW pdfmark, to specify the initial (default) view,
+.\" when the document is opened.
+.\"
+.de pdfview
+.\" -------------------------------------------------------------------
+.\" Usage:
+.\" .pdfview view parameters ...
+.\" Examples:
+.\" .pdfview /PageMode /UseOutlines
+.\" .pdfview /Page 2 /View [/FitH \n(.p u]
+.\" -------------------------------------------------------------------
+.\"
+.da pdf:metadata
+\!.pdfmark \\$* /DOCVIEW
+.di
+..
+.\"
+.\"
+.\" =====================================================================
+.\" Module PDFNOTE: Insert "Sticky Note" Style Comments in a PDF Document
+.\" =====================================================================
+.\"
+.\" "PDFNOTE.WIDTH" and "PDFNOTE.HEIGHT" set the preferred size for
+.\" display of the "sticky note" pane, when opened. Acrobat Reader
+.\" seems not to honour these -- perhaps GhostScript doesn't encode
+.\" them correctly! Anyway, let's set some suitable default values,
+.\" in case the user has a set up which does work as advertised.
+.\"
+.nr PDFNOTE.WIDTH 3.5i
+.nr PDFNOTE.HEIGHT 2.0i
+.\"
+.\" "pdf:bbox" defines the expression used to set the size and location
+.\" of the bounding rectangle for display of notes and link "hot-spots".
+.\" This is defined, such that a note is placed at troff's current text
+.\" position on the current page, with its displayed image size defined
+.\" by the "PDFNOTE.WIDTH" and "PDFNOTE.HEIGHT" registers, while the
+.\" bounds for a link "hot-spot" are matched to the text region which
+.\" defines the "hot-spot".
+.\"
+.ds pdf:bbox \\n[pdf:llx] u \\n[pdf:lly] u \\n[pdf:urx] u \\n[pdf:ury] u
+.\"
+.\" Getting line breaks into the text of a PDFNOTE is tricky -- we need
+.\" to get a "\n" into the PostScript stream, but three levels of "\" are
+.\" swallowed, when we invoke "pdfnote". The following definition of "PDFLB",
+.\" (for LineBreak), is rather ugly, but does allow us to use
+.\"
+.\" .pdfnote Some text.\*[PDFLB]Some more text, on a new line.
+.\"
+.ds PDFLB \\\\\\\\\\\\\\\\n
+.\"
+.de pdfnote
+.\" ----------------------------------------------------------------------
+.\" Usage:
+.\" .pdfnote [-T "Text for Title"] Text of note ...
+.\" ----------------------------------------------------------------------
+.\"
+.if \\n[PDFOPMODE] \{\
+.\"
+.\" First, compute the bounding rectangle,
+.\" for this PDFNOTE instance
+.\"
+. mk pdf:ury
+. nr pdf:llx \\n(.k+\\n(.o+\\n[.in]
+. nr pdf:lly \\n[pdf:ury]-\\n[PDFNOTE.HEIGHT]
+. nr pdf:urx \\n[pdf:llx]+\\n[PDFNOTE.WIDTH]
+. ds pdf:note.instance /Rect [\\*[pdf:bbox]]
+.\"
+.\" Parse any specified (recognisable) PDFNOTE options
+.\"
+. while dpdf:note\\$1 \{\
+. pdf:note\\$1 \\$@
+. shift \\n[pdf:note.argc]
+. \}
+.\"
+.\" Emit the note, and clean up
+.\"
+. pdfmark \\*[pdf:note.instance] /Contents (\\$*) /ANN
+. rm pdf:note.instance
+. rr pdf:note.argc
+. \}
+..
+.de pdf:note-T
+.nr pdf:note.argc 2
+.as pdf:note.instance " /Title (\\$2)
+..
+.\"
+.\"
+.\" =====================================================================
+.\" Module PDFBOOKMARK: Add an Outline Reference in the PDF Bookmark Pane
+.\" =====================================================================
+.\"
+.\" "PDFBOOKMARK.VIEW" controls how the document will be displayed,
+.\" when the user selects a bookmark. This default setting will fit
+.\" the page width to the viewing window, with the bookmarked entry
+.\" located at the top of the viewable area.
+.\"
+.ds PDFBOOKMARK.VIEW /FitH \\n[PDFPAGE.Y] u
+.\"
+.\" "PDFOUTLINE.FOLDLEVEL" controls how the document outline will be
+.\" displayed. It is a number, defining the maximum heading level
+.\" which will be visible, without outline expansion by the user, in
+.\" the initial view of the document outline. Assuming that no sane
+.\" document will ever extend to 10,000 levels of nested headings,
+.\" this initial default value causes outlines to be fully expanded.
+.\"
+.nr PDFOUTLINE.FOLDLEVEL 10000
+.\"
+.\" The actual job of creating an outline reference
+.\" is performed by the "pdfbookmark" macro.
+.\"
+.de pdfbookmark
+.\" ------------------------------------------------------------------
+.\" Usage:
+.\" .pdfbookmark [-T tag] level "Text of Outline Entry"
+.\"
+.\" $1 = nesting level for bookmark (1 is top level)
+.\" $2 = text for bookmark, (in PDF viewer bookmarks list)
+.\" $3 = suffix for PDF internal bookmark name (optional)
+.\" ------------------------------------------------------------------
+.\"
+.if \\n[PDFOPMODE] \{\
+.\"
+.\" Make the bookmark name "untagged" by default,
+.\" then parse any specified options, to set a "tag", if required
+.\"
+. ds pdf:href-T
+. while dpdf:href.opt\\$1 \{\
+. pdf:href.opt\\$1 \\$@
+. shift \\n[pdf:href.argc]
+. \}
+. rr pdf:href.argc
+.\"
+.\" If we found "--" to mark the end of the options, discard it
+.\"
+. if '\\$1'--' .shift
+.\"
+.\" Synchronise the bookmark cache
+.\" to the requested bookmark nesting level
+.\"
+. pdf:bm.sync \\$1
+. shift
+.\"
+.\" Increment the bookmark serialisation index
+.\" in order to generate a uniquely serialised bookmark name,
+.\" ( which we return in the string "PDFBOOKMARK.NAME" ),
+.\" and insert this bookmark into the cache
+.\"
+. pdf:href.sety
+. nr pdf:bm.nr +1
+. ds PDFBOOKMARK.NAME pdf:bm\\n[pdf:bm.nr]\\*[pdf:href-T]
+. ds pdf:bm\\n[pdf:bm.nr] /Dest /\\*[PDFBOOKMARK.NAME]
+. pdfmark \\*[pdf:bm\\n[pdf:bm.nr]] /View [\\*[PDFBOOKMARK.VIEW]] /DEST
+. as pdf:bm\\n[pdf:bm.nr] " /Title (\\$*)
+. pdf:href.options.clear
+. rr PDFPAGE.Y
+. \}
+..
+.\"
+.\" Macro "pdf:bm.sync" is called for each bookmark created,
+.\" to establish a cache entry at the appropriate nesting level.
+.\" It will flush ALL previous cache content, when called to
+.\" add a new bookmark at level 1, or if simply called at
+.\" level 1, without adding any bookmark.
+.\"
+.de pdf:bm.sync
+.\" ------------------------------------------------------------------
+.\" Usage:
+.\" .pdf:bm.sync level
+.\" $1 = nesting level of current bookmark, or 1 to flush cache
+.\" ------------------------------------------------------------------
+.\"
+.\" First validate the bookmark nesting level
+.\" adjusting it if required
+.\"
+.if \\$1>\\n[pdf:bm.nl] .nr pdf:bm.nl +1
+.ie \\$1>\\n[pdf:bm.nl] \{\
+. pdf:warn adjusted level \\$1 bookmark; should be <= \\n[pdf:bm.nl]
+. \}
+.el .nr pdf:bm.nl \\$1
+.if \\n[pdf:bm.nl]<1 \{\
+. pdf:warn bad arg (\\$1) in \\$0 \\$1; \\$0 1 forced
+. nr pdf:bm.nl 1
+. \}
+.\"
+.\" If reverting from a higher to a lower nesting level,
+.\" cyclicly adjust cache counts for each pending higher level
+.\"
+.if \\n[pdf:bm.lc]>=\\n[pdf:bm.nl] \{\
+. nr pdf:bm.lc +1
+. if !rpdf:bm.c\\n[pdf:bm.lc].c .nr pdf:bm.c\\n[pdf:bm.lc].c 0
+. while \\n[pdf:bm.lc]>\\n[pdf:bm.nl] \{\
+. as pdf:bm.c\\n[pdf:bm.lc] " \\n[pdf:bm.c\\n[pdf:bm.lc].c]
+. rr pdf:bm.c\\n[pdf:bm.lc].c
+. nr pdf:bm.lc -1
+. \}
+. \}
+.\"
+.\" Update the cache level,
+.\" flushing when we are at level 1
+.\"
+.nr pdf:bm.lc \\n[pdf:bm.nl]
+.ie \\n[pdf:bm.nl]=1 \{\
+. while \\n[pdf:bm.ic]<\\n[pdf:bm.nr] .pdf:bm.emit 0
+. rr pdf:bm.rc
+. \}
+.el .nr pdf:bm.c\\n[pdf:bm.nl].c +1
+..
+.\" Macro "pdf:bm.emit" is called, when the cache is at level 1.
+.\" This flushes ALL pending bookmarks from the cache, i.e. the
+.\" preceding level 1 bookmark, and any nested dependents,
+.\" which it may have.
+.\"
+.de pdf:bm.emit
+.\" ------------------------------------------------------------------
+.\" Usage:
+.\" .pdf:bm.emit flag
+.\" $1 = reference counting flag, used to control recursion
+.\" ------------------------------------------------------------------
+.\"
+.\" First check for nested dependents,
+.\" and append the "dependent count" to the bookmark, as required.
+.\"
+.nr pdf:bm.ic +1
+.nr pdf:bm.lc +1
+.pdf:pop nr pdf:bm.rc pdf:bm.c\\n[pdf:bm.lc]
+.if \\n[pdf:bm.rc] \{\
+. ds pdf:bm.fold
+. if \\n[pdf:bm.lc]>\\n[PDFOUTLINE.FOLDLEVEL] .ds pdf:bm.fold -
+. as pdf:bm\\n[pdf:bm.ic] " /Count \\*[pdf:bm.fold]\\n[pdf:bm.rc]
+. rm pdf:bm.fold
+. \}
+.pdfmark \\*[pdf:bm\\n[pdf:bm.ic]] /OUT
+.rm pdf:bm\\n[pdf:bm.ic]
+.\"
+.\" For ALL dependents, if any,
+.\" recursively flush out any higher level dependents,
+.\" which they themselves may have
+.\"
+.while \\n[pdf:bm.rc] \{\
+. nr pdf:bm.rc -1
+. pdf:bm.emit \\n[pdf:bm.rc]
+. \}
+.\"
+.\" Finally,
+.\" unwind the recursive call stack, until we return to the top level.
+.\"
+.nr pdf:bm.rc \\$1
+.nr pdf:bm.lc -1
+..
+.nr pdf:bm.nr 0
+.nr pdf:bm.nl 1
+.nr pdf:bm.lc 0
+.nr pdf:bm.ic 0
+.\"
+.\"
+.\" =============================================================
+.\" Module PDFHREF: Create Hypertext References in a PDF Document
+.\" =============================================================
+.\"
+.\" "PDFHREF.VIEW" controls how the document will be displayed,
+.\" when the user follows a link to a named reference.
+.\"
+.ds PDFHREF.VIEW /FitH \\n[PDFPAGE.Y] u
+.\"
+.\" This default setting will fit the page width to the viewing
+.\" window, with the bookmarked entry located close to the top
+.\" of the viewable area. "PDFHREF.VIEW.LEADING" controls the
+.\" actual distance below the top of the viewing window, where
+.\" the reference will be positioned; 5 points is a reasonable
+.\" default offset.
+.\"
+.nr PDFHREF.VIEW.LEADING 5.0p
+.\"
+.\" Yuk!!!
+.\" PDF view co-ordinates are mapped from the bottom left corner,
+.\" of the page, whereas page printing co-ordinates are mapped
+.\" conventionally, from top left.
+.\"
+.\" Macro "pdf:href.sety" transforms the vertical position of the
+.\" last printed baseline, from the printing co-ordinate domain to
+.\" the PDF view domain.
+.\"
+.de pdf:href.sety
+.\" ----------------------------------------------------------------
+.\" Usage:
+.\" .pdf:href.sety
+.\" ----------------------------------------------------------------
+.\"
+.\" This computation yields the vertical view co-ordinate
+.\" in groff's basic units; don't forget to append grops' "u"
+.\" conversion operator, when writing the pdfmark!
+.\"
+.nr PDFPAGE.Y \\n(.p-\\n(nl+\\n[PDFHREF.VIEW.LEADING]
+..
+.\" When we create a link "hot-spot" ...
+.\" "PDFHREF.LEADING" sets the distance above the top of the glyph
+.\" bounding boxes, in each line of link text, over which the link
+.\" hot-spot will extend, while "PDFHREF.HEIGHT" sets the hot-spot
+.\" height, PER LINE of text occupied by the reference.
+.\"
+.\" Since most fonts specify some leading space within the bounding
+.\" boxes of their glyphs, a better appearance may be achieved when
+.\" NEGATIVE leading is specified for link hot-spots; indeed, when
+.\" the default 10pt Times font is used, -1.0 point seems to be a
+.\" reasonable default value for "PDFHREF.LEADING" -- it may be
+.\" changed, if desired.
+.\"
+.\" "PDFHREF.HEIGHT" is initially set as one vertical spacing unit;
+.\" note that it is defined as a string, so it will adapt to changes
+.\" in the vertical spacing. Changing it is NOT RECOMMENDED.
+.\"
+.nr PDFHREF.LEADING -1.0p
+.ds PDFHREF.HEIGHT 1.0v
+.\"
+.\" PDF readers generally place a rectangular border around link
+.\" "hot-spots". Within text, this looks rather ugly, so we set
+.\" "PDFHREF.BORDER" to suppress it -- the three zeroes represent
+.\" the border parameters in the "/Border [0 0 0]" PDFMARK string,
+.\" and may be changed to any valid form, as defined in Adobe's
+.\" PDFMARK Reference Manual.
+.\"
+.ds PDFHREF.BORDER 0 0 0
+.\"
+.\" "PDFHREF.COLOUR" (note British spelling) defines the colour to
+.\" be used for display of link "hot-spots". This will apply both
+.\" to borders, if used, and, by default to text; however, actual
+.\" text colour is set by "PDFHREF.TEXT.COLOUR", which may be reset
+.\" independently of "PDFHREF.COLOUR", to achieve contrasting text
+.\" and border colours.
+.\"
+.\" "PDFHREF.COLOUR" must be set to a sequence of three values,
+.\" each in the range 0.0 .. 1.0, representing the red, green, and
+.\" blue components of the colour specification in the RGB colour
+.\" domain, which is shared by "groff" and the PDF readers.
+.\"
+.ds PDFHREF.COLOUR 0.35 0.00 0.60
+.defcolor pdf:href.colour rgb \*[PDFHREF.COLOUR]
+.\"
+.\" "PDFHREF.TEXT.COLOUR", on the other hand, is simply defined
+.\" using any "groff" colour name -- this default maps it to the
+.\" same colour value as "PDFHREF.COLOUR".
+.\"
+.ds PDFHREF.TEXT.COLOUR pdf:href.colour
+.\"
+.\" Accommodate users who prefer the American spelling, COLOR, to
+.\" the British spelling, COLOUR.
+.\"
+.als PDFHREF.COLOR PDFHREF.COLOUR
+.als PDFHREF.TEXT.COLOR PDFHREF.TEXT.COLOUR
+.\"
+.\" All PDF "Hypertext" reference capabilities are accessed
+.\" through the "pdfhref" macro
+.\"
+.de pdfhref
+.\" -----------------------------------------------------------------
+.\" Usage:
+.\" .pdfhref <subcommand [options ...] [parameters ...]> ...
+.\" -----------------------------------------------------------------
+.\"
+.if \\n[PDFOPMODE] \{\
+.\"
+.\" Loop over all subcommands specified in the argument list
+.\"
+. while \\n(.$ \{\
+. \"
+. \" Initially, assume each subcommand will complete successfully
+. \"
+. nr pdf:href.ok 1
+. \"
+. \" Initialise -E and -X flags in the OFF state
+. \"
+. nr pdf:href-E 0
+. nr pdf:href-X 0
+. \"
+. \" Handle the case where subcommand is specified as "-class",
+. \" setting up appropriate macro aliases for subcommand handlers.
+. \"
+. if dpdf*href\\$1 .als pdf*href pdf*href\\$1
+. if dpdf*href\\$1.link .als pdf*href.link pdf*href\\$1.link
+. if dpdf*href\\$1.file .als pdf*href.file pdf*href\\$1.file
+. \"
+. \" Repeat macro alias setup
+. \" for the case where the subcommand is specified as "class",
+. \" (without a leading hyphen)
+. \"
+. if dpdf*href-\\$1 .als pdf*href pdf*href-\\$1
+. if dpdf*href-\\$1.link .als pdf*href.link pdf*href-\\$1.link
+. if dpdf*href-\\$1.file .als pdf*href.file pdf*href-\\$1.file
+. \"
+. \" Process one subcommand ...
+. \"
+. ie dpdf*href \{\
+. \"
+. \" Subcommand "class" is recognised ...
+. \" discard the "class" code from the argument list,
+. \" set the initial argument count to swallow all arguments,
+. \" and invoke the selected subcommand handler.
+. \"
+. shift
+. nr pdf:argc \\n(.$
+. pdf*href \\$@
+. \"
+. \" When done,
+. \" discard all arguments actually consumed by the handler,
+. \" before proceeding to the next subcommand (if any).
+. \"
+. shift \\n[pdf:argc]
+. \}
+. el \{\
+. \"
+. \" Subcommand "class" is not recognised ...
+. \" issue a warning, and discard the entire argument list,
+. \" so aborting this "pdfhref" invocation
+. \"
+. pdf:warn \\$0: undefined reference class '\\$1' ignored
+. shift \\n(.$
+. \}
+. \"
+. \" Clean up temporary reference data,
+. \" to ensure it doesn't propagate to any future reference
+. \"
+. rm pdf*href pdf:href.link pdf:href.files
+. rr pdf:href-E pdf:href-X
+. pdf:href.options.clear
+. \}
+. rr pdf:href.ok
+. \}
+..
+.\"
+.\" Macros "pdf:href.flag" and "pdf:href.option"
+.\" provide a generic mechanism for switching on flag type options,
+.\" and for decoding options with arguments, respectively
+.\"
+.de pdf:href.flag
+.\" ----------------------------------------------------------------------
+.\" ----------------------------------------------------------------------
+.nr pdf:href\\$1 1
+.nr pdf:href.argc 1
+..
+.de pdf:href.option
+.\" ----------------------------------------------------------------------
+.\" ----------------------------------------------------------------------
+.ds pdf:href\\$1 \\$2
+.nr pdf:href.argc 2
+..
+.\"
+.\" Valid PDFHREF options are simply declared
+.\" by aliasing option handlers to "pdf:href.option",
+.\" or to "pdf:href.flag", as appropriate
+.\"
+.als pdf:href.opt-A pdf:href.option \" affixed text
+.als pdf:href.opt-D pdf:href.option \" destination name
+.als pdf:href.opt-E pdf:href.flag \" echo link descriptor
+.als pdf:href.opt-F pdf:href.option \" remote file specifier
+.als pdf:href.opt-N pdf:href.option \" reference name
+.als pdf:href.opt-P pdf:href.option \" prefixed text
+.als pdf:href.opt-T pdf:href.option \" bookmark "tag"
+.als pdf:href.opt-X pdf:href.flag \" cross reference
+.\"
+.\" For references to another document file
+.\" we also need to support OS dependent file name specifiers
+.\"
+.als pdf:href.opt-DF pdf:href.option \" /DOSFile specifier
+.als pdf:href.opt-MF pdf:href.option \" /MacFile specifier
+.als pdf:href.opt-UF pdf:href.option \" /UnixFile specifier
+.als pdf:href.opt-WF pdf:href.option \" /WinFile specifier
+.\"
+.\" Macro "pdf:href.options.clear" ensures that ALL option
+.\" argument strings are deleted, after "pdfhref" has completed
+.\" all processing which depends on them
+.\"
+.de pdf:href.options.clear
+.\" -----------------------------------------------------------------
+.\" Usage:
+.\" .pdf:href.options.clear [option ...]
+.\" -----------------------------------------------------------------
+.\"
+.\" When an option list is specified ...
+.\"
+.ie \\n(.$ \{\
+. \"
+. \" then loop through the list,
+. \" deleting each specified option argument string in turn
+. \"
+. while \\n(.$ \{\
+. if dpdf:href-\\$1 .rm pdf:href-\\$1
+. shift
+. \}
+. \}
+.\"
+.\" ... but when no list is specified,
+.\" then recurse, to clear all known option argument strings
+.\"
+.el .pdf:href.options.clear A D F N P T DF MF UF WF
+..
+.\"
+.\" "PDFHREF.INFO" establishes the content of the cross reference
+.\" data record, which is exported via the "stderr" stream, when a
+.\" cross reference anchor is created using a "pdfhref" macro request
+.\" of the form
+.\"
+.\" .pdfhref M -N name -X text ...
+.\"
+.\" .ds PDFHREF.INFO \\*[PDFHREF.NAME] reference data ...
+.\"
+.ds PDFHREF.INFO page \\n% \\$*
+.\"
+.\" Macro "pdf*href-M" is the handler invoked by "pdfhref", when
+.\" called with the "M" reference class specifier, to create a
+.\" named cross reference mark, and to emit a cross reference
+.\" data record, as specified by "PDFHREF.INFO".
+.\"
+.de pdf*href-M
+.\" -----------------------------------------------------------------
+.\" Usage:
+.\" .pdfhref M [-X] [-N name | -D name] [-E] descriptive text ...
+.\" -----------------------------------------------------------------
+.\"
+.\" Initially, declare the -D and -N string options as empty,
+.\" so we avoid warning messages when we try to use them, and find
+.\" that they are undefined.
+.\"
+.ds pdf:href-D
+.ds pdf:href-N
+.\"
+.\" Parse, interpret, and strip any specified options from the
+.\" argument list. (Note that only options with a declared handler
+.\" will be processed; there is no provision for detecting invalid
+.\" options -- anything which is not recognised is assumed to start
+.\" the "descriptive text" component of the argument list).
+.\"
+.while dpdf:href.opt\\$1 \{\
+. pdf:href.opt\\$1 \\$@
+. shift \\n[pdf:href.argc]
+. \}
+.\"
+.\" If we found "--", to mark the end of the options,
+.\" then we should discard it.
+.\"
+.if '\\$1'--' .shift
+.\"
+.\" All PDF reference markers MUST be named. The name may have been
+.\" supplied using the "-N Name" option, (or the "-D Name" option);
+.\" if not, deduce it from the first "word" in the "descriptive text",
+.\" if any, and set the marker -- if we still can't identify the name
+.\" for the destination, then this marker will not be created.
+.\"
+.pdf*href.set \\*[pdf:href-N] \\*[pdf:href-D] \\$1
+.\"
+.\" If we specified a cross reference, with the "-X" option, and the
+.\" reference mark has been sucessfully created, then we now need to
+.\" write the cross reference info to the STDERR stream
+.\"
+.if \\n[pdf:href-X] .pdf*href.export \\*[PDFHREF.INFO]
+.\"
+.\" Irrespective of whether this marker is created, or not,
+.\" the descriptive text will be copied to the groff output stream,
+.\" provided the "-E" option was specified
+.\"
+.if \\n[pdf:href-E] \&\\$*
+..
+.\"
+.de pdf*href.set
+.\" ----------------------------------------------------------------------
+.\" ----------------------------------------------------------------------
+.pdf*href.map.init
+.ie \\n(.$ \{\
+. \"
+. \" a marker name has been supplied ...
+. \" if we are formatting for immediate output,
+. \" emit PDFMARK code to establish the associated view
+. \"
+. ie '\\n(.z'' \{\
+. pdf:href.sety
+. pdfmark /Dest /\\$1 /View [\\*[PDFHREF.VIEW]] /DEST
+. ds PDFHREF.NAME \\$1
+. rr PDFPAGE.Y
+. \}
+. \"
+. \" but, when formatting a diversion ...
+. \" delay output of the PDFMARK code, until the diversion
+. \" is eventually written out
+. \"
+. el \!.\\$0 \\$@
+. \"
+. \" check if we also need to emit cross reference data
+. \" (caller will do this if "pdf:href-X" is set, but it is
+. \" not necessary, when "pdf:href.map" already exists)
+. \"
+. if dpdf:href.map .nr pdf:href-X 0
+. \}
+.el \{\
+. \" marker is unnamed ...
+. \" issue error message; do not emit reference data
+. \"
+. pdf:warn pdfhref destination marker must be named
+. nr pdf:href-X 0
+. \}
+..
+.de pdf*href.export
+.\"
+.\" Called ONLY by "pdf*href-M",
+.\" this macro ensures that the emission of exported reference data
+.\" is synchronised with the placement of the reference mark,
+.\" especially when the mark is defined within a diversion.
+.\"
+.ie '\\n(.z'' .tm gropdf-info:href \\*[PDFHREF.NAME] \\$*
+.el \!.\\$0 \\$@
+..
+.\"
+.\" Macro "pdf*href-D" is invoked when "pdfhref" is called
+.\" with the "D" reference class specifier; it provides a
+.\" standardised mechanism for interpreting reference data
+.\" exported by the "M" reference class, and may be used
+.\" to directly define external reference data, without the
+.\" use of "M" reference class designators in the source
+.\" document.
+.\"
+.de pdf*href-D
+.ds pdf:href-N
+.\"
+.\" Parse, interpret, and strip any specified options from the
+.\" argument list. (Note that only options with a declared handler
+.\" will be processed; there is no provision for detecting invalid
+.\" options -- anything which is not recognised is assumed to start
+.\" the "descriptive text" component of the argument list).
+.\"
+.while dpdf:href.opt\\$1 \{\
+. pdf:href.opt\\$1 \\$@
+. shift \\n[pdf:href.argc]
+. \}
+.\"
+.\" If we found "--", to mark the end of the options,
+.\" then we should discard it.
+.\"
+.if '\\$1'--' .shift
+.\"
+.ie '\\*[pdf:href-N]'' \{\
+. pdf:warn pdfhref defined reference requires a name
+. \}
+.el \{\
+. ds pdf:href(\\*[pdf:href-N]).info \\$*
+. \}
+..
+.\"
+.\" Macro "pdf*href-F" is invoked when "pdfhref" is called
+.\" with the "F" reference class specifier; it allows the user
+.\" to provide an alternative interpreter macro, which will be
+.\" called when a "PDFHREF.INFO" record is retrieved to define
+.\" the text of a cross reference link "hot spot".
+.\"
+.de pdf*href-F
+.\" ----------------------------------------------------------------
+.\" Usage:
+.\" .pdfhref F [macro-name]
+.\" ----------------------------------------------------------------
+.\"
+.\" Set macro specified by "macro-name" as the format interpreter
+.\" for parsing "PDFHREF.INFO" records; if "macro-name" is omitted,
+.\" or is specified as the reserved name "default", then use the
+.\" default format parser, "pdf*href.format", defined below.
+.\"
+.if '\\$1'default' .shift \\n(.$
+.ie \\n(.$ .als pdf*href.format \\$1
+.el .als pdf*href.format pdf*href.default
+.nr pdf:argc 1
+..
+.\" The default reference formatting macro is defined below.
+.\" It parses the "PDFHREF.INFO" record specific to each reference,
+.\" recognising the keywords "file", "page" and "section", when they
+.\" appear in initial key/value pairs, replacing the key/value pair
+.\" with "PDFHREF.FILEREF", "PDFHREF.PAGEREF" or "PDFHREF.SECTREF"
+.\" respectively; any additional data in the "PDFHREF.INFO" record
+.\" is enclosed in typographic double quotes, and the parsed record
+.\" is appended to "PDFHREF.PREFIX", to be returned as the formatted
+.\" reference text.
+.\"
+.\" Default definitions for the reference strings "PDFHREF.PREFIX",
+.\" "PDFHREF.FILEREF", "PDFHREF.PAGEREF" and "PDFHREF.SECTREF" are
+.\" provided, in the English language. Users may substitute any
+.\" desired alternative definitions, for example, when formatting
+.\" documents in other languages. In each case, "\\$1" may be used
+.\" in the substitution, to represent the "value" component of the
+.\" respective key/value pair specified in the "PDFHREF.INFO" record.
+.\"
+.ds PDFHREF.PREFIX see
+.ds PDFHREF.PAGEREF page \\$1,
+.ds PDFHREF.SECTREF section \\$1,
+.ds PDFHREF.FILEREF \\$1
+.\"
+.de pdf*href.format
+.\" -----------------------------------------------------------------
+.\" Usage: (to be called ONLY by "pdfhref")
+.\" .pdf*href.format cross reference data ...
+.\" -----------------------------------------------------------------
+.\"
+.\" This macro is responsible for defining the strings "PDFHREF.TEXT"
+.\" and "PDFHREF.DESC", which are used by the "pdfhref" macro, as the
+.\" basis for generating the text content of a link "hot spot"; (any
+.\" user specified alternate formatter MUST do likewise).
+.\"
+.\" Note that "PDFHREF.TEXT" defines the overall format for the "link
+.\" text", while "PDFHREF.DESC" is the descriptive component thereof.
+.\"
+.\" This default implementation, subject to user customisation of the
+.\" "internationalisation" strings defined above, formats "hot spots"
+.\" of the style
+.\"
+.\" see page N, section S, "descriptive text ..."
+.\"
+.ds PDFHREF.TEXT \\*[PDFHREF.PREFIX]
+.while d\\$0.\\$1 \{\
+. \\$0.\\$1 "\\$2"
+. shift 2
+. \}
+.\"
+.\" Retrieve the descriptive text from the cross reference data,
+.\" ONLY IF no overriding description has been set by the calling
+.\" "pdfhref" macro invocation.
+.\"
+.if \\n(.$ .if !dPDFHREF.DESC .ds PDFHREF.DESC \\$*
+.\"
+.\" Augment "PDFHREF.TEXT" so the descriptive text will be included
+.\" in the text of the formatted reference
+.\"
+.if dPDFHREF.DESC .as PDFHREF.TEXT " \(lq\\\\*[PDFHREF.DESC]\(rq
+.\"
+.\" Finally, suppress any leading spaces,
+.\" which may have been included in the PDFHREF.TEXT definition.
+.\"
+.ds PDFHREF.TEXT \\*[PDFHREF.TEXT]
+..
+.de pdf*href.format.file
+.\" ----------------------------------------------------------------------
+.\" Include a file identifier in a formatted reference.
+.\" This is invoked ONLY by "pdf*href.format", and ONLY IF the
+.\" reference data includes an initial file identifier tuple.
+.\" ----------------------------------------------------------------------
+.\"
+.as PDFHREF.TEXT " \\*[PDFHREF.FILEREF]
+..
+.de pdf*href.format.page
+.\" ----------------------------------------------------------------------
+.\" Include a page number in a formatted reference.
+.\" This is invoked ONLY by "pdf*href.format", and ONLY IF the
+.\" reference data includes an initial page number tuple.
+.\" ----------------------------------------------------------------------
+.\"
+.as PDFHREF.TEXT " \\*[PDFHREF.PAGEREF]
+..
+.de pdf*href.format.section
+.\" ----------------------------------------------------------------------
+.\" Include a section number in a formatted reference.
+.\" This is invoked ONLY by "pdf*href.format", and ONLY IF the
+.\" reference data includes an initial section number tuple.
+.\" ----------------------------------------------------------------------
+.\"
+.as PDFHREF.TEXT " \\*[PDFHREF.SECTREF]
+..
+.\"
+.\" Make "pdf*href.format" the default cross reference formatter
+.\"
+.als pdf*href.default pdf*href.format
+.\"
+.\"
+.\" Macro "pdf*href" provides a generic mechanism for placing link
+.\" "hot-spots" in a PDF document. ALL "pdfhref" class macros which
+.\" create "hot-spots" are aliased to this macro; each must also have
+.\" an appropriately aliased definition for "pdf*href.template".
+.\"
+.de pdf*href
+.\" ------------------------------------------------------------------
+.\" Usage:
+.\" .pdf*href class [options ...] [link text ...]
+.\" ------------------------------------------------------------------
+.\"
+.\" First, we initialise an empty string, which will be affixed to
+.\" the end of the "link text". (This is needed to cancel the effect
+.\" of a "\c" escape, which is placed at the end of the "link text"
+.\" to support the "-A" option -- any text supplied by the user, when
+.\" the "-A" option is specified, will replace this empty string).
+.\"
+.ds pdf:href-A
+.\"
+.\" Now we interpret, and remove any specified options from the
+.\" argument list. (Note that only options with a declared handler
+.\" will be processed; there is no provision for detecting invalid
+.\" options -- anything which is not recognised is assumed to start
+.\" the "link text" component of the argument list).
+.\"
+.while dpdf:href.opt\\$1 \{\
+. pdf:href.opt\\$1 \\$@
+. shift \\n[pdf:href.argc]
+. \}
+.\"
+.\" If we found "--", to mark the end of the options, then we should
+.\" discard it.
+.\"
+.if '\\$1'--' .shift
+.\"
+.\" All PDF link classes REQUIRE a named destination. This may have
+.\" been supplied using the "-D Name" option, but, if not, deduce it
+.\" from the first "word" in the "link text", if any -- if we still
+.\" can't identify the destination, then set "pdf:href.ok" to zero,
+.\" so this link will not be created.
+.\"
+.if !dpdf:href-D .pdf:href.option -D \\$1
+.if '\\*[pdf:href-D]'' \{\
+. pdf:error pdfhref has no destination
+. nr pdf:href.ok 0
+. \}
+.\"
+.\" Some PDF link classes support a "/File (FilePathName)" argument.
+.\"
+.if dpdf*href.file \{\
+. \"
+. \" When this is supported, it may be specified by supplying
+. \" the "-F FileName" option, which is captured in "pdf:href-F".
+. \"
+. if dpdf:href-F \{\
+. \"
+. \" the /File key is present, so set up the link specification
+. \" to establish the reference to the specified file
+. \"
+. als pdf*href.link pdf*href.file
+. ds pdf:href.files /File (\\*[pdf:href-F])
+. \"
+. \" in addition to the /File key,
+. \" there may also be platform dependent alternate file names
+. \"
+. if dpdf:href-DF .as pdf:href.files " /DOSFile (\\*[pdf:href-DF])
+. if dpdf:href-MF .as pdf:href.files " /MacFile (\\*[pdf:href-MF])
+. if dpdf:href-UF .as pdf:href.files " /UnixFile (\\*[pdf:href-UF])
+. if dpdf:href-WF .as pdf:href.files " /WinFile (\\*[pdf:href-WF])
+. \}
+. \" In some cases, the "/File" key is REQUIRED.
+. \" We will know it is missing, if "pdf*href.link" is not defined.
+. \"
+. if !dpdf*href.link \{\
+. \"
+. \" When a REQUIRED "/File" key specification is not supplied,
+. \" then complain, and set "pdf:href.ok" to abort the creation
+. \" of the current reference.
+. \"
+. pdf:error pdfhref: required -F specification omitted
+. nr pdf:href.ok 0
+. \}
+. \" Now, we have no further use for "pdf*href.file".
+. \"
+. rm pdf*href.file
+. \}
+.\"
+.\" Now, initialise a string, defining the PDFMARK code sequence
+.\" to create the reference, using the appropriate type indicators.
+.\"
+.ds pdf:href.link /Subtype /Link \\*[pdf*href.link]
+.\"
+.\" And now, we have no further use for "pdf*href.link".
+.\"
+.rm pdf*href.link
+.\"
+.\" If the user specified any "link prefix" text, (using the "-P text"
+.\" option), then emit it BEFORE processing the "link text" itself.
+.\"
+.if dpdf:href-P \&\\*[pdf:href-P]\c
+.ie \\n[pdf:href.ok] \{\
+. \"
+. \" This link is VALID (so far as we can determine) ...
+. \" Modify the "link text" argument specification, as required,
+. \" to include any pre-formatted cross reference information
+. \"
+. ie \\n(.$ \{\
+. \"
+. \" One or more "link text" argument(s) are present,
+. \" so, set the link description from the argument(s) ...
+. \"
+. ds PDFHREF.DESC \\\\$*
+. ie \\n[pdf:href-X] \{\
+. \"
+. \" ... and, when the "-X" flag is set,
+. \" also include formatted location information,
+. \" derived from the cross reference record.
+. \"
+. pdf*href.format \\*[pdf:href(\\*[pdf:href-D]).info]
+. \}
+. el \{\
+. \" ... but, when the "-X" flag is NOT set,
+. \" use only the argument(s) as the entire content
+. \" of the "link text"
+. \"
+. rn PDFHREF.DESC PDFHREF.TEXT
+. \}
+. \}
+. el \{\
+. \" No "link text" arguments are present,
+. \" so, format the cross reference record to define
+. \" the content of the "link text".
+. \"
+. pdf*href.format \\*[pdf:href(\\*[pdf:href-D]).info]
+. \}
+. \" Apply border and colour specifications to the PDFMARK string
+. \" definition, as required.
+. \"
+. if dPDFHREF.BORDER .as pdf:href.link " /Border [\\*[PDFHREF.BORDER]]
+. if dPDFHREF.COLOUR .as pdf:href.link " /Color [\\*[PDFHREF.COLOUR]]
+. \"
+. \" Emit the "link text", in its appropriate colour, marking the
+. \" limits of its bounding box(es), as the before and after output
+. \" text positions.
+. \"
+. pdf*href.mark.begin "\\*[pdf:href.link]"
+. if dPDFHREF.COLOUR .defcolor pdf:href.colour rgb \\*[PDFHREF.COLOUR]
+. nop \&\m[\\*[PDFHREF.TEXT.COLOUR]]\\*[PDFHREF.TEXT]\m[]\c
+. pdf*href.mark.end
+. \"
+. \" Clean up the temporary registers and strings, used to
+. \" compute the "hot-spot" bounds, and format the reference,
+. \"
+. rm PDFHREF.DESC PDFHREF.TEXT
+. \}
+.\"
+.\" But when we identify an INVALID link ...
+.\" We simply emit the "link text", with no colour change, no border,
+.\" and no associated "hot-spot".
+.\"
+.el \&\\$*\c
+.\"
+.\" And then, if the user specified any affixed text, (using the
+.\" "-A text" option), we tack it on at the end.
+.\"
+.nop \&\\*[pdf:href-A]
+..
+.de pdf*href.map.init
+.\" ----------------------------------------------------------------------
+.\" ----------------------------------------------------------------------
+.\"
+.if dpdf:href.map-1 \{\
+. \"
+. \" We have a reference map, but we haven't started to parse it yet.
+. \" This must be the first map reference in pass 2, so we need to
+. \" "kick-start" the parsing process, by loading the first indexed
+. \" sub-map into the global map.
+. \"
+. rn pdf:href.map-1 pdf:href.map
+. als pdf:href.map.internal pdf:href.map
+. nr pdf:href.map.index 1 1
+. \}
+.als pdf*href.map.init pdf*href.mark.idle
+..
+.\"
+.\" "pdf*href-Z" is used to add link co-ordinate entries to the
+.\" "pdf:href.map". Primarily, it is used by the "pdfroff" formatter,
+.\" to pass link co-ordinate data from one "groff" formatting pass to
+.\" the next, and is not generally useful to the end user.
+.\"
+.de pdf*href-Z
+.\" ----------------------------------------------------------------------
+.\" Usage:
+.\" .pdfhref Z page-index x-displacement y-displacement
+.\" Where:
+.\" page-index is the reference mark's page number
+.\" x-displacement is its offset from the left edge of the page
+.\" y-displacement is its offset from the top edge of the page
+.\" ( both displacement values are expressed in basic groff units, )
+.\" ( and measured perpendicular to their respective page edges. )
+.\" ----------------------------------------------------------------------
+.\"
+.ie \\n(.$=3 .ds pdf:href.map-\\n+[pdf*href-Z.index] \\$*
+.el .pdf:error pdfhref Z operator expects exactly three arguments
+..
+.\" Initialise the auto-incrementing "pdf*href-Z.index" register,
+.\" to ensure that sub-map numbering starts at 1.
+.\"
+.nr pdf*href-Z.index 0 1
+.\"
+.de pdf*href.map.read
+.\" ----------------------------------------------------------------------
+.\" Usage: (internal use only):
+.\" .pdf*href.map.read co-ordinate name list ...
+.\" ----------------------------------------------------------------------
+.\"
+.\" Reads values from "pdf:href.map" to each named register, in turn
+.\" Reading to "null" discards the corresponding value in "pdf:href.map"
+.\"
+.while \\n(.$ \{\
+. \"
+. \" Loop over all registers named in the argument list,
+. \" assigning values from "pdf:href.map" to each in turn.
+. \"
+. pdf:pop nr pdf:\\$1 pdf:href.map.internal
+. if !dpdf:href.map.internal \{\
+. \"
+. \" We ran out of map references in the current sub-map,
+. \" so move on to the next indexed sub-map, if any.
+. \"
+. if dpdf:href.map-\\n+[pdf:href.map.index] \{\
+. rn pdf:href.map-\\n[pdf:href.map.index] pdf:href.map
+. als pdf:href.map.internal pdf:href.map
+. \}
+. \}
+. \"
+. \" Proceed to the next named co-ordinate, (if any), specified
+. \" in the argument list.
+. \"
+. shift
+. \}
+.\"
+.\" Discard any assignments to a register named "null"
+.\"
+.rr pdf:null
+..
+.de pdf*href.mark.begin
+.\" ----------------------------------------------------------------------
+.\" ----------------------------------------------------------------------
+.pdf*href.map.init
+.ie dpdf:href.map \{\
+. \"
+. \" Once we have established a document reference map,
+. \" then this, and all subsequent calls to "pdf*href.mark.begin",
+. \" may be redirected to the reference mark resolver, and the
+. \" "pdf*href.mark.end" macro has nothing further to do.
+. \"
+. pdf*href.mark.resolve \\$@
+. rn pdf*href.mark.resolve pdf*href.mark.begin
+. als pdf*href.mark.end pdf*href.mark.idle
+. \}
+.el \{\
+. \" Since we don't yet have a document reference map, the
+. \" reference mark resolver will not work, in this pass of the
+. \" formatter; this, and all subsequent calls to "pdf*href.mark.begin",
+. \" may be redirected to "pdf*href.mark.end", which is responsible
+. \" for emitting the reference mark data to be incorporated into
+. \" the reference map in a subsequent formatting pass.
+. \"
+. pdf*href.mark.end
+. als pdf*href.mark.begin pdf*href.mark.end
+. \}
+..
+.de pdf*href.mark.resolve
+.\" ----------------------------------------------------------------------
+.\" ----------------------------------------------------------------------
+.ie '\\n(.z'' \{\
+. ds pdf:href.link \\$1
+. nr pdf:urx \\n(.o+\\n(.l
+. pdf*href.map.read spg llx ury epg urx.end lly.end
+. ie \\n[pdf:spg]=\\n[pdf:epg] \{\
+. \"
+. \" This link is entirely contained on a single page ...
+. \" emit the text, which defines the content of the link region,
+. \" then make it active.
+. \"
+. pdf*href.mark.emit 1 \\n[pdf:urx.end]
+. if \\n[pdf:lly]<\\n[pdf:lly.end] \{\
+. \"
+. \" This link spans multiple output lines; we must save its
+. \" original end co-ordinates, then define a new intermediate
+. \" end point, to create a PDFMARK "hot-spot" extending from
+. \" the start of the link to the end if its first line.
+. \"
+. nr pdf:ury +1v
+. nr pdf:llx \\n(.o+\\n[.in]
+. nr pdf:lly \\n[pdf:lly.end]-\\*[PDFHREF.HEIGHT]
+. if \\n[pdf:ury]<\\n[pdf:lly] \{\
+. nr pdf:lly +\\*[PDFHREF.HEIGHT]-1v
+. pdf*href.mark.emit 2
+. nr pdf:ury \\n[pdf:lly.end]-\\*[PDFHREF.HEIGHT]
+. \}
+. pdf*href.mark.emit 0 \\n[pdf:urx.end]
+. \}
+. pdf*href.mark.flush
+. \}
+. el \{\
+. \" This link is split across a page break, so ...
+. \" We must mark the "hot-spot" region on the current page,
+. \" BEFORE we emit the link text, as we will have moved off
+. \" this page, by the time the text has been output.
+. \"
+. \" First step: define the region from the start of the link,
+. \" to the end of its first line.
+. \"
+. pdf*href.mark.emit 1 \\n[pdf:urx]
+. \"
+. \" All additional regions MUST align with the left margin.
+. \"
+. nr pdf:llx \\n(.o+\\n[.in]
+. \"
+. \" If the current page can accomodate more than the current line,
+. \" then it will include a second active region for this link; this
+. \" will extend from just below the current line to the end of page
+. \" trap, if any, or the bottom of the page otherwise, and occupy
+. \" the full width of the page, between the margins.
+. \"
+. nr pdf:ury +1v
+. pdf*href.mark.emit 3
+. \"
+. \" We now need a page transition trap, to map the active link
+. \" region(s), which overflow on to the following page(s); (the
+. \" handler for this trap MUST have been previously installed).
+. \"
+. ie dpdf*href.mark.hook \{\
+. \"
+. \" The page transition trap handler has been installed,
+. \" so we may activate both it, and also the appropriate
+. \" termination handler, to deactivate it when done.
+. \"
+. als pdf*href.mark.hook pdf*href.mark.trap
+. \"
+. \" Now we set up "pdf:epg" to count the number of page breaks
+. \" which this link will span, and emit the link text, leaving
+. \" the page trap macro to map active regions on intervening
+. \" pages, which are included in the link.
+. \"
+. nr pdf:epg -\\n[pdf:spg] 1
+. \}
+. el \{\
+. \" There was no handler initialised for the page trap,
+. \" so we are unable to map the active regions for this link;
+. \" we may discard the remaining map data for this link,
+. \" and issue a diagnostic.
+. \"
+. pdf:error pdfhref: link dissociated at page break (trap not initialised)
+. if dPDFHREF.BROKEN.COLOR \{\
+. \"
+. \" The user may opt to have such broken links highlighted.
+. \" We use "PDFHREF.BROKEN.COLOUR" to specify this requirement,
+. \" but the user may prefer the American spelling, so we will
+. \" handle both as equivalent.
+. \"
+. als PDFHREF.BROKEN.COLOUR PDFHREF.BROKEN.COLOR
+. \}
+. if dPDFHREF.BROKEN.COLOUR \{\
+. if dPDFHREF.COLOUR .als PDFHREF.COLOUR PDFHREF.BROKEN.COLOUR
+. \}
+. \}
+. \}
+. \}
+.el \!.\\$0 \\$@
+..
+.\"
+.\" Macro "pdf*href.mark.emit" is called only by "pdf*href". It is
+.\" responsible for emitting the PDFMARK code, to establish the
+.\" "hot-spot" region associated with a document or resource link.
+.\"
+.de pdf*href.mark.emit
+.\" ----------------------------------------------------------------------
+.\" Usage:
+.\" .pdf*href.mark.emit <action> [<end-urx>]
+.\" <action> == 0 --> normal operation -- link height = 1 line
+.\" <action> == 1 --> start of link -- add leading above text
+.\" <action> == 2 --> overtall link -- set intermediate baseline
+.\" <action> == 3 --> split link -- break at bottom of page
+.\" ----------------------------------------------------------------------
+.\"
+.if \\$1=1 \{\
+. \"
+. \" Initialising a new link region ...
+. \" Some different versions of "groff" disagree about the vertical
+. \" displacement of "opminy", as emitted by "\O1|\h'-\w"|"u'\O2\c",
+. \" relative to the current text baseline. Therefore, recompute
+. \" the link displacement, independently of "opminy".
+. \"
+. mk pdf:ury.base
+. while \\n[pdf:ury.base]<\\n[pdf:ury] .nr pdf:ury.base +1v
+. nr pdf:ury.base -1m+\\n[PDFHREF.LEADING]
+. \"
+. \" adjust the end-point vertical displacement by the same offset,
+. \" and then relocate the link starting point to its new displacement,
+. \" as established by this base line relative computation.
+. \"
+. nr pdf:lly.end +\\n[pdf:ury.base]-\\n[pdf:ury]+\\*[PDFHREF.HEIGHT]
+. rnn pdf:ury.base pdf:ury
+. \}
+.if \\$1<2 \{\
+. \"
+. \" Link segment fits on a single line ...
+. \" Set its height and end-point horizontal displacement accordingly.
+. \"
+. nr pdf:lly \\n[pdf:ury]+\\*[PDFHREF.HEIGHT]
+. if \\n[pdf:lly]>=\\n[pdf:lly.end] .nr pdf:urx \\$2
+. \}
+.ie \\$1=3 \{\
+. \"
+. \" Link segment extends beyond the next page break ...
+. \" Recompute truncated height, to just fit portion on current page,
+. \" recursing to emit it, and leaving page trap mechanism to place
+. \" continuation region(s) on following page(s).
+. \"
+. nr pdf:lly (\\n[.t]u-\\n[.V]u)/1v
+. if \\n[pdf:lly]>0 \{\
+. nr pdf:lly \\n[pdf:ury]+\\n[pdf:lly]v-1v+\\*[PDFHREF.HEIGHT]
+. pdf*href.mark.emit 2
+. \}
+. \}
+.el \{\
+. \" Link region size and placement has been fully specified ...
+. \" Emit it.
+. \"
+. pdfmark \\*[pdf:href.link] /Rect [\\*[pdf:bbox]] /ANN
+. \}
+..
+.\"
+.\" When "pdf*href" emits a link for which the "hot-spot" spans a
+.\" page break, then we need to provide a "hook" in to the page break
+.\" trap, so we can map the "hot-spot" regions which are to be placed
+.\" on either side of the page break.
+.\"
+.\" Macro "pdf*href.mark.idle" is a dummy macro, which provide this
+.\" "hook" for normal page breaks, where there is no link "hot-spot"
+.\" crossing the break.
+.\"
+.de pdf*href.mark.idle
+.\" ----------------------------------------------------------------------
+.\" Usage:
+.\" Called only as an internal hook, by a page trap macro.
+.\" Expects no arguments, and does nothing.
+.\" ----------------------------------------------------------------------
+..
+.\"
+.\" Macro "pdf*href.mark.trap" is the active "hook", which is substituted
+.\" for "pdf*href,mark.idle" at those page breaks which are crossed by
+.\" a link "hot-spot".
+.\"
+.de pdf*href.mark.trap
+.\" ----------------------------------------------------------------------
+.\" Usage:
+.\" Called only as an internal hook, by a page trap macro.
+.\" Expects no arguments. Maps residual link "hot-spot" regions,
+.\" which spill beyond any page break. Not to be invoked directly
+.\" by the user, nor by any user supplied macro.
+.\" ----------------------------------------------------------------------
+.\"
+.mk pdf:ury
+.nr pdf:ury +1v-1m-\\n[PDFHREF.LEADING]
+.ie \\n-[pdf:epg] \{\
+. \"
+. \" The link "hot-spot" extends across more than one page break,
+. \" so, for each page which is completely contained within the
+. \" extent of the link, simply mark the entire text area on the
+. \" page as a "hot-spot".
+. \"
+. pdf*href.mark.emit 3
+. \}
+.el \{\
+. \" The link "hot-spot" ends on the page which immediately follows
+. \" the current page transition, so we may now finalise this link.
+. \"
+. nr pdf:lly \\n[pdf:ury]+\\*[PDFHREF.HEIGHT]
+. if \\n[pdf:lly.end]>\\n[pdf:lly] \{\
+. \"
+. \" The "hot-spot" extends beyond the first line of text,
+. \" on its final page; compute and emit "hot-spot" region to cover
+. \" the full with of the text area, including all but the last
+. \" line of the link text.
+. \"
+. while \\n[pdf:lly.end]>\\n[pdf:lly] .nr pdf:lly +1v
+. nr pdf:lly -1v
+. pdf*href.mark.emit 2
+. \"
+. \" Now, adjust the vertical "hot-spot" mapping reference,
+. \" to identify the correct position for the the last line of
+. \" text, over which the "hot-spot" extends.
+. \"
+. nr pdf:ury \\n[pdf:lly.end]-\\*[PDFHREF.HEIGHT]
+. \}
+. \"
+. \" We now have exactly one final line of text, over which we must
+. \" emit a "hot-spot" region; map it, terminate page trap processing
+. \" for this "hot-spot", and clean up the "hot-spot" mapping context.
+. \"
+. pdf*href.mark.emit 0 \\n[pdf:urx.end]
+. als pdf*href.mark.hook pdf*href.mark.idle
+. pdf*href.mark.flush
+. \}
+..
+.de pdf*href.mark.flush
+.\" ----------------------------------------------------------------------
+.\" ----------------------------------------------------------------------
+.rr pdf:spg pdf:epg
+.rr pdf:llx pdf:lly pdf:urx pdf:ury
+.if dPDFHREF.COLOR .als PDFHREF.COLOUR PDFHREF.COLOR
+.rr pdf:urx.end pdf:lly.end
+..
+.de pdf*href.mark.end
+.\" ----------------------------------------------------------------------
+.\" ----------------------------------------------------------------------
+\O1|\h'-\w"|"u'\O2\c
+..
+.\" Macro "pdf*href-I" is used for one time initialisation of special
+.\" "pdfhref" features; (currently, only the above page trap hook is
+.\" supported, but it is implemented with one level of indirection, to
+.\" accommodate possible future expansion).
+.
+.de pdf*href-I
+.\" ----------------------------------------------------------------------
+.\" Usage:
+.\" .pdfhref I -<option> <optarg> [-<option> <optarg>] ...
+.\" ----------------------------------------------------------------------
+.\"
+.\" Loop over all arguments, in pairs ...
+.
+.while \\n(.$ \{\
+. \"
+. \" handing them off to their respective initialisers,
+. \" when suitable initialisers exist, or complaining otherwise.
+. \"
+. ie dpdf*href\\$1.init .pdf*href\\$1.init \\$2
+. el .pdf*error pdfhref:init: unknown feature '\\$1'
+. shift 2
+. \}
+..
+.\" Before we can use the page break "hook", we need to initialise it
+.\" as an addendum to a regular page break trap. To ensure that we don't
+.\" compromise the user's page trap setup, we leave the onus for this
+.\" initialisation with the user, but we provide the "pdf*href-PT.init"
+.\" macro, (invoked by ".pdfhref I -PT <macro-name>"), to implement a
+.\" suitable initialisation action.
+.
+.de pdf*href-PT.init
+.\" ----------------------------------------------------------------------
+.\" Usage:
+.\" .pdfhref I -PT <macro-name>
+.\" <macro-name> == name of user's page break trap macro
+.\" ----------------------------------------------------------------------
+.\"
+.\" Initially, map the page break hook to its default, do nothing helper.
+.
+.als pdf*href.mark.hook pdf*href.mark.idle
+.ie !\\n(.$ \{\
+. \"
+. \" Don't have enough arguments to specify a page trap macro name,
+. \" so simply plant "pdf*href.mark.hook" as a top of page trap.
+. \"
+. wh 0 pdf*href.mark.hook
+. \}
+.el \{\
+. \" Page trap macro name is specified in "\\$1" ...
+. \"
+. ie d\\$1 \{\
+. \"
+. \" When this page trap macro already exists, then we simply
+. \" append a call to "pdf*href.mark.hook" to it.
+. \"
+. am \\$1 pdf*href.mark.idle
+. pdf*href.mark.hook
+. pdf*href.mark.idle
+. \}
+. el \{\
+. \" However, when the specified page trap macro does not yet
+. \" exist, then we create it, and plant it as a top of page
+. \" trap.
+. \"
+. de \\$1 pdf*href.mark.idle
+. pdf*href.mark.hook
+. pdf*href.mark.idle
+. wh 0 \\$1
+. \}
+. \}
+..
+.
+.\" "pdf*href-L" is the generic handler for creating references to
+.\" named destinations in PDF documents. It supports both local
+.\" references, to locations within the same document, through its
+.\" "pdf*href-L.link" attribute, and also references to locations
+.\" in any other PDF document, through "pdf*href-L.file".
+.\"
+.als pdf*href-L pdf*href
+.ds pdf*href-L.link /Dest /\\\\*[pdf:href-D]
+.ds pdf*href-L.file /Action /GoToR \\\\*[pdf:href.files] \\*[pdf*href-L.link]
+.\"
+.\" "pdf*href-O" is the "official" handler for creating PDF
+.\" document outlines. It is simply an alias to "pdfbookmark",
+.\" which may also be invoked directly, if preferred. Neither
+.\" a "pdf*href-O.link" nor a "pdf*href-O.file" attribute is
+.\" required.
+.\"
+.als pdf*href-O pdfbookmark
+.\"
+.\" "pdf*href-W" is the generic handler for creating references to
+.\" web resources, (or any resource specified by a uniform resource
+.\" identifier). Such resource links are fully specified by the
+.\" "pdf*href-W.link" attribute.
+.\"
+.als pdf*href-W pdf*href
+.ds pdf*href-W.link /Action << /Subtype /URI /URI (\\\\*[pdf:href-D]) >>
+.\"
+.\" pdfmark.tmac: end of file / vim: ft=groff
diff --git a/contrib/groff/contrib/pdfmark/pdfroff.man b/contrib/groff/contrib/pdfmark/pdfroff.man
new file mode 100644
index 000000000000..7d83cdd92849
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/pdfroff.man
@@ -0,0 +1,552 @@
+.TH PDFROFF @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
+.\" --------------------------------------------------------------------
+.\" Legal Matters
+.\" --------------------------------------------------------------------
+.ig
+pdfroff.1
+
+File position: <groff-source>/contrib/pdfmark/pdfroff.man
+
+Last update:
+
+This file is part of groff, the GNU roff type-setting system.
+
+Copyright (C) 2005 Free Software Foundation, Inc.
+written by Keith Marshall <keith.d.marshall@ntlworld.com>
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with no
+Front-Cover Texts, no Back-Cover Texts, and the following Invariant
+Sections:--
+
+ a) This "Legal Matters" section, extending from the start of
+ the document, to the end of the enclosing ".ig" section.
+
+ b) The entire section bearing the heading "AUTHOR", extending
+ from the ".SH AUTHOR" tag, to the end of the document.
+
+A copy of the Free Documentation License is included as a file called
+FDL in the main directory of the groff source package.
+..
+.\" --------------------------------------------------------------------
+.
+.SH NAME
+pdfroff \- create PDF documents using
+.I groff
+.
+.hw pdfmark
+.de Q
+\&\\$3\*(lq\\$1\*(rq\\$2
+..
+.de nohy
+.hy 0
+\&\\$*
+.hy
+..
+.\" --------------------------------------------------------------------
+.
+.SH SYNOPSIS
+.de cmd
+. if r@i .in
+. nr @i \\n(.i
+. in +\w'\f[B]\\$1\0'u
+. ti \\n(@iu
+. B \\$1\0\c
+..
+.de opt
+. tr -\-
+. RB [ -\\$1\c
+. IR \&\\$2 ]
+. tr --
+..
+.de opta
+. ie \\n(.$>1 .opt \\$1 \0\\$2
+. el .opt \\$1
+..
+.de opte
+. tr -\-
+. RB [ -\\$1 =\c
+. IR \&\\$2 ]
+. tr --
+..
+.de optx
+. tr -\-
+. RB [ --no\\$1 \0|\0\c
+. BR -\\$1 =\c
+. IR \&\\$2 ]
+. tr --
+..
+.ad l
+.hy 0
+.ll -5
+.cmd pdfroff
+.opt abcegilpstzCEGNRSUVXZ
+.opta d cs
+.opta f fam
+.opta F dir
+.opta I dir
+.opta L arg
+.opta m name
+.opta M dir
+.opta n num
+.opta o list
+.opta P arg
+.opta r cn
+.opta T dev
+.opta w name
+.opta W name
+.opt -no-toc-relocation
+.opte -stylesheet name
+.optx -pdf-output name
+.optx -reference-dictionary name
+.opt -report-progress
+.B file
+.I ...
+.ll
+.sp
+.cmd pdfroff
+.B -h
+|
+.B --help
+.sp
+.cmd pdfroff
+.B -v
+|
+.B --version
+.RI [ option
+.IR ... ]
+.rr @i
+.in
+.ad
+.hy
+.P
+The command line is parsed in accordance with normal GNU conventions,
+but with one exception \(em when specifying any short form option
+(i.e., a single character option introduced by a single hyphen),
+and if that option expects an argument, then it
+.I must
+be specified independently (i.e., it may
+.I not
+be appended to any group of other single character short form options).
+.P
+Long form option names (i.e., those introduced by a double hyphen)
+may be abbreviated to their minimum length unambigous initial substring.
+.
+.\" --------------------------------------------------------------------
+.
+.SH DESCRIPTION
+.B pdfroff
+is a wrapper program for the GNU text processing system,
+.BR groff .
+It transparently handles the mechanics of multiple pass
+.B groff
+processing, when applied to suitably marked up
+.B groff
+source files,
+such that tables of contents and body text are formatted separately,
+and are subsequently combined in the correct order, for final publication
+as a single PDF document.
+A further optional
+.Q style\0sheet
+capability is provided;
+this allows for the definition of content which is required to preceed the
+table of contents, in the published document.
+.P
+For each invocation of
+.BR pdfroff ,
+the ultimate
+.B groff
+output stream is post\(hyprocessed by the GhostScript interpreter,
+to produce a finished PDF document.
+.P
+.B pdfroff
+makes no assumptions about, and imposes no restrictions on,
+the use of any
+.B groff
+macro packages which the user may choose to employ,
+in order to achieve a desired document format;
+however, it
+.I does
+include specific built in support for the
+.B pdfmark
+macro package, should the user choose to employ it.
+Specifically, if the
+.I pdfhref
+macro, defined in the
+.B pdfmark.tmac
+package, is used to define public reference marks,
+or dynamic links to such reference marks, then
+.B pdfroff
+will perform as many preformatting
+.B groff
+passes as required, up to a maximum limit of
+.IR four ,
+in order to compile a document reference dictionary,
+to resolve references, and to expand the dynamically defined
+content of links.
+.
+.\" --------------------------------------------------------------------
+.
+.SH USAGE
+.B pdfroff
+usage closely mirrors that of
+.B groff
+itself.
+Indeed,
+with the exception of the
+.BR \-h ,
+.BR \-v ,
+and
+.BI \-T \0dev
+short form options, and
+all long form options,
+which are parsed internally by
+.BR pdfroff ,
+all options and file name arguments specified on the command line are
+passed on to
+.BR groff ,
+to control the formatting of the PDF document.
+Consequently,
+.B pdfroff
+accepts all options and arguments, as specified in
+.BR groff (@MAN1EXT@),
+which may also be considered as the definitive reference for all standard
+.BR pdfroff
+options and argument usage.
+.
+.\" --------------------------------------------------------------------
+.
+.SH OPTIONS
+.B pdfroff
+accepts all of the short form options
+(i.e., those introduced by a single hyphen),
+which are available with
+.B groff
+itself.
+In most cases, these are simply passed transparently to
+.BR groff ;
+the following, however, are handled specially by
+.BR pdfroff .
+.TP
+.B \-h
+Same as
+.BR \-\-help ;
+see below.
+.TP
+.B \-i
+Process standard input, after all other specified input files.
+This is passed transparently to
+.BR groff ,
+but, if grouped with other options, it
+.I must
+be the first in the group.
+Hiding it within a group will
+break standard input processing, in the multiple pass
+.B groff
+processing context of
+.BR pdfroff .
+.TP
+.BI \-T \0dev
+Only
+.BI \-T \0ps
+is supported by
+.BR pdfroff .
+Attempting to specify any other device will cause
+.B pdfroff
+to abort.
+.TP
+.B \-v
+Same as
+.BR \-\-version ;
+see below.
+.P
+See
+.BR groff (@MAN1EXT@)
+for a description of all other short form options,
+which are transparently passed through
+.BR pdfroff
+to
+.BR groff .
+.P
+All long form options
+(i.e., those introduced by a double hyphen)
+are interpreted locally by
+.BR pdfroff ;
+they are
+.B not
+passed on to
+.BR groff ,
+unless otherwise stated below.
+.TP
+.B \-\-help
+Causes
+.B pdfroff
+to display a summary of the its usage syntax, and supported options,
+and then exit.
+.TP
+.B \-\-no\-pdf\-output
+May be used with the
+.BI \-\-reference\-dictionary= name
+option (described below) to eliminate the overhead of PDF formatting,
+when running
+.B pdfroff
+to create a reference dictionary, for use in a different document.
+.TP
+.B \-\-no\-reference\-dictionary
+May be used to eliminate the overhead of creating a reference dictionary,
+when it is known that the target PDF document will contain no public
+references, created by the
+.I pdfhref
+macro.
+.TP
+.B \-\-no\-toc\-relocation
+May be used to eliminate the extra
+.B groff
+processing pass,
+which is required to generate a table of contents,
+and relocate it to the start of the PDF document,
+when processing any document which lacks an automatically
+generated table of contents.
+.TP
+.BI \-\-pdf\-output= name
+Specifies the name to be used for the resultant PDF document;
+if unspecified, the PDF output is written to standard output.
+A future version of
+.B pdfroff
+may use this option,
+to encode the document name in a generated reference dictionary.
+.TP
+.BI \-\-reference\-dictionary= name
+Specifies the name to be used for the generated reference dictionary file;
+if unspecified, the reference dictionary is created in a temporary file,
+which is deleted when
+.B pdfroff
+completes processing of the current document.
+This option
+.I must
+be specified, if it is desired to save the reference dictionary,
+for use in references placed in other PDF documents.
+.TP
+.B \-\-report\-progress
+Causes
+.B pdfroff
+to display an informational message on standard error,
+at the start of each
+.B groff
+processing pass.
+.TP
+.BI \-\-stylesheet= name
+Specifies the name of an
+.IR "input file" ,
+to be used as a style sheet for formatting of content,
+which is to be placed
+.I before
+the table of contents,
+in the formatted PDF document.
+.TP
+.B \-\-version
+Causes
+.B pdfroff
+to display a version identification message.
+The entire command line is then passed transparently to
+.BR groff ,
+in a
+.I one
+pass operation
+.IR only ,
+in order to display the associated
+.B groff
+version information, before exiting.
+.
+.\" --------------------------------------------------------------------
+.
+.SH ENVIRONMENT
+The following environment variables may be set, and exported,
+to modify the behaviour of
+.BR pdfroff .
+.TP
+.B GROFF_TMPDIR
+Identifies the directory in which
+.B pdfroff
+should create temporary files.
+If
+.B GROFF_TMPDIR
+is
+.I not
+specified, then the variables
+.BR TMPDIR ,
+.B TMP
+and
+.B TEMP
+are considered in turn, as possible temporary file repositories.
+If none of these are set, then temporary files will be created
+in the current directory.
+.TP
+.B GROFF_GHOSTSCRIPT_INTERPRETER
+Specifies the program to be invoked, when
+.B pdfroff
+converts
+.B groff
+PostScript output to PDF.
+If
+.B GROFF_GHOSTSCRIPT_INTERPRETER
+is not specified, then
+.B pdfroff
+will search the process
+.BR PATH ,
+looking for a program with any of the well known names
+for the GhostScript interpreter;
+if no GhostScript interpreter can be found,
+.B pdfroff
+will abort.
+.TP
+.B GROFF_AWK_INTERPRETER
+Specifies the program to be invoked, when
+.B pdfroff
+is extracting reference dictionary entries from a
+.B groff
+intermediate message stream.
+If
+.B GROFF_AWK_INTERPRETER
+is not specified, then
+.B pdfroff
+will search the process
+.BR PATH ,
+looking for any of the preferred programs, `gawk', `mawk', `nawk'
+and `awk', in this order;
+if none of these are found,
+.B pdfroff
+will issue a warning message, and continue processing;
+however, in this case, no reference dictionary will be created.
+.TP
+.B OSTYPE
+Typically defined automatically by the operating system,
+.B OSTYPE
+is used on Microsoft Win32/MS\(hyDOS platforms
+.IR only ,
+to infer the default
+.B PATH_SEPARATOR
+character,
+which is used when parsing the process
+.B PATH
+to search for external helper programs.
+.TP
+.B PATH_SEPARATOR
+If set,
+.B PATH_SEPARATOR
+overrides the default separator character,
+(':' on POSIX/UNIX systems,
+inferred from
+.B OSTYPE
+on Microsoft Win32/MS\(hyDOS),
+which is used when parsing the process
+.B PATH
+to search for external helper programs.
+.TP
+.B SHOW_PROGRESS
+If this is set to a non-empty value, then
+.B pdfroff
+will always behave as if the
+.B \-\-report\-progress
+option is specified, on the command line.
+.
+.\" --------------------------------------------------------------------
+.
+.SH FILES
+Input and output files for
+.B pdfroff
+may be named according to any convention of the user's choice.
+Typically, input files may be named according to the choice of the
+principal formatting macro package, e.g.,
+.IB file .ms
+might be an input file for formatting using the
+.B ms
+macros
+.RB ( s.tmac );
+normally, the final output file should be named
+.IB file .pdf\c
+\&.
+.P
+Temporary files, created by
+.BR pdfroff ,
+are placed in the directory specified by environment variables (see
+section
+.BR ENVIRONMENT ),
+and named according to the convention
+.BI pdf $$ .*\c
+\&, where
+.I $$
+is the standard shell variable representing the process ID of the
+.B pdfroff
+process itself, and
+.I *
+represents any of a number of extensions used by
+.B pdfroff
+for temporary and intermediate files.
+.
+.\" --------------------------------------------------------------------
+.
+.SH SEE ALSO
+See
+.BR groff (@MAN1EXT@)
+for the definitive reference to document formatting with
+.BR groff .
+Since
+.B pdfroff
+provides a superset of all
+.B groff
+capabilities,
+.BR groff (@MAN1EXT@)
+may also be considered to be the definitive reference to all
+.I standard
+capabilities of
+.BR pdfroff ,
+with this document providing the reference to
+.BR pdfroff 's
+extended features.
+.P
+While
+.B pdfroff
+imposes neither any restriction on, nor any requirement for,
+the use of any specific
+.B groff
+macro package, a number of supplied macro packages,
+and in particular those associated with the package
+.BR pdfmark.tmac ,
+are best suited for use with
+.BR pdfroff
+as the preferred formatter.
+Detailed documentation on the use of these packages may be found,
+in PDF format, in the reference guide
+.BR "\*(lqPortable Document Format Publishing with GNU Troff\*(rq" ,
+included in the installed documentation set as
+.hy 0
+.BR @PDFDOCDIR@/pdfmark.pdf .
+.hy
+.
+.\" --------------------------------------------------------------------
+.
+.SH AUTHOR
+Copyright \(co 2005, Free Software Foundation, Inc.
+.LP
+This man page is distributed under the terms of the
+GNU Free Documentation License (FDL), version 1.1 or later,
+and is part of the
+.I GNU troff
+software package.
+It was originally written by Keith Marshall,
+.nohy <keith.d.marshall@ntlworld.com>,
+who also wrote the implementation of the
+.I pdfroff
+program, to which it relates.
+.LP
+You should have received a copy of the FDL as part of the
+.I GNU troff
+distribution; it is also available on\-line, at the GNU
+.Q copyleft
+site,
+.nohy <http://www.gnu.org/copyleft/fdl.html>.
+.
+.\" --------------------------------------------------------------------
+.\" EOF / vim: ft=groff
diff --git a/contrib/groff/contrib/pdfmark/pdfroff.sh b/contrib/groff/contrib/pdfmark/pdfroff.sh
new file mode 100644
index 000000000000..03bed4e1f3eb
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/pdfroff.sh
@@ -0,0 +1,572 @@
+#! /bin/sh
+# ------------------------------------------------------------------------------
+#
+# Function: Format PDF Output from groff Markup
+#
+# Copyright (C) 2005, Free Software Foundation, Inc.
+# Written by Keith Marshall (keith.d.marshall@ntlworld.com)
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with groff; see the file COPYING. If not, write to the Free Software
+# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ------------------------------------------------------------------------------
+#
+# Set up an identifier for the NULL device.
+# In most cases "/dev/null" will be correct, but some shells on
+# MS-DOS/MS-Windows systems may require us to use "NUL".
+#
+ NULLDEV="/dev/null"
+ test -c $NULLDEV || NULLDEV="NUL"
+#
+# Set up the command name to use in diagnostic messages.
+# (We can't assume we have 'basename', so use the full path if required.
+# Also use the 'exec 2>...' workaround for a bug in Cygwin's 'ash').
+#
+ CMD=`exec 2>$NULLDEV; basename $0` || CMD=$0
+#
+# To ensure that prerequisite helper programs are available, and are
+# executable, a [fairly] portable method of detecting such programs is
+# provided by function `searchpath'.
+#
+ searchpath(){
+ #
+ # Usage: searchpath progname path
+ #
+ IFS="${PATH_SEPARATOR-":"}" prog=':'
+ for dir in $2
+ do
+ for ext in '' '.exe'
+ #
+ # try `progname' with all well known extensions
+ # (e.g. Win32 may require `progname.exe')
+ #
+ do
+ try="$dir/$1$ext"
+ test -f "$try" && test -x "$try" && prog="$try" && break
+ done
+ test "$prog" = ":" || break
+ done
+ echo "$prog"
+ }
+# @PATH_SEARCH_SETUP@
+#
+# We need both 'grep' and 'sed' programs, to parse script options,
+# and we also need 'cat', to display help and some error messages,
+# so ensure they are all installed, before we continue.
+#
+ CAT=`searchpath cat "$PATH"`
+ GREP=`searchpath grep "$PATH"`
+ SED=`searchpath sed "$PATH"`
+#
+# Another fundamental requirement is the 'groff' program itself;
+# we MUST use a 'groff' program located in 'GROFF_BIN_DIR', if this
+# is specified; if not, we will search 'GROFF_BIN_PATH', only falling
+# back to a 'PATH' search, if neither of these is specified.
+#
+ if test -n "$GROFF_BIN_DIR"
+ then
+ GPATH=GROFF_BIN_DIR
+ GROFF=`searchpath groff "$GROFF_BIN_DIR"`
+#
+ elif test -n "$GROFF_BIN_PATH"
+ then
+ GPATH=GROFF_BIN_PATH
+ GROFF=`searchpath groff "$GROFF_BIN_PATH"`
+#
+ else
+ GPATH=PATH
+ GROFF=`searchpath groff "$PATH"`
+ fi
+#
+# If one or more of these is missing, diagnose and bail out.
+#
+ NO='' NOPROG="$CMD: installation problem: cannot find program"
+ test "$CAT" = ":" && echo >&2 "$NOPROG 'cat' in PATH" && NO="$NO 'cat'"
+ test "$GREP" = ":" && echo >&2 "$NOPROG 'grep' in PATH" && NO="$NO 'grep'"
+ test "$GROFF" = ":" && echo >&2 "$NOPROG 'groff' in $GPATH" && NO="$NO 'groff'"
+ test "$SED" = ":" && echo >&2 "$NOPROG 'sed' in PATH" && NO="$NO 'sed'"
+ if test -n "$NO"
+ then
+ set $NO
+ test $# -gt 1 && NO="s" IS="are" || NO='' IS="is"
+ while test $# -gt 0
+ do
+ test $# -gt 2 && NO="$NO $1,"
+ test $# -eq 2 && NO="$NO $1 and" && shift
+ test $# -lt 2 && NO="$NO $1"
+ shift
+ done
+ $CAT >&2 <<-ETX
+
+ *** FATAL INSTALLATION ERROR ***
+
+ The program$NO $IS required by '$CMD',
+ but cannot be found; '$CMD' is unable to continue.
+
+ ETX
+ exit 1
+ fi
+#
+# Set up temporary/intermediate file locations.
+#
+ WRKFILE=${GROFF_TMPDIR=${TMPDIR-${TMP-${TEMP-"."}}}}/pdf$$.tmp
+#
+ REFCOPY=${GROFF_TMPDIR}/pdf$$.cmp
+ REFFILE=${GROFF_TMPDIR}/pdf$$.ref
+#
+ CS_DATA=""
+ TC_DATA=${GROFF_TMPDIR}/pdf$$.tc
+ BD_DATA=${GROFF_TMPDIR}/pdf$$.ps
+#
+# Set a trap, to delete temporary files on exit.
+# (FIXME: may want to include other signals, in released version).
+#
+ trap "rm -f ${GROFF_TMPDIR}/pdf$$.*" 0
+#
+# Initialise 'groff' format control settings,
+# to discriminate table of contents and document body formatting passes.
+#
+ TOC_FORMAT="-rPHASE=1"
+ BODY_FORMAT="-rPHASE=2"
+#
+ LONGOPTS="
+ help reference-dictionary no-reference-dictionary
+ stylesheet pdf-output no-pdf-output
+ version report-progress no-toc-relocation
+ "
+# Parse the command line, to identify 'pdfroff' specific options.
+# Collect all other parameters into new argument and file lists,
+# to be passed on to 'groff', enforcing the '-Tps' option.
+#
+ DIFF="" STREAM="" INPUT_FILES=""
+ SHOW_VERSION="" GROFF_STYLE="$GROFF -Tps"
+ while test $# -gt 0
+ do
+ case "$1" in
+#
+# Long options must be processed locally ...
+#
+ --*)
+#
+# First identify, matching any abbreviation to its full form.
+#
+ MATCH="" OPTNAME=`IFS==; set dummy $1; echo $2`
+ for OPT in $LONGOPTS
+ do
+ MATCH="$MATCH"`echo --$OPT | $GREP "^$OPTNAME"`
+ done
+#
+# For options in the form --option=value
+# capture any specified value into $OPTARG.
+#
+ OPTARG=`echo $1 | $SED -n s?"^${OPTNAME}="??p`
+#
+# Perform case specific processing for matched option ...
+#
+ case "$MATCH" in
+
+ --help)
+ $CAT >&2 <<-ETX
+ Usage: $CMD [-option ...] [--long-option ...] [file ...]
+
+ Options:
+ -h
+ --help
+ Display this usage summary, and exit.
+
+ -v
+ --version
+ Display a version identification message and exit.
+
+ --report-progress
+ Enable console messages, indicating the progress of the
+ PDF document formatting process.
+
+ --pdf-output=name
+ Write the PDF output stream to file 'name'; if this option
+ is unspecified, standard output is used for PDF output.
+
+ --no-pdf-output
+ Suppress the generation of PDF output entirely; use this
+ with the --reference-dictionary option, if processing a
+ document stream to produce only a reference dictionary.
+
+ --no-reference-dictionary
+ Suppress the generation of a '$CMD' reference dictionary
+ for the PDF document. Normally '$CMD' will create a
+ reference dictionary, at the start of document processing;
+ this option can accelerate processing, if it is known in
+ advance, that no reference dictionary is required.
+
+ --reference-dictionary=name
+ Save the document reference dictionary in file 'name'.
+ If 'name' already exists, when processing commences, it
+ will be used as the base case, from which the updated
+ dictionary will be derived. If this option is not used,
+ then the reference dictionary, created during the normal
+ execution of '$CMD', will be deleted on completion of
+ document processing.
+
+ --stylesheet=name
+ Use the file 'name' as a 'groff' style sheet, to control
+ the appearance of the document's front cover section. If
+ this option is not specified, then no special formatting
+ is applied, to create a front cover section.
+
+ --no-toc-relocation
+ Suppress the multiple pass 'groff' processing, which is
+ normally required to position the table of contents at the
+ start of a PDF document.
+
+ ETX
+ exit 0
+ ;;
+
+ --version)
+ GROFF_STYLE="$GROFF_STYLE \"$1\""
+ SHOW_VERSION="GNU pdfroff (groff) version @VERSION@"
+ ;;
+
+ --report-progress)
+ SHOW_PROGRESS=echo
+ ;;
+
+ --pdf-output)
+ PDF_OUTPUT="$OPTARG"
+ ;;
+
+ --no-pdf-output)
+ PDF_OUTPUT="$NULLDEV"
+ ;;
+
+ --reference-dictionary)
+ REFFILE="$OPTARG"
+ ;;
+
+ --no-reference-dictionary)
+ AWK=":" DIFF=":" REFFILE="$NULLDEV" REFCOPY="$NULLDEV"
+ ;;
+
+ --stylesheet)
+ STYLESHEET="$OPTARG" CS_DATA=${GROFF_TMPDIR}/pdf$$.cs
+ ;;
+
+ --no-toc-relocation)
+ TC_DATA="" TOC_FORMAT="" BODY_FORMAT=""
+ ;;
+#
+# any other non-null match must have matched more than one defined case,
+# so report the ambiguity, and bail out.
+#
+ --*)
+ echo >&2 "$CMD: ambiguous abbreviation in option '$1'"
+ exit 1
+ ;;
+#
+# while no match at all simply represents an undefined case.
+#
+ *)
+ echo >&2 "$CMD: unknown option '$1'"
+ exit 1
+ ;;
+ esac
+ ;;
+#
+# A solitary hyphen, as an argument, means "stream STDIN through groff",
+# while the "-i" option means "append STDIN stream to specified input files",
+# so set up a mechanism to achieve this, for ALL 'groff' passes.
+#
+ - | -i*)
+ STREAM="$CAT ${GROFF_TMPDIR}/pdf$$.in |"
+ test "$1" = "-" && INPUT_FILES="$INPUT_FILES $1" \
+ || GROFF_STYLE="$GROFF_STYLE $1"
+ ;;
+#
+# Those standard options which expect an argument, but are specified with
+# an intervening space, between flag and argument, must be reparsed, so we
+# can trap illegal use of '-T dev', or missing input files.
+#
+ -[dfFILmMnoPrTwW])
+ OPTNAME="$1"
+ shift; set reparse "$OPTNAME$@"
+ ;;
+#
+# Among standard options, '-Tdev' is treated as a special case.
+# '-Tps' is automatically enforced, so if specified, is silently ignored.
+#
+ -Tps) ;;
+#
+# No other '-Tdev' option is permitted.
+#
+ -T*) echo >&2 "$CMD: option '$1' is incompatible with PDF output"
+ exit 1
+ ;;
+#
+# '-h' and '-v' options redirect to their equivalent long forms ...
+#
+ -h*) set redirect --help
+ ;;
+#
+ -v*) shift; set redirect --version "$@"
+ ;;
+#
+# All other standard options are simply passed through to 'groff',
+# with no validation beforehand.
+#
+ -*) GROFF_STYLE="$GROFF_STYLE \"$1\""
+ ;;
+#
+# All non-option arguments are considered as possible input file names,
+# and are passed on to 'groff', unaltered.
+#
+ *) INPUT_FILES="$INPUT_FILES \"$1\""
+ ;;
+ esac
+ shift
+ done
+#
+# If the '-v' or '--version' option was specified,
+# then we simply emulate the behaviour of 'groff', with this option,
+# and quit.
+#
+ if test -n "$SHOW_VERSION"
+ then
+ echo >&2 "$SHOW_VERSION"
+ echo >&2; eval $GROFF_STYLE $INPUT_FILES
+ exit $?
+ fi
+#
+# Establish how to invoke 'echo', suppressing the terminating newline.
+# (Adapted from 'autoconf' code, as found in 'configure' scripts).
+#
+ case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,*-n*) n='' c='' ;;
+ *c*) n='-n' c='' ;;
+ *) n='' c='\c' ;;
+ esac
+#
+# If STDIN is specified among the input files,
+# or if no input files are specified, then we need to capture STDIN,
+# so we can replay it into each 'groff' processing pass.
+#
+ test -z "$INPUT_FILES" && STREAM="$CAT ${GROFF_TMPDIR}/pdf$$.in |"
+ test -n "$STREAM" && $CAT > ${GROFF_TMPDIR}/pdf$$.in
+#
+# Unless reference resolution is explicitly suppressed,
+# we initiate it by touching the cross reference dictionary file,
+# and initialise the comparator, to kickstart the reference resolver loop.
+#
+ SAY=":"
+ if test -z "$DIFF"
+ then
+ >> $REFFILE
+ echo kickstart > $REFCOPY
+ test "${SHOW_PROGRESS+"set"}" = "set" && SAY=echo
+#
+# In order to correctly resolve 'pdfmark' references,
+# we need to have both the 'awk' and 'diff' programs available.
+#
+ NO=''
+ if test -n "$GROFF_AWK_INTERPRETER"
+ then
+ AWK="$GROFF_AWK_INTERPRETER"
+ test -f "$AWK" && test -x "$AWK" || AWK=":"
+ else
+ for prog in @GROFF_AWK_INTERPRETERS@
+ do
+ AWK=`searchpath $prog "$PATH"`
+ test "$AWK" = ":" || break
+ done
+ fi
+ DIFF=`searchpath diff "$PATH"`
+ test "$AWK" = ":" && echo >&2 "$NOPROG 'awk' in PATH" && NO="$NO 'awk'"
+ test "$DIFF" = ":" && echo >&2 "$NOPROG 'diff' in PATH" && NO="$NO 'diff'"
+ if test -n "$NO"
+ then
+ set $NO
+ SAY=":" AWK=":" DIFF=":"
+ test $# -gt 1 && NO="s $1 and $2 are" || NO=" $1 is"
+ $CAT >&2 <<-ETX
+
+ *** WARNING ***
+
+ The program$NO required, but cannot be found;
+ consequently, '$CMD' is unable to resolve 'pdfmark' references.
+
+ Document processing will continue, but no 'pdfmark' reference dictionary
+ will be compiled; if any 'pdfmark' reference appears in the resulting PDF
+ document, the formatting may not be correct.
+
+ ETX
+ fi
+ fi
+#
+# Run the multi-pass 'pdfmark' reference resolver loop ...
+#
+ $SAY >&2 $n Resolving references ..$c
+ until $DIFF $REFCOPY $REFFILE 1>$NULLDEV 2>&1
+ do
+#
+# until all references are resolved, to yield consistent values
+# in each of two consecutive passes, or until it seems that no consistent
+# resolution is achievable.
+#
+ $SAY >&2 $n .$c
+ PASS_INDICATOR="${PASS_INDICATOR}."
+ if test "$PASS_INDICATOR" = "...."
+ then
+#
+# More than three passes required indicates a probable inconsistency
+# in the source document; diagnose, and bail out.
+#
+ $SAY >&2 " failed"
+ $CAT >&2 <<-ETX
+ $CMD: unable to resolve references consistently after three passes
+ $CMD: the source document may exhibit instability about the reference(s) ...
+ ETX
+#
+# Report the unresolved references, as a diff between the two pass files,
+# preferring 'unified' or 'context' diffs, when available
+#
+ DIFFOPT=''
+ $DIFF -c0 $NULLDEV $NULLDEV 1>$NULLDEV 2>&1 && DIFFOPT='-c0'
+ $DIFF -u0 $NULLDEV $NULLDEV 1>$NULLDEV 2>&1 && DIFFOPT='-u0'
+ $DIFF >&2 $DIFFOPT $REFCOPY $REFFILE
+ exit 1
+ fi
+#
+# Replace the comparison file copy from any previous pass,
+# with the most recently updated copy of the reference dictionary.
+# (Some versions of 'mv' may not support overwriting of an existing file,
+# so remove the old comparison file first).
+#
+ rm -f $REFCOPY
+ mv $REFFILE $REFCOPY
+#
+# Run 'groff' and 'awk', to identify reference marks in the document source,
+# filtering them into the reference dictionary; discard incomplete 'groff' output
+# at this stage.
+#
+ eval $STREAM $GROFF_STYLE -Z 1>$NULLDEV 2>$WRKFILE $REFCOPY $INPUT_FILES
+ $AWK '/^gropdf-info:href/ {$1 = ".pdfhref D -N"; print}' $WRKFILE > $REFFILE
+ done
+ $SAY >&2 " done"
+#
+# To get to here ...
+# We MUST have resolved all 'pdfmark' references, such that the content of the
+# updated reference dictionary file EXACTLY matches the last saved copy.
+#
+# If PDF output has been suppressed, then there is nothing more to do.
+#
+ test "$PDF_OUTPUT" = "$NULLDEV" && exit 0
+#
+# We are now ready to start preparing the intermediate PostScript files,
+# from which the PDF output will be compiled -- but before proceding further ...
+# let's make sure we have a GhostScript interpreter to convert them!
+#
+ if test -n "$GROFF_GHOSTSCRIPT_INTERPRETER"
+ then
+ GS="$GROFF_GHOSTSCRIPT_INTERPRETER"
+ test -f "$GS" && test -x "$GS" || GS=":"
+ else
+ for prog in @GROFF_GHOSTSCRIPT_INTERPRETERS@
+ do
+ GS=`searchpath $prog "$PATH"`
+ test "$GS" = ":" || break
+ done
+ fi
+#
+# If we could not find a GhostScript interpreter, then we can do no more.
+#
+ if test "$GS" = ":"
+ then
+ echo >&2 "$CMD: installation problem: cannot find GhostScript interpreter"
+ $CAT >&2 <<-ETX
+
+ *** FATAL INSTALLATION ERROR ***
+
+ '$CMD' requires a GhostScript interpreter to convert PostScript to PDF.
+ Since you do not appear to have one installed, '$CMD' connot continue.
+
+ ETX
+ exit 1
+ fi
+#
+# We now extend the local copy of the reference dictionary file,
+# to create a full 'pdfmark' reference map for the document ...
+#
+ $AWK '/^grohtml-info/ {print ".pdfhref Z", $2, $3, $4}' $WRKFILE >> $REFCOPY
+#
+# Re-enable progress reporting, if necessary ...
+# (Missing 'awk' or 'diff' may have disabled it, to avoid display
+# of spurious messages associated with reference resolution).
+#
+ test "${SHOW_PROGRESS+"set"}" = "set" && SAY=echo
+#
+# If a document cover style sheet is specified ...
+# then we run a special formatting pass, to create a cover section file.
+#
+ if test -n "$STYLESHEET"
+ then
+ DOT='^\.[ ]*'
+ CS_MACRO=${CS_MACRO-"CS"} CE_MACRO=${CE_MACRO-"CE"}
+ $SAY >&2 $n "Formatting document ... front cover section ..$c"
+ CS_FILTER="$STREAM $SED -n '/${DOT}${CS_MACRO}/,/${DOT}${CE_MACRO}/p'"
+ eval $CS_FILTER $INPUT_FILES | eval $GROFF_STYLE $STYLESHEET - > $CS_DATA
+ $SAY >&2 ". done"
+ fi
+#
+# If table of contents relocation is to be performed (it is, by default),
+# then we run an extra 'groff' pass, to format a TOC intermediate file.
+#
+ if test -n "$TC_DATA"
+ then
+ $SAY >&2 $n "Formatting document ... table of contents ..$c"
+ eval $STREAM $GROFF_STYLE $TOC_FORMAT $REFCOPY $INPUT_FILES > $TC_DATA
+ $SAY >&2 ". done"
+ fi
+#
+# In all cases, a final 'groff' pass is required, to format the document body.
+#
+ $SAY >&2 $n "Formatting document ... body section ..$c"
+ eval $STREAM $GROFF_STYLE $BODY_FORMAT $REFCOPY $INPUT_FILES > $BD_DATA
+ $SAY >&2 ". done"
+#
+# Finally ...
+# Invoke GhostScript as a PDF writer, to bind all of the generated
+# PostScript intermediate files into a single PDF output file.
+#
+ $SAY >&2 $n "Writing PDF output ..$c"
+ PDFWRITE="$GS -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite"
+#
+# (This 'sed' script is a hack, to eliminate redundant blank pages).
+#
+ $SED '
+ :again
+ /%%EndPageSetup/b finish
+ /%%Page:/{
+ N
+ b again
+ }
+ b
+ :finish
+ N
+ /^%%Page:.*0 *Cg *EP/d
+ ' $TC_DATA $BD_DATA | $PDFWRITE -sOutputFile=${PDF_OUTPUT-"-"} $CS_DATA -
+ $SAY >&2 ". done"
+#
+# ------------------------------------------------------------------------------
+# $RCSfile: pdfroff.sh,v $ $Revision: 1.7 $: end of file
diff --git a/contrib/groff/contrib/pdfmark/spdf.tmac b/contrib/groff/contrib/pdfmark/spdf.tmac
new file mode 100644
index 000000000000..52bde1685fb0
--- /dev/null
+++ b/contrib/groff/contrib/pdfmark/spdf.tmac
@@ -0,0 +1,225 @@
+.\" -*- nroff -*-
+.ig
+
+spdf.tmac
+
+Copyright (C) 2004
+ Free Software Foundation, Inc.
+ Written by Keith Marshall (keith.d.marshall@ntlworld.com)
+
+This file is part of groff.
+
+groff is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+groff is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License along
+with groff; see the file COPYING. If not, write to the Free Software
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
+
+..
+.\"
+.if !rOPMODE .nr OPMODE 1
+.\"
+.mso s.tmac
+.mso pdfmark.tmac
+.\"
+.\" Omitted Sections
+.\" ================
+.\"
+.\" Define section markers, for special document sections,
+.\" which are to be omitted from regular document processing.
+.\"
+.de OMIT OMIT
+.de \\$1
+.omit@begin \\$1 \\$2
+..
+.de \\$2
+.omit@end \\$1 \\$2
+..
+.OMIT CS CE \" front cover text, processed independently
+.OMIT MS ME \" menu definitions, for info documents only
+.\"
+.de omit@begin
+.ds omit@section \\$1
+.ig \\$2
+..
+.de omit@end
+.if !'\\*[omit@section]'\\$1' .@error \\$2 without \\$1
+.rm omit@section
+..
+.de XM
+.\"
+.pdfhref M -X \\$@
+..
+.de XR
+.if \\n(.$ \{\
+. if \\n[OPMODE] \{\
+. ds spdf!opts -D "\\$1"
+. if \\n(.$>1 .as spdf!opts " -A "\\$2"
+. if \\n(.$>2 .as spdf!opts " -P "\\$3"
+. pdfhref L \\*[spdf!opts]
+. rm spdf!opts
+. \}
+. \}
+..
+.\"
+.\" Document Outlines, Section Headings and Table of Contents
+.\" =========================================================
+.\"
+.de XN
+.\" Use AFTER .NH n, to define the text of the numbered heading,
+.\" automatically generating a matching formatted TOC entry, and
+.\" a PDF document outline entry.
+.\"
+.\" String registers XNVS1, XNVS2 and XNVS3 establish additional leading,
+.\" prior to top level headings, preceding each level of indented subheading,
+.\" and following each nested level of subheading, respectively
+.\" (strings are used, rather than numeric registers, so that these
+.\" additional spacing parameters may be set relative to the current
+.\" document line spacing, as set by \n[VS]).
+.\"
+.rm xn*ref
+.while dopt*XN\\$1 \{\
+. opt*XN\\$1 \\$*
+. shift \\n[xn*argc]
+. \}
+.rr xn*argc
+.if '\\$1'--' .shift
+.if dxn*ref .XM -N \\*[xn*ref] -- \\$@
+.rm xn*ref
+.pdfhref O \\n[nh*hl] "\\*(SN \\$*"
+.XS
+.if rtc*hl \{\
+. if !dXNVS1 .ds XNVS1 1.0v \" default leading for top level
+. if !dXNVS2 .ds XNVS2 0.3v \" default leading at nesting increment
+. if !dXNVS3 .ds XNVS3 0.6v \" default leading following nested group
+. if \\n[nh*hl]==1 \{\
+. sp \\*[XNVS1]
+. nr tc*hl-max 1
+. \}
+. ie \\n[nh*hl]<\\n[tc*hl] .if \\n[nh*hl]>1 .sp \\*[XNVS3]
+. el \{\
+. ie \\n[nh*hl]>\\n[tc*hl] .sp \\*[XNVS2]
+. el \{\
+. if !r tc*hl-max .nr tc*hl-max 1
+. ie \\n[tc*hl-max]>\\n[nh*hl] .sp \\*[XNVS3]
+. el .nr tc*hl-max \\n[nh*hl]
+. \}
+. \}
+. \}
+.nr tc*hl \\n[nh*hl]
+\h'\\n[nh*hl]-1m'\c
+\&\\*(SN\h'1n'\\$*
+.\".pdfhref L -D \\*[PDFBOOKMARK.NAME] -- \&\\*(SN\h'1n'\\$*
+.XE
+\&\\$*
+..
+.de opt*XN-N
+.nr xn*argc 2
+.ds xn*ref \\$2
+..
+.de opt*XN-X
+.nr xn*argc 1
+.if !dxn*ref .ds xn*ref \\\\$1
+..
+.de LU
+.LP
+The content for this section is not yet available.
+..
+.de AN
+.ie \\n(.$ .@AN \\$*
+.el .@AN Note
+..
+.de @AN
+.SH
+\\$*
+.LP
+..
+.nr PDF-TOC-ONLY 1
+.nr PDF-BODY-TEXT 2
+.de OP
+.ie rPHASE \{\
+. ie \\n(.$ \{\
+. nr op:request 0
+. while \\n(.$ \{\
+. if \\$1=\\n[PHASE] .nr op:request 1
+. shift
+. \}
+. \}
+. el .nr op:request 1
+. if !\\n[op:request]=\\n[OPMODE] \{\
+. nr OPMODE \\n[op:request]
+. nop \O[\\n[OPMODE]]\c
+. \}
+. \}
+.el .nr OPMODE 1
+..
+.nr SAME-PAGE 0
+.de NN
+.if !\\n[SAME-PAGE] .bp
+.nr SAME-PAGE 0
+.NH \\$1
+.nn*setname \\$2
+.shift 2
+.XN -N \\*[nn*name] -- \\$@
+.rm nn*name
+..
+.de nn*setname
+.ds nn*name \\$1
+.shift
+.while \\n(.$ \{\
+. as nn*name -\\$1
+. shift
+. \}
+..
+.de PXREF
+.nn*setname \\$2
+.XR \\*[nn*name] )\\$1 (
+.rm nn*name
+..
+.de IS
+.RS
+.nr LL \\n(LL-\\n(PI
+..
+.de IE
+.RE
+.nr LL \\n(LL+\\n(PI
+..
+.\" Override the standard ms macro,
+.\" to ensure the document outline cache is flushed
+.\" BEFORE emitting the table of contents.
+.de TC
+.pdfsync O
+.P1
+.OP \n[PDF-TOC-ONLY]
+.pg@begin 1 i
+.if \\n[OPMODE] .pdf@toc
+.PX \\$1
+..
+.de pdf@toc
+.pdfhref O -T T 1 "\\*[TOC]"
+.pdfsync O
+..
+.de pdf@exit
+.if \\n[OPMODE] .pdfsync
+.pg@end-text
+..
+.em pdf@exit
+.OP \n[PDF-BODY-TEXT]
+.
+.\" groff "ms" provides the "pg@bottom" macro, which has already
+.\" been installed as a page transition trap. To ensure proper
+.\" mapping of "pdfhref" links which overflow the bottom of any
+.\" page, we need to install the "pdfhref" page transition hook,
+.\" as an addendum to this macro.
+.
+.pdfhref I -PT pg@bottom
+.\"
+.\" spdf.tmac: end of file: vim: ft=groff
diff --git a/contrib/groff/contrib/pic2graph/pic2graph.man b/contrib/groff/contrib/pic2graph/pic2graph.man
index c48c1c79235f..36008cba4a50 100644
--- a/contrib/groff/contrib/pic2graph/pic2graph.man
+++ b/contrib/groff/contrib/pic2graph/pic2graph.man
@@ -1,4 +1,4 @@
-.\" $Id: pic2graph.man,v 1.3 2002/07/17 04:55:46 wlemb Exp $
+.\" $Id: pic2graph.man,v 1.5 2003/10/28 07:46:24 wlemb Exp $
.\" This documentation is released to the public domain.
.TH PIC2GRAPH @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
.IX pic2graph
@@ -106,8 +106,25 @@ The
initialization file.
.
.
+.SH ENVIRONMENT
+.TP
+.B GROFF_TMPDIR
+The directory in which temporary files will be created.
+If this is not set
+.B pic2graph
+searches the environment variables
+.BR \%TMPDIR ,
+.BR TMP ,
+and
+.B TEMP
+(in that order).
+Otherwise, temporary files will be created in
+.BR /tmp .
+.
+.
.SH "SEE ALSO"
.BR eqn2graph (@MAN1EXT@),
+.BR grap2graph (@MAN1EXT@),
.BR @g@pic (@MAN1EXT@),
.BR @g@eqn (@MAN1EXT@),
.BR groff (@MAN1EXT@),
diff --git a/contrib/groff/contrib/pic2graph/pic2graph.sh b/contrib/groff/contrib/pic2graph/pic2graph.sh
index f4478519a569..5a066cef2e25 100644
--- a/contrib/groff/contrib/pic2graph/pic2graph.sh
+++ b/contrib/groff/contrib/pic2graph/pic2graph.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
#
# pic2graph -- compile PIC image descriptions to bitmap images
#
@@ -32,7 +32,7 @@
# We don't have complete option coverage on eqn because this is primarily
# intended as a pic translator; we can live with eqn defaults.
#
-# $Id: pic2graph.sh,v 1.3 2002/12/21 08:32:56 wlemb Exp $
+# $Id: pic2graph.sh,v 1.7 2005/05/18 07:03:07 wl Exp $
#
groffpic_opts=""
gs_opts=""
@@ -68,16 +68,34 @@ then
eqndelim="delim $eqndelim"
fi
+# create temporary directory
+tmp=
+for d in "$GROFF_TMPDIR" "$TMPDIR" "$TMP" "$TEMP" /tmp; do
+ test -z "$d" && continue
+
+ tmp=`(umask 077 && mktemp -d -q "$d/pic2graph-XXXXXX") 2> /dev/null` \
+ && test -n "$tmp" && test -d "$tmp" \
+ && break
+
+ tmp=$d/pic2graph$$-$RANDOM
+ (umask 077 && mkdir $tmp) 2> /dev/null \
+ && break
+done;
+if test -z "$tmp"; then
+ echo "$0: cannot create temporary directory" >&2
+ { (exit 1); exit 1; }
+fi
+
+trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 2 15
+
# Here goes:
# 1. Wrap the input in dummy .PS/PE macros (and add possibly null .EQ/.EN)
# 2. Process through eqn and pic to emit troff markup.
# 3. Process through groff to emit Postscript.
# 4. Use convert(1) to crop the PostScript and turn it into a bitmap.
-tmp=/usr/tmp/pic2graph-$$
-trap "rm ${tmp}.*" 0 2 15
(echo ".EQ"; echo $eqndelim; echo ".EN"; echo ".PS"; cat; echo ".PE") | \
- groff -e -p $groffpic_opts -Tps >${tmp}.ps \
- && convert -crop 0x0 $convert_opts ${tmp}.ps ${tmp}.${format} \
- && cat ${tmp}.${format}
+ groff -e -p $groffpic_opts -Tps -P-pletter > $tmp/pic2graph.ps \
+ && convert -trim -crop 0x0 $convert_opts $tmp/pic2graph.ps $tmp/pic2graph.$format \
+ && cat $tmp/pic2graph.$format
# End