I know similar (infact, probably identical) problems have already been posted here, but I have scoured the threads and the suggested solutions do not seem to work for me. So here goes...
It's time for me to start thinking about writing my PhD thesis and, as with my first year transfer report, I shall be doing it in LaTeX. The main difference will be that I want to have a list of references (bibliography) at the end of each chapter.
I have a main file; thesis.tex, which includes the preamble, the first few compulsary pages (ToC, List of Figures/Tables, Abstract, etc.) and then calls each of the sections using the following packages and command;
Code: Select all
\usepackage[numbers, super, comma, sort&compress, sectionbib]{natbib}
\usepackage{chapterbib}
-------------------
\include{Chapter#/chap#}
Code: Select all
\bibliographystyle{plain}
\renewcommand{\bibname}{References to Chapter 1}
.... text .....
\clearpage
\phantomsection
\begin{singlespace}
\addcontentsline{toc}{section}{References to Chapter#}
\bibliography{Chapter#/ch#refs}
Sometime, it correctly generates references for Chapter 1 but not for subsequent chapters. Any references it does show in Chapter 2, for example, are only those that have also appeared in Chapter 1, but the Bibliography at the end of Chapter 2 is just a repeat of that printed at the end of Chapter 1.
It is important to note that I have:
- the ch#refs.bib files for each chapter located in the folder with its associated chap#.tex file
- ch#refs.bib which contain only the references used in that chapter
- the plain.bst file in the main folder with thesis.tex file created this all as a project file (using TeXniCenter) with thesis.tex as the main file
- the .bst file located in the main folder with thesis.tex
- executed the build process in the correct order: LaTeX(main)-BibTeX(each chapter individually)-LaTeX(main)-LaTeX(main)
- tried deleting thesis.bbl, thesis.aux, chap#.aux and starting again from scratch, to no avail.
which implies that BibTeX is not treating the .bib files exclusively.-----------------Output Profile: LaTeX > PDF-------------------
This is BibTeX, Version 0.99c (MiKTeX 2.7)
The top level auxiliary file: thesis.aux
A level-1 auxiliary file: Chapter1/chap1.aux
The style file: Plain.bst
A level-1 auxiliary file: Chapter2/chap2.aux
Illegal, another \bibstyle command---line 2 of file Chapter2/chap2.aux
: \bibstyle
: {plain}
I'm skipping whatever remains of this command
Illegal, another \bibdata command---line 113 of file Chapter2/chap2.aux
: \bibdata
: {Chapter2/ch2refs}
I'm skipping whatever remains of this command
Database file #1: Chapter1/ch1refs.bib
Warning--I didn't find a database entry for "<a-reference-that-appears-only-in-ch2refs.bib>"
<repeats several times>
(There were 2 error messages)
I have quickly thrown together a MWE, which I have attached in a .rar file.
Any ideas on why it doesn't work?
Thanks,
Gingerella