Loading ...
Sorry, an error occurred while loading the content.

[GP] bibtex BST automatic et al?

Expand Messages
  • Bill LANGDON
    ... I have written a short gawk script which replaces 2nd, 3rd, etc authors or editors by and others . As Colin points out this is going to be helpful if the
    Message 1 of 6 , Jun 2, 2012
    • 0 Attachment
      Following of from Colin's suggestion:
      > Hi!
      >
      > > > Do you know of a bibtex style file (.bst), or some other way,
      > > > which shortens long editor lists to "first editor, et al."
      >
      > I don't know of a .bst way to do this but you can use the reserved-word "others" in a list of editors or authors in the .bib file to create this effect, e.g.
      >
      > EDITOR="John Doe and others"
      >
      > will produce, at least in the standard .bst files, a reference something like:
      >
      > Doe, J. et al. (eds.), ...
      >
      > but this doesn't seem to be well known to many writers of .bst files so it fails to work in some bibliography styles (which default to treating "others" as a name).
      >
      > See e.g. http://www.tug.org/TUGboat/tb27-2/tb87hufflen.pdf
      >
      > Good wishes,
      >
      > Colin.
      >
      I have written a short gawk script which replaces 2nd, 3rd, etc
      authors or editors by "and others". As Colin points out this is
      going to be helpful if the bibtex style file you choose supports
      "and others". In the hope it might be useful, here it is

      #gawk script to replace long editor lists with others $Revision: 1.3 $
      #
      #WBL 30 May 2012 Based on Mar 4 2008 gpbib_bbl.awk
      #WBL 6 Feb 2008

      #Inputs bibtex file
      #eg gawk -f bbl_others.awk ~/bibtex/gp-bibliography.bib > gp-bibliography.bib

      BEGIN {
      v = "$Revision: 1.3 $"; v = substr(v,2,length(v)-2);
      printf("%%bbl_others.awk.awk %s %s ",
      v,strftime());
      for(i=1;i<ARGC;i++) printf("%s ",ARGV[i]);
      printf("\n")
      }

      (FNR==1) {
      }

      (NF==0) { state=0; }
      ($2=="=" && NF>=3) { state=0; }
      (index($0,"%")==0 && state==0 && $2=="=" &&
      ($1=="author" || $1=="editor") && (n=split($0,t," and")) > 2) {
      state=1;
      printf("%s and others",t[1]);
      if(index(t[1]," \"")) printf("\",\n");
      else printf("},\n");
      #printf("%%");
      #for(i=2;i<n;i++) printf(" %s and",t[i]);
      #printf(" %s\n",t[n]);
      next;
      }

      (state==0) {print $0;}
      #(state!=0) {print "%"$0;}

      END{
      }
    • Bill LANGDON
      In case your mailer (like mine) has just trashed bbl_others.awk I have put a copy of it at
      Message 2 of 6 , Jun 2, 2012
      • 0 Attachment
        In case your mailer (like mine) has just trashed bbl_others.awk
        I have put a copy of it at
        http://www.cs.bham.ac.uk/~wbl/biblio/tools/README.html#bbl_others.awk
        Bill
      Your message has been successfully submitted and would be delivered to recipients shortly.