1

The model5-names.bst style from elsarticle.cls adds period after DOIs in the bibliography. I would like to remove it when DOI is present, but retain it in its absence.

For example:

Kanizsa, G. (1976). Subjective contours. Scientific American, 234(4), 48–52.

and

Kanizsa, G. (1976). Subjective contours. Scientific American, 234(4), 48–52. doi:123456789

but not

Kanizsa, G. (1976). Subjective contours. Scientific American, 234(4), 48–52. doi:123456789.

Thank you.

1 Answer 1

1

It's important to note that the style model5-names adds a period after all formatted entries, not just the ones that contain a doi field. To modify this behavior, you need to modify the function fin.entry in the bst file. Edit a copy of the bst file, not the original bst file.

Specifically, you should change the function from

FUNCTION {fin.entry}
{ add.period$
  write$
  newline$
}

to

FUNCTION {fin.entry}
{ doi empty$
    { add.period$ }
    { }
  if$
  write$
  newline$
}

Doing so will add a test of whether the doi field is empty; the add.period$ instruction is executed only if the test is true.

4
  • Thank you Mico for your altruism! You've saved me three times already :))).
    – Gaijin
    Oct 2, 2015 at 16:23
  • Mico, one more problem... :-( APA style requires "Retrieved from URL" if DOI is absent for an online article. Is there a way to do this in the model5-names.bst? Sorry for nagging you...
    – Gaijin
    Oct 2, 2015 at 16:44
  • @Gaijin - For a substantially new question, please post a new query. Separately, please consider upvoting (as well as accepting) answers you find helpful.
    – Mico
    Oct 2, 2015 at 16:54
  • Got it! Will post it as a separate question. Thank you!
    – Gaijin
    Oct 2, 2015 at 16:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .