3

In other topic @egreg helped me a lot but there can be thousand of bugs in horizontal long multiplication. I am a bit frustrated and can't make array like that: array

The red drawings are commas. I'm trying to use tabular it's not elegant at all.

1
  • 1
    Could you please add a code and a link to "the other topic"?
    – user156344
    Commented Apr 14, 2019 at 19:24

1 Answer 1

4

Is this what you seek? It uses tabstackengine.

\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage[TABcline]{tabstackengine}
\TABstackMath
\begin{document}
\tabbedShortunderstack[r]{
&&&&&&&\mathllap{30{,}24\cdot5{,}12}\\
\TABcline{1-8}
&&&&6&0&4&8\\
+\,&&&3&0&2&4&\\
&1&5&1&2&0&&\\
\TABcline{1-8}
&1&5&4&{,}8&3&&&
}
\end{document}

enter image description here


SUPPLEMENT

For cases where there are an even number of lines between the rules, one needs to raise the + half way, here with \+ in lieu of +:

\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage[TABcline]{tabstackengine}
\newcommand\+{\smash{\raisebox{.5\baselineskip}{$+$}}}
\TABstackMath
\begin{document}
\tabbedShortunderstack[r]{
&&&&&&\mathllap{9{,}37\cdot1{,}90}\\
\TABcline{1-7}
&&&8&4&3&3\\
\+\,&&9&3&7&&\\
\TABcline{1-7}
&1&7&{,}8&0&&
}
\end{document}

enter image description here

3
  • +1, but result should be 154,2 :-)
    – Zarko
    Commented Apr 14, 2019 at 20:12
  • Good but when I have only 2 numbers for addition like most of the time the + should be centered between them like this: imgur.com/a/yPurnum Commented Apr 15, 2019 at 11:52
  • 1
    @SimeonSimeonov Please see the supplement to my answer. Commented Apr 15, 2019 at 12:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .