所以我仍在写这篇大论文,今天我注意到我们在 .bib 文件中添加的注释没有显示在参考书目中。只有当我使用 apa 样式时才会发生这种情况。也许打印注释数据字段没有实现,就像 ISBN 一样?(Biblatex 未显示采用 APA 样式的 ISBN)否则,我做错了什么?
梅威瑟:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber,style=apa,citestyle=apa]{biblatex}
\DeclareLanguageMapping{english}{english-apa}
\addbibresource{sources.bib}
\begin{document}
Content. \parencite{something_one} More content \parencite{something-else_one} more content.
\printbibliography
\end{document}
以及 sources.bib 文件:
@online{something_one,
author = {Some One},
title = {Something},
year = {nodate},
url = {https://somesite.org/somepage},
urldate = {2017-12-19},
note = {I'm a note}
}
@online{something-else_one,
author = {Some One},
title = {Something else},
year = {nodate},
url = {https://somesite.org/someotherpage},
urldate = {2017-12-19},
note = {I'm another note}
}
答案1
除了上述评论之外,这是修补@online
条目类型驱动程序以包含该note
字段的方法。
- 查看文件
apa.bbx
并找到online
驱动程序(搜索\DeclareBibliographyDriver{online}
)。 - 查看此驱动程序并确定要将
note
字段放在哪里。大多数驱动程序将note
字段放在任何doi
或之前url
。 - 您将会看到,在该字段之前立即
doi
有一个\printfield{entrysubtype}
。 我们可以使用该驱动程序修补程序,在该字段后
xpatch
插入note
字段,并在其间添加句点和空格,如下所示:\usepackage{xpatch}% load the xpatch package \xpatchbibdriver{online}% patch the online driver: {\printfield{entrysubtype}}% replace this line {\printfield{entrysubtype}% with these lines \newunit\newblock \printfield{note}} {} {}
完整 MWE
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{something_one,
author = {Some One},
title = {Something},
year = {nodate},
url = {https://somesite.org/somepage},
urldate = {2017-12-19},
note = {I'm a note}
}
@online{something-else_one,
author = {Some One},
title = {Something else},
year = {nodate},
url = {https://somesite.org/someotherpage},
urldate = {2017-12-19},
note = {I'm another note}
}
\end{filecontents}
\usepackage[style=apa]{biblatex}
\DeclareLanguageMapping{english}{english-apa}
\usepackage{xpatch}
\xpatchbibdriver{online}
{\printfield{entrysubtype}}
{\printfield{entrysubtype}%
\newunit\newblock
\printfield{note}}
{}
{}
\addbibresource{\jobname.bib}
\pagestyle{empty}
\begin{document}
\nocite{*}
\printbibliography
\end{document}