[Tex/LaTex] Undefined control sequence. \end{align*}

amsmatherrors

\begin{align*}
    \DIV \BP =&~\Bzero~,\label{PDE1}\\
    \rho_0 c \dot{\theta}=&-\DIV \BQ + \theta\p{\theta}\BP:\dot{\BF}~.\label{PDE2}
\end{align*}

I had used packages like amsmath,amsfonts,amssymb… But it's showing the following error:

Undefined control sequence. \end{align*}

Do I need to add other packages?

Best Answer

Well, assuming that you defined some commands somewhere in your document, I took the liberty to define them too to be able to compile your document.

The problems were:

  1. All the user-undefined commands. I created them but you'll have to change to the correct ones later.

  2. The align* environment produces an unnumbered equation, so you cannot put labels in it (unless you have a \tag on that same line, as barbara beeton says).

After some modifications, here is your code, with only the amsmath package and your mysterious user-defined commands.

I also added another version where you can put labels on your equations.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\newcommand{\DIV}{\div}
\newcommand{\BP}{\left<BP\right>}
\newcommand{\Bzero}{\left<Bzero\right>}
\newcommand{\BQ}{\left<BQ\right>}
\newcommand{\p}{\left<p\right>}
\newcommand{\BF}{\left<BF\right>}

\begin{align*}
    \DIV \BP & = \Bzero~,\\
    \rho_0 c \dot{\theta} & = -\DIV \BQ + \theta\p{\theta}\BP:\dot{\BF}~.
\end{align*}

\begin{subequations}
 \begin{align}
    \DIV \BP & = \Bzero~,\label{PDE1}\\
    \rho_0 c \dot{\theta} & = -\DIV \BQ + \theta\p{\theta}\BP:\dot{\BF}~.\label{PDE2}
 \end{align}
\end{subequations}

See Eqs. \ref{PDE1} and \ref{PDE2}

\end{document}