Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
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 '12 at 16:51
add comment

1 Answer 1

up vote 6 down vote accepted

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} 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.