0

I am using \listofalgorithms in a document with \documentclass{amsbook}. It seems the two clash for some reason. When I run pdflatex, I get the following error message:

(./main.loa
! Undefined control sequence.
\@dottedtocline ... \hbox {$\m@th \mkern \@dotsep 
                                                  mu\hbox {.}\mkern \@dotsep...
l.1 ...uction algorithm.\relax }}{11}{algorithm.1}

?

Below is a minimal code snippet that produces the error in question. If one comments out \listofalgorithms the code compiles just fine under pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian). Oh, and I get the error when I run pdflatex the second time, that is after LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right..

\documentclass[12pt,a4paper]{amsbook}

\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}

\title{Example}

\begin{document}
    \maketitle

    \listofalgorithms

    \chapter{Introduction}
        This is about homotopy theory.

            \begin{algorithm}
                \begin{algorithmic}[1]
                    \Procedure{ComputeY}{$X$}
                        \State \Return $Y$
                    \EndProcedure
                \end{algorithmic}
                \caption{Algorithm.}
                \label{algo:algo1}
            \end{algorithm}
\end{document}

Any idea regarding what could be the problem?

2
  • 2
    Could you please provide the minimal code, that reproduces this error?
    – Rico
    Commented Jan 13, 2016 at 11:52
  • @Rico, I have just updated the post. Commented Jan 13, 2016 at 12:02

1 Answer 1

2

the ams document classes treat lists of "whatever" differently from the definitions in the basic document classes, and thus with some of the additional packages (like those for algorithms) that follow the method of the book class.

if you add these definitions to your preamble, the form of the list of algorithms should be compatible with the amsbook way of doing things.

\makeatletter
\renewcommand{\listofalgorithms}{\@starttoc{loa}{List of Algorithms}}
\let\l@algorithm=\l@figure
\makeatother

You must log in to answer this question.

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