I'm using natbib with a custom .bst file for a conference paper. Unfortunately, the .bst file results in a comma separating the authors names when there are only two authors, and I need to remove this comma.
In the .bst file, here is the format.names function:
FUNCTION {format.names}
{ 'bibinfo :=
duplicate$ empty$ 'skip$ {
's :=
"" 't :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr
"{vv~}{ll}{, f.}{, jj}"
format.name$
bibinfo bibinfo.check
't :=
nameptr #1 >
{
namesleft #1 >
{ ", " * t * }
{
s nameptr "{ll}" format.name$ duplicate$ "others" =
{ 't := }
{ pop$ }
if$
"," *
t "others" =
{
" " * bbl.etal *
}
{
bbl.and
space.word * t *
}
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
} if$
}
I'm not familiar enough with the scripting language used in the .bst file to modify it. I believe I need to add another condition for when the total number of names is 2, and to modify:
namesleft #1 >
{ ", " * t * }
As an aside, I believe this bst file was created by the conference organizer using the bst creation wizard.
Unfortunately, I cannot move forward with the editing process until this is fixed... Could anyone assist me?
Thank you in advance.
Edit: Here is a MWE:
\documentclass[conf]{new-aiaa}
\begin{document}
Here is a MWE containing a sample citation and references list \cite{peyret2012computational}.
\bibliography{sample}
\end{document}
To get this MWE to work, you need the following sample.bib file
@inbook{peyret2012computational,
title={Computational Methods for Fluid Flow},
edition={2},
author={Peyret, Roger and Taylor, Thomas D},
year={1983},
publisher={Springer-Verlag},
address={New York},
chapter={7, 14}
}
and the new-aiaa.cls and new-aiaa.bst files, which can be sourced from the presenter resources page found at
https://www.aiaa.org/home/events-learning/events/Technical-Presenter-Resources
or directly from Overleaf at
Just a note, I have this issue with conference papers as well, but this is for my thesis which uses the new-aiaa.bst file for references, but of course, a different cls file.
Thank you for your patience and assistance.
.bst
file and add a sample document and.bib
item showing the problem?