groff-commit
[Top][All Lists]
Advanced

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

[Groff-commit] groff ChangeLog NEWS tmac/e.tmac tmac/s.tmac tm...


From: Werner LEMBERG
Subject: [Groff-commit] groff ChangeLog NEWS tmac/e.tmac tmac/s.tmac tm...
Date: Fri, 28 Jan 2011 10:04:46 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Werner LEMBERG <wl>     11/01/28 10:04:45

Modified files:
        .              : ChangeLog NEWS 
        tmac           : e.tmac s.tmac 
Added files:
        tmac           : refer-me.tmac refer-mm.tmac refer-ms.tmac 
                         refer.tmac 

Log message:
        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.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/ChangeLog?cvsroot=groff&r1=1.1283&r2=1.1284
http://cvs.savannah.gnu.org/viewcvs/groff/NEWS?cvsroot=groff&r1=1.266&r2=1.267
http://cvs.savannah.gnu.org/viewcvs/groff/tmac/e.tmac?cvsroot=groff&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/groff/tmac/s.tmac?cvsroot=groff&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/groff/tmac/refer-me.tmac?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/tmac/refer-mm.tmac?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/tmac/refer-ms.tmac?cvsroot=groff&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/groff/tmac/refer.tmac?cvsroot=groff&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/ChangeLog,v
retrieving revision 1.1283
retrieving revision 1.1284
diff -u -b -r1.1283 -r1.1284
--- ChangeLog   22 Jan 2011 15:45:02 -0000      1.1283
+++ ChangeLog   28 Jan 2011 10:04:45 -0000      1.1284
@@ -1,3 +1,18 @@
+2011-01-28  Werner LEMBERG  <address@hidden>
+
+       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.
+
 2011-01-22  Werner LEMBERG  <address@hidden>
 
        [groff.texinfo]: Updates.

Index: NEWS
===================================================================
RCS file: /cvsroot/groff/groff/NEWS,v
retrieving revision 1.266
retrieving revision 1.267
diff -u -b -r1.266 -r1.267
--- NEWS        22 Jan 2011 14:35:48 -0000      1.266
+++ NEWS        28 Jan 2011 10:04:45 -0000      1.267
@@ -16,6 +16,12 @@
 
 o A new option `-j' has been added to call the `chem' preprocessor.
 
+Macro Packages
+--------------
+
+o Support for the `refer' preprocessor has been added to the -me and -mm
+  macros.
+
 
 VERSION 1.21
 ============

Index: tmac/e.tmac
===================================================================
RCS file: /cvsroot/groff/groff/tmac/e.tmac,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- tmac/e.tmac 5 Jan 2009 10:20:59 -0000       1.8
+++ tmac/e.tmac 28 Jan 2011 10:04:45 -0000      1.9
@@ -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.
address@hidden
-.)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

Index: tmac/s.tmac
===================================================================
RCS file: /cvsroot/groff/groff/tmac/s.tmac,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- tmac/s.tmac 23 Jan 2010 07:23:24 -0000      1.39
+++ tmac/s.tmac 28 Jan 2011 10:04:45 -0000      1.40
@@ -1869,157 +1869,7 @@
 .\" ******** 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 [. address@hidden
-.\" end of reference number
-.ds .] address@hidden
-.\" 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]
address@hidden
-..
-.\" end collected references
-.de ]>
address@hidden
-.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 ********
 .\" ****************************

Index: tmac/refer-me.tmac
===================================================================
RCS file: tmac/refer-me.tmac
diff -N tmac/refer-me.tmac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tmac/refer-me.tmac  28 Jan 2011 10:04:45 -0000      1.1
@@ -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 (address@hidden)
+.\"
+.\" 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 address@hidden
+.
+.
+.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

Index: tmac/refer-mm.tmac
===================================================================
RCS file: tmac/refer-mm.tmac
diff -N tmac/refer-mm.tmac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tmac/refer-mm.tmac  28 Jan 2011 10:04:45 -0000      1.1
@@ -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 (address@hidden)
+.\"
+.\" 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 address@hidden
+.
+.
+.als ref*error @warning
+.
+.de ref*text-label-start
+.  FS "\\$1"
+..
+.de ref*text-label-end
+.  FE
+..
+.
+.de ref*biblio-item-start
+.  address@hidden "\\$1"
+..
+.de ref*biblio-item-start-nolabel
+.  address@hidden \&
+..
+.de ref*biblio-item-end
+.  address@hidden
+..
+.
+.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

Index: tmac/refer-ms.tmac
===================================================================
RCS file: tmac/refer-ms.tmac
diff -N tmac/refer-ms.tmac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tmac/refer-ms.tmac  28 Jan 2011 10:04:45 -0000      1.1
@@ -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 (address@hidden)
+.\"
+.\" 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 address@hidden
+.
+.
+.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 address@hidden
+.als ref*refnum-end   address@hidden
+.
+.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]
+.  address@hidden
+..
+.
+.de ref*biblio-end-hook
+.  address@hidden
+..
+.
+.mso refer.tmac
+.
+.\" EOF

Index: tmac/refer.tmac
===================================================================
RCS file: tmac/refer.tmac
diff -N tmac/refer.tmac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tmac/refer.tmac     28 Jan 2011 10:04:45 -0000      1.1
@@ -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 (address@hidden)
+.\"
+.\" 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 address@hidden
+.
+.
+.\" 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



reply via email to

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