TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use the algorithm and algorithmicx packages to type algorithms in a paper and my main document class is amsart. All is well until I try to use \listofalgorithms. This returns a variety of error messages, some of which I've been able to work around thanks to other threads on this website. I am now stuck at the following and here is a (very) minimal working example:

\let\chapter\section               % Conflict fix found on this site.
\usepackage[norelsize]{algorithm}  % [norelsize] fixes another conflict.

\listofalgorithms                  % This is the problematic command.

This MWE uses algorithmic but the same behavior occurs with algorithmicx. Running this through pdflatex returns the error

! Missing } inserted.
<inserted text> 
l.7 \listofalgorithms

I'm hoping someone has a hint as to how to fix this.


share|improve this question
I made an update to my answer changing some settings to make the list of algorithms behave more as the list of figures, or tables. – Gonzalo Medina Nov 26 '12 at 23:52
algorithm knows the options plain, ruled and boxed for the appearance of algorithms; nothing, part, chapter, section, subsection and subsubsection for their numbering; any other option is taken as the algorithm name (for a different language than English, for instance). – egreg Nov 27 '12 at 0:03
@GonzaloMedina I was doing the same. I'm currently working with \def\l@algorithm{\@tocline{1}{0pt}{1pc}{2.1em}{}} which seems to be compact and looks like the table of contents. – Dominique Nov 27 '12 at 0:03
up vote 5 down vote accepted

Some redefinitions are necessary (notice that I didn't use the norelsize option):

\let\chapter\section               % Conflict fix found on this site.
\usepackage{algorithm}  % [norelsize] fixes another conflict.

\def\l@algorithm{\@tocline{0}{3pt plus2pt}{0pt}{1.9em}{}}



\caption{test algorithm one}
\caption{test algorithm two}


enter image description here

share|improve this answer
Awesome. Thanks! Indeed using norelsize changed "List of Algorithms" to "List of Norelsizes" in my case!!! Now I just have to tweak the appearance of the list. – Dominique Nov 26 '12 at 23:53

Your Answer


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.