I'm compiling a thesis where the main TeX file contains all my preamble declarations before including the thesis chapters as individual TeX files. I'd prefer, however, to have a single bibliography at the end of the thesis but before any appendices. However, when I try to do this none of my citations appear correctly in the chapters, i.e. they are replaced with "?", even though they all appear in the bibliography.
I discovered the xcite
package, which I've attempted to use to solve this problem but haven't got it working correctly. Probably a simple misunderstanding on my part of how to implement it.
The main file creates the main thesis from several chapters and the bibliography:
\documentclass{report}
\usepackage[authoryear,comma,nonamebreak,round,sort&compress]{natbib}
\usepackage{xcite}
\bibliographystyle{plainnat}
\externalcitedocument{Chapter1}
\externalcitedocument{Chapter2}
...
\externalcitedocument{Chaptern}
\externalcitedocument{Appendix}
\begin{document}
\include{Chapter1}
\include{Chapter2}
....
\include{Chaptern}
\bibliography{Bibliography}
\appendix
\include{Appendix}
\end{document}
And the each chapter or appendix only contains text content, i.e. no preamble or \begin{document}
and \end{document}
commands. Citations within the text are made in the format:
...as found in \citet{Smith2013}...
I've tried moving \externalcitedocument{Chapteri}
to the ith. chapter TeX file but it made no difference. I'm using WinEdt7 PDFTeXify to compile my document and JabRef to create the bibliography.
It seems like such a straightforward action that I can only assume I've not used xcite
correctly.
Best Answer
Just to show you that
xcite
is not necceccary and how to build an MWE for your problem please check the following MWE (with commentedxcite
). It includes with packagefilecontents
three chapter files and a bib file. If you copied this MWE into filemwe.tex
then\jobname
becomesmwe
.Compile this MWE with latex, bibtex, latex, latex and you will get a pdf file and four warnings, coming from package
filecontents
(they are okay and can be ignored). If you have still?
instead of a correct citation there is something other wrong with your system or way to build the pdf file.