# how to deal with multiple titles and multiple documents?

I am compiling my dissertation which is composed with several separate papers (with independent LaTeX code).

I have a title for my dissertation and want to insert my individual papers with their own titles (different authors, etc., for each paper).

Someone suggested use

\begin{document}
\include{paper1}
\include{paper2}
\end{document}


where paper1 has the codes as

\begin{document}

\end{document}


But it doesn't solve my problem.

For each individual latex code for the individual paper, I have title code outside of the \begin{document}.

Any suggestion about how to insert the entire LaTeX code of a academic paper, A, into another academic paper, B, while remain everything not changed for A.

-
Have a look at the standalone package. –  Peter Grill Apr 2 '13 at 22:16
You can try either doc­mute (ctan.org/pkg/docmute) or combine (ctan.org/tex-archive/macros/latex/contrib/combine) –  MMA Apr 3 '13 at 1:01

There are broadly two ways to proceed here, and which is easier/'better' depends on your exact requirements.

The first is simply to typeset each sub-document separately and then create the main document using pdfpages. You can then use \includepdf to add each file, with the main title etc. in the main file

\documentclass{reprot} % or similar
\usepackage{pdfpages}
\title{...}
\author{...}
\begin{document}
\maketitle
\includepdf ....


You may want a table of contents, which is doable this way with a little effort. Page numbers can also be added to the included PDFs: you'll probably want to supress them in the sub-documents if you do this.

The second approach is to use for example the combine package to allow multiple documents to be typeset in one run. There are some restrictions on what will and won't work with combine, so that may depend on the document class(es) and packages in use in the sub-documents.

As I say, the exact detail here depends on your situation. I'd recommend focussing things a bit by thinking about the above and asking a new question once you've got a reasonable idea of what makes sense for you.

-

Try this!

\documentclass{article}
\usepackage{fancyhdr}
\title{First Article}
\author{First Author}
\begin{document}
\maketitle
\pagenumbering{gobble}
\end{document}


Save as paper1.tex

Then, create a master file:

\documentclass{report}
\usepackage{pdfpages}
\usepackage{fancyhdr}
\fancyhf{}
\pagestyle{fancy}
\rfoot{\thepage}
\begin{document}
\tableofcontents
\chapter{A chapter}
\section{Introduction}
\includepdf[pages=1-,pagecommand={\thispagestyle{fancy}}]{paper1.pdf}
\includepdf[pages=1-,pagecommand={\thispagestyle{fancy}}]{paper2.pdf}
\end{document}


Save as myDissertation.tex

-