1

I struggle with biblatex's \noinherit command: it works as expected for most fields, but I can't get the urldate and subtitle not to be inherited.

The syntax I use is inspired from the examples p. 238 in biblatex 3.16 documentation. Here's a mwe, where the url is not inherited (as expected) but the urldate and subtitle are inherited (which is not wanted).

Edit: the work-around for urldate is to \noinherit{urlyear} adapted from Biblatex: Suppressing urldate does not work (\clearfield).

\documentclass{article}
\usepackage[
    style=authoryear,
    backend=biber,
]{biblatex}  
\DeclareDataInheritance{*}{periodical,inproceedings,inreference,inbook,incollection}{%
    \noinherit{url}
    \noinherit{urldate}
    \noinherit{subtitle}
}
% noinherit as expected: url, addendum, note, isbn, keywords
% don't noinherit: urldate, subtitle
\begin{filecontents}{\jobname.bib}
@book{main,
  editor     = {Famous, I Am},
  date       = {1998},
  title      = {Book title},
  subtitle   = {Very long and detailed subtle subtitle of the book},
  url        = {httpz://test.com},
  urldate    = {2022-09-15},
}
@inbook{sub,
  author       = {Known, Less},
  title        = {Nice chapter title},
  pages        = {579-588},
  crossref     = {main},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

output with unwanted urldate and subtitle fields

3
  • OK, so I just found that \noinherit{urlyear} does the job for the urldate, thanks to this. I'll edit the question, remains the subtitle problem.
    – letax
    Commented Sep 15, 2022 at 16:52
  • the subtitle problem looks like a bug, report it in the biblatex github tracker. Commented Sep 15, 2022 at 17:08
  • @UlrikeFischer thanks for the feedback, we'll see if a work-around shows up.
    – letax
    Commented Sep 15, 2022 at 17:36

1 Answer 1

1

subtitle is inherited because there is a more detailed inheritance rule set up for it in biblatex.def (ll. 1731-1741 v3.18)

\DeclareDataInheritance{book}{inbook,bookinbook,suppbook}{%
  \inherit{title}{booktitle}
  \inherit{subtitle}{booksubtitle}
  \inherit{titleaddon}{booktitleaddon}
  \noinherit{shorttitle}
  \noinherit{sorttitle}
  \noinherit{indextitle}
  \noinherit{indexsorttitle}
}

Your preamble code will come in later, but at that point the field will already have been inherited.

The only solution I see is to reset the whole inheritance model and block the ones you don't want. Of course this means you have to copy a lot of stuff from biblatex.def

\documentclass{article}
\usepackage[
    style=authoryear,
    backend=biber,
]{biblatex}  

\ResetDataInheritance

\DefaultInheritance{all=true,override=false}

\DeclareDataInheritance{mvbook,book}{inbook,bookinbook,suppbook}{%
  \inherit{author}{author}
  \inherit{author}{bookauthor}
}

\DeclareDataInheritance{mvbook}{book,inbook,bookinbook,suppbook}{%
  \inherit{title}{maintitle}
  \noinherit{subtitle}
  \noinherit{titleaddon}
  \noinherit{shorttitle}
  \noinherit{sorttitle}
  \noinherit{indextitle}
  \noinherit{indexsorttitle}
}

\DeclareDataInheritance{mvcollection,mvreference}
{collection,reference,incollection,inreference,suppcollection}{%
  \inherit{title}{maintitle}
  \noinherit{subtitle}
  \noinherit{titleaddon}
  \noinherit{shorttitle}
  \noinherit{sorttitle}
  \noinherit{indextitle}
  \noinherit{indexsorttitle}
}

\DeclareDataInheritance{mvproceedings}{proceedings,inproceedings}{%
  \inherit{title}{maintitle}
  \noinherit{subtitle}
  \noinherit{titleaddon}
  \noinherit{shorttitle}
  \noinherit{sorttitle}
  \noinherit{indextitle}
  \noinherit{indexsorttitle}
}

\DeclareDataInheritance{book}{inbook,bookinbook,suppbook}{%
  \inherit{title}{booktitle}
  \noinherit{subtitle}
  \noinherit{titleaddon}
  \noinherit{shorttitle}
  \noinherit{sorttitle}
  \noinherit{indextitle}
  \noinherit{indexsorttitle}
}

\DeclareDataInheritance{collection,reference}
{incollection,inreference,suppcollection}{%
  \inherit{title}{booktitle}
  \noinherit{subtitle}
  \noinherit{titleaddon}
  \noinherit{shorttitle}
  \noinherit{sorttitle}
  \noinherit{indextitle}
  \noinherit{indexsorttitle}
}

\DeclareDataInheritance{proceedings}{inproceedings}{%
  \inherit{title}{booktitle}
  \noinherit{subtitle}
  \noinherit{titleaddon}
  \noinherit{shorttitle}
  \noinherit{sorttitle}
  \noinherit{indextitle}
  \noinherit{indexsorttitle}
}

\DeclareDataInheritance{periodical}{article,suppperiodical}{%
  \inherit{title}{journaltitle}
  \noinherit{subtitle}
  \noinherit{titleaddon}
  \noinherit{shorttitle}
  \noinherit{sorttitle}
  \noinherit{indextitle}
  \noinherit{indexsorttitle}
}

\DeclareDataInheritance{*}{*}{%
  \noinherit{ids}
  \noinherit{crossref}
  \noinherit{xref}
  \noinherit{entryset}
  \noinherit{entrysubtype}
  \noinherit{execute}
  \noinherit{label}
  \noinherit{options}
  \noinherit{presort}
  \noinherit{related}
  \noinherit{relatedoptions}
  \noinherit{relatedstring}
  \noinherit{relatedtype}
  \noinherit{shorthand}
  \noinherit{shorthandintro}
  \noinherit{sortkey}
  \noinherit{url}
  \noinherit{urlyear}
}


% noinherit as expected: url, addendum, note, isbn, keywords
% also noinherit: urldate, subtitle
\begin{filecontents}{\jobname.bib}
@book{main,
  editor     = {Famous, I Am},
  date       = {1998},
  title      = {Book title},
  subtitle   = {Very long and detailed subtle subtitle of the book},
  url        = {httpz://test.com},
  urldate    = {2022-09-15},
}
@inbook{sub,
  author       = {Known, Less},
  title        = {Nice chapter title},
  pages        = {579-588},
  crossref     = {main},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

Famous, I Am, ed. (1998). Book title. Very long and detailed subtle subtitle of the book. url: httpz://test.com (visited on 09/15/2022).
Known, Less (1998). “Nice chapter title”. In: Book title. Ed. by I Am Famous, pp. 579–588.

3
  • Great, it works nicely and does save a few lines in the bibliography... Should we consider this as a feature or should I report it as a bug as Ulrike Fischer suggested in her comment? Thanks anyhow.
    – letax
    Commented Sep 18, 2022 at 14:40
  • @letax I would say it is an artefact of the current implementation. If it bothers you, you can open an issue at github.com/plk/biblatex/issues and it can be discussed. I'm guessing that it would need changes in Biber code to make sure that rules are first collected, "cleaned up" and then executed rather than pretty much executed directly. The hassle of implementing that might not be worth it, but I wouldn't know.
    – moewe
    Commented Sep 18, 2022 at 16:34
  • Nothing crucial, but I submitted an issue here \noinherit subtitle #1245
    – letax
    Commented Sep 19, 2022 at 9:36

You must log in to answer this question.

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