我正在biblatex
使用biblatex-nature
我使用 软件包来处理我的参考书目,但我发现一个怪现象:当参考书目条目包含页码时,DOI 和 URL 字段不会显示。我尝试natbib
使用该nature
软件包查看行为是否相同,但在这种情况下,DOI 和 URL 条目是排版的。
这肯定不是正确的行为,不是吗?无论如何,无论这是否是预期的行为,我如何才能让包biblatex-nature
始终显示 DOI 和 URL?强制使用和显示 DOI 和 URL 字段doi=true
没有url=true
帮助。我发现显示 URL 和 DOI 的唯一方法a:agrawal:2001:01
是删除该pages
字段。
梅威瑟:
\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}
\addbibresource{bib.bib}
\begin{document}
\noindent\parencite{a:agrawal:2001:01} \\
\parencite{a:brown:2013:01}
% Uncomment for natbib.
% \bibliographystyle{naturemag}
% \bibliography{bib}
\printbibliography
\end{document}
答案1
这里的行为是在主article
驱动程序中设置的:
\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}}
{}%
\setunit{\addspace}\newblock
\usebibmacro{issue+date}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{related}%
\usebibmacro{finentry}%
}
因此最简单的改变就是重新定义驱动程序
\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}%
\setunit{\addspace}\newblock
\usebibmacro{issue+date}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\usebibmacro{related}%
\usebibmacro{finentry}%
}
(如果愿意,您可以使用修补方法来实现此目的。)