6

When using the @set entry type in combination with the authoryear style in BibLaTeX, I obtain unexpected results. Instead of giving the correct year for each entry in the set, the year of the main entry gets repeated.

An example explains this better:

\begin{filecontents*}{\jobname.bib}
@SET{set,
  entryset = {original,translation}
}

@ARTICLE{original,
  author = {Author, A.},
  journal = {Journal de France},
  year = {1999}
}

@ARTICLE{translation,
  author = {Author, A.},
  journal = {American Journal},
  year = {2000},
  translator = {Traducteur, T.}
}
\end{filecontents*}

\documentclass{article}

\usepackage[style=authoryear]{biblatex}
\addbibresource{\jobname.bib}

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

Result of compilation

I would have expected the second appearance of 1999 to give 2000... Or maybe, that the bibliography style would change on subsequent set entries. Could someone clarify this to me or propose a workaround?

2
  • 2
    The second year should indeed be 2000. We're already looking at edits to date label handling, so this will get fixed soon. In the meantime you should consider using the (also biber-only) related entries feature. The entry vangennep:related from biblatex-examples.bib shows how you can relate an original work to its translation.
    – Audrey
    Aug 1, 2013 at 18:12
  • @Audrey understood my question better than myself. Her comment led to an acceptable answer. I will reformulate my question and give the answer myself.
    – michel
    Aug 2, 2013 at 12:17

1 Answer 1

4

You should probably use the the related and relatedtype fields instead of the @set entry type. There is a relatedtype called bytranslator defined by default. However, it is meant to be used in combination with @book entries rather than @article entries as in your case. But you can still define your own relatedtype as shown in the example below:

\begin{filecontents*}{\jobname.bib}
@ARTICLE{original,
  author = {Auteur, A.},
  journal = {Journal de France},
  year = {1999},
  title = {Always English},
  related = {translation},
  relatedtype = {articletranslatedin}
}

@ARTICLE{translation,
  author = {Author, A.},
  journal = {American Journal},
  year = {2000},
  title = {Always English},
  translator = {Traducteur, T.}
}
\end{filecontents*}

\documentclass{article}

\usepackage[style=authoryear]{biblatex}
\addbibresource{\jobname.bib}

\makeatletter
%% Here we basically just re-use code from different places in BibLaTeX
\newbibmacro*{related:articletranslatedin}[1]{%
 \entrydata{#1}{%
  \renewbibmacro*{name:hook}[1]{%
   \ifnumequal{\value{listcount}}{1}
    {\begingroup
     \mkrelatedstring%
     \lbx@initnamehook{#1}%
     \endgroup}
    {}}%
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{journal+issuetitle}%
  \setunit{\addspace}%
  \printtext[parens]{\printdate}
  \newunit
  \usebibmacro{note+pages}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
   {\printfield{issn}}
   {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
}}
\makeatother

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

Result after compilation

But be careful with this example. It is not very portable and expects the following:

  1. The author should be the same in both entries. It is therefore omitted in the related article. We do not check for differing names.
  2. The title is expected to be the same as well and is omitted for the second entry.

You must log in to answer this question.

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