0

I want to have a 2 line aligned equation. When I try to compile the following code I receive a few errors and I cannot understand why.

\begin{equation}
\begin{split}
n \nabla \cdot \boldsymbol{v} + \boldsymbol{v} \cdot \nabla n + \frac{\partial n}{\partial t} &= 0 \\

n \sum_{i=1}^3\Big( \frac{\partial\dot{q_i}}{\partial q_i}+\frac{\partial\dot{v_i}}{\partial v_i} \Big) + \boldsymbol{v}\cdot \nabla n + \frac{\partial n}{\partial t} &= 0
\end{split}
\end{equation}

I recieve the errors:

Missing $ inserted
Missing \endgroup inserted
Display math should end with $$.
Mico
  • 506,678

1 Answers1

0

The environment align and aligned are probably more suited than split for what you are looking for. Look at the following MWE:

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
n \nabla \cdot \boldsymbol{v} + \boldsymbol{v} \cdot \nabla n + \frac{\partial n}{\partial t} &= 0 \\
n \sum_{i=1}^3\Big( \frac{\partial\dot{q_i}}{\partial q_i}+\frac{\partial\dot{v_i}}{\partial v_i} \Big) + \boldsymbol{v}\cdot \nabla n + \frac{\partial n}{\partial t} &= 0
\end{align}

\end{document}

Another solution, would be to use sub-equations as follows:

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}
\begin{subequations}
\begin{align}
n \nabla \cdot \boldsymbol{v} + \boldsymbol{v} \cdot \nabla n + \frac{\partial n}{\partial t} &= 0 \\
n \sum_{i=1}^3\Big( \frac{\partial\dot{q_i}}{\partial q_i}+\frac{\partial\dot{v_i}}{\partial v_i} \Big) + \boldsymbol{v}\cdot \nabla n + \frac{\partial n}{\partial t} &= 0
\end{align}
\end{subequations}
\end{document}

Hope that helps.

Romain

RockyRock
  • 1,221
  • 2
    but now you have two equation numbers. with split is only one ... – Zarko May 17 '18 at 16:30
  • Yes, using subequations is probably a much cleaner solution. – RockyRock May 17 '18 at 16:40
  • 1
    no :-). what op desire, is one number, so it use split ... error in his/her code example is empty line as pointed David in his comment. also use \biggl( and \biggr) is more correct selection for parenthesis. – Zarko May 17 '18 at 16:46