[net.text] -me macros with refer

crm@duke.UUCP (Charlie Martin) (06/26/85)

Can anyone tell me how to fix the -me refer macros to work nicely with
the %LIST% construct (i.e. forcing the bibliography to hte end of a 
document) or send me modified macros for -me which work?

Thanks in advance,
Charlie Martin
( crm@duke, {decvax,ihnp4}!mcnc!duke!crm )
-- 

			Charlie Martin
			(...mcnc!duke!crm)

stephen@dcl-cs.UUCP (Stephen J. Muir) (07/07/85)

In article <5957@duke.UUCP> crm@duke.UUCP (Charlie Martin) writes:
>Can anyone tell me how to fix the -me refer macros to work nicely with
>the %LIST% construct (i.e. forcing the bibliography to hte end of a 
>document) or send me modified macros for -me which work?
Actually, there is nothing wrong with the -me macros - the fault is in
refer(1).  We have fixed ours to work properly.  Also, you need to delete the
"(f" and ")f" macros if you want the bibliography at the end - just say
".rm (f" and ".rm )f" immediately before the "$LIST$" line.  If there is
sufficient demand, I might be persuaded to post my pathes to refer(1).
-- 
UUCP:	...!seismo!mcvax!ukc!icdoc!dcl-cs!stephen
DARPA:	stephen%lancs.comp@ucl-cs	| Post: University of Lancaster,
JANET:	stephen@uk.ac.lancs.comp	|	Department of Computing,
Phone:	+44 524 65201 Ext. 4599		|	Bailrigg, Lancaster, UK.
Project:Alvey ECLIPSE Distribution	|	LA1 4YR

stephen@dcl-cs.UUCP (Stephen J. Muir) (07/11/85)

In article <287@dcl-cs.UUCP> stephen@dcl-cs.UUCP (Stephen J. Muir) writes:
>Actually, there is nothing wrong with the -me macros - the fault is in
>refer(1).  We have fixed ours to work properly.  Also, you need to delete the
>"(f" and ")f" macros if you want the bibliography at the end - just say
>".rm (f" and ".rm )f" immediately before the "$LIST$" line.  If there is
>sufficient demand, I might be persuaded to post my pathes to refer(1).
As there HAS been a demand - here they are.
----------------------------------- cut here ----------------------------------
*** refer..c.old	Wed Jul 10 20:29:02 1985
--- refer..c	Wed Jul 10 20:28:52 1985
***************
*** 5,10
  #include <assert.h>
  
  #define FLAG 003
  #define NRFTXT 10000
  #define NRFTBL 500
  #define NTFILE 20

--- 5,11 -----
  #include <assert.h>
  
  #define FLAG 003
+ # define FFLAG	004
  #define NRFTXT 10000
  #define NRFTBL 500
  #define NTFILE 20
*** refer1.c.old	Wed Jul 10 20:30:15 1985
--- refer1.c	Wed Jul 10 20:29:55 1985
***************
*** 90,96
  		}
  		sep = 002; /* separate records without confusing sort..*/
  	}
! 	if (sort && !labels) {
  		sprintf(ofile, "/tmp/rj%db", getpid());
  		ftemp = fopen(ofile, "w");
  		if (ftemp == NULL) {

--- 90,96 -----
  		}
  		sep = 002; /* separate records without confusing sort..*/
  	}
! 	if (sort) {
  		sprintf(ofile, "/tmp/rj%db", getpid());
  		ftemp = fopen(ofile, "w");
  		if (ftemp == NULL) {
***************
*** 126,132
  	if (endpush && fo != NULL)
  		dumpold();
  	output("");
! 	if (sort && !labels)
  		recopy(ofile);
  	clfgrep();
  	cleanup();

--- 126,132 -----
  	if (endpush && fo != NULL)
  		dumpold();
  	output("");
! 	if (sort)
  		recopy(ofile);
  	clfgrep();
  	cleanup();
*** refer2.c.old	Wed Jul 10 20:31:11 1985
--- refer2.c	Wed Jul 10 20:30:50 1985
***************
*** 112,118
  						nf = tabs(flds, one);
  						nf += tabs(flds+nf, dbuff);
  						assert(nf < NFLD);
! 						putsig(nf,flds,nr,line1,line);
  					}
  					return;
  				}

