2

I am sure my question is a really easy one, but the syntax of the bst files is way too complicated for me. I would like to edit my bst file so that, in case the same author has multiple publications in the same year, it would print:

Doe (1900) Doe (1900a) Doe (1900b)

instead of

Doe (1900a) Doe (1900b) Doe (1900c)

I have figured out that it all happens in this area:

STRINGS { longest.label last.label next.extra }

INTEGERS { longest.label.width last.extra.num number.label }

FUNCTION {initialize.longest.label} { "" 'longest.label :=  #0 int.to.chr$ 'last.label :=  "" 'next.extra :=  #0 'longest.label.width :=  #0 'last.extra.num :=  #0 'number.label := }

FUNCTION {forward.pass} { last.label label =    { last.extra.num #1 + 'last.extra.num :=
     last.extra.num int.to.chr$ 'extra.label :=    }    { "a" chr.to.int$ 'last.extra.num :=
     "" 'extra.label :=
     label 'last.label :=    }  if$  number.label #1 + 'number.label := }

FUNCTION {reverse.pass} { next.extra "b" =    { "a" 'extra.label := }  'skip$  if$  extra.label 'next.extra :=  extra.label  duplicate$ empty$    'skip$    { "{\natexlab{" swap$ * "}}" * }  if$  'extra.label :=  label extra.label * 'label := }

EXECUTE {initialize.longest.label}

ITERATE {forward.pass}

REVERSE {reverse.pass}

But this is the best I can do… Any help would be greatly appreciated!

2
  • What's wrong or bothersome with1990a, 1990b, and 1990c? Are you maybe publishing in a field where it's more common to write the year labels as 1990, 1990a, and 1990b?
    – Mico
    Jun 8, 2015 at 20:01
  • Yes, exactly. There is actually nothing "wrong" with it. I am only used to 1900, 1900a, 1900b (extra label being actually quite rarely used)…
    – J. Eijdt
    Jun 8, 2015 at 21:48

1 Answer 1

1

I figured something out. This isn't very graceful, but it did the trick. I made the counting start with "`" (acute, that is, the previous ASCII character in the table) instead of "a" in FUNCTION {forward.pass}, which now reads like this:

FUNCTION {forward.pass}
    { last.label label =
        { last.extra.num #1 + 'last.extra.num :=
        last.extra.num int.to.chr$ 'extra.label :=
            }
            { "`" chr.to.int$ 'last.extra.num :=
            "" 'extra.label :=
            label 'last.label :=
        }
    if$
    number.label #1 + 'number.label :=
    }

I have some doubts about this being a stable solution, though…

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.