Biblatex:不要为电子版打印“访问日期”

Biblatex:不要为电子版打印“访问日期”

我正在使用 Zotero 来管理参考书目:它会自动添加条目,urldatearxiv以文本形式添加到最终文档中visited on <date>

在此处输入图片描述

我怎样才能摆脱它,但只对有字段的条目有效eprint?(我想保留visited on常规网站):

梅威瑟:

\documentclass[]{article}

\usepackage{filecontents}

\begin{filecontents}{biblio.bib}
@online{ABC,
  title = {My title},
  author = {Some, One},
  date = {2021-04-10},
  eprint = {0102.34567},
  eprinttype = {arxiv},
  primaryclass = {quant-ph},
  url = {http://arxiv.org/abs/0102.34567},
  urldate = {2021-04-13},
  abstract = {blabla},
  archiveprefix = {arXiv}
}

@online{WWW,
  title = {{{WEBSITE}}},
  author = {{Author WebSite}},
  url = {https://example.org/},
  urldate = {2021-09-13},
  abstract = {Some abstract.},
  langid = {english},
  organization = {{Organization}},
}

\end{filecontents}

% BibLatex > Bibtex
\usepackage[backend=biber,style=trad-alpha]{biblatex}
\addbibresource{biblio.bib}
% Remove "visited on" for
%\usepackage{xpatch}
%\xpatchbibdriver{online}{urldate}{}{}{}

\begin{document}

Eprint like~\cite{ABC} should \emph{not} contain the ``visited on'', while normal web pages should~\cite{WWW}.

\printbibliography

\end{document}

答案1

感谢 moewe 的评论(谢谢!)我能够得出一个映射,该映射删除带有 的条目的urls和,或删除不带有 的条目(这意味着我只插入不带有 的元素的url )。查看更多示例urldateeprinttype@online@onlineeprinttype这里Dynamic Modification of Data或在BibLaTex 手册

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      % If it contains a field eprinttype...
      \step[fieldsource=eprinttype, final]
      % ... remove the urldate and url
      \step[fieldset=urldate, null]
      \step[fieldset=url, null]
    }
    \map{
      % If it is not @online, always remove urldate and url
      \pernottype{online}
      % ... remove the urldate and url
      \step[fieldset=urldate, null]
      \step[fieldset=url, null]
    }
  }
}

相关内容