# Combine several chapters (separate files) in to one report

I am writing my final year thesis. I was asked to write my report part by part. First I wrote the Introduction chapter. No I have completed the Literature Survey. Both these were written as two separate articles(document class). Both these tex files reside in different directories and both of them have their own bibliography. All the bibtex files are kept in a common folder

Report
>intro
>introduction.tex
>lit-review
>literature-review.tex
>refs
>refgroup1.bib
>refgroup2.bib


Now I want to combine these two articles in to one document as two chapters, to produce a draft report which will be extended further by adding new parts as my research progresses. The references should be displayed at the end of the whole report.

Could someone guide me to do this? Thank you

-

Use a larger document class like book, report, or memoir, that allows chapters. Include the text of your introduction (the document part, not the preamble) in the first chapter, and the text of your lit review in the second.

Use the multibib or chapterbib package to manage separate bibliographies.

-
Chapterbib worked fine for me. 1 vote up. –  yCalleecharan Jan 3 '11 at 21:00
Thank you for the information. I simply wanted to list my references at the end of the document. All I had to do was write a simple tex file to combine everything. I posted my answer below. I am sure knowing the existence of those two packages you mentioned will come in handy someday. –  Niroshan Jan 6 '11 at 11:51

I would suggest to have a look at the (excellent) package classicthesis.

-

You may want to look at this post:

Equation numbers messed up

-
It listed references at the end of each chapter. I wanted them to list at the end of the whole document. I posted the solution I am using. Thank you (ya I will need lot of luck to complete it with in the time given :D ) –  Niroshan Jan 6 '11 at 11:56
I am just wondering if you have several articles, then why would you want to put the bibliography at the end of your whole document? Don't you think it's better that each article is followed by its own bibliography? I don't know how to move your bibliography to the end of your whole document. Maybe you can take a look at the memoir package. It has lots of options. –  yCalleecharan Jan 12 '11 at 9:20
I guess the title was misleading. I changed the title a bit. I wanted to combine several chapters in to one report (I described the task in question content though). A reference may be quoted in several chapters. –  Niroshan Jan 18 '11 at 19:06

I found a very useful pdf with some examples. This is the link (This is the link I downloaded the example, I am sorry if it doesn't work anymore)

This pdf gives few examples in dividing your document in to multiple files. I used the reverse approach and made it work in the way I want it to work.

Here is the latex code I used

\documentclass[10pt,a4paper,final]{report}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{hyperref}
%This is for removing coloured boxes around the links and internal references. I don't like those boxes%
\hypersetup{
pdfborder={0 0 0},
}

\begin{document}

\include{./titlepage} % including my cover page

\pagenumbering{roman}
\tableofcontents
%---- I commented these since my document doesn't need them yet-----%
%\listoffigures
%\listoftables

%\chapter*{Acknowledgements}
%\begin{abstract}
%\end{abstract}

\pagenumbering{arabic}
\include{./intro/introduction}
\include{./lit-review/literature-review}
\bibliographystyle{IEEEtran}
\bibliography{./relative/path/to/my/bibtexfiles}
\end{document}


The include files must not have \begin{document} and \end{document} tags in them. And better not have any formatting code in them too. Otherwise they might overwrite each other and produce unexpected results.

compiling the file that contain above code was enough to produce correct results. First compile with pdflatex, then with bibtex and twice again with pdflatex.

This is my titlepage.tex

% the start of the tex file
\begin{titlepage}

\begin{center}
%----  Title page content -----%
\end{center}

\end{titlepage}
% end of file


And this is how my introduction.tex looked like

% the start of the .tex file
\chapter{Introduction}