Why does the nature biblatex style not always show the DOI and URL?

I am using biblatex with the biblatex-nature package for my bibliography, and I've come across a peculiarity where the DOI and URL fields are not shown when the bibliographic entry includes the page numbers. I tried natbib with the nature package to see whether the behaviour was the same, but, in that case, the DOI and URL entries are typeset.

Surely that can't be the right behaviour, can it? Either way, whether this is the intended behaviour, how can I get the biblatex-nature package to always show the DOI and URL? Forcing the DOI and URL fields to be shown with doi=true and url=true does not help. The only way I found to get a:agrawal:2001:01 to show the URL and DOI is by removing the pages field.

MWE:

\documentclass{article}

\begin{filecontents*}{bib.bib}
@Article{a:agrawal:2001:01,
title         = {Phenotypic Plasticity in the Interactions and Evolution of Species},
author        = {Agrawal, Anurag A.},
journal       = {Science},
year          = {2001},
month         = oct,
volume        = {294},
number        = {5541},
pages         = {321--326},
doi           = {10.1126/science.1060701},
url           = {http://dx.doi.org/10.1126/science.1060701},
}

@Article{a:brown:2013:01,
title         = {What Evolvability Really Is},
author        = {Brown, Rachael L.},
journal       = {The British Journal for the Philosophy of Science},
year          = {2013},
month         = aug,
doi           = {10.1093/bjps/axt014},
url           = {http://dx.doi.org/10.1093/bjps/axt014},
}
\end{filecontents*}

% \usepackage[numbers]{natbib} % Uncomment for natbib.
\usepackage[backend=biber,style=nature]{biblatex}

\begin{document}
\noindent\parencite{a:agrawal:2001:01} \\
\parencite{a:brown:2013:01}

% Uncomment for natbib.
% \bibliographystyle{naturemag}
% \bibliography{bib}

\printbibliography
\end{document}


• It's deliberate, and as it's matches the journal I'm not likely to change the distribution version. Logic is that if you have page numbers for an article, the correct reference will be journal/year/volume/pages even if there is a DOI. On the other hand, for an article without pages the DOI if available may be used: the article is likely 'in press'. – Joseph Wright Dec 10 '13 at 13:24
• @JosephWright Thanks for the quick reply. I was not sure whether this was the intended behaviour because the nature package for natbib gave different results. Despite that, would it be possible to force the DOI and/or URL to always be shown? – sudosensei Dec 10 '13 at 13:27
• What a style for natbib does is neither here nor there: the definitive reference is the journal itself. I've posted an approach in an answer. – Joseph Wright Dec 10 '13 at 13:28
• @JosephWright Yes, I get that. I should have checked the journal guidelines. Apologies for that. – sudosensei Dec 10 '13 at 13:33

The behaviour here is set up in the main article driver:

\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\iftoggle{bbx:articletitle}
{%
\usebibmacro{title}%
\newblock
}
{}%
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{note+pages}%
\newunit
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\iffieldundef{pages}% KEY PART HERE
{\usebibmacro{doi+eprint+url}}
{}%
\usebibmacro{issue+date}%
\newunit\newblock
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{related}%
\usebibmacro{finentry}%
}


Thus the easiest change is to simply redefine the driver

\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\iftoggle{bbx:articletitle}
{%
\usebibmacro{title}%
\newblock
}
{}%
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{note+pages}%
\newunit
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\usebibmacro{issue+date}%
\newunit\newblock
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{related}%
\usebibmacro{finentry}%
}


(You can do this using patching approaches if you prefer.)

• Thanks for the answer. I'll definitely use that, unless there's a way to get the url=true functionality. Is that possible? No problem if it is not. I just thought it would be neat for the package to provide that option. Your work and help is appreciated either way! :-) – sudosensei Dec 10 '13 at 13:35
• @sudosensei An option is certainly possible, but I'd need a name. As doi is already taken, and really means something else, what about doi-ignore-pages? – Joseph Wright Dec 10 '13 at 13:48
• Anything really. How about show-doi and show-url? That way, it is possible to disable the DOI and enable the URL, regardless of whether page numbers are provided. I like having a URL when sending papers to my supervisor. If I'm ever lucky enough to write something up for Nature, I can just get the intended behaviour by setting both options to false. – sudosensei Dec 10 '13 at 14:09
• This may be a long shot, but has anything happened in this matter? – Ian Apr 20 '17 at 11:19
• @ian_itor As noted on my comment on the question, this is 'by design' as it's what the journal does: that has to be the model. – Joseph Wright Apr 20 '17 at 11:20