参照上图,我试图删除没有卷数和编号的文章的括号。我正在使用biblatex-philosophy
。volnumformat=parens
手册中没有其他简单的指南,只能进行我还不理解的困难编码。任何帮助都将不胜感激。以下是供您参考的代码。
\documentclass{memoir}
\usepackage[style=english]{csquotes}
\usepackage[style=philosophy-modern,backend=biber,volnumformat=parens]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{references.bib}
@article{Russell,
keywords = {article},
title={Article without volume and number},
journal={Journal of journaling},
author={Russell, Bertrand},
year={1900},
}
@article{Wittgenstein,
keywords = {article},
title={Article with volume and number},
author={Wittgenstein, Ludwig},
journal={Journal of journaling},
volume={6},
number={2},
year={1950},
}
\end{filecontents}
\addbibresource{references.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
答案1
biblatex-philosophy
不检查volume
字段是否提供,只是假设有一个,我们可以将其添加回来
\renewbibmacro*{volnumparens}{%
\ifboolexpr{ not test {\iffieldundef{volume}} or not test {\iffieldundef{number}} }
{\nopunct%
\printtext[pureparens]{%
\printfield{volume}%
\setunit*{\volnumpunct}%
\printfield{number}}}
{}}