我使用 Biblatex 的 authoryear 样式。对于具有 DOI 的文章,biblatex+biber 会自动在参考书目中生成以下内容:
DOI: 10.1162/qjec.2008.123.1.49
其中包含指向以下位置的超链接: https://doi.org/10.1162/qjec.2008.123.1.49
我想知道如何更改样式,以便 DOI 也显示完整链接,即显示:
并仍链接到相同的 URLhttps://doi.org/10.1162/qjec.2008.123.1.49
谢谢你!
梅威瑟:
\documentclass{article}
\usepackage{hyperref}
\usepackage[%url=false,eprint=false,
style=authoryear, backend=biber]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{GabaixLandier_2008,
author = {Gabaix, Xavier and Landier, Augustin},
doi = {10.1162/qjec.2008.123.1.49},
journal = {The Quarterly Journal of Economics},
number = {1},
pages = {49-100},
title = {Why has CEO Pay Increased So Much?},
volume = {123},
year = {2008},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\section{Introduction}
Dummytext~\autocite{GabaixLandier_2008}.
\printbibliography
\end{document}
答案1
加载后,将以下内容添加到您的序言中biblatex
:
\DeclareFieldFormat{doi}{%
\mkbibacro{DOI}\addcolon\space
\ifhyperref
{\href{https://doi.org/#1}{\nolinkurl{https://doi.org/#1}}}
{\nolinkurl{https://doi.org/#1}}}
答案2
使用
\DeclareFieldFormat{doi}{\mkbibacro{DOI}\addcolon\space\url{https://doi.org/#1}}