GeneralMultibib gets numbering of cites wrong

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Multibib gets numbering of cites wrong

Post by benowar »

Hi,

I use the multibib package to introduce 2 bibliographys to my document. I want to use a different style for both (alpha and plain). Now, interestingly, the entries for plain use wrong numbering. It behaves like this:

"Foo bar [2] foo bar [FooBar98]".

Where [2] is an entry for the first bibliography with stlye plain and [FooBar98] from the second with style alpha. The correct way would be:

"Foo bar [1] foo bar [FooBar98]".

To me it looks as if Bibtex would simply count all cites from both bibliographies, ignoring the presence of different styles. Is there something I can do (maybe when executing bibtex.exe) do prevent this?

Btw I call bibtex 2 times with the 2 aux files that mictex creates on the first run.

Thanks for helping,
Ben

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Multibib gets numbering of cites wrong

Post by gmedina »

Code: Select all

\usepackage[resetlabels]{multibib}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Re: Multibib gets numbering of cites wrong

Post by benowar »

Thanks, but this doesnt seem to make any difference. My first bilbiographical reference starts with [17], then comes [16], [26], [29]. Is keeping the references in the same bib file a problem? Following the example from http://www.ctan.org/tex-archive/macros/ ... ltibib.pdf it doesnt seem to be a requirement.

Btw I am using TeXnicCenter, not sure if thats relevant.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Multibib gets numbering of cites wrong

Post by gmedina »

benowar wrote: Is keeping the references in the same bib file a problem?

No. Could you post the relevant parts of your document? (The preamble, and the commands you are using to include your bibliographies?)
1,1,2,3,5,8,13,21,34,55,89,144,233,...
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Multibib gets numbering of cites wrong

Post by benowar »

Before I do this, maybe this helps to find out about the problem: When I change the author-value of a bib-entry, the numbers change (!). So, for the following entry, using {{aaaIBM Corporation}} as author value, the entry shows up as [1] instead of [17]. I am shocked how the author name could have any influence on the reference numbering...

@MISC{ibmdb2home,
author = {{IBM Corporation}},
title = {{Homepage IBM DB2}},
owner = {bpasero},
pdf = {C:\Dokumente und Einstellungen\bpasero\Desktop\Diplom\Thesis\Quellen\Internet\Used\Analyse\db2_homepage.pdf},
timestamp = {2007.08.15},
url = {http://www-306.ibm.com/software/data/db2/},
urldate = {2007.08.15}
}


header.tex

\usepackage[resetlabels]{multibib}
\newcites{www}{Internet-Quellen}


document.tex

\clearpage
\renewcommand{\bibname}{Literatur}
\bibliographystyle{alpha}
\bibliography{literatur}
\addcontentsline{toc}{chapter}{Literatur}

\clearpage
\renewcommand{\bibname}{Internet-Quellen}
\bibliographystylewww{plain}
\bibliographywww{literatur}
\addcontentsline{toc}{chapter}{\bibname}
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Re: Multibib gets numbering of cites wrong

Post by benowar »

Interesting. This doesnt even seem to be related to multibib. I see exactly the same effect when not using that package at all.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Multibib gets numbering of cites wrong

Post by gmedina »

benowar wrote: So, for the following entry, using {{aaaIBM Corporation}} as author value, the entry shows up as [1] instead of [17]. I am shocked how the author name could have any influence on the reference numbering...

You are using plain and alpha styles which sort the entries alphabetically by authors, so it's not a surprise that the author name has any influence on the reference numbering; in fact, it must have all the influence. So review the documentation on BibTeX to see how the entries are sorted and the precautions you must have regarding names.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Re: Multibib gets numbering of cites wrong

Post by benowar »

Ah that explains it. Weird, I have nerver seen cites numbered like that in any book I read before, but maybe I should read more books...

Is there a style that is not sorting by name?
benowar
Posts: 33
Joined: Mon Aug 06, 2007 2:05 pm

Re: Multibib gets numbering of cites wrong

Post by benowar »

Using \natbib and style unsrtnat finally worked.
Post Reply