Take the 2-minute tour ×

I got a custom \bibliographstyle from my University. I exceeded the number 26 with my Entries which do not have an Author and a Year. For the Author I put in "o.V".

Normally I got as Key in my .bbl file (which is generated by bibtex out of my .bib file) \bibitem[o.Va] to \bibitem[o.Vz] Here is the Problem. After the "z" it generates an "{" which will obviously not work. So in my Paper there there should be written [o.Va]-[o.Vz] as cites. But theoretically after the Z is [o.V{], which wont compile!

I ASSUME that I need to modify my .bst file (this is the bibliographstyle, IF I am not mistaken).

How can I make it, that my bibliography takes other 3 letters than o.V, OR if I leave the Author emtpy that it takes something custom I can choose?

Please look http://pastebin.com/1Qdy83eJ line 352. That won't work and has nothing to do with jabref!

share|improve this question
Welcome to TeX.sx! –  Jubobs May 3 '13 at 12:14
Do you use a program like Jabref to create your keys or do you create the keys by your own? –  Kurt May 3 '13 at 13:20
You may have to both load the alphalph package (to allow for alphabetical "numbers" to continue past "z") and hack the .bst file to change instances of \alph to \alphalph. Is the bibliography style file available for general downloading? –  Mico May 3 '13 at 13:24
Yes I am using Jabref. I think it is this file: w3-mediapool.hm.edu/mediapool/media/bibliothek_2/bib_lokal/… –  user30109 May 3 '13 at 13:52
So for me it seems to be a problem with Jabref, because you asked it to generate automatic keys for your bibliography. I do not use Jabref but I'm sure you can change the algorithmn of creating keys there ;-) Then you can use something like o.V.## ore similar ... –  Kurt May 3 '13 at 14:05

3 Answers 3

up vote 3 down vote accepted

You are right in that the BibTeX style (alphadin.bst) adds an extra label to entries that appear the same to it. This label is just the counter of equivalent entries converted to characters, and after z comes { in ASCII.

We can fix that by changing this conversion to obtain extra labels of the form a..z, aa..az, ba..bz, ....

For that, make a copy of alphadin.bst, say alphadin2.bst, and save it in a place where BibTeX can find it.

Open the new file in an editor, and locate the function forward.pass (line 2144 ff.) Add the following integer division function before that function:

INTEGERS { a b aneg bneg }
%% takes two arguments a and b, and returns q = a/b, and the remainder a-q*b
FUNCTION {div} {
  'a :=
  'b :=
  a #0 <
    { #1 'aneg :=
      #0 a - 'a := }
    { #0 'aneg := }
  b #0 <
    { #1 'bneg :=
      #0 b - 'b :=
    { #0 'bneg := }
  b #0 =
      "Division by zero requested, will return 0 0" * warning$
      #0 #0
      #0                 %% initialize quotient on stack
      { a b > a b = or }
      { a b - 'a :=      %% decrement a by b
        #1 +             %% increment value on stack
          a #0 >
            { b a - 'a :=
               #-1 swap$ -
            { #0 swap$ - }
        { #0 swap$ - }
      a                  %% push remainder

Then, modify forward.pass as follows:

FUNCTION {forward.pass}
{ last.sort.label sort.label =
    { last.extra.num #1 + 'last.extra.num :=
      %% last.extra.num int.to.chr$ 'extra.label :=   %% original; the next 10 lines are new
      last.extra.num #122 >
          last.extra.num #97 - #26 swap$ div
          #97 + int.to.chr$                   %% remainder; 0..25 -> a..z
          swap$ #96 + int.to.chr$             %% quotient;  1..26 -> a..z
          swap$ *
          'extra.label :=
        { last.extra.num int.to.chr$ 'extra.label := }
    { "a" chr.to.int$ 'last.extra.num :=
      "" 'extra.label :=
      sort.label 'last.sort.label :=

Now you can use \bibliographystyle{alphadin2} in your document.

share|improve this answer
that solved the problem. thank you! –  user30109 May 5 '13 at 11:04

The keys by which you refer to an item in your bibliography (with bibtex), are defined in your .bib file that has all the data concerning your references.

so if you had a bibliography MyBib.bib containing the entry

@article{ref1, author = "o.V."}

you would refer to it in the text as

 I am now citing the reference 1 \cite{ref1}.

The value of the author and other fields does not matter. (I do not know if BiBTeX auto-assigns keys if you do not provide them yourself, but if you do as in the example, then that is all that matters).

The .bbl file is an auxiliary file created by BiBTeX with the references formatted as they should be, so that when LaTeX is run for the second time (after BiBTeX) it can plug those in. You should not have to modify it.

share|improve this answer
If I understand the OP's write-up correctly, the problem is (i) that there are more than 26 entries in the .bib file with author field "o.V" and (ii) that the entries should be sorted alphabetically by author. The problem thus appears to be that if there are more than 26 entries with identically "named" authors, BibTeX doesn't know how to sort these entries... –  Mico May 3 '13 at 13:27
yes. Bibtex doesnt know how to sort after these 26 entries with the same author. –  user30109 May 3 '13 at 13:55

Your question is a little bit missleading.

I suppose you do not have to change a bst file or something else. It is not clear if you wrote the keys by yourself or if you used a program to do it for you.

In a comment you told me that you are using Jabref. In the manual of Jabref is a chapter BibTeX Keys (in my german 2.4 Beta version it is chapter 3.4). It describes that Jabref creates BibTex-Keys for you and where you can control the behavior of Jabref. It also says that in chapter 4.3 you can learn how to change the creation of the keys.

I'm pretty sure that you can advice Jabref to build the keys with another algorithmn. Because I use citavi I can't tell you how. But a look in the documentation will help -- I'm sure.

The german documentation says:

Wie die BibTEX-Keys aussehen, die JABREF automatisch generiert, und wie Sie dieses Aussehen verändern können, erfahren Sie im Abschnitt 4.3 Automatische Erstellung von BibTEX-Keys.

share|improve this answer
I think you mixed something up. Jabref only refers to my .bib-file. They are fine! These .bib file is used by bibtex (or whatever) and convertet into an .bbl file. In this .bbl file I get the problems with the numbers, not in the bib file. I dont have a problem with my database i have the problems with the resault generated out of my database! –  user30109 May 4 '13 at 9:52
@user30109 Why do you not show us how some of your entries (the first and the last of this one author)? In your bib file you have @book{key. This key is used by BibTeX and in your case I guess created by Jabref ... This key is the reason for your problem and you can only get rid of it by changing the key in your bib file ... BibTeX or LaTeX do not change/rewrite this key in your bib file -- only Jabref, Citavi, Zotero or you can do (and perhaps do) so. –  Kurt May 4 '13 at 11:32
pastebin.com/1Qdy83eJ this is the file which causes an error. The Key which you mentioned is not the problem. The "shown" key is the problem. This depends on the citation style. If you use numbers that is ok, but I have a citation style which uses author and Year. I updated my post already! –  user30109 May 4 '13 at 12:53

Your Answer


