[Tex/LaTex] Bold labels and more with custom bibtex bst and author-year

bibtexnatbib

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:
enter image description here
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$
}

Best Answer

Here is a code using biblatex that seems to fulfill the requirements:

        \documentclass[german]{article}%mkbib
        \usepackage[T1]{fontenc}
        \usepackage[utf8]{inputenc}
        \usepackage{lmodern}
        \usepackage{babel}%
        \usepackage{csquotes}
        \usepackage{xpatch}
        \usepackage[backend=biber, style=authoryear, firstinits, mergedate=false]{biblatex}

        \addbibresource{marcedb.bib}
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        \renewcommand*{\multinamedelim}{\addsemicolon\space}
        \renewcommand*{\subtitlepunct}{\addcolon\space}
        \renewcommand*{\newunitpunct}{\addcomma\space}
        \renewcommand*{\finentrypunct}{\addperiod}
        \renewcommand*{\revsdnamepunct}{\addcomma\space}%
        \renewcommand*{\finalnamedelim}{\multinamedelim}
        \renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}%
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        \DeclareNameAlias{sortname}{last-first}
        \DeclareNameFormat{last-first}{%
          \iffirstinits
            {\mkbibbold{\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}}}%
            {\mkbibbold{\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}}%
          \usebibmacro{name:andothers}}

        \renewcommand*{\labelnamepunct}{\bfseries\addcolon\space}

        \renewbibmacro*{date+extrayear}{}%

        \renewbibmacro*{date}{%
        \mkbibparens{\printdate}}%

        \renewbibmacro*{issue+date}{%
                \printtext{\usebibmacro{date}}
                \setunit*{\addcomma\space}
                \printfield{issue}
         \newunit}

        \renewbibmacro*{series+number}{%
         \addcomma\space
         \iffieldundef{series}{}{\printtext[parens]{\printfield{series}%
          \setunit*{\addsemicolon\space}%
          \printfield{number}}}%
          \newunit}

        \renewbibmacro*{publisher+location+date}{%
          \printlist{location}%
          \iflistundef{publisher}{}%
          {\addspace\printtext{u.a.:}}
          \printlist{publisher}%
          \addspace%
          \usebibmacro{date}%
          \newunit}

        \xpatchbibmacro{byeditor+others}%
        {\usebibmacro{byeditor+othersstrg}%
             \setunit{\addspace}%
             \printnames[byeditor]{editor}%
             \clearname{editor}%
             \newunit}%
        {\printnames[byeditor]{editor}%
             \clearname{editor}%
             \setunit{\addspace}
             \mkbibparens{Ed\addperiod}%
             \newunit}%

        \xpatchbibdriver{inbook}{%
          \newunit\newblock
        \usebibmacro{maintitle+booktitle}%
          \newunit\newblock
          \usebibmacro{byeditor+others}}%
          {%
          \iffieldundef{bybookauthor}{}%
         { \newunit\newblock}%
          \usebibmacro{byeditor+others}%
          \setunit{\addcolon\space}\newblock
          \usebibmacro{maintitle+booktitle}}%
          {}{}%

        \renewbibmacro*{journal+issuetitle}{%
          \usebibmacro{journal}%
          \setunit*{\addcomma\space}%
          \iffieldundef{series}
            {}
            {\newunit
             \printfield{series}%
             \setunit{\addspace}}%
          \usebibmacro{volume+number+eid}%
          \setunit{\addspace}%
          \usebibmacro{issue+date}%
          \setunit{\addcolon\space}%
          \usebibmacro{issue}%
          \newunit}

            \begin{document}

             \nocite{*}
              \printbibliography

            \end{document}

and the result:enter image description here

Related Question