5

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}
David Carlisle
  • 757,742

2 Answers2

5

You can try,

\[
\begin{array}{@{}cr}
    & 1 \\
+  & 10 \\
\cline{2-2}
  & 11 
\end{array}
\]

You may want also to adjust the space between the columns by using

\setlength\arraycolsep{0.1em}

enter image description here

Edit: added numbering

There are many ways to number the equations, but for this type of problem, I would either use the multienum package or incorporate the numbering in the array manually, or create a counter to auto increment. Here is a rather longer example. Of course it will look better if the + sign was on the right like we do in my part of the world.

enter image description here

\documentclass[fleqn]{article}
\usepackage{amsmath,multienum,booktabs}
\renewcommand{\regularlisti}{\setcounter{multienumi}{0}%
  \renewcommand{\labelenumi}%
  {\addtocounter{multienumi}{1}\alph{multienumi})}}
\begin{document}

\[
\begin{array}{lrr}
\text{(i)}&   & 1  \\
&+  & 10 \\
\cmidrule(lr){3-3}
&  & 11  \\
\end{array}
\]

\[
\begin{array}{lrr}
\text{(ii)}&   & 1  \\
&+  & 10 \\
\cmidrule(lr){3-3}
&  & 11  \\
\end{array}
\]


\[
\begin{array}{crr@{}c@{}r@{}c@{}l}
\text{(iii)}   &237   &100a        &{}+{}&10b    &{}+{}&c\\
\addlinespace
\text{(iv)}  &732   &100c        &{}+{}&10b    &{}+{}&a\\
\cmidrule(lr){2-2}\cmidrule(lr){3-7}
\text{(v)} &495   &\multicolumn{1}{l@{}}{100(a-c-1)} &+&90     &+&(10+c-a)\\
\addlinespace
\text{(vi)}  &594   &\multicolumn{1}{l@{}}{100(10+c-a)} &+&90     &+&(a-c-1)\\
\cmidrule(lr){2-2}\cmidrule(lr){3-7}
\text{(vii)}   &1089  &\multicolumn{1}{c}{900}        &+&180    &+&9\\
\cmidrule(lr){2-2}\cmidrule(lr){3-7}
\specialrule{0pt}{-1pt}{-1pt} 
\cmidrule(lr){2-2}\cmidrule(lr){3-7}
\end{array}
\]
\end{document}
\end{document}
David Carlisle
  • 757,742
yannisl
  • 117,160
2

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}

Peter Grill
  • 223,288