You found a bug in custom-bib
, that should be reported to its maintainer.
Specifically, merlin.mbs
contains in function format.org.or.pub
, line 6907 ff. the following code that needs to be changed as indicated
%<*pub-date&!ay>
year empty$
'skip$
{ t empty$ address empty$ and
'skip$
%<!pub-xc> { ", " * } %% removed: swap$ *
%<pub-xc> { " " * } %% removed: swap$ *
if$
year "year" bibinfo.check
%<dtbf> bolden
*
}
if$
%</pub-date&!ay>
It looks like a copy-and-paste error from the pub-date&ay
case that follows the code I pasted here.
With this change your bst
file should contain the function in the following form:
FUNCTION {format.org.or.pub}
{ 't :=
""
year empty$
{ "empty year in " cite$ * warning$ }
'skip$
if$
address empty$ t empty$ and
year empty$ and
'skip$
{
add.blank "(" *
t empty$
{ address "address" bibinfo.check *
}
{ t *
address empty$
'skip$
{ ", " * address "address" bibinfo.check * }
if$
}
if$
year empty$
'skip$
{ t empty$ address empty$ and
'skip$
{
", " * %% originally: ", " swap$ * *
}
if$
year "year" bibinfo.check
*
}
if$
")" *
}
if$
}
Regarding debugging of bst
files: there is the stack$
command that will show you the stack on standard output, but it also flushes the stack, so you almost surely run into errors in the following execution. It is still helpful to see the complete stack at a certain point of the bst
file. It is less intrusive to show only the topmost stack item as a warning with
duplicate$ "On stack:'" swap$ * "'" * warning$
or the two top items with
duplicate$ "On stack:'" swap$ * "'" * warning$
swap$ duplicate$ " '" swap$ * "'" * warning$ swap$
leaving the stack intact.
The cause of the problem is a faulty instruction in the bst file. Make a copy of fom.bst
and edit the copy as follows:
in the function format.names.author
, find the string
"{vv}{ll, }{f.}"
and replace it with
"{vv~}{ll}{, f.}"
That way, a comma will be inserted after the last-name component only if the author's name contains a first-name component as well.
Note that, in addition to moving the location of the comma to the first-name component of the (full) name, I also recommend making the space between the von and last-name components non-breakable.
Repeat this edit for the second occurrence of the string "{vv}{ll, }{f.}"
in the function format.names.author
and for the two occurrences of this string in the function format.name.editors
.
Save the modified bst file, update you TeX distribution's filename database if the new bst file isn't placed in the same directory as your main .tex file, and recompile your document from scratch.
Addendum: I can't help but voice my surprise and dismay over the fact that the fom
bibliography style doesn't provide a mechanism for dealing with authors' "junior" name components (which can be Sr
., Jr.
, III
, the Elder
, the Younger
, and so on). You may luck out, in the sense that your bibliographic entries don't contain authors whose names contain such "junior" components. Nevertheless, it seems to be quite unsatisfactory for a bibliography style not to provide such a mechanism at all.
Best Answer
Consider to use
biblatex
. Here's how an entry of your desired type looks like withbiblatex
(taken frombiblatex-examples.bib
):Compilable example: