![斜体和常规“et al”分别表示作者和编辑](https://linux22.com/image/428900/%E6%96%9C%E4%BD%93%E5%92%8C%E5%B8%B8%E8%A7%84%E2%80%9Cet%20al%E2%80%9D%E5%88%86%E5%88%AB%E8%A1%A8%E7%A4%BA%E4%BD%9C%E8%80%85%E5%92%8C%E7%BC%96%E8%BE%91.png)
我正在使用 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-gost
heading
已经定义了一种在条目开头为作者调用的特殊名称格式。如果我们使用名称包装器,我们可以为整个名称列表获得斜体,并且只需重新定义\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}
名称包装器是最近才添加的biblatex
(它们是在 2018-10-30 的 v3.12 中添加的)。您可以在以下位置找到更多示例以及它与其他名称格式的比较Biblatex - 样式 authoryear - 大写作者。
答案2
对于这个解决方案,我将使用该xpatch
包,但是如果您愿意,也可以不用它。
首先,让我们删除方括号:
\xpatchbibmacro{name:andothers}{\mkbibbrackets}{}{}{}
然后我们创建新的宏name:andothers:it
并name: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}}{}{}{}