\documentclass{book} 
\usepackage{amsmath, amssymb} 
\usepackage{amsthm} % let's me fiddle with the theorem environment below
\usepackage{enumerate}  % lets you do \begin{enumerate}[(a)] and such
\usepackage{url} % formats url's nicely using \url{}
\usepackage{makeidx} % indexing

%% you will probably need packages for graphics; this one's for pdflatex
\usepackage{graphicx}

%% put bibliography and index in \toc, [nottoc] means don't put \toc in \toc
\usepackage[nottoc]{tocbibind} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%  we are using the fancyhdr package to do our headers,
%%  we will be busy for a while setting this up
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{fancyhdr}
\usepackage[overload]{textcase} % fixes MakeUppercase so it doesn't affect stuff in math mode
\pagestyle{fancyplain}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter. \MakeUppercase{#1}}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection. \MakeUppercase{#1}}{}}
\renewcommand{\headrulewidth}{0pt}

% page style for first page of chapters
% this is being redefined (i.e., don't change the name!), so that we can use it in other places too
\fancypagestyle{plain}{
  \fancyhf{} % clear all headers and footers
  \fancyfoot[CE,CO]{\thepage}
}
% page style for other things
\fancypagestyle{content}{
  \fancyhf{} % clear all headers and footers
  \fancyhead[LE]{\hspace{3em}\footnotesize{\leftmark}}
  \fancyhead[RO]{{\footnotesize\rightmark}\hspace{3em}}
  \fancyfoot[CE,CO]{\thepage}
}

% makes blank pages introduced by \cleardoublepage have \pagestyle{empty}
% mwn snarfed this from somewhere
\makeatletter
\def\cleardoublepage{
  \clearpage
  \if@twoside\ifodd\c@page\else
  \hbox{}
  \thispagestyle{empty}
  \newpage
  \if@twocolumn\hbox{}\newpage\fi
  \fi\fi
  }
\makeatother
%% end of fancyhdr setup %%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% the goal is to use the ams theorem environment, with the text in \textsl
%% rather than \textit, and to avoid the ams proof environment
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newtheoremstyle{plainsl}%
	{\topsep}
	{\topsep}
	{\slshape} % only non-default setting
	{}
	{\normalfont\bfseries}
	{.}
	{ }
	{}

% I prefer 1.2 Lemma to Lemma 1.2
\swapnumbers

{\theoremstyle{plainsl}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}}
{\theoremstyle{remark}
\newtheorem{example}[theorem]{Example}}

% I label my lemmas with tags of the form lem:name,
% and then I cite them as \lref{name}; you might not want to bother
\newcommand\chref[1]{Chapter~\ref{cha:#1}}
\newcommand\lref[1]{Lemma~\ref{lem:#1}}
\newcommand\tref[1]{Theorem~\ref{thm:#1}}
\newcommand\cref[1]{Corollary~\ref{cor:#1}}
\newcommand\sref[1]{Section~\ref{sec:#1}}

% I do not like the ams proof environment, because it inserts too much
% space between the statement of the theorem/lemma/whatever and the proof
% so I use \proof text.\qed
% The AMS proof environment will not function properly once \proof
% and \qed are defined as below.
\renewcommand\proof{\noindent\textsl{Proof. }}
\newcommand\sqr[2]{{\vbox{\hrule height.#2pt
    \hbox{\vrule width.#2pt height#1pt \kern#1pt
        \vrule width.#2pt}\hrule height.#2pt}}}
% Put \qed at the end of each proof, flush against the full stop.
% you cannot use \qed inside the align or multline environments
% instead use: \tag*{\sqr53}
%(you cannot use \qed inside eqnarray either, but you should be using align rather than eqnarray)
\renewcommand\qed{%
	\ifmmode\eqno\sqr53
	\else\nolinebreak\ \hfill\sqr53\medbreak\fi}

%% end of theorem/proof adjustments %%%%%%%%%%%%%%%%%%%%%%%%%%%

%% equation numbers in each section start at 1,
%% references to equation numbers should include the section, of course
\numberwithin{equation}{section}

%% there is a lot to be said for just writing out your macro definitions here explicitly
%% if you do need a file, keep it in the same directory

%%\input mymacros

%% Here are my most useful macros
%% I also have a bunch of abbreviations (\al for \alpha) and \mathcal's
%% (\newcommand\cA{\mathcal{A}}, etc)
%%
%% use \comp in place of \bar
\newcommand\comp[1]{{\mkern2mu\overline{\mkern-2mu#1}}}
%% a substitute for setminus
\newcommand\diff{\mathbin{\mkern-1.5mu\setminus\mkern-1.5mu}}
%% use \pmat{a&b\\ c&d} for a 2 x 2 matrix
\newcommand\pmat[1]{\begin{pmatrix} #1 \end{pmatrix}}
%% for "f restricted to S": $f\res S$
\newcommand\res{\mathbin{\mkern-2.0mu\restriction\mkern-2.0mu}}% ch2
\newcommand\sbs{\subseteq}
\newcommand\sps{\supseteq}
\newcommand\seq[3]{#1_{#2},\ldots,#1_{#3}}

\DeclareMathOperator\supp{supp} % = \newcommand\supp{\mathop{\mathrm{supp}}}
\DeclareMathOperator\im{im}
\DeclareMathOperator\rk{rk}
\DeclareMathOperator\tr{tr}

\newcommand\cx{{\mathbb C}}% complexes
\newcommand\fld{{\mathbb F}}
\newcommand\flde{{\mathbb E}}
\newcommand\ints{{\mathbb Z}}
\newcommand\nn{{\mathbb N}}%non-negative integers
\newcommand\re{{\mathbb R}}%reals
\newcommand\rats{{\mathbb Q}}

\makeindex

\begin{document}

%% start numbering in roman
\pagenumbering{roman}
\pagestyle{empty} % no headers and footers (for now)

%% you could put the next four items in one file
\include{title}\cleardoublepage
\include{declaration}\cleardoublepage % this is my thesis,...
\include{abstract}\cleardoublepage
\include{thanks}\cleardoublepage

\pagestyle{plain} % do the table of contents in plain headers and footers
\tableofcontents\cleardoublepage

%% restart numbering, in arabic; adjust page style
\pagenumbering{arabic}
\pagestyle{content}

%% give your chapters names - you might change the order at some point (trust me!)
\include{intro}
\include{schemes}
\include{ratio}
\include{partition}
\include{EKR}
\include{orthogonality}

%\bibliographystyle{mwnbib}
%\bibliography{main}

\printindex

\end{document}

