[Tex/LaTex] Equations not centered using align

align

I use the following latex code to using align environment but the formula does not appear centered.

\begin{align}
    \text{$SM$}_7 \rightarrow \text{$SM$}_1 :  \{K_{NG},HMAC_{K_{1}}\}_{\{encr\}K_{1}},
\end{align}

But when writing the same code in IEEE journal latex file, the formula was centered.
Can any one help me to make text within align to be centered ??

enter image description here

Best Answer

Looking at the image I would guess you have the fleqn option to set math flush left which is why it is not centred but align should never be used for one-lien equations

\begin{align}
    \text{$SM$}_7 \rightarrow \text{$SM$}_1 :  \{K_{NG},HMAC_{K_{1}}\}_{\{encr\}K_{1}},
\end{align}

should be

\begin{equation}
    SM_7 \rightarrow SM_1 :  \{K_{NG},HMAC_{K_{1}}\}_{\{encr\}K_{1}},
\end{equation}

or perhaps

\begin{equation}
    \mathit{SM}_7 \rightarrow \mathit{SM}_1 :  \{K_{NG},HMAC_{K_{1}}\}_{\{encr\}K_{1}},
\end{equation}

if SM is a single identifier here not a combination of S and M