38

This question led to a new feature in a package:
biblatex

Robert Bringhurst, The Elements of Typographic Style, rule 2.1.5 states "Add little or no space within strings of initials."

If biblatex's firstinits option is enabled, "all first and middle names will be rendered as initials" (p. 54 of the manual). This, however, will put ties (~), i.e. non-breakable interword spaces between the initials. (See the .bbl-file of my compiled example.) How can I replace these ties with thin spaces (\,) and thus follow Bringhurst?

\documentclass{article}

\usepackage[firstinits=true]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@book{Knu86,
  author = {Knuth, Donald E.},
  year = {1986},
  title = {The \TeX book},
}
\end{filecontents}

\bibliography{\jobname}

\begin{document}

\nocite{*}

\printbibliography

\end{document}
lockstep
  • 250,273
  • I have a feeling I've answered something similar before, but was it here or somewhere else ... – Joseph Wright Feb 03 '11 at 21:08
  • Oh, I remember now: someone asked me this about one of my biblatex styles. – Joseph Wright Feb 03 '11 at 21:12
  • 1
    There is difference with backend=biber –  Feb 03 '11 at 21:42
  • In light of http://tex.stackexchange.com/questions/196175/use-non-breaking-space-after-name-initials-with-biblatex-macros, does this need revisiting? Note that in particular Biber now uses a more flexible approach to the stuff between initials. – Joseph Wright Aug 13 '14 at 15:20

3 Answers3

29

[update for biber 0.9+, April 2011]

You can customise this with \bibinitdelim:

\renewrobustcmd*{\bibinitdelim}{\,}

See the biblatex manual section 3.12.4 for a list of all name spacing macros.


Old answer:

Just to update this - biber 0.8.3/biblatex 1.3 have just been released and they address this issue. Biber no longer hard codes any typsetting in names---it only uses macros which can be changed from biblatex. See section 3.11.4 of the new biblatex manual.

[removed misleading biber 0.8.2 comments which are now obsolete]

Actually, thinking about this a little more coherently, what we're going to do soon is just make this a macro in biblatex so you can redefine any initials separators in biblatex. Probably in 1.3/0.8.3

PLK
  • 22,776
  • Would it make sense to set this to, say, \biberinitsep and have it be set and configurable with biblatex? The whole idea of biblatex in the first place was to move away from having typesetting decisions in the back-end. – Will Robertson Feb 14 '11 at 21:30
  • We can do that too - I just wanted to make some way to do this available. In fact, when biblatex drops bibtex (program not format) support completely, which won't be that far in the future, it's not so inaccurate to say that the notion of a "backend" won't apply so much - the system will be "biblatex-biber". An option like this is unlikely to be set per document so it's not so bad having it set in the biber config file ... – PLK Feb 15 '11 at 07:10
  • @PLK I'm not saying anything against biber but I really think it's a good idea to keep biblatex and the backend as separate as possible. It's fine to have features that only work in one backend, but who's to say that another radically different backend might not appear? – Will Robertson Feb 15 '11 at 13:22
  • Cool addition to biber. When you say "we're going to do soon is just make this a macro in biblatex so you can redefine any initials separators", does this also mean initials not created by biblatex? I'm thinking about names like 'D. W. Griffith' or 'H. G. Wells' – at the moment I use hardcoded , in the .bib file which is of course ugly. – Simifilm Feb 15 '11 at 15:40
  • Yes; the processing on the bib file inserts these hard spaces automatically so you'd no longer need to use \, manually in the bib file. – Will Robertson Feb 15 '11 at 15:40
  • @Simifilm: this should really be a comment. You've not quite got enough reputation to comment yet, so you'll need to answer a few questions to get that privilege. I've used mod privileges to make this change. – Joseph Wright Feb 15 '11 at 15:40
  • 1
    This is now implemented in biber 0.8.3/biblatex 1.3 released today. All of the spacing in name parts and sub-parts is handled by biber by inserting macros which are fully customisable in biblatex so biber isn't making any typsetting decisions for you any more. – PLK Mar 14 '11 at 17:50
  • 8
    For clarity: With the current version, you get the OP's desired effect with \renewcommand\bibinitdelim{\addnbthinspace}. – zwol Apr 13 '12 at 21:58
  • 1
    @Zack I think you should post this as an answer. – Jörg Jun 07 '12 at 13:00
  • @PLK Could you update your answer to use the new \bibnamedelim(a-d/i) stuff? – Joseph Wright Aug 13 '14 at 15:34
