\ProvidesPackage{setup_long}

\RequirePackage{amsbsy,amsmath,amssymb,amsthm,commath,chngcntr,dsfont, econometrics,fancyhdr}
\RequirePackage{cleveref}

% Setting up page style 
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{Page \thepage}
\setlength{\headheight}{14.5pt}

% Change expectation and probability to bold font
\renewcommand{\E}{\mathbb{E}}
\renewcommand{\P}{\mathbb{P}}

% Declare some shortcuts
\newcommand{\ind}{\mathds{1}}
\newcommand{\wcov}{\rightsquigarrow}
\newcommand{\andbox}{\hbox{ }\text{ and }\hbox{ }}

% Make capital vectors commands from econometrics packages
\newcommand{\vA}{\mathbf{A}}
\newcommand{\vB}{\mathbf{B}}
\newcommand{\vC}{\mathbf{C}}
\newcommand{\vD}{\mathbf{D}}
\newcommand{\vE}{\mathbf{E}}
\newcommand{\vF}{\mathbf{F}}
\newcommand{\vG}{\mathbf{G}}
\newcommand{\vH}{\mathbf{H}}
\newcommand{\vI}{\mathbf{I}}
\newcommand{\vJ}{\mathbf{J}}
\newcommand{\vK}{\mathbf{K}}
\newcommand{\vL}{\mathbf{L}}
\newcommand{\vM}{\mathbf{M}}
\newcommand{\vN}{\mathbf{N}}
\newcommand{\vO}{\mathbf{O}}
\newcommand{\vP}{\mathbf{P}}
\newcommand{\vQ}{\mathbf{Q}}
\newcommand{\vR}{\mathbf{R}}
\newcommand{\vS}{\mathbf{S}}
\newcommand{\vT}{\mathbf{T}}
\newcommand{\vU}{\mathbf{U}}
\newcommand{\vV}{\mathbf{V}}
\newcommand{\vW}{\mathbf{W}}
\newcommand{\vX}{\mathbf{X}}
\newcommand{\vY}{\mathbf{Y}}
\newcommand{\vZ}{\mathbf{Z}}


% Declare New Math Operators
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator{\cube}{Cub}
\DeclareMathOperator{\Cov}{Cov}
\DeclareMathOperator{\err}{err}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\Poisson}{Poisson}
\DeclareMathOperator{\polylog}{polylog}
\DeclareMathOperator{\supp}{supp}
\DeclareMathOperator{\sign}{sign}
\DeclareMathOperator{\Var}{Var}

% Command to add numbering to otherwise unnembered equations 
\newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}}

% Set up fat title, roman body theorem styles
\theoremstyle{definition}
\newtheorem{assumption}{Assumption}
\crefname{assumption}{assumption}{assumptions}
\newtheorem*{assumption*}{Assumption}
\newtheorem{condition}{Condition}
\crefname{condition}{condition}{conditions}
\newtheorem*{condition*}{Condition}
\newtheorem{definition}{Definition}
\crefname{definition}{definition}{definitions}
\newtheorem*{definition*}{Definition}
\newtheorem{example}{Example}
\crefname{example}{examples}{examples}
\newtheorem*{example*}{Example}
\newtheorem{remark}{Remark}
\crefname{remark}{remark}{remarks}
\newtheorem*{remark*}{Remark}
\newtheorem{specification}{Specification}
\crefname{specification}{specification}{specifications}
\newtheorem*{specification*}{Specification}
\newtheorem{solution}{Solution}
\crefname{solution}{solution}{solutions}
\newtheorem*{solution*}{Solution}

% Set up fat title, italic body theorem styles
\theoremstyle{plain}
\newtheorem{corollary}{Corollary}
\crefname{corollary}{corollary}{corollaries}
\newtheorem*{corollary*}{Corollary}
\newtheorem{lemma}{Lemma}
\crefname{lemma}{lemma}{lemmas}
\newtheorem*{lemma*}{Lemma}
\newtheorem{prop}{Proposition}
\crefname{prop}{proposition}{propositions}
\newtheorem*{prop*}{Proposition}
\newtheorem{theorem}{Theorem}
\crefname{theorem}{theorem}{theorems}
\newtheorem*{theorem*}{Theorem}


% Long document so number within sections
\numberwithin{assumption}{section}
\numberwithin{corollary}{section}
\numberwithin{definition}{section}
\numberwithin{equation}{section}
\numberwithin{example}{section}
\numberwithin{figure}{section}
\numberwithin{lemma}{section}
\numberwithin{prop}{section}
\numberwithin{remark}{section}
\numberwithin{solution}{section}
\numberwithin{specification}{section}
\numberwithin{theorem}{section}

% Reset footnote counter at each subsection
\counterwithin*{footnote}{subsection}

% Use the dash instead of the word ``to'' in Crefrange
\newcommand{\crefrangeconjunction}{--}


% Set bibliography style
\bibliographystyle{chicago}

% Set table of contents depth
\setcounter{tocdepth}{2}

% Blank Footnote Mark
\newcommand\blfootnote[1]{%
  \begingroup
  \renewcommand\thefootnote{}\footnote{#1}%
  \addtocounter{footnote}{-1}%
  \endgroup
}

% Define some colors 
\definecolor{uclablue}{HTML}{2774AE}
\definecolor{ucladarkblue}{RGB}{0, 85, 135}
\definecolor{uclagold}{RGB}{255, 184, 0}
\definecolor{pastelred}{HTML}{d62d0e}
\definecolor{pastelgreen}{RGB}{2,117,36}
\newcommand{\ucla}[1]{\textcolor{uclablue}{#1}}
\newcommand{\darkucla}[1]{\textcolor{ucladarkblue}{#1}}
\newcommand{\gold}[1]{\textcolor{uclagold}{#1}}
\newcommand{\red}[1]{\textcolor{pastelred}{#1}}
\newcommand{\green}[1]{\textcolor{pastelgreen}{#1}}


