%                                 _     _                                
%  _ __  _ __ ___  __ _ _ __ ___ | |__ | | ___        ___ ___  _ __ ___  
% | '_ \| '__/ _ \/ _` | '_ ` _ \| '_ \| |/ _ \_____ / __/ _ \| '_ ` _ \ 
% | |_) | | |  __/ (_| | | | | | | |_) | |  __/_____| (_| (_) | | | | | |
% | .__/|_|  \___|\__,_|_| |_| |_|_.__/|_|\___|      \___\___/|_| |_| |_|
% |_|                                                                    
%                         _            
%  _ __ ___   ___  _ __  | |_ _____  __
% | '_ ` _ \ / _ \| '_ \ | __/ _ \ \/ /
% | | | | | | (_) | | | || ||  __/>  < 
% |_| |_| |_|\___/|_| |_(_)__\___/_/\_\
%                                      
% Pablo (C) 2022

\usepackage{amsmath, amssymb, amsthm, stmaryrd, mathrsfs, gensymb, dsfont}
\usepackage{mathtools, adjustbox}
\usepackage[scr=esstix,cal=boondox]{mathalfa}
\usepackage{enumitem, xfrac, xcolor, cancel, multicol, tabularx, relsize}
\usepackage{fancyvrb, hyperref, csquotes}
\usepackage{xalgebra, xtopology, xgeometry, functional, capitalgreekall}
\usepackage{ytableau}
\usepackage[backend=biber]{biblatex}
\usepackage{pgfplots, tikz, tikz-cd}
\usepackage{graphicx, wrapfig}
\usepackage{xparse}
\usepackage[normalem]{ulem}
\usepackage{minted}

% Set the color scheme used by minted
\usemintedstyle{friendly}

% Configure graphics
\usetikzlibrary{calc, shadows.blur, shapes.geometric, patterns, arrows}
\pgfplotsset{compat=1.16}

% Double struck letters
% The following is kept besides \AA being already defined because I don't care
% abaut Å
\renewcommand{\AA}{\mathbb{A}}   % Double struck A
\newcommand{\BB}{\mathbb{B}}     % Double struck B
\newcommand{\CC}{\mathbb{C}}     % Double struck C
\newcommand{\DD}{\mathbb{D}}     % Double struck D
\newcommand{\EE}{\mathbb{E}}     % Double struck E
\newcommand{\FF}{\mathbb{F}}     % Double struck F
\newcommand{\GG}{\mathbb{G}}     % Double struck G
\newcommand{\HH}{\mathbb{H}}     % Double struck H
\newcommand{\II}{\mathbb{I}}     % Double struck I
\newcommand{\JJ}{\mathbb{J}}     % Double struck J
\newcommand{\KK}{\mathbb{K}}     % Double struck K
\newcommand{\LL}{\mathbb{L}}     % Double struck L
\newcommand{\MM}{\mathbb{M}}     % Double struck M
\newcommand{\NN}{\mathbb{N}}     % Double struck N
\newcommand{\OO}{\mathbb{O}}     % Double struck O
\newcommand{\PP}{\mathbb{P}}     % Double struck P
\newcommand{\QQ}{\mathbb{Q}}     % Double struck Q
\newcommand{\RR}{\mathbb{R}}     % Double struck R
% The following is ommited because LaTeX keeps complaining about \SS not being
% allowed in mathmode
% \renewcommand{\SS}{\mathbb{S}} % Double struck S
\newcommand{\TT}{\mathbb{T}}     % Double struck T
\newcommand{\UU}{\mathbb{U}}     % Double struck U
\newcommand{\VV}{\mathbb{V}}     % Double struck V
\newcommand{\WW}{\mathbb{W}}     % Double struck W
\newcommand{\XX}{\mathbb{X}}     % Double struck X
\newcommand{\YY}{\mathbb{Y}}     % Double struck Y
\newcommand{\ZZ}{\mathbb{Z}}     % Double struck Z
\newcommand{\hh}{\mathds{h}}     % Double struck h
\newcommand{\kk}{\mathds{k}}     % Double struck k

% Use \blacksquare for \qed
\renewcommand{\qedsymbol}{\ensuremath{\blacksquare}}

% Only use \smallsetminus
\renewcommand{\setminus}{\smallsetminus}

% Make the \mid symbol taller (this is useful for Group Theory)
\renewcommand{\mid}{\,\mathlarger{\mathlarger{\mathchar"326A}}\,}
\renewcommand{\nmid}{\,\mathlarger{\mathlarger{\mathchar"352D}}\,}

% Get propper inequality symbols
\renewcommand{\leq}{\leqslant}
\renewcommand{\le}{\leqslant}
\renewcommand{\geq}{\geqslant}
\renewcommand{\ge}{\geqslant}
\renewcommand{\preceq}{\preccurlyeq}
\renewcommand{\succeq}{\succcurlyeq}

% Add missing arrows
\newcommand{\longhookrightarrow}{\lhook\joinrel\longrightarrow}
\newcommand{\longhookleftarrow}{\longleftarrow\joinrel\rhook}
\DeclareRobustCommand\longtwoheadrightarrow
  {\relbar\joinrel\twoheadrightarrow}

% Fix the subset symbol
\renewcommand{\subset}{\subseteq}

% Redefine \bar
\renewcommand{\bar}{\overline}

% A semantic alternative to \textbf
\newcommand{\strong}[1]{\textbf{#1}}

% Set cardinal
\newcommand{\card}[1]{\left|\nobreak#1\nobreak\right|}

% Minus sign with a dot over it. Usefull for typsetting saturated subtraction
\def\dotminus{\mathbin{\ooalign{\hss\raise1ex\hbox{.}\hss\cr
  \mathsurround=0pt$-$}}}

% Empty macro (it's usefull for typesetting Young diagrams)
\newcommand{\void}{ }

% Display long arrows instead of short ones
\renewcommand{\to}{\longrightarrow}
\renewcommand{\mapsto}{\longmapsto}
\renewcommand{\To}{\Longrightarrow}

% Fix the goddamn \chi and \wp macros!
% For some reason the default LaTeX fonts place this characters much lower than
% where people actually expect them to be. This new definitions place them in
% with the appropriate spacing
\renewcommand{\chi}{\ensuremath \raisebox{\depth}{$\mathchar"11F$}}
\renewcommand{\wp}{\ensuremath \raisebox{\depth}{$\mathchar"17D$}}

