4

In my bibliography, I have a case where the author of an @Inbook entry is the same as the editor of the book:

@Book{ducktales, Booktitle={Ducktales}, Editor = {Donald Duck}, Year = {2001}}

@Inbook{intro, Title={Introduction}, Crossref = {ducktales}, Author = {Donald Duck}, Pages = {1-10}}

The bibliography entry appears like this:

Donald Duck: Introduction. In: Ducktales (2001), Published by Donald Duck.

However, if the author is the same as the editor, I'd like to have the editor replaced by author. So the entry should look like this:

Donald Duck: Introduction. In: Ducktales (2001), Published by author.

How can I do that?

3
  • Which bibliography style do you use at present?
    – Mico
    Apr 26, 2014 at 14:45
  • I'm using authoryear-ibid with biblatex.
    – Bob
    Apr 26, 2014 at 16:26
  • Thanks. I've taken the liberty of deleting the "bibtex" tag and adding a "biblatex" tag.
    – Mico
    Apr 26, 2014 at 17:17

1 Answer 1

4

We can redefine the byeditor macros to print \bibstring[\mkibid]{idem\thefield{gender}} whenever editor and author are the same

\renewbibmacro*{byeditor}{%
  \ifnameundef{editor}
    {}
    {\usebibmacro{bytypestrg}{editor}{editor}%
     \setunit{\addspace}%
     \ifnamesequal{author}{editor}
       {\bibstring[\mkibid]{idem\thefield{gender}}}
       {\printnames[byeditor]{editor}}%
     \newunit}%
  \usebibmacro{byeditorx}}

\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {\usebibmacro{byeditor+othersstrg}%
     \setunit{\addspace}%
     \ifnamesequal{author}{editor}
       {\bibstring[\mkibid]{idem\thefield{gender}}}
       {\printnames[byeditor]{editor}}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}}

Of course, you can \bibstring[\mkibid]{idem\thefield{gender}} by anything you like above (for example: author).

You can do the same for byauthor

\renewbibmacro*{bybookauthor}{%
  \ifnamesequal{author}{bookauthor}
    {\bibstring[\mkibid]{idem\thefield{gender}}}
    {\printnames{bookauthor}}}

If you prefer the output "author" instead of "idem".

\NewBibliographyString{author}
\DefineBibliographyStrings{english}{author = {author}}
\DefineBibliographyStrings{german}{author = {Autor}}

and replace every line

{\bibstring[\mkibid]{idem\thefield{gender}}}

above by

{\bibstring{author}}

MWE

\documentclass{article}
\usepackage[style=authoryear-ibid]{biblatex}
\addbibresource{biblatex-examples.bib}

\providecommand*{\mkibid}[1]{#1}
\renewbibmacro*{bybookauthor}{%
  \ifnamesequal{author}{bookauthor}
    {\bibstring[\mkibid]{idem\thefield{gender}}}
    {\printnames{bookauthor}}}

\renewbibmacro*{byeditor}{%
  \ifnameundef{editor}
    {}
    {\usebibmacro{bytypestrg}{editor}{editor}%
     \setunit{\addspace}%
     \ifnamesequal{author}{editor}
       {\bibstring[\mkibid]{idem\thefield{gender}}}
       {\printnames[byeditor]{editor}}%
     \newunit}%
  \usebibmacro{byeditorx}}

\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {\usebibmacro{byeditor+othersstrg}%
     \setunit{\addspace}%
     \ifnamesequal{author}{editor}
       {\bibstring[\mkibid]{idem\thefield{gender}}}
       {\printnames[byeditor]{editor}}%
     \clearname{editor}%
     \newunit}%
  \usebibmacro{byeditorx}%
  \usebibmacro{bytranslator+others}}

\begin{document}
  \nocite{kant:kpv,westfahl:space}
  \printbibliography
\end{document}

enter image description here

You must log in to answer this question.

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