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.

The following code shows, that an exclamation mark in the title of a bib entry removes the field separator (here: a comma) which separates the title from the journal. How can this be avoided? If the title does not contain the exclamation mark, the comma is correctly printed.

Note: you have to run the code twice (first, bib.bib has to be generated)

\documentclass{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{blindtext}
\usepackage[
backend=bibtex,
style=authoryear,
sorting=ydnt
]{biblatex}

\usepackage{filecontents}
% remove "!" and the comma separator will be there
\begin{filecontents*}{bib.bib}
@article{mykey,
  author={TeX, L.},
  journal={Journal of LaTeX questions},
  pages={1--10},
  title={{Minimal title!}},
  volume={1},
  number={1},
  year={2011}}
\end{filecontents*}

% bibliography
\renewcommand*{\newunitpunct}{\addcomma\space}
\DeclareFieldFormat*{title}{#1}
\renewbibmacro*{in:}{}

\addbibresource{bib.bib}% bibliography data

\begin{document}
\blindtext[1]
\textcite{mykey}
\printbibliography
\end{document}
share|improve this question
1  
would putting braces around the ! get around this problem? –  barbara beeton Jan 31 '13 at 19:37

1 Answer 1

up vote 5 down vote accepted

In my opinion, biblatex is correct in omitting the comma separator after a title that ends with a period, question mark, or exclamation mark. If you insist on adding a comma even in those cases, use a literal , instead of \addcomma:

\renewcommand*{\newunitpunct}{,\space}
share|improve this answer
    
Thanks a lot, lockstep, precisely what I was looking for. –  Marius Hofert Jan 31 '13 at 20:08

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.