Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Customising a biblatex style, I want to ensure that after the title of books only a space is used. If you take a look at one of the standard drivers:

\DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{maintitle+title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \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
  \printfield{pagetotal}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \usebibmacro{finentry}}

changing the part about the book title to read

  \usebibmacro{maintitle+title}%
  \setunit{\addspace}%

does not work as the various \newunit instructions seem to over-ride it even if no additional fields are printed. What's the correct way to say 'the next punctuation must always be just a space'?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

According to section 4.7.3 of the manual, the \nopunct macro "[a]dds an internal marker which will cause the next punctuation command to print nothing." The following seems to work:

  \usebibmacro{maintitle+title}%
  \nopunct
share|improve this answer
    
Excellent: I knew there would be a way, but was failing to find it. –  Joseph Wright Feb 27 '11 at 7:09

You could try to replace every following \newunit by \setunit*{\newunitpunct}, as the starred variant of \setunit prints the punctuation only if the previous command (\printtext, \printfield, \printlist, \printnames, \bibstring) was executed. Although I am not sure if this works, it is worth a try.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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