# Error when using \align from amsmath

I am trying to add a block equation to my paper with an equation number 12. When I try the following in https://www.codecogs.com/latex/eqneditor.php, I get an invalid equation error.

I am new to LaTeX, so this may be entirely bad form.

\begin{align}
L(\theta; y) = \prod\limit_{j=1}^n (\theta_j e^{-\theta_j y_j})^{\delta_j}(e^{-\theta_j y_j})^{1 - \delta_j}
\label{12}
\end{align}


The actual equation portion appears to be fine, but I get an error when using \align and label to number.

• It would be much easier to debug if you made the example a complete small document that generated the error. also why are you using align here there is only one line and no alignment points (&) ? – David Carlisle Nov 27 '15 at 17:34
• put it into the editor without the \begin{align} and \end{align} – user2478 Nov 27 '15 at 17:39
• That site assumes you're already in mathmode, so the \begin{align} and \end{align} are unnecessary. Another thing: you can use semantic labels, e.g. \label{likelihood}, and refer to them with \ref{likelihood}; LaTeX will assign numbers automatically, and so you don't have to manually renumber everything if you add, remove, or rearrange text. – Arun Debray Nov 27 '15 at 17:50

! Undefined control sequence.

as the command is \limits with an s although it would be more normal to use the default setting here so just delete \limit.
Note you should not use align unless it is a multiple line equation on which you want to align some operators. A one line equation should use equation.