5

I am using Biblatex to produce a bibliography. Some Inbook entries have a crossref-field pointing at a book entry.

What I want to achieve is:

If only one of the child (inbook) entries is cited => inherit all available fields from the parent (book) entry.

If more than one of the child (inbook) entries are cited => print the parent (book) entry; only inherit some fields (e.g. bookauthor and title) to the child (inbook) entries.

I have tried to modify the Inheritance Setup via \DeclareDataInheritance. What I did was to add a \ifentryseen test, but this is not allowed in Inheritance Setups. Now, I have added to same test to the bibliography-driver. But \nocite doesn't seem to affect the \ifentryseen test.

Does someone have an idea what I could try next?

I have shortened the inbook bibliography driver a bit to make things easier. If both items are cited both inbook entries shoould output "..., in: Short Title"; if only one is cited: "..., in: Complete Title". Until now, \ifentryseen always expands to false.

MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=authortitle-ibid,backend=biber]{biblatex}
\bibliography{bib}
\usepackage{filecontents}

\begin{filecontents}{bib.bib}
@book{AGS,
author = {Adorno, Theodor W.},
title = {Gesammelte Schriften},
editor = {Tiedemann, Rolf},
location = {Frankfurt},
year = {2003},
}

@inbook{DDA,
author = {Horkheimer, Max and Adorno, Theodor W.},
title = {Dialektik der Aufklärung},
crossref = {AGS},
volume = {3},
}

@inbook{ND,
author = {Adorno, Theodor W.},
title = {Negative Dialektik},
crossref = {AGS},
volume = {6},
}
\end{filecontents}


\DeclareBibliographyDriver{inbook}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%
\ifentryseen{\thefield{crossref}}%
{Shortreference}
{Complete Reference}
\usebibmacro{finentry}}


\begin{document}
\cite{DDA}
\cite{ND}
\printbibliography
\end{document}
6

As discussed on Github, (https://github.com/plk/biblatex/issues/124) there will be a new test in the upcoming version of BibLaTeX: \ifentryinbib. Usage is exactly like \ifentryseen, except that it checks whether a specific entry is in the bibliography. The MWE should be modified like this:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=authortitle-ibid,backend=biber]{biblatex}
\bibliography{bib}
\usepackage{filecontents}

\begin{filecontents}{bib.bib}
@book{AGS,
author = {Adorno, Theodor W.},
title = {Gesammelte Schriften},
editor = {Tiedemann, Rolf},
location = {Frankfurt},
year = {2003},
}

@inbook{DDA,
author = {Horkheimer, Max and Adorno, Theodor W.},
title = {Dialektik der Aufklärung},
crossref = {AGS},
volume = {3},
}

@inbook{ND,
author = {Adorno, Theodor W.},
title = {Negative Dialektik},
crossref = {AGS},
volume = {6},
}
\end{filecontents}


\DeclareBibliographyDriver{inbook}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%
\ifentryinbib{\thefield{crossref}}%
{Shortreference}
{Complete Reference}
\usebibmacro{finentry}}


\begin{document}
\cite{DDA}
\cite{ND}
\printbibliography
\end{document}

Now, as the new test does not exist yet, it is necessary to enter this into the preamble to test it, or to use \ifentryinbib before BibLaTeX 2.7 is released:

\makeatletter
\let\ifentryinbib\blx@ifdata
\makeatother

With BibLaTeX 2.7 this won't be necessary.

  • (+1) But I'd really like to see the code filled out to make it a working example! – cfr Jul 23 '14 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.