Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

biblatex: spaces between first names/initials

413 views
Skip to first unread message

Will Robertson

unread,
Jul 22, 2008, 3:09:29 AM7/22/08
to
Hello,

I might have missed something in the manual, but it seems that all
"first names" in biblatex are always separated by hard spaces (i.e.,
"~"). This holds both for the "full" and "abbreviated" versions.

So having "Will S. Robertson" will result in a "first name" of
"Will~S." and "W.~S." for the initials.

It'd be nice to be able to customise this space; for example, it's
fairly frequent to only insert a thin space between name initials. (I
tried looking for a hook a la terseinits but couldn't find anything.)

In lieu of an actual package option to support this kind of thing, the
\mkbibnamefirst macro can be used to replace non-breaking spaces in the
first name with whatever we like.

I've attached some code to do this (wrap in
\makeatletter...\makeatother, of course). I'll forward this message on
to Philipp personally in case he's not watching here, but perhaps in
the meantime this might be useful to someone.

Hope this helps,
Will

\renewcommand\mkbibnamefirst[1]{%
\spaces@to{\,}{#1}}
% the first argument is inserted
% between words in the "first name"
\newcommand\spaces@to[2]{%
\begingroup
\def\FROM@SPACE{#1}%
\hardspaces@@to#2~\@empty
\endgroup}
% pretty much taken from \zap@space:
\def\hardspaces@@to#1~#2{%
#1\ifx#2\@empty\else
\FROM@SPACE\expandafter\hardspaces@@to
\fi#2}

Philipp Lehman

unread,
Jul 23, 2008, 1:13:55 PM7/23/08
to
Will Robertson wrote:

> I might have missed something in the manual, but it seems that all
> "first names" in biblatex are always separated by hard spaces (i.e.,
> "~").

Well, not quite. Bibtex will use both "~" and " " depending on what it
considers appropriate (which may very well be different from what you
and I consider appropriate).

> It'd be nice to be able to customise this space; for example, it's
> fairly frequent to only insert a thin space between name initials.
> (I tried looking for a hook a la terseinits but couldn't find
> anything.)

This has been discussed in the past (in this group, but I don't have
any URL at hand). It's an annoying issue. Essentially, the spacing
between the parts of the "first names" chunk may be modified on the
Bibtex side of the workflow and that's how the terseinits option
works. But there is one flaw in Bibtex's implementation: if you
override Bibtex's choice of " " and "~" with any other string, Bibtex
will also kill all dashes! That's okay with terseinits=true but
obviously unacceptable otherwise. So the only way to make such spaces
configurable is parsing the string generated by Bibtex.

> In lieu of an actual package option to support this kind of thing,
> the \mkbibnamefirst macro can be used to replace non-breaking spaces
> in the first name with whatever we like.

> \renewcommand\mkbibnamefirst[1]{%


> \spaces@to{\,}{#1}}
> % the first argument is inserted
> % between words in the "first name"
> \newcommand\spaces@to[2]{%
> \begingroup
> \def\FROM@SPACE{#1}%
> \hardspaces@@to#2~\@empty
> \endgroup}
> % pretty much taken from \zap@space:
> \def\hardspaces@@to#1~#2{%
> #1\ifx#2\@empty\else
> \FROM@SPACE\expandafter\hardspaces@@to
> \fi#2}

How about:

\renewcommand\mkbibnamefirst[1]{{\let~\,#1}}

The tilde is active, after all ;)

However, since Bibtex may mix "~" and " " you need to scan for
both strings. One could either extend your code or use a macro I
posted the other day as a starting point. See:

http://groups.google.com/group/comp.text.tex/msg/6cf9161c77160677

This one removes all commas from a string. It could be extended to
replace spaces and tildes with a user-defined string/macro.

--
Sender address blackholed; do not reply to From: address.
You can still reach me by email at: plehman gmx net.

Will Robertson

unread,
Jul 27, 2008, 9:07:24 AM7/27/08
to
On 2008-07-24 02:43:55 +0930, Philipp Lehman
<devnull....@spamgourmet.com> said:

> But there is one flaw in Bibtex's implementation: if you
> override Bibtex's choice of " " and "~" with any other string, Bibtex
> will also kill all dashes!

Really?! That's annoying :)

> How about:
>
> \renewcommand\mkbibnamefirst[1]{{\let~\,#1}}
>
> The tilde is active, after all ;)

Oh, how embarrassing :) Yeah, I wrote that code first for real spaces
and then changed it for tildes.

> However, since Bibtex may mix "~" and " " you need to scan for
> both strings.

Well, scanning for spaces and letting ~ to \, should work (I think). On
the other hand, maybe even something like

\renewcommand\mkbibnamefirst[1]{%
{\fontdimen2\font=0.5\fontdimen2\font#1}}

would do the job.

Thanks for the comments,
Will

0 new messages