Latex problem with alignment character and &

  • Context: LaTeX 
  • Thread starter Thread starter HMPARTICLE
  • Start date Start date
  • Tags Tags
    alignment Latex
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 2K views
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.
 
Physics news on Phys.org
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.