11

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}
1
  • 2
    It is a bug in the package; line 1001 should be }{} instead of }. There's no fix possible other than editing the file or bypassing the dotocloa option Ian Thompson suggests. Contact the package author.
    – egreg
    Feb 23, 2012 at 16:51

1 Answer 1

9

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} 

You must log in to answer this question.

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