--- 112,118 -----
  						nf = tabs(flds, one);
  						nf += tabs(flds+nf, dbuff);
  						assert(nf < NFLD);
! 						putsig(nf,flds,nr,line1,line,0);
  					}
  					return;
  				}
***************
*** 129,135
  	if (sort)
  		putkey(nf, flds, refnum, keystr);
  	if (bare < 2)
! 		putsig(nf, flds, refnum, line1, line);
  	else
  		flout();
  	putref(nf, flds);

--- 129,135 -----
  	if (sort)
  		putkey(nf, flds, refnum, keystr);
  	if (bare < 2)
! 		putsig(nf, flds, refnum, line1, line, 1);
  	else
  		flout();
  	putref(nf, flds);
*** refer5.c.old	Wed Jul 10 20:36:29 1985
--- refer5.c	Wed Jul 10 20:35:50 1985
***************
*** 9,15
  
  static char sig[NLABC];
  static char bflab[NFLAB];
! static char *labtab[NLABC];
  static char *lbp = bflab;
  static char labc[NLABC];
  static char stbuff[50];

--- 9,15 -----
  
  static char sig[NLABC];
  static char bflab[NFLAB];
! char	*labtab[NLABC];
  static char *lbp = bflab;
  char	labc[NLABC];
  static char stbuff[50];
***************
*** 11,17
  static char bflab[NFLAB];
  static char *labtab[NLABC];
  static char *lbp = bflab;
! static char labc[NLABC];
  static char stbuff[50];
  static int  prevsig;
  

--- 11,17 -----
  static char bflab[NFLAB];
  char	*labtab[NLABC];
  static char *lbp = bflab;
! char	labc[NLABC];
  static char stbuff[50];
  static int  prevsig;
  
***************
*** 15,21
  static char stbuff[50];
  static int  prevsig;
  
! putsig (nf, flds, nref, nstline, endline)	/* choose signal style */
  char *flds[], *nstline, *endline;
  {
  	char t[100], t1[100], t2[100], format[10], *sd, *stline;

--- 15,21 -----
  static char stbuff[50];
  static int  prevsig;
  
! putsig (nf, flds, nref, nstline, endline, new)	/* choose signal style */
  char *flds[], *nstline, *endline;
  {
  	char t[100], t1[100], t2[100], format[10], *sd, *stline;
***************
*** 143,151
  			}
  		}
  	}
! 	if (bare < 2)
! 		if (nf > 0)
! 			fprintf(fo,".ds [F %s%c",t,sep);
  	if (bare > 0)
  		flout();
  #if EBUG

--- 143,150 -----
  			}
  		}
  	}
! 	if (new && bare < 2 && nf > 0)
! 		fprintf(fo,".ds [F %s%c",t,sep);
  	if (bare > 0)
  		flout();
  #if EBUG
***************
*** 238,244
  char *t;
  {
  	int i;
! 	int x = -1;
  
  	for(i = 1; i < nref; i++) {
  		if (strcmp(labtab[i], t) == 0)

--- 237,243 -----
  char *t;
  {
  	int i;
! 	int	x = 'a' - 1;
  
  	for(i = 1; i < nref; i++) {
  		if (strcmp(labtab[i], t) == 0)
*** refer7.c.old	Wed Jul 10 20:37:16 1985
--- refer7.c	Wed Jul 10 20:37:00 1985
***************
*** 3,8
  #endif
  
  #include "refer..c"
  
  int newr[250];
  

--- 3,10 -----
  #endif
  
  #include "refer..c"
+ extern char	*labtab [];
+ extern char	labc [];
  
  int newr[250];
  
***************
*** 96,101
  			*s = 0;
  			printf("%d", newr[atoi(tb)]);
  			continue;
  		}
  		putchar(c);
  	}

--- 98,120 -----
  			*s = 0;
  			printf("%d", newr[atoi(tb)]);
  			continue;
+ 		}
+ 		if (c == FFLAG)
+ 		{ char	tb [100];
+ 		  char	*s = tb;
+ 		  while ((c = getc (ftemp)) != FFLAG)
+ 			*s++ = c;
+ 		  if (*--s == 'a')
+ 		  { *s = 0;
+ 		    for (c = 1; c <= refnum; ++c)
+ 			if (labc [c] != 'a' && strcmp (labtab [c], tb) == 0)
+ 			{ *s = 'a';
+ 			  break;	/* optimisation */
+ 			}
+ 		  }
+ 		  *++s = 0;
+ 		  printf ("%s", tb);
+ 		  continue;
  		}
  		putchar(c);
  	}
