[Tex/LaTex] List of Algorithms Using algorithm2e

algorithm2etable of contents

According to the documentation, I can add an entry in the ToC for the list of algorithms created using the algorithm2e package by including dotocloa as a package option. When I do this I receive an error:

! Undefined control sequence.
l.1005 \newcommand{\algocf@name
                               }{algorithm2e}%

How can I fix it so List of Algorithms appears in the ToC?

Here is a minimum non-working example:

\documentclass[10pt]{book}

\usepackage[dotocloa]{algorithm2e}

\begin{document}

\tableofcontents

\chapter{Test}

\begin{algorithm} 
\caption{AlgorithmName}\label{alg:AlgorithmName}
\end{algorithm}

\end{document}

Best Answer

This seems to be a bug in the package. I think there might be some confusion between 'algorithms' and 'algorithmes' (which is presumably the French spelling). This hack seems to work though.

\documentclass[10pt]{book}
\usepackage{tocbibind}
\usepackage{algorithm2e}
\newcommand{\listofalgorithmes}{\tocfile{\listalgorithmcfname}{loa}}

\begin{document}

\tableofcontents
\listofalgorithmes

\chapter{Test}

\begin{algorithm} 
\caption{AlgorithmName}\label{alg:AlgorithmName}
\end{algorithm}

\end{document}