I am using biblatex/biber and would like to have separate maxnames
values for author and editor lists. What is the cleanest way to do this?
2 Answers
Unfortunately I don't know what style you are using, but for the standard ones you may try to patch 4 macros (I hope I didn't forget any):
\usepackage{xpatch}
\xpretobibmacro{author}{\defcounter{maxnames}{2}}{}{}
\newcommand*{\defeditorcounter}{\defcounter{maxnames}{3}}
\xpretobibmacro{editor}{\defeditorcounter}{}{}
\xpretobibmacro{editor+others}{\defeditorcounter}{}{}
\xpretobibmacro{byeditor+others}{\defeditorcounter}{}{}
Not sure this is the cleanest way though.
-
It works like a charm and is very clean thanks to the use of
xpatch
.– equaegheJul 23, 2013 at 14:10 -
1@netzaffin your edit was ok, but it would be better to post it as an additional answer instead of an edit to the existing answer. Edits are just for formatting and rephrasing/clarification, we try to avoid substantial contributions to an answer written by different people, because it makes it more difficult to vote or comment on the different parts of the answer.– MarijnApr 5, 2020 at 12:08
As suggested, I will post my edit as answer:
\usepackage{xpatch}
\newcommand*{\defauthorcounter}{\defcounter{maxnames}{2}}
\newcommand*{\defeditorcounter}{\defcounter{maxnames}{3}}
\xpretobibmacro{author}{\defauthorcounter}{}{}
\xpretobibmacro{author+others}{\defauthorcounter}{}{}
\xpretobibmacro{editor}{\defeditorcounter}{}{}
\xpretobibmacro{editor+others}{\defeditorcounter}{}{}
\xpretobibmacro{byeditor+others}{\defeditorcounter}{}{}
- I've added a variable for the authors counter
- I've added author+others to match multiples authors