# Commands argmin and argmax in algorithm

I am trying to use the argmin and the argmax commands that I defined in an algorithm but I keep getting the argument not in the middle but on the right. Does anyone have an idea how to put the argument in the middle.

I declare the operators:

\DeclareMathOperator*{\argmin}{\arg\!\min}
\DeclareMathOperator*{\argmax}{\arg\!\max}


and I use the following packages to write algorithms:

\usepackage[chapter]{algorithm}
\usepackage{algorithmic}


Full algorithm code:

\begin{algorithm}
\begin{algorithmic}
\STATE some statement here
\WHILE{!stop}
\STATE $s_{i} = \argmin_{p} \| l_{j} - s_{p} \|$
\ENDWHILE
\end{algorithmic}
\end{algorithm}

-
i don't understand why you use the already-defined \arg and \min rather than just \DeclareMathOperator*{\argmin}{argmin}. –  barbara beeton Nov 20 '12 at 15:10
