I have a minor issue with biblatex and punctuation, when a field, say author, may be empty. I would like to insert a comma instead that a period, when author is defined, but I fail to do so without to insert a comma even when author is empty.

So I have




\defbibnote{A}{Group A}
\defbibnote{B}{Group B}

\printbibliography[prenote={A}, keyword=A] 
\printbibliography[prenote={B}, keyword=B] 

min.bib file is

%author = {NO Author},
label = {MM},
title = {aaa},
publisher = {book pub},
location = {myTown},
year = {2020},
 keywords = {A}

author = {mario myself},
title = {bbb},
publisher = {book pub},
location = {myTown},
year = {2020},
 keywords = {B}

I use a custom .bbx file, where \DeclareBibliographyDriver{book} is defined as:


The question is: how to hack \DeclareBibliographyDriver{book} to get a comma after the author just in case author is defined. Thks.

enter image description here

  • 2
    \renewcommand*{\labelnamepunct}{\addcomma\space} should be enough. – moewe Dec 8 '17 at 11:44
  • It seems it works. Thanks. How/where do I renew the command just for the Book case? – mario Dec 8 '17 at 14:41
  • Do you really want that? That would make things a tad inconsistent. Two possible solutions: \renewcommand*{\labelnamepunct}{\ifentrytype{book}{\addcomma\space}{\newunitpunct}}. Or you change the \setunit{\labelnamepunct} in the @book driver to \setunit{\addcomma\space} – moewe Dec 8 '17 at 14:43

biblatex has its punctuation tracker to make sure not to print punctuation when it is not needed (for example, if a field is missing/empty). You can read up on the punctuation tracker in §4.11.7 Using the Punctuation Tracker and §4.7 Punctuation and Spacing of the biblatex documentation

For this specific issue the punctuation lives in a dedicated macro, so


Should be enough.

You can restrict this change to @book only with


or by changing the line \setunit{\labelnamepunct}\newblock in \DeclareBibliographyDriver{book} to

  • Can you explain why you chose \space and not \addspace? – StrongBad Dec 8 '17 at 18:17
  • Ok, I am a old newbie: where do I learn about the punctuation tracker? Anyway, I got what I needed. Thks – mario Dec 8 '17 at 20:19
  • 1
    @StrongBad Good question! \addcomma‌​\space is a common biblatex idiom. Essentially \add<punct or space> removes preceding space, does some bookkeeping and prints <punct or space>. If we use \add<punct> that already removes preceding space and does bookkeeping so that an \addspace after that would not add anything useful (since it comes after \add<punct> we can be sure no unwanted space was introduced), so we can resort to the simpler \addcomma\space. If it appears alone \addspace is preferred over \space, but in combination with other \add<punct> it might not be needed. – moewe Dec 9 '17 at 10:40
  • @mario I updated the answer with two references. – moewe Dec 9 '17 at 10:41

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.