使用 biber 和 APA 从参考文献中删除月份和日期

使用 biber 和 APA 从参考文献中删除月份和日期

我的问题是,我的 biblatex 库中的“年份”字段未填充;相反,“日期”字段已填充,但除了年份外,还包括月份和日期。\usepackage[backend=biber, style=apa]{biblatex}然后打印日期和月份,尽管 APA 不允许这样做。我试过了,\AtEveryBibitem{\clearfield{month}}当然会清除错误的字段。我怎样才能从参考书目中删除月份和日期?

biblatex 条目如下所示:

@Article{breiman_random_2001,
  author       = {Breiman, Leo},
  title        = {Random Forests},
  volume       = {45},
  number       = {1},
  pages        = {5--32},
  issn         = {0885-6125, 1573-0565},
  date         = {2001-10-01},
  doi          = {10.1023/A:1010933404324},
  file         = {Full Text,
  journaltitle = {Machine Learning},
  langid       = {english},
  shortjournal = {Machine Learning},
  url          = {https://link.springer.com/article/10.1023/A:1010933404324},
  urldate      = {2018-04-17},
}

我的可重现乳胶代码如下所示:

\documentclass[11pt, a4paper]{article}
\usepackage[backend=biber, style=apa]{biblatex} %sorting=nyt, 
\bibliography{breiman}
\AtEveryBibitem{
    \clearfield{month}
    \clearfield{doi}
    \clearfield{url}
    \clearfield{note}
    \clearfield{chapter}  
    \clearfield{date}  
}
\DeclareLanguageMapping{english}{english-apa}

\begin{document}
    Random forests are cool \parencite{breiman_random_2001}.
    \printbibliography  
\end{document}

结果如下:

在此处输入图片描述

答案1

添加labeldate=year到包选项中是可行的。此外,隐藏 DOI 和 URL 字段也可以作为包选项来完成。

\begin{filecontents}{\jobname.bib}
@Article{breiman_random_2001,
  author       = {Breiman, Leo},
  title        = {Random Forests},
  volume       = {45},
  number       = {1},
  pages        = {5--32},
  issn         = {0885-6125, 1573-0565},
  date         = {2001-10-01},
  doi          = {10.1023/A:1010933404324},
  file         = {Full Text},
  journaltitle = {Machine Learning},
  langid       = {english},
  shortjournal = {Machine Learning},
  url          = {https://link.springer.com/article/10.1023/A:1010933404324},
  urldate      = {2018-04-17},
}
\end{filecontents}

\documentclass[11pt, a4paper]{article}
\usepackage[backend=biber, style=apa,labeldate=year,doi=false,eprint=false]{biblatex} %sorting=nyt, 
\addbibresource{\jobname.bib}

\DeclareLanguageMapping{english}{english-apa}

\begin{document}
    Random forests are cool \parencite{breiman_random_2001}.
    \printbibliography  
\end{document}

代码输出

相关内容