xref: /original-bsd/share/tmac/doc (revision c3e32dec)
Copyright (c) 1991, 1993
The Regents of the University of California. All rights reserved.

%sccs.include.redist.man%

@(#)doc 8.1 (Berkeley) 06/08/93

.mdoc-parse - attempt to parse troff request arguments
%beginstrip%
.cp 0 .\} . so /usr/share/tmac/tmac.doc-ditroff .\} . so /usr/share/tmac/tmac.doc-nroff .\} .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))
.nr Db 0 . ie \\n(Db==0 \{\ .tm DEBUGGING ON . nr Db 1 . \} . el \{\ .tm DEBUGGING OFF . nr Db 0 . \} .\} . if "\\$1"on" \{\ .tm DEBUGGING ON . nr Db 1 . \} . if "\\$1"off" \{\ .tm DEBUGGING OFF . nr Db 0 . \} .\} .. NS aV macro - parse argument vector (recursive) (.aV arg ... )
NS fV macro - parse argument vector (recursive) (.fV)
NS aC register argument counter (aV/fV)
NS fV register argument counter (must set to \\n(.$ prior to reuqest) (fV)
NS A[0-9] argument vector (aV/fV)
NS C[0-9] reg. arg type(1=macro, 2=arg, 3=punct-suf, 4=punct-pre) (aV/fV)
NS S[0-9] space vector (sV)
NS aP register argument pointer (aV)
NS yU local string used for debugging
NS iI local register (indent for inline debug mode)
NS mN name of calling request (set in each user requestable macro)
.nr aC \\n(aC+1 . if "\\*(mN"Op" .ds A\\n(aC \\$1 . if "\\*(mN"Ar" .ds A\\n(aC \\$1 . if "\\*(mN"Fl" .ds A\\n(aC \\$1 . if "\\*(mN"Cm" .ds A\\n(aC \\$1 . if "\\*(mN"It" .ds A\\n(aC \\$1 .\} .aU \\n(aC .nr C\\n(aC \\n(aT .s\\n(aT . if \\n(aT==1 .ds yU Executable . if \\n(aT==2 .ds yU String . if \\n(aT==3 .ds yU Closing Punctuation or suffix . if \\n(aT==4 .ds yU Opening Punctuation or prefix . if \\n(iN==1 \{\ . br . nr iI \\n(.iu . in -\\n(iIu . if \\n(aC==1 \{\ \fBDEBUG(argv) MACRO: `.\\*(mN' Line #: \\n(.c . \} \tArgc: \\n(aC Argv: `\\*(A\\n(aC' Length: \\n(sW \tSpace: `\\*(S\\n(aC' Class: \\*(yU . \} . if \\n(iN==0 \{\ . if \\n(aC==1 \{\ . tm DEBUG(argv) MACRO: `.\\*(mN' Line #: \\n(.c . \} . tm \tArgc: \\n(aC Argv: `\\*(A\\n(aC' Length: \\n(sW . tm \tSpace: `\\*(S\\n(aC' Class: \\*(yU . \} .\} . nr aP 0 . ie \\n(dZ==1 \{\ . if \\n(oM>1 .as b1 \\*(S0 . \} . el \{\ . if \\n(oM>0 \{\ . if \\n(fC==0 .as b1 \\*(S0 . \} . \} . ds S0 \\*(S\\n(aC . if \\n(Db \{\ . if \\n(iN==1 \{\ MACRO REQUEST: \t.\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9 . br . in \\n(iIu . \} . if \\n(iN==0 \{\ .tm \tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9 . \} . \} .\} .. .nr aC \\n(aC+1 . if "\\*(mN"Op" .ds A\\n(aC \\*(A\\n(aC . if "\\*(mN"Ar" .ds A\\n(aC \\*(A\\n(aC . if "\\*(mN"Fl" .ds A\\n(aC \\*(A\\n(aC . if "\\*(mN"Cm" .ds A\\n(aC \\*(A\\n(aC . if "\\*(mN"It" .ds A\\n(aC \\*(A\\n(aC .\} .aU \\n(aC .nr C\\n(aC \\n(aT .s\\n(aT . if \\n(aT==1 .ds yU Executable . if \\n(aT==2 .ds yU String . if \\n(aT==3 .ds yU Closing Punctuation or suffix . if \\n(aT==4 .ds yU Opening Punctuation or prefix . if \\n(iN==1 \{\ . br . nr iI \\n(.iu . in -\\n(iIu . if \\n(aC==1 \{\ \fBDEBUG(fargv) MACRO: `.\\*(mN' Line #: \\n(.c . \} \tArgc: \\n(aC Argv: `\\*(A\\n(aC' Length: \\n(sW \tSpace: `\\*(S\\n(aC' Class: \\*(yU . \} . if \\n(iN==0 \{\ . if \\n(aC==1 \{\ . tm DEBUG(fargv) MACRO: `.\\*(mN' Line #: \\n(.c . \} . tm \tArgc: \\n(aC Argv: `\\*(A\\n(aC' Length: \\n(sW . tm \tSpace: `\\*(S\\n(aC' Class: \\*(yU . \} .\} . nr aP 0 . ie \\n(dZ==1 \{\ . if \\n(oM>1 .as b1 \\*(S0 . \} . el \{\ . if \\n(oM>0 \{\ . if \\n(fC==0 .as b1 \\*(S0 . \} . \} . ds S0 \\*(S\\n(aC . nr fV 0 . if \\n(Db \{\ . ie \\n(iN \{\ \tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9 . br . in \\n(iIu . \} . el \{\ .tm \tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9 . \} . \} .\} . nr fV \\n(fV-1 . fV .\} .. NS aX macro - stuff saved strings into `b1' (used by -diag list)
.nr aP \\n(aP+1 .as b1 \\*(A\\n(aP . nr aP 0 . nr fV 0 .\} . as b1 \\*(sV . nr fV \\n(fV-1 . aX .\} .. NS aI macro - append arg to arg vector: .aI [arg] [type] (used by .En only)
. nr aC \\n(aC+1 . ds A\\n(aC \\$1 . nr C\\n(aC \\$2 . s\\$2 . ds xV S\\n(aC .\} . tm Usage: Too many arguments (maximum of 8 accepted) (#\\n(.c) . tm \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9 .\} ..
NS aZ macro - print buffer (pB) and clean up arg vectors (aY)
.pB .aY .. NS aY macro - clean up arg vector
.nr aC 0 .nr aP 0 .. NS pB macro - test for end of vector (eol) (print b1 buffer or divert)
. if \\n(oM==1 \{\\*(b1 . rm S0 . ds b1 . \} . if \\n(oM==0 \{\ . x2 . \} .\} . ie \\n(oM==0 \{\\*(b1 . rm S0 . ds b1 . \} . el \{\ . if ((\\n(sM==1)&(\\n(tP==0)) \{\ . x1 . \} . \} .\} .. NS x1 macro - save buffer and divert if tP flag set
NS eB diversion string
NS b2 string save of buffer
NS lK register count of lines read from input file
.nr dZ \\n(dZ+1 .nr lK \\n(.c .ev 2 .di eB ..
NS x2 macro - end diversion and print
NS b0 string local temporary

.di .ev . ds b0 \\*(eB\\ . ds b1 \\*(b2\\*(b0\\*(b1 .\} \\*(b1 .nr dZ \\n(dZ-1 .. NS Fl macro - flags (appends - and prints flags)
NS cF register save current font
NS cZ register save current font size
.as b1 \\*(fL . ie \\n(.$==0 \{\ . as b1 \|-\|\s0 . pB . \} . el \{\ . ds mN Fl . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . ie (\\n(aC-\\n(aP)==0 \{\ . as b1 \|-\s0 . aZ . \} . el \{\ . nr aP \\n(aP+1 . ie \\n(C\\n(aP==1 \{\ . as b1 \|-\s0 . \\*(A\\n(aP . \} . el \{\ . nr cF \\n(.f . nr cZ \\n(.s . if \\n(C\\n(aP==3 \{\ . as b1 \|-\| . \} . fR . \} . \} .\} ..
NS fR macro - Fl flag recursion routine (special handling)
NS jM local register
NS jN local register

.nr jM \\n(C\\n(aP . as b1 \fP\s0 . \\*(A\\n(aP .\} . nr jN \\n(aP . ie \\n(jM==2 \{\ . ie !"\\*(A\\n(aP"\\*(Ba" \{\ . ie !"\\*(A\\n(aP"|" \{\ . 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\s0 . ie \\n(aC==\\n(aP \{\ . if \\n(jM==4 .as b1 \|- . as b1 \fP\s0 . aZ . \} . el \{\ . 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 . \} .\} .rr jM jN ..
NS nR macro - general name recursion routine
NS jM local register
NS jN local register
.nr jM \\n(C\\n(aP . as b1 \f\\n(cF\s\\n(cZ . \\*(A\\n(aP .\} . nr jN \\n(aP . ie \\n(jM==2 .as b1 \\*(A\\n(aP . el .as b1 \f\\n(cF\s\\n(cZ\\*(A\\n(aP\s0 . ie \\n(aC==\\n(aP \{\ . as b1 \f\\n(cF\s\\n(cZ . aZ . \} . el \{\ . nr aP \\n(aP+1 . as b1 \\*(S\\n(jN . nR . \} .\} .rr jM jN .. NS Ar macro - command line `argument' macro

.as b1 \\*(aR . ie \\n(.$==0 \{\ . as b1 file ...\s0 . pB . \} . el \{\ . ds mN Ar . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . ie (\\n(aC-\\n(aP)==0 \{\ . as b1 file ...\s0 . aZ . \} . el \{\ . nr aP \\n(aP+1 . ie \\n(C\\n(aP==1 \{\ . as b1 file ...\s0 . \\*(A\\n(aP . \} . el \{\ . nr cF \\n(.f . nr cZ \\n(.s . if \\n(C\\n(aP==3 \{\ . as b1 file ... . \} . nR . \} . \} .\} .. NS Ad macro - Addresses
. ie \\n(.$==0 .tm Usage: .Ad address ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Ad . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(aD . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Cd macro - Config declaration (for section 4 SYNOPSIS) (not callable)
needs work - not very translatable
. ie \\n(.$==0 .tm Usage: .Cd Configuration file declaration (#\\n(.c) . el \{\ . ds mN Cd . 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 . \} .\}

. as b1 \\*(nM . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . ie \\n(nS \{\ . if "\\*(mN"Cd" \{\ . rs . ie \\n(nS>1 .br . el \{\ . if \\n(iS==0 .nr iS \\n(Dsu . \} . in +\\n(iSu . ti -\\n(iSu . nr nS \\n(nS+1 . \} . nR . in -\\n(iSu . \} . el .nR .\} .. NS Cm macro - Interactive command modifier (flag)
. ie \\n(.$==0 .tm Usage: .Cm Interactive command modifier ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Cm . 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 . \} .\} . as b1 \\*(cM . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Dv macro - define variable
. ie \\n(.$==0 .tm Usage: .Dv define_variable ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Dv . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(eR . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Em macro - Emphasis
. ie \\n(.$==0 \{\ . tm Usage: .Em text ... \\*(Pu (#\\n(.c) . \} . el \{\ . ds mN Em . 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 . \} .\} . as b1 \\*(eM . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Er macro - Errnotype
. ie \\n(.$==0 .tm Usage: .Er ERRNOTYPE ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Er . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(eR . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Ev macro - Environment variable
. ie \\n(.$==0 .tm Usage: .Ev ENVIRONMENT_VARIABLE ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Ev . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(eV . nr aP \\n(aP+1 . 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 fY register subroutine count (in synopsis only) (fortran only)
NS fZ register also subroutine count (in synopsis only)
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 . rs . \} . el .br . \} . nr fD \\n(fD+1 .\} .nr cF \\n(.f .nr cZ \\n(.s \\*(fD\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9

.fs \\n(cZ .. NS Fr macro - function return value - not callable (at the moment)
. ie \\n(.$==0 .tm Usage: .Fr Function_return_value... \\*(Pu (#\\n(.c) . el \{\ . ds mN Fr . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(aR . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Ic macro - Interactive command
. ie \\n(.$==0 .tm Usage: .Ic Interactive command ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Ic . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(iC . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Li macro - literals
. ie \\n(.$==0 .tm Usage .Li argument ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Li . 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 . \} .\} . as b1 \\*(lI . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Or macro - Pipe symbol (OR)
. ie \\n(.$==0 .tm Usage: .Or ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Or . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(iC . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Ms macro - Math symbol
. ie \\n(.$==0 .tm Usage: .Ms Math symbol ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Ms . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(sY . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Nm macro - Name of command or page topic
NS n1 string - save first invocation of .Nm
NS iS register - indent second command line in a synopsis
. ie \\n(.$==0 \{\ . ie "\\*(n1"" .tm Usage: .Nm Name(s) ... \\*(Pu (#\\n(.c) . el \\*(nM\\*(n1\s0 . \} . el \{\ . ds mN Nm . 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 . \} .\} . ie \\n(aC==\\n(aP \{\ . as b1 \\*(nM\\*(n1\s0 . aZ . \} . el \{\ . as b1 \\*(nM . nr aP \\n(aP+1 . ie \\n(C\\n(aP==1 \{\ . as b1 \\*(n1\s0 . \\*(A\\n(aP . \} . el \{\ . nr cF \\n(.f . nr cZ \\n(.s . if \\n(nS \{\ . if "\\*(mN"Nm" \{\ . rs . in -\\n(iSu . ie \\n(nS>1 .br . el \{\ . if \\n(iS==0 \{\ . sw \\$1 . nr iS ((\\n(sWu+1)*\\n(fW)u . \} . \} . in +\\n(iSu . ti -\\n(iSu . nr nS \\n(nS+1 . \} . \} . if "\\*(n1"" .ds n1 \\*(A\\n(aP . nR . \} . \} .\} .. NS Pa macro - Pathname
. ie \\n(.$==0 \\*(pA~\s0 . el \{\ . ds mN Pa . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(pA . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Sy macro - Symbolics
. ie \\n(.$==0 .tm Usage: .Sy symbolic_text ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Sy . 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 . \} .\} . as b1 \\*(sY . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Tn macro - Trade Name Macro
. ie \\n(.$==0 .tm Usage: .Tn Trade_name(s) ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Tn . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(tN\\*(tF . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS nN macro - Trade Name Macro for inside of reference
. ie \\n(.$==0 .tm Usage: .Tn Trade_name(s) ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Tn . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(tN . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS Va macro - variable name macro
. ie \\n(.$==0 .tm Usage: .Va variable_name(s) ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Va . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . as b1 \\*(vA . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} ..
NS No macro - Normal text macro (default text style if mess up)
.as b1 \\*(nO . ie \\n(.$==0 .tm Usage: .No must be called with arguments (#\\n(.c) . el \{\ . ds mN No . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . nr aP \\n(aP+1 . ie \\n(C\\n(aP==1 \{\ . \\*(A\\n(aP . \} . el \{\ . nr cF \\n(.f . nr cZ \\n(.s . nR . \} .\} .. ------------------------------------------------------------------------
NS Op macro - Option Expression
. ds mN Op .\} .ds qL \\*(lO
.ds qR \\*(rO
.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 .. NS Aq macro - Enclose string in angle brackets
.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Bq macro - Enclose string in square brackets
.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Dq macro - Enclose string in double quotes
.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Eq macro - Enclose string in double quotes
.En \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Pq macro - Enclose string in parenthesis
.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Ql macro - Quoted literal is in file mdoc-[dit|n|g]roff (too large
an if-else to carry along recursively for `if n ...')

NS Sq macro - Enclose string in single quotes
.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Sq macro - Enclose string in single quotes
.En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ..
NS Es macro - Set up strings for .En call
. ie \\n(.$>2 .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . el \{\ . ds qL \\$1 . ds qR \\$2 . \} .\} . nr aP \\n(aP+1 . ds qL \\*(A\\n(aP . nr aP \\n(aP+1 . ds qR \\*(A\\n(aP . ie \\n(aC>\\n(aP .c\\n(C\\n(aP . el .aZ .\} .. .tm En beg arg(A[\\n(aP])==\\*(A\\n(aP;
.tm En oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC
NS En macro - Enclose string with given args (eg [ and ] etc)
NS qL string variable set by calling macro
NS qR string variable set by calling macro
NS aJ register (for vR)
. ie \\n(.$==0 \{\ . as b1 \\*(qL\\*(qR . pB . \} . el \{\ . as mN (En)
. aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . as b1 \\*(qL . \} .\} . as b1 \\*(qL .\} . ie (\\n(aC-\\n(aP)==0 \{\ . as b1 \\*(qR . aZ . \} . el \{\ . ie \\n(C\\n(aC==3 \{\ . nr aJ \\n(aC-1 . vR . nr aJ \\n(aJ+1 . ds A\\n(aJ \\*(qR\\*(A\\n(aJ . nr aJ 0 . \} . el .aI \\*(qR 3 . nr aP \\n(aP+1 . if \\n(C\\n(aP==1 .\\*(A\\n(aP . if \\n(C\\n(aP>1 \{\ . nr aP \\n(aP-1 . No . \} . \} .\} .. NS vR macro - vector routine (for En, trace backwards past trail punct)
. nr aJ \\n(aJ-1 . vR .\} .. ------------------------------------------------------------------------
NS Ao macro - Angle open
.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Ac macro - Angle close
.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Bo macro - Bracket open
.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Bc macro - Bracket close
.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Do macro - Double Quote open
.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Dc macro - Double Quote close
.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Eo macro - Enclose open
.eO \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Ec macro - Enclose close
.eC \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Oo macro - Option open
.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Oc macro - Option close
.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Po macro - Parenthesis open
.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Pc macro - Parenthesis close
.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Qo macro - Straight Double Quote open
.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Qc macro - Straight Double Quote close
.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS So macro - Single Quote open
.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Sc macro - Single Quote close
.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Xo macro - Extend open (continue)
.nr mN 1
.eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS Xe macro - Extend close (end)
.nr mN 0
.eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS eO macro - enclose string open
NS oM register (extension possible)
.nr oM \\n(oM+1 .tm eO last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ;
. ie \\n(.$>0 \{\ . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . as b1 \\*(qL . \} . el \{\ . as b1 \\*(qL . if (\\n(dZ==0)&(\\n(sM==1) \{\ . nr dZ \\n(dZ+1 . ds b2 \\*(b1 . ds b1 . nr lK \\n(.c . ev 2 . fi . di eB . \} . \} .\} . as b1 \\*(qL .\} . if \\n(aC>\\n(aP \{\ . nr aP \\n(aP+1 . ie \\n(C\\n(aP==1 .\\*(A\\n(aP . el \{\ . nr aP \\n(aP-1 . No . \} . \} . if \\n(aC==\\n(aP \{\ . if \\n(tP==1 \{\ .tm SETTING Xt!!!
. nr Xt 1 . \} .\" . ds S0
CHANGED ds S0 \\*(iV
. aY . \} .\} . if \\n(oM>1 .as b1 \\*(sV .\} ..
NS eC macro - enclose string close
NS aa local register
.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 . ie \\n(.$>0 \{\ . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} . el \{\ . ie "\\*(xB"" \{\ . pB . \} . el \{\ . pB .\\*(L\\n(lC . nr Xt 0 . ds xB . \} . \} .\} . ie \\n(aC==\\n(aP \{\ . ie \\n(oM==0 \{\ . aZ . \} . el .aY . \} . 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 . if \\n(tP>0 \{\ tm UNSETTING Xt==\\n(Xt!!!!
. if \\n(Xt>0 .nr Xt \\n(Xt-1 tm NOW Xt==\\n(Xt!!!!
. \} . No . \} .\} .. ------------------------------------------------------------------------
NS Pf macro - Prefix (calls .pF)
.pF \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. NS pF macro - Prefix (for prefixing open quotes, brackets etc)
. as b1 \\*(qL . ie \\n(.$<2 \{\ . tm Warning: Missing arguments - prefix .Pf) . pB . \} . el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .\} . ie (\\n(aC-\\n(aP)>1 \{\ . nr aP \\n(aP+1 . as b1 \\*(A\\n(aP . \} . el .tm Warning: .Pf: trailing prefix (#\\n(.c) .\} . ie (\\n(aC-\\n(aP)==0 .aZ . el \{\ . nr aP \\n(aP+1 . c\\n(C\\n(aP . \} .\} .. NS Ns macro - remove space (space remove done by .aV or .fV)
. ds mN Ns . ie \\n(.$>0 .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . el .tm Usage: .Ns must be called with arguments (#\\n(.c) .\} .No .. . ds mN Ap . tm Usage: Ap "cannot be first request on a line (no .Ap)" (#\\n(.c) .\} .as b1 ' .No .. NS Hv macro - Hard (unpaddable) Space vector
NS iV string inter-vector space
NS sV string inter-argument space
.. NS Sv macro - Soft Space vector (troff limitation)
.. NS Tv macro - Tab Space vector
.. NS Sm macro - Space mode
NS sM register - default is one (space mode on)
.nr sM 1 . ie \\n(.$==0 .tm "Usage: .Sm [off | on]" (#\\n(.c) . el \{\ . ds mN Sm . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . nr aP \\n(aP+1 . if "\\*(A\\n(aP"on" \{\ . ds sV \\*(iV . nr sM 1 . \} . if "\\*(A\\n(aP"off" \{\ . ds sV . rm S0 S1 S2 S3 S4 S5 S6 S7 S8 S9 . nr sM 0 . \} . ie \\n(aC>\\n(aP \{\ . No . \} . el .aY .\} .. ------------------------------------------------------------------------
Size and Argument type macros
NS aT macro - argument type
NS aU macro - argument type (same as .aT but uses A[1-9] strings
NS aT register argument type
.nr aT 0 . nr aT 2 .\} . 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 . \} .\} .. .nr aT 0 .aW \\$1 . 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 . \} .\} .. .\} .nr aT 0 . nr aT 2 .\} . 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 . \} .\} .. .nr aT 0 .aW \\$1 . 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 . \} .\} .. .\} 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 s4 macro - set spacing for class type 4
NS S[0-9] string spacing
NS xX local register
NS aa local register
.tm MDOC-ERROR: bogus type 0 (can't set space '\\*(A\\n(aC') (#\\n(.c) .. . nr xX \\n(aC-1 . rm S\\n(xX . ds S\\n(aC \\*(sV .\} . 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 .\} .. .. . nr xX \\n(aC-1 . rm S\\n(xX .\} .. .nr aa 0 .. Class switches (on current argument aP)
NS c0 macro - catch errors (non-existent class type 0)
NS c1 macro - call request if type 1
NS c2 macro - call .No if type 2
NS c3 macro - call .No if type 3
NS c4 macro - call .No if type 4
.tm MDOC-ERROR: bogus class 0 (can't determine '\\*(A\\n(aC') (#\\n(.c) .. .\\*(A\\n(aP .. .nr aP \\n(aP-1 .No .. .nr aP \\n(aP-1 .No .. .nr aP \\n(aP-1 .No .. NS y1 macro - ignore if class 1
NS y2 macro - ignore if class 2
NS y3 macro - append if type 3
NS y4 macro - append if type 4
.nr aa 1 .. .nr aa 1 .. .as b1 \\*(A\\n(aP .nr aP \\n(aP+1 .n\\C\\n(aP .. .as b1 \\*(A\\n(aP .nr aP \\n(aP+1 .n\\C\\n(aP .. --------------------------------------------------------------------------
Ns Bf macro - Begin Font Mode (will be begin-mode/end-mode in groff & TeX)
Ns Ef macro - End Font Mode
. nr bF \\n(.f . nr bZ \\n(.s . 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 .\} .. .. Ns Bk macro - Begin Keep
Ns Ek macro - End Keep
Ns kS string - keep type
.tm Usage: .Bk [-lines | -words] (#\\n(.c) .\} . if !"\\*(kS"" .tm .Bk: nesting keeps not implemented yet. (#\\n(.c) . if "\\$1"-lines" .tm .Bd -lines: Not implemented yet. (#\\n(.c) . if "\\$1"-words" .Hv . ds kS \\$1 .\} .. . if "\\*(kS"-lines" .tm .Bd -lines: Not implemented yet. (#\\n(.c) . if "\\*(kS"-words" .Sv . rm kS .\} .. NS Bd macro - Begin Display display-type [offset string]
NS Ed macro - end Display
NS O[0-9] registers - stack of indent
NS d[0-9] registers - display-type stack
.tm Usage: .Bd [-literal | -filled | -ragged | -unfilled] [-offset [string]] [-compact] (#\\n(.c) .\} . ds aa . nr bV 0 . nr iD 0 . nr dP \\n(dP+1 . if "\\$1"-literal" \{\ . nr iD \\n(iD+1 . ds d\\n(dP dL . nr cF \\n(.f . nr cZ \\n(.s . ie t \{\\*(lI ' ta 9n 18n 27n 36n 45n 54n 63n 72n . \} . el \{\ ' ta 8n 16n 24n 32n 40n 48n 56n 64n 72n . \} . nf . \} . if "\\$1"-filled" \{\ . nr iD \\n(iD+1 . ds d\\n(dP dF . br . \} . if "\\$1"-ragged" \{\ . nr iD \\n(iD+1 . 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
. if ((\\n(iD>=1)&(\\n(.$>\\n(iD)) \{\ . bV \\$2 \\$3 \\$4 . \} . if \\n(O\\n(dP>0 'in \\n(.iu+\\n(O\\n(dPu . 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 . nr iD 0 .\} .. NS bV macro - resolve remaining .Bd arguments
.tm in bV with args: \\$1 \\$2 \\$3
.nr iD 1 . ds bY \\$2 . if "\\*(bY"left" \{\ . nr iD \\n(iD+1 . nr O\\n(dP 0 . \} . if "\\*(bY"right" \{\ . nr iD \\n(iD+1 . nr O\\n(dP (\\n(.l/3)u . \} . if "\\*(bY"center" \{\ . nr iD \\n(iD+1 . nr O\\n(dP (\\n(.l-\\n(.i)/4u . \} . if "\\*(bY"indent" \{\ . nr iD \\n(iD+1 . nr O\\n(dP \\n(dIu . \} . if "\\*(bY"indent-two" \{\ . nr iD \\n(iD+1 . nr O\\n(dP \\n(dIu+\\n(dIu . \} . if \\n(iD==1 \{\ . nr iD \\n(iD+1 . sW "\\*(bY" . ie \\n(sW>2 \{\ . ie ((\\*(bY>9n)&(\\*(bY<100n)) \{\ . nr O\\n(dP \\*(bY . \} . el .nr O\\n(dP (\\n(sW)*\\n(fWu . \} . el \{\ . if \\n(sW==2 .aT \\*(bY . ie \\n(aT==1 \{\ . nr O\\n(dP \\n(\\*(bY . \} . el .nr O\\n(dP \\*(bY . \} . \} .\} . nr bV 1 .\} . ie "\\*(bY"" \{\ . bV \\$2 \\$3 . \} . el \{\ . bV \\$3 . \} .\} .. NS Ed macro - end display

. ft \\n(cF . fz \\n(cZ .\} .rr O\\n(dP .nr dP \\n(dP-1

.. --------------------------------------------------------------------------
NS Bl macro - begin list (.Bl list-type)
NS L[0-9] registers - stack of list types
.tm Usage: .Bl [[-hang | -tag] [-width]] [ -item | -enum | -bullet | -diag] (#\\n(.c) .\} . ds mN Bl . nr aP 0 . nr lC \\n(lC+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"-hang" \{\ . nr aP \\n(aP+1 . ds L\\n(lC hL . nr w\\n(lC 6n . nr tC 1 . \} . if "\\$1"-tag" \{\ . nr aP \\n(aP+1 . ds L\\n(lC tL . nr tC 1 . \} . if "\\$1"-item" \{\ . nr aP \\n(aP+1 . ds L\\n(lC iT . nr tC 1 . \} . if "\\$1"-enum" \{\ . nr aP \\n(aP+1 . ds L\\n(lC nU . nr w\\n(lC 3n . nr tC 1 . \} . if "\\$1"-bullet" \{\ . nr aP \\n(aP+1 . ds L\\n(lC bU . nr w\\n(lC 2n . nr tC 1 . \} . if "\\$1"-dash" \{\ . 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" \{\ . nr aP \\n(aP+1 . ds L\\n(lC lL . nr tC 1 . \} . if "\\$1"-diag" \{\ . nr aP \\n(aP+1 . ds L\\n(lC mL . nr mL 1 . \} . if "\\$1"-ohang" \{\ . nr aP \\n(aP+1 . ds L\\n(lC oL . nr tC 1 . \} . if "\\$1"-column" \{\ . nr aP \\n(aP+1 . ds L\\n(lC cL . \} . ie \\n(aP==0 \{\ . tm \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . tm Usage: .Bl [[-inset|-tag] -width] [-item|-enum|-bullet|-diag] (#\\n(.c) . \} . el \{\ . tY . if (\\n(aP==1)&(\\n(aP<\\n(.$) \{\ . nr aP 0 . lV . if "\\*(L\\n(lC"cL" \{\ . W\\n(wV . nr w\\n(lC 0 ' in -\\n(eWu . ie \\n(v\\n(lC==1 \{\ . nr aa 0 . \} . el \{\ . sp \\n(dVu . \} . nf . nr wV 0 . \} . \} . \} . nr aP 0 . ds b1
. aY .tm Here is L[\\n(lC]==\\*(L\\n(lC
.\} .. . nr i 10 . while \ni<100 \{\ . nr num!\nin 1 . nr i +1 . \} .\} NS lV macro - resolve remaining .Bl arguments
.nr aP \\n(aP+1 . nr iD 0 . if "\\*(A\\n(aP"-compact" \{\ . nr iD 1 . nr v\\n(lC 1 . \} . if "\\*(A\\n(aP"-width" \{\ . nr iD 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 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 \{\ . aT \\*(tS . ie \\n(aT==1 \{\ . nr w\\n(lC \\n(\\*(tS . \} . el \{\ . nr w\\n(lC \\*(tSu . \} . \} . \} . if "\\*(A\\n(aP"-offset" \{\ . nr iD 1 . nr aP \\n(aP+1 . ie "\\*(A\\n(aP"indent" \{\ . nr o\\n(lC \\n(Dsu . \} . el \{\ . ds tS \\*(A\\n(aP . aW \\n(aP . ie \\n(sW>2 \{\ . 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 \{\ . ie \\n(C\\n(aP==1 .nr o\\n(lC \\n(\\*(tS . el .nr o\\n(lC \\*(tS . \} . \} . \} . if \\n(iD==0 \{\ . if "\\*(L\\n(lC"cL" \{\ . nr wV \\n(wV+1 . ds A\\n(wV \\*(A\\n(aP . \} . \} . if \\n(fV>\\n(aP .lV .\} .. NS El macro - end list
NS iD local register
. tm Usage: .El (#\\n(.c) .\} . ds mN El . nr iD 0 . if "\\*(L\\n(lC"cL" \{\ . nr iD 1 . cC . \} . if "\\*(L\\n(lC"nU" \{\ . nr nU 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 . nr lC \\n(lC-1 . tY . nr iD 1 . \} . if "\\*(L\\n(lC"oL" \{\ ' in \\n(.iu-\\n(o\\n(lCu . tZ . nr lC \\n(lC-1 . tY . nr iD 1 . \} . if "\\*(L\\n(lC"lL" \{\ ' in \\n(.iu-\\n(o\\n(lCu . tZ . nr lC \\n(lC-1 . tY . nr iD 1 . \} . if \\n(iD==0 \{\ . lE . \} . br . nr iD 0 .\} .. NS It macro - list item
NS iD local register
NS aA save pA font string for section FILES (no underline if nroff)
. tm Usage .Bl -list-type [-width [string] | -compact | -offset [string]] (#\\n(.c) . tm .It \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 .\} .tm Here is L[\\n(lC]==\\*(L\\n(lC
. ds mN It . ds b1 . nr iD 0 . 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(.$ . if "\\*(L\\n(lC"mL" \{\ . nr iD 1 . nr aP 0 . aX . \\*(L\\n(lC . \} . if "\\*(L\\n(lC"cL" \{\ . ds b1 . nr aP 0 . nr iD 1 . \\*(L\\n(lC . \} . if "\\*(L\\n(lC"iT" \{\ . nr aP 0 . nr iD 1 . \\*(L\\n(lC . \} . if \\n(iD==0 \{\ . fV 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 aP \\n(aP+1 . nr tX \\n(C\\n(aP . ds tX \\*(A\\n(aP . if \\n(nF==1 \{\ . ds aA \\*(pA . if n .ds pA \\*(nO . \} . ie \\n(C\\n(aP==1 \{\ . \\*(A\\n(aP . \} . el \{\ . nr aP \\n(aP-1 . 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 . \} . nr iD 0 .\} .. NS lL macro - .It item of list-type inset
.lY

\\*(b1 .nr oM \\n(oM-1 .nr tP 0 .aY 'fi .. NS hL macro - .It item of list-type hanging label (as opposed to tagged)
.lX .nr bb \\n(w\\n(lCu+\\n(lSu .nr oM \\n(oM-1 .nr tP 0 .aY 'fi .. NS oL macro - .It item of list-type overhanging label
.lY \\*(b1

.nr oM \\n(oM-1 .nr tP 0 .aY 'fi .. NS iT macro - .It item of list-type [empty label]
.lY

.ds b1
.aY 'fi .. NS nU macro - Enumerated list
NS nU register count
NS hU macro - Hyphen paragraph list (sub bullet list)
NS bU macro - Bullet paragraph list
.nr oM \\n(oM+1 .nr nU \\n(nU+1 .uL .. .nr oM \\n(oM+1 .nr bU \\n(bU+1 .uL .. .nr oM \\n(oM+1 .nr bU \\n(bU+1 .uL .. NS uL macro - .It item of list-type enum/bullet/hyphen
.lX .nr bb \\n(w\\n(lCu+\\n(lSu .nr oM \\n(oM-1 .nr dZ \\n(dZ+1
.nr tP 0 .aY 'fi .. NS mL macro - .It item of list-type diagnostic-message
.nr cF \\n(.f .nr cZ \\n(.s . nr zB \\n(.c . ie (\\n(zB-\\n(zA)>1 .Pp . el .br . nr zA \\n(zB . nr zB 0 .\} . nr zA \\n(.c . br .\} \\*(sY\\*(b1\f\\n(cF\s\\n(cZ\\*(lS\c .aY 'fi .. NS tL macro - .It item of list-type "tag"
tm in tL here is b1==\\*(b1
.lX .nr bb \\n(w\\n(lCu+\\n(lSu . br .\} . if n .ds pA \\*(aA .\} .nr oM \\n(oM-1 .nr tP 0 .nr dZ \\n(dZ+1
.aY 'fi .. NS lW macro - resolve unknown label/tag width (if .Bl [inset | tag] only)
. ie \\n(tX==1 \{\ . ds t\\n(lN \\*(tX . nr w\\n(lN \\n(\\*(tX . \} . el \{\ . ds t\\n(lN No . nr w\\n(lN \\n(No . \} . if !"\\*(t\\n(lC"\\*(t\\n(lN" .nr tC 1 .\} .. NS lX macro - set up vertical spacing (if compact) and offset+indent (all)
. nr tC 0 . nr tW 0 . if \\n(v\\n(lC==0 .sp \\n(dVu . in \\n(.iu+\\n(w\\n(lCu+\\n(o\\n(lCu+\\n(lSu .\} . ie \\n(v\\n(lC==1 \{\ . nr aa 0 . \} . el \{\ . sp \\n(dVu . \} .\} .. NS lY macro - set up vertical spacing (if compact) and offset+indent (all)
. nr tC 0 . nr tW 0 . if \\n(v\\n(lC==0 .sp \\n(dVu . in \\n(.iu+\\n(o\\n(lCu .\} . ie \\n(v\\n(lC==1 \{\ . nr aa 0 . \} . el \{\ . sp \\n(dVu . \} .\} .. NS tS temporary string
NS hL macro - hanging list function
NS tS temporary string
NS hL macro - hanging list function
NS lT macro - tagged list function
NS lE macro - list end function
NS tX string (initial string)
NS tX register (initial class)
NS tC parameter change flag
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 t[0-9] register tag string stack (nested tags)
NS o[0-9] register offset stack (nested tags)
NS v[0-9] register vertical tag break stack
NS h[0-9] register horizontal tag stack (continuous if 1, break if 0)
.nr lC 0 .nr wV 0 .nr w1 0 .nr o1 0 .nr v1 0 .nr h1 0 IN lC o[\\n(lC]==\\n(o\\n(lC, w[\\n(lC]==\\n(w\\n(lC,
' in \\n(.iu-(\\n(w\\n(lCu)-(\\n(o\\n(lCu)-\\n(lSu . rr o\\n(lC .\} .tZ .nr lC \\n(lC-1 .tY .. NS tY macro - set up next block for list
NS tZ macro - decrement stack
NS tY register (next possible lC value)
.nr tY (\\n(lC+1) .nr w\\n(tY 0 .nr h\\n(tY 0 .nr o\\n(tY 0 .nr v\\n(tY 0 .. .rr w\\n(tY .rr h\\n(tY .rr o\\n(tY .rr v\\n(tY .nr tY \\n(tY-1 .. initial values
.nr w1 0 .nr o1 0 .nr h1 0 .nr v1 0 .nr tY 1 NS Xr macro - cross reference (man page only)
. ie \\n(.$==0 .tm Usage: .Xr manpage_name [section#] \\*(Pu (#\\n(.c) . el \{\ . ds mN Xr . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . 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\s0 . if \\n(aC>\\n(aP \{\ . nr aP \\n(aP+1 . if \\n(C\\n(aP==2 \{\ . as b1 (\\*(A\\n(aP) . nr aP \\n(aP+1 . \} . if \\n(aC>=\\n(aP \{\ . c\\n(C\\n(aP . \} . \} . \} . aZ . \} .\} .. NS Sx macro - cross section reference
. ie \\n(.$==0 .tm Sx Usage: .Sx Section Header \\*(Pu (#\\n(.c) . el \{\ . ds mN Sx . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . nr aP \\n(aP+1 . as b1 \\*(sX . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS cC macro - column-list end-list
NS eW macro - column indent width
NS cI register - column indent width
NS W[1-5] macro - establish tabs for list-type column
'in \\n(.iu-\\n(o\\n(lCu-\\n(w\\n(lCu

.tZ .nr lC \\n(lC-1 .tY .. .nr eW \w\\*(A1 u 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu .. .nr eW \w\\*(A1 u+\w\\*(A2 u 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu .. .nr eW \w\\*(A1 u+\w\\*(A2 u+\w\\*(A3 u 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu .. .nr eW \w\\*(A1 u+\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu .. .nr eW \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u ' in \\n(.iu+\\n(eWu+\\n(o\\n(lCu .. This is packed abnormally close, intercol width should be an option
.nr eW \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u +\w\\*(A6 ' in \\n(.iu+\\n(eWu+\\n(o\\n(lCu .. NS cL macro - column items
. fi ' in \\n(.iu+\\n(eWu .\} .fV .nr aP \\n(aP+1 . if "\\*(A\\n(aP"Ta" \{\ . nr jJ \\n(aP-1 . rm S\\n(jJ . rr jJ . \} . c\\n(C\\n(aP .\} .. NS Ta macro - append tab (\t)
. nr aP \\n(aP+1 . ie \\n(aC>=\\n(aP \{\ . if "\\*(A\\n(aP"Ta" \{\ . nr jJ \\n(aP-1 . rm S\\n(jJ . rr jJ . \} . as b1 \\t . c\\n(C\\n(aP . \} . el \{\ . as b1 \\t\\c . rm S\\n(aP . pB . aY . ds b1
. \} .\} . tm Usage: Ta must follow column entry: e.g. (#\\n(.c) . tm .It column_string [Ta [column_string ...] ] .\} ..
NS Dl macro - display (one line) literal
'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i . ie \\n(.$==0 \{\ . tm Usage: .Dl argument ... (#\\n(.c) . \} . el \{\ . ds mN Dl . 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 . Li . \} .\} . tm Usage: .Dl not callable by other macros (#\\n(.c) .\} ..
NS D1 macro - display (one line)
'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i . ie \\n(.$==0 \{\ . tm Usage: .D1 argument ... (#\\n(.c) . \} . el \{\ . ds mN D1 . 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 aP \\n(aP+1 . ie \\n(C\\n(aP==1 .\\*(A\\n(aP . el .No . \} .\} . tm Usage: .D1 not callable by other macros (#\\n(.c) .\} .. NS Ex macro - DEFUNCT
.tm Ex defunct, Use .D1: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ..
NS Ex macro - DEFUNCT
.tm Ex defunct, Use .D1: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 ..
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
if a function declaration was the last thing given, want vertical space
. Pp . nr fD 0 .\} if a subroutine was the last thing given, want vertical space
. ie \\n(fX==0 \{\ . Pp . rs . \} . el .br .\} .nr fX \\n(fX+1 .nr cF \\n(.f .nr cZ \\n(.s \\*(fT\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .fs \\n(cZ ..
NS Ft macro - Function type
.nr fZ 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 fY 1 .\} .nr cF \\n(.f .nr cZ \\n(.s \\*(fT\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .fs \\n(cZ .br
..
NS Ot macro - Old Function type (fortran - no newline)
Ns oT register
.nr oT 0 .nr oT 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 .\} .as b1 \ ..
NS Fa macro - Function arguments
. ie \\n(.$==0 .tm Usage: .Fa Function Arguments ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Fa . 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 . \} .\} . fC .\} . 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
. 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\|,\\*(fA\\*(S\\n(aP\\*(A\\n(aP\s0 . \} . if \\n(fC==1 \{\ . as b1 \|\\*(fA\\*(A\\n(aP\s0 . \} . nr fC \\n(fC+1 . fC .\} . aY .\} .. NS Fn macro - functions
NS fY register - dick with old style function declarations (fortran)
NS fZ register - break a line when more than one function in a synopsis

. ie \\n(.$==0 .tm Usage: .Fn function_name function_arg(s) ... \\*(Pu (#\\n(.c) . el \{\ . ds mN Fn . 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 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 .\} . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . as b1 \\*(fN\\*(A\\n(aP\s0\\*(lp . ie \\n(aC>\\n(aP \{\ . as b1 \\*(fA . nr aP \\n(aP+1 . f\\n(C\\n(aP . \} . el \{\ . ie \\n(nS>0 .as b1 \|\\*(rp; . el .as b1 \|\\*(rp . aZ . \} . if \\n(nS>0 \{\ . in -\\n(iSu . \} .\} ..
NS f1 macro - class switch
NS f2 macro - handle function arguments
NS f3 macro - punctuation
NS f4 macro - write out function
.\\*(A\\n(aP .. . 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 . nr aa \\n(aP . nr aP \\n(aP+1 . if \\n(C\\n(aP==2 \{\ . as b1 \|\f\\n(cF\s\\n(cZ,\\*(S\\n(aa\s0\| . \} . f\\n(C\\n(aP .\} . ie \\n(nS>0 .as b1 \\*(rp;\f\\n(cF\s\\n(cZ . el .as b1 \\*(rp\f\\n(cF\s\\n(cZ . aZ .\} .. . No .\} .. . nr aP \\n(aP+1 . No .\} .. . 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 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 .\} . 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\s0\\*(lp . aY .\} .. . 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 . nr aP \\n(aP+1 . \\*(A\\n(aP .\} . aZ .\} . in -\\n(iSu .\} .. 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
.tm fB==\\n(fB, Fb==\\n(Fb, 1==\\$1 2==\\$2 3==\\$3 4==\\$4 5==\\$5 6==\\$6
. nr fB \\n(.$ . nr Fb 0 . ds Fb .\} .nr Fb \\n(Fb+1 .as Fb \\$1 . 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

Very crude references, stash all reference info into strings (usual
use of b1 buffer, then b1 contents copied to string of retrievable
naming convention), print out reference on .Re request and clean up.
Ordering very limited, no fancy citations, but can do articles, journals
and books - need to add several missing options (like city etc).
should be able to grab a refer entry, massage it a wee bit (prefix
a `.' to the %[A-Z]) and not worry (ha!)

NS Rs macro - Reference Start
NS rS register - Reference Start flag
NS rS string - Reference Start buffer name for next save (of b1 buffer)
.nr rS 1 .rC .nr Kl 0 .. NS Re macro - Reference End
.rZ .rC .nr rS 0 .. NS rC macro - reference cleanup
.nr uK 0 .nr jK 0 .nr iK 0 .nr nK 0 .nr oK 0 .nr qK 0 .nr rK 0 .nr tK 0 .nr vK 0 .nr dK 0 .nr pK 0 .nr bK 0 .. NS rZ macro - reference print
. nr aK 1 . if (\\n(uK>1 \{\ . aK . \} . nr Kl -\\n(uK .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \{\ . ie (\\n(jK==1):(\\n(bK==1) \{\\*q\\*(tK\\*q. . \} . el \{\\*(eM\\*(tK\\*(nO. . \} . \} . if \\n(Kl>0 \{\ . ie (\\n(jK==1):(\\n(bK==1) \{\\*q\\*(tK\\*q, . \} . el \{\\*(eM\\*(tK\\*(nO, . \} . \} .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \\*(eM\\*(bK\\*(nO. . if \\n(Kl>0 \\*(eM\\*(bK\\*(nO, .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \\*(eM\\*(iK\\*(nO. . if \\n(Kl>0 \\*(eM\\*(iK\\*(nO, .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \\*(eM\\*(jK\\*(nO. . if \\n(Kl>0 \\*(eM\\*(jK\\*(nO, .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \\*(rK. . if \\n(Kl>0 \\*(rK, .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \\*(nK. . if \\n(Kl>0 \\*(nK, .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \\*(vK. . if \\n(Kl>0 \\*(vK, .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \\*(pK. . if \\n(Kl>0 \\*(pK, .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \\*(qK. . if \\n(Kl>0 \\*(qK, .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \\*(dK. . if \\n(Kl>0 \\*(dK, .\} . nr Kl \\n(Kl-1 . if \\n(Kl==0 \\*(oK. . if \\n(Kl>0 \\*(oK, .\} .. NS aK macro - print out reference authors
.nr aK \\n(aK+1 .\} . aK .\} .. NS %A macro - reference author(s)
NS uK register - reference author(s) counter
NS U[1-9] strings - reference author(s) names
. ie \\n(.$==0 .tm Usage: .%A Author_name (#\\n(.c) . el \{\ . 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 . \} .\} . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS %B macro - [reference] Book Name
NS bK string - Book Name
NS bK register - Book Name flag
. ie \\n(.$==0 .tm Usage: .%B Book Name (#\\n(.c) . el \{\ . ds mN %B . 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 A4 \\$4 . ds A5 \\$5 . ds A6 \\$6 . ds A7 \\$7 . ds A8 \\$8 . ds A9 \\$9 . nr fV \\n(.$ . fV . \} .\} . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . ie \\n(rS==0 \{\ . as b1 \\*(eM . nR . \} . el .rR .\} .. NS %D macro - [reference] Date
NS dK string - Date String
NS dK register - Date flag
. ie \\n(.$==0 .tm Usage: .%D Date (#\\n(.c) . el \{\ . ds mN %D . nr dK \\n(dK+1 . nr Kl \\n(Kl+1 . ds rS dK . 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 aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS %I macro - [reference] Issuer/Publisher Name
NS jK register - [reference] Issuer/Publisher Name flag
NS jK string - [reference] Issuer/Publisher Name
. ie \\n(.$==0 .tm Usage: .%I Issuer/Publisher Name (#\\n(.c) . el \{\ . ds mN %I . nr iK \\n(iK+1 . ds rS iK . nr Kl \\n(Kl+1 . 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 aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS %J macro - [reference] Journal Name
NS jK register - [reference] Journal Name flag
NS jK string - [reference] Journal Name
. ie \\n(.$==0 .tm Usage: .%J Journal Name (#\\n(.c) . el \{\ . ds mN %J . nr jK \\n(jK+1 . ds rS jK . nr Kl \\n(Kl+1 . 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 aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS %N macro - [reference] issue number
NS nK register - [reference] issue number flag
NS nK string - [reference] issue number
. ie \\n(.$==0 .tm Usage: .%N issue number (#\\n(.c) . el \{\ . 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 . \} .\} . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS %O macro - [reference] optional information
NS oK register - [reference] optional information flag
NS oK string - [reference] optional information
. ie \\n(.$==0 .tm Usage: .%O optional information ... \\*(Pu (#\\n(.c) . el \{\ . ds mN %O . nr oK \\n(oK+1 . nr Kl \\n(Kl+1 . ds rS oK . 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 aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS %P macro - [reference] page numbers
NS pK register - [reference] page number flag
NS pK string - [reference] page number
. ie \\n(.$==0 .tm Usage: .%P page numbers ... \\*(Pu (#\\n(.c) . el \{\ . ds mN %P . nr pK \\n(pK+1 . nr Kl \\n(Kl+1 . ds rS pK . 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 aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS %Q macro - Corporate or Foreign Author
NS qK string - Corporate or Foreign Author
NS qK register - Corporate or Foreign Author flag
. ie \\n(.$==0 .tm Usage: .%Q Corporate or Foreign Author (#\\n(.c) . el \{\ . ds mN %Q . nr qK \\n(qK+1 . nr Kl \\n(Kl+1 . ds rS qK . 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 aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS %R macro - [reference] report name
NS rK string - [reference] report name
NS rK register - [reference] report flag
. ie \\n(.$==0 .tm Usage: .%R reference report (#\\n(.c) . el \{\ . ds mN %R . nr rK \\n(rK+1 . nr Kl \\n(Kl+1 . ds rS rK . 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 aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS %T macro - reference title
NS tK string - reference title
NS tK register - reference title flag
. ie \\n(.$==0 .tm Usage: .%T (#\\n(.c) . el \{\ . ds mN %T . if \\n(rS>0 \{\ . nr tK \\n(tK+1 . nr Kl \\n(Kl+1 . ds rS tK . \} . 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 . \} .\} . ie \\n(jS==1 \{\
. nr cF \\n(.f
. nr cZ \\n(.s
. ds qL \\*(Lq\\*(rA
. ds qR \\*(Rq\f\\n(cF\s\\n(cZ
. En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
. \}
. el \{\
. nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . ie \\n(rS==0 \{\ . as b1 \\*(eM . nR . \} . el .rR . \}
.\} .. NS %V macro - reference volume
NS vK string - reference volume
NS vK register - reference volume flag
. ie \\n(.$==0 .tm Usage: .%V Volume , ... \\*(Pu (#\\n(.c) . el \{\ . ds mN %V . nr vK \\n(vK+1 . nr Kl \\n(Kl+1 . ds rS vK . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} .\} . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . rR .\} .. NS rR macro - reference recursion routine
NS jM local register
NS jN local register
.nr jM \\n(C\\n(aP . as b1 \f\\n(cF\s\\n(cZ
. ie "\\*(A\\n(aP"Tn" \{\ . nN . \} . el \{\ . if \\n(aC>8 .tm Usage: \\*(mN - maximum 8 arguments (#\\n(.c) . aI rR 1 . \\*(A\\n(aP . \} .\} . nr jN \\n(aP . ie \\n(jM==2 .as b1 \\*(A\\n(aP . el .as b1 \\*(A\\n(aP . el .as b1 \f\\n(cF\s\\n(cZ\\*(A\\n(aP\s0
. ie \\n(aC==\\n(aP \{\ . as b1 \f\\n(cF\s\\n(cZ
. rD . \} . el \{\ . nr aP \\n(aP+1 . as b1 \\*(S\\n(jN . rR . \} .\} .rr jM jN .. NS rD macro - save b1 buffer in to appropriate name
.as \\*(rS \\*(b1 .aY .. NS Hf macro - source include header files.

p File:

a \\$1

p .nr cF \\n(.f .nr cZ \\n(.s \\*(lI

.\} .\}

.so  \\$1
.fz \\n(cZ

p .. NS An macro - author name
NS aN register
.nr aN 0 . ie \\n(aN==1 \{\ . br . \} . el \{\ . nr aN 1 . \} .\} . 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 . \} .\} . nr aP \\n(aP+1 . nr cF \\n(.f . nr cZ \\n(.s . nR .\} .. NS Sf macro -defunct
.tm .Sf defunct, use prefix or Ns .. Ns Rv macro - return values
Ns rV string - standard return message
.tm Usage: .Rv [-std] (#\\n(.c) .\} . 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 . \} .\} ..