1

Currently, I use below code (from StackExchange) to 'linkify' parts of BibTeX entries:

FUNCTION {doilink}
{ duplicate$ empty$
  { pop$ "" }
  { doi empty$
      { skip$ }
      { "\href{https://doi.org/" doi * "}{" * swap$ * "}" * }
    if$
  }
  if$
}

Appending this command to, e.g., the code for format.title formats the title as a hyperlink:

FUNCTION {format.title}
{ title
  duplicate$ empty$ 'skip$
    { "t" change.case$ }
  if$
  "title" bibinfo.check
  duplicate$ empty$ 'skip$
    {
      emphasize
    }
  if$
  doilink
}

Question: How can I change the doilink code to use the url field when there is no doi field, and to do nothing if both are not present?

The solution should work with BibTeX (in particular, it should not require biblatex).

0

Your Answer

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

Browse other questions tagged or ask your own question.