Using the multibib
package, I have two bibliographic sections.
I do not want the reference counter to be reset, which I had thought should be the default case. At least this is what the package documentation says, and reading the package code, the option resetlabels
is off by default. But each bibliography starts counting from one.
Here comes a MWE (file mwe.tex):
\documentclass[12pt]{article}
\usepackage[numbers]{natbib}
\usepackage{multibib}
\newcites{wwwbib}{Links to Webpages}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\section*{Test multibib}
Reference to Buzz Lightyear \cite{ref01}.
The reference to Pixar I would expect to be number 2, but it is not \citewwwbib{ref02}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bibliographystyle{plainnat}
\bibliography{mwe}{}
\bibliographystylewwwbib{plainnat}
\bibliographywwwbib{mwe}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
To compile, I use
pdflatex mwe
bibtex mwe
bibtex wwwbib
pdflatex mwe
pdflatex mwe
The content of file mwe.bib
is as follows:
@article{ref01,
author = {Lightyear, Buzz},
title = {To Infinity and Beyound Part 1},
journal = {Unknown},
volume = {54},
number = {4},
pages = {331-390},
year = {2001}
}
@misc{ref02,
author = {Pixar},
title = {Pixar Website},
howpublished = {\url{www.pixar.com}},
year = {2001}
}
The pdf output is
How can I get continuous numbering?
Best Answer
With my current MiKTeX 2.9 and
multibib
, version multibib 2008/12/10 v1.4 I get the following (wrong) filewwwbib.aux
:Because there exists no file
wwwbib.bib
(line 3) referenceref02
is invalid. After changingwwwbib
totest
(thebib
file is namedtest.bib
) it worked.The reason for this is that I usualy prefer to write an
filecontents
part like this to keep createdbib
or other file with the same name my MWE file has:If you use package
multibib
, this package uses itself macro\jobname
to create filewwwbib.aux
with\jobname.aux
and\bibdata{\jobname}
for the needed\bibdata{test}
.It seems that here is a bug in
multibib
(or in the system orfilecontents
for using\jobname
, resulting in the wrong line\bibdata{wwwbib}
(instead of the correct\bibdata{test}
).Solution:
Do not use
\jobname
forfilecontents
if you need to usemultibib
in your MWE!Result:
The following MWE runs without errors on my system:
I got the wanted result: