biblatex chem-biochem 书目缩进

biblatex chem-biochem 书目缩进

在我在另一个问题中对 chem-biochem biblatex 样式的一些修改获得非常有用的建议之后,我还有一件事想改变:

默认情况下,chem-biochem 会在参考书目条目的第一行创建一个小缩进。如果可能的话,我想去掉它,并像大多数其他样式一样右对齐。

谢谢你! 例子

答案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}

在此处输入图片描述

相关内容