[texhax] i'm using natbib and chapterbib but cannot get thebibliographies to appear in separate chapters of the book?any ideas?

Steve Schwartz s.schwartz at imperial.ac.uk
Sat Feb 5 18:23:22 CET 2005


Well, I think I know what Ludwig wants to do, and here's a recipe, based
on a book we've just finished. We failed to use chapterbib (I forget
whether there was some interference with the style files imposed by the
publisher or whatever). Anyway:

1  You need a master .tex file for the whole book which sets everything
up. It should have:
\usepackage[sectionbib]{natbib} somewhere (I forget exactly what the
sectionbib option does).

2  In that master, you need to \include (NOT \input) each chapter.tex
file (these chapter.tex files can \input subsections if they wish). The
point here is that each \include'd file will generate its own .aux file.
Each of these chapter.tex files has to declare its bibliographystyle,
bibliography, AND \input its .bbl file, so they will look like:

% this is chapterone.tex
... % can \input files of sections, etc. here
\bibliographystyle{...}
\bibliography{...}   % bib file
\input{chapterone.bbl} % this will fail the 1st run through. Better is:

\IfFileExists{chapterone.bbl}{\input{chapterone.bbl}}{\typeout{chapterone.bbl not found; run bibtex chapterone}

3  latex as (we used pdflatex to generate a nice, hyper-ref'ed book)

latex master.tex
bibtex chapterone  % this will generate a .bbl with only chapterone refs
bibtex chaptertwo
... etc.
latex master.tex
latex master.tex

NOTE: Do NOT run bibtex on master, as that will generate .bbl's which
contain all the references for the book in each chapter!

This is not a perfect solution. You may find that latex gives you lots
of warnings about multiply-defined citations (because the same keys may
appear in different chapters if you use a common .bib file).

There may be/should be/probably are other more elegant ways, but this
will work. It may also give you clues as to what you might be doing
wrong at present with your attempts using chapterbib.

HTH,
Steve


On Sat, 2005-02-05 at 16:11, Philip G. Ratcliffe wrote:
> Subject: [texhax] i'm using natbib and chapterbib but cannot get
> thebibliographies to appear in separate chapters of the book?any ideas?
> 
> Novel way of writing e-mail!  Anyway, it's a little hard to help with no
> example of exactly what you're doing.
> 
> Cordialmente,  Philip G. Ratcliffe
> _________________________________________
> 
> Professor of Nuclear & Subnuclear Physics
> Dipartimento di Fisica e Matematica
> Università degli Studi dell'Insubria
> via Valleggio 11
> 22100 Como (CO)
> Italy
> 
> Tel. +39 (031) 238.6231
> Fax  +39 (031) 238.6119
> Cell +39 (340) 2346580
> Web  http://www.unico.it/~pgr
> 
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> TeX newsgroup: http://groups.google.com/groups?group=comp.text.tex
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
> 
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
-- 
+-------------------------------------------------------------------+
Professor Steven J Schwartz       Phone: +44-(0)20-7594-7660
Space and Atmospheric Physics     Fax:   +44-(0)20-7594-7772
The Blackett Laboratory           E-mail: s.schwartz at imperial.ac.uk
Imperial College London           Office: Huxley 6M70 
London SW7 2AZ, U.K.              Web: http://www.sp.ph.ic.ac.uk/
+-------------------------------------------------------------------+



More information about the texhax mailing list