[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] refer macros
From: |
Andy Dougherty |
Subject: |
Re: [Groff] refer macros |
Date: |
Tue, 11 Jul 2000 12:50:46 -0400 (EDT) |
On Tue, 11 Jul 2000, Nicola Bernardini wrote:
>
> Hi,
>
> I need to use the refer preprocessor for a paper I'm writing and
> using the mm macros. The mm macros I have (from the groff CVS dist)
> have no support for refer, while the ms do. I'm thinking of rebuilding
> a separate set of refer macros to be used with any package.
>
> Has something like this already been done? Is there any counter-indication
> in doing it? (I would send them to the maintainers afterwards of
> course).
Some time ago, I did something along these lines as follows:
1. Extract the Refer support module from groff's tmac.s and put it in a
separate file.
2. Modify that file to use -mm commands rather than -ms commands to
format the various lists. (e.g. I used a .VL list instead of individual
indented .IP paragraphs).
3. Customize the output to match the requirements of the journal I was
submitting to
4. Save the result in a separate file and .so it as part of my document.
Here's the result. My originals were based on an older version of the
groff -ms macros; I have patched my macros against the oldest version I
have lying around to try to avoid confusing matters due to version skew.
Even so, I don't recognize what I was doing with the address@hidden stuff.
My main observations on the whole procedure are:
1. There wasn't too much to change, so it wasn't too hard.
2. The package builds extensively on existing macros in the larger
macro package (either -ms or -mm). I think it would be a mistake
to try to reimplement the refer macros in a package-independent
way. That's likely to lead to too much duplication of effort
(e.g. a package-independent way to get indented paragraphs using
the prevailing indent, etc.)
3. Making a duplicate -mm version also duplicates a lot of work, but,
as my patch shows, not all *that* much has to be changed, so it's
probably not that big a deal to maintain duplicate "flavors"
of the refer support.
4. Specific requirements of specific journals (or other target
audiences) may require customization of the macros anyway.
Hope this helps.
--- ms.refer Tue Jul 11 12:46:06 2000
+++ mm.refer Sat Feb 21 13:50:39 1998
@@ -58,9 +57,11 @@
.rm [F [T1 [T2
..
.\" start of reference number
-.ds [. address@hidden
+.\" .ds [. \v'-.4m'\s-4[
+.ds [. \0[
.\" end of reference number
-.ds .] address@hidden
+.\" .ds .] ]\s0\v'.4m'
+.ds .] ]
.\" period before reference
.ds <. .
.\" period after reference
@@ -70,16 +71,13 @@
.\" comma after reference
.ds >, \" empty
.\" start collected references
-.de ]<
+.de ]< \" start to display collected references
.als ref*print ref*end-print
-.SH
-\&\\*[REFERENCES]
address@hidden
-..
-.\" end collected references
-.de ]>
address@hidden
+.VL 4 0 1
+..
+.de ]> \" end display of collected references
.als ref*print ref*normal-print
+.LE
..
.de ref*normal-print
.ie d [F .FS "\\*([.\\*([F\\*(.]"
@@ -88,7 +86,7 @@
.FE
..
.de ref*end-print
-.ie d [F .IP "\\*([F."
+.ie d [F .LI "\\*([F."
.el .XP
\\*[ref*string]
..
@@ -118,21 +116,24 @@
.if r [T .nr ref*suppress-period \\n([T
..
.de ref*add-T2
-.ref*field T , "\\*Q" "" "\\*U"
+.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-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. "
+.ref*field E , "" " eds."
..
.de ref*add-G
.ref*field G "" ( )
--
Andy Dougherty address@hidden
Dept. of Physics
Lafayette College, Easton PA 18042