# How to write a long equation and number it?

I have the formula block:

 \begin{eqnarray} \tag{A8}
2x+3y+4z+2u+7o+8k+90l+43+56+45p+33h \nonumber \\
&+& 89n+90m+34j+23a+45b+56f = 0
\end{eqnarray}


but I am not getting the required equation with name A8. If anyone can figure it out you're most welcome.

• eqnarray doesn't accept \tag. Only use amsmath environments and never eqnarray. – egreg Aug 19 '19 at 11:09

You get

! Package amsmath Error: \tag not allowed here.

See the amsmath package documentation for explanation.


Only use amsmath environments to split equations across lines or to align them. Never use eqnarray. In this case, multline is the appropriate one.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{multline}
2x+3y+4z+2u+7o+8k+90l+43+56+45p+33h \\
+ 89n+90m+34j+23a+45b+56f = 0
\tag{A8}
\end{multline}

\end{document}


If you use the tag \nonumber, then the equation number doesn't print, please remove that command in your tag and then try, the modified tag is:

\begin{eqnarray}
\tag{A8}
2x+3y+4z+2u+7o+8k+90l+43+56+45p+33h \\
&+& 89n+90m+34j+23a+45b+56f = 0\nonumber
\end{eqnarray}


Also, note that eqnarray is one of the older environment, please try with align environment which comes along with amsmath package....

Corrected tag is:

 \begin{align}
\tag{A8}
&2x+3y+4z+2u+7o+8k+90l+43+56+45p+33h \\

• The multline environment is also an option here. – GuM Aug 19 '19 at 11:16
• @GuM Ha ha ha, egreg is one of a legend in TeX.... – MadyYuvi Aug 19 '19 at 13:29