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:

    \parindent\z@ \parskip\cftparskip

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}
    \let\cleardoublepage\relax  % book
    \let\clearpage\relax        % report
    \titleformat{\chapter} [hang] {\Large\bfseries\sffamily} {\thesection} {1em} {}

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:



2 Answers 2


I had the same problem and found no solution online, so I opened algorithm2e.sty and dug in. There is actually an undocumented feature to do just that.

I just intended to C-s'd for "chapter" in the whole file until I found something interesting, and I did:

% /!\ this is not part of the solution, it just explains how I found it.

So this means that writing


before calling \usepackage[…]{algorithm2e} will nicely do the trick :).

Another solution is to directly call \@starttoc, knowing that the list of algorithms is toc loa:

\section*{List of Algorithms} % or whatever is preferred

Easiest would be to let \chapter be equivalent to \section:

\let\chapter\section% Make \chapter equivalent to \section

The \chapter update is temporary until \listofalgorithms is complete.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .