1

When I write some long equation for notes, I write e.g.

    \begin{align}
    a & =  a \cdot 1 \nonumber % this not numbered  \\
      & = a \cdot (1+0)  \nonumber % this not numbered \\  
      & = a \cdot 1+a\cdot 0  % say, I do want this numbered \\   
      & = a +a\cdot 0 \nonumber  % this not numbered 
    \end{align}

Is there kind of a dual align command (say alignsinglenumbered) that is closer to align* than to align, in the sense that

    \begin{alignsinglenumbered} 
    a & =  a \cdot 1  % this not numbered  \\
      & = a \cdot (1+0)   % this not numbered \\  
      & = a \cdot 1+a\cdot 0 \numbered  % say, I do want this numbered \\   
      & = a +a\cdot 0     % this not numbered  
        \end{alignsinglenumbered}

produces the same output as the one given above with align? Since these equations turn out to be long, one wishes allowdisplaybreaks to work, which doesn't if one writes

\begin{align}
\begin{split}
        a & =  a \cdot 1   \\
          & = a \cdot (1+0)   \\
          & = a \cdot 1+a\cdot 0  \\   
          & = a +a\cdot 0   
\end{split}
\end{align} 
c.p.
  • 4,636

1 Answers1

1

For numbering of a collection of equations, you can use a combination of

\begin{equation}
  \begin{aligned}
    % <your equations here)
  \end{aligned}
\end{equation}

Alternatively, if you're interested in a single equation inside an align-like environment numbered as a complement to a string of \nonumbers, you can use the following definition:

enter image description here

\documentclass{article}

\usepackage{amsmath}

\newcommand{\numbered}{\refstepcounter{equation}\tag{\theequation}}

\newenvironment{alignsinglenumbered}
  {\csname align*\endcsname}
  {\csname endalign*\endcsname}

\begin{document}

\begin{align}
a & = a \cdot 1             \nonumber \\ % this is not numbered 
  & = a \cdot (1 + 0)       \nonumber \\ % this is not numbered
  & = a \cdot 1 + a \cdot 0           \\ % say, I do want this numbered
  & = a \cdot 1 + 0         \nonumber \\ % this is not numbered
  & = a \cdot 1             \nonumber \\ % this is not numbered
  & = a                     \nonumber
\end{align}

\noindent\hrulefill

\begin{alignsinglenumbered}
  a & = a \cdot 1                       \\
    & = a \cdot (1 + 0)                 \\
    & = a \cdot 1 + a \cdot 0 \numbered \\ % say, I do want this numbered  
    & = a \cdot 1 + 0                   \\
    & = a \cdot 1                       \\
    & = a      
\end{alignsinglenumbered}

\end{document}
Werner
  • 603,163
  • Actually your solution does allow for a long equation splitting in pages. The question this is a dupe from has a solution by \begin{align} \begin{split} a &= b \\ &=c \\ &=d \\ &=e \end{split} \end{align} for which one cannot use allowdisplaybreaks – c.p. Dec 17 '19 at 08:39