1. ## Multiline addition with carries

I can't figure out how to display a multiline addition in latex with carried numbers... Could anyone show me how to do this neatly?

2. I figured out how to do the numbers that are carried over by using \overset{}, but how do I get a shorter line between the added number and the result? Now it fills all the page from left to middle....

Here's the code (I just posted it like this since it didn't render with the math tags..):
\begin{align*}
& \overset{1}{\ }\overset{1}{{1}}\overset{1}{0}\overset{1}{{1}}1_{ 2}\\
+ & \ \ \ 111_{2}\\
\hline & 10010\end{align*}

3. Ok I figured I could just do this:

\begin{minipage}[t]{40pt}%
\begin{align*}
& \overset{1}{\ }\overset{1}{{1}}\overset{1}{0}\overset{1}{{1}}1_{ 2}\\
+ & \ \ \ 111_{2}\\
\hline & 10010\end{align*}
%
\end{minipage}

Not the most elegant solution, so if anyone has a better way to do this (there must be, this is simple maths!!:P)...

4. Originally Posted by Jodles
Not the most elegant solution, so if anyone has a better way to do this (there must be, this is simple maths!!:P)...
Simple maths doesn't necessarily mean simple LaTeX! This is also not elegant LaTeX, but it produces a fairly neat result:
Code:
\begin{array}{c@{\:}c@{\:}c@{\:}c@{\:}c@{\,}c}
^{^1}&^{^1}&^{^1}&^{^1}\vspace{-2ex}\\
&1&0&1&1&_2\\
\llap{+}&&1&1&1&_2\\
\hline
1&0&0&1&0\\
\end{array}
$\begin{array}{c@{\:}c@{\:}c@{\:}c@{\:}c@{\,}c}
^{^1}&^{^1}&^{^1}&^{^1}\vspace{-2ex}\\
&1&0&1&1&_2\\
\llap{+}&&1&1&1&_2\\
\hline
1&0&0&1&0\\
\end{array}
$

5. Many thanks, Opalg!

That produces a much more cleaner result!

Sometimes the simplest things seem the most difficult...

6. While we're on it. I modified the above for subtraction:
$\begin{array}{c@{\:}c@{\:}c@{\:}c@{\:}c@{\:}c@{\:} c@{\:}c@{\,}c} ^{^{}}&^{^{}}&^{^{}}&^{^{10}}&^{^{10}}&^{^{10}}&^{ ^{10}}\vspace{-2ex}\\
1&0&1&1&0&0&0&_2\\
\llap{-}0&0&0&1&0&1&1&_2\\
\hline
1&0&0&1&1&0&1_2\\
\end{array}$

But how would I be able to show that the borrowed 10's are striked out? I tried with \sout{}, but that oddly enough adds a line under the number instead of through...

7. I shouldn't be so quick to ask.. In math environment: \usepackage{cancel}, and \cancel{24324}, instead of \sout{}.