删除参考书目中的 doi 字段,但保留链接

删除参考书目中的 doi 字段,但保留链接

我有一些引用显示得相当丑陋,包括期刊后的 DOI,例如

J. Doe 和 J. Doe,“伟大的突破”,《自然通讯》13,10.1038/s12345-678-90123-4 (2022)。

我想删除这些10.1038/s12345-678-90123-4内容,但保留期刊名称作为可点击链接。我尝试设置doi=false和一些相关选项,但无济于事。如果我从文件doi中删除该字段references.bib,那么10.1038...将消失,但链接也会消失。

梅威瑟:

example.tex

\documentclass{scrartcl}

\usepackage[backend=biber,style=phys,doi=false,eprint=false,url=false]{biblatex}
\addbibresource{references.bib}

\usepackage{hyperref}
\begin{document}
Text~\cite{author1}

\printbibliography
\end{document}

references.bib

@Article{author1,
  author       = {Jane Doe and John Doe},
  date         = {2022-01},
  journaltitle = {Nature Communications},
  title        = {Great Breakthrough},
  doi          = {10.1038/s12345-678-90123-4},
  number       = {1},
  volume       = {13},
  publisher    = {Springer Science and Business Media {LLC}},
}

答案1

biblatex-physpages仅当字段不存在时才显示 DOI 。但如果pages不存在,它甚至会忽略该doi选项并始终显示 DOI。

如果你不想这样,你可以使用以下note+pages宏的重新定义

\renewbibmacro*{note+pages}{%
  \printfield{note}%
  \setunit{\bibpagespunct}%
  \printfield{pages}%
}

根据此定义,DOI 输出仅受doi选项控制。

\documentclass{scrartcl}

\usepackage[backend=biber,style=phys,doi=false,eprint=false,url=false]{biblatex}

\renewbibmacro*{note+pages}{%
  \printfield{note}%
  \setunit{\bibpagespunct}%
  \printfield{pages}%
}

\begin{filecontents}{\jobname.bib}
@article{author1,
  author       = {Jane Doe and John Doe},
  date         = {2022-01},
  journaltitle = {Nature Communications},
  title        = {Great Breakthrough},
  doi          = {10.1038/s12345-678-90123-4},
  number       = {1},
  volume       = {13},
  publisher    = {Springer Science and Business Media {LLC}},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\usepackage{hyperref}
\begin{document}
Text~\cite{sigfridsson,author1}

\printbibliography
\end{document}

J. Doe 和 J. Doe,“伟大的突破”,《自然通讯》13 (2022)。

相关内容