10

This solution isn't entirely general for when firstinits is not true, but otherwise it does exactly what you are asking for:

\documentclass{article}
\RequirePackage[firstinits=true]{biblatex}
\bibliography{xampl}
\renewcommand*{\mkbibnamefirst}[1]{{\let~\,#1}}
\makeatother
\begin{document}
 \nocite{whole-collection}
 \printbibliography
\end{document}

This code uses biblatex's hook into how to print the ‘first name’, which in this case is the initials, and substitutes ~ for \,. (I'm not sure if the nested set of braces are required, but it doesn't hurt to be careful.)

When firstinits is not in effect, this will end up putting thin spaces between someone's first name and their initial, which is probably not desirable. So you might want to qualify the definition above as

\renewcommand*{\mkbibnamefirst}[1]{{\iffirstinits{\let~\,}{}#1}}
  • 1
    I think we have a new winner here. :-) – lockstep Feb 15 '11 at 16:38
  • @Will: A vote coming up once the day rolls over (I've run out for today, as per usual) – Joseph Wright Feb 15 '11 at 17:47
  • P.S. I still think a backend improvement is a good idea! – Will Robertson Feb 15 '11 at 18:02
  • @Joseph: I should point out that this is the first time I've revoked acceptance of an answer. (You still have my upvote.) – lockstep Feb 15 '11 at 18:25
  • @lockstep: no problem at all. At some stage this will hopefully be available from biblatex itself, so the best answer may change again – Joseph Wright Feb 15 '11 at 18:53
  • It will. In the next minor release, we will almost certainly replace all hard-coded typsetting for names (spaces, ties etc.) with customisable macros which you can reset in biblatex. It's about time that the backend became fully typsetting agnostic. Our only decision is about whether to retain the old bibtex tying algorithm which isn't so bad since the "ties" will now be macros you can redefine anyway. – PLK Feb 20 '11 at 18:38
  • @Will: Sorry for revoking acceptance of your answer -- Phil Kime has provided the definite one. – lockstep Mar 14 '11 at 21:37
  • @lockstep he sure has! Thanks for the note -- I was interested in this issue and hadn't seen the update yet. – Will Robertson Mar 15 '11 at 11:18
6

The separator between initials is one of the few things that is defined in the file biblatex.bst rather than at the LaTeX level. If you look at a biblatex style file, you'll find that the biblatex kernel provides the full names and initials. Tracing back, these come from BibTeX's format.name$ function. I suspect the only way to customise this (currently) is to hack the process to do a search-and-replace on the initials. A longer-term solution is, of course, to make a feature request.

To explain how firstinits works, it's a switch which you can use inside a biblatex style to select either the full names or initials as supplied to the style by the biblatex kernel. So the formatting of the initials themselves is already done when the style gets the data.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • But there's also the terseinits option. If you set it also to true in my example, the result is "DE Knuth". So maybe it is possible to change separators at the LaTeX level. – lockstep Feb 03 '11 at 21:25
  • 1
    @lockstep. terseinits is passed to the BibTeX style (or to Biber). The way it works is that a flag is set for the BibTeX file, which then does the formatting using format.name$ (at least for BibTeX.) – Joseph Wright Feb 03 '11 at 21:29
  • Note that locally redefining ~ means you can get any separator you like :) (see my answer below) – Will Robertson Feb 15 '11 at 13:51
  • 1
    @Will: Now it's above :-) – Hendrik Vogt Feb 15 '11 at 16:56
  • 1
    In fact, terseinits passes an option to the backed to make it deal with initials in a different way. In the next release, terseinits will no longer exist as an option as there will be a more flexible way to control this with some macros at the LaTeX level. – PLK Feb 20 '11 at 18:40