我正在尝试删除参考书目中文章的卷字段后面的点。我还没有找到可行的解决方案。我怀疑我需要重新定义setunit
使用\DeclareFieldFormat[article]{volume}
,但我还没有让它工作。有人知道我必须做什么才能删除这个点吗?
MWE 如下所示:
\documentclass[a4paper]{book}
\usepackage[style=numeric-comp,sorting=none,backend=biber,isbn=false,date=year,url=false]{biblatex}
\renewbibmacro{in:}{}
\AtEveryBibitem{
\iffieldundef{pages}{}{\clearfield{doi}}
}
\DeclareFieldFormat[article]{number}{}
\DeclareFieldFormat[article]{pages}{#1}
\renewcommand*{\bibpagespunct}{%
\ifentrytype{article}
{\addspace}
{\addcomma\space}}
\addbibresource{\jobname.bib}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Debnath2013,
author = {Debnath, Mainak and Dutta, Arpan and Biswas, Surajit and Das, Kalyan Kumar and Lee, Hon Man and V{\'{i}}cha, Jan and Marek, Radek and Marek, Jaromir and Ali, Mahammad},
doi = {10.1016/j.poly.2013.07.013},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Debnath et al. - 2013 - Catalytic oxidation of aromatic hydrocarbons by mono-oxido-alkoxidovanadium(V) complexes of ONNO donor ethylened.pdf:pdf},
issn = {02775387},
journal = {Polyhedron},
keywords = {benzoic acid,ethylenediamine- bis,phenolate,terpenes,toluene},
mendeley-tags = {benzoic acid,terpenes,toluene},
month = {oct},
number = {2},
pages = {189--198},
publisher = {Elsevier Ltd},
title = {{Catalytic oxidation of aromatic hydrocarbons by mono-oxido-alkoxidovanadium(V) complexes of ONNO donor ethylenediamine-bis(phenolate) ligands}},
url = {http://linkinghub.elsevier.com/retrieve/pii/S027753871300538X},
volume = {63},
year = {2013}
}
\end{filecontents}
\begin{document}
\cite{Debnath2013}
\printbibliography
\end{document}
答案1
添加的点在volume+number+eid
宏中是硬编码的,即standard.bbx
。一旦您想要删除日记帐编号(此宏期望),您可以重新定义它,而不是使用\DeclareFieldFormat[article]{number}{}
。使用:
\renewbibmacro{volume+number+eid}{%
\printfield{volume}%
\setunit{\addcomma\space}%
\printfield{eid}}
据我所知,此宏仅由article
中的驱动程序使用numeric-comp
,但我对此并不十分确定,因此需要注意一些不良影响。[请参阅下面的编辑]
完整的 MWE:
\documentclass[a4paper]{book}
\usepackage[style=numeric-comp,sorting=none,backend=biber,isbn=false,date=year,url=false]{biblatex}
\renewbibmacro{in:}{}
\AtEveryBibitem{
\iffieldundef{pages}{}{\clearfield{doi}}
}
%\DeclareFieldFormat[article]{number}{}
\renewbibmacro{volume+number+eid}{%
\printfield{volume}%
\setunit{\addcomma\space}%
\printfield{eid}}
\DeclareFieldFormat[article]{pages}{#1}
\renewcommand*{\bibpagespunct}{%
\ifentrytype{article}
{\addspace}
{\addcomma\space}}
\addbibresource{\jobname.bib}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Debnath2013,
author = {Debnath, Mainak and Dutta, Arpan and Biswas, Surajit and Das, Kalyan Kumar and Lee, Hon Man and V{\'{i}}cha, Jan and Marek, Radek and Marek, Jaromir and Ali, Mahammad},
doi = {10.1016/j.poly.2013.07.013},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Debnath et al. - 2013 - Catalytic oxidation of aromatic hydrocarbons by mono-oxido-alkoxidovanadium(V) complexes of ONNO donor ethylened.pdf:pdf},
issn = {02775387},
journal = {Polyhedron},
keywords = {benzoic acid,ethylenediamine- bis,phenolate,terpenes,toluene},
mendeley-tags = {benzoic acid,terpenes,toluene},
month = {oct},
number = {2},
pages = {189--198},
publisher = {Elsevier Ltd},
title = {{Catalytic oxidation of aromatic hydrocarbons by mono-oxido-alkoxidovanadium(V) complexes of ONNO donor ethylenediamine-bis(phenolate) ligands}},
url = {http://linkinghub.elsevier.com/retrieve/pii/S027753871300538X},
volume = {63},
year = {2013}
}
\end{filecontents}
\begin{document}
\cite{Debnath2013}
\printbibliography
\end{document}
导致:
编辑:为了安全起见,您可以根据 entrytype 进行条件更改,方法是:
\AtEveryBibitem{%
\ifentrytype{article}{%
\renewbibmacro{volume+number+eid}{%
\printfield{volume}%
\setunit{\addcomma\space}%
\printfield{eid}}%
}%
{}%
}
编辑2: moewe 在评论中确认,在标准样式中,volume+number+eid
确实仅由 entrytype 使用article
。因此,在这种情况下,采用最初提出的解决方案是完全安全的。
答案2
还有一种替代解决方案,可以清除该number
字段,\AtEveryBibitem
类似于您已经处理 DOI 的方式
\AtEveryBibitem{%
\iffieldundef{pages}
{}
{\clearfield{doi}}%
\ifentrytype{article}
{\clearfield{number}}
{}}
这样你就不需要重新定义宏了,但你得把每个 bibitem 都挂起来。如果你\fullcite
在任何地方使用,你都需要同样的宏\AtEveryCitekey
\AtEveryCitekey{%
\iffieldundef{pages}
{}
{\clearfield{doi}}%
\ifentrytype{article}
{\clearfield{number}}
{}}