Misplaced alignment character error in LaTeX align environment

  • Topic: LaTeX 
  • Thread starter HMPARTICLE
  • Start date
  • Tags Tags
    alignment Latex
3 replies · 2K views · last reply
HMPARTICLE
Messages
95
Reaction score
0
\begin{align*}
AB &= \sqrt{(2-(-1))^2+(3-4)^2}\\
&= \sqrt{3^2+(-1)^2}\\
&= \sqrt{10}.
\end{align*}

is what i am entering.
This is the error i am getting;

misplaced alignment character &.I am baffled.
 
for some reason it is working on here, but not in my latex editor, i have tried 2 different latex editors :(
 
HMPARTICLE said:
for some reason it is working on here, but not in my latex editor, i have tried 2 different latex editors :(
The error might be due to the code appearing before this.