I'm writing my thesis and I have a few algorithms (using algorithm2e) that I want to list in my appendix, but I don't want to start a new page. Also my listoffigures currently creates a section, not a chapter, same for my bibliography.
Therefore I want to do the same for listofalgorithms, but I can't change it correctly. This is how the figure list is changed:
\renewcommand{\listoffigures}{%
\@cfttocstart
\par
\begingroup
\parindent\z@ \parskip\cftparskip
\section{\listfigurename}
\@starttoc{lof}%
\endgroup
\@cfttocfinish%
}%
I have tried not changing it from chapter to section, but change the layout of the chapter to section, but I can't get it perfectly, because I can't change the skip distance after the heading.
This is what almost looks right:
\renewcommand\listalgorithmcfname{\thesection\hspace{3mm}List of Algorithms}
\begingroup
\let\cleardoublepage\relax % book
\let\clearpage\relax % report
\titleformat{\chapter} [hang] {\Large\bfseries\sffamily} {\thesection} {1em} {}
\listofalgorithms
\endgroup
I tried suggestions of similar threads, but they use other algorithm packages, so I think the algorithm2e handles things in some different manner.
Any help is appreciated.
Edit: @Werner: I can't tell you why, but it's not working. Maybe it isn't in fact using a chapter, I'm not sure. It starts on a new page and the indent is the same as chapter headers.
This is a MWE:
\documentclass{report}
\usepackage{algorithm2e}
\begin{document}
\begin{algorithm}
\caption{Algorithm}
\end{algorithm}
\listofalgorithms
\end{document}