1

I want to write the equal sign below each other. My code is

\begin{equation*}
\overline{x}=\frac{1}{n}\sum_{i=1}^{n}x_{i}
=\frac{1}{3}(1 + 2 + 3)
=2
\end{equation*}

Now i' get

enter image description here

but it should look like this:

enter image description here

5

Load the package amsmath and use the {align} environment:

\begin{align*}
\overline{x}&=\frac{1}{n}\sum_{i=1}^{n}x_{i} \\
&=\frac{1}{3}(1 + 2 + 3) \\
&=2
\end{align*}

End all lines except the last one with \\ and insert & before the symbol you want the columns to be aligned at.

1
\begin{eqnarray*}
\overline{x} &=& \frac{1}{n}\sum_{i=1}^{n}x_{i}\\
&=& \frac{1}{3}(1 + 2 + 3)\\
&=& 2
\end{eqnarray*}
  • 2
    Welcome to the site! Thanks very much for your first contribution! =) However, you should know that eqnarray is severely deprecated and out of date; you should definitely consider following the accepted answer and switch to align – Au101 Mar 13 '18 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.