[Tex/LaTex] Numbering Vertical Addition Problems

arraysnumbering

Right now I have the following for a vertical addition problem but I would also like it to be numbered without messing everything else up.

\begin{array}{c@{\,}c}
  & 1 \\
+ & 1 \\
\hline
  & 2 \\
\end{array}

Best Answer

You could also just use an enumerate type of environment. With that I would recommend you use the aligned environment which will allow specification of alignment of the numbers, but array can be used as well:

enter image description here

Note:

  • The addition problem used a macro only to improve readability in this example.

Code:

\documentclass{article}
\usepackage{amsmath}

\newcommand*{\ProblemInArray}{\quad%
    \begin{array}{c@{\,}c}
          & 1 \\
        + & 1 \\
        \hline
          & 2 \\
    \end{array}
}%

\newcommand*{\ProblemInAligned}{\quad%
    \begin{aligned}[t]% Choose alignement: t, b, or c
          & 1 \\
        + & 1 \\
        \hline
          & 2
    \end{aligned}
}%

\begin{document}\noindent
Using \texttt{array} environemnt
\begin{enumerate}
    \item $\ProblemInArray$
    \item $\ProblemInArray$
\end{enumerate}
%
Using \texttt{aligned} environemnt
\begin{enumerate}
    \item $\ProblemInAligned$
    \item $\ProblemInAligned$
\end{enumerate}
\end{document}
Related Question