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!

  • Welcome to TeX.sx! – jub0bs May 3 '13 at 12:14
  • 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
  • If I am not mistaken, jabref only creates the entries. bibtex is creating the keys from the .bib file in an .aux file. It would be nice to have something which puts o.V.## when I leave the author and year blank. Unfortunatley I don't know how – user30109 May 3 '13 at 14:21
  • i updated my text. – user30109 May 4 '13 at 10:07

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.


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.

  • 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
  • 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

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.

  • 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 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.