I am writing a program that generates the steps performed during math operations ( + - * / ) and explain it has well.
I have read this and the best answer here is using the xlop package , which displays, e.g. multiplication as (in plain text):
3 8 4
x 5 6
---------
2 3 0 4
1 9 2 0
---------
2 1 5 0 4
And the latex :
\documentclass{article}
\usepackage{xlop}
\begin{document}
\opmul{384}{56}\qquad
\end{document}
But is there a way to create the latex like
3 8 4
x 5 6
---------
2 3 0 4
Here is one way using Plain-commands:
\vbox{
\openup2pt
\def\trule{\noalign{\smallskip\hrule\smallskip}}
\halign{&\tabskip1em$\mathstrut#$\cr
& & 3 & 8 & 4 \cr
\times& & & 5 & 6 \cr
\trule
& 2 & 3 & 0 & 4 \cr
\trule
}
}
\bye
Where it is not completely finished but shows a 'step' in the process. So what I mean is that , is it possible using the xlop package to specify to which degree and what it completed or what I want to omit from the output ? Or do I need to use a totally different technique

xloppackage can't do this out of the box. You might want to contact the author to see if they would be interested in adding this as an option though. In case anyone here wants to mess with the code, you might want to add a sample document to your question. – Alan Munn Sep 06 '23 at 13:53xlopsolution you want/need, in case somebody wonders about using a different approach. (I know nothing aboutxlopso I don't know what might be special about it.) – cfr Sep 07 '23 at 00:43xloppackage is as it renders the school-grade operations accurately and with little 'code' , however if theres a better way I am all ears – Aarav Shah Sep 07 '23 at 15:34