summaryrefslogtreecommitdiff
path: root/tmac
diff options
context:
space:
mode:
authorwl <wl>2011-01-28 10:04:45 +0000
committerwl <wl>2011-01-28 10:04:45 +0000
commita1b5588bb0be6f77f9e44cd34332e996f66c3f1a (patch)
tree16fe538c72872985f645411b3ed2b084a73cd76a /tmac
parent093780c79fd279976d508613712cd7c2060e2f2c (diff)
downloadgroff-a1b5588bb0be6f77f9e44cd34332e996f66c3f1a.tar.gz
Add `refer' support to -me.
* tmac/refer.tmac, tmac/refer-me.tmac, tmac/refer-ms.tmac, tmac/refer-mm.tmac: New files. The code in refer.tmac is based on the old code from `s.tmac'. * tmac/s.tmac: Remove direct refer support and include `refer-ms.tmac' instead. * tmac/e.tmac: Remove direct refer support and include `refer-me.tmac' instead. * NEWS: Updated.
Diffstat (limited to 'tmac')
-rw-r--r--tmac/e.tmac112
-rw-r--r--tmac/refer-me.tmac99
-rw-r--r--tmac/refer-mm.tmac106
-rw-r--r--tmac/refer-ms.tmac86
-rw-r--r--tmac/refer.tmac343
-rw-r--r--tmac/s.tmac152
6 files changed, 636 insertions, 262 deletions
diff --git a/tmac/e.tmac b/tmac/e.tmac
index 88339949..a5bfaabb 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -1189,117 +1189,7 @@
.\"
.\" REFER
.\"
-.de ][ \" *** refer output
-.if \\$1>5 .tm Bad arg to []
-.[\\$1
-..
-.
-.de [0 \" --- other
-.(f
-.ip "\\*([F.\0"
-.if !"\\*([A"" \\*([A,
-.if !"\\*([T"" \\f2\\*([T\\f1\c
-.if !"\\*([T"" .if !"\\*([O"" ,\ \"
-.ie !"\\*([O"" \\*([O
-.el .if !"\\*([T"" \&.
-.if !"\\*([D"" \\*([D.
-.@p
-.)f
-..
-.
-.de [1 \" --- journal article
-.(f
-.ip "\\*([F.\0"
-\\*([A,
-.if !"\\*([T"" \\*(lq\\*([T,\\*(rq
-.if "\\*([V"" \\f2\\*([J\\f1,
-.if !"\\*([V"" \\f2\\*([J\\f1
-.if !"\\*([V"" \\f3\\*([V\\f1\c
-.if !"\\*([N"" (\\*([N)\c
-.if !"\\*([P"" \
-\{\
-. ie \\n([P>0 \ pp.\&
-. el \ p.\&
-\\*([P
-.\}
-.if !"\\*([I"" .if "\\*([R"" \\*([I,
-(\\*([D).
-.if !"\\*([O"" \\*([O
-.)f
-..
-.
-.de [2 \" --- book
-.(f
-.ip "\\*([F.\0"
-\\*([A, \\f2\\*([T,\\f1
-\\*([I\c
-.if !"\\*([C"" , \\*([C\c
- (\\*([D).
-.if !"\\*([G"" Gov't. ordering no. \\*([G
-.if !"\\*([O"" \\*([O
-.)f
-..
-.
-.de [3 \" --- article in book
-.(f
-.ip "\\*([F.\0"
-\\*([A, \\*(lq\\*([T,\\*(rq
-.if !"\\*([P"" pp. \\*([P
-in \\f2\\*([B\\f1, \c
-.if !"\\*([E"" ed. \\*([E, \c
-.if !"\\*([I"" \\*([I\c
-.if !"\\*([C"" , \\*([C\c
- (\\*([D).
-.if !"\\*([O"" \\*([O
-.)f
-..
-.
-.de [4 \" --- report
-.(f
-.ip "\\*([F.\0"
-\\*([A, \\*(lq\\*([T,\\*(rq
-\\*([R\c
-.if !"\\*([G"" \& (\\*([G)\c
-.if !"\\*([I"" , \\*([I\c
-.if !"\\*([C"" , \\*([C\c
- (\\*([D).
-.if !"\\*([O"" \\*([O
-.)f
-..
-.
-.de [5 \" --- tm style
-.(f
-.ip "\\*([F.\0"
-\\*([A, \\f2\\*([T\\f1,
-.ie \\n(TN \\*([M.
-.el Bell Laboratories internal memorandum (\\*([D).
-.)f
-..
-.
-.de ]<
-.$p References
-.lp
-.rm (f )f
-..
-.
-.de ]>
-.sp
-..
-.
-.de ]-
-.rm [V [P [A [T [N [C [B [O [R [I [E [D
-..
-.
-.ie \n(.V<1v \
-\{\
-. ds [. \s-2\v'-.4m'\f1
-. ds .] \v'.4m'\s+2\fP
-.\}
-.el \
-\{\
-. ds [. " [
-. ds .] ]
-.\}
+.mso refer-me.tmac
.
.\"
.\" IDEAL
diff --git a/tmac/refer-me.tmac b/tmac/refer-me.tmac
new file mode 100644
index 00000000..e86dee45
--- /dev/null
+++ b/tmac/refer-me.tmac
@@ -0,0 +1,99 @@
+.\" -*- mode: nroff; coding: iso-latin-1; -*-
+.\"
+.\" refer-me.tmac
+.\"
+.\" Refer support for me macros.
+.\"
+.\" Copyright (C) 2011 Free Software Foundation, Inc.
+.\" Written by Werner Lemberg (wl@gnu.org)
+.\"
+.\" This file is part of groff.
+.\"
+.\" groff is free software; you can redistribute it and/or modify it under
+.\" the terms of the GNU General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
+.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+.\" for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Please send comments to groff@gnu.org.
+.
+.
+.als ref*error tm
+.
+.de ref*text-label-start
+. (f
+. ip "\\$1"
+..
+.de ref*text-label-end
+. )f
+..
+.
+.de ref*biblio-item-start
+. ip "\\$1"
+..
+.de ref*biblio-item-start-nolabel
+. ip \&
+..
+.de ref*biblio-item-end
+..
+.
+.ds ref*refnum-start \" empty
+.ds ref*refnum-end .\0\"
+.
+.ie \n(.V<1v \{\
+. ds [. \s-2\v'-.4m'\f1
+. ds .] \v'.4m'\s+2\fP
+.\}
+.el \{\
+. ds [. " [
+. ds .] ]
+.\}
+.
+.ds ref*spec!0 Q A T S V N P I C O D
+.ds ref*spec!1 Q A T J S V N P I C D O
+.ds ref*spec!2 Q A T S V P I C D G O
+.ds ref*spec!3 Q A T P B E S V I C D O
+.ds ref*spec!4 Q A T R G P I C D O
+.\" style #5 (Bell Laboratories internal memorandum) is not supported
+.\" by GNU refer
+.
+.ds ref*spec!A ", " "
+.ds ref*spec!B ", " " "in \f2" "" "\f1"
+.ds ref*spec!B:3 ", " " "in \f2" "\f1"
+.ds ref*spec!D """ " " "(" ")"
+.ds ref*spec!D:0 """ " "
+.ds ref*spec!E ", " " "ed. "
+.ds ref*spec!G """ " " "(" ")"
+.ds ref*spec!G:2 ". " " "Gov't. ordering no.\~"
+.ds ref*spec!J ", " " "\f2" "\f1"
+.ds ref*spec!N """ "(" "" ")"
+.ds ref*spec!O ". " "
+.ds ref*spec!O:0 ", " "
+.ds ref*spec!O:2 """ " "
+.ds ref*spec!P ", " " "p.\~"
+.ds ref*spec!PP ", " " "pp.\~"
+.ds ref*spec!T ", " " "\\*(lq" "" "\\*(rq"
+.ds ref*spec!T:0 ", " " "\f2" "\f1"
+.ds ref*spec!T:2 ", " " "\f2" "" "\f1"
+.ds ref*spec!V """ " " "\f3" "\f1"
+.ds ref*spec!dflt ", " "
+.
+.de ref*biblio-start-hook
+. $p References
+. lp
+..
+.
+.de ref*biblio-end-hook
+. sp
+..
+.
+.mso refer.tmac
+.
+.\" EOF
diff --git a/tmac/refer-mm.tmac b/tmac/refer-mm.tmac
new file mode 100644
index 00000000..55dac432
--- /dev/null
+++ b/tmac/refer-mm.tmac
@@ -0,0 +1,106 @@
+.\" -*- mode: nroff; coding: iso-latin-1; -*-
+.\"
+.\" refer-mm.tmac
+.\"
+.\" Refer support for mm macros.
+.\"
+.\" Copyright (C) 2011 Free Software Foundation, Inc.
+.\" Written by Werner Lemberg (wl@gnu.org)
+.\"
+.\" This file is part of groff.
+.\"
+.\" groff is free software; you can redistribute it and/or modify it under
+.\" the terms of the GNU General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
+.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+.\" for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Please send comments to groff@gnu.org.
+.
+.
+.als ref*error @warning
+.
+.de ref*text-label-start
+. FS "\\$1"
+..
+.de ref*text-label-end
+. FE
+..
+.
+.de ref*biblio-item-start
+. ref@start-print "\\$1"
+..
+.de ref*biblio-item-start-nolabel
+. ref@start-print \&
+..
+.de ref*biblio-item-end
+. ref@stop-print
+..
+.
+.ds ref*refnum-start \" empty
+.ds ref*refnum-end .\"
+.
+.ds [. \v'-.4m'\s-3[\"
+.ds .] ]\s0\v'.4m'\"
+.
+.ds ref*spec!0 Q A T S V N P I C D O
+.ds ref*spec!1 Q A T J S V N P I C D O
+.ds ref*spec!2 Q A T S V P I C D O
+.ds ref*spec!3 Q A T B E S V P I C D O
+.ds ref*spec!4 Q A T R G P I C D O
+.
+.ds ref*spec!A ", " "
+.ds ref*spec!B """ " " "in \fI" "" "\fP"
+.ds ref*spec!D """ " " "(" ")"
+.ds ref*spec!E ", " " "ed. "
+.ds ref*spec!G """ " " "(" ")"
+.ds ref*spec!J ", " " "\fI" "" "\fP"
+.ds ref*spec!N """ "(" "" ")"
+.ds ref*spec!O ". " "
+.ds ref*spec!P ", " " "p.\~"
+.ds ref*spec!PP ", " " "pp.\~"
+.ds ref*spec!T ", " " "\(lq" "" "\(rq"
+.ds ref*spec!T:0 ", " " "\fI" "" "\fP"
+.ds ref*spec!T:2 ", " " "\fI" "" "\fP"
+.ds ref*spec!V """ " " "\fB" "\fR"
+.ds ref*spec!dflt ", " "
+.
+.\" For the bibliography section, we emulate the .RS/.RF mechanism of mm by
+.\" collecting references (enclosed with .]- and .][) in macro `ref*mac'.
+.\" This macro gets expanded while calling the .RP macro.
+.
+.de ref*][-first-pass
+. ec
+. am ref*mac
+. ds [F "\\*([F\"
+. ][ "\\$1" "\\$2"
+\\..
+..
+.
+.de ref*biblio-start-hook
+. als ref*][-second-pass ][
+. als ][ ref*][-first-pass
+. de ref*item-start-hook
+. eo
+. am ref*mac ][
+\\..
+..
+.
+.de ref*biblio-end-hook
+. als ][ ref*][-second-pass
+. rm ref*item-start-hook
+. als ref*print ref*end-print
+. RP
+. als ref*print ref*normal-print
+..
+.
+.mso refer.tmac
+.
+.\" EOF
diff --git a/tmac/refer-ms.tmac b/tmac/refer-ms.tmac
new file mode 100644
index 00000000..5e9da210
--- /dev/null
+++ b/tmac/refer-ms.tmac
@@ -0,0 +1,86 @@
+.\" -*- mode: nroff; coding: iso-latin-1; -*-
+.\"
+.\" refer-ms.tmac
+.\"
+.\" Refer support for ms macros.
+.\"
+.\" Copyright (C) 2011 Free Software Foundation, Inc.
+.\" Written by Werner Lemberg (wl@gnu.org)
+.\"
+.\" This file is part of groff.
+.\"
+.\" groff is free software; you can redistribute it and/or modify it under
+.\" the terms of the GNU General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
+.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+.\" for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Please send comments to groff@gnu.org.
+.
+.
+.als ref*error @error
+.
+.de ref*text-label-start
+. FS "\\$1"
+..
+.de ref*text-label-end
+. FE
+..
+.
+.de ref*biblio-item-start
+. IP "\\$1"
+..
+.de ref*biblio-item-start-nolabel
+. XP
+..
+.de ref*biblio-item-end
+..
+.
+.als ref*refnum-start par@sup-start
+.als ref*refnum-end par@sup-end
+.
+.ds [. \E*[ref*refnum-start]\"
+.ds .] \E*[ref*refnum-end]\"
+.
+.ds ref*spec!0 Q A T S V N P I C D O
+.ds ref*spec!1 Q A T J S V N P I C D O
+.ds ref*spec!2 Q A T S V P I C D O
+.ds ref*spec!3 Q A T B E S V P I C D O
+.ds ref*spec!4 Q A T R G P I C D O
+.
+.ds ref*spec!A ", " "
+.ds ref*spec!B """ " " "in \fI" "" "\fP"
+.ds ref*spec!D """ " " "(" ")"
+.ds ref*spec!E ", " " "ed. "
+.ds ref*spec!G """ " " "(" ")"
+.ds ref*spec!J ", " " "\fI" "" "\fP"
+.ds ref*spec!N """ "(" "" ")"
+.ds ref*spec!O ". " "
+.ds ref*spec!P ", " " "p.\~"
+.ds ref*spec!PP ", " " "pp.\~"
+.ds ref*spec!T ", " " "\\*Q" "" "\\*U"
+.ds ref*spec!T:0 ", " " "\fI" "" "\fP"
+.ds ref*spec!T:2 ", " " "\fI" "" "\fP"
+.ds ref*spec!V """ " " "\fB" "\fR"
+.ds ref*spec!dflt ", " "
+.
+.de ref*biblio-start-hook
+. SH
+. nop \&\\*[REFERENCES]
+. par@reset
+..
+.
+.de ref*biblio-end-hook
+. par@finish
+..
+.
+.mso refer.tmac
+.
+.\" EOF
diff --git a/tmac/refer.tmac b/tmac/refer.tmac
new file mode 100644
index 00000000..61a306d6
--- /dev/null
+++ b/tmac/refer.tmac
@@ -0,0 +1,343 @@
+.\" -*- mode: nroff; coding: iso-latin-1; -*-
+.\"
+.\" refer.tmac
+.\"
+.\" This is an interface to `refer', originally part of `s.tmac'.
+.\"
+.\" Copyright (C) 2011 Free Software Foundation, Inc.
+.\" Written by Werner Lemberg (wl@gnu.org)
+.\"
+.\" This file is part of groff.
+.\"
+.\" groff is free software; you can redistribute it and/or modify it under
+.\" the terms of the GNU General Public License as published by the Free
+.\" Software Foundation, either version 3 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
+.\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
+.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+.\" for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
+.\"
+.\" Please send comments to groff@gnu.org.
+.
+.
+.\" The following macros must be defined:
+.\"
+.\" ref*error -- print an error message (in arg1)
+.\"
+.\" ref*text-label-start -- start a reference in text (formatted
+.\" reference number in arg1)
+.\" ref*text-label-end -- end a reference in text
+.\"
+.\" ref*biblio-item-start -- a reference item with label (in arg1)
+.\" in the bibliography block
+.\" ref*biblio-item-start-nolabel -- a reference item without label in the
+.\" bibliography block
+.\" ref*biblio-item-end -- end a reference item in the
+.\" bibliography block
+.\"
+.\" The following macros are optional:
+.\"
+.\" ref*item-start-hook -- stuff appended to the ]- macro
+.\" ref*item-end-hook -- stuff prepended to the ][ macro
+.\" ref*biblio-start-hook -- stuff appended to the ]< macro
+.\" ref*biblio-end-hook -- stuff appended to the ]> macro
+.\"
+.\" The following strings must be defined:
+.\"
+.\" ref*refnum-start -- start reference number formatting in
+.\" footnote
+.\" ref*refnum-end -- end reference number formatting in
+.\" footnote
+.\"
+.\" [. -- start reference number in text
+.\" (directly inserted by `refer')
+.\" .] -- end reference number in text (directly
+.\" inserted by `refer')
+.\"
+.\" Here is the specification of the five possible reference styles
+.\" provided by `refer'. The example entries are taken from the ms
+.\" macro package
+.\"
+.\" ref*spec!0 Q A T S V N P I C D O -- other
+.\" ref*spec!1 Q A T J S V N P I C D O -- journal article
+.\" ref*spec!2 Q A T S V P I C D O -- book
+.\" ref*spec!3 Q A T B E S V P I C D O -- article within book
+.\" ref*spec!4 Q A T R G P I C D O -- technical report
+.\"
+.\" Now the setup for the formatting of reference entries. The given example
+.\" entries for the various strings are taken from the ms macro package.
+.\"
+.\" Each string defines five arguments which are passed to a macro, with the
+.\" meaning as below. Please refer to the man page of `refer' for more
+.\" details on the fields. To allow fine-tuning, two levels are implemented:
+.\" For the refer field X and style Y the string `ref*spec!X:Y' is looked up.
+.\" If it doesn't exist, the string `ref*spec!X' is used instead.
+.\"
+.\" arg 1 the punctuation character to use to separate this field from the
+.\" previous field
+.\" arg 2 a string to insert after the punctuation character of the
+.\" previous field (normally a space)
+.\" arg 3 a string with which to prefix this field
+.\" arg 4 a string with which to postfix this field
+.\" arg 5 a string to add after the punctuation character supplied by the
+.\" next field
+.\"
+.\" 1 2 3 4 5
+.\" ----------------------------------------------------------------------
+.\" ref*spec!A , " " -- author name
+.\" ref*spec!B "" " " "in \fI" "" "\fP" -- book title of article
+.\" ref*spec!D "" " " "(" ")" -- date of publication
+.\" ref*spec!E , " " "ed. " -- editor
+.\" ref*spec!G "" " " "(" ")" -- US Gov. ordering number
+.\" ref*spec!J , " " "\fI" "" "\fP" -- journal name
+.\" ref*spec!N "" "(" "" ")" -- issue number
+.\" ref*spec!O . " " -- other information
+.\" ref*spec!P , " " "p.\~" -- page
+.\" ref*spec!PP , " " "pp.\~" -- page range
+.\" ref*spec!T , " " "\\*Q" "" "\\*U" -- journal title
+.\" ref*spec!T:0 , " " "\fI" "" "\fP" -- book title (other)
+.\" ref*spec!T:2 , " " "\fI" "" "\fP" -- book title (book)
+.\" ref*spec!V "" " " "\fB" "\fR" -- volume number
+.\"
+.\" ref*spec!dflt , " " -- all other entries
+.
+.\" start of reference
+.de ]-
+. rm [A [B [C [D [E [G [I [J [N [O [P [Q [R [S [T [V
+. rm ref*string
+. if d ref*item-start-hook \
+. ref*item-start-hook
+..
+.
+.
+.\" end of reference
+.de ][
+. if d ref*item-end-hook \
+. ref*item-end-hook
+. ie d ref*spec!\\$1 \
+. ref*build \\$1 \\*[ref*spec!\\$1]
+. el \{\
+. ref*error "unknown reference type `\\$1'"
+. ref*build 0 \\*[ref*spec!0]
+. \}
+. ref*print
+. rm ref*string
+. rm [F
+..
+.
+.
+.\" period before reference
+.ds <. .\"
+.
+.\" period after reference
+.ds >. \" empty
+.
+.\" comma before reference
+.ds <, ,\"
+.
+.\" comma after reference
+.ds >, \" empty
+.
+.
+.\" start collected references
+.de ]<
+. als ref*print ref*end-print
+. if d ref*biblio-start-hook \
+. ref*biblio-start-hook
+..
+.
+.
+.\" end collected references
+.de ]>
+. als ref*print ref*normal-print
+. if d ref*biblio-end-hook \
+. ref*biblio-end-hook
+..
+.
+.
+.de ref*normal-print
+. ie d [F \
+. ref*text-label-start \
+ "\\*[ref*refnum-start]\\*([F\\*[ref*refnum-end]"
+. el \
+. ref*text-label-start \&
+. nop \\*[ref*string]
+. ref*text-label-end
+..
+.
+.
+.de ref*end-print
+. ie d [F \
+. ref*biblio-item-start "\\*([F."
+. el \
+. ref*biblio-item-start-nolabel
+. nop \\*[ref*string]
+. ref*biblio-item-end
+..
+.
+.
+.als ref*print ref*normal-print
+.
+.de ref*build
+. rm ref*string ref*post-punct
+. nr ref*suppress-period 1
+. nr ref*style \\$1
+. shift
+. while \\n[.$] \{\
+. if d [\\$1 \{\
+. ie d ref*add-\\$1 \
+. ref*add-\\$1 \\n[ref*style]
+. el \
+. ref*add-dflt \\$1 \\n[ref*style]
+. \}
+. shift
+. \}
+. \" now add a final period
+. ie d ref*string \{\
+. if !\\n[ref*suppress-period] \
+. as ref*string .
+. if d ref*post-punct \{\
+. as ref*string "\\*[ref*post-punct]
+. rm ref*post-punct
+. \}
+. \}
+. el \
+. ds ref*string
+..
+.
+.
+.de ref*add-T
+. ie d ref*spec!T:\\$1 \
+. ref*field T \\*[ref*spec!T:\\$1]
+. el \
+. ref*field T \\*[ref*spec!T]
+. if r [T \
+. nr ref*suppress-period \\n([T
+..
+.
+.de ref*add-P
+. ie \\n([P>0 \{\
+. ie d ref*spec!PP:\\$1 \
+. ref*field P \\*[ref*spec!PP:\\$1]
+. el \
+. ref*field P \\*[ref*spec!PP]
+. \}
+. el \{\
+. ie d ref*spec!P:\\$1 \
+. ref*field P \\*[ref*spec!P:\\$1]
+. el \
+. ref*field P \\*[ref*spec!P]
+. \}
+..
+.
+.de ref*add-J
+. ie ref*spec!J:\\$1 \
+. ref*field J \\*[ref*spec!J:\\$1]
+. el \
+. ref*field J \\*[ref*spec!J]
+..
+.
+.de ref*add-D
+. ie ref*spec!D:\\$1 \
+. ref*field D \\*[ref*spec!D:\\$1]
+. el \
+. ref*field D \\*[ref*spec!D]
+..
+.
+.de ref*add-E
+. ie ref*spec!E:\\$1 \
+. ref*field E \\*[ref*spec!E:\\$1]
+. el \
+. ref*field E \\*[ref*spec!E]
+..
+.
+.de ref*add-G
+. ie ref*spec!G:\\$1 \
+. ref*field G \\*[ref*spec!G:\\$1]
+. el \
+. ref*field G \\*[ref*spec!G]
+..
+.
+.de ref*add-B
+. ie ref*spec!B:\\$1 \
+. ref*field B \\*[ref*spec!B:\\$1]
+. el \
+. ref*field B \\*[ref*spec!B]
+..
+.
+.de ref*add-O
+. ie ref*spec!O:\\$1 \
+. ref*field O \\*[ref*spec!O:\\$1]
+. el \
+. ref*field O \\*[ref*spec!O]
+. if r [O \
+. nr ref*suppress-period \\n([O
+.\" XXX
+.\" el \
+.\" nr ref*suppress-period 1
+..
+.
+.de ref*add-A
+. ie ref*spec!A:\\$1 \
+. ref*field A \\*[ref*spec!A:\\$1]
+. el \
+. ref*field A \\*[ref*spec!A]
+. if r [A \
+. nr ref*suppress-period \\n([A
+..
+.
+.de ref*add-V
+. ie ref*spec!V:\\$1 \
+. ref*field V \\*[ref*spec!V:\\$1]
+. el \
+. ref*field V \\*[ref*spec!V]
+..
+.
+.de ref*add-N
+. ie ref*spec!N:\\$1 \
+. ref*field N \\*[ref*spec!N:\\$1]
+. el \
+. ref*field N \\*[ref*spec!N]
+..
+.
+.de ref*add-dflt
+. ie ref*spec!dflt:\\$2 \
+. ref*field \\$1 \\*[ref*spec!dflt:\\$2]
+. el \
+. ref*field \\$1 \\*[ref*spec!dflt]
+..
+.
+.
+.\" First argument is the field letter.
+.\" Second argument is the punctuation character to use to separate this
+.\" field from the previous field.
+.\" Third argument is a string to insert after the punctuation character of
+.\" the previous field (normally a space).
+.\" Fourth argument is a string with which to prefix this field.
+.\" Fifth argument is a string with which to postfix this field.
+.\" Sixth argument is a string to add after the punctuation character
+.\" supplied by the next field.
+.de ref*field
+. if d ref*string \{\
+. ie d ref*post-punct \{\
+. if !\\n[ref*suppress-period] \
+. as ref*string "\\$2\"
+. as ref*string "\\*[ref*post-punct]\\$3\"
+. rm ref*post-punct
+. \}
+. el \
+. as ref*string "\\$2\\$3\"
+. \}
+. as ref*string "\\$4\\*([\\$1\\$5
+. if \\n[.$]>5 \
+. ds ref*post-punct "\\$6\"
+. nr ref*suppress-period 0
+..
+.
+.
+.\" EOF
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 3a0e0c66..8a1c8c12 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -1869,157 +1869,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
.\" ******** module ref ********
.\" ****************************
.\" Refer support.
-.de ]-
-.rm [A [B [C [D [E [G [I [J [N [O [P [Q [R [S [T [V
-.rm ref*string
-..
-.\" Other
-.ds ref*spec!0 Q A T1 S V N P I C D O
-.\" Journal article
-.ds ref*spec!1 Q A T2 J S V N P I C D O
-.\" Book
-.ds ref*spec!2 Q A T1 S V P I C D O
-.\" Article within book
-.ds ref*spec!3 Q A T2 B E S V P I C D O
-.\" Tech report
-.ds ref*spec!4 Q A T2 R G P I C D O
-.\" ][ type
-.de ][
-.if r [T \{\
-. als [T1 [T
-. als [T2 [T
-.\}
-.ie d ref*spec!\\$1 .ref*build \\*[ref*spec!\\$1]
-.el \{\
-. @error unknown reference type `\\$1'
-. ref*build \\*[ref*spec!0]
-.\}
-.ref*print
-.rm ref*string
-.rm [F [T1 [T2
-..
-.\" start of reference number
-.ds [. \E*[par@sup-start]
-.\" end of reference number
-.ds .] \E*[par@sup-end]
-.\" period before reference
-.ds <. .
-.\" period after reference
-.ds >. \" empty
-.\" comma before reference
-.ds <, ,
-.\" comma after reference
-.ds >, \" empty
-.\" start collected references
-.de ]<
-.als ref*print ref*end-print
-.SH
-\&\\*[REFERENCES]
-.par@reset
-..
-.\" end collected references
-.de ]>
-.par@finish
-.als ref*print ref*normal-print
-..
-.de ref*normal-print
-.ie d [F .FS "\\*([.\\*([F\\*(.]"
-.el .FS \&
-\\*[ref*string]
-.FE
-..
-.de ref*end-print
-.ie d [F .IP "\\*([F."
-.el .XP
-\\*[ref*string]
-..
-.als ref*print ref*normal-print
-.de ref*build
-.rm ref*string ref*post-punct
-.nr ref*suppress-period 1
-.while \\n[.$] \{\
-. if d [\\$1 \{\
-. ie d ref*add-\\$1 .ref*add-\\$1
-. el .ref*add-dflt \\$1
-. \}
-. shift
-.\}
-.\" now add a final period
-.ie d ref*string \{\
-. if !\\n[ref*suppress-period] .as ref*string .
-. if d ref*post-punct \{\
-. as ref*string "\\*[ref*post-punct]
-. rm ref*post-punct
-. \}
-.\}
-.el .ds ref*string
-..
-.de ref*add-T1
-.ref*field T , " " "\fI" "" "\fP"
-.if r [T .nr ref*suppress-period \\n([T
-..
-.de ref*add-T2
-.ref*field T , " " "\\*Q" "" "\\*U"
-.if r [T .nr ref*suppress-period \\n([T
-..
-.de ref*add-P
-.ie \\n([P>0 .ref*field P , " " "pp. "
-.el .ref*field P , " " "p. "
-..
-.de ref*add-J
-.ref*field J , " " \fI "" \fP
-..
-.de ref*add-D
-.ref*field D "" " " ( )
-..
-.de ref*add-E
-.ref*field E , " " "ed. "
-..
-.de ref*add-G
-.ref*field G "" " " ( )
-..
-.de ref*add-B
-.ref*field B "" " " "in \fI" "" \fP
-..
-.de ref*add-O
-.ref*field O . " "
-.ie r [O .nr ref*suppress-period \\n([O
-.el .nr ref*suppress-period 1
-..
-.de ref*add-A
-.ref*field A , " "
-.if r [A .nr ref*suppress-period \\n([A
-..
-.de ref*add-V
-.ref*field V "" " " \fB \fR
-..
-.de ref*add-N
-.ref*field N "" ( "" ")"
-..
-.de ref*add-dflt
-.ref*field \\$1 , " "
-..
-.\" First argument is the field letter.
-.\" Second argument is the punctuation character to use to separate this field
-.\" from the previous field.
-.\" Third argument is a string to insert after the punctuation character of
-.\" the previous field (normally a space)
-.\" Fourth argument is a string with which to prefix this field.
-.\" Fifth argument is a string with which to postfix this field.
-.\" Sixth argument is a string to add after the punctuation character supplied
-.\" by the next field.
-.de ref*field
-.if d ref*string \{\
-. ie d ref*post-punct \{\
-. as ref*string "\\$2\\*[ref*post-punct]\\$3\"
-. rm ref*post-punct
-. \}
-. el .as ref*string "\\$2\\$3\"
-.\}
-.as ref*string "\\$4\\*([\\$1\\$5
-.if \\n[.$]>5 .ds ref*post-punct "\\$6
-.nr ref*suppress-period 0
-..
+.mso refer-ms.tmac
.\" ****************************
.\" ******** module acc ********
.\" ****************************