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

BiBTeX, bst hackers, format.name$, please help

61 views
Skip to first unread message

Danie Els

unread,
Jun 28, 2002, 9:02:12 AM6/28/02
to
Is there somewhere documentation for the format.name$ function of
BiBTeX. Oren Patashnik only advises to look in other .bst files. In my
case that did not helped a lot.

Our university reference style DEMANDS!! the following format:

author={Els, Daniel Nicolaas and de Klerk, Nico-Ben}
-> Els, D.N. & de Klerk, N.-B. (no spaces between initials)

From merlin.mbs of the makebst bundle I got the following:

"{vv~}{ll}{, jj}{, f{}}" format.name$ -> Els, DN & de Klerk, NB
"{vv~}{ll}{, jj}{, f{.}.}" format.name$ -> Els, D.N. & de Klerk, N.B.
"{vv~}{ll}{, jj}{, f.}" format.name$ -> Els, D. N. & de Klerk, N.-B.

I can not get it to eliminate the space and still write double name
initials with the hyphen. Is there a way to get around this. (Even the
stuff from makebst eats up the hyphen)

I hope someone can help.

Danie Els
(change the first name to initials DNJ in e-address)

Scott Pakin

unread,
Jun 28, 2002, 11:20:01 AM6/28/02
to
Danie Els wrote:
> Is there somewhere documentation for the format.name$ function of
> BiBTeX. Oren Patashnik only advises to look in other .bst files. In my
> case that did not helped a lot.

Take a look at the article "Designing BibTeX Styles", which is distributed
as btxhak.*. You may already have that on your system. If not, then you
can download it from CTAN.

-- Scott

Philip G. Ratcliffe

unread,
Jun 28, 2002, 11:34:39 AM6/28/02
to
Dear Danie,

I fought with this for a long time too and even mentioned it in some list or
other, with no reply. I came to the conclusion that the only way is the
nasty way:

STRINGS {z}

FUNCTION {remove.spaces}
{ 'z :=
""
{ z empty$ not }
{ z #1 #1 substring$
z #2 global.max$ substring$ 'z :=
duplicate$ "~" =
'pop$
{ duplicate$ " " =
'pop$
{ * }
if$
}
if$
}
while$
}

INTEGERS { nameptr namesleft numnames }

FUNCTION {forname.format.string}
{ "{f.}" }

FUNCTION {surname.format.string}
{ "{vv~}{ll}" }

FUNCTION {jnrname.format.string}
{ "{, jj}" }

FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr forname.format.string format.name$ remove.spaces
duplicate$ empty$ 'skip$ { "~" * } if$
s nameptr surname.format.string format.name$ *
s nameptr jnrname.format.string format.name$ *
't :=
nameptr #1 >
{ namesleft max.authors.biblio <
{ namesleft #1 >
{ ", " * t * }
{ t "others" =
{ " " * etal * }
{ " and " * t * }
if$
}
if$
}
{ #0 'namesleft :=
" " * etal *
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}

This may not do exactly what you want in terms of order etc., but it does
solve the basic problem via the remove.spaces function, which does simply
that.

Hope this helps.

Cheers, Phil Ratcliffe

0 new messages