\LoadClass[letterpaper, 10pt]{article}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{resume}[2018/05/11 Custom Resume Class]

% Page layout, define margins
\RequirePackage[top=0.7in, bottom=0.7in, left=0.7in, right=0.7in]{geometry}

% Define color names used below
\RequirePackage{xcolor}
\definecolor{navy}{RGB}{38, 75, 154}
\definecolor{grey}{RGB}{140, 140, 154}
\definecolor{lightgrey}{RGB}{180, 180, 200}

% Redefine sections for our own formatting
\RequirePackage{titlesec}
% Reduce font size, make bold, left-aligned, and navy-colored
\titleformat{\section}
	{\large\scshape\bf\raggedright\color{navy}}
	{}{0em} % indentation
	{}
\titleformat{\subsection}
	{\normalsize\bf\raggedright}
	{}{1em} % indentation
	{}

% Reduce spacing from the default
\titlespacing{\section}
	{0pt}
	{2ex}  % vertical spacing above section text
	{.5ex} % vertical spacing below section text
\titlespacing{\subsection}
	{0pt}
	{1ex}  % vertical spacing above section text
	{.5ex} % vertical spacing below section text

% Created versions of \section and \item commands which also display dates
\newcommand{\datedsection}[2]{%
	\section[#1]{#1 \hfill \color{grey}\normalfont{#2}}%
}
\newcommand{\datedsubsection}[2]{%
	\subsection[#1]{#1 \hfill \color{grey}\normalfont{#2}}%
}
\newcommand{\dateditem}[2]{%
	\item{#1 \hfill \color{grey}#2}%
}

% Create new list environment to reduce the vertical spacing between \item's
\newenvironment{reslist}
{\begin{itemize}
	\setlength{\topsep}{0pt}
	\setlength{\itemsep}{0pt}
	\setlength{\parskip}{0pt}
	\setlength{\parsep}{0pt}
	\setlength{\partopsep}{0pt}

	% Make \item use dashes, open circles, diamonds, and dashes again instead
	% of bullets
	\renewcommand\labelitemi{--}
	\renewcommand\labelitemii{$\circ$}
	\renewcommand\labelitemiii{$\diamond$}
	\renewcommand\labelitemiv{-}}
{\end{itemize}}

% Create new environment lists with no bullets to reduce the vertical spacing
% between \item's
\newenvironment{reslistbare}
{\begin{reslist}
	% Don't use anything for bullets for \item
	\renewcommand\labelitemi{}
	\renewcommand\labelitemii{}
	\renewcommand\labelitemiii{}
	\renewcommand\labelitemiv{}}
{\end{reslist}}

% Place text centered between two lines
\newcommand{\textbetweenlines}[2][.4pt]{%
	\par\vspace{\topsep}
	\noindent\makebox[\textwidth]{%
		\sbox0{#2}%
		\dimen0=.5\dimexpr\ht0+#1\relax
		\dimen2=-.5\dimexpr\ht0-#1\relax
		\color{lightgrey}
		\leaders\hrule height \dimen0 depth \dimen2\hfill
		\color{black}
		\quad #2\quad
		\color{lightgrey}
		\leaders\hrule height \dimen0 depth \dimen2\hfill
		\color{black}
	}\par\nopagebreak\vspace{\topsep}
}

% Turn off page numbering
\pagestyle{empty}

% Tell LaTeX that hyphenation is Baaaad
\hyphenpenalty=5000