-- 
UUCP:	...!seismo!mcvax!ukc!dcl-cs!stephen
DARPA:	stephen%lancs.comp@ucl-cs	| Post: University of Lancaster,
JANET:	stephen@uk.ac.lancs.comp	|	Department of Computing,
Phone:	+44 524 65201 Ext. 4599		|	Bailrigg, Lancaster, UK.
Project:Alvey ECLIPSE Distribution	|	LA1 4YR

tetres@uvaee.UUCP (Thomas E. Tkacik) (07/12/85)

In article <287@dcl-cs.UUCP> stephen@dcl-cs.UUCP (Stephen J. Muir) writes:
>In article <5957@duke.UUCP> crm@duke.UUCP (Charlie Martin) writes:
>>Can anyone tell me how to fix the -me refer macros to work nicely with
>>the %LIST% construct (i.e. forcing the bibliography to the end of a 
>>document) or send me modified macros for -me which work?
>Actually, there is nothing wrong with the -me macros - the fault is in
>refer(1).  We have fixed ours to work properly.
I have found that there is indeed a slight error with the -me macros.
And nothing wrong with refer(1).
There is a missing macro definition. When the %LIST% construct is used
refer(1) adds the macro .]< before printing out the references. This
macro is defined in /usr/lib/me/refer.me, and removes the ".(f" and
".)f macros to prevent printing them at the bottom of the page.
However, this macro is not defined in /usr/lib/tmac/tmac.e (the -me macros),
and thus never gets called.  The fix is simple, put in tmac.e
the macro definition,

.de ]<
.rn ]< @]
.so \\*(||/refer.me
.]<
.rm @]
..

This macro is defined in refer.me, and works, but I have a slight
modificaltion to make it format better. Instead of removeing the
".(f" and ".)f" macros, they are redefined to be the
".(b" and ".)b" macros, which keeps the references from being
broken over two pages. The following is how ".]<" is now defined in
our version of refer.me.

.de ]<
.rn (f (@
.rn (b (f
.rn )f )@
.rn )b )f
.\" because the printing macros insert space between each refernce
.\" make the block macro inserts no extra space
.nr bs 0
.lp
..

All that is needed is to put the macro call (the first one shown above)
in the file /usr/lib/tmac/tmac.e, and possibly modify the macro
defined in /usr/lib/me/refer.me (to taste, as in the second example).

			Tom Tkacik
			...!decvax!mcnc!ncsu!uvacs!uvaee!tet

My apologies to those who do not like looking at troff macros.

stephen@dcl-cs.UUCP (Stephen J. Muir) (07/15/85)

In article <363@uvaee.UUCP> tet@uvaee.UUCP (Thomas E. Tkacik) writes:
>In article <287@dcl-cs.UUCP> stephen@dcl-cs.UUCP (Stephen J. Muir) writes:
>>Actually, there is nothing wrong with the -me macros - the fault is in
>>refer(1).  We have fixed ours to work properly.
>I have found that there is indeed a slight error with the -me macros.
>And nothing wrong with refer(1).
Ok - there may be a bug in the -me macros, but the bugs in refer still exist.
These bugs are, possibly, unrelated to the original problem - but they should
be corrected anyway.
-- 
UUCP:	...!seismo!mcvax!ukc!dcl-cs!stephen
DARPA:	stephen%lancs.comp@ucl-cs	| Post: University of Lancaster,
JANET:	stephen@uk.ac.lancs.comp	|	Department of Computing,
Phone:	+44 524 65201 Ext. 4599		|	Bailrigg, Lancaster, UK.
Project:Alvey ECLIPSE Distribution	|	LA1 4YR