I was writing my masters' thesis using Latex and have written 4 chapters in 4 different .tex files. Now I wish to combine all these chapters into a single .pdf file. For this I wrote a main .tex file in which I included the 4 tex files using \include statement. However, everytime I run the main tex file, I see an error message :
Message : ! Latex error ! Can be used only in preamble.
What I wrote in the main tex file was the following :
\documentclass[10pt]{thesis}
%\usepackage{pgf}
\usepackage{varioref} % when using \vref the page the figure is on is printed
\usepackage[margin=10pt,font=small,labelfont=bf]{caption} % enables caption adjustments
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{subfigure}
\usepackage{array}
\usepackage{url} % makes nice url's
\usepackage[a4paper, left=3cm,right=3cm,top=4cm,bottom=4cm]{geometry}
%\usepackage{mathcomp}
%\usepackage{mathptmx}
\usepackage{graphicx,color}
\usepackage[english]{babel}
\usepackage{bbm} % enables \mathbbm
\usepackage{lscape} % enables landscape tables
%\usepackage{lettrine} % enables dropcaps ('miniaturen')
\usepackage{float}
\usepackage{caption}
%\usepackage{here}
%\usepackage{rotate}
%\usepackage{fancyhdr}
\usepackage{multirow}
\usepackage{picins}
\usepackage{a4}
\usepackage{braket}
\usepackage{cite}
\begin{document}
\include{Chapter1_Introduction_Final} % Names of my tex files
\include{Chapter2_STIOS}
\include{Chapter3_FrequencyStabilization}
\include{Chapter4_VHDLperformance}
\end{document}
If I compile each .tex file individually , then I get separate .pdf files. However, I want to generate a single .pdf file consisting of all 4 chapters. I would be obliged for the assistance.
\includeand then remove the preamble anddocumentenvironment of each of the chapters. – David Carlisle May 29 '14 at 11:00\chapter{Chaptertitle}and only include the text itself. At this point ofinclusionthey should not be standalone, i.e., they should only require your preamble of your main file – Mario S. E. May 29 '14 at 11:02