-% Code
-% Pseudocode
-\usepackage[algochapter,linesnumbered,lined,boxed]{algorithm2e}
-% Fix the algorithm font
-\renewcommand\AlCapFnt{\normalfont}
-\usepackage{listings}
-% https://tex.stackexchange.com/questions/149056/how-can-i-define-additional-literate-replacements-without-deleting-existing-ones
-\makeatletter
-\def\addToLiterate#1{\edef\lst@literate{\unexpanded\expandafter{\lst@literate}\unexpanded{#1}}}
-\lst@Key{moreliterate}{}{\addToLiterate{#1}}
-\makeatother
-% General listings settings
-\lstset{%
- basewidth=0.5em,
- basicstyle=\tt\small,
- breakatwhitespace=false,
- breaklines=true,
- captionpos=b,
- columns=[c]fixed,
- commentstyle=\sl,
- escapeinside={[+}{+]}, % chktex 9
- frame=L,
- keepspaces=true,
- keywordstyle=\bf,
- postbreak=\mbox{\textcolor{gray}{$\hookrightarrow$}\space},
- showspaces=false,
- showstringspaces=false,
- showtabs=false,
- stringstyle=\it,
- tabsize=4,
- upquote=true,
- numberstyle=\tiny,
-}
-\usepackage{lstlangclean}
-\usepackage{lstlanghaskell}
-\usepackage{lstlangarduino}
-\lstloadlanguages{%
- {[Arduino]C++},%
- {c},%
- {Python},%
- {Clean},%
- {[Regular]Haskell},
- {[Lhs2Tex]Haskell}}
-\newcommand{\cinline}[1]{\lstinline[language=c,postbreak=]|#1|}
-\newcommand{\arduinoinline}[1]{\lstinline[language={[Arduino]C++},postbreak=]|#1|}
-\newcommand{\pythoninline}[1]{\lstinline[language=Python,postbreak=]|#1|}
-\newcommand{\cleaninline}[1]{\lstinline[language=Clean,postbreak=]|#1|}
-\newcommand{\cleaninputlisting}[2][]{\renewcommand*{\lstlistingname}{Listing (\gls{CLEAN})}\lstinputlisting[language=Clean,#1]{#2}}
-\newcommand{\haskellinline}[1]{\lstinline[language={[Regular]Haskell},postbreak=]|#1|}
-\newcommand{\haskellinputlisting}[2][]{\renewcommand*{\lstlistingname}{Listing (\gls{HASKELL})}\lstinputlisting[language={[Regular]Haskell},#1]{#2}}
-\newcommand{\haskelllhstexinline}[1]{\lstinline[language={[Lhs2Tex]Haskell},postbreak=]|#1|}
-%For storing listings in footnotes
-\newsavebox{\LstBox}
-% Fix list of listings title
-\renewcommand{\lstlistlistingname}{List of Listings}
-% Fix list of listings chapter separator
-\makeatletter
-\let\my@chapter\@chapter%
-\renewcommand*{\@chapter}{%
- \addtocontents{lol}{\protect\addvspace{10pt}}%
- \my@chapter}
-\makeatother