summaryrefslogtreecommitdiffstats
path: root/contrib/groff/mm
diff options
context:
space:
mode:
authorasmodai <asmodai@FreeBSD.org>2000-01-12 09:51:43 +0000
committerasmodai <asmodai@FreeBSD.org>2000-01-12 09:51:43 +0000
commit2e2c9047c3a8b5b6fdcdcd4585d5b114f31cd386 (patch)
tree723c5fa18b7084a4da09e4e42000ef10cbc884fa /contrib/groff/mm
parent35cdaa022af3f495aa21a1292d85ee40b28f86fb (diff)
downloadFreeBSD-src-2e2c9047c3a8b5b6fdcdcd4585d5b114f31cd386.zip
FreeBSD-src-2e2c9047c3a8b5b6fdcdcd4585d5b114f31cd386.tar.gz
Virgin import of FSF groff v1.15
Diffstat (limited to 'contrib/groff/mm')
-rw-r--r--contrib/groff/mm/ChangeLog111
-rw-r--r--contrib/groff/mm/Makefile.sim66
-rw-r--r--contrib/groff/mm/Makefile.sub14
-rw-r--r--contrib/groff/mm/README3
-rw-r--r--contrib/groff/mm/groff_mm.man250
-rw-r--r--contrib/groff/mm/groff_mmse.man14
-rw-r--r--contrib/groff/mm/mm/0.MT16
-rw-r--r--contrib/groff/mm/mm/4.MT17
-rw-r--r--contrib/groff/mm/mm/5.MT4
-rw-r--r--contrib/groff/mm/mm/ms.cov4
-rw-r--r--contrib/groff/mm/mm/se_ms.cov2
-rw-r--r--contrib/groff/mm/tmac.m899
-rw-r--r--contrib/groff/mm/tmac.mse11
13 files changed, 1045 insertions, 366 deletions
diff --git a/contrib/groff/mm/ChangeLog b/contrib/groff/mm/ChangeLog
index 5320294..fb0d4fe 100644
--- a/contrib/groff/mm/ChangeLog
+++ b/contrib/groff/mm/ChangeLog
@@ -1,3 +1,114 @@
+Mon Mar 15 22:22:42 1999 Jörgen Hägg (jh at axis.com)
+
+ * OK, let's release this as a beta, 1.33 will be better. :-)
+ * version 1.32
+ * fixed .el-error
+ * Added number variable Hss
+ * Changed Hps1 and Hps2 to units
+ * added hd*h1-text to be used in user defined macro TP.
+ * -U needed for SETR (I really need 'mv', 'echo', 'rm'
+ and 'test' builtin!)
+ * Rewritten the reference system, SETR now prints to stderr
+ if the number register Qrf > 0. Store in the filename
+ that is the argument to .INITR
+ The old behaviour is returned if number register Initr > 0.
+ * Fixed bug with List of XXXX, long lines messed up the result.
+ * added number register H1dot.
+ * added string variable H1txt
+ * added string variable Tcst
+ * added number register Dsp.
+ * added alias APPX for user-defined appendix title.
+ * added string variable Apptxt
+ * added H1h for use in TP in headers
+ * added macro EPIC
+ * added macro PIC (safe replacement for PSPIC)
+ * fixed Hps-bug, should be 1, not 1v.
+ * fixed bug with APPSK, variable not set.
+
+Wed Feb 4 15:46:04 1998 Jörgen Hägg (jh at axis.se)
+
+ * version 1.31
+ * .LI will now honor a space mark.
+ * Another fix for .AU to let it be used without arguments.
+ * uninitialized eq*label fixed
+
+Fri Sep 6 07:13:07 1996 Jörgen Hägg (jh at axis.se)
+
+ * version 1.30
+ * This is more like a beta-release, bugs might pop up. :-)
+ * last line in TOC was not correctly terminated (missing .br)
+ * changed the indentation for displays, it will now
+ indent to the current indent, not the one at the definition
+ of the display.
+ * Equation marks should now work better, indentation also.
+ * included these bug fixes from Larry Jones:
+ * The documentation for the argument to .AS was incorrect for MT 4.
+ * \*(EM should be a double-dash for nroff.
+ * \nS is in points, not units.
+ * If \nO isn't set, the default page offset should be .75i for nroff
+ and .963i for troff.
+ * .S D should set the point size to \nS, not 10.
+ * .S was setting the vertical spacing based on the old point size
+ instead of the new point size.
+ * Got rid of a spurrious .br that prevented run-in headings from
+ working.
+ * Reset the .SP counters in pg@header so that spacing on one page
+ won't affect spacing on subsequent pages.
+ * Allow .AU and .AF with no arguments (real mm does, even though it
+ isn't documented).
+ * Do .init@reset first thing to initialize the default environment.
+ * For MT 4, the title should be 4 points larger than the default size,
+ not 12 point.
+ * The cover environment needs to be initialized.
+ * Printing the abstract on the first page needs to be controlled by
+ the .AS argument.
+ * Heading eject should be suppressed if the heading immediately
+ follows the first page stuff (title, author, etc.).
+ * support for table of contents numbering style (.nr Oc)
+ * changes the troff empty line height from .25v to .5v
+ * fixed section page numbering
+ * fixed a really nasty bug in footnotes that could cause you
+ to lose the page footer completely if the very first
+ footnote on the page occurred at just the wrong place
+
+
+Wed May 15 07:39:32 1996 Jörgen Hägg (jh at axis.se)
+
+ * version 1.29
+ * Syntax and scaling errror fixed, (thanks to Frazer Williams)
+ * DF/DE will now do a line-break before printing the display.
+ * Updated the manual for TB,FG,EX and EC.
+ * Added support for the ms- (and mgs-)macro .IX
+ * Added indexmacro IX, INITI, IND and INDP, support for
+ TXIND, TYIND and TZIND.
+ * PGFORM will now always really reset to the default
+ values for unspecified arguments.
+ * Floating displays tested and repaired, it should
+ now (finanlly) work exactly as the original (I hope :-).
+ * Should now set year correctly even after 2000.
+ * Stupid bug in PGNH fixed.
+ * Corrected line length for figure caption (FG and friends)
+
+
+Mon Apr 24 07:37:52 1995 Jörgen Hägg (jh at axis.se)
+
+ * version 1.28
+ * Added AVL (AV without date)
+ * Fixed nroff scaling for W and L.
+ * Added support for register E and roman/bold
+ for all Subject/Date/From strings.
+ * Added support for register C (1-4), (for DRAFTs and other types)
+ * Will protest if not used with groff.
+ * Change of the internal number registers @ps and @vs, they
+ are now in units, and is set in the new macros .@ps and .@vs.
+ @ps and @vs is now corrected to the real point and vertical size.
+ * Macro EQ has now correct pointsize.
+ * Figures should now get the right page number in the index.
+ * User-defined macros can now be defined for list of
+ figures, tables, equations and exhibits (T{X,Y}{FG,TB,EC,EX}.
+ * Space may be omitted between prefix and mark in automatic lists (.AL)
+ See .LI
+
Tue Jan 10 07:51:37 1995 Jörgen Hägg (jh at axis.se)
* version 1.27
diff --git a/contrib/groff/mm/Makefile.sim b/contrib/groff/mm/Makefile.sim
new file mode 100644
index 0000000..2ac0892
--- /dev/null
+++ b/contrib/groff/mm/Makefile.sim
@@ -0,0 +1,66 @@
+#
+# $Id: Makefile.sim,v 1.32 1999/09/03 05:33:14 jh Exp $
+#
+# To install mgm separately as tmac.gm:
+# make -f Makefile.sub tmacdir=/usr/local/lib/groff/tmac srcdir=. \
+# INSTALL_DATA='install -m 644' tmac_m=gm install
+#
+# or as tmac.m:
+#
+# tmacdir is the destination for your groff/tmac-directory, srcdir is
+# this directory and INSTALL_DATA is the command to install a file with.
+# If you dont have 'install': use 'cp'.
+
+
+# change this to whatever you like
+tmacdir=/usr/local/lib/groff/tmac
+#tmac_m = gm
+tmac_m = m
+indexdir = xx
+install = install -m 644
+
+# Do not change anything below this line
+srcdir = .
+version = 1.32
+mdate = 1999-09-03
+
+.SUFFIXES: .n .man
+
+all:
+
+
+install: groff_mm.n groff_mmse.n
+ $(MAKE) -f Makefile.sub tmacdir=$(tmacdir) srcdir=$(srcdir) \
+ INSTALL_DATA='$(install)' tmac_m=$(tmac_m) install
+
+ uninstall: groff_mm.n groff_mmse.n
+ $(MAKE) -f Makefile.sub tmacdir=$(tmacdir) srcdir=$(srcdir) \
+ INSTALL_DATA='$(install)' tmac_m=$(tmac_m) uninstall_sub
+
+
+.man.n:
+ @echo Making $@ from $<
+ @-rm -f $@
+ @sed -e "s;@HYPHENFILE@;$(hyphenfile);g" \
+ -e "s;@FONTDIR@;$(fontdir);g" \
+ -e "s;@FONTPATH@;$(fontpath);g" \
+ -e "s;@MACRODIR@;$(tmacdir);g" \
+ -e "s;@MACROPATH@;$(tmacpath);g" \
+ -e "s;@DEVICE@;$(DEVICE);g" \
+ -e "s;@DEFAULT_INDEX@;$(indexdir)/$(indexname);g" \
+ -e "s;@DEFAULT_INDEX_NAME@;$(indexname);g" \
+ -e "s;@INDEX_SUFFIX@;$(indexext);g" \
+ -e "s;@COMMON_WORDS_FILE@;$(common_words_file);g" \
+ -e "s;@MAN1EXT@;$(man1ext);g" \
+ -e "s;@MAN5EXT@;$(man5ext);g" \
+ -e "s;@MAN7EXT@;$(man7ext);g" \
+ -e "s;@TMAC_S@;$(tmac_s);g" \
+ -e "s;@TMAC_M@;$(tmac_m);g" \
+ -e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \
+ -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \
+ -e "s;@VERSION@;$(version);g" \
+ -e "s;@MDATE@;$(mdate);g" \
+ -e "s;@g@;$(g);g" \
+ -e "s;@G@;`echo $(g) | tr [a-z] [A-Z]`;g" \
+ $< >$@
+
diff --git a/contrib/groff/mm/Makefile.sub b/contrib/groff/mm/Makefile.sub
index 60307cd..08d6b55 100644
--- a/contrib/groff/mm/Makefile.sub
+++ b/contrib/groff/mm/Makefile.sub
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.sub,v 1.27 1995/04/24 05:37:46 jh Exp $
+# $Id: Makefile.sub,v 1.32 1999/09/03 05:33:12 jh Exp $
#
MAN7=groff_mm.n groff_mmse.n
FILES=0.MT 5.MT 4.MT ms.cov se_ms.cov
@@ -20,10 +20,10 @@ install_mm: install_m
install_m:
-test -d $(tmacdir) || mkdir $(tmacdir)
- -rm -f $(tmacdir)/tmac.$(tmac_m_prefix)m
- $(INSTALL_DATA) $(srcdir)/tmac.m $(tmacdir)/tmac.$(tmac_m_prefix)m
- @sed -e "s;^.mso tmac.m;.mso $(tmac_m_prefix)m;g" $(srcdir)/tmac.mse \
- > $(tmacdir)/tmac.$(tmac_m_prefix)mse
+ -rm -f $(tmacdir)/tmac.$(tmac_m)
+ $(INSTALL_DATA) $(srcdir)/tmac.m $(tmacdir)/tmac.$(tmac_m)
+ @sed -e "s;^.mso tmac.m;.mso $(tmac_m);g" $(srcdir)/tmac.mse \
+ > $(tmacdir)/tmac.$(tmac_m)se
@@ -32,6 +32,6 @@ uninstall_sub:
-for f in $(LOCALE); do \
test -s $(tmacdir)/mm/$$f || rm -f $(tmacdir)/mm/$$f; \
done
- -rm -f $(tmacdir)/tmac.$(tmac_m_prefix)m
- -rm -f $(tmacdir)/tmac.$(tmac_m_prefix)mse
+ -rm -f $(tmacdir)/tmac.$(tmac_m)
+ -rm -f $(tmacdir)/tmac.$(tmac_m)se
-rmdir $(tmacdir)/mm
diff --git a/contrib/groff/mm/README b/contrib/groff/mm/README
index f08f68d..a720f07 100644
--- a/contrib/groff/mm/README
+++ b/contrib/groff/mm/README
@@ -13,7 +13,8 @@ of tmac.m) and the version of groff.
Any new ideas or improvements are welcome.
Newest version is available with anonymous FTP
-at ftp.efd.lth.se [130.235.48.11], as pub/groff/mm<something>.Z
+at ftp://ftp.efd.lth.se/pub/groff/mm<something>.gz
+or ftp://ftp.axis.se/pub/groff/mm<something>.gz
You can install mgm as a separate package without the configure in groff
with the following command:
diff --git a/contrib/groff/mm/groff_mm.man b/contrib/groff/mm/groff_mm.man
index a2ae4af..6398b1e 100644
--- a/contrib/groff/mm/groff_mm.man
+++ b/contrib/groff/mm/groff_mm.man
@@ -1,22 +1,5 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1991-1995 Free Software Foundation, Inc.
-
-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.
-..
-.\" $Id: groff_mm.man,v 1.27 1995/04/24 05:37:46 jh Exp $
+.\"
+.\" $Id: groff_mm.man,v 1.32 1999/09/03 05:33:12 jh Exp $
.\"
.de T2
.ne 2v
@@ -35,7 +18,7 @@ the original English.
groff_mm \- groff mm macros
.SH SYNOPSIS
.B groff
-.B \-m@TMAC_M_PREFIX@m
+.B \-m@TMAC_M@
[
.IR options .\|.\|.
]
@@ -55,16 +38,9 @@ the macros OK and PM is not implemented.
.B \(bu
groff mm does not support cut marks
.LP
-\fBm@TMAC_M_PREFIX@m\fP is intended to be international. Therefore it is
+\fBm@TMAC_M@\fP is intended to be international. Therefore it is
possible to write short national macrofiles which change all
-english text to the preferred language. Use \fBm@TMAC_M_PREFIX@mse\fP as an example.
-.LP
-New macros: \fBAPP\fP, \fBAPPSK\fP, \fBB1\fP, \fBB2\fP, \fBBVL\fP,
-\fBCOVER\fP, \fBCOVEND\fP, \fBGETHN\fP, \fBGETPN\fP, \fBGETR\fP,
-\fBGETST\fP, \fBINITR\fP, \fBMC\fP, \fBMOVE\fP, \fBMULB\fP,
-\fBMULN\fP, \fBMULE\fP, \fBPGFORM\fP, \fBPGNH\fP, \fBSETR\fP,
-\fBTAB\fP, \fBVERBON\fP, \fBVERBOFF\fP.
-.LP
+english text to the preferred language. Use \fBm@TMAC_M@se\fP as an example.
.\"########################################################################
.LP
A file called \fBlocale\fP or \fIlang\fP\fB_locale\fP is read
@@ -123,6 +99,12 @@ Set the format with \fBaf\fP:
.LP
\fBMacros:\fP
.TP
+.B ")E level text"
+Adds \fBtext\fP (heading-text) to the table of contents
+with \fBlevel\fP either 0
+or between 1-7. See also \fB.H\fP. This macro is used for customized
+table of contents.
+.TP
.B "1C [1]"
Begin one column processing. An \fB1\fP as argument disables the page-break.
Use wide footnotes, small footnotes may be overprinted.
@@ -166,6 +148,7 @@ variable \fBAph\fP is non-zero. This is the default.
The appendix always appear in the 'List of contents' with correct
pagenumber. The name \fIAPPENDIX\fP can be changed by setting
the string \fBApp\fP to the desired text.
+The string \fBApptxt\fP contains the current appendix text.
.TP
.B "APPSK name pages text"
Same as \fB.APP\fP, but the pagenr is incremented with \fIpages\fP.
@@ -179,14 +162,14 @@ Argument \fIarg\fP controls where the abstract is printed.
.T2 Arg
Placement
.T2 0
-Abstract will be printed on page 1 and con the cover sheet if
+Abstract will be printed on page 1 and on the cover sheet if
used in the released-paper style (\fBMT 4\fP), otherwise
it will be printed on page 1 without a cover sheet.
.T2 1
-Abstract will only be printed on page 1 (\fBMT 4\fP only).
+Abstract will only be printed on the cover sheet (\fBMT 4\fP only).
.T2 2
-Abstract will be printed only on the cover sheet. The cover sheet
-is printed without need for \fBCS\fP.
+Abstract will be printed only on the cover sheet (other than \fBMT 4\fP only).
+The cover sheet is printed without need for \fBCS\fP.
.in
Abstract is not printed at all in external letters (\fBMT 5\fP).
The \fIindent\fP controls the indentation of both margins, otherwise
@@ -200,7 +183,7 @@ Sets the text above the abstract text.
Authors title. \fBAT\fP must appear just after each \fBAU\fP.
The title will show up after the name in the signature block.
.TP
-.B "AU name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]"
+.B "AU [name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]]"
Author information, specifies the author of the memo or paper, and
will be printed on the cover sheet and on other similar places.
\fBAU\fP must appear before \fBTL\fP. The author information
@@ -212,6 +195,9 @@ Approval signature, generates an approval line with place for
signature and date. The string \fBAPPROVED:\fP can be changed
with variable \fBLetapp\fP, and the string \fBDate\fP in \fBLetdate\fP.
.TP
+.B "AVL [name]"
+Letter signature, generates a line with place for signature.
+.TP
.B "B [bold-text [prev-font-tex [bold...]]]"
Begin boldface
No limit on the number of arguments.
@@ -409,12 +395,19 @@ change the numbering.
It is possible to use \fB.af\fP to change the format of the number.
If number register \fBOf\fP is 1, then the format of title
will use a dash instead of a dot after the number.
+.br
The string \fBLe\fP controls the title of the
List of Equations, default is \fILIST OF EQUATIONS\fP.
+The List of Equations will only be printed if number register \fBLe\fP
+is 1, default 0.
The string \fBLiec\fP contains the word \fIEquation\fP, wich
is printed before the number.
-If \fIrefname\fP is used, then the equationnumber is saved with
+If \fIrefname\fP is used, then the equation number is saved with
\&\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
+.br
+Special handling of the title will occur if
+\fBEC\fP is used inside \fBDS\fP/\fBDE\fP, it will not be
+affected by the format of \fBDS\fP.
.TP
.B "EF [arg]"
Even-page footer, printed just above the normal page footer
@@ -443,6 +436,14 @@ Argument from \fBEF\fP.
Argument from \fBOF\fP.
.in
.TP
+.B "EPIC width height [name]"
+\fBEPIC\fP draws a box with the given \fIwidth\fP and \fIheight\fP, it will
+also print the text \fIname\fP or a default string if
+\fIname\fP is not specified..
+This is used to include external pictures, just give the size
+of the picture.
+See \fBPIC\fP
+.TP
.B "EQ [label]"
Equation start.
\fBEQ\fP/\fBEN\fP are the delimiters for equations written for \fBeqn\fP.
@@ -453,14 +454,20 @@ number register \fBEq\fP is 1. Then the label will appear at the
left margin.
.TP
.B "EX [title [override [flag [refname]]]]"
-Exhibit title, arguments are the same as for \fBEC\fP
+Exhibit title, arguments are the same as for \fBEC\fP.
\fBEX\fP uses the number register \fBEx\fP as counter.
The string \fBLx\fP controls the title of the
List of Exhibits, default is \fILIST OF EXHIBITS\fP.
+The List of Exhibits will only be printed if number register \fBLx\fP
+is 1, default 1.
The string \fBLiex\fP contains the word \fIExhibit\fP, wich
is printed before the number.
-If \fIrefname\fP is used, then the exhibitnumber is saved with
+If \fIrefname\fP is used, then the exhibit number is saved with
\&\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
+.br
+Special handling of the title will occur if
+\fBEX\fP is used inside \fBDS\fP/\fBDE\fP, it will not be
+affected by the format of \fBDS\fP.
.TP
.B "FC [closing]"
Prints \fIYours\ very\ truly,\fP as a formal closing of a letter or
@@ -493,15 +500,26 @@ justification (ljust).
.fi
.DT
Argument greater than or equal to 11 is considered as arg 0.
-Default for m@TMAC_M_PREFIX@mm is 10.
+Default for m@TMAC_M@m is 10.
.TP
.B FE
Footnote end.
.TP
.B "FG [title [override [flag [refname]]]]"
-Figure title.
-If \fIrefname\fP is used, then the figurenumber is saved with
+Figure title, arguments are the same as for \fBEC\fP.
+\fBFG\fP uses the number register \fBFg\fP as counter.
+The string \fBLf\fP controls the title of the
+List of Figures, default is \fILIST OF FIGURES\fP.
+The List of Figures will only be printed if number register \fBLf\fP
+is 1, default 1.
+The string \fBLifg\fP contains the word \fIFigure\fP, wich
+is printed before the number.
+If \fIrefname\fP is used, then the figure number is saved with
\&\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
+.br
+Special handling of the title will occur if
+\fBFG\fP is used inside \fBDS\fP/\fBDE\fP, it will not be
+affected by the format of \fBDS\fP.
.TP
.B "FS [label]"
Footnote start.
@@ -752,12 +770,59 @@ See \fBI\fP.
.B IE
Ends the address-specification after \fPIA\fP.
.TP
+.B "INITI filename [type]"
+Initialize the new index system, sets the filename to collect
+index lines in with \fBIND\fP. Argument \fItype\fP selects
+teh type of index, page number, header marks or both.
+The default is \fIN\fP.
+.sp
+\fBtype\fP
+.in +.5i
+.T2 N
+Page numbers
+.T2 H
+Header marks
+.T2 B
+Both page numbers and header marks, tab separated
+.in
+.TP
+.B "IND arg1 [arg2 [...]]"
+\fBIND\fP writes a line in the index file selected by \fBINITI\fP
+with all arguments and the page number or header mark separated by tabs.
+.in +.5i
+\fBExamples\fP
+.br
+arg1\etpage number
+.br
+arg1\etarg2\etpage number
+.br
+arg1\etheader mark
+.br
+arg1\etpage number\etheader mark
+.in
+.TP
+.B "INDP"
+\fBINDP\fP prints the index by running the command specified
+by string variable \fBIndcmd\fP, normally \fIsort\ -t\et\fP.
+\fBINDP\fP reads the output from the command to form
+the index, normally in two columns (can be changed by defining \fBTYIND\fP).
+The index is printed with string variable \fBIndex\fP as header,
+default is \fBINDEX\fP. One-column processing is
+returned after the list. \fBINDP\fP will call the
+user-defined macros \fBTXIND\fP, \fBTYIND\fP and \fBTZIND\fP if defined.
+\fBTXIND\fP is called before printing \fBINDEX\fP, \fBTYIND\fP
+is called instead of printing \fBINDEX\fP. \fBTZIND\fP is called
+after the printing and should take care of restoring to normal
+operation again.
+
+.TP
.B "INITR filename"
Initialize the refencemacros. References will be written to
\fIfilename.tmp\fP and \fIfilename.qrf\fP. Requires two passes with groff.
The first looks for references and the second includes them.
\fBINITR\fP can be used several times, but it is only the first
occurrence of \fBINITR\fP that is active.
+Option \fB-U\fP might be needed if \fBunsafe\fP-errors occur.
See also \fBSETR\fP, \fBGETPN\fP and \fBGETHN\fP.
.TP
.B "IR [italic-text [roman-text [italic-text [...]]]"
@@ -828,7 +893,12 @@ List item precedes every item in a list. Without argument \fBLS\fP
will print the mark determined by the current list type. By giving
\fBLI\fP one argument, it will use that as the mark instead.
Two arguments to \fBLI\fP will make \fImark\fP a prefix to
-the current mark. A zero length \fImark\fP will make a hanging
+the current mark.
+There will be no separating space between the prefix
+and the mark if the second argument is \fB2\fP instead of \fB1\fP.
+This behaviour can also be achieved by setting number register
+\fBLimsp\fP to zero.
+A zero length \fImark\fP will make a hanging
indent instead.
.sp
A blank line is normally printed before the list item. This behaviour
@@ -1060,6 +1130,9 @@ to reset everything after a \fBMOVE\fP.
A line-break is done unless the fourth argument is given.
This can be used to avoid the pagenumber on the first page while setting
new width and length.
+(It seems as if this macro sometimes doesn't work too well.
+Use the command line arguments
+to change linelength, pagelength and pageoffset instead. Sorry.)
.TP
.B PGNH
No header is printed on the next page. Used to get rid off
@@ -1067,9 +1140,16 @@ 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]]
+\fBPIC\fP includes a Postscript file in the document.
+The macro depends on \fBmgm_ref\fP and \fBINITR\fP.
+\fB-L\fP, \fB-C\fP, \fB-R\fP and \fB-I n\fP adjusts the picture
+or indents it. The optionally \fIwidth\fP and \fIheight\fP
+can also be given to resize the picture.
+.TP
.B PE
Picture end.
-Ends a picture for \fB@g@pic\fP, see the manual for \fB@g@pic\fP.
+Ends a picture for \fB@TMAC_M@pic\fP, see the manual for \fB@TMAC_M@pic\fP.
.TP
.B "PF [arg]"
Page footer.
@@ -1216,9 +1296,18 @@ to avoid this.
reset tabs to every 5n. Normally used to reset any previous tabpositions.
.TP
.B "TB [title [override [flag [refname]]]]"
-Table title.
-If \fIrefname\fP is used, then the tablenumber is saved with
-\&\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
+Table title, arguments are the same as for \fBEC\fP.
+\fBTB\fP uses the number register \fBTb\fP as counter.
+The string \fBLt\fP controls the title of the
+List of Tables, default is \fILIST OF TABLES\fP.
+The List of Tables will only be printed if number register \fBLt\fP
+is 1, default 1.
+The string \fBLitb\fP contains the word \fITABLE\fP, wich
+is printed before the number.
+.br
+Special handling of the title will occur if
+\fBTB\fP is used inside \fBDS\fP/\fBDE\fP, it will not be
+affected by the format of \fBDS\fP.
.TP
.B "TC [slevel [spacing [tlevel [tab [h1 [h2 [h3 [h4 [h5]]]]]]]]]"
Table of contents.
@@ -1239,9 +1328,13 @@ The rest of the arguments will be printed, centered, before the
table of contents.
.sp
The user-defined macros \fBTX\fP and \fBTY\fP are used if \fBTC\fP is called
-with at most four arguments. \fBRX\fP is called before the printing
+with at most four arguments. \fBTX\fP is called before the printing
of \fICONTENTS\fP, and \fBTY\fP is called instead of printing \fICONTENTS\fP.
.sp
+Equivalent macros can be defined for list of figures, tables, equations
+and excibits by defining \fBTXxx\fP or \fBTYxx\fP, where \fBxx\fP
+is \fBFg\fP, \fBTB\fP, \fBEC\fP or \fBEX\fP.
+.sp
String \fBCi\fP can be set to control the indentations for each heading-level.
It must be scaled, like \fB.ds\ Ci\ .25i\ .5i\ .75i\ 1i\ 1i\fP.
The indentation is normally controlled by the maxlength of headings
@@ -1372,14 +1465,21 @@ Floating displays does not generate line break.
.LP
.\"########################################################################
.LP
-.B "Strings used in m@TMAC_M_PREFIX@m:"
+.B "Strings used in m@TMAC_M@:"
.TP
.B App
A string containing the word "APPENDIX".
.TP
+.B Apptxt
+.TP
+The current appendix text.
.B "EM"
Em dash string
.TP
+.B H1txt
+Will be updated by \fB.H\fP and \fB.HU\fP to the current heading text.
+Also updated in table of contents & friends.
+.TP
.B HF
Fontlist for headings, normally "2 2 2 2 2 2 2".
Nonnumeric fontnames may also be used.
@@ -1388,6 +1488,12 @@ Nonnumeric fontnames may also be used.
Pointsize list for headings. Normally "0 0 0 0 0 0 0" which is the same as
"10 10 10 10 10 10 10".
.TP
+.B Index
+.TP
+Contains \fIINDEX\fP.
+.B Indcmd
+.TP
+Contains the index command, \fIsort\ -t\et\fP.
.B Lifg
String containing \fIFigure\fP.
.TP
@@ -1480,6 +1586,22 @@ String containing "See chapter \e\e*[Qrfh], page \e\en[Qrfp].".
.B Rp
Contains "REFERENCES".
.TP
+.B Tcst
+Contains current status of table of contents and list of XXXX.
+Empty outside \fB.TC\fP.
+Useful in user-defined macros like \fB.TP\fP.
+.nf
+.ta 1.5i
+\fBValue Meaning\fP
+co Table of contents
+fg List of figures
+tb List of tables
+ec List of equations
+ex List of exhibits
+ap Appendix
+.fi
+.ta
+.TP
.B Tm
Contains \e(tm, trade mark.
.TP
@@ -1487,7 +1609,7 @@ Contains \e(tm, trade mark.
Argument to \fB.nm\fP in \fB.VERBON\fP, default: \fB1\fP.
.\"-----------------------------------
.LP
-.B "Number variables used in m@TMAC_M_PREFIX@m:"
+.B "Number variables used in m@TMAC_M@:"
.TP
.B Aph
Print an appendix-page for every new appendix
@@ -1508,11 +1630,15 @@ gives information about the progress of formatting, default 0.
.B De
Eject after floating display is output [0:1], default 0.
.TP
+.B Dsp
+Controls the space output before and after static displays
+if defined. Otherwise is the value of Lsp used.
+.TP
.B Df
Floating keep output [0:5], default 5.
.TP
.B Ds
-space before and after display if == 1 [0:1], default 1.
+\fBLsp\fP space before and after display if == 1 [0:1], default 1.
.TP
.B Ej
Eject page, default 0.
@@ -1526,6 +1652,13 @@ Footnote spacing, default 1.
.B "H1-H7"
Heading counters
.TP
+.B H1dot
+Append a dot after the level one heading number if > 0. Default is 1.
+.TP
+.B H1h
+.TP
+Copy of number register \fBH1\fP, but it is incremented
+just before the page break. Useful in user defined header macros.
.B Hb
Heading break level [0:7], default 2.
.TP
@@ -1550,15 +1683,19 @@ The real amount of lines is controlled by the variables \fBHps1\fP and
.TP
.B Hps1
This is the number of lines preceding \fB.H\fP when the heading-level
-is greater than \fBHps\fP. Value is in units, normally 0.5v.
+is greater than \fBHps\fP. Value is in units, normally 0.5.
.TP
.B Hps2
This is the number of lines preceding \fB.H\fP when the heading-level
-is less than or equal to \fBHps\fP. Value is in units, normally 1v.
+is less than or equal to \fBHps\fP. Value is in units, normally 1.
.TP
.B Hs
Heading space level [0:7], default 2.
.TP
+.B Hss
+This is the number of lines that follows \fB.H\fP when the heading-level
+is less than or equal to \fBHs\fP. Value is in units, normally 1.
+.TP
.B Ht
Heading numbering type, default 0.
0 -> multiple (1.1.1 ...)
@@ -1586,6 +1723,13 @@ Default: Lf=1, Lt=1, Lx=1, Le=0.
.B Li
List indent, used by .AL, default 6.
.TP
+.B Limsp
+Flag for space between prefix and mark in automatic lists (.AL).
+.br
+0\ ==\ no space
+.br
+1\ ==\ space
+.TP
.B Ls
List space, if current listlevel > Ls then no spacing will occur around lists.
Default 99.
@@ -1714,7 +1858,7 @@ variable \fBlet*lo-\fP\fItype\fP.
Jörgen Hägg, Lund, Sweden <jh@axis.se>.
.SH FILES
.TP
-.B @MACRODIR@/tmac.@TMAC_M_PREFIX@m
+.B @MACRODIR@/tmac.@TMAC_M@
.TP
.B @TMAC_MDIR@/*.cov
.TP
@@ -1729,4 +1873,4 @@ Jörgen Hägg, Lund, Sweden <jh@axis.se>.
.BR @g@eqn (@MAN1EXT@)
.br
.BR mm (@MAN7EXT@)
-.BR m@TMAC_M_PREFIX@mse (@MAN7EXT@)
+.BR m@TMAC_M@se (@MAN7EXT@)
diff --git a/contrib/groff/mm/groff_mmse.man b/contrib/groff/mm/groff_mmse.man
index 5d5469b..e27d0ae 100644
--- a/contrib/groff/mm/groff_mmse.man
+++ b/contrib/groff/mm/groff_mmse.man
@@ -1,5 +1,5 @@
-.\" -*- nroff -*-
-.\" $Id: groff_mmse.man,v 1.27 1995/04/24 05:37:46 jh Exp $
+.\"
+.\" $Id: groff_mmse.man,v 1.32 1999/09/03 05:33:12 jh Exp $
.\" Skrivet av Jörgen Hägg, Lund, Sverige
.\"
.TH GROFF_MMSE @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
@@ -7,7 +7,7 @@
groff_mmse \- svenska mm makro för groff
.SH SYNTAX
.B groff
-.B \-m@TMAC_M_PREFIX@mse
+.B \-m@TMAC_M@se
[
.IR flaggor .\|.\|.
]
@@ -15,7 +15,7 @@ groff_mmse \- svenska mm makro för groff
.IR filer .\|.\|.
]
.SH BESKRIVNING
-\fBm@TMAC_M_PREFIX@mse\fP är en svensk variant av \fBm@TMAC_M_PREFIX@m\fP. Alla texter
+\fBm@TMAC_M@se\fP är en svensk variant av \fBm@TMAC_M@\fP. Alla texter
är översatta. En A4 sida får text som är 13 cm bred, 3.5 cm indragning
samt är 28.5 cm hög.
Det finns stöd för brevuppställning enligt svensk standard
@@ -68,9 +68,9 @@ parenteser.
Om makrot \fB.TP\fP är definierat anropas det efter utskrift av brevhuvudet.
Där lägger man lämpligen in postadress och annat som brevfot.
.SH "SKRIVET AV"
-Jörgen Hägg, Lund, Sweden <jh@axis.se>
+Jörgen Hägg, Lund, Sweden <Jorgen.Hagg@axis.se>
.SH FILER
-.B @MACRODIR@/tmac.@TMAC_M_PREFIX@mse
+.B @MACRODIR@/tmac.@TMAC_M@se
.B @TMAC_MDIR@/se_*.cov
.SH "SE OCKSÅ"
.BR groff (@MAN1EXT@),
@@ -79,4 +79,4 @@ Jörgen Hägg, Lund, Sweden <jh@axis.se>
.BR @g@pic (@MAN1EXT@),
.BR @g@eqn (@MAN1EXT@)
.br
-.BR m@TMAC_M_PREFIX@m (@MAN7EXT@)
+.BR m@TMAC_M@ (@MAN7EXT@)
diff --git a/contrib/groff/mm/mm/0.MT b/contrib/groff/mm/mm/0.MT
index 5f1fa77..aa26cd3 100644
--- a/contrib/groff/mm/mm/0.MT
+++ b/contrib/groff/mm/mm/0.MT
@@ -1,5 +1,5 @@
.\"------------
-.\" $Id: 0.MT,v 1.27 1995/04/24 05:37:50 jh Exp $
+.\" $Id: 0.MT,v 1.32 1999/09/03 05:33:13 jh Exp $
.\" Cover sheet. Memorandum type 0-3 and "string".
.\"------------
.if !r Au .nr Au 1
@@ -11,11 +11,11 @@ subject:
.sp -1.1
.S
.PGFORM
-.B
+.ft \\*[@sdf_font]
.ll 9c
.fi
.cov*title
-.R
+.ft
.ll
.nf
.if d cov*title-charge-case \fBCharge Case \\*[cov*title-charge-case]\fP
@@ -32,7 +32,7 @@ subject:
.S
.sp -1
.in 0.8c
-.B
+.ft \\*[@sdf_font]
.nr cov*i 0 1
.while \\n+[cov*i]<=\\n[cov*au] \{\
. cov@print-au1 \\n[cov*i] 1
@@ -45,17 +45,17 @@ subject:
. \}
. if \\n[cov*i]<\\n[cov*au] .SP 1
.\}
-.R
+.ft
.if r cov*mt-tm-max \{\
. SP 1
. nr cov*i 0 1
-. B
+. ft \\*[@sdf_font]
TM
. in 1.5c
. sp -1
. while \\n+[cov*i]<\\n[cov*mt-tm-max] \\*[cov*mt-tm!\\n[cov*i]]
. in
-. R
+. ft
.\}
.fi
.PGFORM
@@ -83,7 +83,7 @@ TM
.S
.sp -1
.in 0.8c
-.B "\\*[cov*new-date]"
+\f[\\*[@sdf_font]]\\*[cov*new-date]\fP
.br
.fi
.PGFORM
diff --git a/contrib/groff/mm/mm/4.MT b/contrib/groff/mm/mm/4.MT
index 90f3a68..15895ff 100644
--- a/contrib/groff/mm/mm/4.MT
+++ b/contrib/groff/mm/mm/4.MT
@@ -1,11 +1,11 @@
.\"------------
-.\" $Id: 4.MT,v 1.27 1995/04/24 05:37:50 jh Exp $
+.\" $Id: 4.MT,v 1.32 1999/09/03 05:33:13 jh Exp $
.\" Cover sheet. Memorandum type 4
.\"------------
.de cov@print-title
.if !d cov*title .@error title (.TL) not defined!
.MOVE 2.4c
-.S 12
+.S +4
.ad c
.fi
.B
@@ -41,6 +41,7 @@
.SP 2
.if d cov*abstract \{\
. misc@ev-keep cov*ev
+. init@reset
. if \\n[cov*abs-ind]>0 \{\
. in +\\n[cov*abs-ind]u
. ll -\\n[cov*abs-ind]u
@@ -60,9 +61,19 @@
. cov@print-title
. cov@print-authors
. cov@print-firm
-. cov@print-abstract
+. if !\n[cov*abs-arg] .cov@print-abstract
. SP 3
+. nr hd*cur-bline \n[nl]
. ds cov*mt-printed
. pg@enable-top-trap
. pg@enable-trap
.\}
+.de CS
+.pg@disable-top-trap
+.SK
+.cov@print-title
+.cov@print-authors
+.cov@print-firm
+.cov@print-abstract
+..
+
diff --git a/contrib/groff/mm/mm/5.MT b/contrib/groff/mm/mm/5.MT
index d803c8b..687a9e1 100644
--- a/contrib/groff/mm/mm/5.MT
+++ b/contrib/groff/mm/mm/5.MT
@@ -1,5 +1,5 @@
.\"------------
-.\" $Id: 5.MT,v 1.27 1995/04/24 05:37:50 jh Exp $
+.\" $Id: 5.MT,v 1.32 1999/09/03 05:33:13 jh Exp $
.\" Cover sheet. Memorandum type 5
.\"------------
.nr cov*mt0-ind 1.1c
@@ -18,7 +18,7 @@
.\"------------
.de cov@print-date
.rj 1
-.B "\\*[cov*new-date]"
+\f[\\*[@sdf_font]]\\*[cov*new-date]\fP
.br
..
.\"------------
diff --git a/contrib/groff/mm/mm/ms.cov b/contrib/groff/mm/mm/ms.cov
index 6de13fa..1fea393 100644
--- a/contrib/groff/mm/mm/ms.cov
+++ b/contrib/groff/mm/mm/ms.cov
@@ -1,5 +1,5 @@
.\"------------
-.\" $Id: ms.cov,v 1.27 1995/04/24 05:37:50 jh Exp $
+.\" $Id: ms.cov,v 1.32 1999/09/03 05:33:13 jh Exp $
.\" Cover sheet. Mostly like ms cover.
.\"------------
.de cov@print-title
@@ -62,7 +62,7 @@
.\"------------
.de cov@print-date
.SP 2
-\\*[cov*new-date]
+\f[\\*[@sdf_font]]\\*[cov*new-date]\fP
..
.\"-----------------
.de COVEND
diff --git a/contrib/groff/mm/mm/se_ms.cov b/contrib/groff/mm/mm/se_ms.cov
index 351b05a..ec4432c 100644
--- a/contrib/groff/mm/mm/se_ms.cov
+++ b/contrib/groff/mm/mm/se_ms.cov
@@ -1,3 +1,3 @@
-.\" $Id: se_ms.cov,v 1.27 1995/04/24 05:37:50 jh Exp $
+.\" $Id: se_ms.cov,v 1.32 1999/09/03 05:33:13 jh Exp $
.mso mm/ms.cov
.nr cur*abstract-ll 11c
diff --git a/contrib/groff/mm/tmac.m b/contrib/groff/mm/tmac.m
index c6c7970..f96f615 100644
--- a/contrib/groff/mm/tmac.m
+++ b/contrib/groff/mm/tmac.m
@@ -3,11 +3,11 @@
.ds RE \\$2
..
.\"
-.\" $Id: tmac.m,v 1.27 1995/04/24 05:37:46 jh Exp $
-.@revision $Revision: 1.27 $
+.\" $Id: tmac.m,v 1.32 1999/09/03 05:33:12 jh Exp $
+.@revision $Revision: 1.32 $
.ig
-Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+Copyright (C) 1991-1998 Free Software Foundation, Inc.
mgm is written by Jörgen Hägg <jh@axis.se>
mgm is free software; you can redistribute it and/or modify it under
@@ -22,13 +22,9 @@ 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.
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-Almost complete. The letter format is not included.
-Maybe as a separate package.
-Should be better as time goes.
-
-Please send bugreports with examples to jh@axis.se.
+Please send bugreports with examples to jh@axis.com.
Naming convention stolen from mgs.
Local names module*name
@@ -36,6 +32,8 @@ Extern names module@name
Env.var environ:name
Index array!index
..
+.if !\n(.g .ab These mm macros require groff.
+.if \n(.C .ab The groff mm macros do not work in compatibility mode.
.warn
.\" ######## init #######
.\" Contents level [0:7], contents saved if heading level <= Cl
@@ -52,10 +50,11 @@ Index array!index
.nr Ds 1
.\" Eject page
.nr Ej 0
-.\" Equation lable adjust 0=left, 1=right
+.\" Equation label adjust 0=left, 1=right
.nr Eq 0
.\" Em dash string
-.ds EM \-
+.ie n .ds EM " --
+.el .ds EM \(em
.\" Footnote spacing
.nr Fs 1
.\" H1-H7 heading counters
@@ -113,6 +112,8 @@ Index array!index
.\" Format of figure,table,exhibit,equation titles.
.\" 0= ". ", 1=" - "
.nr Of 0
+.\" Table of contents page numbering style
+.nr Oc 0
.\" Page-number, normally same as %.
.nr P 0
.\" paragraph indent
@@ -129,6 +130,10 @@ Index array!index
.\" Display indent
.nr Si 5
.\"
+.\" Current state of TOC, empty outside TC, inside
+.\" it will be set to co,fg,tb,ec,ex or ap.
+.ds Tcst
+.\"
.ds Tm \(tm
.\"
.\"---------------------------------------------
@@ -137,32 +142,57 @@ Index array!index
.\" This is for cover macro .MT
.\" .ds @language
.\"
-.\" Current pointsize and vertical space, always in points.
-.ie r S \{\
-. nr @ps \n[S]
-. nr @vs \n[S]+2
+.nr @copy_type 0
+.if r C .nr @copy_type \n[C]
+.\" >0 if Subject/Date/From should be bold, roman otherwise
+.ie n .ds @sdf_font R
+.el .ds @sdf_font B
+.if \n[@copy_type]=4 \{\
+. ls 2
+. nr Pi 10
+. nr Pt 1
.\}
-.el \{\
-. nr @ps 10
-. nr @vs 12
+.\"
+.\"
+.if r E \{\
+. ie \n[E] .ds @sdf_font B
+. el .ds @sdf_font R
.\}
.\"
+.\" Current pointsize and vertical space, always in points.
+.if !r S .nr S 10
+.ps \n[S]
+.vs \n[S]+2
+.\"
+.nr @ps \n[.ps]
+.nr @vs \n[.v]
+.if \n[D]>1 .tm @ps=\n[@ps], @vs=\n[@vs]
+.\"
.\" Page length
-.ie r L .nr @pl \n[L]
-.el .nr @pl \n[.p]
+.if r L \{\
+. ie n .pl \n[L]u
+. el .pl \n[L]u
+.\}
+.nr @pl \n[.p]
+.\"
.\" page width
-.ie r W .nr @ll \n[W]
-.el .nr @ll 6i
+.ie r W \{\
+. ie n .ll \n[W]u
+. el .ll \n[W]u
+.\}
+.el .ll 6i
+.nr @ll \n[.l]
+.nr @cur-ll \n[@ll]
+.lt \n[@ll]u
+.\"
.\" page offset
-.ie r O .nr @po \n[O]
-.el .nr @po \n(.o
+.ie r O .po \n[O]
+.el \{\
+. ie n .po .75i
+. el .po .963i
+.\}
.\"
-.\" cheating...
-.pl \n[@pl]u
-.ll \n[@ll]u
-.lt \n[@ll]u
-.po \n[@po]u
-.nr @cur-ll \n[@ll]
+.nr @po \n[.o]
.\"
.\" non-zero if escape mechanism is turned off. Used by VERBON/OFF
.nr @verbose-flag 0
@@ -174,18 +204,40 @@ Index array!index
.\" print appendixheader, 0 == don't
.nr Aph 1
.\"
+.\" Current appendix text
+.ds Apptext
+.\" Controls the space before and after static displays if defined.
+.\" Lsp is used otherwise
+.\" .nr Dsp 1v
+.\"
+.\" Add a dot after level one heading number if >0
+.nr H1dot 1
+.\"
.\" header prespace level. If level <= Hps, then two lines will be printed
.\" before the header instead of one.
.nr Hps 1
.\"
.\" These variables controls the number of lines preceding .H.
.\" Hps1 is the number of lines when level > Hps
-.nr Hps1 0.5v
-.if n .nr Hps1 1v
+.nr Hps1 0.5
+.if n .nr Hps1 1
+.\"
+.\" Hps2 is the number of lines when level <= Hps
+.nr Hps2 1
+.if n .nr Hps2 2
+.\"
+.\" Hss is the number of lines (Lsp) after the header.
+.nr Hss 1
+.\"
+.\" H1txt will be updated by .H and .HU, containing the heading text.
+.\" Will also be updated in table of contents & friends
.\"
-.\" Hps2 is the number of lines when level >= Hps
-.nr Hps2 1v
-.if n .nr Hps2 2v
+.ds H1txt
+.\"
+.\" header text for the index
+.ds Index INDEX
+.\" command to sort the index
+.ds Indcmd sort
.\"
.\" flag for mkindex
.if !r Idxf .nr Idxf 0
@@ -195,6 +247,9 @@ Index array!index
.ds Liex Exhibit
.ds Liec Equation
.ds Licon CONTENTS
+.\" Flag for space between mark and prefix 1==space, 0==no space
+.\" Can also be controlled by using '.LI mark 2'
+.nr Limsp 1
.\"
.\" Lsp controls the height of an empty line. Normally 0.5v
.\" Normally used for nroff compatibility.
@@ -269,6 +324,12 @@ Index array!index
.ds Letns!13 Complete Memorandum to
.ds Letns!14 CC:
.\"
+.\" Text printed below the footer. Controlled by @copy_type (C).
+.ds Pg_type!0
+.ds Pg_type!1 OFFICIAL FILE COPY
+.ds Pg_type!2 DATE FILE COPY
+.ds Pg_type!3 D\ R\ A\ F\ T
+.ds Pg_type!4 D\ R\ A\ F\ T
.\" Max lines in return address
.nr Letwam 14
.\"--------------------------
@@ -276,9 +337,20 @@ Index array!index
.\" what macros is used.
.nr .mgm 1
.\"
+.\" Due to security problems with groff I had to rewrite
+.\" the reference system. It's not as elegant as before, you
+.\" have to run groff with '-z -rRef=1' and put stderr into the filename
+.\" for .INITR
+.\"
+.\" Output references to stderr if non-zero
+.ie !r Ref \{\
+. nr Ref 0
+.\}
+.el .warn 0
+.\"
.\"---------------------------------------------
.\" set local variables.
-.ie d @language .mso mm/\\*[@language]_locale
+.ie d @language .mso mm/\*[@language]_locale
.el .mso mm/locale
.\"---------------------------------------------
.if \n[D] .tm Groff mm, version \*[RE].
@@ -291,8 +363,8 @@ Index array!index
.el 'nh
'in 0
'ti 0
-'ps \\n[@ps]
-'vs \\n[@vs]
+.ps \\n[@ps]u
+.vs \\n[@vs]u
..
.de @warning
'tm WARNING:(\\n[.F]) input line \\n[.c]:\\$*
@@ -345,12 +417,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.de P
.\" skip P if previous heading
.ie !((\\n[nl]=\\n[hd*last-pos]):(\\n[nl]=(\\n[hd*last-pos]-.5v))) \{\
-. if \\n[D]>2 .tm Paragraph
+. if \\n[D]>2 .tm Paragraph nl=\\n[nl]
. par@doit \\$*
. if \\n[Np] \\n[H1].\\n+[par*number]\ \ \c
.\}
.el .if !(\\n[hd*last-hpos]=\\n[.k]) \{\
-. if \\n[D]>2 .tm Paragraph
+. if \\n[D]>2 .tm Paragraph nl=\\n[nl]
. par@doit \\$*
. if \\n[Np] \\n[H1].\\n+[par*number]\ \ \c
.\}
@@ -360,12 +432,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.de nP
.\" skip P if previous heading
.ie !((\\n[nl]=\\n[hd*last-pos]):(\\n[nl]=(\\n[hd*last-pos]-.5v))) \{\
-. if \\n[D]>2 .tm Paragraph
+. if \\n[D]>2 .tm Paragraph nl=\\n[nl]
. par@doit \\$*
\\n[H2].\\n+[par*number2]\ \ \c
.\}
.el .if !(\\n[hd*last-hpos]=\\n[.k]) \{\
-. if \\n[D]>2 .tm Paragraph
+. if \\n[D]>2 .tm Paragraph nl=\\n[nl]
. par@doit \\$*
\\n[H2].\\n+[par*number2]\ \ \c
.\}
@@ -468,14 +540,28 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" Hope this doesn't break anything else :-)
.\" Don't break if arg_4 is a '1'.
.if ''\\$4' .br
-.if !''\\$1' .nr @ll \\$1
-.if !''\\$2' .nr @pl \\$2
-.if !''\\$3' .nr @po \\$3
-.ll \\n[@ll]u
-.lt \\n[@ll]u
-.po \\n[@po]u
-.pl \\n[@pl]u
-.nr @cur-ll \\n[@ll]
+.ie !''\\$1' \{\
+. ll \\$1
+. nr @ll \n[.l]
+. nr @cur-ll \\n[@ll]
+. lt \\n[@ll]u
+.\}
+.el \{\
+. ll \\n[@ll]u
+. lt \\n[@ll]u
+.\}
+.\"
+.ie !''\\$2' \{\
+. pl \\$2
+. nr @pl \n[.p]
+.\}
+.el .pl \\n[@pl]u
+.\"
+.ie !''\\$3' \{\
+. po \\$3
+. nr @po \n[.o]
+.\}
+.el .po \\n[@po]u
'in 0
.pg@move-trap
..
@@ -529,28 +615,32 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"
.\" set point size
.if !'\\*[misc*a]'C' \{\
-. ie '\\*[misc*a]'P' .nr @ps \\n[misc*S-ps]
+. ie '\\*[misc*a]'P' .ps \\n[misc*S-ps]u
. el \{\
-. ie '\\*[misc*a]'D' .nr @ps 10
-. el .nr @ps \\*[misc*a]
+. ie '\\*[misc*a]'D' .ps \\n[@ps]u
+. el .ps \\*[misc*a]
+. if \\n[D]>2 .tm S: .ps \\*[misc*a]
. \}
.\}
.\"
.\" set vertical spacing
.if !'\\*[misc*b]'C' \{\
-. ie '\\*[misc*b]'P' .nr @vs \\n[misc*S-vs]
+. ie '\\*[misc*b]'P' .vs \\n[misc*S-vs]u
. el \{\
-. ie '\\*[misc*b]'D' .nr @vs \\n[@ps]+2
-. el .nr @vs \\*[misc*b]
+. ie '\\*[misc*b]'D' .vs \\n[.ps]u+2p
+. el .vs \\*[misc*b]
+. if \\n[D]>2 .tm S: .vs \\*[misc*b]
. \}
.\}
-'ps \\n[@ps]
-'vs \\n[@vs]
-.if \\n[D]>1 .tm point-size \\n[@ps] (\\n[.s]), vertical spacing \\n[@vs] (\\n[.v])
+.nr @ps \\n[.ps]
+.nr @vs \\n[.v]
+.\"
+.if \\n[D]>1 .tm S(\\$*): ma:\\*[misc*a], mb:\\*[misc*b] => ps:\\n[@ps]u, vs:\\n[@vs]u
.nr misc*S-ps \\n[misc*S-ps1]
.nr misc*S-vs \\n[misc*S-vs1]
.nr misc*S-ps1 \\n[@ps]
.nr misc*S-vs1 \\n[@vs]
+.pg@move-trap
..
.\"------------
.de HC
@@ -620,6 +710,140 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ev
.nr @verbose-flag 0
..
+.\" ######## module pict #################
+.nr pict*width 0
+.nr pict*height 0
+.nr pict*mode 0
+.nr pict*ind 0
+.nr pict*id 0 1
+.\" I assume that the number variable pict*id is the same
+.\" between two runs.
+.de PIC
+.br
+.nr pict*ind 0
+.nr pict*box 0
+.while \\n[.$]>0 \{\
+. if '-B'\\$1' \{\
+. nr pict*box 1
+. shift
+. continue
+. \}
+. if '-L'\\$1' \{\
+. nr pict*mode 0
+. shift
+. continue
+. \}
+. if '-R'\\$1' \{\
+. nr pict*mode 1
+. shift
+. continue
+. \}
+. if '-I'\\$1' \{\
+. nr pict*ind (m;\\$2)
+. nr pict*mode 2
+. shift 2
+. continue
+. \}
+. if '-C'\\$1' \{\
+. nr pict*mode 3
+. shift
+. continue
+. \}
+. ds pict*f \\$1
+. nr pict*id +1
+. shift
+. if \\n[.$]>0 \{\
+. nr pict*width (i;\\$1)
+. shift
+. \}
+. if \\n[.$]>0 \{\
+. nr pict*height (i;\\$1)
+. shift
+. \}
+.\}
+.if \\n[Ref]>0 \{\
+. tm .\\\\" PIC id \\n[pict*id]
+. tm .\\\\" PIC file \\*[pict*f]
+.\}
+.if d pict*file!\\n[pict*id] \{\
+. ds pict*f \\*[pict*file!\\n[pict*id]]
+. nr pict*llx \\n[pict*llx!\\n[pict*id]]
+. nr pict*lly \\n[pict*lly!\\n[pict*id]]
+. nr pict*urx \\n[pict*urx!\\n[pict*id]]
+. nr pict*ury \\n[pict*ury!\\n[pict*id]]
+. \"
+. nr pict*w (p;\\n[pict*urx]-\\n[pict*llx])
+. if \\n[pict*w]<0 .nr pict*w 0-\\n[pict*w]
+. nr pict*h (p;\\n[pict*ury]-\\n[pict*lly])
+. if \\n[pict*h]<0 .nr pict*h 0-\\n[pict*h]
+. if \\n[pict*width]>0 \{\
+. nr pict*rs (u;1000*\\n[pict*width]/\\n[pict*w])
+. nr pict*w (u;\\n[pict*w]*\\n[pict*rs]/1000)
+. nr pict*h (u;\\n[pict*h]*\\n[pict*rs]/1000)
+. \}
+. if \\n[pict*height]>0 \{\
+. nr pict*rs (u;1000*\\n[pict*height]/\\n[pict*h])
+. nr pict*h (u;\\n[pict*h]*\\n[pict*rs]/1000)
+. \}
+. if '0'\\n[pict*mode]' \{\
+. nr pict*in \\n[.i]u
+. \}
+. if '1'\\n[pict*mode]' \{\
+. nr pict*in (u;\\n[.l]-\\n[.i]-\\n[pict*w])
+. \}
+. if '2'\\n[pict*mode]' \{\
+. nr pict*in \\n[pict*ind]u
+. \}
+. if '3'\\n[pict*mode]' \{\
+. nr pict*in (u;(\\n[.l]-\\n[.i]-\\n[pict*w])/2)
+. \}
+. ds pict*h "
+. if \\n[pict*h]>0 .ds pict*h \\n[pict*h]
+. \"
+. ne \\n[pict*h]u
+. \"
+. \" these lines are copied and modified from tmac.pspic.
+. \" Originally written by James Clark
+. br
+. ie \\n[pict*box]>0 \{\
+\h'\\n[pict*in]u'\
+\Z'\D'p 0 \\n[pict*h]u \\n[pict*w]u 0 0 -\\n[pict*h]u''\
+\v'\\n[pict*h]u'\X'ps: import \\*[pict*f] \
+\\n[pict*llx] \\n[pict*lly] \\n[pict*urx] \\n[pict*ury] \\n[pict*w] \\n[pict*h]'
+.\}
+. el \{\
+\h'\\n[pict*in]u'\
+\X'ps: invis'\
+\Z'\D'p 0 \\n[pict*h]u \\n[pict*w]u 0 0 -\\n[pict*h]u''\
+\X'ps: endinvis'\
+\v'\\n[pict*h]u'\X'ps: import \\*[pict*f] \
+\\n[pict*llx] \\n[pict*lly] \\n[pict*urx] \\n[pict*ury] \\n[pict*w] \\n[pict*h]'
+. \}
+. br
+. sp \\n[pict*h]u
+.\}
+..
+.\" external picture
+.de EPIC
+.if \\n[.$]< 2 .@error "EPIC: Not enough arguments"
+.nr pict*w \\$1
+.nr pict*h \\$2
+.ds pict*name "External picture
+.if !''$3' .ds pict*name \\$3
+\&
+.br
+.ne \\n[pict*h]u
+.sp \\n[pict*h]u
+.nr pict*ind (u;(\\n[.l]-\\n[.i]-\\n[pict*w])/2)
+.in +\\n[pict*ind]u
+\D'l \\n[pict*w]u 0'\
+\D'l 0 -\\n[pict*h]u'\
+\D'l -\\n[pict*w]u 0'\
+\D'l 0 \\n[pict*h]u'\
+\v'-(u;\\n[pict*h]/2)'\
+\h'(u;(\\n[pict*w]-\w'\\*[pict*name]'/2))'\\*[pict*name]
+.in
+..
.\" ######## module acc #################
.\"-----------
.\" accents. These are copied from mgs, written by James Clark.
@@ -683,6 +907,14 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.nr hd*i 1 1
.while \\n+[hd*i]<8 .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
+.\"
+.\" This is a little fix to be able to get correct H1 heading number
+.\" in page headers.
+.nr H1h \\n[H1] 1
+.if \\n[hd*level]=1 .nr H1h +1
+.\"
.\" Check if it's time for new page. Only if text has
.\" appeared before.
.if \\n[Ej]&(\\n[Ej]>=\\n[hd*level])&(\\n[nl]>\\n[hd*cur-bline]) .pg@next-page
@@ -691,8 +923,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.nr H\\n[hd*level] +1
.\"
.\" update pagenumber if section-page is used
-.if \\n[hd*level]=1 .hd@set-page \\n[%]
-.\"
+.if (\\n[hd*level]=1)&(\\n[Sectp]>0) .hd@set-page 1
.\"
.\" hd*mark is the text written to the left of the header.
.ds hd*mark \\n[H1].
@@ -703,15 +934,13 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.while \\n+[hd*i]<8 .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]].
.\"
-.\" toc-mark is sent to the table of contents
-.ds hd*toc-mark \\*[hd*mark]
+.\" special case, no dot after level one heading if not H1dot true
+.if (\\n[hd*level]=1)&(\\n[H1dot]=0) .ds hd*mark \\n[H1]
+.\"
.as hd*mark \ \ \" add spaces between mark and heading
-.if !\\n[hd*arg1] \{\
-. ds hd*mark\" no mark for unnumbered
-. ds hd*toc-mark
-.\}
+.if !\\n[hd*arg1] .ds hd*mark\" no mark for unnumbered
.\"
-.if \\n[D]>1 .tm At header \\*[hd*toc-mark] "\\$2"
+.if \\n[D]>1 .tm At header \\*[hd*mark] "\\$2"
.nr hd*htype 0 \" hd*htype = check break and space
. \" 0 = run-in, 1 = break only, 2 = space
.if \\n[hd*level]<=\\n[Hb] .nr hd*htype 1
@@ -720,7 +949,6 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ie (\\n[hd*htype]=0)&(\w@\\$2@) .ds hd*suf-space " \"
.el .ds hd*suf-space
.nr hd*need 2v \" hd*need = header need space
-.if \\n[hd*htype]<2 .nr hd*need +\\n[Lsp]u \" add some extra space
.\"---------- user macro HX ------------
.\" User exit macro to override numbering.
.\" May change hd*mark (}0), hd*suf-space (}2) and hd*need (;3)
@@ -728,8 +956,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if d HX .HX \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
.\"--------------------------------------
.\" pre-space
-.ie \\n[hd*level]<=\\n[Hps] .SP \\n[Hps2]u
-.el .SP \\n[Hps1]u
+.ie \\n[hd*level]<=\\n[Hps] .SP (u;\\n[Hps2])
+.el .SP (u;\\n[Hps1])
.\"
.par@reset-num \\n[hd*level]\" reset numbered paragraph
.\" start diversion to measure size of header
@@ -738,8 +966,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.br
.di
.rm hd*div
-.ne \\n[hd*need]u+\\n[dn]u+.5p \" this is the needed space for a header
.if \\n[hd*htype] .na \" no adjust if run-in
+.if \\n[hd*htype]<2 .nr hd*need +\\n[Lsp]u \" add some extra space
+.ne \\n[hd*need]u+\\n[dn]u+.5p-1v \" this is the needed space for a header
.\"
.\" size and font calculations
.hd@split hd*font \\n[hd*level] HF \\*[HF]\" get font for this level
@@ -779,21 +1008,16 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.el \\$2\\$3\\*[hd*suf-space]\&\c
.ft 1
.\" restore pointsize and vertical size.
-.ps \\n[@ps]
-.vs \\n[@vs]
+.ps \\n[@ps]u
+.vs \\n[@vs]u
.\"
.\" table of contents
-.if (\\n[hd*level]<=\\n[Cl])&\w@\\$2@ \{\
-. ie \\n[Sectp] \{\
-. toc@save \\n[hd*level] "\\*[hd*toc-mark]" "\\$2" \\*[hd*sect-pg]
-. \}
-. el .toc@save \\n[hd*level] "\\*[hd*toc-mark]" "\\$2" \\n[%]
-.\}
+.if (\\n[hd*level]<=\\n[Cl])&\w@\\$2@ .toc@entry \\n[hd*level] "\\$2"
.\" set adjust to previous value
.SA
.\" do break or space
.if \\n[hd*htype] .br
-.if \\n[hd*htype]>1 .SP \\n[Lsp]u
+.if \\n[hd*htype]>1 .SP (u;\\n[Lsp]*\\n[Hss])
.if \\n[hd*htype] \{\
. \" indent if Hi=1 and Pt=1
. if (\\n[Hi]=1)&(\\n[Pt]=1) .ti +\\n[Pi]n
@@ -827,11 +1051,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" set page-nr, called from header
.\"
.de hd@set-page
-.if \\n[.$]>0 .nr hd*h1-page \\$1
-.\"
-.ie \\n[Sectp] .nr P \\n[%]-\\n[hd*h1-page]+1
-.el .nr P \\n[%]
.\"
+.ie \\n[.$]>0 .nr P \\$1
+.el .nr P +1
.\" Set section-page-string
.ds hd*sect-pg \\n[H1]-\\n[P]
.if \\n[Sectp]>1 .if '\\n[H1]'0' .ds hd*sect-pg "
@@ -841,10 +1063,10 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.wh 0 pg@header
.em pg@end-of-text
.\"
-.ds pg*header ''- % -''
+.ds pg*header ''- \\nP -''
.ds pg*footer
.if \n[N]=4 .ds pg*header ''''
-.if \n[N]=5 \{\
+.if (\n[N]=3):(\n[N]=5) \{\
. ds pg*header ''''
. ds pg*footer ''\\*[hd*sect-pg]''
.\}
@@ -869,15 +1091,16 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.nr pg*ps \n[@ps]
.nr pg*vs \n[@vs]
.\"-------------------------
-.\" footer traps: set, enable and disable
+.\" footer TRAPS: set, enable and disable
.de pg@set-new-trap
.nr pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]v+\\n[pg*extra-footer-size]u)
.\"
-.if \\n[D]>2 .tm pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]v) = \\n[pg*foot-trap]
+.if \\n[D]>2 .tm pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]v+\\n[pg*extra-footer-size]u) = \\n[pg*foot-trap]
.\"
.\" last-pos points to the position of the footer and bottom
.\" block below foot-notes.
.nr pg*last-pos \\n[@pl]u-(\\n[pg*block-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]v)
+.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]v) = \\n[pg*last-pos]
..
.de pg@enable-trap
.wh \\n[pg*foot-trap]u pg@footer
@@ -902,7 +1125,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
..
.\" no header on the next page
.de PGNH
-.nr pg*top-enabled -1
+.nr pg*top-enabled (-1)
..
.\" set first trap for pagefooter
.pg@enable-top-trap
@@ -936,6 +1159,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\}
.\" assign current page-number to P
.hd@set-page
+.\" reset spacing
+.nr line*lp\\n[.z] 0
+.nr line*ac\\n[.z] 0
.\"
.\" suppress pageheader if pagenumber == 1 and N == [124]
.if \\n[pg*top-enabled] \{\
@@ -1024,6 +1250,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. el .tl \\*[pg*even-footer]
. ie (\\n[%]=1)&(\\n[N]=1) .tl \\*[pg*header]
. el .tl \\*[pg*footer]
+. tl ''\\*[Pg_type!\\n[@copy_type]]''
.\}
.ev
.\" be sure that floating displays and footnotes will be
@@ -1044,12 +1271,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
'in 0
'ti 0
.ie \\n[Pgps] \{\
-. ps \\n[@ps]
-. vs \\n[@vs]
+. ps \\n[@ps]u
+. vs \\n[@vs]u
.\}
.el \{\
-. ps \\n[pg*ps]
-. vs \\n[pg*vs]
+. ps \\n[pg*ps]u
+. vs \\n[pg*vs]u
.\}
.lt \\n[@ll]u
..
@@ -1258,8 +1485,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ds pg*mul-fam \\n[.fam]
.nr pg*mul-font \\n[.f]
.ev pg*mul-ev
-.ps \\n[@ps]
-.vs \\n[@vs]
+.ps \\n[@ps]u
+.vs \\n[@vs]u
.fam \\*[pg*mul-fam]
.ft \\n[pg*mul-font]
.fi
@@ -1328,8 +1555,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.el 'hy 0
.ll \\n[@cur-ll]u
.lt \\n[@cur-ll]u
-.ps (\\n[@ps]-2)
-.vs (\\n[@vs]-1)
+.ps (p;\\n[@ps]u-2)
+.vs (p;\\n[@vs]u-1)
..
.\"-----------------
.\" set footnote format
@@ -1390,6 +1617,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
..
.\"-----------------
.\" begin footnote
+.\" Change environment, switch to diversion and print the foot-note mark.
.de FS
.if \\n[ft*busy] .@error "FS: missing FE"
.nr ft*busy 1
@@ -1418,6 +1646,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
..
.\"-----------------
.\" end footnote
+.\" End the diversion, back to previous environment, and adjust
+.\" the trap to the new foot-note size.
.de FE
.nr ft*busy 0
.br
@@ -1425,6 +1655,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
'in 0
'nf
.if \\n[@pl]u<\\n[dn]u .@error "FE: too big footnote"
+.if !d ft*div .nr dn +1v
+.if \\n[D]>3 .tm FE: foot-trap=\\n[pg*foot-trap] .d=\\n[.d] dn=\\n[dn]
.ie (\\n[pg*foot-trap]u-\\n[.d]u)<\\n[dn]u \{\
. da ft*next-div
. ft*tmp-div
@@ -1496,14 +1728,13 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ds@set-format \\$@
.\"
.nr df*old-ll \\n[.l]
-.nr ds*i \\n[.i]
.nr ds*ftmp \\n[.f]
.misc@ev-keep df*ev
.ft \\n[ds*ftmp]
.\"
.init@reset
.di df*div
-'in \\n[ds*i]u
+'in 0
.\"
.ds@set-new-ev \\n[df*old-ll]
.SP \\n[Lsp]u
@@ -1533,6 +1764,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"-------------
.\" called by end-of-text
.de df@eot-print
+.br
.if \\n[df*o-fnr]<=\\n[df*fnr] \{\
. if \\n[D]>2 .tm Print remaining displays.
.\" still some floats left, make non-empty environment
@@ -1557,16 +1789,34 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if !\\n[ds*float-busy] \{\
. nr ds*float-busy 1
.\" at .DE
-. if (\\$1=1)&((\\n[Df]%2)=1) \{\
+. if \\n[D]>3 .tm print-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
+. \" Df = 1 or 5
+. if (\\$1=1)&((\\n[Df]=1):(\\n[Df]=5)) \{\
+. if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
+. \" Print only new displays.
+. if \\n[df*o-fnr]=\\n[df*fnr] \{\
+. br
+. ds@print-one-float
+. \}
+. \}
+. \}
+. \" Df = 3
+. if (\\$1=1)&(\\n[Df]=3) \{\
. if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
-. \" Df = 1,3 or 5
+. br
. ds@print-one-float
. \}
. \}
.\" print all if Df<2 and end of section
-. if (\\$1=2)&(\\n[Df]<2) .ds@print-all-floats
+. if (\\$1=2)&(\\n[Sectp]>0)&(\\n[Df]<2) \{\
+. br
+. ds@print-all-floats
+. \}
.\" print all if end of document. Where should they go instead?
-. if \\$1=3 .ds@print-all-floats
+. if \\$1=3 \{\
+. br
+. ds@print-all-floats
+.\}
.\" new page
. if (\\$1=4)&(\\n[Df]>1) \{\
. if \\n[Df]=2 .ds@print-one-float
@@ -1580,19 +1830,24 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\}
..
.\"---------------
+.\" DF out
.\" print a floating diversion
-.de ds@output-div
+.de ds@output-float
.nr df*old-ll \\n[.l]
+.nr df*old-in \\n[.i]
.ev ds*fev
-.in 0
.nf
.nr df*i \\n[df*o-fnr]
.nr df*f \\n[df*format!\\n[df*i]]
.\"
+.in \\n[df*old-in]u
+.if \\n[df*f]=1 'in +\\n[Si]n
+.if \\n[df*f]>=2 'in 0
.if \\n[df*f]=2 'ce 9999
-.if \\n[df*f]=3 'in (u;(\\n[df*old-ll]-\\n[df*width!\\n[df*i]])/2)
+.if \\n[df*f]=3 'in (u;(\\n[.l]-\\n[df*width!\\n[df*i]])/2)
.if \\n[df*f]=4 'rj 9999
-.if \\n[df*f]=5 'in (u;\\n[df*old-ll]-\\n[df*width!\\n[df*i]])
+.if \\n[df*f]=5 'in (u;\\n[.l]-\\n[df*width!\\n[df*i]])
+.\"
.\"
.df*fdiv!\\n[df*o-fnr]
.\"
@@ -1609,8 +1864,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" print one floating display if there is one.
.de ds@print-one-float
.if \\n[df*o-fnr]<=\\n[df*fnr] \{\
+. if \\n[D]>3 .tm print-one-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
. if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
-. ds@output-div
+. ds@output-float
. if \\n[De] .pg@next-page
.\}
..
@@ -1619,8 +1875,11 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" if De>0 do a page eject between the floats.
.de ds@print-all-floats
.while \\n[df*o-fnr]<=\\n[df*fnr] \{\
+. if \\n[D]>3 .tm print-all-floats: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
. if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
-. ds@output-div
+. br
+\c
+. ds@output-float
. if \\n[De] .pg@next-page
.\}
..
@@ -1628,8 +1887,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" print as many floats as will fit on the current page
.de ds@print-this-page
.while \\n[df*o-fnr]<=\\n[df*fnr] \{\
+. if \\n[D]>3 .tm print-this-page: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
. if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .break
-. ds@output-div
+. ds@output-float
.\}
..
.\"---------------------------------------------------
@@ -1668,13 +1928,6 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"
.ie \\n[ds*fill] 'fi
.el 'nf
-.\"
-.if \\n[ds*format]=1 \{\
-. ll -\\n[Si]n
-. lt -\\n[Si]n
-' in +\\n[Si]n
-.\}
-.if (\\n[ds*format]=3):(\\n[ds*format]=5) 'in 0
..
.\"--------------------------------------------------------
.nr ds*format 0\" dummy value for .En/.EQ
@@ -1706,6 +1959,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ds@set-format \\$@
.\"
.nr ds*old-ll \\n[.l]
+.nr ds*old-in \\n[.i]
.misc@push ds-ll \\n[.l]
.misc@push ds-form \\n[ds*format]
.nr ds*i \\n[.i]
@@ -1714,7 +1968,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ft \\n[ds*ftmp]
.\"
.init@reset
-'in \\n[ds*i]u
+.\" indent in a diversion doesn't seem like a good idea.
+'in 0
.di ds*div!\\n[ds*snr]
.\"
.ds@set-new-ev \\n[ds*old-ll]
@@ -1725,30 +1980,41 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if \\n-[ds*lvl]<0 .@error "DE: no corresponding DS"
.br
.di
+.\" **********
.nr ds*width \\n[dl]
.nr ds*height \\n[dn]
.misc@pop-nr ds-ll ds*old-ll
.misc@pop-nr ds-form ds*format
-.if (\\n[ds*format]>=2)&(\\n[ds*width]>\\n[ds*old-ll]) \{\
-. @error "DE: display too wide for current line-length"
-.\}
.\"
-'in 0
+.\" **********
'nf
+.\" calculate needed space
+.nr ds*need \\n[ds*height]
+.nr ds*i \\n[pg*foot-trap]-\\n[pg*header-size]v-\\n[pg*extra-header-size]v
+.if (\\n[ds*height]>\\n[ds*i])&(\\n[.t]<(\\n[ds*i]/2)) .nr ds*need \\n[.t]u+1v
+.if (\\n[ds*height]<\\n[ds*i])&(\\n[.t]<(\\n[ds*height])) .nr ds*need \\n[.t]u+1v
+.\" Eject page if display will fit one page and
+.\" there are less than half of the page left.
+.if \\n[ds*need] .ne \\n[ds*need]u
+.\"
+.\" check if pending equation label
+.eq@check \\n[ds*need]
+'in \\n[ds*old-in]u
+.if \\n[ds*format]=1 'in \\n[ds*old-in]u+\\n[Si]n
+.if \\n[ds*format]>=2 'in 0
.if \\n[ds*format]=2 'ce 9999
-.if \\n[ds*format]=3 'in (u;(\\n[ds*old-ll]-\\n[ds*width])/2)
+.if \\n[ds*format]=3 'in (u;(\\n[.l]-\\n[ds*width])/2)
.if \\n[ds*format]=4 'rj 9999
-.if \\n[ds*format]=5 'in (u;\\n[ds*old-ll]-\\n[ds*width])
+.if \\n[ds*format]=5 'in (u;\\n[.l]-\\n[ds*width])
+.\" **********
.\"
.\" Print static display
-.\" Eject page if display will fit one page and
-.\" there are less than half of the page left.
-.nr ds*i \\n[pg*foot-trap]-\\n[pg*header-size]v-\\n[pg*extra-header-size]v
-.if (\\n[ds*height]>\\n[ds*i])&(\\n[.t]<(\\n[ds*i]/2)) .ne \\n[.t]u+1v
-.if (\\n[ds*height]<\\n[ds*i])&(\\n[.t]<(\\n[ds*height])) .ne \\n[.t]u+1v
-.if \\n[Ds] .SP \\n[Lsp]u
+.nr ds*i \\n[Lsp]
+.if r Dsp .nr ds*i \\n[Dsp]
+.\"
+.if \\n[Ds] .SP \\n[ds*i]u
.ds*div!\\n[ds*snr]
-.if \\n[Ds] .SP \\n[Lsp]u
+.if \\n[Ds] .SP \\n[ds*i]u
.\"
.if \\n[ds*format]=2 'ce 0
.if \\n[ds*format]=4 'rj 0
@@ -1816,8 +2082,10 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if \\n[li*type]=5 .ds li*c-mark <\\n[li*cnt!\\n[li*lvl]]>
.if \\n[li*type]=6 .ds li*c-mark {\\n[li*cnt!\\n[li*lvl]]}
.if \\n[.$]=1 .ds li*c-mark \\$1
-.if \\n[.$]=2 .ds li*c-mark \\$1\ \\*[li*c-mark]
-.if '\\*[li*c-mark]'\ ' .ds li*c-mark
+.ie \\n[.$]=2 \{\
+. ie (\\$2=2):(\\n[Limsp]=0) .ds li*c-mark \\$1\\*[li*c-mark]
+. el .ds li*c-mark \\$1\ \\*[li*c-mark]
+.\}
.\"
.\" determine where the text begins
.nr li*text-begin \\n[li*tind]>?\w@\\*[li*c-mark]\ @
@@ -2016,54 +2284,27 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" ####### module eq #######################################
.\"
.nr eq*number 0 1
+.ds eq*label
.de EQ
-.ds eq*lable "\\$1
-.di eq*div
-.misc@ev-keep eq*ev
-.in 0
-.nf
+.ds eq*label "\\$1
..
-.de EN
-.br
-.di
-.ta
-.\" equation with lable.
-.if \\n[dl] \{\
-. br
-. chop eq*div
+.de eq@check
+.if !'\\*[eq*label]'' \{\
+. mk
+' sp (u;\\$1/2-.45v)
. ie (\\n[Eq]%2) \{\
-. \" lable to the left
-. if \\n[ds*format]<2 \{\
-. ta (u;(\\n[.l]/7)+\\n[.i]) \\n[.l]u\" L
-\\*[eq*lable]\t\\*[eq*div]\t\&
-. \}
-. if (\\n[ds*format]=2):(\\n[ds*format]=3) \{\
-. ta (u;(\\n[.l]-\\n[.i])/2+\\n[.i])C \\n[.l]u\" C
-\\*[eq*lable]\t\\*[eq*div]\t\&
-. \}
-. if \\n[ds*format]>3 \{\
-. ta \\n[.l]uR\" R
-\\*[eq*lable]\t\\*[eq*div]
-. \}
+. \" label to the left
+\h'|0'\\*[eq*label]\c
. \}
. el \{\
-. \" lable to the right
-. if \\n[ds*format]<2 \{\
-. ta \\n[.l]uR\" L
-\\*[eq*div]\t\\*[eq*lable]
-. \}
-. if (\\n[ds*format]=2):(\\n[ds*format]=3) \{\
-. ta (u;(\\n[.l]-\\n[.i])/2+\\n[.i])C \\n[.l]uR\" C
-\t\\*[eq*div]\t\\*[eq*lable]
-. \}
-. if \\n[ds*format]>3 \{\
-. ta (\\n[.l]u-\w@\\*[eq*lable]@u-1m)R \\n[.l]uR\" R
-\t\\*[eq*div]\t\\*[eq*lable]
-. \}
+. \" label to the right
+\h'|\\n[.l]u'\\*[eq*label]
. \}
+. rt
.\}
-.TAB
-.ev
+.ds eq*label
+..
+.de EN
..
.\"########### module toc ###################
.\" table of contents
@@ -2084,16 +2325,26 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if \w@\\$3@>0 .nr toc*tlevel \\$3
.if \w@\\$4@>0 .nr toc*tab \\$4
.if \\n[pg*cols-per-page]>1 .1C
+.ds H1txt \\*[Licon]
+.ds Tcst co
.pg@clear-hd
+.EF ""
+.OF ""
.pg@next-page
-.pg@clear-ft
.\"-------------
.if d Ci .toc@read-Ci \\*[Ci]
.nf
.in 0
-.nr toc*pn 0 1
-.af toc*pn i
-.PF "''\\\\\\\\n+[toc*pn]''"
+.ie \\n[Oc] .hd@set-page 1
+.el \{\
+. nr toc*pn 1 1
+. af toc*pn i
+. aln ;g toc*pn
+. PF "''\\\\\\\\n[toc*pn]''"
+. am pg@header
+. nr toc*pn +1
+\\..
+.\}
.nr toc*i 4 1
.while \\n+[toc*i]<10 \{\
. if !'\\$\\n[toc*i]'' \{\
@@ -2111,11 +2362,12 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. SP 3
.\}
.if d toc*list .toc*list
+.br
.\" print LIST OF XXX
-.if d lix*dsfg .lix@print-ds fg "\\*[Lf]"
-.if d lix*dstb .lix@print-ds tb "\\*[Lt]"
-.if d lix*dsec .lix@print-ds ec "\\*[Le]"
-.if d lix*dsex .lix@print-ds ex "\\*[Lx]"
+.if d lix*dsfg .lix@print-ds fg FG "\\*[Lf]" \\n[.$]
+.if d lix*dstb .lix@print-ds tb TB "\\*[Lt]" \\n[.$]
+.if d lix*dsec .lix@print-ds ec EC "\\*[Le]" \\n[.$]
+.if d lix*dsex .lix@print-ds ex EX "\\*[Lx]" \\n[.$]
..
.\"-----------
.\" .toc@read-Ci lev1 lev2 lev3 lev4 ... lev7
@@ -2126,12 +2378,20 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\}
..
.\"-----------
+.de toc@entry
+.ie \\n[Sectp] \{\
+. toc@save \\$1 "\\*[hd*mark]" "\\$2" \\*[hd*sect-pg]
+.\}
+.el .toc@save \\$1 "\\*[hd*mark]" "\\$2" \\n[%]
+..
+.als )E toc@entry
+.\"-----------
.de toc@save
.\" collect maxsize of mark if string Ci don't exist.
.if !d Ci \{\
. if !r toc*hl!\\$1 .nr toc*hl!\\$1 0
. if \\n[toc*hl!\\$1]<=\w@\\$2@ \{\
-. nr toc*hl!\\$1 \w@\\$2@u+1m
+. nr toc*hl!\\$1 \w@\\$2@u
. \}
.\}
.am toc*list
@@ -2143,7 +2403,6 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" level mark text pagenumber
.de toc@set
.if \\$1<=\\n[toc*slevel] .SP \\n[toc*spacing]u
-.ne 2v
.na
.fi
.nr toc*ind 0
@@ -2164,6 +2423,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.nr toc*i \\n[toc*hl!\\$1]-\w@\\$2@
.\"
.ll \\n[@ll]u-\w@\\$4@u-2m
+.ne 2v
.\" ragged right ---------------------------------
.ie \\$1>\\n[toc*tlevel] \{\
\\$2
@@ -2225,26 +2485,26 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ie !\\n[Of] .ds lix*ds-form .\ \ \"
.el .ds lix*ds-form "\ \(em\ \"
.nr lix*in \\n[.i]
-.ds lix*lable \\*[Li\\$1]\ \\*[lix*numb]\\*[lix*ds-form]
+.ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\*[lix*ds-form]
.if !'\\$5'' \{\
-. if !0\\$6 .ds lix*lable \\*[Li\\$1]\ \\$5\\*[lix*numb]\\*[lix*ds-form]
-. if 0\\$6=1 .ds lix*lable \\*[Li\\$1]\ \\*[lix*numb]\\$5\\*[lix*ds-form]
-. if 0\\$6=2 .ds lix*lable \\*[Li\\$1]\ \\$5\\*[lix*ds-form]
+. if !0\\$6 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*numb]\\*[lix*ds-form]
+. if 0\\$6=1 .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\$5\\*[lix*ds-form]
+. if 0\\$6=2 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*ds-form]
.\}
-.ie \\n[Sectp] .ds lix*pgnr \\*[hd*sect-pg]
-.el .ds lix*pgnr \\n[%]
.\" print line if not between DS/DE
-.ie \\n[ds*lvl]<1 .lix@print-text "\\*[lix*lable]" "\\*[lix*text]"
-.el .lix@embedded-text "\\*[lix*lable]" "\\*[lix*text]"
+.ie \\n[ds*lvl]<1&\\n[df*float]=0 \{\
+. lix@print-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
+.\}
+.el \{\
+. lix@embedded-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
+.\}
.\"
-.\" save line for LIST OF XXX
-.if !r lix*wth\\$1 .nr lix*wth\\$1 0
-.if \w@\\*[lix*lable]@>\\n[lix*wth\\$1] .nr lix*wth\\$1 \w@\\*[lix*lable]@
-.if \\n[\\$2] .lix@ds-save \\$1 \\*[lix*pgnr] "\\$4" "\\*[lix*lable]"
-.if !'\\$7'' .SETR \\$7 \\*[lix*numb]
..
.\"-----------
+.\" label text type stringvar refname
.de lix@print-text
+.ie \\n[Sectp] .ds lix*pgnr \\*[hd*sect-pg]
+.el .ds lix*pgnr \\n[%]
.SP \\n[Lsp]u
.misc@ev-keep lix
.init@reset
@@ -2257,31 +2517,58 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
\fB\\$1\fP\\$2
.br
.ev
+.\" save line for LIST OF XXX, wth is the width of the label
+.if !r lix*wth\\$3 .nr lix*wth\\$3 0
+.\" find the maximum width
+.if \w@\\*[lix*label]@>\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
+.if \\n[\\$4] .lix@ds-save \\$3 \\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
+.\" save reference to the figure
+.if !'\\$5'' .SETR \\$5 \\*[lix*numb]
..
.\" hide printout until diversion is evaluated
.de lix@embedded-text
-\!.SP \\n[Lsp]u
+\!.ie \\\\n[Sectp] .ds lix*pgnr \\\\*[hd*sect-pg]
+\!.el .ds lix*pgnr \\\\n[%]
+\!.SP \\\\n[Lsp]u
\!.misc@ev-keep lix
+\!.ll \\n[.l]u
\!.init@reset
-\!.br
-\!.ie (\w@\\$1\\$2@)>(\\n[.l]-\\n[.i]) \{\
+\!.fi
+\!.ie (\w@\\$1\\$2@)>(\\\\n[.l]-\\\\n[.i]) \{\
. in +\w@\\$1@u
\!. ti 0
+\!\fB\\$1\fP\\$2
\!.\}
-\!.el .ce 1
+\!.el \{\
+. ce 1
\!\fB\\$1\fP\\$2
+\!.\}
\!.br
\!.ev
+.\" save line for LIST OF XXX, wth is the width of the label
+\!.if !r lix*wth\\$3 .nr lix*wth\\$3 0
+.\" find the maximum width
+\!.if \w@\\*[lix*label]@>\\\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
+\!.if \\\\n[\\$4] .lix@ds-save \\$3 \\\\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
+.\" save reference to the figure
+\!.if !'\\$5'' .SETR \\$5 \\*[lix*numb]
..
.\"------------
.\" print complete list of XXXX
.de lix@print-ds
.\" arg: fg,tb,ec,ex text
+.ds H1txt \\$3
+.ds Tcst \\$1
.if !\\n[Cp] .pg@next-page
.\" print LIST OF XXXX
-.ce
-\\$2
-.SP 3
+.\" execute user-defined macros
+.if \\$4<=4 .if d TX\\$2 .TX\\$2
+.ie d TY\\$2 .if \\$4<=4 .TY\\$2
+.el \{\
+. ce
+\\$3
+. SP 3
+.\}
.in \\n[lix*wth\\$1]u
.fi
.lix*ds\\$1
@@ -2299,9 +2586,16 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" lix@dsln type pagenumber text headernr
.de lix@dsln
.nr lix*i \\n[lix*wth\\$1]-\w@\\$4@
-.ne 2v
-.nr lix*sep \\n[.l]-\\n[lix*i]-\w'\\$4\\$3\\$2'-1m-1n-\\n[.i]
-\h'\\n[lix*i]u'\\$4\\$3\h'1n'\l'\\n[lix*sep]u.'\h'1m'\\$2
+.ne 4v
+.ll \\n[@ll]u-\w@\\$4@u-\w@\\$2@u-2m
+.ti -\\n[lix*wth\\$1]u
+\\$4
+.sp -1
+\\$3\h'1m'
+.sp -1
+.ll
+.nr lix*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$2@)-1m
+\h'|\\n[.n]u'\l'\\n[lix*sep]u.'\h'1m'\\$2
.SP \\n[toc*spacing]u
..
.\"########################### module fnt ############################
@@ -2366,8 +2660,8 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" jump to new environment.
.ev box*ev
.di box*div
-.ps \\n[@ps]
-.vs \\n[@vs]
+.ps \\n[@ps]u
+.vs \\n[@vs]u
.in 1n
.ll (u;\\n[box*wid]-1n)
.hy \\n[.hy]
@@ -2490,6 +2784,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.nr app*nr 0 1
.af app*nr A
.nr app*dnr 0 1
+.nr app*flag 0
.\"------------
.\" .APP name text
.\" name == "" -> autonumber
@@ -2497,6 +2792,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\" .if \\n[.$]<2 .@error "APP: too few arguments"
.app@set-ind "\\$1"
.\"
+.ds Tcst ap
+.ds Apptxt \\$2
+.\"
.ie \\n[Aph] .app@header \\*[app*ind] "\\$2"
.el .bp
.app@index "\\*[app*ind]" "\\$2"
@@ -2508,6 +2806,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if \\n[.$]<2 .@error "APPSK: too few arguments"
.app@set-ind "\\$1"
.\"
+.ds Tcst ap
+.ds Apptxt \\$3
+.\"
.ie \\n[Aph] .app@header \\*[app*ind] "\\$3"
.el .bp
.app@index "\\*[app*ind]" "\\$3"
@@ -2517,12 +2818,15 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.de app@set-ind
.ie \w@\\$1@ .ds app*ind \\$1
.el \{\
-. if !\\n[app*dnr] \{\
+. if !\\n[app*flag] \{\
. nr H1 0 1
. af H1 A
+. af H1h A
+. nr app*flag 1
. \}
. ds app*ind \\n+[app*nr]
. nr H1 \\n+[app*dnr]
+. nr H1h \\n[app*dnr]
.\}
.\" clear lower counters
.nr app*i 1 1
@@ -2544,6 +2848,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
\fB\s+2\\$2\s0\fP
.SP (u;\\n[Lsp]*4)
..
+.als APPX app@header
.\"########################### module cov ############################
.\" title stored in diversion cov*title
.\" abstract stored in diversion cov*abstract
@@ -2577,9 +2882,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.de AU
.cov@title-end
.pg@disable-top-trap
-.if \\n[.$]<1 .@error "AU: no arguments"
.nr cov*au +1
.nr cov*i 0 1
+.ds cov*au!\\n[cov*au]!1
.while \\n[.$]>=\\n+[cov*i] \{\
. ds cov*au!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
.\}
@@ -2603,7 +2908,6 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"-------------------
.de AF
.cov@title-end
-.if \\n[.$]<1 .@error "AF: no arguments"
.ds cov*firm \\$1
..
.de AST
@@ -2619,9 +2923,9 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
..
.de AE
..
-.\" I am planning to use mgm some time :-)
-.ie \\n[yr]<50 .ds cov*new-date \\*[MO\\n[mo]] \\n[dy], 20\\n[yr]
-.el .ds cov*new-date \\*[MO\\n[mo]] \\n[dy], 19\\n[yr]
+.\" I am planning to use mgm for some time :-)
+.nr cov*year 1900+\n[yr]
+.ds cov*new-date \*[MO\n[mo]] \n[dy], \n[cov*year]
.als DT cov*new-date
.de ND
.ds cov*new-date \\$1
@@ -2670,30 +2974,20 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.\"########################### module qrf ############################
.\" forward and backward reference thru special files.
.\"
+.\" check if stderr-method is wanted
+.\" This was needed when I discovered that groff was considered unsafe
+.\" and groff -U didn't work. It's a workaround like the original
+.\" index method, but not in my view elegant enough.
+.\"
.\" init reference system
.de INITR
-.if \\n[.$]<1 .@error "INITR:filename missing"
-.\" ignore if INITR has already been used
-.if !r qrf*pass \{\
-.\"
-. ds qrf*file \\$1
-. sy test -f \\*[qrf*file].tmp
-. ie \\n[systat] \{\
-. \" PASS 1
-. if \\n[D]=1 .tm PASS 1
-. if \\n[D]>1 .tm INITR: file \\*[qrf*file].tmp, PASS 1
-. nr qrf*pass 1
-. open qrf*stream \\*[qrf*file].tmp
-. write qrf*stream .\\\\" references for \\*[qrf*file]
-. close qrf*stream
-. \}
-. el \{\
-. nr qrf*pass 2
-. if \\n[D]=1 .tm PASS 2
-. if \\n[D]>1 .tm INITR: file \\*[qrf*file].tmp, PASS 2
-. sy mv \\*[qrf*file].tmp \\*[qrf*file].qrf
-' so \\*[qrf*file].qrf
-. \}
+.ds qrf*file \\$1
+.nr qrf*pass 2
+.if \\n[D]>1 .tm INITR: source \\*[qrf*file]
+.if \\n[Ref] \{\
+. tm .\\\\" Filename: \\$1
+.\}
+'so \\*[qrf*file]
.\}
..
.\"---------------
@@ -2703,20 +2997,16 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ie !r qrf*pass .tm "SETR: No .INITR in this file"
.el \{\
. ds qrf*name qrf*ref-\\$1
-.\" probably pass two if already defined
-. if \\n[qrf*pass]<2 \{\
-. if \\n[D]>2 .tm SETR: ref \\*[qrf*name]=\\*[hd*toc-mark],\\n[%]
-. \" heading-number
-. ds \\*[qrf*name]-hn \\*[hd*toc-mark]
-. \" page-number
-. ds \\*[qrf*name]-pn \\n[%]
-. \"
-. \" append to file
-. opena qrf*stream \\*[qrf*file].tmp
-. write qrf*stream .ds \\*[qrf*name]-hn \\*[hd*toc-mark]
-. write qrf*stream .ds \\*[qrf*name]-pn \\n[%]
-. if !'\\$2'' .write qrf*stream .ds \\*[qrf*name]-xx \\$2
-. close qrf*stream
+. if \\n[D]>2 .tm SETR: ref \\*[qrf*name]=\\*[hd*mark],\\n[%]
+. \" heading-number
+. ds \\*[qrf*name]-hn \\*[hd*mark]
+. \" page-number
+. ds \\*[qrf*name]-pn \\n[%]
+. \"
+. if \\n[Ref] \{\
+. tm .ds \\*[qrf*name]-hn \\*[hd*mark]
+. tm .ds \\*[qrf*name]-pn \\n[%]
+. if !'\\$2'' .tm .ds \\*[qrf*name]-xx \\$2
. \}
.\}
..
@@ -2727,15 +3017,11 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if \\n[.$]<1 .@error "GETST:reference name missing"
.if !r qrf*pass .tm "GETST: No .INITR in this file"
.ds qrf*name qrf*ref-\\$1
-.ie \\n[qrf*pass]=2 \{\
-. ie !d \\*[qrf*name]-xx .tm "GETHN:\\$1 not defined"
-. el \{\
+. if d \\*[qrf*name]-xx \{\
. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-xx]
. el \\*[\\*[qrf*name]-xx]\c
. \}
.\}
-.\" The answer...
-.el <->42<->\c
..
.\"---------------
.\" get header-number, output X.X.X. in pass 1
@@ -2744,14 +3030,10 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if \\n[.$]<1 .@error "GETHN:reference name missing"
.if !r qrf*pass .tm "GETHN: No .INITR in this file"
.ds qrf*name qrf*ref-\\$1
-.ie \\n[qrf*pass]=2 \{\
-. ie !d \\*[qrf*name]-hn .tm "GETHN:\\$1 not defined"
-. el \{\
-. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-hn]
-. el \\*[\\*[qrf*name]-hn]\c
-. \}
+.if d \\*[qrf*name]-hn \{\
+. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-hn]
+. el \\*[\\*[qrf*name]-hn]\c
.\}
-.el X.X.X.\c
..
.\"---------------
.\" get page-number, output 9999 in pass 1
@@ -2760,14 +3042,10 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.if \\n[.$]<1 .@error "GETPN:reference name missing"
.if !r qrf*pass .tm "GETPN: No .INITR in this file"
.ds qrf*name qrf*ref-\\$1
-.ie \\n[qrf*pass]=2 \{\
-. ie !d \\*[qrf*name]-pn .tm "GETPN:\\$1 not defined"
-. el \{\
-. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-pn]
-. el \\*[\\*[qrf*name]-pn]\c
-. \}
+.if d \\*[qrf*name]-pn
+. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-pn]
+. el \\*[\\*[qrf*name]-pn]\c
.\}
-.el 9999\c
..
.\"----------
.de GETR
@@ -2776,11 +3054,64 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. tm "GETR: No .INITR in this file"
.\}
.el \{\
-. if \\n[qrf*pass]=2 \{\
-. GETHN \\$1 Qrfh
-. GETPN \\$1 Qrfp
+. GETHN \\$1 Qrfh
+. GETPN \\$1 Qrfp
\\*[Qrf]
-. \}
+.\}
+..
+.\"########################### module ind ############################
+.\" Support for mgs-style indexing, borrowed from mgs.
+.de IX
+.tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[%]
+..
+.\"--------------------
+.\" Another type of index system
+.\" INITI filename [type]
+.de INITI
+.if \\n[.$]<1 .@error "INITI:filename missing"
+.\" ignore if INITI has already been used
+.if r ind*pass .@error "INITI:already initialyzed"
+.nr ind*pass 1
+.ds ind*file \\$1.ind
+.ie \\n[.$]<2 .ds ind*type N
+.el .ds ind*type \\$2
+..
+.\"---------------
+.de IND
+.if !r ind*pass .@error "IND: No .INITI in this file"
+.if '\\*[ind*type]'N' .ds ind*ref \\n[%]
+.if '\\*[ind*type]'H' .ds ind*ref \\*[hd*mark]
+.if '\\*[ind*type]'B' .ds ind*ref \\*[hd*mark]\t\\n[%]
+.\"
+.if \\n[.$] .ds ind*line \\$1
+.while \\n[.$]>0 \{\
+. shift
+. as ind*line \t\\$1
+.\}
+.as ind*line \\*[ind*ref]
+.tm \\*[ind*line]
+..
+.\" print index
+.de INDP
+.\" sort the index
+.if !\\n[Cp] .pg@next-page
+.\" print INDEX
+.\" execute user-defined macros
+.if d TXIND .TXIND
+.ie d TYIND .TYIND
+.el \{\
+. SK
+. ce
+\\*[Index]
+. SP 3
+. 2C
+. nf
+.\}
+.pso \\*[Indcmd] \\*[ind*file]
+.ie d TZIND .TZIND
+.el \{\
+. fi
+. 1C
.\}
..
.\"########################### module let ############################
@@ -2857,7 +3188,18 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.sp 2
.ie n ______________________________ ______________
.el \D'l 25m 0'\h'4m'\D'l 12m 0'
-\Z'\\$1'\h'29m'\\*[Letdate]
+\Z'\\$1'\h'29m'\f[\\*[@sdf_font]]\\*[Letdate]\fP
+.fi
+..
+.\"------------------------
+.\" Letter signature
+.de AVL
+.ne 6v
+.nf
+.sp 3
+.ie n ______________________________
+.el \D'l 25m 0'
+\Z'\\$1'
.fi
..
.\"------------------------
@@ -3007,7 +3349,7 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
. el \{\
. sp
. if '\\*[let*type]'SB' .ti +5m
-\\*[LetSJ] \\*[let*lo-SJ]
+\\*[LetSJ] \f[\\*[@sdf_font]]\\*[let*lo-SJ]\fP
. \}
.\}
..
@@ -3084,3 +3426,6 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
.ds let*lo-\\$1 \\$2
.if \n[D]>1 .tm Letter option \\$1 \\$2
..
+.\"--------------------
+.\" Start with a clean slate
+.init@reset
diff --git a/contrib/groff/mm/tmac.mse b/contrib/groff/mm/tmac.mse
index b9daec0..2b1e8ee 100644
--- a/contrib/groff/mm/tmac.mse
+++ b/contrib/groff/mm/tmac.mse
@@ -1,10 +1,11 @@
-.\" $Id: tmac.mse,v 1.27 1995/04/24 05:37:46 jh Exp $
+.\" $Id: tmac.mse,v 1.32 1999/09/03 05:33:12 jh Exp $
.\"
.\" swedish version of mm
.\" See tmac.m for version-information.
-.mso tmac.m
.ds @language se
+.mso tmac.m
.\"
+.ds App Bilaga
.ds Lf Figurer
.ds Lt Tabeller
.ds Lx Uppställningar
@@ -44,7 +45,7 @@
.ds Letns!4 Atts.
.ds Letns!5 Enc.
.ds Letns!6 Encs.
-.ds Letns!7 Under separate cover
+.ds Letns!7 Annat försättsblad
.ds Letns!8 Brev till
.ds Letns!9 Dokument till
.ds Letns!10 Kopia (med atts.) till
@@ -65,8 +66,8 @@
.ds MO10 oktober
.ds MO11 november
.ds MO12 december
-.ie \\n[yr]<50 .ds cov*new-date \\n[dy] \\*[MO\\n[mo]] 20\\n[yr]
-.el .ds cov*new-date \\n[dy] \\*[MO\\n[mo]] 19\\n[yr]
+.nr cov*year 1900+\n[yr]
+.ds cov*new-date \n[dy] \*[MO\n[mo]] \n[cov*year]
.nr pg*footer-size 4\" 1v+footer+even/odd footer+1v
.\"------------------------------------------------
.\" Dokumentnamn
OpenPOWER on IntegriCloud