LaTeX Latex problem with alignment character and &

  • Thread starter Thread starter HMPARTICLE
  • Start date Start date
  • Tags Tags
    alignment Latex
Click For Summary
The discussion centers around an error encountered in LaTeX when trying to calculate the distance between two points using the formula AB = √((2-(-1))² + (3-4)²). The user reports receiving a "misplaced alignment character &" error in their LaTeX editor, despite the code working correctly in the forum. It is suggested that the issue may stem from preceding code in the document rather than the formula itself, indicating a potential problem with the LaTeX environment setup or syntax in the editor being used. The user has attempted this in two different LaTeX editors, reinforcing the notion that the issue is likely not specific to a single editor.
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 :(
 
I guess it is a problem with the LaTeX editors, not a problem with the forum then.
 
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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 5 ·
Replies
5
Views
8K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K