1

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

1

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}
  • This changes the style of the url but not of the doi number. There the style inserts locally \urlstyle{rm} – Ulrike Fischer Jul 4 '15 at 13:26
  • @UlrikeFischer Thansk I missed that - answer updated. – Andrew Swann Jul 4 '15 at 13:31
1

You could redefine the rm-urlstyle:

\documentclass{article}

\usepackage{natbib,hyperref}

\usepackage{helvet}  % helvetica font
\renewcommand{\familydefault}{\sfdefault}
%\usepackage{sfmath}  % helvetica for math mode too
\makeatletter
\def\url@rmstyle{%
  \def\UrlFont{\sffamily}}
 \makeatother 
\begin{document}
test \citet{foo2010}
\bibliographystyle{plainnat}
\bibliography{test}
\end{document}

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.