% file thesis.tex
% Master Document sets up all display and includes text files
% Other file used in setup, e.g. titlepage, is  header.tex

%table of contents, etc, introduced in header.tex !!!

\documentclass[twoside]{report} %,draft,openright]
\tolerance=1000  % all 3 of these commands make LaTeX less fussy about what
\hbadness=10000  % is a ``good'' length/width/height of a page
\raggedbottom

%\listfiles %lists files called in compiling this document
%\usepackage{showkeys} %shows label names, etc
%optional graphics packages
%\usepackage{axodraw,color}
%essential graphics packages
\usepackage{epsf,graphicx}
%define additional symbols
\usepackage{latexsym,amssymb}
%both these packages are essential for a decently presented thesis
\usepackage{setspace,cite} %double spacing for text, single for captions,
		      	   %footnotes, etc.
%\usepackage{mcite} %can find on web. not really recommended
%\usepackage{draft} %draft option - doesn't put full figures in -
		    % useful when editing
%does the headers on the pages - keep in
\usepackage{fancyhdr}
%\usepackage{makeidx} %in case you have an index too
%\makeindex  %also needed for an index
\usepackage{a4}

%newcommands.tex can be a text file that defines shortcuts
%\input{newcommands}

%fiddling with the page dimensions - optional
\setlength{\textheight}{23cm}
\setlength{\textwidth}{13.7cm}

%   this is for BibTeX.  If you choose not to use it and to make your
%   own bibliography (which is daft, imo), remove these lines
\bibliographystyle{h-physrev3}
\bibliography{../jcwbibliography/rwj}
%rwj.bib is provided with these files

%omitting any of these makes the thesis compile without the omitted
%chapter - good for editing single chapters.
\includeonly{header,intro,background,appendix}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%      end of preamble and start of document     %%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\newpage

%Puts page numbering of preamble in roman and of main body of thesis in
%arabic. Also defines how chapters and sections are made
\pagenumbering{arabic}
\setcounter{page}{1} \pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\chaptername%
\ \thechapter:\,\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\,\ #1}}

%DEFINES TITLE PAGE, and contains abstract, acknowledgements, etc.

\include{header}

\newpage

%sets up headers for lefthand and righthand pages. To alter, edit
%these lines and the chaptermark/sectionmark lines above
%NOTE some of these lines are redundant, but I haven't had time to
%optimize the size of this file, and anyway, IT WORKS as is.
\addtolength{\headheight}{3pt}
\fancyhead{}
\fancyhead[LE]{\sl\leftmark}
\fancyhead[LO,RE]{\rm\thepage}
\fancyhead[RO]{\sl\rightmark}
\fancyfoot[C,L,E]{}
%\renewcommand{\headrulewidth}{0.5pt}
\pagenumbering{arabic}
%\setcounter{page}{1} %\pagestyle{headings}

\singlespacing  % you must use setspace.sty to get this. setspace also
		% defines the below two spacing options. It's magic.
%\doublespacing
%\onehalfspacing
\input{intro.tex}
\input{background.tex}
\input{appendix.tex}

%adds the bibliography to the table of contents
\addcontentsline{toc}{chapter} 
		 {\protect\numberline{Bibliography\hspace{-96pt}}} 


\end{document}
