I am facing a problem when using natbib
together with multibib
and label prefixes. I want to define two bibliographies: One for literature of other people, with numbered references, and one for my own literature, also with numbered references, but with a prefix "O" before each reference (the multibib
labeled
option). Without natbib
(only using multibib
), it works fine. But together with natbib
, the "O" prefix vanishes in the text. In the bibliography, it is still there. I need to use natbib
because the sort&compress
feature.
Working minimal example:
\documentclass{scrbook}
\usepackage{filecontents}
\begin{filecontents}{main.bib}
@ARTICLE{travis,
author = {Brehm, M. and Kirchner, B.},
title = {TRAVIS - A free Analyzer and Visualizer for Monte Carlo and Molecular
Dynamics Trajectories},
journal = {J. Chem. Inf. Model.},
year = {2011},
volume = {51 (8)},
pages = {2007-2023},
owner = {Brehministrator},
timestamp = {2011.11.27}
},
@ARTICLE{welton2001,
author = {L. Cammarata and S. G. Kazarian and P. A. Salter and T. Welton},
title = {Molecular states of water in room temperature ionic liquids},
journal = {Phys. Chem. Chem. Phys.},
year = {2001},
volume = {3},
pages = {5192-5200},
owner = {Brehministrator},
timestamp = {2011.12.11}
}
}
\end{filecontents}
\usepackage[square, sort&compress, super, comma]{natbib}
\usepackage[labeled,resetlabels]{multibib}
\newcites{O}{Own Publications}
\begin{document}
\chapter{Introduction}
Citing my own literature\citeO{travis}.
Citing other people's literature\cite{welton2001}.
\appendix
\bibliographystyle{plain}
\bibliographystyleO{plain}
\bibliography{main}
\bibliographyO{main}
\end{document}
To compile this, you need to run bibtex separately on "main" and on "O".
Best Answer
Here is a way to achieve your result. (I had duplicated your references to check whether the sorting and compression works.)
You have to keep in mind that the
natbib
package should be commented till you generateO.bbl
and<filename>.bbl
. That is to load thenatbib
package once you generate thebbl
files usingbibtex
. Otherwise, the\citation
entries will only write to<filename>.aux
and theO.bbl
will generate with no\bibitem{...}
. This will be kept in your mind in later stage when you edit yourmain.bib
file.The macros which are defined between
\makeatletter
and\makeatother
are taken fromnatbib
package.The output will look like: