# When author field is empty, do not put colon after prenote in authortitle-comp

Preemptive note: This is not a duplicate of Empty author field in BibTeX.

I am experiencing a weird thing with the authortitle-comp citation style where, if the author field is empty in a bibliographic record, a colon will still be set between the prenote field and the title field, like in footnote 2, where I'd expect the same behavior as in footnote 1:

Here's a minimum working example (never mind the umlauts and such):

\documentclass[12pt,paper=a4]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[style=authortitle-comp,backend=biber]{biblatex}

\begin{filecontents*}{bibliography.bib}
@Incollection{poppe,
Title = {Die Verwandlung},
Author = {Sandra Poppe},
Booktitle = {Kafka-Handbuch},
Booksubtitle = {Leben -- Werk -- Wirkung},
Editor = {Manfred Engel and Bernd Auerochs},
Publisher = {Metzler},
Year = {2010},
Pages = {164--174}
}

@Incollection{kindlerbio,
Title = {Kafka, Franz -- Biogramm},
Booktitle = {Kindlers Literatur Lexikon in 18 Bänden},
Publisher = {Metzler},
Year = {2009},
Edition = {3., völlig neu bearb. Aufl.},
Url = {http://www.munzinger.de/document/22000340100},
Urldate = {2014-07-11}
}
\end{filecontents*}

\bibliography{bibliography.bib}

\begin{document}
Some text,\footfullcite[Vgl.][]{poppe} and some other text as well.\footfullcite[Vgl.][]{kindlerbio}
\end{document}


I've been using some additional specifications in a biblatex.cfg file to tweak things according to how my department likes us to format bibliographies, cf. http://pastebin.com/1uZs4vtw (based on these modifications of authortitle-icomp for German studies by J. 'Mach' Wust). Without that file, things are generated as expected except there's a full stop after the author name instead of a colon, and further testing reveals that the following line is the culprit (this is a change that is suggested e.g. in Colon (:) instead of period (.) after author with biblatex, alphabetic, maybe the original author copied it from there, I don't know):

\renewcommand{\labelnamepunct}{\addcolon\addspace}


If it's that, how would this line have to be changed to not result in the problem I have? Changing this line to

\renewcommand{\nametitledelim}{\addcolon\addspace}


does not seem to have any effect.

• Just an aside: For kindlerbio the entry type @inreference might be more fitting than @incollection (in the standard styles though currently, the former is an alias for the latter). A @reference refers to "A [...] work of reference such as an encyclopedia or a dictionary." – moewe Aug 14 '14 at 6:24

The problem seems to lie with biblatex's punctuation tracker. Since author is a required field for @incollections, biblatex can - in a way - expect there to be one. (As a matter of fact, that is not the best of ideas, especially since @incollection is alias for @inreference in the standard styles, and @inreference entries don't always have authors one can easily find out about.)

So we will have to deal with the punctuation tracker and tell it not to print any colons, this can be done in two ways:

## Use \nopunct

We can reformat the prenote field to

\DeclareFieldFormat{prenote}{#1\isdot\nopunct}


This will always add \nopunct after the field, therefore suppressing any punctuation that might come directly after the prenote field (in some cases that superfluous colon; in most cases it will do absolutely nothing.)

## Use \printunit instead of \setunit

The prenote macro uses \setunit to print the \prenotedelim - the delimiter between the prenote and the citation proper - by default this is a space. We can modify the macro to use \printunit instead.

\renewbibmacro*{prenote}{%
\iffieldundef{prenote}
{}
{\printfield{prenote}%
\printunit{\prenotedelim}}}


biblatex employs this highly sophisticated punctuation tracker mechanism in order to make sure no superfluous punctuation is printed. If one uses the proper punctuation commands \setunit and friends, the punctuation is not printed immediately, it is merely stored in a "buffer" and printed when needed next - biblatex inserts punctuation before a field is printed.

Subsequent \setunits override each other so \setunit{A}\setunit{B}\setunit{C} will put A in the buffer, then overwrite it with B and then with C; so if punctuation is called for the next time (and no other command alters the buffer) "C" is printed.

With \printunit the punctuation is not overridden by a subsequent punctuation command, but persist in the buffer unit it is printed or reset by special commands.

The problem here was that the \prenotedelim was not actually printed until the next command printed anything, said command in the problematic case printed the title field, at which point the punctuation buffer had been overwritten with \labelnamepunct causing biblatex to print the colon. In the non-problematic case, the next command to print something was the author macro - no new punctuation had been inserted into the buffer at this point, so the \prenotedelim was printed as expected.

You can read more about this in the biblatex manual §4.11.7 Using the Punctuation Tracker, pp. 238-242 and §4.7.1 Block and Unit Punctuation, pp. 197 seq.

This problem is not visible if we don't redefine the \labelnamepunct. By default it is the same as \newunitpunct, which in turn defaults to \addperiod\space. biblatex is clever and avoids double periods/dots, it treats the "." at the end of "Vgl." as an abbreviation dot (thanks to the standard \DeclareFieldFormat{prenote}{#1\isdot} definition) so that it does not print "Vgl..", but "Vgl." - it suppresses the period inserted by \setunit; a dot-colon construct is possible though, so with a colon we get "Vgl.:" and the colon is not suppressed.

## MWE

I feel that using \printunit is the more appropriate solution in this case, choose what you like best.

\documentclass[12pt,paper=a4]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[style=authortitle-comp,backend=biber]{biblatex}

\begin{filecontents*}{\jobname.bib}
@Incollection{poppe,
Title = {Die Verwandlung},
Author = {Sandra Poppe},
Booktitle = {Kafka-Handbuch},
Booksubtitle = {Leben -- Werk -- Wirkung},
Editor = {Manfred Engel and Bernd Auerochs},
Publisher = {Metzler},
Year = {2010},
Pages = {164--174}
}

@inreference{kindlerbio,
Title = {Kafka, Franz -- Biogramm},
Booktitle = {Kindlers Literatur Lexikon in 18 Bänden},
Publisher = {Metzler},
Year = {2009},
Edition = {3., völlig neu bearb. Aufl.},
Url = {http://www.munzinger.de/document/22000340100},
Urldate = {2014-07-11}
}
\end{filecontents*}