# remove comma after the last author

I've finally manged to produce my custom \bibliographystyle (.bst) file. Below is the output (sample) of listed references. Is it possible to remove the comma after the last author (just before the year)? I would also like to get rid of "Literatura" title that is assigned as well. Any help appreciated.

Literatura
Abbiati, M., Bianchi, C. N., Castelli, A., 1987. Polychaete vertical zonation along a
littoral cliff in the western Mediterranean. Marine ecology, 8(1): 33–48.
Antoniadou, C., Nicolaidou, A., Chintiroglou, C., 2004. Polychaetes associated with
the sciaphilic alga community in the northern Aegena Sea: spatial and temporal
variability. Helgoland Marine Research, 58: 168–182.

-

Regarding the "Literatura" title: I suppose you're using babel like

\usepackage[slovene]{babel}


In that case use \addto like:

\addto{\captionsslovene}{%
\renewcommand*{\refname}{Bibliography title}%
\renewcommand*{\bibname}{\refname}%
}


Depending on your document class either \refname (article) or \bibname (book, report) would be used. This definition applies to both of them.

-
Bingo! One tiny thing though. I've entered an empty argument {}, but the space is still there. Is there a soft method of how to shift the references up so that there isn't so much empty space? –  Roman Luštrik Aug 15 '10 at 20:40
You could get rid of the heading by \def\section*#1{} right before the bibliography or the same but for \chapter*. If needed, take it back like here: texblog.net/latex-archive/plaintex/… –  Stefan Kottwitz Aug 15 '10 at 20:54

I've found the little bugger. To remove the comma after the last author, I edited these lines in the .bst file (took out 4th line and replaced with with the 5th):

FUNCTION {output.nonnull}
{ 's :=
output.state mid.sentence =
<strike>{ ", " * write$}</strike> { " " * write$ }
{ output.state after.block =
{ add.period$write$
newline$"\newblock " write$
}
{ output.state before.all =
'write${ add.period$ " " * write$} if$
}
if$mid.sentence 'output.state := } if$
s
}

-

The heading for the bibliography is stored in \bibname in the standard classes. Try:

\renewcommand\bibname{Your title}


As for the comma after the author list you will have to check your custom bst file to see where it is coming from.

-
Unfortunately I have to use localized settings and your answer doesn't work -- see Stefan's answer. –  Roman Luštrik Aug 15 '10 at 20:41

The other answer didn't help me. I deleted the comma in line 12 in my bst file. I'm not sure what I've actually done there, but it works.

FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$'numnames := numnames 'namesleft := { namesleft #0 > } { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ numnames #2 >
{ "," * }
'skip$if$
t "others" =
{ " et~al." * }
{ " and " * t * }
if$} if$
}
't
if$nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$
}

-
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  Torbjørn T. Mar 29 '13 at 17:14