答案1
biblatex-chem
仍然chem-biochem
使用一些 3.3 之前的代码。请参阅Biblatex 3.3 名称格式。特别是你需要用\ifblank
替换\ifdefvoid
。
\renewbibmacro*{name:family-given}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifdefvoid{#3}{}
{\mkbibnameprefix{#3\isdot}%
\ifprefchar{}{\addhighpenspace}}%
\mkbibnamefamily{#1\isdot}%
\ifdefvoid{#2}{}
{\addcomma\addlowpenspace
\mkbibnamegiven{#2}\isdot}%
\ifdefvoid{#4}{}
{\addlowpenspace
\mkbibnamesuffix{#4}\isdot}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibnamefamily{#1}\isdot
\ifboolexpe{%
test {\ifdefvoid{#2}}
and
test {\ifdefvoid{#3}}}
{}
{\addcomma}%
\ifdefvoid{#2}{}
{\addlowpenspace
\mkbibnamegiven{#2}\isdot}%
\ifdefvoid{#3}{}
{\addlowpenspace
\mkbibnameprefix{#3}\isdot}%
\ifdefvoid{#4}{}
{\addlowpenspace
\mkbibnamesuffix{#4}\isdot}}%
}
使用旧宏的定义chem-biochem.bbx
与新名称格式不太兼容,在某些情况下会导致出现虚假空格。这就是您看到的不正确的缩进。
修复你的 MWEchem-biochem 选项不起作用变成
\documentclass{article}
\usepackage[style=chem-biochem, biblabel=brackets]{biblatex}
\addbibresource{biblatex-examples.bib}
\makeatletter
\renewcommand*{\bibleftbracket}{\blx@postpunct[}
\renewcommand*{\bibrightbracket}{\blx@postpunct]\midsentence}
\makeatother
\DeclareFieldFormat{labelnumber}{#1}
\renewbibmacro*{name:family-given}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifdefvoid{#3}{}
{\mkbibnameprefix{#3\isdot}%
\ifprefchar{}{\addhighpenspace}}%
\mkbibnamefamily{#1\isdot}%
\ifdefvoid{#2}{}
{\addcomma\addlowpenspace
\mkbibnamegiven{#2}\isdot}%
\ifdefvoid{#4}{}
{\addlowpenspace
\mkbibnamesuffix{#4}\isdot}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibnamefamily{#1}\isdot
\ifboolexpe{%
test {\ifdefvoid{#2}}
and
test {\ifdefvoid{#3}}}
{}
{\addcomma}%
\ifdefvoid{#2}{}
{\addlowpenspace
\mkbibnamegiven{#2}\isdot}%
\ifdefvoid{#3}{}
{\addlowpenspace
\mkbibnameprefix{#3}\isdot}%
\ifdefvoid{#4}{}
{\addlowpenspace
\mkbibnamesuffix{#4}\isdot}}%
}
\begin{document}
\cite{sigfridsson}
\printbibliography
\end{document}