A thesis in LaTeX

I wrote my PhD thesis in LaTeX, there are many advantages to this including perfect formatting, PDF links, and rock solid stability. Pretty much everyone I know has had major issues writing a thesis in Microsoft Word. The template below should be of some help in creating a nicely formatted thesis. You can download the template file below as main.tex and my introduction chapter introduction.tex and the title page title.tex as an example.

The percent sign (%) is a commenting mark, so everything after "%" in each line is ignored by LaTeX, this is a good way to quickly try different options by commenting out lines of code.

Thesis template

% Thesis template by Bevan Weir %%%%%%%%%%%%%%%%%%%%%%%% start %%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper,12pt,twoside] {book} % title page, draft - warning draft turns off hyperref 
%\usepackage{utopia} % The "Utopia" font
%\usepackage{charter} % The "charter" font
\usepackage{textcomp} % Allows the use of extra characters
\usepackage{verbatim, amsmath, amsfonts, amssymb, amsthm} % For code environment and math support
\usepackage{makeidx} %robustindex % Indexing
\usepackage[british]{babel} % For British English hyphenation patterns
\usepackage[final]{graphicx} %draft % To include graphics
\usepackage{booktabs,longtable,rotating} % long tables are split to other lines %for rotating tables
\usepackage{array,warpcol} % Alignment on decimal point entries in tables
\usepackage{multirow} % muli rows (merge) in tables
\usepackage{fixme} %
\usepackage[section,verbose]{placeins} % Keeps floats `in their place', preventing them from floating past a "\FloatBarrier" command into another section
\usepackage[width=11cm,font=footnotesize,labelfont=bf, % format=default,justification=centerlast]{caption} 
% Captions
\usepackage{fancyhdr} % Change caption style; changes headers and page styles etc.
\usepackage{sectsty} % Changing section headings
\usepackage{setspace} % For changing line spacing
\usepackage{url} % Formatting for URL's i.e. http://www.rhizobia.co.nz
\usepackage{natbib} % The best package for bibliographies
\usepackage{appendix} % Makes appendices
\usepackage{cclicenses} % Creative commons
\usepackage{afterpage} % Makes appendices
\usepackage{microtype} % makes pdf look better
%\usepackage{lineno} % Line numbering [pagewise]
\usepackage[nottoc]{tocbibind} % Table of contents
%\usepackage{texshade} % Fancy DNA sequences
Specificity, and Ecology of New Zealand
Rhizobia},pdfauthor={Bevan Weir},colorlinks=false,
pdfpagelabels]{hyperref} % colourlinks=false for printing 
% ---------------------------------------------------------------
% OPTIONS %\citeindextrue % Fuzz
\hfuzz2pt % Don't bother to report over-full boxes if over-edge is < 2pt   
%Alter page dimensions %\setlength{\textwidth}{16cm}
% with this we ensure that the chapter and section
% headings are in lowercase.
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{} % delete current setting for header and footer
\addtolength{\headheight}{0.5pt} % make space for the rule
\fancyhead{} % get rid of headers on plain pages
\renewcommand{\headrulewidth}{0pt} % and the line
% Document settings \setcounter{secnumdepth}{3} %subsubsections are numbered
\setcounter{tocdepth}{3} %subsubsections are added to the TOC 
\allsectionsfont{\raggedright} % stops headings being split 
% \linenumbers % turns line numbering on %parts to include
%uncomment as necessary
Title, Abstract, Acknowledgements, Glossary, Introduction, Methods,
Identification, Nitrogen, NodA, Discussion, Appendix}
\hyphenation{leg-ume Zea-land leg-umes Car-mi-chae-lia
Car-mi-chae-li-eae leg-u-min-o-sa-rum li-po-poly-sac-ch-rides
exo-poly-sac-ch-rides rep-li-cons Brady-rhi-zo-bi-um
Meso-rhi-zo-bi-um nod-u-la-ted So-pho-ra car-mi-chae-li-ana
beta-proteo-bacteria alpha-proteo-bacteria} 
% \parskip 7.2pt %sets spacing between paragraphs
%-------------------- end of preamble ---------------------
\frontmatter %the following is numbered with roman numerals 
\doublespacing % --> better for proof reading 
\doublespacing % --> better for proof reading 
\mainmatter %start numbering with Arabic numerals 
%\backmatter %still arabic numerals, but sections not numbered in TOC 
\bibliographystyle{bevbib4} %{plainnat}
%\addcontentsline{toc}{chapter}{Index} %leave commented I think

% \textcelsius\ and \textcelsius.
% you can add thin spaces by using: \;
% The symbols * † ‡ § ¶ # should be used for footnotes
% * \dag \ddag \S \P \sharp \diamond %By default, LaTeX doesn't like to fill more than 0.7 of a text page
%with tables and graphics, nor does it like too many figures per
%page. This behaviour can be changed by placing lines like the
%following before \begin{document} %\renewcommand\floatpagefraction{.9}
%\setcounter{totalnumber}{50} \setcounter{topnumber}{50}