The following code produces what are (to me) unexpected results and I would like to know where I am going wrong. Here's the code:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@bookinbook{robber-early-years,
crossref = {robber-robberies},
title = {Robbing Trains: The Early Years},
pages = {33-245}}
@inbook{robber-greatest,
crossref = {robber-robberies},
title = {My Greatest Robbery Yet},
pages = {456--468}}
@book{robber-robberies,
author = {Robber, Great Train},
title = {A Robber's Life},
year = 2014,
publisher = {Fictitious Emporium Ltd.},
address = {Somewhere}}
\end{filecontents}
\usepackage{biblatex}
\makeatletter
\renewcommand*{\intitlepunct}{\addspace}
% http://tex.stackexchange.com/a/10686/39222
\renewbibmacro{in:}{%
\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
\makeatother
\bibliography{\jobname.bib}
\begin{document}
\autocites{robber-early-years}{robber-greatest}
\printbibliography
\end{document}
What I expect this to do for entry types which use the bibmacro
in:
and which are not of type @article
is to use in
or In
followed by a breakable space rather than in
or In
followed by a colon etc. However, I get a full stop as well and I do not understand why:
I can avoid this by redefining the @inbook
entry type:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@bookinbook{robber-early-years,
crossref = {robber-robberies},
title = {Robbing Trains: The Early Years},
pages = {33-245}}
@inbook{robber-greatest,
crossref = {robber-robberies},
title = {My Greatest Robbery Yet},
pages = {456--468}}
@book{robber-robberies,
author = {Robber, Great Train},
title = {A Robber's Life},
year = 2014,
publisher = {Fictitious Emporium Ltd.},
address = {Somewhere}}
\end{filecontents}
\usepackage{biblatex}
\makeatletter
\renewcommand*{\intitlepunct}{\addspace}
% http://tex.stackexchange.com/a/10686/39222
\renewbibmacro{in:}{%
\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
\makeatother
\bibliography{\jobname.bib}
\makeatletter
\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:}%
% \usebibmacro{bybookauthor}%
% \newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\makeatother
\begin{document}
\autocites{robber-early-years}{robber-greatest}
\printbibliography
\end{document}
But this is surely not the best way to do this. It strikes me as odd that the driver for @inbook
tries to use the book author as well as the author. As I understand it, @inbook
and @bookinbook
are for precisely those cases in which the author of the whole is also the author of a distinct part. An example for @bookinbook
mentioned in the manual is the collected works of an author. But in that case, you would not expect a distinct author and it seems silly to include the author twice when laying out the entry.
This makes me think that I'm fundamentally misunderstanding something here - either about how the commands work or about the intended purpose of these entry types.
If I stick to the standard definition of in:
, I don't get spurious full stops but I do, of course, get the colon I wanted to get rid of. (This looks especially silly for non-article entries, in my view, and in
is altogether unnecessary for article entries so eliminating the colon seemed a good option. The comment in the code is to the question I took the code from but I cannot get it to work 'right'.)
Can anybody explain how to do this correctly and how these are intended to be used?