I am trying to modify apalike3.bst (see here) so that instead of printing the DOI number as a URL with hyperlink, it prints the actual DOI number but retains the hyperlink. The original DOI function is:
FUNCTION {format.doi} % doi
{
doi empty$
{ "" }
{ "\url{https://doi.org/" doi * "}" * }
if$
}
I'm trying to use \href
instead: I've tried some variations and I can make it print some words hyperlinked to the right webpage, but not a DOI number that changes with the article. I thought the following would work:
FUNCTION {format.doi} % doi
{
doi empty$
{ "" }
{ "\href{https://doi.org/" doi * "}{DOI:" doi * "}" * }
if$
}
but I get a the literal stack is empty
error when compiling the .bib
file. Any clue of what should be written instead?