2

I would like to change "ed." to "eds.", if there is more than one Editor for @inproceedings in biblatex.

Here is an MWE:

 \documentclass{article} 
 
 % required for \xpatchbibmacro
\usepackage{xpatch}
 
 \usepackage{csquotes}
 
 \usepackage[
backend=biber, 
defernumbers=true, 
style=numeric, 
autocite = superscript,
date=year, 
]
{biblatex}

% Some general changes for reference format
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\bibinitdelim}{}
\renewbibmacro*{in:}{%
    \iffieldequalstr{entrytype}{inproceedings}{%
        \printtext{\bibstring{in}\addspace}%
    }{}%
}


% Changes for Book
\csletcs{abx@macro@publisher+location+date@orig}{abx@macro@publisher+location+date}
\renewbibmacro*{publisher+location+date}{%
    \printtext[parens]{\usebibmacro{publisher+location+date@orig}}
}
\DeclareFieldFormat[book]{title}{#1\printunit{\addspace}}


% Changes for inproceedings
\DeclareFieldFormat[inproceedings]{title}{#1\isdot}
\DeclareFieldFormat{booktitle}{#1\addcomma}
\xpatchbibmacro{byeditor+others}{%
    \usebibmacro{byeditor+othersstrg}%
    \setunit{\addspace}%
    \printnames[byeditor]{editor}%
    \clearname{editor}%
}{%
    \printnames[byeditor]{editor}%
    \clearname{editor}
    \addcomma\addspace
    \bibstring{editor}
    \setunit{\addspace}%
}{}{}

\begin{filecontents}[force]{\jobname.bib}

@inproceedings{moraux,
  author       = {Moraux, Paul},
  editor       = {Lloyd, G. E. R. and Owen, G. E. L.},
  title        = {Le \emph{De Anima} dans la tradition gr{\`e}cque},
  date         = 1979,
  booktitle    = {Aristotle on Mind and the Senses},
  subtitle     = {Quelques aspects de l'interpretation du trait{\'e}, de
                  Theophraste {\`a} Themistius},
  booktitleaddon= {Proceedings of the Seventh Symposium Aristotelicum},
  eventdate    = 1975,
  publisher    = cup,
  location     = {Cambridge},
  pages        = {281-324},
  keywords     = {secondary},
  langid       = {french},
  indexsorttitle= {De Anima dans la tradition grecque},
  indextitle   = {\emph{De Anima} dans la tradition gr{\`e}cque, Le},
  shorttitle   = {\emph{De Anima} dans la tradition gr{\`e}cque},
  annotation   = {This is a typical \texttt{inproceedings} entry. Note the
                  \texttt{booksubtitle}, \texttt{shorttitle},
                  \texttt{indextitle}, and \texttt{indexsorttitle} fields. Also
                  note the \texttt{eventdate} field.},
}

@inproceedings{salam,
  author       = {Salam, Abdus},
  editor       = {Svartholm, Nils},
  title        = {Weak and Electromagnetic Interactions},
  date         = 1968,
  booktitle    = {Elementary particle theory},
  booksubtitle = {Relativistic groups and analyticity},
  booktitleaddon= {Proceedings of the {Eighth Nobel Symposium}},
  eventdate    = {1968-05-19/1968-05-25},
  venue        = {Aspen{\"a}sgarden, Lerum},
  publisher    = {Almquist \& Wiksell},
  location     = {Stockholm},
  pages        = {367-377},
}
    
\end{filecontents}


\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

And here is the output:

enter image description here

I would like to change G. E. R. Lloyd and G. E. L. Owen, ed. to G. E. R. Lloyd and G. E. L. Owen, eds., while keeping Nils Svartholm, ed., as is.

(If it were possible to change Nils Svartholm, ed. to N. Svartholm, ed., at the same time, bliss, but I understand that should be a separate question.)

Many thanks!

EDIT

The solution provided by @moewe was certainly successful for the MWE I provided.

Unfortunately, my MWE was too minimal (?supramimimal) and omitted an important aspect of the bibliography, namely that the bibstyle=authoryear.

A new MWE incorporating @moewe's solution and the new problems caused by bibstyle=authoryear are shown below.

\documentclass{article}
\usepackage{xpatch}
\usepackage{csquotes}
\usepackage[
  backend=biber,
  style=numeric,
  bibstyle=authoryear,
  defernumbers=true,
  autocite = superscript,
  date=year,
]{biblatex}

\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\bibinitdelim}{}
\renewcommand*{\intitlepunct}{\addspace}
\renewbibmacro*{in:}{%
  \ifentrytype{inproceedings}
    {\bibstring{in}%
     \printunit{\intitlepunct}}
    {}%
}




\letbibmacro{publisher+location+date@orig}{publisher+location+date}
\renewbibmacro*{publisher+location+date}{%
  \printtext[parens]{\usebibmacro{publisher+location+date@orig}}
}
\DeclareFieldFormat[book]{title}{#1\printunit{\addspace}}

\DeclareFieldFormat[inproceedings]{title}{#1\isdot}
\DeclareFieldFormat{booktitle}{#1\addcomma}
\letbibmacro{byeditor+others}{editor+others} % gives double title

\addbibresource{biblatex-examples.bib}

\begin{document}
\nocite{moraux,salam,baez/article}
\printbibliography
\end{document}

The relevant output is: enter image description here

The problems are:

(1) @article now have two titles and dates. I would like to retain Author (Date). Title etc. (not the second occurence of Title (Date),

(2) In @article, the titles are in inverted commas.

(3) In @inproceedings, the names of the Editors are replaced by a dash.

(4) In @inproceedings, ed. has become Ed., and eds. has become Eds..

Thank you!

3
  • Some of these new issues have nothing to do with the modifications for "ed."/"eds.". Please ask about them in separate questions. I'll only address (3) and (4), since those are related to what I did below.
    – moewe
    Commented Dec 6, 2023 at 5:25
  • Thank you very much, @moewe
    – Bob
    Commented Dec 6, 2023 at 6:51
  • Though I would point out that your much appreciated addition \letbibmacro{byeditor+others}{editor+others} seems to be responsible for the double title. (The double title goes away if this line is commented out.) Though, as you say, this issue may not be strictly related to the eds. issue.
    – Bob
    Commented Dec 6, 2023 at 7:01

1 Answer 1

3

The patch to byeditor+others only contains an explicit \bibstring{editor} and does not check if there are multiple editors. This could be changed by copying the relevant bits from the editor+others bibmacro, but since that would only make byeditor+others a copy of editor+others, we can just use \letbibmacro to make the copy directly.

\documentclass{article}
\usepackage{xpatch}
\usepackage{csquotes}
\usepackage[
  backend=biber,
  style=numeric,
  defernumbers=true,
  autocite = superscript,
  date=year,
]{biblatex}

\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\bibinitdelim}{}
\renewcommand*{\intitlepunct}{\addspace}
\renewbibmacro*{in:}{%
  \ifentrytype{inproceedings}
    {\bibstring{in}%
     \printunit{\intitlepunct}}
    {}%
}

\letbibmacro{publisher+location+date@orig}{publisher+location+date}
\renewbibmacro*{publisher+location+date}{%
  \printtext[parens]{\usebibmacro{publisher+location+date@orig}}
}
\DeclareFieldFormat[book]{title}{#1\printunit{\addspace}}

\DeclareFieldFormat[inproceedings]{title}{#1\isdot}
\DeclareFieldFormat{booktitle}{#1\addcomma}
\letbibmacro{byeditor+others}{editor+others}

\addbibresource{biblatex-examples.bib}

\begin{document}
\nocite{moraux,salam}
\printbibliography
\end{document}

Paul Moraux. Le De Anima dans la tradition gr` ecque. Quelques aspects de l’interpretation du trait´ e, de Theophraste à Themistius. In Aristotle on Mind and the Senses, Proceedings of the Seventh Symposium Aristotelicum (1975). G. E. R. Lloyd and G. E. L. Owen, eds. (Cambridge: Cambridge University Press, 1979), pp. 281–324.
Abdus Salam. Weak and Electromagnetic Interactions. In Elementary particle theory. Relativistic groups and analyticity, Proceedings of the Eighth Nobel Symposium (Aspenäsgarden, Lerum, May 19–25, 1968). Nils Svartholm, ed. (Stockholm: Almquist & Wiksell, 1968), pp. 367–377.


If you use authoryear or authortitle (or any other style that supports the dashed option) as bibliography style, you will have to manually copy the standard definition of editor+others into byeditor+others, since those styles overwrite editor+others with a definition that implements the dashes, which we do not want in the middle of our entries.

\documentclass{article}
\usepackage{xpatch}
\usepackage{csquotes}
\usepackage[
  backend=biber,
  style=authoryear,
  defernumbers=true,
  autocite = superscript,
  date=year,
]{biblatex}

\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\bibinitdelim}{}
\renewcommand*{\intitlepunct}{\addspace}
\renewbibmacro*{in:}{%
  \ifentrytype{inproceedings}
    {\bibstring{in}%
     \printunit{\intitlepunct}}
    {}%
}

\letbibmacro{publisher+location+date@orig}{publisher+location+date}
\renewbibmacro*{publisher+location+date}{%
  \printtext[parens]{\usebibmacro{publisher+location+date@orig}}
}
\DeclareFieldFormat[book]{title}{#1\printunit{\addspace}}

\DeclareFieldFormat[inproceedings]{title}{#1\isdot}
\DeclareFieldFormat{booktitle}{#1\addcomma}
\renewbibmacro*{byeditor+others}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\printnames{editor}%
     \setunit{\printdelim{editortypedelim}}%
     \usebibmacro{editor+othersstrg}%
     \clearname{editor}}
    {}}

\addbibresource{biblatex-examples.bib}

\begin{document}
\nocite{moraux,salam}
\printbibliography
\end{document}
2
  • Thank you very @moewe. Unfortunately, my style file is hacked from numerous stackexchange answers and is much more complicated than my MWE. When I tried your solution everything fell to pieces, which I am sure reflects my poor latex skills rather than your answer. I also tried to copy the relevant bits of editor+others bibmacro to \xpatchbibmacro{byeditor+others} but my biblatex skills are weak. I have upvoted your answer, which is certainly correct given the MWE I provided.
    – Bob
    Commented Dec 4, 2023 at 8:38
  • Magic! Thank you so much, @moewe. Your solution also solves the double title problem, so double magic! Thanks very much again.
    – Bob
    Commented Dec 6, 2023 at 7:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .