%% Global usepackages, options, configurations, …

\usepackage[a4paper,margin=2.6cm]{geometry}

\usepackage[english,french]{babel}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{xfrac}
\usepackage{csquotes}
\usepackage[dvipsnames]{xcolor}
\usepackage{makecell}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{array}
\usepackage{multirow}
\usepackage{listings}
\usepackage{colortbl}
\usepackage{hyperref}
%\usepackage{shorttoc}
\usepackage{enumerate}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{import}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{tikz}
\usepackage{needspace}
\usepackage[noEnd=true]{algpseudocodex}
\usepackage[bottom]{footmisc}  % footnotes are below floats
\usepackage[final]{microtype}

\usetikzlibrary{positioning}
\usetikzlibrary{fit}

\emergencystretch=1em

% Local sty files
\usepackage{include/my_listings}
\usepackage{include/todo}
\usepackage{include/leftrules}

\input{include/macros.tex}


% 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{}
}

% Hyperlinks
\definecolor{link_blue}{RGB}{0,0,97}
\hypersetup{
%    bookmarks=true,         % show bookmarks bar?
%    unicode=false,          % non-Latin characters in Acrobat’s bookmarks
%    pdftoolbar=true,        % show Acrobat’s toolbar?
%    pdfmenubar=true,        % show Acrobat’s menu?
%    pdffitwindow=false,     % window fit to page when opened
%    pdfstartview={FitH},    % fits the width of the page to the window
%    pdftitle={My title},    % title
%    pdfauthor={Author},     % author
%    pdfsubject={Subject},   % subject of the document
%    pdfcreator={Creator},   % creator of the document
%    pdfproducer={Producer}, % producer of the document
%    pdfkeywords={keyword1} {key2} {key3}, % list of keywords
%    pdfnewwindow=true,      % links in new PDF window
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor=link_blue,          % color of internal links (change box color with linkbordercolor)
    citecolor=ForestGreen,        % color of links to bibliography
    filecolor=magenta,      % color of file links
    urlcolor=link_blue           % color of external links
}

% Listing floats -- thanks https://tex.stackexchange.com/a/279245
\newfloat{lstfloat}{htbp}{lop}
\floatname{lstfloat}{Listing}
\def\lstfloatautorefname{Listing}
\DeclareCaptionSubType{lstfloat}

\newfloat{algorithm}{htbp}{lop}
\floatname{algorithm}{Algorithm}
\def\algorithmautorefname{Algorithm}

\def\chapterautorefname{Chapter}
