# \begin{align} not working as expected

In this small snippet of code, I'm doing quick derivation to arrive at an equation to be used later in the analysis:

$|\vec{F}|=q|\vec{v}||\vec{B}|sin(\theta)\\ m\frac{v^2}{r}=qvB\\ \frac{2qV}{r}=qvB\\ \frac{2qV}{r}=qB\sqrt{\frac{2qV}{m}}\\ \frac{V}{r}=B\sqrt{\frac{q}{2m}}\sqrt{V}\\$
$$\frac{V}{r}=\lambda\sqrt{V},\lambda\equiv B\sqrt{\frac{q}{2m}}$$


I am admittedly new to LaTeX, but not to programming or mark-up languages. I included

\usepackage{amsmath}


to be able to use

\begin{gather*}
\end{gather*}


but this nor align is working on either side of the dollar signs. I receive the error:

Missing } inserted. <inserted text> } \end{gather*}


Any information on the reconciliation of this problem is greatly appreciated.

• Welcome to TeX.SX! You don't need the  characters for align* or gather*. – user31729 Apr 18 '15 at 23:02 • Lorentz force and centripetal force of a charge in magnetic field? ;-) – user31729 Apr 18 '15 at 23:18 • Yup - specifically the Fine Beam Tube experiment for determining the charge-to-mass ratio of electrons! – Jeesubmyunu Apr 18 '15 at 23:24 • Well, my students' favorite experiment. They like to deflect the beam with external magnets ;-) – user31729 Apr 18 '15 at 23:25 ## 1 Answer None of the align, gather and equation environments must be typeset within of a ...$ pair, since those environments start the math mode for themselves. This is true for the starred variants of the mentioned environments as well. Some side remarks: • Use \sin instead of sin -- it's a math operator which should not be typeset in italics. • \dfrac{}{} is (sometimes) a better replacement for nicer fractions. • \DeclairedPairedDelimiters{\abs}{\lvert}{\rvert} is much better than |some stuff| \documentclass{article} \usepackage{mathtools} \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \begin{document} %$
%m\dfrac{v^2}{r}=qvB\\
%\dfrac{2qV}{r}=qvB\\
%\dfrac{2qV}{r}=qB\sqrt{\dfrac{2qV}{m}}\\
%\dfrac{V}{r}=B\sqrt{\dfrac{q}{2m}}\sqrt{V}\\
%\$

\begin{align*}
\abs{\vec{F}} &=\abs{q}\abs{\vec{v}}\abs{\vec{B}}\abs{\sin(\theta)}\\
m\dfrac{v^2}{r}& =qvB\\
\dfrac{2qV}{r} &=qvB\\
\dfrac{2qV}{r} & =qB\sqrt{\dfrac{2qV}{m}}\\
\dfrac{V}{r} &=B\sqrt{\dfrac{q}{2m}}\sqrt{V}\\
\end{align*}

\begin{align*}
\dfrac{V}{r} &=\lambda\sqrt{V}  &\lambda\equiv B\sqrt{\dfrac{q}{2m}}
\end{align*}

\begin{gather*}$$\dfrac{V}{r}=\lambda\sqrt{V},\lambda\equiv B\sqrt{\dfrac{q}{2m}}$$\end{gather*}

$$\dfrac{V}{r}=\lambda\sqrt{V},\lambda\equiv B\sqrt{\dfrac{q}{2m}}$$

\end{document}

• I'd be tempted to insert \quad after the \lambda\sqrt{V}, terms in the gather* and equation environments. – Mico Apr 19 '15 at 1:42
• @Mico: I left that as an exercise to the OP -- he will realize that it doesn't look very nice. And if egreg's thunderbold should struck me down, I have to stand it ;-) Thanks anyway – user31729 Apr 19 '15 at 1:43
• shouldn't \DeclarePairedDelimiter be in the preamble? – barbara beeton Apr 19 '15 at 2:16
• @barbarabeeton: Yes, of course. I was in a hurry. Thanks for notifying me – user31729 Apr 19 '15 at 8:20