I use multibib and natbib with the numerical citation style in my
document. Although I have not specified 'resetlabels' as an option both
of my literature listings start with 1 and are therefore ambiguous.
I can't figure out what I am doing wrong. Do you have any idea?
Example:
-----------------------
\documentclass[a4paper]{scrreprt}
\usepackage{multibib}
\newcites{tools}{Tools}
\usepackage[numbers,sort]{natbib}
\begin{document}
In \cite{one} is written... and in \citetools{tool:one} is...
\bibliographystyle{plain}
\bibliography{example}
\bibliographystyletools{plain}
\bibliographytools{example}
\end{document}
-----------------------
My .bib file contains:
-----------------------
@misc{one,
author = {Author1},
title = {Title1}
}
@misc{tool:one,
author = {AuthorTool1},
title = {ToolTitle1}
}
-----------------------
I compile the document with
-----------------------
pdflatex example.tex
bibtex example
bibtex tools
pdflatex example.tex
pdflatex example.tex
pdflatex example.tex
-----------------------
Thanks for any hints,
James
> I use multibib and natbib with the numerical citation style in my
> document. Although I have not specified 'resetlabels' as an option both
> of my literature listings start with 1 and are therefore ambiguous.
>
> I can't figure out what I am doing wrong. Do you have any idea?
Hello,
I had a similar problem a while ago. IIRC, it is an incompatibility
between natbib and multibib. I have since stopped using natbib, and
have never taken the time to write a proper bug report. You can find
below the patch that I wrote to solve the problem.
I have Cc'ed Thorsten Hansen, so he can maybe fix multibib in a future
version.
Arnaud
--- multibib.sty.orig 2006-01-06 11:59:39.000000000 +0100
+++ multibib.sty 2006-01-06 12:08:57.000000000 +0100
@@ -23,6 +23,8 @@
%% Package `multibib' to use with LaTeX2e.
%% Copyright (C) 2003 by Thorsten Hansen. All rights reserved.
%%
+%% natbib compatibility added by Arnaud Giersch
+%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{multibib}
[2004/01/28 v1.3 Multiple bibliographies for one document.]
@@ -33,8 +35,10 @@
\ProcessOptions
\def\mylop#1\to#2{\expandafter\mylopoff#1\mylopoff#1#2}
\long\def\mylopoff#1,#2\mylopoff#3#4{\def#4{#1}\def#3{#2}}
+\newif\ifmb@natbib
\AtBeginDocument{%
- \@ifpackageloaded{natbib}{%
+ \@ifpackageloaded{natbib}{\mb@natbibtrue}{\mb@natbibfalse}
+ \ifmb@natbib
\NAT@set@cites
\let\std@@citex\@citex
\def\mb@@citex[#1][#2]#3{%
@@ -43,7 +47,7 @@
\std@@citex[#1][#2]{#3}%
\let\@auxout\@save@auxout
\let\@citex\std@@citex}%
- }{% else
+ \else
\@ifundefined{@newciteauxhandle}{% not defined by compatible packages
\let\std@@citex\@citex
\def\mb@@citex[#1]#2{{%
@@ -51,18 +55,26 @@
\std@@citex[#1]{#2}}%
\let\@citex\std@@citex}%
}{\let\mb@@citex\@citex}%
- }%
+ \fi
}%
\def\@newusecounter#1{\@nmbrlisttrue\def\@listctr{#1}}
\let\newusecounter\usecounter
\let\std@bibliography\bibliography
\def\bibliography#1{%
\ifcontinuouslabels
- \let\usecounter\newusecounter
+ \ifmb@natbib
+ \let\setcounter\@gobbletwo
+ \else
+ \let\usecounter\newusecounter
+ \fi
\fi
\std@bibliography{#1}%
\ifcontinuouslabels
- \global\let\newusecounter\@newusecounter
+ \ifmb@natbib
+ % nop
+ \else
+ \global\let\newusecounter\@newusecounter
+ \fi
\fi}
\newcount\mb@biblabelwidth
\newcommand\setbiblabelwidth[1]{\mb@biblabelwidth #1}
@@ -77,7 +89,11 @@
\def\thebibliography#1{%
\@isnumber{#1}%
{\ifnum\mb@biblabelwidth=0
- \@tempcnta\c@enumiv
+ \ifmb@natbib
+ \@tempcnta\c@NAT@ctr
+ \else
+ \@tempcnta\c@enumiv
+ \fi
\ifcontinuouslabels
\advance\@tempcnta#1%
\fi
Arnaud Giersch wrote:
> Jeudi 05 janvier 2006, vers 22:00:44 (+0100), James Oliver a écrit :
>
> > I use multibib and natbib with the numerical citation style in my
> > document. Although I have not specified 'resetlabels' as an option both
> > of my literature listings start with 1 and are therefore ambiguous.
> >
> > I can't figure out what I am doing wrong. Do you have any idea?
>
> Hello,
>
> I had a similar problem a while ago. IIRC, it is an incompatibility
> between natbib and multibib. I have since stopped using natbib, and
> have never taken the time to write a proper bug report. You can find
> below the patch that I wrote to solve the problem.
Thank you very much for this patch! Now the numbering works as I
expected it.
James