2

I am using gost-numeric bibliography style and I have the following issue: I want et al to be italics or regular depending on its context, i.e. in my example in italics in author list and in regular in editor list.

Obviously redefining \renewbibmacro*{name:andothers}, as it is suggested in Formatting et al in biblatex affects both of these in the same way.

How is it possible to make this work?

Update: 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}

enter image description here

2 Answers2

3

For this solution I will use the xpatch package but if you want you can do without it.

First of all, let's remove the square brackets:

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

Then we create the new macros name:andothers:it and name:andothers:rm and modify the first one so that it prints the string andothers in italics:

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

Finally we make the driver @incollection use these two new macros, respectively, before printing the list of authors and the list of editors, translators, etc.:

\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}}
  {}
  {}

Here is a minimal working example:

\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}

which gives:

enter image description here

Edit

You can also replace the two \xpatchbibdrivers with this:

\xpretobibmacro{author/translator+others}{\letbibmacro{name:andothers}{name:andothers:it}}{}{}{}
\xpretobibmacro{byauthor}{\letbibmacro{name:andothers}{name:andothers:rm}}{}{}{}
Ivan
  • 4,368
  • Awesome, thank you for the solution, Ivan, that worked great! – Peter Mukhachev Feb 16 '21 at 14:18
  • I edited the answer: the result is the same, but now it prevents andothers from being printed in italics in the lists following author/translator + others, which you most likely don't want – Ivan Feb 16 '21 at 14:33
  • Yes, and also this way I no longer need to patch each driver individually, because basically I need the same with inproceedings. – Peter Mukhachev Feb 16 '21 at 15:05
  • Also, when I made et al italics by default for all publication types with \DefineBibliographyStrings, I had to swap name:andothers:it and name:andothers:rm in your examples. – Peter Mukhachev Feb 16 '21 at 15:10
2

Here is a slightly different solution using name wrappers.

I figured that the idea is to have the whole author list (including possible "et al."s) in italics and to format the editor list normally.

biblatex-gost already defines a special name format called heading for the authors at the beginning of the entry. If we make use of the name wrapper, we can get italics for the entire name list and only need to redefine \mkbibhdnamefamily to avoid double italics.

\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." all in italics

Name wrappers are a fairly recent addition to biblatex (they were added in v3.12 from 2018-10-30). You can find some more examples and how it compares to other possibilities of name formatting at Biblatex - style authoryear - author in capital.

moewe
  • 175,683