1

Using the makebst routine, I have created a bst file which mostly conforms to what I need, the only exception being the incollection entry. Currently, here is how the reference is compiled as:

enter image description here

although, the reference style should be like this:

enter image description here

So there are three differences. The (eds) should be after the editors names, secondly, I need to remove the last comma after the last editor and finally after the publisher location and before the page numbers, there should be a semi colon and not a comma.

Here is link to a Gist with the full bst file for replication: https://gist.github.com/anonymous/d2c33f3ecc03f5f52109d4d291b68013

Here is the incollection function within my bst file:

FUNCTION {incollection}
{ output.bibitem
  format.authors "author" output.check
  author format.key output
  format.date "year" output.check
  date.block
  format.title "title" output.check
  new.block
  crossref missing$
    { format.in.ed.booktitle "booktitle" output.check
      format.publisher.address output
      format.bvolume output
      format.number.series output
      format.chapter.pages output
      new.sentence
      format.edition output
    }
    { format.incoll.inproc.crossref output.nonnull
      format.chapter.pages output
    }
  if$
  new.block
  format.note output
  fin.entry
}

The part that I have identified that need adapting which is called upon is format.in.ed.booktitle:

FUNCTION {format.in.ed.booktitle}
{ format.booktitle duplicate$ empty$ 'skip$
     {
       format.bvolume duplicate$ empty$ 'pop$
         { " " swap$ * * }
       if$
       editor "editor" format.names.ed duplicate$ empty$ 'pop$
         {
           bbl.editors
           " " * swap$ *
           swap$
           "" *
           ", " * swap$
           * }
       if$
       word.in swap$ *
     }
   if$
}

where bbl.editors has been redefined the produce (eds):

FUNCTION {bbl.editors}
{ "(eds)" }

Moreover, here is the exact bib entry:

@incollection{Greene2008,
address = {New York, NY},
author = {Greene, William},
booktitle = {The Measurement of Productive Efficiency and Productivity},
editor = {Fried, Harold O. and Lovell, C.A. Knox and Schmidt, Shelton S.},
pages = {92--250},
publisher = {Oxford University Press},
title = {{The Econometric Approach to Efficiency Analysis}},
year = {2008}
}

Please do let me know if you require any further code snippets or information to answer this question, any help would be gratefully received.

EDIT: I realise this may be a difficult question but what may be helpful is if someone can describe to me what is exactly going on in the second block of code, as it is here that I'm sure the problem and solution lie.

  • 1
    Bibtex hacking is pretty difficult. I wonder why you didn't choose biblatex. I made good experiences when creating biblatex-lni. – koppor Dec 11 '16 at 8:22
2

After several days, I've managed to fix the issue. Here are the amended sections if this is of interest to anyone in the future:

FUNCTION {format.in.ed.booktitle}
{ format.booktitle duplicate$ empty$ 'skip$
    {
      editor "editor" format.names.ed duplicate$ empty$ 'pop$
        {
          get.bbl.editor
          swap$ "" *
          " " * swap$ *
          swap$
          "," *
          " " * swap$
          * }
      if$
      word.in swap$ *
    }
  if$
}

As well as:

FUNCTION {incollection}
{ output.bibitem
  format.authors "author" output.check
  author format.key output
  format.date "year" output.check
  date.block
  format.title "title" output.check
  new.block
  crossref missing$
    { format.in.ed.booktitle "booktitle" output.check
      new.block
      format.publisher.address output
      new.block
      format.bvolume output
      format.number.series output
      format.chapter.pages output
      new.sentence
      format.edition output
      format.isbn output
    }
    { format.incoll.inproc.crossref output.nonnull
      format.chapter.pages output
    }
  if$
  format.doi output
  new.block
  format.note output
  fin.entry
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.