# biblatex: relatedtype={bytranslator} does not work as expected with @article and @incollection

Yesterday I asked how to include the translation of a work in the bibliography in the form "translated by ... as ...". I was told to use the fields related={<key>} and relatedtype={bytranslator}. This worked very well for my purposes, at first. But then I realized that it works correctly only for @book, not for @article or @incollection. Take, for example, the following @incollection and its translation, which is an @article:

Derrida, Jacques (2001). “Une certaine possibilité impossible de dire l’événement”. In: Dire l’événement, est-ce possible? Paris: L’Harmattan, pages 79–112.

Derrida, Jacques (2007). “A certain impossible possibility of saying the event”. Translated by Gila Walker. In: Critical Inquiry 33.2, pages 441–461.

Combining the two with relatedtype={bytranslator} produces the following incomplete entry:

Derrida, Jacques (2001). “Une certaine possibilité impossible de dire l’événement”. In: Dire l’événement, est-ce possible? Paris: L’Harmattan, pages 79–112. Translated by Gila Walker as “A certain impossible possibility of saying the event” (2007).

The information about the journal and number in which the translation appeared is missing. That is, the entry should read (I think):

Derrida, Jacques (2001). “Une certaine possibilité impossible de dire l’événement”. In: Dire l’événement, est-ce possible? Paris: L’Harmattan, pages 79–112. Translated by Gila Walker as “A certain impossible possibility of saying the event”. In: Critical Inquiry 33.2 (2007), pages 441–461.

Here is a minimal example:

\documentclass[12pt]{article}

\usepackage{filecontents}

