1

I have a very long equation of the following format

\begingroup
\allowdisplaybreaks
\begin{align}
a &= very long expression here\\
  + & another long expression here\\
  + & another long expression here
\end{align}
\endgroup

Now this equation is labelled thrice, once for each line. How do i make sure that the equation gets labelled only once?

Troy
  • 13,741

1 Answers1

3

Here is one solution. No need to use \notag on each line that should remain unnumbered if you use this trick; only insert \numberthis at the end of the equation.


enter image description here


\documentclass{article}

\usepackage{amsmath}
\usepackage{lipsum}

\newcommand\numberthis[1][]{%
    \refstepcounter{equation}%
    \ifx#1\empty\else\label{eq:#1}\fi%
    \tag{\theequation}%
}

\begin{document}

\lipsum[1-4]
filler text\\
filler text\\
filler text\\
filler text

{
\Large
\allowdisplaybreaks
\begin{align*}
a = b   &+ c + d + e + f + g + h + i + j\\
        &+ k + l + m + n + o + p + q +r \numberthis\\
        &+ s + t + u + v + w + x + y + z \numberthis[jubobs]
\end{align*}
}

See \ref{eq:jubobs}.
\end{document}
Moriambar
  • 11,466
jub0bs
  • 58,916