斜体和常规“et al”分别表示作者和编辑

斜体和常规“et al”分别表示作者和编辑

我正在使用 gost-numeric 书目样式,并且遇到以下问题:我希望 et al 根据其上下文为斜体或常规,即在我的示例中,在作者列表中使用斜体,在编辑器列表中使用常规。

显然重新定义\renewbibmacro*{name:andothers},正如biblatex 中的格式化等以相同的方式影响这两者。

如何才能实现这一点呢?

更新:MWE

\documentclass[12pt]{article}
\begin{filecontents}{mybib.bib}
@INCOLLECTION{TatbulPrecisionRecallTime2018,
  AUTHOR = {Tatbul, Nesime and Lee, Tae Jun and Zdonik, Stan and Alam, Mejbah and Gottschlich, Justin},
  EDITOR = {Bengio, S. and Wallach, H. and Larochelle, H. and Grauman, K. and Cesa-Bianchi, N. and Garnett, R.},
  PUBLISHER = {Curran Associates, Inc.},
  ANNOTATION = {00012},
  BOOKTITLE = {Adv. in {{Neural Inf. Processing Systems}} 31},
  DATE = {2018},
  PAGES = {1920--1930},
  TITLE = {Precision and {{Recall}} for {{Time Series}}},
  langid = {english},
}
\end{filecontents}
\usepackage[backend=biber,
bibstyle=gost-numeric,
blockpunct=space,
otherlangs=true,
citestyle=numeric,
movenames=false,
sorting=none]{biblatex}
\addbibresource{mybib.bib}
\renewbibmacro*{name:andothers}{%
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\ifnumgreater{\value{liststop}}{1}
       {\finalandcomma}
       {}%
     \andothersdelim\bibstring{andothers}}
   {}}
 \begin{document}
 \cite{TatbulPrecisionRecallTime2018}
 \printbibliography
 \end{document}

在此处输入图片描述

答案1

这是一个使用名称包装器的稍微不同的解决方案。

我认为这个想法是将整个作者列表(包括可能的“et al.”)以斜体显示,并正常格式化编辑者列表。

biblatex-gostheading已经定义了一种在条目开头为作者调用的特殊名称格式。如果我们使用名称包装器,我们可以为整个名称列表获得斜体,并且只需重新定义\mkbibhdnamefamily即可避免双重斜体。

\documentclass[12pt]{article}

\usepackage[backend=biber,
  bibstyle=gost-numeric,
  citestyle=numeric,
  sorting=none,
  movenames=false,
  blockpunct=space,
  otherlangs=true,
]{biblatex}

\renewbibmacro*{name:andothers}{%
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\ifnumgreater{\value{liststop}}{1}
       {\finalandcomma}
       {}%
     \andothersdelim\bibstring{andothers}}
    {}}

\DeclareNameWrapperFormat{heading}{\mkgostheading{#1}}
\renewcommand*{\mkbibhdnamefamily}[1]{#1}

\begin{filecontents}{\jobname.bib}
@incollection{TatbulPrecisionRecallTime2018,
  author     = {Tatbul, Nesime and Lee, Tae Jun and Zdonik, Stan
                and Alam, Mejbah and Gottschlich, Justin},
  title      = {Precision and Recall for Time Series},
  editor     = {Bengio, S. and Wallach, H. and Larochelle, H.
                and Grauman, K. and Cesa-Bianchi, N. and Garnett, R.},
  booktitle  = {Adv. in Neural Inf. Processing Systems 31},
  date       = {2018},
  pages      = {1920--1930},
  publisher  = {Curran Associates, Inc.},
  annotation = {00012},
  langid     = {english},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\cite{TatbulPrecisionRecallTime2018}
\printbibliography
\end{document}

“Tatbul N. et al.”均以斜体表示

名称包装器是最近才添加的biblatex(它们是在 2018-10-30 的 v3.12 中添加的)。您可以在以下位置找到更多示例以及它与其他名称格式的比较Biblatex - 样式 authoryear - 大写作者

答案2

对于这个解决方案,我将使用该xpatch包,但是如果您愿意,也可以不用它。

首先,让我们删除方括号:

\xpatchbibmacro{name:andothers}{\mkbibbrackets}{}{}{}

然后我们创建新的宏name:andothers:itname:andothers:rm修改第一个宏,以便它andothers以斜体打印字符串:

\letbibmacro{name:andothers:it}{name:andothers}
\letbibmacro{name:andothers:rm}{name:andothers}
\xpatchbibmacro{name:andothers:it}{\bibstring}{\bibstring[\emph]}{}{}

最后,我们让驱动程序@incollection在打印作者列表和编辑、翻译等列表之前分别使用这两个新的宏:

\xpatchbibdriver{incollection}
  {\usebibmacro{author/translator+others}}
  {\letbibmacro{name:andothers}{name:andothers:it}\usebibmacro{author/translator+others}}
  {}
  {}
\xpatchbibdriver{incollection}
  {\usebibmacro{byauthor}}
  {\letbibmacro{name:andothers}{name:andothers:rm}\usebibmacro{byauthor}}
  {}
  {}

这是一个最小的工作示例:

\documentclass[12pt]{article}
\begin{filecontents}{mybib.bib}
 @INCOLLECTION{TatbulPrecisionRecallTime2018,
  AUTHOR = {Tatbul, Nesime and Lee, Tae Jun and Zdonik, Stan and Alam, Mejbah and Gottschlich, Justin},
  EDITOR = {Bengio, S. and Wallach, H. and Larochelle, H. and Grauman, K. and Cesa-Bianchi, N. and Garnett, R.},
  PUBLISHER = {Curran Associates, Inc.},
  ANNOTATION = {00012},
  BOOKTITLE = {Adv. in {{Neural Inf. Processing Systems}} 31},
  DATE = {2018},
  PAGES = {1920--1930},
  TITLE = {Precision and {{Recall}} for {{Time Series}}},
  langid = {english},
 }
\end{filecontents}
\usepackage[backend=biber,
bibstyle=gost-numeric,
blockpunct=space,
otherlangs=true,
citestyle=numeric,
movenames=false,
sorting=none]{biblatex}
\addbibresource{mybib.bib}

\usepackage{xpatch}
\xpatchbibmacro{name:andothers}{\mkbibbrackets}{}{}{}
\letbibmacro{name:andothers:it}{name:andothers}
\letbibmacro{name:andothers:rm}{name:andothers}
\xpatchbibmacro{name:andothers:it}{\bibstring}{\bibstring[\emph]}{}{}
\xpatchbibdriver{incollection}
  {\usebibmacro{author/translator+others}}
  {\letbibmacro{name:andothers}{name:andothers:it}\usebibmacro{author/translator+others}}
  {}
  {}
\xpatchbibdriver{incollection}
  {\usebibmacro{byauthor}}
  {\letbibmacro{name:andothers}{name:andothers:rm}\usebibmacro{byauthor}}
  {}
  {}    

\begin{document}
 \cite{TatbulPrecisionRecallTime2018}
 \printbibliography
\end{document}

这使:

在此处输入图片描述

编辑

您还可以\xpatchbibdrivers用以下代码替换这两个:

\xpretobibmacro{author/translator+others}{\letbibmacro{name:andothers}{name:andothers:it}}{}{}{}
\xpretobibmacro{byauthor}{\letbibmacro{name:andothers}{name:andothers:rm}}{}{}{}

相关内容