% adjustwidth environment
\RequirePackage{changepage}

% nicer ellipses
%\RequirePackage{ellipsis}

% nicer numbers
\RequirePackage{numprint}
\npthousandsep{,}

% nicer tables
\RequirePackage{tabularx}
\RequirePackage{booktabs}
\RequirePackage{color, colortbl}
\definecolor{rowhighlight}{gray}{0.95}

% fix overfull hboxes
\setlength{\emergencystretch}{1.5em}

% embed images
\RequirePackage{graphicx}

% add border around figures
\RequirePackage{float}
\floatstyle{boxed}
\restylefloat{figure}

% smaller caption, align with text instead of ``figure'', bold ``figure''
\RequirePackage[hang,small,bf]{caption}

% nicer descriptions
%\RequirePackage{enumitem}
% inparaenum
\RequirePackage{paralist}

\RequirePackage{fontspec}
\setmainfont[
  RawFeature={protrusion=default},
  Ligatures=TeX,
  Extension=.otf,
  UprightFont=*-regular,
  BoldFont=*-bold,
  ItalicFont=*-italic,
  BoldItalicFont=*-bolditalic
]{texgyretermes}

\RequirePackage{setspace}
  \onehalfspacing

% reset section counter for each part
\usepackage{chngcntr}
  \counterwithin*{section}{part}

% mini-toc
\RequirePackage{titletoc}

% links
\RequirePackage[usenames,dvipsnames,svgnames]{xcolor}
\definecolor{link}{HTML}{224466}
\RequirePackage[unicode,colorlinks=true,linkcolor=black,citecolor=black,urlcolor=link,linktoc=all,hypertexnames=false]{hyperref}
\urlstyle{same}


%\pdfprotrudechars2 % 1 if you don't want to change line breaking
%\RequirePackage[protrusion=true,expansion]{microtype}

%\RequirePackage{polyglossia}
%  \setmainlanguage{english}

\RequirePackage[american]{babel}
\RequirePackage{csquotes}
\RequirePackage[backend=biber,style=apa,mincitenames=1,maxcitenames=2]{biblatex}
\DeclareLanguageMapping{american}{american-apa}

% add 3cm margin on the left
%\RequirePackage[left=3cm,right=2.5cm,top=2cm,bottom=2cm]{geometry}
\RequirePackage[left=3cm,right=2.5cm,top=2cm,bottom=3.25cm]{geometry}

% header: 1.25cm
% footer: 1.25cm
\usepackage{fancyhdr}
\setlength{\headheight}{1.25cm}
\setlength{\footskip}{1.25cm}
\pagestyle{fancyplain}

\renewcommand{\headrulewidth}{0.2pt}
\renewcommand{\footrulewidth}{0.2pt}
%\newcommand{\headline}[1]{{\begin{center}\linespread{0.9}\headlinefont\Huge\textbf{#1}\end{center}}}
\newcommand{\headline}[1]{{\begin{center}\linespread{0.9}\Large\textbf{#1}\end{center}}}

%\fancyhead{}
\fancyfoot{}
\fancyfoot[L]{\footnotesize{Ricardo Wurmus (3607635), Assigment 2, 72296 Environmental Impact Assessment}}
\fancyfoot[R]{\thepage}

\RequirePackage[toc,title]{appendix}
\usepackage[nottoc,numbib]{tocbibind}
