该\clearfield
命令应该在 中全局抑制问题编号biblatex
,但在下面的 MWE 中,它只抑制了参考书目中的问题编号,并且它在脚注中幽灵般地重新出现。这是为什么?我怎样才能在所有地方抑制问题编号?
\documentclass{article}
\usepackage[british]{babel}
\usepackage[autostyle]{csquotes}
\usepackage[style=oscola,backend=biber,ibidtracker=true,ibidstyle=lc,giveninits,ecli=true]{biblatex}
\AtEveryBibitem{%
\ifentrytype{article}{
\clearfield{issue}%
\clearfield{number}%
}{}}
\addbibresource{mylibrary.bib}
\begin{filecontents}{mylibrary.bib}
@article{VanderMeulen2013,
author = {van der Meulen, Bernd},
doi = {10.3390/laws2020069},
issn = {2075-471X},
journal = {Laws},
number = {2},
pages = {69--98},
title = {{The Structure of European Food Law}},
volume = {2},
year = {2013}
}
\end{filecontents}
\begin{document}
A sentence.\autocites{VanderMeulen2013}
\printbibliography
\end{document}
答案1
\AtEveryBibitem
仅适用于参考书目。如果您需要将\clearfield
s 也应用于引文,则可以使用\AtEveryCitekey
。但这当然会使您必须编写的代码行数增加一倍。
\documentclass{article}
\usepackage[british]{babel}
\usepackage[autostyle]{csquotes}
\usepackage[backend=biber,
style=oscola,
giveninits,
ibidtracker=true, ibidstyle=lc,
ecli=true,
]{biblatex}
\AtEveryBibitem{%
\ifentrytype{article}
{\clearfield{issue}%
\clearfield{number}}
{}}
\AtEveryCitekey{%
\ifentrytype{article}
{\clearfield{issue}%
\clearfield{number}}
{}}
\begin{filecontents}{\jobname.bib}
@article{VanderMeulen2013,
author = {van der Meulen, Bernd},
doi = {10.3390/laws2020069},
issn = {2075-471X},
journal = {Laws},
number = {2},
pages = {69--98},
title = {The Structure of {European} Food Law},
volume = {2},
year = {2013},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
A sentence.\autocites{VanderMeulen2013}
\printbibliography
\end{document}
为了从输出中完全删除字段,我通常更喜欢使用源映射解决方案,该解决方案在从.bib
文件中读取字段时删除这些字段。
\documentclass{article}
\usepackage[british]{babel}
\usepackage[autostyle]{csquotes}
\usepackage[backend=biber,
style=oscola,
giveninits,
ibidtracker=true, ibidstyle=lc,
ecli=true,
]{biblatex}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\pertype{article}
\step[fieldset=number, null]
\step[fieldset=issue, null]
}
}
}
\begin{filecontents}{\jobname.bib}
@article{VanderMeulen2013,
author = {van der Meulen, Bernd},
doi = {10.3390/laws2020069},
issn = {2075-471X},
journal = {Laws},
number = {2},
pages = {69--98},
title = {The Structure of {European} Food Law},
volume = {2},
year = {2013},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
A sentence.\autocites{VanderMeulen2013}
\printbibliography
\end{document}