0

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

1
  • 1
    Usually it will be centered, so can you make a complete example (a minimal working example (MWE)) that demonstrates the problem? And unrelated, but why write \text{$SM$} instead of just SM? Apr 11, 2017 at 19:07

1 Answer 1

1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .