1

I've made a custom .bst file, using makebst. When using Natbib, I get for two papers in the same year and author, a letter identifying the two papers as "a" and "b" in the citation. Sadly, no letter is added in the bibliography. If I change my bibliographystyle to plainnat, I see the letters. Hope someone can help me...

\documentclass{article}
\usepackage{natbib}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{Hansen2015a,
author = {Hansen, Jens},
title = {Title One},
year = {2015}
}
@misc{Hansen2015b,
author = {Hansen, Jens},
title = {Title Two},
year = {2015}
}
\end{filecontents*}
\begin{document}
\citep{Hansen2015a} and~\citep{Hansen2015b} or \citep{Hansen2015a,Hansen2015b}.
\bibliographystyle{bibstyle}
%\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}

BST file

Custom bst-style:

bibstyle

PlainNat Style:

plainnat

2
  • 2
    Oh boy it has been years since I was using makebst the last time. I am sure that it was asking you as one of the first questions which bib-compiler you are using, and natbib was to be declared as 'some non-standard system' or so. Did you remember to choose that option, otherwise using natbib might misinterpret the bst. Apr 3, 2015 at 23:17
  • Thanks for suggesting to run the makebst again. It helped me locating the missing code in the bst-file.
    – TobiasDK
    Apr 7, 2015 at 16:22

1 Answer 1

1

The issue was related to extra.label, which was missing in the original bst-file. Running the makebst again and copying the code-snip from the new bst-file works for me now.

Old code:

FUNCTION {format.date}
{
  month "month" bibinfo.check
  duplicate$ empty$
  year  "year"  bibinfo.check duplicate$ empty$
    { swap$ 'skip$
        { "there's a month but no year in " cite$ * warning$ }
      if$
      *
    }
    { swap$ 'skip$
        {
          swap$
          " " * swap$
        }
      if$
      *
    }
  if$
}

New bst-code for FUNCTION {format.date}

FUNCTION {format.date}
{ year "year" bibinfo.check duplicate$ empty$
    {
    }
    'skip$
  if$
  month "month" bibinfo.check duplicate$ empty$
    'skip$
    {
      " " * swap$
    }
  if$
  *
  extra.label *
  before.all 'output.state :=
  ", " swap$ *
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.