2

I'm trying to switch to biblatex/biber. I started using the authortitle style for the bibliography. For my thesis I need lots of changes in the style. Along the way I changed the separator between entry fields in the bibliography to be a comma and not a dot. For that I used the following command:

\renewcommand*{\newunitpunct}{\addcomma\space}

Later when I added an article with a question mark in it's title, I realised that my redefinition of \newunitpunct must've destroyed some automated punctuation recognitions. Or at least, that's what I think the problem is. Because when I remove the redefinition I end up with dots as separators but the "punctuation recognition" works.

Any idea how I can solve this?

Thanks!

P.S. I've included a working sample.

\documentclass{scrartcl}
%
\usepackage[%
backend=biber,%
citestyle=authortitle-comp,%
bibstyle=authortitle,%
]{biblatex}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{filecontents}
\usepackage{verbatim}
\usepackage{csquotes}
%
\addbibresource{\jobname.bib} 
\renewbibmacro{in:}{% kein 'in' bei @article
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
%
 \makeatletter
\DeclareFieldFormat[article]{title}{{#1%\isdot
}}
\makeatother
% 
%
% ==== This is the problem, I think...When I delete this line it works.
\renewcommand*{\newunitpunct}{\addcomma\space}

% === BIB
\begin{filecontents}{\jobname.bib}
@article{test,
    author  ={Test Author},
    title   ={Interesting Title?},
    journal ={Journal},
    year    ={2018},
}
\end{filecontents}
%
\begin{document}
% ===
\printbibliography[title=Bibliography]
    This is an example.\footcite{test}\\
I wanted the separator between entry fields to be a comma not a dot. Thats why I changed it to \verb|\addcomma|.\\ But it seems like \verb|\newunitpunct| was configured to \enquote{know} if there were punctuations in the title. Now because of my changes it \verb|\newunitpunct| doesn't recognise those punctuations anymore. Thus I end up with \enquote{\textbf{?,}}
instead of \enquote{\textbf{?}}.\\  
    How can I make it work?
\end{document}
2
  • 1
    This is the intended behaviour. biblatex tries to avoid a full stop/period running in with other punctuation marks, but a question mark and comma are considered OK.
    – moewe
    Apr 25, 2018 at 13:12
  • @moewe Understood. Any ideas how I can configure that "punctuation recognition" for commas as well?
    – texnewbie
    Apr 25, 2018 at 13:16

1 Answer 1

3

\DeclarePunctuationPairs is the command you are looking for. That command is language-specific and must therefore live in \DefineBibliographyExtras.

\DefineBibliographyExtras{german}{\DeclarePunctuationPairs{comma}{*}}

This set-up always swallows the comma after all punctuation except an abbreviation dot.


The command is documented in §4.7.5 Configuring Punctuation and Capitalization on pp. 246-247 of the biblatex manual

The syntax is \DeclarePunctuationPairs{<identifier>}{<characters>}

The command declares the punctuation marks that <identifier> can follow without being dropped.

The <identifier> selects the command to be configured. The identifiers correspond to the names of the punctuation commands from §4.7.3 without the \add prefix, i.e., valid <identifier> strings are dot, comma, semicolon, colon, period, exclam, question. The <characters> argument is an undelimited list of punctuation marks. Valid <characters> are comma, semicolon, colon, period, exclamation mark, question mark, and asterisk. A period in the <characters> argument denotes an end-of-sentence period, an asterisk the dot after an abbreviation.

The default value

\DeclarePunctuationPairs{comma}{*!?}

for the comma allows the combinations "!,", "?," and ".," (if the dot signifies an abbreviation). You don't want the "?," and "!,", so you want the setting

\DeclarePunctuationPairs{comma}{*}
3
  • Your additional explanation helped a lot. Thanks!
    – texnewbie
    Apr 25, 2018 at 13:38
  • What about ")"? How can I tell biblatex to put a comma after a closing bracket?
    – rsa-krypto
    Mar 14, 2019 at 10:46
  • 1
    @rsa-krypto Normally commas after closing brackets should not be swallowed, so I don't think \DeclarePunctuationPairs would help here. I'm not quite sure what you are after, though. Would it be possible to ask a new question with MWE that shows the use case that you have in mind?
    – moewe
    Mar 14, 2019 at 10:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .