groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] Refer & mm


From: Robert D. Goulding
Subject: [Groff] Refer & mm
Date: Sat, 30 Nov 2002 01:39:38 -0500 (EST)

Based on some earlier postings, I've adapted the ms refer support to work
with mm.  The only thing I can't figure out is what to put instead of .XP
in line 68.  I guessed that it might be simply .LI -- but this messes up
the formatting of the listed bibliography at the end.  Can someone fix
this?

Robert.

mrefer.tmac
-- begin --
.\" ****************************
.\" ******** module ref ********
.\" ****************************
.\" Refer support.
.ds REFERENCES References
.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 [. \v'-.4m'\s-4[
.ds [. \0[
.\" end of reference number
.\" .ds .] ]\s0\v'.4m'
.ds .] ]
.\" period before reference
.ds <. .
.\" period after reference
.ds >. \" empty
.\" comma before reference
.ds <, ,
.\" comma after reference
.ds >, \" empty
.\" start collected references
.de ]< \" start to display collected references
.als ref*print ref*end-print
.ie d REFERENCES .HU "\\*[REFERENCES]"
.P
.VL 6 0 1
..
.de ]> \" end display of collected references
.als ref*print ref*normal-print
.LE
..
.de ref*normal-print
.ie d [F .FS "\\*([.\\*([F\\*(.]"
.el .FS \&
\\*[ref*string]
.FE
..
.de ref*end-print
.ie d [F .LI "\\*([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 , "\\(lq" "" "\\(rq"
.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-V
.ref*field V , \fB "" \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-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 with which to prefix this field.
.\" Fourth argument is a string with which to postfix this field.
.\" Fifth 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] \"
.               rm ref*post-punct
.       \}
.       el .as ref*string "\\$2 \"
.\}
.as ref*string "\\$3\\*([\\$1\\$4
.if \\n[.$]>4 .ds ref*post-punct "\\$5
.nr ref*suppress-period 0
..
-- end --


-- 
Robert Goulding
Society of Fellows
Joseph Henry House
Princeton NJ 08544


reply via email to

[Prev in Thread] Current Thread [Next in Thread]