I'd like to organize a thesis-like document with ut-thesis
package such that there is a main .tex
file as the following:
\documentclass{ut-thesis}
\degree{X}
\department{X}
\gradyear{X}
\author{X}
\title{X}
\setcounter{tocdepth}{2}
\flushbottom
\begin{document}
\begin{preliminary}
\maketitle
\begin{abstract}
\end{abstract}
\tableofcontents
\end{preliminary}
\include{chap1}
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{plain}
\bibliography{thesis}
\end{document}
where chap1.tex
is:
\chapter{Introduction}
This chapter is your first plan...
Now, assume that I want to define some commands or add some packages into my chapter file. For example, I may need to add amsthm
package, in addition to the following commands:
\renewcommand{\qedsymbol}{$\blacksquare$}
\newtheorem{thm}{Theorem}
\newtheorem{lem}{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{cor}{Corollary}
\newtheorem{conj}{Conjecture}
\theoremstyle{definition}
\newtheorem{defn}{Definition}
\newtheorem{exmp}{Example}
\newtheorem{rem}{Remark}
If I add anything before chapter{}
, the following error will be raised:
Can be used only in preamble. \usepackage
How to import packages and commands into chapter files?
\documentclass{book} \usepackage{yourmasterpreamblewitheverythingyouneed} \begin{document} \input{chapter1}\end{document}
, or replace\input{chapter1}
by\include{chapter1}
(if really needed)didn't work
mean? You cannot compile the chapter on its own regardless.