# Suppress \unspace command to force biblatex to add spaces (DIN 1505)

DIN 1505 requires breakable interword spaces in front of punctuation. A bibliography entry is supposed to look like this:

Lastname1, Firstname1 ; Lastname2, Firstname2: Title : Subtitle [...]


^                                                    ^

I tried to accomplish this by redefining the \multinamedelim and \subtitlepunct commands. Unfortunately the \addspace in front of \addsemicolon respectively \addcolon doesn't show up in the resulting file. The reason for this is the \unspace command, which removes preceding whitespaces. It is implicitly executed by \addspace.

MWE:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[
style=alphabetic,
backend=biber,
]{biblatex}

\begin{filecontents}{test.bib}
@BOOK{Author2001,
author = {Alastname, Afirstname},
title = {Title},
subtitle = {Subtitle},
year = {2001},
}
\end{filecontents}

% Setup bibliography
\DeclareNameAlias{default}{last-first}
\renewcommand*{\finentrypunct}{}

\begin{document}
Filler text \cite{Author2001}

\printbibliography
\end{document}


I found an example of a DIN 1505 style (see here). The author substituted \addspace with \mbox{ }. Unfortunately this is not officially supported by biblatex. Does anyone know a better solution?

• In front of the colons and semicolons? This seems strange. However, the places where you'd like to have spaces are difficult to tell from your example; can you use a fixed width font for better showing them? – egreg Aug 28 '13 at 9:16
• This looks really strange and I have not seen any journal using this format. DIN 1505 is supposed to be replaced with DIN ISO 690 which does not seem to include this format, so I would recommend using the updated version instead. – Alexander Aug 28 '13 at 11:29
• Yes, I meant the spaces in front of the colons and semicolons. I formated my example as code. That way a fixed font width is used and hopefully things become clearer. – FrogThomas Aug 28 '13 at 13:46
• @Alexander I think the style DIN 1505 is not all that unpopular. For example bibsonomy.org is able to export it. Anyway, I'm supposed to us this style and not ISO 690. By the way, ISO 690 also has spaces in front of colons and semicolons! – FrogThomas Aug 28 '13 at 13:49

You could just replace the \addsemicolon/\addcolon etc. commands by a plain ; or : respectively, so \DeclareDelimFormat{multinamedelim}{\addspace\addsemicolon\addspace} becomes \DeclareDelimFormat{multinamedelim}{\addspace;\addspace}. That way biblatex does not check for space preceding the punctuation mark, but neither will it check for preceding punctuation symbols as \addsemicolon would.

We can also delve a little bit deeper into the internals of biblatex and try and define our own space-preserving macros \addsp<punct>. Those macros are defined via \blx@addsppunct, which is essentially the macro \blx@addpunct with the \unspace commented out.

You now use \addspsemicolon and \addspcolon instead of \addsemicolon and \addcolon whenever you do not want the preceding space to disappear.

MWE

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[
style=alphabetic,
backend=biber,
]{biblatex}

\makeatletter
% see biblatex.sty for these macros
\blx@regimcs{%
\def\blx@addsppunct#1{% <---- new name for spaced punctuation
%\unspace <----- commented out
\ifnum\blx@spacefactor<\blx@sf@threshold@low
\csuse{blx@qp@#1}\csuse{abx@#1}%
\else
\ifnum\blx@spacefactor>\blx@sf@threshold@high
\csuse{blx@qp@#1}\csuse{abx@#1}%
\else
\ifcsdef{blx@pp@\the\csname blx@sf@#1\endcsname @\blx@spacefactor}
{\csuse{blx@qp@#1}\csuse{abx@#1}}
{\csuse{blx@qp@#1}}%
\fi
\fi
\csuse{blx@pq@#1}}

\makeatother

% Set up bibliography
\DeclareNameAlias{default}{family-given}

\DeclareDelimAlias{finalnamedelim}{multinamedelim}

\DeclareDelimAlias{finallistdelim}{multilistdelim}

\renewcommand*{\finentrypunct}{}

\begin{document}
\cite{sigfridsson,worman}

\printbibliography
\end{document}


edit Code modernised for biblatex 3.8 and newer. See the edit history for older versions.

• I actually hoped that there is a switch in BibLaTeX in order to temporarily switch off the \unspace-cycle. Unfortunately it seems like there isn't. Nevertheless THANKS for the coding you did. Under these circumstances, your solution of defining new macros, is the best possible one. – FrogThomas Aug 28 '13 at 19:22
• Using egrep origtitle * in the biblatex folder finds the mention in biblatex1 but not biblatex2. Is this on purpose or just missed? – Johannes_B Mar 7 '16 at 17:16
• @Johannes_B Mhh, you will find that \abx@dofields looks different in biblatex1 and biblatex2. In the former, all fields are listed, while in the latter we are referred to \def\abx@dofields{\dolistcsloop{blx@biber@datamodel@fields}}. I suppose biblatex2's origtitle lives in biblatex-dm.def. – moewe Mar 7 '16 at 17:23
• Yes, it is. Ah, all the internals are confusing. Working on the wikibook page on bibliographies right now. – Johannes_B Mar 7 '16 at 17:25