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

2 Answers 2

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}
2
  • This changes the style of the url but not of the doi number. There the style inserts locally \urlstyle{rm} Jul 4, 2015 at 13:26
  • @UlrikeFischer Thansk I missed that - answer updated. Jul 4, 2015 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

You must log in to answer this question.

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