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.
It turns out that this issue has been noticed here.
Although it doesn't say how to fix the merlin.mbs
file, it tells you how to fix the .bst
file.
Basically, in the lines following:
FUNCTION {format.org.or.pub}
there is a line like this:
{ ", " swap$ * * }
Replace it by:
{ ", " swap$ * ", " * }
It fixed it for me! It's still not ideal, but at least you don't need to mess with the .bib
or the .bbl
.
I suspect that there is a typo somewhere between lines 6866 and 6954 in merlin.mbs
. But I'm not familiar enough with this type of file to confidently fiddle with it... Maybe someone here can?
Best Answer
The string
z
is used in the.bst
file but not declared. Change the lineto
and the problem should go away. (If there are further errors, please construct a minimal LaTeX + BibTeX example, as I have done in my answer to Hyphenating a number in the BibTeX pages field.)