BSD 4_3_Net_2 release
[unix-history] / usr / src / share / tmac / doc
index e32eda8..a1b2114 100644 (file)
@@ -1,21 +1,50 @@
 .\" Copyright (c) 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" Copyright (c) 1991 The Regents of the University of California.
 .\" All rights reserved.
 .\"
-.\" %sccs.include.redist.man%
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.\"     @(#)doc        5.4 (Berkeley) %G%
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     @(#)doc        5.8 (Berkeley) 8/5/91
 .\"
 .\" .mdoc-parse - attempt to parse troff request arguments
 .\"     %beginstrip%
 .\"
 .\" .mdoc-parse - attempt to parse troff request arguments
 .\"     %beginstrip%
+.if \n(.g \{\
+.cp 0
+.ftr C CR
+.\}
 .if t \{\
 .if t \{\
-.      so /usr/share/tmac/tmac.doc-ditroff
+.       so /usr/share/tmac/tmac.doc-ditroff
 .\}
 .if n \{\
 .\}
 .if n \{\
-.      so /usr/share/tmac/tmac.doc-nroff
+.       so /usr/share/tmac/tmac.doc-nroff
 .\}
 .so /usr/share/tmac/tmac.doc-common
 .so /usr/share/tmac/tmac.doc-syms
 .\}
 .so /usr/share/tmac/tmac.doc-common
 .so /usr/share/tmac/tmac.doc-syms
-.\"
 .\" NS Db macro - start/stop DEBUG MODE
 .\" NS Db register DEBUG MODE
 .\" NS iN register DEBUG MODE (inline if 1, to stderr if 0 (default))
 .\" NS Db macro - start/stop DEBUG MODE
 .\" NS Db register DEBUG MODE
 .\" NS iN register DEBUG MODE (inline if 1, to stderr if 0 (default))
 .\" NS iI local register (indent for inline debug mode)
 .\" NS mN name of calling request (set in each user requestable macro)
 .de aV
 .\" NS iI local register (indent for inline debug mode)
 .\" NS mN name of calling request (set in each user requestable macro)
 .de aV
-.nr aC+1
-.ds A\\n(aC \\$1
+.nr aC \\n(aC+1
+.ie "\\$1"|" \{\
+.      if "\\*(mN"Op" .ds A\\n(aC \fR\\$1\fP
+.      if "\\*(mN"Ar" .ds A\\n(aC \fR\\$1\fP
+.      if "\\*(mN"Fl" .ds A\\n(aC \fR\\$1\fP
+.      if "\\*(mN"Cm" .ds A\\n(aC \fR\\$1\fP
+.      if "\\*(mN"It" .ds A\\n(aC \fR\\$1\fP
+.\}
+.el .ds A\\n(aC \\$1
 .aU \\n(aC
 .nr C\\n(aC \\n(aT
 .s\\n(aT
 .aU \\n(aC
 .nr C\\n(aC \\n(aT
 .s\\n(aT
 .              if \\n(oM>1 .as b1 \\*(S0
 .      \}
 .      el \{\
 .              if \\n(oM>1 .as b1 \\*(S0
 .      \}
 .      el \{\
-.              if \\n(oM>0 .as b1 \\*(S0
+.              if \\n(oM>0 \{\
+.                      if \\n(fC==0 .as b1 \\*(S0
+.              \}
 .      \}
 .      ds S0 \\*(S\\n(aC
 .      if \\n(Db \{\
 .      \}
 .      ds S0 \\*(S\\n(aC
 .      if \\n(Db \{\
 .el .aV \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 ..
 .de fV
 .el .aV \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 ..
 .de fV
-.nr aC+1
+.nr aC \\n(aC+1
+.if "\\*(A\\n(aC"|" \{\
+.      if "\\*(mN"Op" .ds A\\n(aC \fR\\*(A\\n(aC\fP
+.      if "\\*(mN"Ar" .ds A\\n(aC \fR\\*(A\\n(aC\fP
+.      if "\\*(mN"Fl" .ds A\\n(aC \fR\&\\*(A\\n(aC\fP
+.      if "\\*(mN"Cm" .ds A\\n(aC \fR\\*(A\\n(aC\fP
+.      if "\\*(mN"It" .ds A\\n(aC \fR\\*(A\\n(aC\fP
+.\}
 .aU \\n(aC
 .nr C\\n(aC \\n(aT
 .s\\n(aT
 .aU \\n(aC
 .nr C\\n(aC \\n(aT
 .s\\n(aT
 .              if \\n(oM>1 .as b1 \\*(S0
 .      \}
 .      el \{\
 .              if \\n(oM>1 .as b1 \\*(S0
 .      \}
 .      el \{\
-.              if \\n(oM>0 .as b1 \\*(S0
+.              if \\n(oM>0 \{\
+.                      if \\n(fC==0 .as b1 \\*(S0
+.              \}
 .      \}
 .      ds S0 \\*(S\\n(aC
 .      nr fV 0
 .      \}
 .      ds S0 \\*(S\\n(aC
 .      nr fV 0
 .      \}
 .\}
 .el \{\
 .      \}
 .\}
 .el \{\
-.      nr fV-1
+.      nr fV \\n(fV-1
 .      fV
 .\}
 ..
 .\" NS aX macro - stuff saved strings into `b1' (used by -diag list)
 .de aX
 .      fV
 .\}
 ..
 .\" NS aX macro - stuff saved strings into `b1' (used by -diag list)
 .de aX
-.nr aP+1
+.nr aP \\n(aP+1
 .as b1 \&\\*(A\\n(aP
 .ie \\n(fV==1 \{\
 .      nr aP 0
 .      nr fV 0
 .\}
 .el \{\
 .as b1 \&\\*(A\\n(aP
 .ie \\n(fV==1 \{\
 .      nr aP 0
 .      nr fV 0
 .\}
 .el \{\
-.      nr fV-1
+.      as b1 \&\\*(sV
+.      nr fV \\n(fV-1
 .      aX
 .\}
 ..
 .\" NS aI macro - append arg to arg vector: .aI [arg] [type] (used by .En only)
 .de aI
 .ie \\n(aC<9 \{\
 .      aX
 .\}
 ..
 .\" NS aI macro - append arg to arg vector: .aI [arg] [type] (used by .En only)
 .de aI
 .ie \\n(aC<9 \{\
-.      nr aC+1
+.      nr aC \\n(aC+1
 .      ds A\\n(aC \\$1
 .      nr C\\n(aC \\$2
 .      s\\$2
 .      ds A\\n(aC \\$1
 .      nr C\\n(aC \\$2
 .      s\\$2
 .\" NS b2 string save of buffer
 .\" NS lK register count of lines read from input file
 .de x1
 .\" NS b2 string save of buffer
 .\" NS lK register count of lines read from input file
 .de x1
-.nr dZ+1
+.nr dZ \\n(dZ+1
 .ds b2 \\*(b1
 .ds b1
 .nr lK \\n(.c
 .ds b2 \\*(b1
 .ds b1
 .nr lK \\n(.c
 .el .ds b1 \\*(b2\\*(b1
 \&\\*(b1
 .rm eB b2 b0 b1
 .el .ds b1 \\*(b2\\*(b1
 \&\\*(b1
 .rm eB b2 b0 b1
-.nr dZ-1
+.nr dZ \\n(dZ-1
 ..
 .\" NS Fl macro - flags (appends - and prints flags)
 .\" NS cF register save current font
 ..
 .\" NS Fl macro - flags (appends - and prints flags)
 .\" NS cF register save current font
 .              aZ
 .      \}
 .      el \{\
 .              aZ
 .      \}
 .      el \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ie \\n(C\\n(aP==1 \{\
 .                      as b1 \&\|\-\fP\s0
 .                      \\*(A\\n(aP
 .              ie \\n(C\\n(aP==1 \{\
 .                      as b1 \&\|\-\fP\s0
 .                      \\*(A\\n(aP
 .el \{\
 .      nr jN \\n(aP
 .      ie \\n(jM==2 \{\
 .el \{\
 .      nr jN \\n(aP
 .      ie \\n(jM==2 \{\
-.               ie "\\*(A\\n(aP"-" .as b1 \&\|\-\-\|
-.               el .as b1 \&\|\-\\*(A\\n(aP
+.              ie !"\\*(A\\n(aP"\\*(Ba" \{\
+.                      ie !"\\*(A\\n(aP"\fR|\fP" \{\
+.                             ie "\\*(A\\n(aP"-" .as b1 \&\|\-\^\-\|
+.                             el .as b1 \&\|\-\\*(A\\n(aP
+.                      \}
+.                      el .as b1 \&\\*(A\\n(aP
+.              \}
+.              el .as b1 \&\\*(A\\n(aP
 .      \}
 .      el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0
 .      ie \\n(aC==\\n(aP \{\
 .      \}
 .      el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0
 .      ie \\n(aC==\\n(aP \{\
 .              aZ
 .      \}
 .      el \{\
 .              aZ
 .      \}
 .      el \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ie ((\\n(C\\n(aP==3)&(\\n(C\\n(jN==4)) .as b1 \&\|\-
 .              el .as b1 \&\\*(S\\n(jN
 .              fR \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .              ie ((\\n(C\\n(aP==3)&(\\n(C\\n(jN==4)) .as b1 \&\|\-
 .              el .as b1 \&\\*(S\\n(jN
 .              fR \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .              aZ
 .      \}
 .      el \{\
 .              aZ
 .      \}
 .      el \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              as b1 \&\\*(S\\n(jN
 .              nR
 .      \}
 .              as b1 \&\\*(S\\n(jN
 .              nR
 .      \}
 .              aZ
 .      \}
 .      el \{\
 .              aZ
 .      \}
 .      el \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ie \\n(C\\n(aP==1 \{\
 .                      as b1 \&file\ ...\fP\s0
 .                      \\*(A\\n(aP
 .              ie \\n(C\\n(aP==1 \{\
 .                      as b1 \&file\ ...\fP\s0
 .                      \\*(A\\n(aP
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(aD
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(aD
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .br
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(nM
 .br
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(nM
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
-.      if \\n(nS \{\
+.      ie \\n(nS \{\
 .              if "\\*(mN"Cd" \{\
 .                      rs
 .              if "\\*(mN"Cd" \{\
 .                      rs
-.                      in -\\n(iSu
 .                      ie \\n(nS>1 .br
 .                      el \{\
 .                      ie \\n(nS>1 .br
 .                      el \{\
-.                              if \\n(iS==0 .nr iS Dsu
+.                              if \\n(iS==0 .nr iS \\n(Dsu
 .                      \}
 .                      in +\\n(iSu
 .                      ti -\\n(iSu
 .                      nr nS \\n(nS+1
 .              \}
 .                      \}
 .                      in +\\n(iSu
 .                      ti -\\n(iSu
 .                      nr nS \\n(nS+1
 .              \}
+.      nR
+.      in -\\n(iSu
 .      \}
 .      \}
-.       nR
+.      el .nR
 .\}
 ..
 .\" NS Cm macro - Interactive command modifier (flag)
 .\}
 ..
 .\" NS Cm macro - Interactive command modifier (flag)
 .       ie \\n(.$==0 .tm Usage: .Cm Interactive command modifier ... \\*(Pu (#\\n(.c)
 .      el \{\
 .              ds mN Cm
 .       ie \\n(.$==0 .tm Usage: .Cm Interactive command modifier ... \\*(Pu (#\\n(.c)
 .      el \{\
 .              ds mN Cm
-.              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.               ds A1 \\$1
+.               ds A2 \\$2
+.               ds A3 \\$3
+.               ds A4 \\$4
+.               ds A5 \\$5
+.               ds A6 \\$6
+.               ds A7 \\$7
+.               ds A8 \\$8
+.               ds A9 \\$9
+.              nr fV \\n(.$
+.              fV
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(cM
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(cM
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(eR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(eR
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(eM
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(eM
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(eR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(eR
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(eV
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(eV
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 ..
 .\" NS Fd macro - function declaration - not callable (& no err check)
 .\" NS fD register subroutine test (in synopsis only)
 ..
 .\" NS Fd macro - function declaration - not callable (& no err check)
 .\" NS fD register subroutine test (in synopsis only)
-.\" NS fY register subroutine count (in synopsis only)
+.\" NS fY register subroutine count (in synopsis only) (fortran only)
 .\" NS fZ register also subroutine count (in synopsis only)
 .de Fd
 .ds mN Fd
 .if \\n(nS>0 \{\
 .\" NS fZ register also subroutine count (in synopsis only)
 .de Fd
 .ds mN Fd
 .if \\n(nS>0 \{\
+.\"    if a variable type was the last thing given, want vertical space
+.      if \\n(fX>0 \{\
+.              Pp
+.              nr fX 0
+.      \}
+.\"    if a subroutine was the last thing given, want vertical space
 .      if \\n(fZ>0 \{\
 .              ie \\n(fD==0 \{\
 .                      Pp
 .      if \\n(fZ>0 \{\
 .              ie \\n(fD==0 \{\
 .                      Pp
 .              \}
 .              el .br
 .      \}
 .              \}
 .              el .br
 .      \}
-.      nr fD+1
-.      nr fZ+1
-.      nr fY+1
+.      nr fD \\n(fD+1
 .\}
 .nr cF \\n(.f
 .nr cZ \\n(.s
 .\}
 .nr cF \\n(.f
 .nr cZ \\n(.s
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(aR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(aR
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(iC
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(iC
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(lI
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(lI
-.      nr aP+1
+.      nr aP \\n(aP+1
+.       nr cF \\n(.f
+.      nr cZ \\n(.s
+.       nR
+.\}
+..
+.\" NS Or macro - Pipe symbol (OR)
+.de Or
+.if \\n(aC==0 \{\
+.       ie \\n(.$==0 .tm Usage: .Or ... \\*(Pu (#\\n(.c)
+.      el \{\
+.              ds mN Or
+.              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.      \}
+.\}
+.if \\n(aC>\\n(aP \{\
+.      as b1 \\*(iC
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(sY
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(sY
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .\" NS n1 string - save first invocation of .Nm
 .\" NS iS register - indent second command line in a synopsis
 .de Nm
 .\" NS n1 string - save first invocation of .Nm
 .\" NS iS register - indent second command line in a synopsis
 .de Nm
-.as b1 \\*(nM
 .if \\n(aC==0 \{\
 .      ie \\n(.$==0 \{\
 .              ie "\\*(n1"" .tm Usage: .Nm Name(s) ... \\*(Pu (#\\n(.c)
 .if \\n(aC==0 \{\
 .      ie \\n(.$==0 \{\
 .              ie "\\*(n1"" .tm Usage: .Nm Name(s) ... \\*(Pu (#\\n(.c)
 .              aZ
 .      \}
 .      el \{\
 .              aZ
 .      \}
 .      el \{\
-.              nr aP+1
+.              as b1 \\*(nM
+.              nr aP \\n(aP+1
 .              ie \\n(C\\n(aP==1 \{\
 .                      as b1 \&\\*(n1\fP\s0
 .                      \\*(A\\n(aP
 .              ie \\n(C\\n(aP==1 \{\
 .                      as b1 \&\\*(n1\fP\s0
 .                      \\*(A\\n(aP
 .                                      el \{\
 .                                              if \\n(iS==0 \{\
 .                                                      sw \\$1
 .                                      el \{\
 .                                              if \\n(iS==0 \{\
 .                                                      sw \\$1
-.\" .                                                  nr nW \w' '
-.\" .                                  nr iS (\\n(sWu+1*\\n(fW)u+\\n(nWu
 .                                      nr iS ((\\n(sWu+1)*\\n(fW)u
 .                                              \}
 .                                      \}
 .                                      nr iS ((\\n(sWu+1)*\\n(fW)u
 .                                              \}
 .                                      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(pA
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(pA
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(sY
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(sY
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      as b1 \\*(tN
-.      nr aP+1
+.      as b1 \\*(tN\\*(tF
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(tN
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(tN
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(vA
 .\}
 .if \\n(aC>\\n(aP \{\
 .      as b1 \\*(vA
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nR
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.       nr aP+1
+.      nr aP \\n(aP+1
 .       ie \\n(C\\n(aP==1 \{\
 .              \\*(A\\n(aP
 .       \}
 .       ie \\n(C\\n(aP==1 \{\
 .              \\*(A\\n(aP
 .       \}
 .\" an if-else to carry along recursively for `if n ...')
 .\"
 .\" NS Sq macro - Enclose string in single quotes
 .\" an if-else to carry along recursively for `if n ...')
 .\"
 .\" NS Sq macro - Enclose string in single quotes
+.de Qq
+.if \\n(aC==0 .ds mN Qq
+.ds qL \&\\*q
+.ds qR \&\\*q
+.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Sq macro - Enclose string in single quotes
 .de Sq
 .if \\n(aC==0 .ds mN Sq
 .ds qL \&\\*(sL
 .de Sq
 .if \\n(aC==0 .ds mN Sq
 .ds qL \&\\*(sL
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .      ds qL \\*(A\\n(aP
 .      ds qL \\*(A\\n(aP
-.      nr aP+1
+.      nr aP \\n(aP+1
 .      ds qR \\*(A\\n(aP
 .      ie \\n(aC>\\n(aP .c\\n(C\\n(aP
 .      el .aZ
 .      ds qR \\*(A\\n(aP
 .      ie \\n(aC>\\n(aP .c\\n(C\\n(aP
 .      el .aZ
 .\" NS qR string variable set by calling macro
 .\" NS aJ register (for vR)
 .de En
 .\" NS qR string variable set by calling macro
 .\" NS aJ register (for vR)
 .de En
-.as b1 \&\\*(qL
-.if \\n(aC==0 \{\
+.ie \\n(aC==0 \{\
 .      ie \\n(.$==0 \{\
 .      ie \\n(.$==0 \{\
-.              as b1 \&\\*(qR
+.              as b1 \&\\*(qL\\*(qR
 .              pB
 .      \}
 .      el \{\
 .              pB
 .      \}
 .      el \{\
-.              as mN (En)
+.\".           as mN (En)
 .              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.              as b1 \&\\*(qL
 .      \}
 .\}
 .      \}
 .\}
+.el \{\
+.      as b1 \&\\*(qL
+.\}
 .if \\n(aC>0 \{\
 .      ie (\\n(aC-\\n(aP)==0 \{\
 .              as b1 \&\\*(qR
 .if \\n(aC>0 \{\
 .      ie (\\n(aC-\\n(aP)==0 \{\
 .              as b1 \&\\*(qR
 .              ie \\n(C\\n(aC==3 \{\
 .                      nr aJ \\n(aC-1
 .                      vR
 .              ie \\n(C\\n(aC==3 \{\
 .                      nr aJ \\n(aC-1
 .                      vR
-.                      nr aJ+1
+.                      nr aJ \\n(aJ+1
 .                      ds A\\n(aJ \&\\*(qR\\*(A\\n(aJ
 .                      ds A\\n(aJ \&\\*(qR\\*(A\\n(aJ
+.                      nr aJ 0
 .              \}
 .              el .aI \&\\*(qR 3
 .              \}
 .              el .aI \&\\*(qR 3
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              if \\n(C\\n(aP==1 .\\*(A\\n(aP
 .              if \\n(C\\n(aP>1 \{\
 .              if \\n(C\\n(aP==1 .\\*(A\\n(aP
 .              if \\n(C\\n(aP>1 \{\
-.                      nr aP-1
+.                      nr aP \\n(aP-1
 .                      No
 .              \}
 .      \}
 .                      No
 .              \}
 .      \}
 .\" NS vR macro - vector routine (for En, trace backwards past trail punct)
 .de vR
 .if \\n(C\\n(aJ==3 \{\
 .\" NS vR macro - vector routine (for En, trace backwards past trail punct)
 .de vR
 .if \\n(C\\n(aJ==3 \{\
-.      nr aJ-1
+.      nr aJ \\n(aJ-1
 .      vR
 .\}
 ..
 .      vR
 .\}
 ..
 .ds qR \&)
 .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 ..
 .ds qR \&)
 .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 ..
+.\" NS Qo macro - Straight Double Quote open
+.de Qo
+.if \\n(aC==0 .ds mN Qo
+.ds qL \&\\*q
+.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Qc macro - Straight Double Quote close
+.de Qc
+.if \\n(aC==0 .ds mN Qc
+.ds qR \&\\*q
+.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS So macro - Single Quote open
+.de So
+.if \\n(aC==0 .ds mN So
+.ds qL \&\\*(sL
+.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
+.\" NS Sc macro - Single Quote close
+.de Sc
+.if \\n(aC==0 .ds mN Sc
+.ds qR \&\\*(sR
+.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+..
 .\" NS Xo macro - Extend open (continue)
 .de Xo
 .if \\n(aC==0 .ds mN Xo
 .\" NS Xo macro - Extend open (continue)
 .de Xo
 .if \\n(aC==0 .ds mN Xo
+.\" .nr mN 1
 .ds qL
 .eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 ..
 .\" NS Xe macro - Extend close (end)
 .de Xc
 .ds qL
 .eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 ..
 .\" NS Xe macro - Extend close (end)
 .de Xc
+.\" .nr mN 0
 .if \\n(aC==0 .ds mN Xc
 .ds qR
 .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 ..
 .\" NS eO macro - enclose string open
 .\" NS oM register (extension possible)
 .if \\n(aC==0 .ds mN Xc
 .ds qR
 .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 ..
 .\" NS eO macro - enclose string open
 .\" NS oM register (extension possible)
-.nr oM 0
 .de eO
 .de eO
-.as b1 \\*(qL
-.nr oM+1
+.nr oM \\n(oM+1
 .\" .tm eO last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ;
 .\" .tm eO last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ;
-.if \\n(aC==0 \{\
+.ie \\n(aC==0 \{\
 .       ie \\n(.$>0 \{\
 .               aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .       ie \\n(.$>0 \{\
 .               aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.              as b1 \\*(qL
 .       \}
 .      el \{\
 .       \}
 .      el \{\
+.              as b1 \\*(qL
 .              if (\\n(dZ==0)&(\\n(sM==1) \{\
 .              if (\\n(dZ==0)&(\\n(sM==1) \{\
-.                      nr dZ+1
+.                      nr dZ \\n(dZ+1
 .                      ds b2 \\*(b1
 .                      ds b1
 .                      nr lK \\n(.c
 .                      ds b2 \\*(b1
 .                      ds b1
 .                      nr lK \\n(.c
 .              \}
 .      \}
 .\}
 .              \}
 .      \}
 .\}
+.el \{\
+.      as b1 \\*(qL
+.\}
 .ie \\n(aC>0 \{\
 .      if \\n(aC>\\n(aP \{\
 .ie \\n(aC>0 \{\
 .      if \\n(aC>\\n(aP \{\
-.              nr aP +1
+.              nr aP \\n(aP+1
 .              ie \\n(C\\n(aP==1 .\\*(A\\n(aP
 .              el  \{\
 .              ie \\n(C\\n(aP==1 .\\*(A\\n(aP
 .              el  \{\
-.                      nr aP-1
+.                      nr aP \\n(aP-1
 .                      No
 .              \}
 .      \}
 .      if \\n(aC==\\n(aP \{\
 .              if \\n(tP==1 \{\
 .                      No
 .              \}
 .      \}
 .      if \\n(aC==\\n(aP \{\
 .              if \\n(tP==1 \{\
+.\" .tm SETTING Xt!!!
 .                      nr Xt 1
 .              \}
 .                      nr Xt 1
 .              \}
+.\".\" .               ds S0
+.\"CHANGED             ds S0 \\*(iV
 .              aY
 .      \}
 .\}
 .              aY
 .      \}
 .\}
 .\" NS eC macro - enclose string close
 .\" NS aa local register
 .de eC
 .\" NS eC macro - enclose string close
 .\" NS aa local register
 .de eC
-.nr oM-1
-.\" .tm eO last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ;
+.nr oM \\n(oM-1
+.\" tm eC last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ;
 .as b1 \\*(qR
 .if \\n(aC==0 \{\
 .       ie \\n(.$>0 \{\
 .as b1 \\*(qR
 .if \\n(aC==0 \{\
 .       ie \\n(.$>0 \{\
 .      el \{\
 .              nr aa \\n(aP+1
 .              if \\n(C\\n(aa==2 .as b1 \\*(S\\n(aC
 .      el \{\
 .              nr aa \\n(aP+1
 .              if \\n(C\\n(aa==2 .as b1 \\*(S\\n(aC
+.\" tm CURRENT arg (aP==\\*(A\\n(aP and ap+1==\\*(A\\n(aa) tP==\\n(tP Xt==\\n(Xt
 .              rr aa
 .              rr aa
+.              if \\n(tP>0 \{\
+.\" tm UNSETTING Xt==\\n(Xt!!!!
+.                      if \\n(Xt>0 .nr Xt \\n(Xt-1
+.\" tm NOW Xt==\\n(Xt!!!!
+.              \}
 .              No
 .      \}
 .\}
 .              No
 .      \}
 .\}
 .\}
 .el \{\
 .      ie (\\n(aC-\\n(aP)>1 \{\
 .\}
 .el \{\
 .      ie (\\n(aC-\\n(aP)>1 \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              as b1 \&\\*(A\\n(aP
 .      \}
 .              as b1 \&\\*(A\\n(aP
 .      \}
-.      el .tm Warning: trailing prefix Pf)
+.      el .tm Warning: .Pf: trailing prefix (#\\n(.c)
 .\}
 .if \\n(aC>0 \{\
 .      ie (\\n(aC-\\n(aP)==0 .aZ
 .      el \{\
 .\}
 .if \\n(aC>0 \{\
 .      ie (\\n(aC-\\n(aP)==0 .aZ
 .      el \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              c\\n(C\\n(aP
 .      \}
 .\}
 .              c\\n(C\\n(aP
 .      \}
 .\}
 .      \}
 .\}
 .if \\n(aC>0 \{\
 .      \}
 .\}
 .if \\n(aC>0 \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .      if "\\*(A\\n(aP"on" \{\
 .              ds sV \\*(iV
 .              nr sM 1
 .      if "\\*(A\\n(aP"on" \{\
 .              ds sV \\*(iV
 .              nr sM 1
 .\" NS aT macro - argument type
 .\" NS aU macro - argument type (same as .aT but uses A[1-9] strings
 .\" NS aT register argument type
 .\" NS aT macro - argument type
 .\" NS aU macro - argument type (same as .aT but uses A[1-9] strings
 .\" NS aT register argument type
+.if \n(.g \{\
+.de aT
+.nr aT 0
+.ie \\n(sW>2:(\A'\\$1'==0) \{\
+.      nr aT 2
+.\}
+.el \{\
+.      if \\n(sW==1 \{\
+.              ie \\n(z\\$1>2 \{\
+.                      nr aT \\n(z\\$1
+.              \}
+.              el .nr aT 2
+.      \}
+.      if \\n(sW==2 \{\
+.              ie \\n(\\$1 \{\
+.                      nr aT 1
+.              \}
+.              el .nr aT 2
+.      \}
+.\}
+..
+.de aU
+.nr aT 0
+.aW \\$1
+.ie \\n(sW>2:(\A'\\*(A\\$1'==0) .nr aT 2
+.el \{\
+.      if \\n(sW==1 \{\
+.              ie \\n(z\\*(A\\$1>2 \{\
+.                      nr aT \\n(z\\*(A\\$1
+.              \}
+.              el .nr aT 2
+.      \}
+.      if \\n(sW==2 \{\
+.              ie (\\n(\\*(A\\$1) \{\
+.                      nr aT 1
+.              \}
+.              el .nr aT 2
+.      \}
+.\}
+..
+.\}
+.if !\n(.g \{\
 .de aT
 .nr aT 0
 .ie \\n(sW>2 \{\
 .de aT
 .nr aT 0
 .ie \\n(sW>2 \{\
 .      \}
 .\}
 ..
 .      \}
 .\}
 ..
+.\}
+.\" NS s1 macro - set spacing for class type 1
+.\" NS s2 macro - set spacing for class type 2
+.\" NS s3 macro - set spacing for class type 3
 .\" NS s1 macro - set spacing for class type 1
 .\" NS s2 macro - set spacing for class type 2
 .\" NS s3 macro - set spacing for class type 3
 .\" NS s1 macro - set spacing for class type 1
 .\" NS s2 macro - set spacing for class type 2
 .\" NS s3 macro - set spacing for class type 3
 .\" NS xX local register
 .\" NS aa local register
 .de s0
 .\" NS xX local register
 .\" NS aa local register
 .de s0
-.tm MDOC-ERROR: bogus type 0 (can't set space  \\*(A\\n(aC) (#\\n(.c)
+.tm MDOC-ERROR: bogus type 0 (can't set space '\\*(A\\n(aC') (#\\n(.c)
 ..
 .de s1
 .if \\n(\\*(A\\n(aC==3 \{\
 ..
 .de s1
 .if \\n(\\*(A\\n(aC==3 \{\
 .\}
 .if \\n(\\*(A\\n(aC==2 \{\
 .      nr xX \\n(aC-1
 .\}
 .if \\n(\\*(A\\n(aC==2 \{\
 .      nr xX \\n(aC-1
+.\" this kludge can probably go away, but need to double check first
 .      ie "\\*(A\\n(aC"Nb" .ds S\\n(xX \\*(hV
 .      el .rm S\\n(xX
 .\}
 .      ie "\\*(A\\n(aC"Nb" .ds S\\n(xX \\*(hV
 .      el .rm S\\n(xX
 .\}
 .\" NS c3 macro - call .No if type 3
 .\" NS c4 macro - call .No if type 4
 .de c0
 .\" NS c3 macro - call .No if type 3
 .\" NS c4 macro - call .No if type 4
 .de c0
-.tm MDOC-ERROR: bogus class 0 (can't determine \\*(A\\n(aC) (#\\n(.c)
+.tm MDOC-ERROR: bogus class 0 (can't determine '\\*(A\\n(aC') (#\\n(.c)
 ..
 .de c1
 .\\*(A\\n(aP
 ..
 .de c2
 ..
 .de c1
 .\\*(A\\n(aP
 ..
 .de c2
-.nr aP-1
+.nr aP \\n(aP-1
 .No
 ..
 .de c3
 .No
 ..
 .de c3
-.nr aP-1
+.nr aP \\n(aP-1
 .No
 ..
 .de c4
 .No
 ..
 .de c4
-.nr aP-1
+.nr aP \\n(aP-1
 .No
 ..
 .\" NS y1 macro - ignore if class 1
 .No
 ..
 .\" NS y1 macro - ignore if class 1
 ..
 .de y3
 .as b1 \\*(A\\n(aP
 ..
 .de y3
 .as b1 \\*(A\\n(aP
-.nr aP+1
+.nr aP \\n(aP+1
 .n\\C\\n(aP
 ..
 .de y4
 .as b1 \\*(A\\n(aP
 .n\\C\\n(aP
 ..
 .de y4
 .as b1 \\*(A\\n(aP
-.nr aP+1
+.nr aP \\n(aP+1
 .n\\C\\n(aP
 ..
 .\"--------------------------------------------------------------------------
 .n\\C\\n(aP
 ..
 .\"--------------------------------------------------------------------------
 .ie \\n(.$>0 \{\
 .      nr bF \\n(.f
 .      nr bZ \\n(.s
 .ie \\n(.$>0 \{\
 .      nr bF \\n(.f
 .      nr bZ \\n(.s
-.      if "\\$1"Em" \&\\*(eM
-.      if "\\$1"Li" \&\\*(lI
-.      if "\\$1"Sy" \&\\*(sY
-.      if "\\$1"-emphasis" \&\\*(eM
-.      if "\\$1"-literal" \&\\*(lI
-.      if "\\$1"-symbolic" \&\\*(sY
+.      if "\\$1"Em" \&\\*(eM\c
+.      if "\\$1"Li" \&\\*(lI\c
+.      if "\\$1"Sy" \&\\*(sY\c
+.      if "\\$1"-emphasis" \&\\*(eM\c
+.      if "\\$1"-literal" \&\\*(lI\c
+.      if "\\$1"-symbolic" \&\\*(sY\c
 .\}
 .el .tm Usage .Bf [Em | emphasis | Li | literal | Sy | symbolic] (#\\n(.c)
 ..
 .\}
 .el .tm Usage .Bf [Em | emphasis | Li | literal | Sy | symbolic] (#\\n(.c)
 ..
 .de Bd
 .ds mN Bd
 .ie \\n(.$==0 \{\
 .de Bd
 .ds mN Bd
 .ie \\n(.$==0 \{\
-.tm Usage: .Bd [-literal | -filled | -ragged ] [-offset [string]] [-compact] (#\\n(.c)
+.tm Usage: .Bd [-literal | -filled | -ragged | -unfilled] [-offset [string]] [-compact] (#\\n(.c)
 .\}
 .el \{\
 .      ds aa
 .      nr bV 0
 .       nr iD 0
 .\}
 .el \{\
 .      ds aa
 .      nr bV 0
 .       nr iD 0
-.       nr dP+1
+.      nr dP \\n(dP+1
 .       if "\\$1"-literal" \{\
 .       if "\\$1"-literal" \{\
-.               nr iD+1
+.              nr iD \\n(iD+1
 .               ds d\\n(dP dL
 .              nr cF \\n(.f
 .              nr cZ \\n(.s
 .               ds d\\n(dP dL
 .              nr cF \\n(.f
 .              nr cZ \\n(.s
 .              nf
 .       \}
 .       if "\\$1"-filled" \{\
 .              nf
 .       \}
 .       if "\\$1"-filled" \{\
-.               nr iD+1
+.              nr iD \\n(iD+1
 .               ds d\\n(dP dF
 .              br
 .       \}
 .       if "\\$1"-ragged" \{\
 .               ds d\\n(dP dF
 .              br
 .       \}
 .       if "\\$1"-ragged" \{\
-.               nr iD+1
+.              nr iD \\n(iD+1
 .               ds d\\n(dP dR
 .               ds d\\n(dP dR
+.              na
+.       \}
+.       if "\\$1"-unfilled" \{\
+.              nr iD \\n(iD+1
+.               ds d\\n(dP dU
 .              nf
 .       \}
 .\" .tm Here is argc: \\n(.$ and here is iD \\n(iD
 .              nf
 .       \}
 .\" .tm Here is argc: \\n(.$ and here is iD \\n(iD
 .              bV \\$2 \\$3 \\$4
 .      \}
 .      if \\n(O\\n(dP>0 'in \\n(.iu+\\n(O\\n(dPu
 .              bV \\$2 \\$3 \\$4
 .      \}
 .      if \\n(O\\n(dP>0 'in \\n(.iu+\\n(O\\n(dPu
-.      if (\\n(bV==0)&(\\n(nS==0) \{\
-'              sp \\n(dVu
+.      if (\\n(bV==0) \{\
+.              if (\\n(nS==0) \{\
+.                      ie "\\*(d\\n(dP"dR" .sp \\n(dVu
+.                      el 'sp \\n(dVu
+.              \}
 .      \}
 .      if \\n(cR==0 .ne 2v
 .      nr bV 0
 .      \}
 .      if \\n(cR==0 .ne 2v
 .      nr bV 0
 .if "\\$1"-offset" \{\
 .      ds bY \\$2
 .      if "\\*(bY"left" \{\
 .if "\\$1"-offset" \{\
 .      ds bY \\$2
 .      if "\\*(bY"left" \{\
-.              nr iD+1
+.              nr iD \\n(iD+1
 .              nr O\\n(dP 0
 .      \}
 .      if "\\*(bY"right" \{\
 .              nr O\\n(dP 0
 .      \}
 .      if "\\*(bY"right" \{\
-.              nr iD+1
+.              nr iD \\n(iD+1
 .              nr O\\n(dP (\\n(.l/3)u
 .      \}
 .      if "\\*(bY"center" \{\
 .              nr O\\n(dP (\\n(.l/3)u
 .      \}
 .      if "\\*(bY"center" \{\
-.              nr iD+1
+.              nr iD \\n(iD+1
 .              nr O\\n(dP (\\n(.l-\\n(.i)/4u
 .      \}
 .      if "\\*(bY"indent" \{\
 .              nr O\\n(dP (\\n(.l-\\n(.i)/4u
 .      \}
 .      if "\\*(bY"indent" \{\
-.              nr iD+1
+.              nr iD \\n(iD+1
 .              nr O\\n(dP \\n(dIu
 .      \}
 .      if "\\*(bY"indent-two" \{\
 .              nr O\\n(dP \\n(dIu
 .      \}
 .      if "\\*(bY"indent-two" \{\
-.              nr iD+1
+.              nr iD \\n(iD+1
 .              nr O\\n(dP \\n(dIu+\\n(dIu
 .      \}
 .      if \\n(iD==1 \{\
 .              nr O\\n(dP \\n(dIu+\\n(dIu
 .      \}
 .      if \\n(iD==1 \{\
-.              nr iD+1
+.              nr iD \\n(iD+1
 .              sW "\\*(bY"
 .              ie \\n(sW>2 \{\
 .              sW "\\*(bY"
 .              ie \\n(sW>2 \{\
-.                      ie ((\\*(bY>9n)&(\\$3<100n)) \{\
+.                      ie ((\\*(bY>9n)&(\\*(bY<100n)) \{\
 .                              nr O\\n(dP \\*(bY
 .                      \}
 .                      el .nr O\\n(dP (\\n(sW)*\\n(fWu
 .                              nr O\\n(dP \\*(bY
 .                      \}
 .                      el .nr O\\n(dP (\\n(sW)*\\n(fWu
 .de Ed
 .ds mN Ed
 .br
 .de Ed
 .ds mN Ed
 .br
+.if \\n(dP==0 .tm mdoc: Extraneous .Ed
 .if "\\*(d\\n(dP"dL" \{\
 .      ft \\n(cF
 .      fz \\n(cZ
 .if "\\*(d\\n(dP"dL" \{\
 .      ft \\n(cF
 .      fz \\n(cZ
 .rm d\\n(dP
 .nr dP \\n(dP-1
 .fi
 .rm d\\n(dP
 .nr dP \\n(dP-1
 .fi
+.if t .ad
 ..
 .\"--------------------------------------------------------------------------
 .\" NS Bl macro - begin list (.Bl list-type)
 ..
 .\"--------------------------------------------------------------------------
 .\" NS Bl macro - begin list (.Bl list-type)
 .el \{\
 .      ds mN Bl
 .      nr aP 0
 .el \{\
 .      ds mN Bl
 .      nr aP 0
-.      nr lC+1
+.      nr lC \\n(lC+1
 .      ds A1 \\$2
 .      ds A2 \\$3
 .      ds A3 \\$4
 .      ds A1 \\$2
 .      ds A2 \\$3
 .      ds A3 \\$4
 .      ds A8 \\$9
 .      nr fV \\n(.$-1
 .      if "\\$1"-hang" \{\
 .      ds A8 \\$9
 .      nr fV \\n(.$-1
 .      if "\\$1"-hang" \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ds L\\n(lC hL
 .              nr w\\n(lC 6n
 .              nr tC  1
 .      \}
 .      if "\\$1"-tag" \{\
 .              ds L\\n(lC hL
 .              nr w\\n(lC 6n
 .              nr tC  1
 .      \}
 .      if "\\$1"-tag" \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ds L\\n(lC tL
 .              nr tC  1
 .      \}
 .      if "\\$1"-item" \{\
 .              ds L\\n(lC tL
 .              nr tC  1
 .      \}
 .      if "\\$1"-item" \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ds L\\n(lC iT
 .              nr tC  1
 .      \}
 .      if "\\$1"-enum" \{\
 .              ds L\\n(lC iT
 .              nr tC  1
 .      \}
 .      if "\\$1"-enum" \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ds L\\n(lC nU
 .              ds L\\n(lC nU
-.              nr w\\n(lC 2n
+.              nr w\\n(lC 3n
 .              nr tC  1
 .      \}
 .      if "\\$1"-bullet" \{\
 .              nr tC  1
 .      \}
 .      if "\\$1"-bullet" \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ds L\\n(lC bU
 .              nr w\\n(lC 2n
 .              nr tC  1
 .      \}
 .      if "\\$1"-dash" \{\
 .              ds L\\n(lC bU
 .              nr w\\n(lC 2n
 .              nr tC  1
 .      \}
 .      if "\\$1"-dash" \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
+.              ds L\\n(lC hU
+.              nr w\\n(lC 2n
+.              nr tC  1
+.      \}
+.      if "\\$1"-hyphen" \{\
+.              nr aP \\n(aP+1
 .              ds L\\n(lC hU
 .              nr w\\n(lC 2n
 .              nr tC  1
 .      \}
 .      if "\\$1"-inset" \{\
 .              ds L\\n(lC hU
 .              nr w\\n(lC 2n
 .              nr tC  1
 .      \}
 .      if "\\$1"-inset" \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ds L\\n(lC lL
 .              nr tC  1
 .      \}
 .      if "\\$1"-diag" \{\
 .              ds L\\n(lC lL
 .              nr tC  1
 .      \}
 .      if "\\$1"-diag" \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ds L\\n(lC mL
 .              nr mL 1
 .      \}
 .      if "\\$1"-ohang" \{\
 .              ds L\\n(lC mL
 .              nr mL 1
 .      \}
 .      if "\\$1"-ohang" \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ds L\\n(lC oL
 .              nr tC 1
 .      \}
 .      if "\\$1"-column" \{\
 .              ds L\\n(lC oL
 .              nr tC 1
 .      \}
 .      if "\\$1"-column" \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ds L\\n(lC cL
 .      \}
 .      ie \\n(aP==0 \{\
 .              ds L\\n(lC cL
 .      \}
 .      ie \\n(aP==0 \{\
 .              \}
 .      \}
 .      nr aP 0
 .              \}
 .      \}
 .      nr aP 0
+.\" .  ds b1
 .      aY
 .\" .tm Here is L[\\n(lC]==\\*(L\\n(lC
 .\}
 ..
 .      aY
 .\" .tm Here is L[\\n(lC]==\\*(L\\n(lC
 .\}
 ..
+.if \n(.g \{\
+.      nr i 10
+.      while \ni<100 \{\
+.           nr num!\nin 1
+.           nr i +1
+.      \}
+.\}
 .\" NS lV macro - resolve remaining .Bl arguments
 .de lV
 .\" NS lV macro - resolve remaining .Bl arguments
 .de lV
-.nr aP+1
+.nr aP \\n(aP+1
 .if \\n(fV>=\\n(aP \{\
 .      nr iD 0
 .      if "\\*(A\\n(aP"-compact" \{\
 .if \\n(fV>=\\n(aP \{\
 .      nr iD 0
 .      if "\\*(A\\n(aP"-compact" \{\
 .      \}
 .      if "\\*(A\\n(aP"-width" \{\
 .              nr iD 1
 .      \}
 .      if "\\*(A\\n(aP"-width" \{\
 .              nr iD 1
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              nr tW 1
 .              ds t\\n(lC TagwidtH
 .              ds tS \\*(A\\n(aP
 .              aW \\n(aP
 .              ie \\n(sW>2 \{\
 .              nr tW 1
 .              ds t\\n(lC TagwidtH
 .              ds tS \\*(A\\n(aP
 .              aW \\n(aP
 .              ie \\n(sW>2 \{\
-.                      ie \\n(sW==3 \{\
-.                              ie (\\*(tS>9n)&(\\*(tS<99n) \{\
-.                                      nr w\\n(lC \\*(tSu
+.                      nr w\\n(lC (\\n(sW)*\\n(fWu
+.                      if \\n(sW==3 \{\
+.                              ie \\n(.g \{\
+.                                      if \A'\\*(tS' .if r num!\\*(tS \{\
+.                                              nr w\\n(lC \\*(tS
+.                                      \}
+.                              \}
+.                              el \{\
+.                                      if (\\*(tS>9n)&(\\*(tS<99n) \{\
+.                                              nr w\\n(lC \\*(tSu
+.                                      \}
 .                              \}
 .                              \}
-.                              el .nr w\\n(lC (\\n(sW)*\\n(fWu
 .                      \}
 .                      \}
-.                      el .nr w\\n(lC (\\n(sW)*\\n(fWu
 .              \}
 .              el \{\
 .                      aT \\*(tS
 .              \}
 .              el \{\
 .                      aT \\*(tS
 .      \}
 .      if "\\*(A\\n(aP"-offset" \{\
 .              nr iD 1
 .      \}
 .      if "\\*(A\\n(aP"-offset" \{\
 .              nr iD 1
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ie "\\*(A\\n(aP"indent" \{\
 .                      nr o\\n(lC \\n(Dsu
 .              \}
 .              ie "\\*(A\\n(aP"indent" \{\
 .                      nr o\\n(lC \\n(Dsu
 .              \}
 .                      ds tS \\*(A\\n(aP
 .                      aW \\n(aP
 .                      ie \\n(sW>2 \{\
 .                      ds tS \\*(A\\n(aP
 .                      aW \\n(aP
 .                      ie \\n(sW>2 \{\
-.                              ie (\\*(tS>9n)&(\\*(tS<100n) \{\
-.                                      nr o\\n(lC \\*(tS
+.                              nr o\\n(lC (\\n(sW)*\\n(fWu
+.                              ie \\n(.g \{\
+.                                      if \A'\\*(tS' .if r num!\\*(tS \{\
+.                                              nr o\\n(lC \\*(tS
+.                                      \}
+.                              \}
+.                              el \{\
+.                                      if (\\*(tS>9n)&(\\*(tS<100n) \{\
+.                                              nr o\\n(lC \\*(tS
+.                                      \}
 .                              \}
 .                              \}
-.                              el .nr o\\n(lC (\\n(sW)*\\n(fWu
 .                      \}
 .                      el \{\
 .                              ie \\n(C\\n(aP==1 .nr o\\n(lC \\n(\\*(tS
 .                      \}
 .                      el \{\
 .                              ie \\n(C\\n(aP==1 .nr o\\n(lC \\n(\\*(tS
 .      \}
 .      if \\n(iD==0 \{\
 .              if "\\*(L\\n(lC"cL" \{\
 .      \}
 .      if \\n(iD==0 \{\
 .              if "\\*(L\\n(lC"cL" \{\
-.                      nr wV+1
+.                      nr wV \\n(wV+1
 .                      ds A\\n(wV \\*(A\\n(aP
 .              \}
 .      \}
 .                      ds A\\n(wV \\*(A\\n(aP
 .              \}
 .      \}
 .      if \\n(mL>0 \{\
 .              nr iD 1
 .              nr mL 0
 .      if \\n(mL>0 \{\
 .              nr iD 1
 .              nr mL 0
+.              tZ
+.              nr lC \\n(lC-1
+.              tY
 .      \}
 .      if "\\*(L\\n(lC"iT" \{\
 '              in \\n(.iu-\\n(o\\n(lCu
 .              tZ
 .      \}
 .      if "\\*(L\\n(lC"iT" \{\
 '              in \\n(.iu-\\n(o\\n(lCu
 .              tZ
-.              nr lC-1
+.              nr lC \\n(lC-1
 .              tY
 .              nr iD 1
 .      \}
 .      if "\\*(L\\n(lC"oL" \{\
 '              in \\n(.iu-\\n(o\\n(lCu
 .              tZ
 .              tY
 .              nr iD 1
 .      \}
 .      if "\\*(L\\n(lC"oL" \{\
 '              in \\n(.iu-\\n(o\\n(lCu
 .              tZ
-.              nr lC-1
+.              nr lC \\n(lC-1
 .              tY
 .              nr iD 1
 .      \}
 .      if "\\*(L\\n(lC"lL" \{\
 '              in \\n(.iu-\\n(o\\n(lCu
 .              tZ
 .              tY
 .              nr iD 1
 .      \}
 .      if "\\*(L\\n(lC"lL" \{\
 '              in \\n(.iu-\\n(o\\n(lCu
 .              tZ
-.              nr lC-1
+.              nr lC \\n(lC-1
 .              tY
 .              nr iD 1
 .      \}
 .              tY
 .              nr iD 1
 .      \}
 .      tm .It \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
 .\}
 .\" .tm Here is L[\\n(lC]==\\*(L\\n(lC
 .      tm .It \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
 .\}
 .\" .tm Here is L[\\n(lC]==\\*(L\\n(lC
-.ne 2v
+.ne 3v
 .ie \\n(.$>0 \{\
 .      ds mN It
 .      ds b1
 .ie \\n(.$>0 \{\
 .      ds mN It
 .      ds b1
 .      \}
 .      if \\n(iD==0 \{\
 .              fV
 .      \}
 .      if \\n(iD==0 \{\
 .              fV
-.\" .tm It list-type==\\*(L\\n(lC, aP==\\n(aP
-.\" .tm It beg arg(A[1])==\\*(A1; oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC
-.              nr oM+1
+.\" tm ------------------------------------------------------------------------
+.\" tm It list-type==\\*(L\\n(lC, aP==\\n(aP
+.\" tm It beg arg(A[1])==\\*(A1; oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC
+.              nr oM \\n(oM+1
 .              nr tP 1
 .              nr tP 1
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              nr tX \\n(C\\n(aP
 .              ds tX \\*(A\\n(aP
 .              if \\n(nF==1 \{\
 .              nr tX \\n(C\\n(aP
 .              ds tX \\*(A\\n(aP
 .              if \\n(nF==1 \{\
 .                      \\*(A\\n(aP
 .              \}
 .              el \{\
 .                      \\*(A\\n(aP
 .              \}
 .              el \{\
-.                      nr aP-1
+.                      nr aP \\n(aP-1
 .                      No
 .              \}
 .                      No
 .              \}
+.\" tm in It here is b1==\\*(b1
+.\" tm It mid arg(A[1])==\\*(A1; oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC
 .              ie \\n(Xt==1 .ds xB \&\\*(L\\n(lC
 .              el .\\*(L\\n(lC
 .      \}
 .              ie \\n(Xt==1 .ds xB \&\\*(L\\n(lC
 .              el .\\*(L\\n(lC
 .      \}
 .lY
 .br
 \&\\*(b1
 .lY
 .br
 \&\\*(b1
-.nr oM-1
+.nr oM \\n(oM-1
 .nr tP 0
 .nr tP 0
-.dZ+1
 .ds b1
 .aY
 'fi
 .ds b1
 .aY
 'fi
 .lX
 .nr bb \\n(w\\n(lCu+\\n(lSu
 .ti -\\n(bbu
 .lX
 .nr bb \\n(w\\n(lCu+\\n(lSu
 .ti -\\n(bbu
-.\" .ie \w'\\*(b1'u>=(\\n(w\\n(lCu) \&\\*(b1\\*(lS
 .ie \w\a\\*(b1\au>=(\\n(w\\n(lCu) \&\\*(b1
 .el \&\\*(b1\h'|\\n(bbu'\c
 .ie \w\a\\*(b1\au>=(\\n(w\\n(lCu) \&\\*(b1
 .el \&\\*(b1\h'|\\n(bbu'\c
-.nr oM-1
-.dZ+1
+.nr oM \\n(oM-1
 .ds b1
 .nr tP 0
 .aY
 .ds b1
 .nr tP 0
 .aY
 .lY
 \&\\*(b1
 .br
 .lY
 \&\\*(b1
 .br
-.nr oM-1
-.dZ+1
+.nr oM \\n(oM-1
 .ds b1
 .nr tP 0
 .aY
 .ds b1
 .nr tP 0
 .aY
 .de iT
 .lY
 .br
 .de iT
 .lY
 .br
+.\" .ds b1
 .aY
 'fi
 ..
 .aY
 'fi
 ..
 .\" NS hU macro - Hyphen paragraph list (sub bullet list)
 .\" NS bU macro - Bullet paragraph list
 .de nU
 .\" NS hU macro - Hyphen paragraph list (sub bullet list)
 .\" NS bU macro - Bullet paragraph list
 .de nU
-.nr oM+1
-.nr nU+1
-.ds b1 \&\\n(nU
+.nr oM \\n(oM+1
+.nr nU \\n(nU+1
+.ds b1 \&\\n(nU.
 .uL
 ..
 .de bU
 .uL
 ..
 .de bU
-.nr oM+1
-.nr bU+1
+.nr oM \\n(oM+1
+.nr bU \\n(bU+1
 .ds b1 \&\\*(sY\&\(bu\fP
 .uL
 ..
 .de hU
 .ds b1 \&\\*(sY\&\(bu\fP
 .uL
 ..
 .de hU
-.nr oM+1
-.nr bU+1
+.nr oM \\n(oM+1
+.nr bU \\n(bU+1
 .ds b1 \&\\*(sY\&\-\fP
 .uL
 ..
 .ds b1 \&\\*(sY\&\-\fP
 .uL
 ..
 .nr bb \\n(w\\n(lCu+\\n(lSu
 .ti -\\n(bbu
 .ie \w\a\\*(b1\au>=(\\n(w\\n(lCu) \&\\*(b1
 .nr bb \\n(w\\n(lCu+\\n(lSu
 .ti -\\n(bbu
 .ie \w\a\\*(b1\au>=(\\n(w\\n(lCu) \&\\*(b1
-.\" .ie \w'\\*(b1'u>=(\\n(w\\n(lCu) \&\\*(b1\0
 .el \&\\*(b1\h'|\\n(bbu'\c
 .el \&\\*(b1\h'|\\n(bbu'\c
-.nr oM-1
-.dZ+1
+.nr oM \\n(oM-1
+.\" .nr dZ \\n(dZ+1
 .ds b1
 .nr tP 0
 .aY
 .ds b1
 .nr tP 0
 .aY
 ..
 .\" NS tL macro - .It item of list-type "tag"
 .de tL
 ..
 .\" NS tL macro - .It item of list-type "tag"
 .de tL
+.\" tm in tL here is b1==\\*(b1
 .if \\n(tW==0 .lW
 .lX
 .nr bb \\n(w\\n(lCu+\\n(lSu
 .if \\n(tW==0 .lW
 .lX
 .nr bb \\n(w\\n(lCu+\\n(lSu
 .if \\n(nF==1 \{\
 .      if n .ds pA \\*(aA
 .\}
 .if \\n(nF==1 \{\
 .      if n .ds pA \\*(aA
 .\}
-.nr oM-1
+.nr oM \\n(oM-1
 .nr tP 0
 .nr tP 0
-.dZ+1
+.\" .nr dZ \\n(dZ+1
 .ds b1
 .aY
 'fi
 .ds b1
 .aY
 'fi
 .\" NS tX string (initial string)
 .\" NS tX register (initial class)
 .\" NS tC parameter change flag
 .\" NS tX string (initial string)
 .\" NS tX register (initial class)
 .\" NS tC parameter change flag
-.\" NS Xt something to do with diversions...
+.\" NS Xt save current list-type flag
 .\" NS lC register - list type stack counter
 .\" NS tP register tag flag (for diversions)
 .\" NS w[0-9] register tag stack (nested tags)
 .\" NS lC register - list type stack counter
 .\" NS tP register tag flag (for diversions)
 .\" NS w[0-9] register tag stack (nested tags)
 .      rr o\\n(lC
 .\}
 .el 'in \\n(.iu-\\n(w\\n(lCu-\\n(lSu
 .      rr o\\n(lC
 .\}
 .el 'in \\n(.iu-\\n(w\\n(lCu-\\n(lSu
-.if \\n(lC<=0 .tm Extraneous .Bl or .El call (#\\n(.c)
+.if \\n(lC<=0 .tm Extraneous .El call (#\\n(.c)
 .tZ
 .tZ
-.nr lC-1
+.nr lC \\n(lC-1
 .tY
 ..
 .\" NS tY macro - set up next block for list
 .tY
 ..
 .\" NS tY macro - set up next block for list
 .rr o\\n(tY
 .rm t\\n(tY
 .rr v\\n(tY
 .rr o\\n(tY
 .rm t\\n(tY
 .rr v\\n(tY
-.nr tY-1
+.nr tY \\n(tY-1
 ..
 .\" initial values
 .nr w1 0
 ..
 .\" initial values
 .nr w1 0
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .      ie \\n(C\\n(aP==1 .tm Usage: .Xr manpage_name [section#] \\*(Pu (#\\n(.c)
 .      el \{\
 .              ie \\n(C\\n(aP>2 .y\\n(C\\n(aP
 .              el \{\
 .                      as b1 \&\\*(xR\\*(A\\n(aP\fP\s0
 .                      if \\n(aC>\\n(aP \{\
 .      ie \\n(C\\n(aP==1 .tm Usage: .Xr manpage_name [section#] \\*(Pu (#\\n(.c)
 .      el \{\
 .              ie \\n(C\\n(aP>2 .y\\n(C\\n(aP
 .              el \{\
 .                      as b1 \&\\*(xR\\*(A\\n(aP\fP\s0
 .                      if \\n(aC>\\n(aP \{\
-.                              nr aP+1
+.                              nr aP \\n(aP+1
 .                              if \\n(C\\n(aP==2 \{\
 .                                      as b1 \&(\\*(A\\n(aP)
 .                              if \\n(C\\n(aP==2 \{\
 .                                      as b1 \&(\\*(A\\n(aP)
-.                                      nr aP+1
+.                                      nr aP \\n(aP+1
 .                              \}
 .                              if \\n(aC>=\\n(aP \{\
 .                                      c\\n(C\\n(aP
 .                              \}
 .                              if \\n(aC>=\\n(aP \{\
 .                                      c\\n(C\\n(aP
 .\}
 .\}
 .if \\n(aC>\\n(aP \{\
 .\}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .      as b1 \\*(sX
 .      nr cF \\n(.f
 .      nr cZ \\n(.s
 .      as b1 \\*(sX
 .      nr cF \\n(.f
 .      nr cZ \\n(.s
 .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
 .fi
 .tZ
 .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
 .fi
 .tZ
-.nr lC-1
+.nr lC \\n(lC-1
 .tY
 ..
 .de W1
 .tY
 ..
 .de W1
 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
 ..
 .de W2
 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
 ..
 .de W2
-.\" ARGS2 Here is offset == \\n(o\\n(lCu
 .ta \w\a\\*(A1    \au +\w\a\\*(A2    \au
 .nr eW \w\a\\*(A1    \au+\w\a\\*(A2    \au
 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
 .ta \w\a\\*(A1    \au +\w\a\\*(A2    \au
 .nr eW \w\a\\*(A1    \au+\w\a\\*(A2    \au
 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
 ..
 .de W4
 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
 ..
 .de W4
-.\" ARGS4Here is o[\\n(lC] == \\n(o\\n(lCu,
-.\" A1==\\*(A1
-.\" A2==\\*(A2
-.\" A3==\\*(A3
-.\" A4==\\*(A4
 .ta \w\a\\*(A1    \au +\w\a\\*(A2    \au +\w\a\\*(A3    \au +\w\a\\*(A4    \au
 .nr eW \w\a\\*(A1    \au+\w\a\\*(A2    \au +\w\a\\*(A3    \au +\w\a\\*(A4    \au
 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
 ..
 .de W5
 .ta \w\a\\*(A1    \au +\w\a\\*(A2    \au +\w\a\\*(A3    \au +\w\a\\*(A4    \au
 .nr eW \w\a\\*(A1    \au+\w\a\\*(A2    \au +\w\a\\*(A3    \au +\w\a\\*(A4    \au
 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
 ..
 .de W5
-.ta \w\a\\*(A1    \au +\w\a\\*(A2    \au +\w\a\\*(A3    \au +\w\a\\*(A4    \au +\w\a\\*(A5    \au
-.nr eW \w\a\\*(A1    \au +\w\a\\*(A2    \au +\w\a\\*(A3    \au +\w\a\\*(A4    \au +\w\a\\*(A5    \au
+.ta \w\a\\*(A1   \au +\w\a\\*(A2   \au +\w\a\\*(A3   \au +\w\a\\*(A4   \au +\w\a\\*(A5   \au
+.nr eW \w\a\\*(A1   \au +\w\a\\*(A2   \au +\w\a\\*(A3   \au +\w\a\\*(A4   \au +\w\a\\*(A5   \au
+'      in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
+..
+.\" This is packed abnormally close, intercol width should be an option
+.de W6
+.ta \w\a\\*(A1 \au +\w\a\\*(A2 \au +\w\a\\*(A3 \au +\w\a\\*(A4 \au +\w\a\\*(A5 \au +\w\a\\*(A6
+.nr eW \w\a\\*(A1 \au +\w\a\\*(A2 \au +\w\a\\*(A3 \au +\w\a\\*(A4 \au +\w\a\\*(A5 \au +\w\a\\*(A6
 '      in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
 ..
 .\" NS cL macro - column items
 '      in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
 ..
 .\" NS cL macro - column items
 .\}
 .ti -\\n(eWu
 .fV
 .\}
 .ti -\\n(eWu
 .fV
-.nr aP+1
+.nr aP \\n(aP+1
 .ie \\n(aC>=\\n(aP  \{\
 .      if "\\*(A\\n(aP"Ta" \{\
 .              nr jJ \\n(aP-1
 .ie \\n(aC>=\\n(aP  \{\
 .      if "\\*(A\\n(aP"Ta" \{\
 .              nr jJ \\n(aP-1
 .\" NS Ta macro - append tab (\t)
 .de Ta
 .ie \\n(aC>0 \{\
 .\" NS Ta macro - append tab (\t)
 .de Ta
 .ie \\n(aC>0 \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .      ie \\n(aC>=\\n(aP \{\
 .              if "\\*(A\\n(aP"Ta" \{\
 .                      nr jJ \\n(aP-1
 .      ie \\n(aC>=\\n(aP \{\
 .              if "\\*(A\\n(aP"Ta" \{\
 .                      nr jJ \\n(aP-1
 .              rm S\\n(aP
 .              pB
 .              aY
 .              rm S\\n(aP
 .              pB
 .              aY
+.\" .          ds b1
 .      \}
 .\}
 .el \{\
 .      \}
 .\}
 .el \{\
 .               ds A9 \\$9
 .              nr fV \\n(.$
 .              fV
 .               ds A9 \\$9
 .              nr fV \\n(.$
 .              fV
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              ie \\n(C\\n(aP==1 .\\*(A\\n(aP
 .              el .No
 .      \}
 .              ie \\n(C\\n(aP==1 .\\*(A\\n(aP
 .              el .No
 .      \}
 ..
 .\"
 .\" NS Vt macro - Variable type (for forcing old style variable declarations)
 ..
 .\"
 .\" NS Vt macro - Variable type (for forcing old style variable declarations)
+.\" this is not done in the same manner as .Ot for fortrash - clean up later
 .de Vt
 .de Vt
+.\" if a function declaration was the last thing given, want vertical space
+.if \\n(fD>0 \{\
+.      Pp
+.      nr fD 0
+.\}
+.\"    if a subroutine was the last thing given, want vertical space
+.if \\n(fZ>0 \{\
+.      ie \\n(fX==0 \{\
+.              Pp
+.              rs
+.      \}
+.      el .br
+.\}
+.nr fX \\n(fX+1
 .nr cF \\n(.f
 .nr cF \\n(.f
-.ft \\n(vT
-\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.nr cZ \\n(.s
+\\*(fT\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.ie \\n(oT==0 .br
+.el \&\ \&
 .ft \\n(cF
 .ft \\n(cF
+.fs \\n(cZ
 ..
 .\"
 .\" NS Ft macro - Function type
 ..
 .\"
 .\" NS Ft macro - Function type
 .if \\n(nS>0 \{\
 .      if \\n(fZ>0 \{\
 .              Pp
 .if \\n(nS>0 \{\
 .      if \\n(fZ>0 \{\
 .              Pp
+.              nr fD 0
+.              nr fX 0
+.      \}
+.      if \\n(fD>0 \{\
+.              Pp
+.              nr fD 0
+.              nr fX 0
+.      \}
+.      if \\n(fX>0 \{\
+.              Pp
+.              nr fX 0
 .      \}
 .      \}
-.      nr fZ+1
-.      nr fY+1
+.      nr fY 1
 .\}
 .nr cF \\n(.f
 .nr cZ \\n(.s
 .\}
 .nr cF \\n(.f
 .nr cZ \\n(.s
-.\" .ft \\n(fT
 \&\\*(fT\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .ft \\n(cF
 .fs \\n(cZ
 \&\\*(fT\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .ft \\n(cF
 .fs \\n(cZ
-.br
+.\" .br
 ..
 .\"
 .\" NS Ot macro - Old Function type (fortran - no newline)
 ..
 .\"
 .\" NS Ot macro - Old Function type (fortran - no newline)
+.\" Ns oT register
+.nr oT 0
 .de Ot
 .de Ot
+.nr oT 1
 .if \\n(nS>0 \{\
 .if \\n(nS>0 \{\
-.      if \\n(fZ>0 .Pp
-.      nr fZ+1
-.      nr fY+1
+.      if \\n(fZ>0 \{\
+.              Pp
+.              nr fD 0
+.              nr fX 0
+.      \}
+.      if \\n(fD>0 \{\
+.              Pp
+.              nr fD 0
+.              nr fX 0
+.      \}
+.      if \\n(fX>0 \{\
+.              Pp
+.              nr fX 0
+.      \}
+.      nr fY 1
 .\}
 .\}
-.nr cF \\n(.f
-.ft \\n(fT
-\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
-.ft \\n(cF
+.if \\n(.$==4 .as b1 \&\\*(fT\&\\$1 \\$2 \\$3 \\$4
+.if \\n(.$==3 .as b1 \&\\*(fT\&\\$1 \\$2 \\$3
+.if \\n(.$==2 .as b1 \&\\*(fT\&\\$1 \\$2
+.if \\n(.$==1 .as b1 \&\\*(fT\&\\$1
+.as b1 \&\ \fP
 ..
 .\"
 .\" NS Fa macro - Function arguments
 ..
 .\"
 .\" NS Fa macro - Function arguments
 .       ie \\n(.$==0 .tm Usage: .Fa Function Arguments ... \\*(Pu (#\\n(.c)
 .       el \{\
 .              ds mN Fa
 .       ie \\n(.$==0 .tm Usage: .Fa Function Arguments ... \\*(Pu (#\\n(.c)
 .       el \{\
 .              ds mN Fa
-.              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.               ds A1 \\$1
+.               ds A2 \\$2
+.               ds A3 \\$3
+.               ds A4 \\$4
+.               ds A5 \\$5
+.               ds A6 \\$6
+.               ds A7 \\$7
+.               ds A8 \\$8
+.               ds A9 \\$9
+.              nr fV \\n(.$
+.              fV
 .      \}
 .\}
 .      \}
 .\}
-.if \\n(aC>\\n(aP \{\
-.      as b1 \\*(fA
-.      nr aP+1
-.       nr cF \\n(.f
-.      nr cZ \\n(.s
-.       nR
-.      if \\n(nS>0 \{\
-.              if \\n(fZ>0 .br
+.ie \\n(fC>0 \{\
+.      fC
+.\}
+.el \{\
+.      if \\n(aC>\\n(aP \{\
+.              as b1 \\*(fA
+.              nr aP \\n(aP+1
+.              nr cF \\n(.f
+.              nr cZ \\n(.s
+.              nR
+.              if \\n(nS>0 \{\
+.                      if \\n(fZ>0 .br
+.              \}
+.      \}
+.\}
+..
+.\" NS fC macro - interal .Fa for .FO and .Fc
+.de fC
+.ie \\n(aC>\\n(aP \{\
+.      nr aP \\n(aP+1
+.\" .  nr aa \\n(aP
+.\" .  if \\n(nS>0 \{\
+.              ds Fb
+.              nr fB 0
+.              nr Fb 0
+.              fB \\*(A\\n(aP
+.              if \\n(fB>1 \{\
+.                      rm A\\n(aP
+.                      rn Fb A\\n(aP
+.              \}
+.\" .  \}
+.      if \\n(fC>1 \{\
+.              as b1 \&\f\\n(cF\s\\n(cZ,\\*(S\\n(aP\\*(fA\\*(A\\n(aP\fP\s0
+.\" .          as b1 \&\\,\\*(S\\n(aP\fP\s0\\*(fA\\*(A\\n(aP\fP\s0
 .      \}
 .      \}
+.      if \\n(fC==1 \{\
+.              as b1 \&\|\\*(fA\\*(A\\n(aP\fP\s0
+.      \}
+.      nr fC \\n(fC+1
+.      fC
+.\}
+.el  \{\
+.      aY
 .\}
 ..
 .\" NS Fn macro - functions
 .\}
 ..
 .\" NS Fn macro - functions
 .      \}
 .\}
 .if \\n(nS>0 \{\
 .      \}
 .\}
 .if \\n(nS>0 \{\
-.      if (\\n(fY==0) \{\
-.              if \\n(fZ>0 .Pp
-.              nr fZ+1
+.\" if there is/has been more than one subroutine declaration
+.      if \\n(fY==0 \{\
+.              if \\n(fZ>0 \{\
+.                      Pp
+.                      nr fX 0
+.                      nr fD 0
+.              \}
 .      \}
 .      \}
-.      nr fD 0
-.\}
-.if \\n(nS \{\
-.      if "\\*(mN"Fn" \{\
-.              rs
-.              ie \\n(nS>1 .br
-.              el \{\
-.                      if \\n(iS==0 \{\
-.                              nr iS ((6)*\\n(fW)u
-.                     \}
-.              \}
-.              in +\\n(iSu
-.              ti -\\n(iSu
-.              nr nS \\n(nS+1
-.        \}
+.      if \\n(fY==1 \{\
+.              br
+.              nr fX 0
+.              nr fD 0
+.              nr fY 0
+.      \}
+.      if \\n(fD>0 \{\
+.              Pp
+.              nr fX 0
+.      \}
+.      if \\n(fX>0 \{\
+.              Pp
+.              nr fD 0
+.      \}
+.      nr fZ \\n(fZ+1
+.      nr fY 0
+.      rs
+.      ie \\n(nS>1 .br
+.      el \{\
+.              if \\n(iS==0 \{\
+.                      nr iS ((8)*\\n(fW)u
+.              \}
+.      \}
+.      in +\\n(iSu
+.      ti -\\n(iSu
+.      nr nS \\n(nS+1
 .\}
 .if \\n(aC>\\n(aP \{\
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .      nr cF \\n(.f
 .      nr cZ \\n(.s
 .      as b1 \\*(fN\\*(A\\n(aP\fP\s0\\*(lp
 .      ie \\n(aC>\\n(aP \{\
 .              as b1 \\*(fA
 .      nr cF \\n(.f
 .      nr cZ \\n(.s
 .      as b1 \\*(fN\\*(A\\n(aP\fP\s0\\*(lp
 .      ie \\n(aC>\\n(aP \{\
 .              as b1 \\*(fA
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              f\\n(C\\n(aP
 .      \}
 .      el \{\
 .              f\\n(C\\n(aP
 .      \}
 .      el \{\
 .\\*(A\\n(aP
 ..
 .de f2
 .\\*(A\\n(aP
 ..
 .de f2
+.if \\n(nS>0 \{\
+.      ds Fb
+.      nr fB 0
+.      nr Fb 0
+.      fB \\*(A\\n(aP
+.      if \\n(fB>1 \{\
+.              rm A\\n(aP
+.              rn Fb A\\n(aP
+.      \}
+.\}
 .as b1 \\*(A\\n(aP
 .ie \\n(aC>\\n(aP \{\
 .      nr aa \\n(aP
 .as b1 \\*(A\\n(aP
 .ie \\n(aC>\\n(aP \{\
 .      nr aa \\n(aP
-.      nr aP+1
+.      nr aP \\n(aP+1
 .      if \\n(C\\n(aP==2 \{\
 .              as b1 \&\|\f\\n(cF\s\\n(cZ,\\*(S\\n(aa\fP\s0\|
 .      \}
 .      if \\n(C\\n(aP==2 \{\
 .              as b1 \&\|\f\\n(cF\s\\n(cZ,\\*(S\\n(aa\fP\s0\|
 .      \}
 .de f4
 .as b1 \\*(rp\f\\n(cF\s\\n(cZ\\*(S\\n(aP\\*(A\\n(aP
 .ie \\n(aC>\\n(aP \{\
 .de f4
 .as b1 \\*(rp\f\\n(cF\s\\n(cZ\\*(S\\n(aP\\*(A\\n(aP
 .ie \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .      No
 .\}
 .el .aZ
 ..
 .      No
 .\}
 .el .aZ
 ..
+.de Fo
+.hy 0
+.if \\n(aC==0 \{\
+.      ie \\n(.$==0 .tm Usage: .Fo function_name
+.      el \{\
+.              ds mN Fo
+.               ds A1 \\$1
+.               ds A2 \\$2
+.               ds A3 \\$3
+.               ds A4 \\$4
+.               ds A5 \\$5
+.               ds A6 \\$6
+.               ds A7 \\$7
+.               ds A8 \\$8
+.               ds A9 \\$9
+.              nr fV \\n(.$
+.              fV
+.      \}
+.\}
+.if \\n(nS>0 \{\
+.\" if there is/has been more than one subroutine declaration
+.      if \\n(fY==0 \{\
+.              if \\n(fZ>0 \{\
+.                      Pp
+.                      nr fX 0
+.                      nr fD 0
+.              \}
+.      \}
+.      if \\n(fY==1 \{\
+.              br
+.              nr fX 0
+.              nr fD 0
+.              nr fY 0
+.      \}
+.      if \\n(fD>0 \{\
+.              Pp
+.              nr fX 0
+.      \}
+.      if \\n(fX>0 \{\
+.              Pp
+.              nr fD 0
+.      \}
+.      nr fZ \\n(fZ+1
+.      nr fY 0
+.      rs
+.      ie \\n(nS>1 .br
+.      el \{\
+.              if \\n(iS==0 \{\
+.                      nr iS ((8)*\\n(fW)u
+.              \}
+.      \}
+.      in +\\n(iSu
+.      ti -\\n(iSu
+.      nr nS \\n(nS+1
+.\}
+.if \\n(aC>\\n(aP \{\
+.      nr oM \\n(oM+1
+.      nr fC 1
+.      nr aP \\n(aP+1
+.      nr cF \\n(.f
+.      nr cZ \\n(.s
+.      as b1 \\*(fN\\*(A\\n(aP\fP\s0\\*(lp
+.      aY
+.\}
+..
+.de Fc
+.if \\n(aC==0 \{\
+.      if \\n(.$>0 \{\
+.              ds mN Fo
+.               ds A1 \\$1
+.               ds A2 \\$2
+.               ds A3 \\$3
+.               ds A4 \\$4
+.               ds A5 \\$5
+.               ds A6 \\$6
+.               ds A7 \\$7
+.               ds A8 \\$8
+.               ds A9 \\$9
+.              nr fV \\n(.$
+.              fV
+.      \}
+.\}
+.nr fC 0
+.nr oM \\n(oM-1
+.as b1 \|\\*(rp
+.ie \\n(aC>\\n(aP \{\
+.      nr aP \\n(aP+1
+.      \\*(A\\n(aP
+.\}
+.el \{\
+.      aZ
+.\}
+.if \\n(nS>0 \{\
+.      in -\\n(iSu
+.\}
+.hy
+..
+.\" NS fb macro - if SYNOPSIS, set hard space inbetween function args
+.\" NS fb register - count of words in a function argument
+.\" NS Fb register - counter
+.\" NS Fb string - temporary string
+.de fB
+.\" .tm fB==\\n(fB, Fb==\\n(Fb, 1==\\$1 2==\\$2 3==\\$3 4==\\$4 5==\\$5 6==\\$6
+.if \\n(fB==0 \{\
+.      nr fB \\n(.$
+.      nr Fb 0
+.      ds Fb
+.\}
+.nr Fb \\n(Fb+1
+.as Fb \&\\$1
+.if \\n(Fb<\\n(fB \{\
+.      as Fb \&\\*(hV
+.      fB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.\}
+..
 .\" NS Fc - Function close - not implemented yet
 .\" NS Fo - Function open - not implemented yet
 .\"
 .\" NS Fc - Function close - not implemented yet
 .\" NS Fo - Function open - not implemented yet
 .\"
 .de Rs
 .nr rS 1
 .rC
 .de Rs
 .nr rS 1
 .rC
-.if \\n(nA==1 .br
+.if \\n(nA==1 .Pp
 .nr Kl 0
 ..
 .\" NS Re macro - Reference End
 .nr Kl 0
 ..
 .\" NS Re macro - Reference End
 .nr vK 0
 .nr dK 0
 .nr pK 0
 .nr vK 0
 .nr dK 0
 .nr pK 0
+.nr bK 0
 .ds rS
 .rm U1 U2 U3 U4 U5 U6 U7 U8
 .ds rS
 .rm U1 U2 U3 U4 U5 U6 U7 U8
-.rm uK jK nK oK rK qK tK vK dK pK
+.rm uK jK nK oK rK qK tK vK dK pK bK
 ..
 .\" NS rZ macro - reference print
 .de rZ
 ..
 .\" NS rZ macro - reference print
 .de rZ
 .      if (\\n(uK>1 \{\
 .              aK
 .      \}
 .      if (\\n(uK>1 \{\
 .              aK
 .      \}
-.      nr Kl-\\n(uK
+.      nr Kl -\\n(uK
 .\}
 .if \\n(tK \{\
 .\}
 .if \\n(tK \{\
-.      nr Kl-1
+.      nr Kl \\n(Kl-1
 .      if \\n(Kl==0 \{\
 .              ie (\\n(jK==1):(\\n(bK==1) \{\&\\*q\\*(tK\\*q.
 .              \}
 .      if \\n(Kl==0 \{\
 .              ie (\\n(jK==1):(\\n(bK==1) \{\&\\*q\\*(tK\\*q.
 .              \}
 .      \}
 .\}
 .if \\n(bK \{\
 .      \}
 .\}
 .if \\n(bK \{\
-.      nr Kl-1
+.      nr Kl \\n(Kl-1
 .      if \\n(Kl==0 \&\\*(eM\\*(bK\\*(nO.
 .      if \\n(Kl>0 \&\\*(eM\\*(bK\\*(nO,
 .\}
 .if \\n(jK \{\
 .      if \\n(Kl==0 \&\\*(eM\\*(bK\\*(nO.
 .      if \\n(Kl>0 \&\\*(eM\\*(bK\\*(nO,
 .\}
 .if \\n(jK \{\
-.      nr Kl-1
+.      nr Kl \\n(Kl-1
 .      if \\n(Kl==0 \&\\*(eM\\*(jK\\*(nO.
 .      if \\n(Kl>0 \&\\*(eM\\*(jK\\*(nO,
 .\}
 .if \\n(rK \{\
 .      if \\n(Kl==0 \&\\*(eM\\*(jK\\*(nO.
 .      if \\n(Kl>0 \&\\*(eM\\*(jK\\*(nO,
 .\}
 .if \\n(rK \{\
-.      nr Kl-1
+.      nr Kl \\n(Kl-1
 .      if \\n(Kl==0 \&\\*(rK.
 .      if \\n(Kl>0 \&\\*(rK,
 .\}
 .if \\n(nK \{\
 .      if \\n(Kl==0 \&\\*(rK.
 .      if \\n(Kl>0 \&\\*(rK,
 .\}
 .if \\n(nK \{\
-.      nr Kl-1
+.      nr Kl \\n(Kl-1
 .      if \\n(Kl==0 \&\\*(nK.
 .      if \\n(Kl>0 \&\\*(nK,
 .\}
 .if \\n(vK \{\
 .      if \\n(Kl==0 \&\\*(nK.
 .      if \\n(Kl>0 \&\\*(nK,
 .\}
 .if \\n(vK \{\
-.      nr Kl-1
+.      nr Kl \\n(Kl-1
 .      if \\n(Kl==0 \&\\*(vK.
 .      if \\n(Kl>0 \&\\*(vK,
 .\}
 .if \\n(pK \{\
 .      if \\n(Kl==0 \&\\*(vK.
 .      if \\n(Kl>0 \&\\*(vK,
 .\}
 .if \\n(pK \{\
-.      nr Kl-1
+.      nr Kl \\n(Kl-1
 .      if \\n(Kl==0 \&\\*(pK.
 .      if \\n(Kl>0 \&\\*(pK,
 .\}
 .if \\n(qK \{\
 .      if \\n(Kl==0 \&\\*(pK.
 .      if \\n(Kl>0 \&\\*(pK,
 .\}
 .if \\n(qK \{\
-.      nr Kl-1
+.      nr Kl \\n(Kl-1
 .      if \\n(Kl==0 \&\\*(qK.
 .      if \\n(Kl>0 \&\\*(qK,
 .\}
 .if \\n(dK \{\
 .      if \\n(Kl==0 \&\\*(qK.
 .      if \\n(Kl>0 \&\\*(qK,
 .\}
 .if \\n(dK \{\
-.      nr Kl-1
+.      nr Kl \\n(Kl-1
 .      if \\n(Kl==0 \&\\*(dK.
 .      if \\n(Kl>0 \&\\*(dK,
 .\}
 .if \\n(oK \{\
 .      if \\n(Kl==0 \&\\*(dK.
 .      if \\n(Kl>0 \&\\*(dK,
 .\}
 .if \\n(oK \{\
-.      nr Kl-1
+.      nr Kl \\n(Kl-1
 .      if \\n(Kl==0 \&\\*(oK.
 .      if \\n(Kl>0 \&\\*(oK,
 .\}
 .      if \\n(Kl==0 \&\\*(oK.
 .      if \\n(Kl>0 \&\\*(oK,
 .\}
 ..
 .\" NS aK macro - print out reference authors
 .de aK
 ..
 .\" NS aK macro - print out reference authors
 .de aK
-.nr aK+1
+.nr aK \\n(aK+1
 .ie (\\n(uK-\\n(aK)==0 \{\&and \\*(U\\n(aK,
 .\}
 .el \{\&\\*(U\\n(aK,
 .ie (\\n(uK-\\n(aK)==0 \{\&and \\*(U\\n(aK,
 .\}
 .el \{\&\\*(U\\n(aK,
 .if \\n(aC==0 \{\
 .       ie \\n(.$==0 .tm Usage: .%A Author_name (#\\n(.c)
 .      el \{\
 .if \\n(aC==0 \{\
 .       ie \\n(.$==0 .tm Usage: .%A Author_name (#\\n(.c)
 .      el \{\
-.              nr uK+1
-.              nr Kl+1
+.              nr uK \\n(uK+1
+.              nr Kl \\n(Kl+1
 .              ds rS U\\n(uK
 .              ds mN %A
 .              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .              ds rS U\\n(uK
 .              ds mN %A
 .              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       ie \\n(.$==0 .tm Usage: .%B Book Name (#\\n(.c)
 .       el \{\
 .              ds mN %B
 .       ie \\n(.$==0 .tm Usage: .%B Book Name (#\\n(.c)
 .       el \{\
 .              ds mN %B
-.              nr bK+1
-.              nr Kl+1
-.              ds rS bK
+.              if \\n(rS>0 \{\
+.                      nr bK \\n(bK+1
+.                      nr Kl \\n(Kl+1
+.                      ds rS bK
+.              \}
 .               ds A1 \\$1
 .               ds A2 \\$2
 .               ds A3 \\$3
 .               ds A1 \\$1
 .               ds A2 \\$2
 .               ds A3 \\$3
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
-.       rR
+.      ie \\n(rS==0 \{\
+.              as b1 \&\\*(eM
+.              nR
+.      \}
+.      el .rR
 .\}
 ..
 .\" NS %D macro - [reference] Date
 .\}
 ..
 .\" NS %D macro - [reference] Date
 .       ie \\n(.$==0 .tm Usage: .%D Date (#\\n(.c)
 .       el \{\
 .              ds mN %D
 .       ie \\n(.$==0 .tm Usage: .%D Date (#\\n(.c)
 .       el \{\
 .              ds mN %D
-.              nr dK+1
-.              nr Kl+1
+.              nr dK \\n(dK+1
+.              nr Kl \\n(Kl+1
 .              ds rS dK
 .               ds A1 \\$1
 .               ds A2 \\$2
 .              ds rS dK
 .               ds A1 \\$1
 .               ds A2 \\$2
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       ie \\n(.$==0 .tm Usage: .%J Journal Name (#\\n(.c)
 .       el \{\
 .              ds mN %J
 .       ie \\n(.$==0 .tm Usage: .%J Journal Name (#\\n(.c)
 .       el \{\
 .              ds mN %J
-.              nr jK+1
+.              nr jK \\n(jK+1
 .              ds rS jK
 .              ds rS jK
-.              nr Kl+1
+.              nr Kl \\n(Kl+1
 .               ds A1 \\$1
 .               ds A2 \\$2
 .               ds A3 \\$3
 .               ds A1 \\$1
 .               ds A2 \\$2
 .               ds A3 \\$3
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .if \\n(aC==0 \{\
 .       ie \\n(.$==0 .tm Usage: .%N issue number (#\\n(.c)
 .      el \{\
 .if \\n(aC==0 \{\
 .       ie \\n(.$==0 .tm Usage: .%N issue number (#\\n(.c)
 .      el \{\
-.              nr nK+1
-.              nr Kl+1
+.              nr nK \\n(nK+1
+.              nr Kl \\n(Kl+1
 .              ds rS nK
 .              ds mN %N
 .              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .              ds rS nK
 .              ds mN %N
 .              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       ie \\n(.$==0 .tm Usage: .%O optional information ... \\*(Pu (#\\n(.c)
 .       el \{\
 .              ds mN %O
 .       ie \\n(.$==0 .tm Usage: .%O optional information ... \\*(Pu (#\\n(.c)
 .       el \{\
 .              ds mN %O
-.              nr oK+1
-.              nr Kl+1
+.              nr oK \\n(oK+1
+.              nr Kl \\n(Kl+1
 .              ds rS oK
 .               ds A1 \\$1
 .               ds A2 \\$2
 .              ds rS oK
 .               ds A1 \\$1
 .               ds A2 \\$2
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       ie \\n(.$==0 .tm Usage: .%P page numbers ... \\*(Pu (#\\n(.c)
 .       el \{\
 .              ds mN %P
 .       ie \\n(.$==0 .tm Usage: .%P page numbers ... \\*(Pu (#\\n(.c)
 .       el \{\
 .              ds mN %P
-.              nr pK+1
-.              nr Kl+1
+.              nr pK \\n(pK+1
+.              nr Kl \\n(Kl+1
 .              ds rS pK
 .               ds A1 \\$1
 .               ds A2 \\$2
 .              ds rS pK
 .               ds A1 \\$1
 .               ds A2 \\$2
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       ie \\n(.$==0 .tm Usage: .%Q Corporate or Foreign Author (#\\n(.c)
 .       el \{\
 .              ds mN %Q
 .       ie \\n(.$==0 .tm Usage: .%Q Corporate or Foreign Author (#\\n(.c)
 .       el \{\
 .              ds mN %Q
-.              nr qK+1
-.              nr Kl+1
+.              nr qK \\n(qK+1
+.              nr Kl \\n(Kl+1
 .              ds rS qK
 .               ds A1 \\$1
 .               ds A2 \\$2
 .              ds rS qK
 .               ds A1 \\$1
 .               ds A2 \\$2
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       ie \\n(.$==0 .tm Usage: .%R reference report (#\\n(.c)
 .       el \{\
 .              ds mN %R
 .       ie \\n(.$==0 .tm Usage: .%R reference report (#\\n(.c)
 .       el \{\
 .              ds mN %R
-.              nr rK+1
-.              nr Kl+1
+.              nr rK \\n(rK+1
+.              nr Kl \\n(Kl+1
 .              ds rS rK
 .               ds A1 \\$1
 .               ds A2 \\$2
 .              ds rS rK
 .               ds A1 \\$1
 .               ds A2 \\$2
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       el \{\
 .              ds mN %T
 .              if \\n(rS>0 \{\
 .       el \{\
 .              ds mN %T
 .              if \\n(rS>0 \{\
-.                      nr tK+1
-.                      nr Kl+1
+.                      nr tK \\n(tK+1
+.                      nr Kl \\n(Kl+1
 .                      ds rS tK
 .              \}
 .               ds A1 \\$1
 .                      ds rS tK
 .              \}
 .               ds A1 \\$1
 .\" .          En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .\" .  \}
 .\" .  el \{\
 .\" .          En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .\" .  \}
 .\" .  el \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              nr cF \\n(.f
 .              nr cZ \\n(.s
 .              ie \\n(rS==0 \{\
 .              nr cF \\n(.f
 .              nr cZ \\n(.s
 .              ie \\n(rS==0 \{\
 .       ie \\n(.$==0 .tm Usage: .%V Volume , ... \\*(Pu (#\\n(.c)
 .      el \{\
 .              ds mN %V
 .       ie \\n(.$==0 .tm Usage: .%V Volume , ... \\*(Pu (#\\n(.c)
 .      el \{\
 .              ds mN %V
-.              nr vK+1
-.              nr Kl+1
+.              nr vK \\n(vK+1
+.              nr Kl \\n(Kl+1
 .              ds rS vK
 .              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
 .              ds rS vK
 .              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 .      \}
 .\}
 .if \\n(aC>\\n(aP \{\
-.      nr aP+1
+.      nr aP \\n(aP+1
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .       nr cF \\n(.f
 .      nr cZ \\n(.s
 .       rR
 .              rD
 .      \}
 .      el \{\
 .              rD
 .      \}
 .      el \{\
-.              nr aP+1
+.              nr aP \\n(aP+1
 .              as b1 \&\\*(S\\n(jN
 .              rR
 .      \}
 .              as b1 \&\\*(S\\n(jN
 .              rR
 .      \}
@@ -2898,19 +3353,63 @@ File:
 .fz \\n(cZ
 .Pp
 ..
 .fz \\n(cZ
 .Pp
 ..
-.\" NS An macro - author name (for AUTHOR section only)
+.\" NS An macro - author name
 .\" NS aN register
 .nr aN 0
 .de An
 .\" NS aN register
 .nr aN 0
 .de An
-.ie \\n(aN==1 \{\
-.      br
+.if \\n(nY==1 \{\
+.      ie \\n(aN==1 \{\
+.              br
+.      \}
+.      el \{\
+.              nr aN 1
+.      \}
 .\}
 .\}
-.el \{\
-.      nr aN 1
+.if \\n(aC==0 \{\
+.       ie \\n(.$==0 .tm Usage: .An author_name ... \\*(Pu (#\\n(.c)
+.      el \{\
+.              ds mN An
+.              aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
+.      \}
+.\}
+.if \\n(aC>\\n(aP \{\
+.      nr aP \\n(aP+1
+.       nr cF \\n(.f
+.      nr cZ \\n(.s
+.       nR
 .\}
 .\}
-\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
 ..
 .\" NS Sf macro -defunct
 .de Sf
 .tm .Sf defunct, use prefix or Ns
 ..
 ..
 .\" NS Sf macro -defunct
 .de Sf
 .tm .Sf defunct, use prefix or Ns
 ..
+.ds rV "function returns the value 0 if successful; otherwise the value -1 is returned and the global variable \\*(vAerrno\fP is set to indicate the error.
+.\" Ns Rv macro - return values
+.\" Ns rV string - standard return message
+.de Rv
+.ie \\n(.$==0 \{\
+.tm Usage: .Rv [-std] (#\\n(.c)
+.\}
+.el \{\
+.      ds mN Rv
+.\" .  nr aP 0
+.\" .  nr lR \\n(lR+1
+.\" .  ds A1 \\$2
+.\" .  ds A2 \\$3
+.\" .  ds A3 \\$4
+.\" .  ds A4 \\$5
+.\" .  ds A5 \\$6
+.\" .  ds A6 \\$7
+.\" .  ds A7 \\$8
+.\" .  ds A8 \\$9
+.\" .  nr fV \\n(.$-1
+.      if "\\$1"-std" \{\
+.      nr cH \\*(cH
+.      if (\\n(cH<2):(\\n(cH>3) .tm Usage: .Rv -std sections 2 and 3 only
+.              br
+\&The
+.Fn \\$2
+\&\\*(rV
+.      \}
+.\}
+..