2

I am using biblatex with numeric style. I would like to set it so I can have colon ":" after authors only for book and thesis. For all the rest I need a coma.

I was trying to use

\renewcommand{\labelnamepunct}{\addcolon \space} 

which I found at Colon (:) instead of period (.) after author with biblatex, alphabetic, but it sets colon for all types of documents.

Please tell me how to do it.

3

I'd suggest you use

\renewcommand*{\labelnamepunct}{%
  \ifboolexpr{test {\ifentrytype{book}} or test {\ifentrytype{thesis}}}
    {\addcolon\space}
    {\addcomma\space}}

Then you can get away without patching the drivers and it is slightly more obvious what it is you are doing.

2

Ok. I've come up with an answer based on: biblatex: remove comma after last author only in book

In numeric thesis and book driver it is enough to change nametitledelim so I added:

\xpatchbibdriver{thesis}{\setunit{\printdelim{nametitledelim}}}{\setunit{\addcolon \addspace} }{}{}
\xpatchbibdriver{book}{\setunit{\printdelim{nametitledelim}}}{\setunit{\addcolon \addspace} }{}{}

To have coma for all the rest I used:

\renewcommand{\labelnamepunct}{\addcomma\space}

Now it works as it is supposed to :)

  • 1
    You should use {\addcomma\space} instead of {,\space}. – Alan Munn Jul 7 '16 at 21:14

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.