%  Maffs 
\usepackage[warnunknown, fasterrors, mathletters]{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{amsfonts, amsthm, amsmath, amssymb, amstext}
\usepackage{mathtools}  % Extension to amsmath

% Maffs-related Utility
\usepackage{cancel, textcomp}
\usepackage[mathscr]{euscript}
\usepackage[nointegrals]{wasysym}
\usepackage[a4paper, total={6in, 9.5in}]{geometry}
\usepackage{esvect} % \vv
\usepackage{IEEEtrantools}

% Extras
\usepackage{tikz-cd}  % For drawing commutative diagrams easily
\usepackage{color}  % Add some colour to life
\usepackage{microtype}  % Miniature font tweaks
\usepackage{siunitx}

% Font
\usepackage[fontsize = 10pt]{scrextend}
\usepackage[T1]{fontenc} % Fixes ugly encoding
\usepackage{libertinus}
\usepackage{libertinust1math}
\usepackage{mathrsfs} % Ralph Smith's Formal Script

% Fancy manipulation
\usepackage{tcolorbox}
\tcbuselibrary{breakable}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{colortbl} % add colour to tables
\usepackage{tabularx} % superior tabular
\usepackage{subcaption} % subtables
\usepackage{booktabs}
\usepackage{listings} % codeblock
\lstset{
	language=Python,
	basicstyle=\scriptsize\ttfamily,
	numberstyle=\color{gray},
	stringstyle=\color[HTML]{933797},
	commentstyle=\color[HTML]{228B22},
	emph={[2]from,import,pass,return},
	emphstyle={[2]\color[HTML]{DD52F0}},
	emph={[3]range},
	emphstyle={[3]\color[HTML]{D17032}},
	emph={[4]for,in,def},
	emphstyle={[4]\color{blue}},
	showstringspaces=false,
	breaklines=true,
	prebreak=\mbox{{\color{gray}\tiny$\searrow$}},
	numbers=left,
	xleftmargin=15pt
}

% Chemistry
\usepackage[version=4]{mhchem}
\usepackage{tikz}
\usepackage{chemfig} % CHEMICAL STRUCTURE 
\setchemfig{atom sep=2em}
\renewcommand*\printatom[1]{\footnotesize \ensuremath{\mathsf{#1}}}

% Custom LGBT Colours
% L
\definecolor{lavender}{HTML}{D783FF} % lavender
\definecolor{bubblegum}{HTML}{FF85FF} % bubblegum
\definecolor{carnation}{HTML}{FF8AD8} % carnation
\definecolor{salmon}{HTML}{FF7E79} % salmon
\definecolor{maraschino}{HTML}{FF2600} % maraschino
\definecolor{cayenne}{HTML}{941100} % cayenne
\definecolor{mocha}{HTML}{945200} % mocha
\definecolor{tangerine}{HTML}{FF9300} % tangerine
\definecolor{cantaloupe}{HTML}{FFD479} % cantaloupe
\definecolor{plum}{HTML}{942193} % plum
\definecolor{maroon}{HTML}{941751} % maroon

% G
\definecolor{asparagus}{HTML}{929000} % asparagus
\definecolor{fern}{HTML}{4F8F00} % fern
\definecolor{teal}{HTML}{009193} % teal
\definecolor{flora}{HTML}{73FA79} % flora
\definecolor{honeydew}{HTML}{D4FB79} % honeydew
\definecolor{seafoam}{HTML}{00FA92} % seafoam

% B
\definecolor{turquoise}{HTML}{00FDFF} % turquoise
\definecolor{ocean}{HTML}{005493} % ocean
\definecolor{midnight}{HTML}{011993} % midnight
\definecolor{eggplant}{HTML}{531B93} % eggplant

\definecolor{aqua}{HTML}{0096FF} % aqua
\definecolor{blueberry}{HTML}{0433FF} % blueberry
\definecolor{spindrift}{HTML}{73FCD6} % spindrift
\definecolor{orchid}{HTML}{7A81FF} % orchid

% T
\definecolor{liquorice}{HTML}{000000} % liquorice
\definecolor{tungsten}{HTML}{424242} % tungsten
\definecolor{iron}{HTML}{5E5E5E} % iron
\definecolor{tin}{HTML}{919191} % tin
\definecolor{magnesium}{HTML}{C0C0C0} % magnesium
\definecolor{mercury}{HTML}{EBEBEB} % mercury

% Nord - https://www.nordtheme.com/docs/colors-and-palettes
\definecolor{night1}{HTML}{2E3440} % nord0
\definecolor{night2}{HTML}{3B4252} % nord1
\definecolor{night3}{HTML}{434C5E} % nord2
\definecolor{night4}{HTML}{4C556A} % nord3
% no snowstorm (nord4~nord6)
\definecolor{frost1}{HTML}{8FBCBB} % nord7
\definecolor{frost2}{HTML}{88C0D0} % nord8
\definecolor{frost3}{HTML}{81A1C1} % nord9
\definecolor{frost4}{HTML}{5E81AC} % nord10
\definecolor{aurorared}{HTML}{BF616A} % nord11
\definecolor{auroraorange}{HTML}{D08770} % nord12
\definecolor{aurorayellow}{HTML}{EBCB8B} % nord13
\definecolor{auroragreen}{HTML}{A3BE8C} % nord14
\definecolor{aurorablue}{HTML}{5E81AC} % nord10
\definecolor{aurorapurple}{HTML}{B48EAD} %n nord15

% Recall available colours
\newcommand{\listofcolours}{%
	\begin{table}[ht!]
		\centering
		\begin{tabularx}{\textwidth}{>{\centering\arraybackslash}X >{\centering\arraybackslash}X >{\centering\arraybackslash}X >{\centering\arraybackslash}X >{\centering\arraybackslash}X >{\centering\arraybackslash}X >{\centering\arraybackslash}X}
			\textbf{L} & \textbf{G} & \textbf{B} & \textbf{T} & \textbf{Nord\_Night} & \textbf{Nord\_Frost} & \textbf{Nord\_Aurora} \\
			\hline
			\textcolor{lavender}{lavender} & \textcolor{asparagus}{asparagus} & \textcolor{turquoise}{turquoise} & \textcolor{liquorice}{liquorice} & \textcolor{night1}{night1} & \textcolor{frost1}{frost1} & \textcolor{aurorared}{aurorared}\\
			\textcolor{bubblegum}{bubblegum} & \textcolor{fern}{fern} & \textcolor{ocean}{ocean} & \textcolor{tungsten}{tungsten} & \textcolor{night2}{night2} & \textcolor{frost2}{frost2} & \textcolor{auroraorange}{auroraorange}\\
			\textcolor{carnation}{carnation} & \textcolor{teal}{teal} & \textcolor{midnight}{midnight} & \textcolor{iron}{iron} & \textcolor{night3}{night3} & \textcolor{frost3}{frost3} & \textcolor{auroragreen}{auroragreen} \\
			\textcolor{salmon}{salmon} & \textcolor{flora}{flora} & \textcolor{eggplant}{eggplant} & \textcolor{tin}{tin} & \textcolor{night4}{night4} & \textcolor{frost4}{frost4} & \textcolor{aurorablue}{aurorablue}\\
			\textcolor{maraschino}{maraschino} & \textcolor{honeydew}{honeydew} & \textcolor{plum}{plum} & \textcolor{magnesium}{magnesium} & & & \textcolor{aurorapurple}{aurorapurple}\\
			\textcolor{cayenne}{cayenne} & \textcolor{seafoam}{seafoam} & \textcolor{aqua}{aqua} & \textcolor{mercury}{mercury} & &\\
			\textcolor{mocha}{mocha} & & \textcolor{blueberry}{blueberry} & {} & & &\\
			\textcolor{tangerine}{tangerine} & & \textcolor{spindrift}{spindrift} & {} & & &\\
			\textcolor{cantaloupe}{cantaloupe} & & \textcolor{orchid}{orchid} & {} & & &\\
			\textcolor{maroon}{maroon} & {} & {} & {} & & &\\
			\hline
		\end{tabularx}
	\end{table}
}%
\usepackage{pgfplots,pgfplotstable}
\pgfplotsset{
        compat=1.17,
        tick label style = {font=\scriptsize},
          every axis label = {font=\footnotesize},
          legend style = {font=\footnotesize},
          label style = {font=\footnotesize}
}
\pgfkeys{/pgf/number format/.cd,1000 sep={}}