I'm using \DeclareMathOperator*{\argmin}{argmin} for getting the argmin parameter. Every thing is Ok expect if I type it inside algorithmic table, it fails to show the correct output. In the below picture, the scenario is shown

The code for this picture is
\documentclass{article}
\usepackage{algorithm,algpseudocode,float}
\usepackage{amsmath}
\DeclareMathOperator*{\argmin}{argmin}
%-----------
\makeatletter
\newenvironment{breakablealgorithm}
{% \begin{breakablealgorithm}
\begin{center}
\refstepcounter{algorithm}% New algorithm
\hrule height.8pt depth0pt \kern2pt% \@fs@pre for \@fs@ruled
\renewcommand{\caption}[2][\relax]{% Make a new \caption
{\raggedright\textbf{\ALG@name~\thealgorithm} ##2\par}%
\ifx\relax##1\relax % #1 is \relax
\addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##2}%
\else % #1 is not \relax
\addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##1}%
\fi
\kern2pt\hrule\kern2pt
}
}{% \end{breakablealgorithm}
\kern2pt\hrule\relax% \@fs@post for \@fs@ruled
\end{center}
}
\makeatother
\begin{document}
$$
a = \argmin_s
$$
\begin{breakablealgorithm}
\caption{XXXXXXXXX}
\begin{algorithmic}[1]
\State{$\text{A} = \argmin_s B$}
\end{algorithmic}
\end{breakablealgorithm}
\end{document}
My question is now why it doesn't work properly inside the algorithm.

\[…\]preferable to$$? – Werner Feb 25 '15 at 01:56