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
    Could you please add a code and a link to "the other topic"? – user156344 Apr 14 at 19:24
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

  • +1, but result should be 154,2 :-) – Zarko Apr 14 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 – Simeon Simeonov Apr 15 at 11:52
  • 1
    @SimeonSimeonov Please see the supplement to my answer. – Steven B. Segletes Apr 15 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.