1

I have prepared a cover page and the first chapter of my dissertation. Both of these are in different tex files.

I read that in order to have everything in a master file you need to use the include command. It does not work for me so far.

Here is the minimal example.

% cover_page.tex
\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   %%%%%%%
%%%%%%%%%%%%%%%%%%%%%%         TITLE, AUTHOR FOLLOWS            %%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{\textbf{{\huge Proposal}} \\[8pt] Essays on ...}
\author{by Me}
\date{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    DOCUMENT BEGINS    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{document}
\maketitle
\thispagestyle{empty} % no number in the first page

\vspace{3cm}
\begin{center}
Advisor: 
\end{center}

\vspace{2.5cm}


\begin{minipage}[c]{14.5cm}
\centering Proposal 
\end{minipage}


 \vspace{3cm}
 \begin{minipage}[c]{14.5cm}
 \centering Department \\
  University \\
\end{minipage}


\vspace{2.5cm}
\begin{center}
\date{A month}
\end{center}

\newpage
\thispagestyle{empty}

\begin{center}
\begin{tabular}{lllll}
 Advisor & \hspace{2cm} & \hspace{1cm} & Me & \hspace{2cm} \\[25pt] 
 \cline{1-2}\cline{4-5}
 \textit{Signature} & & & \textit{Signature} &  \\[25pt] 
 \cline{1-2}\cline{4-5}
 \textit{Date}  & & & \textit{Date} &  \\ 
 \end{tabular} 
 \end{center}

 \end{document}

Now let us move on chapter_1.tex

\documentclass[10pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\title{My title}
\author{PSK}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    DOCUMENT BEGINS    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\maketitle
\thispagestyle{empty} % no number in the first page

\newpage

Some stuff here 

\end{document}

And last, but not least the master file:

\documentclass{article}

\begin{document}
\include{cover_page.tex}
\include{chapter_1.tex}

\end{document}
Pantelis Kazakis
  • 1,346
  • 1
  • 12
  • 29
  • \include and \input just take the content of the .tex file being \included or \input and more or less put it on that line of the master .tex file, so you should not be repeating things like \documentclass, \title, \author, etc.. – Adam Liter Apr 03 '14 at 02:03
  • I do not quite understand, do you mean to have all the preambles in the master file? How would you fix the aforementioned code? – Pantelis Kazakis Apr 03 '14 at 02:11
  • 2
    Only master file should have preamble. Sub files should have only the content (at present the content within your \begin{document} and \end{document in the sub files). –  Apr 03 '14 at 02:15
  • 1
    Just as @HarishKumar said! The files that you are \includeing should not have \documentclass, \usepackage, \title, \author, \date, \begin{document}, or \end{document}. They should only have content. – Adam Liter Apr 03 '14 at 02:18
  • I excluded all of these stuff from the included files and I have place all the preambles in the master file, but it still does not work. – Pantelis Kazakis Apr 03 '14 at 02:24
  • OK bros, I fixed it. You should not use include{file.tex}, but rather \include{file} + what it was mentioned before. Thank you so much. – Pantelis Kazakis Apr 03 '14 at 02:42

0 Answers0