It seems that \COMMENT
in the algorithm
package is broken. It gives an error when used in a FOR
or FORALL
line, so the first comment gives a compilation error:
\begin{algorithm}[ht]
\caption{My algorithm}
\begin{algorithmic}
\FORALL{$p \in P$} \COMMENT{loop over all puppies}
\STATE PatPuppy($p$) \COMMENT{sooo nice!}
\ENDFOR
\end{algorithmic}
\end{algorithm}
The error is:
Something's wrong--perhaps a missing \item.
leading text: \FORALL{$p \in P$}
Is there a workaround? I really need to display a comment on that line.
\documentclass{article}...\usepackage{...}
).