每当有 DOI 可用时,我都会在参考书目中提供它而不是 URL。在这两种情况下,我urldate
还需要提供访问日期(字段)。我的问题:biblatex
在 DOI 后面加一个句号,这样接下来的访问于是大写的,但 URL 后面没有句号(所以没有大写)。这看起来不太统一。
如何删除 DOI 后的句号?
梅威瑟:
\documentclass{article}
\usepackage[
backend = biber,
style = authortitle,
]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{a,
author = {Lily},
title = {Trees},
journaltitle = {Journal of Trees},
year = {2015},
url = {www.trees.com},
urldate = {2016-11-21},
}
@article{b,
author = {John},
title = {Flowers},
journaltitle = {Journal of Flowers},
year = {2015},
doi = {17.7-31893.23},
urldate = {2016-11-21},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
答案1
给你。只需重新定义 bibmacro doi+eprint+url
:
\documentclass{article}
\usepackage[
backend = biber,
style = authortitle,
]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{a,
author = {Lily},
title = {Trees},
journaltitle = {Journal of Trees},
year = {2015},
url = {www.trees.com},
urldate = {2016-11-21},
}
@article{b,
author = {John},
title = {Flowers},
journaltitle = {Journal of Flowers},
year = {2015},
doi = {17.7-31893.23},
urldate = {2016-11-21},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\renewbibmacro*{doi+eprint+url}{%
\iftoggle{bbx:doi}
{\printfield{doi}}
{}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\setunit{\addspace}\newblock
\iftoggle{bbx:url}
{\usebibmacro{url+urldate}}
{}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}