Citation with DOI that has underscore breaks functionality in BibDesk
For your particular example (of the unified.bst
) style, it suffices to add the following line to your preamble (and load the hyperref
package)
\newcommand{\doi}[1]{\textsc{doi}: \href{http://dx.doi.org/#1}{\nolinkurl{#1}}}
The MWE
\documentclass{article}
\usepackage{natbib}
\usepackage{hyperref}
\begin{filecontents}{\jobname.bib}
@article{chomsky1977b,
Author = {Chomsky, Noam and Lasnik, Howard},
Doi = {10.1007/978-94-015-6859-3_4},
Journal = {Linguistic Inquiry},
Keywords = {control theory, syntax},
Number = {3},
Pages = {425-504},
Title = {Filters and Control},
Volume = {8},
Year = {1977}}
\end{filecontents}
\newcommand{\doi}[1]{\textsc{doi}: \href{http://dx.doi.org/#1}{\nolinkurl{#1}}}
\begin{document}
\citet{chomsky1977b}
\bibliographystyle{unified}
\bibliography{\jobname}
\end{document}
then yields
If you look at your .bst
, i.e. the BibTeX style file, there should be a function formating the DOI output.
There you could use \href
from the hyperref
package and \detokenize
as mentioned here or here, you can do something like
FUNCTION {format.doilink}
{ duplicate$ empty$
{ pop$ "" }
{ doi empty$
{ skip$ }
{ "{,\ doi:~\href{http://dx.doi.org/" * doi * "}{\detokenize{" * doi * "}}}" * }
if$
}
if$
}
which is based on the naming used in style files of the elsevier BibTeX files, so your function in the .bst
file might differ in naming. The function above pouts a “doi:” in front, as your example suggests. So you could just search your style file for that and change the output after that.
There is a nice solution to similar issue by Roly in Missing $ inserted issue, who recommends to use \usepackage[strings]{underscore}
.
The package arranges that, while in text, ‘_’ itself behaves as \textunderscore (the behaviour of _ in maths mode is not affected).