How to present a vertical multiplication/addition
the xlop package does this sort of thing. It does warn that it uses "french conventions", but at least for multiplication it looks fine, to me.
disclaimer: i last did multiplication sums in school in the 1950s...
\documentclass{article}
\usepackage{xlop}
\begin{document}
\opmul{384}{56}\qquad
\end{document}
How about a simple tabular environment:
\documentclass{article}
\begin{document}
\begin{tabular}{cccc}
& 1 & 2 & 3 \\
+ & & 3 & 4 \\
\hline
& 1 & 5 & 7 \\
\end{tabular}
\end{document}
If you need to change spacing, you can use the @
specifier which automatically puts arguments in braces as a space between columns (in this case a thin space \,
).
\documentclass{article}
\begin{document}
\begin{tabular}{c@{\,}c@{\,}c@{\,}c}
& 1 & 2 & 3 \\
+ & & 3 & 4 \\
\hline
& 1 & 5 & 7 \\
\end{tabular}
\end{document}
Some other spaces are a thick space \;
and a medium space \:
. It is also possible to avoid the onerous typing of repeating column types by using the *{}{}
:
\begin{tabular}{c*{3}{@{\,}c}}
That produces c
, and then 3 times @{\,}c
, which combines to c@{\,}c@{\,}c@{\,}c
.
I think the simplest (least complicated) solution is to use \phantom
, as follows:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}\begin{array}{c}
\phantom{\times99}384\\
\underline{\times\phantom{999}56}\\
\phantom{\times9}2304\\
\underline{\phantom\times1920\phantom9}\\
\phantom\times21504
\end{array}\end{equation*}
\end{document}
Here, amsmath
is needed for the equation*
environment only; if you used equation
you'd need no \usepackage
at all. array
allows multiple-line equations; \\
starts a new line. And \phantom{foo}
prints a space the width of the characters foo
. I've usually found 9
to be a good stand-in for any digit, but (e.g. if you have a few 1
s) you may need to fiddle with it a bit.