[Tex/LaTex] bibtex DOI/URL in Helvetica font

bibtexdoifontshelveticatimes

Bibtex seems to force Times font style for DOI numbers, against my font style Helvetica.

Please consult:

\begin{filecontents*}{test.bib}
@article{foo2010,
  author = "Foo Bar",
  journal = "J.P.B.",
  year = 2010,
  title = "Where the wild things are.",
  doi = {10.1.1/jpb001},
  url = {http://dx.doi.org/10.1.1/jpb001}
}
\end{filecontents*}

\documentclass{article}

\usepackage{natbib,hyperref}

\usepackage{helvet}  % helvetica font
\renewcommand{\familydefault}{\sfdefault}
\usepackage{sfmath}  % helvetica for math mode too

\begin{document}
test \citet{foo2010}
\bibliographystyle{plainnat}
\bibliography{test}
\end{document}

Screenshot:

screenshot

Best Answer

natbib in the presence of hyperref uses the url package to format these and that package defines a sans serif style which you can invoke with

\urlstyle{sf}

For the DOI field, natbib defines the command \doi via something like \providecommand{\doi}[1]{doi: #1} which you can override with

\newcommand{\doi}[1]{doi: \url{#1}}

Sample output

\begin{filecontents*}{test.bib}
@article{foo2010,
  author = "Foo Bar",
  journal = "J.P.B.",
  year = 2010,
  title = "Where the wild things are.",
  doi = {10.1.1/jpb001},
  url = {http://dx.doi.org/10.1.1/jpb001}
}
\end{filecontents*}

\documentclass{article}

\usepackage{natbib,hyperref}

\usepackage{helvet}  % helvetica font
\renewcommand{\familydefault}{\sfdefault}
\usepackage{sfmath}  % helvetica for math mode too
\urlstyle{sf}
\newcommand{\doi}[1]{doi: \url{#1}}

\begin{document}
test \citet{foo2010}
\bibliographystyle{plainnat}
\bibliography{test}
\end{document}