I have the requirement to print the labels for the entries in the bibliography in bold, replace the ,
between multiple authors (if any) with ;
and end them with :
. The following picture is an example from my guidelines:
I suppose that should be possible by modifying my custom .bst file and especially the format.names
function.
Based on this and this I came up with the following function:
FUNCTION {makebold}{
{ duplicate$ empty$
{ pop$ "" }
{ "\textbf{" swap$ * "}" * }
if$
}
However, when I add it to my bst file I only get compilation errors without even calling the function, just by copying it into the file.
This is my current 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}{, jj}{, f{.}.}"
format.name$
bibinfo bibinfo.check
't :=
nameptr #1 >
{
nameptr #2
#1 + =
numnames #2
> and
{ "others" 't :=
#1 'namesleft := }
'skip$
if$
namesleft #1 >
{ ", " * t * }
{
s nameptr "{ll}" format.name$ duplicate$ "others" =
{ 't := }
{ pop$ }
if$
"," *
t "others" =
{
" " * bbl.etal *
}
{ " " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
} if$
}
I have no experience with bst files at all, but need this fixed, because my instructor is already complaining that I should use Word instead of LaTeX and he will force me to migrate my paper if I can't sort out his beloved bibliography style :(
It would be really nice if someone could help me print my entries the way they should be!
Last remark: don't know if that's relevant, but the names should not be bold in the text like when I'm using \citep
etc.
Update: I've managed (with pure trial and error) to get the labels bold (I had to rename the function to bolden
instead of makebold
, don't know why) and replace the comma between authors with a semicolon. What's still missing is the final colon between the author list and the title.
My current format.names
looks like that:
FUNCTION {format.names}
{ 'bibinfo :=
duplicate$ empty$ 'skip$ {
's :=
"" 't :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr
"{vv~}{ll}{, jj}{, f{.}.}"
format.name$ bolden
bibinfo bibinfo.check
't :=
nameptr #1 >
{
nameptr #2
#1 + =
numnames #2
> and
{ "others" 't :=
#1 'namesleft := }
'skip$
if$
namesleft #1 >
{ "; " * t * }
{
s nameptr "{ll}" format.name$ duplicate$ "others" =
{ 't := }
{ pop$ }
if$
"" *
t "others" =
{
" " * bbl.etal bolden *
}
{ "; " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
} if$
}
aer.bst
(likely in the directory.../texmf-dist/bibtex/bst/economic
) for an example of a bibliography style that puts the authors' names in bold. Or, take a look at the fileecta.bst
(in the same directory asaer.bst
) for an example of a style file that sets the authors' names in small caps; if the rest of the formatting performed by this style file suits your needs, changing the function\textsc
to\textbf
should be a snap.\renewcommand*{\multinamedelim}{\addsemicolon\space}
. I think it's much easier to understand than the bibtex language. If you could send a minimal example of what you need precisely, I could give a try.