I'm pretty new to (La)TeX so please forgive me if this question is stupid :)
I have an algorithm that is typeset with the algorithm
and algorithmic
packages.
Then I have this in the algorithm:
\WHILE[growingPhase returns $topK \eq \emptyset$ \OR $\sum_{u_i^-} > k^{th}score$]
{$\exists S_i$ such that $S_i \neq \emptyset$ \AND $growingPhase()$}
Which gives me an undefined control sequence error. The same line without the comment works fine:
\WHILE{$\exists S_i$ such that $S_i \neq \emptyset$ \AND $growingPhase()$}
Also another while works fine with comments:
\WHILE[latice.maxUpperBound is the largest upper bound among the objects in the latice when fullUpdate() or lightUpdate() was last called]
{$\exists S_i$ such that $S_i \neq \emptyset$ \AND $latice.maxUpperBound > k^{th}score$}
So I'm pretty sure it's not the comment, rather the math or the \OR
in the comment that makes the trouble...
A minimum (non)working example is:
\documentclass[twoside,11pt,openright]{report}
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\usepackage{a4}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{epsfig}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[labeled]{multibib}
\usepackage{color}
\usepackage{datetime}
\usepackage{epstopdf}
\usepackage{subfig}
\usepackage{algorithm}
\usepackage{algorithmic}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\renewcommand{\algorithmicforall}{\textbf{for each}}
\renewcommand{\algorithmiccomment}[1]{\hfill// \textit{#1}}
\algsetup{linenosize=\tiny}
\captionsetup[algorithm]{font={scriptsize}}
\begin{document}
\begin{algorithm}
\begin{algorithmic}[1]
\WHILE[growingPhase returns $topK \eq \emptyset$ \OR $\sum_{u_i^-} > k^{th}score$]{$\exists S_i$ such that $S_i \neq \emptyset$ \AND $growingPhase()$}
\ENDWHILE
\end{algorithmic}
\end{algorithm}
\end{document}
(also the comment gives the same error when used in a \COMMENT{}
macro.)