I noticed some really weird interaction between algorithms2e and the option newfloat of the minted package.
\documentclass{book}
\usepackage{algorithm2e}
\usepackage[newfloat]{minted}
\begin{document}
\listofalgorithms % here the spacing is not correct
\chapter{A chapter}
\begin{algorithm}\caption{An algorithm}\end{algorithm}
\begin{algorithm}\caption{An algorithm}\end{algorithm}
\chapter{A chapter}
\begin{algorithm}\caption{An algorithm}\end{algorithm}
\begin{algorithm}\caption{An algorithm}\end{algorithm}
\end{document}
Whereas if I invert the order of the loading of the packages the list of algorithms return to behave normally
\usepackage[newfloat]{minted}
\usepackage{algorithm2e}
I must necessarily load first algorithms2e because I dump my preamble to speed up compilation time since I load a ton of packages for typesetting my book, and I can't dump minted because it seems it doesn't get along with the cache option.
Is there a way to avoid this annoying behaviour?


