% https://grad.wisc.edu/currentstudents/doctoralguide/
% TODO: cool quote: God made the bulk; surfaces were invented by the devil. https://en.wikiquote.org/wiki/Wolfgang_Pauli

% document
\documentclass[11 pt, twoside, openright]{report}  % 10 to 12 pt font required
\usepackage[letterpaper, margin=1in]{geometry}  % 1 inch margins required
\usepackage{setspace}
\usepackage{afterpage}
\usepackage{color}
\usepackage{array}

% headers (required: page number in upper right, nothing else)
\usepackage{fancyhdr}
\fancypagestyle{plain}{
	\fancyhf{}
	\fancyhead[R]{\thepage}
	\fancyfoot{}
	\renewcommand{\headrulewidth}{0pt}
	\renewcommand{\footrulewidth}{0pt}
}
\pagestyle{plain}{\rhead{\thepage}}

% ensure that floats appear in the section they are defined in (http://tex.stackexchange.com/a/235312)
\usepackage{placeins}
\let\Oldsection\section
\renewcommand{\section}{\FloatBarrier\Oldsection}
\let\Oldsubsection\subsection
\renewcommand{\subsection}{\FloatBarrier\Oldsubsection}
\let\Oldsubsubsection\subsubsection
\renewcommand{\subsubsection}{\FloatBarrier\Oldsubsubsection}

% text
\usepackage[utf8]{inputenc}
\setlength\parindent{0pt}
\setlength{\parskip}{1em}
\usepackage{enumitem}
\setlist{noitemsep, topsep=0pt, parsep=0pt, partopsep=0pt}
\renewcommand{\familydefault}{\sfdefault}
\newcommand{\RomanNumeral}[1]{\textrm{\uppercase\expandafter{\romannumeral #1\relax}}}
\usepackage{etoolbox}
\AtBeginEnvironment{verse}{\singlespacing}
\AtBeginEnvironment{tabular}{\singlespacing}

% code highlighting 
%\usepackage{minted}
\definecolor{light-gray}{gray}{0.90}
\newcommand{\code}[1]{\colorbox{light-gray}{\texttt{#1}}}

% graphics
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{epstopdf}
\usepackage{etoc}
\usepackage{tikz}

% math
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[cm]{sfmath}
\DeclareMathOperator{\me}{e}

% misc / ?
\usepackage[nottoc]{tocbibind}
\usepackage{fixltx2e}
\usepackage{pdfpages}
\usepackage[utf8]{inputenc}

% hyperref
\usepackage[colorlinks=true, linkcolor=black, urlcolor=blue, citecolor=black, anchorcolor=black]{hyperref}
\usepackage[all]{hypcap}  % helps hyperref work properly

% bibliography
\usepackage[backend=biber, natbib=true, sorting=none, maxbibnames=99]{biblatex}
\bibliography{bibliography}

% glossary
\usepackage[acronym, nopostdot, nogroupskip]{glossaries}
\newcommand{\comma}{,\penalty \exhyphenpenalty}
\newlength\glsnamewidth
\setlength{\glsnamewidth}{0.3\hsize}
\setlength{\glsdescwidth}{1\hsize}
\newglossarystyle{myglossarystyle}{
	\setglossarystyle{super}
	\renewenvironment{theglossary}{
		\tablehead{}
		\tabletail{}
		\begin{supertabular}{p{\glsnamewidth}p{\glsdescwidth}}}{\end{supertabular}}
	\renewcommand{\glossentry}[2]{
		\raggedleft
		\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
		\glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline}}
\renewcommand{\arraystretch}{1}
\setglossarystyle{myglossarystyle}
\newglossary[slg]{symbolslist}{syi}{syg}{Symbols}
\makeglossaries
\include{glossary}


\usepackage{tocloft}
 
\setlength\cftparskip{0pt}
\setlength\cftbeforechapskip{-5pt}
\setlength\cftbeforesecskip{-7pt}
\setlength\cftbeforesubsecskip{-10pt}

\begin{document}

% pre ---------------------------------------------------------------------------------------------

\begin{centering}
\thispagestyle{empty}

% TITLE PAGE
\textbf{Spectroscopy and Such (Working Title)} \\
\vspace{80 pt}
By \\
Blaise Jonathan Thompson \\
\vspace{40 pt}
A dissertation submitted in partial fulfillment of \\ 
the requirements for the degree of \\
\vspace{10 pt}
Doctor of Philosophy \\
(Chemistry) \\
\vspace{40 pt}
at the \\
UNIVERSITY OF WISCONSIN - MADISON \\
20xx \\
\vspace{200 pt}
\end{centering}

\noindent Date of final oral examination: xx/xx/xxxx \\
This dissertation is approved by the following members of the Final Oral Committee: \\
\-\hspace{1cm} John C. Wright, Professor, Analytical Chemistry \\
\-\hspace{1cm} x \\
\-\hspace{1cm} x \\
\-\hspace{1cm} x \\
\-\hspace{1cm} x \\

\pagenumbering{gobble}
\cleardoublepage  % TODO: remove page number

\pagenumbering{roman}  % must use roman page numbering in preamble

% CONTENTS
\tableofcontents
\listoffigures
\listoftables

% ACKNOWLEDGEMENTS
\cleardoublepage
\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}

% ABSTRACT
\cleardoublepage
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}

% QUOTE
\pagenumbering{gobble}
\cleardoublepage

\setlength{\parskip}{\baselineskip}

\vspace*{2 cm}

\noindent \emph{The explanatory stories that people find compelling are simple; are concrete rather
  than abstract; assign a larger role to talent, stupidity and intentions than to luck; and focus
  on a few striking events that happened rather than on the countless events that failed to
  happen.}

\noindent \emph{The ultimate test of an explanation is whether it would have made the event
  predictable in advance.}

\noindent \emph{Paradoxically, it is easier to construct a coherent story when you know little,
  when there are fewer pieces to fit into the puzzle. Our comforting conviction that the world
  makes sense rests on a secure foundation: our almost unlimited ability to ignore our ignorance.}

\hfill -- Daniel Kahneman \cite{KahnemanDaniel2013a}

\cleardoublepage

\pagebreak

\doublespacing  % double spacing required for body of paper
\pagenumbering{arabic}

% chapters ----------------------------------------------------------------------------------------

\part{Background}
\include{introduction/chapter}
\include{spectroscopy/chapter}
\include{materials/chapter}

\part{Instrumental Development}
\include{software/chapter}
\include{instrument/chapter}

\part{Applications}
\include{PbSe/chapter}
\include{MX2/chapter}
\include{PEDOT:PSS/chapter}
\include{pyrite/chapter}
\include{BiVO4/chapter}

% appendix -----------------------------------------------------------------------------------------

\part{Appendix}
\begin{appendix}
\include{public/chapter}
\include{procedures/chapter}
\include{hardware/chapter}
\include{errata/chapter}
\include{colophon/chapter}
\end{appendix}

% post --------------------------------------------------------------------------------------------

\pagenumbering{gobble}

\singlespacing
\renewcommand{\arraystretch}{2}  % there is probably a better way...
\printglossaries
\printbibliography

\end{document}