1

Previously, including a DOI in a IEEEtran-styled bibliography has been discussed on TexExchange under the title DOI in IEEEtran bibliography and a solution has been provided in form of a patch [1]. However, the solution does not feature a hyperlink for the DOI. One of the particular benefits of using a DOI is the universal and unique URL that links to the respective archive: http://dx.doi.org/ + «DOI»

How can I make the DOI "clickable", i.e. provide a seamless (hyperref) hyperlink that will open a webbrowser when I click on the DOI?

[1] https://gist.github.com/ezod/3373556

2
  • 1
    It would be great if you could show us what you have tried. Posting a minimal working example that indicates what you are trying to do makes it easier for people to understand what you want. It also makes it easier for people to help you, since they have some code to start from, and hence much more likely that some one will try to help you.
    – user30471
    Oct 6, 2017 at 9:00
  • Seems to not quite be a MWE as there are other pieces of code needed to get this piece of code functioning in the bst file.
    – Stephen
    Mar 12, 2020 at 1:26

3 Answers 3

2

The patch provides a function for inserting the DOI:

%% DOI

FUNCTION {format.doi}
{ doi empty$
    { "" }
    { this.to.prev.status
      this.status.std
      cap.yes 'status.cap :=
      name.doi.prefix " " *
      "\doi{" * doi * "}" *
      punct.no 'this.status.punct :=
      punct.period 'prev.status.punct :=
      space.normal 'this.status.space :=
      space.normal 'prev.status.space :=
      quote.no 'this.status.quote :=
    }
  if$
}

Replace the line which inserts the DOI

"\doi{" * doi * "}" *

by

"\href{http://dx.doi.org/\doi{" * doi * "}}{\doi{" * doi * "}}" *

to yield the augmented DOI that includes a hyperlink.

That is, the function is replaced with the code %% DOI

FUNCTION {format.doi}
{ doi empty$
    { "" }
    { this.to.prev.status
      this.status.std
      cap.yes 'status.cap :=
      name.doi.prefix " " *
      "\href{http://dx.doi.org/\doi{" * doi * "}}{\doi{" * doi * "}}" *
      punct.no 'this.status.punct :=
      punct.period 'prev.status.punct :=
      space.normal 'this.status.space :=
      space.normal 'prev.status.space :=
      quote.no 'this.status.quote :=
    }
  if$
}
1

Recently. I got the helpful hints thanks to the ticket #394811. However, I had to modify the existing statements to append a DOI (Digital Object Identifier) in the reference section of the T-CE journal (Transactions on Consumer Electronics). So, I modified the below statements as follows.

  name.doi.prefix ", " *
  "doi: \href{http://dx.doi.org/" * doi * "}{\doi{" * doi * "}}" *
  name.doi.postfix ". " *

The content of the " FUNCTION {format.doi}" is as folows.

%% DOI
%% added by GQMJr
%% Modified by Geunsik Lim on Apr-05-2020 for T-CE.
FUNCTION {format.doi}
{ doi empty$
    { "" }
    { this.to.prev.status
      this.status.std
      cap.yes 'status.cap :=
      name.doi.prefix ", " *
      "doi: \href{http://dx.doi.org/" * doi * "}{\doi{" * doi * "}}" *
      name.doi.postfix ". " *
      punct.no 'this.status.punct :=
      punct.period 'prev.status.punct :=
      space.normal 'this.status.space :=
      space.normal 'prev.status.space :=
      quote.no 'this.status.quote :=
    }
  if$
}

And then, The DOI is successfully generated. :)

1

I had to modify this a bit more to get it to work for me:

%% DOI
%% added by GQMJr
%% Modified by Geunsik Lim on Apr-05-2020 for T-CE.
%% Modified again by Calvin Love on Dec-15-2021
FUNCTION {format.doi}
{ doi empty$
{ "" }
{ this.to.prev.status
this.status.std
cap.yes 'status.cap :=
name.doi.prefix ", " *
"doi: \href{http://dx.doi.org/" * doi * "}{" * doi * "}" *
name.doi.postfix ". " *
punct.no 'this.status.punct :=
punct.period 'prev.status.punct :=
space.normal 'this.status.space :=
space.normal 'prev.status.space :=
quote.no 'this.status.quote :=
}
if$
}

...hoping this helps someone

1
  • 1
    Welcome to TeX.SE! Can you please explain, what you changed or added to the code? Then your answer is better understandable ...
    – Mensch
    Dec 15, 2021 at 19:47

You must log in to answer this question.

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