\usepackage{fontspec}
\usepackage[english,french]{babel}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{stmaryrd}
\usepackage{amsthm}
\usepackage{xfrac}
\usepackage{csquotes}
\usepackage{booktabs}
\usepackage{array}
\usepackage{listings}
\usepackage{colortbl}
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{enumerate}
\usepackage{import}
\usepackage{appendixnumberbeamer}
\usepackage[bottom]{footmisc}  % footnotes are below floats
\usepackage[final]{microtype}
\usepackage{tikz}  % Alas.
\usepackage[outline]{contour}
\usepackage{trimclip}

% Local sty files
\usepackage{include/my_listings}
\usepackage{include/todo}
\input{include/macros.tex}

\emergencystretch=1em

% Tikz
\usetikzlibrary{positioning}
\usetikzlibrary{fit}

% Graphics location
\def\basegraphicspath{assets/imgs/}
\newcommand{\resetgraphicspath}
    {\graphicspath{{\basegraphicspath}}}
\newcommand{\setgraphicspath}[1]
    {\graphicspath{{\basegraphicspath}{\basegraphicspath/#1}}}
%\graphicspath{{\basegraphicspath}}
\resetgraphicspath{}

% Chapter management
\newcommand{\importchapter}[1] {
    \setgraphicspath{#1}
    \subincludefrom{#1}{main.tex}
    \resetgraphicspath{}
}

% Temporarily set leftmargini
\newlength{\STASHleftmargini}
\newenvironment{tightitemize}[1]{
    \setlength{\STASHleftmargini}{\leftmargini}
    \setlength{\leftmargini}{#1}
}{
    \setlength{\leftmargini}{\STASHleftmargini}
}