\begin{filecontents}{biblio.bib}
@incollection{Derrida2001,
author = {Derrida, Jacques},
title = {Une certaine possibilit\'{e} impossible de dire l'\'{e}v\'{e}nement},
location = {Paris},
publisher = {L'Harmattan},
year = {2001},
pages = {79-112},
booktitle = {Dire l'\'{e}v\'{e}nement, est-ce possible?},
related = {Derrida2007},
relatedtype = {bytranslator},
}
@article{Derrida2007,
author = {Derrida, Jacques},
translator = {Walker, Gila},
title = {A certain impossible possibility of saying the event},
journaltitle = {Critical Inquiry},
volume = {33},
number = {2},
year = {2007},
pages = {441-461},
}

\end{filecontents}

\usepackage[style=authoryear,abbreviate=false]{biblatex}

\begin{document}

Citing a text by \textcite{Derrida2001}.

\printbibliography

\end{document}


When I switch the translator, related, and relatedtype fields, (incorrectly) making the @incollection the translation of the @article, a similar truncation happens. Instead of

Derrida, Jacques (2007). “A certain impossible possibility of saying the event”. In: Critical Inquiry 33.2, pages 441–461. Translated by Gila Walker as “Une certaine possibilité impossible de dire l’événement”. In: Dire l’événement, est-ce possible? (Paris: L’Harmattan, 2001).

I get

Derrida, Jacques (2007). “A certain impossible possibility of saying the event”. In: Critical Inquiry 33.2, pages 441–461. Translated by Gila Walker as “Une certaine possibilité impossible de dire l’événement” (Paris: L’Harmattan, 2001).

That is, the title of the book in which the @incollection appeared is missing.

Is this a bug? If so, is there a way around it?

-

The default related:bytranslator macro works well only for @books and similar entry types (I think). In order to make it work for @in... types, we need to modify the macro a bit.

For each of these entry types that need some more output we check for that type and print the desired information (the code for that is taken from standard.bbx).

\makeatletter
\newbibmacro*{related:bytranslator}[1]{%
\entrydata{#1}{%
\renewbibmacro*{name:hook}[1]{%
\ifnumequal{\value{listcount}}{1}
{\begingroup
\mkrelatedstring%
\lbx@initnamehook{#1}%
\endgroup}
{}}%
\printnames[bytranslator]{translator}%
\clearname{translator}%
\usebibmacro{title}%
\ifentrytype{article}
{\usebibmacro{in:}%
\usebibmacro{journal+issuetitle}}
{}
\ifentrytype{inbook}
{\usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}}
{}
\ifentrytype{incollection}
{\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}}
{}
\ifentrytype{inproceedings}
{\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}}
{}
\printtext[parens]{%
\printlist{location}%
\iflistundef{publisher}
\printlist{publisher}%
\printdate}
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printfield{chapter}%
\setunit{\bibpagespunct}%
\printfield{pages}}}
\makeatother


MWE

\documentclass[12pt]{article}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@incollection{Derrida2001,
author = {Derrida, Jacques},
title = {Une certaine possibilit\'{e} impossible de dire l'\'{e}v\'{e}nement},
location = {Paris},
publisher = {L'Harmattan},
year = {2001},
pages = {79-112},
booktitle = {Dire l'\'{e}v\'{e}nement, est-ce possible?},
related = {Derrida2007},
relatedtype = {bytranslator},
}
@article{Derrida2007,
author = {Derrida, Jacques},
title = {A certain impossible possibility of saying the event},
journaltitle = {Critical Inquiry},
translator = {Walker, Gila},
volume = {33},
number = {2},
year = {2007},
pages = {441-461},
}

\end{filecontents}

\usepackage[style=authoryear,abbreviate=false]{biblatex}
\makeatletter
\newbibmacro*{related:bytranslator}[1]{%
\entrydata{#1}{%
\renewbibmacro*{name:hook}[1]{%
\ifnumequal{\value{listcount}}{1}
{\begingroup
\mkrelatedstring%
\lbx@initnamehook{#1}%
\endgroup}
{}}%
\printnames[bytranslator]{translator}%
\clearname{translator}%
\usebibmacro{title}%
\ifentrytype{article}
{\usebibmacro{in:}%
\usebibmacro{journal+issuetitle}}
{}
\ifentrytype{inbook}
{\usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}}
{}
\ifentrytype{incollection}
{\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}}
{}
\ifentrytype{inproceedings}
{\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}}
{}
\printtext[parens]{%
\printlist{location}%
\iflistundef{publisher}
\printlist{publisher}%
\printdate}
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printfield{chapter}%
\setunit{\bibpagespunct}%
\printfield{pages}}}
\makeatother
\begin{document}

Citing a text by \textcite{Derrida2001}.

\printbibliography

\end{document}


This might not work for all cases, so there might be some modifications to be done for corner cases.

-
Thanks for the prompt reply! Your solution works well for the primary case I cited, but it does not work for the (hypothetical) reverse case where I make the incollection the translation of the article. With your code, this produces: Derrida, Jacques (2007). “A certain impossible possibility of saying the event”. In: Critical Inquiry 33.2, pages 441–461. Translated by Gila Walker as “Une certaine possibilité impossible de dire l’événement”. In: Dire l’événement, est-ce possible? Translated by Gila Walker (Paris: L’Harmattan, 2001), pages 79–112. That is, "Translated by ..." appears twice. –  Wolfhart Mar 22 '14 at 15:34
@Wolfhart I have added a call to \clearname{translator} after the translator has been printed, that should prevent it from appearing twice. See the edited answer. Let me know if it works. –  moewe Mar 22 '14 at 15:38
It occurs to me that the reason for the double "translated by ..." in the reverse case may be that the translator field is ambiguous in this case, i.e., it is not immediately clear whether it refers only to the article in the collection or to the whole collection. –  Wolfhart Mar 22 '14 at 15:39
@Wolfhart I thought that as well, and indeed I think the ´translator field for @inbooks and the like refers to the whole book/collection, not the @in... work. Anyway, let me know what the edit gives you. –  moewe Mar 22 '14 at 15:41
Yes, the edit takes care of the reverse case. Thanks a lot! As for the question of the ambiguity of translator, I looked at the manual. For the entry type @article, the manual specifies that "editor and related fields refer to the journal while translator and related fields refer to the article", but it makes no such (or contrary) specification for @inbook or @incollection. So I guess it is a bit ambiguous, although the analogy with @article suggests that translator` refers only to the specific text, not the whole book or collection. –  Wolfhart Mar 22 '14 at 15:59