# How to put left aligned equation inside algorithmic

I have a one-line equation that I want to use just like a statement in algorithmic. I tried with flalign and the equation still goes into the center. Could you please tell me how to fix that? Here is my MWE:

\begin{algorithm}
\begin{algorithmic}
\State
\begin{flalign}
E_i &= \arg\!\max_{E\in \mathcal{E}} F(E)
\end{flalign}
\end{algorithmic}
\end{algorithm}


The reason I want to use equation instead of simple math mode is that I want {E\in \mathcal{E} to be properly under argmax, rather than a subscript. So if there is a way to do that, I'm happy with the simple $ instead of equation. • Do you need the equation to be numbered? – Werner May 18 '16 at 20:30 • @Werner: No I don't. – qsp May 18 '16 at 20:31 ## 1 Answer Use \displaystyle to force content to be set similar to display math: \documentclass{article} \usepackage{algpseudocode,amsmath} \DeclareMathOperator*{\argmax}{arg\,max}% https://tex.stackexchange.com/q/5223/5764 \begin{document} \begin{algorithmic}[1] \State$\displaystyle E_i = \argmax_{E \in \mathcal{E}} F(E)$\State$E_i = \argmax_{E \in \mathcal{E}} F(E)\$
\end{algorithmic}

\end{document}