I have posted this and this later item on long division.
I thought what appears below worked perfectly. But only today I tried it with an example that has several digits before the decimal point in the quotient, and it's lousy.
So I have two questions:
How do we make it work well with several digits before the decimal point in the quotient? This I could possibly figure out with further skull sweat, but I am reluctant to undertake that without a good answer to the next question, which goes beyond my present competence.
How do we make it into a user-friendly style file, so the user only needs to enter the numbers with some indication of what the role of each of them is in the long-division process?
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
% \usepackage{xcolor}
\usepackage{array, booktabs}
\parindent=0pt
\pagestyle{empty}
\begin{document}
\[
\begin{array}{ rr@{} %>{\color{red}}
c@{}*{6}{c@{\mkern2mu}} }
& 0 & . & 7 & 1 & 6 & 2 \\ \cmidrule[0.6pt](l{-0.385em}){2-8}\\[-16.9pt]
74\;\rlap{\Large)} &53 & . & 0 & 0 & 0 & 0 & 0 \\
& 51 & & 8 \\ \cmidrule(l{1ex}){2-5}
& 1 & & 2 & 0 \\
& & & 7 & 4 \\ \cmidrule{3-6}
& & & 4 & 6 & 0 \\
& & & 4 & 4 & 4 \\ \cmidrule{4-7}
& & & & 1 & 6 & 0 \\
& & & & 1 & 4 & 8 \\ \cmidrule{5-8}
& & & & & 1 & 2 & 0
\end{array}
\]
\[
\begin{array}{ rr@{} %>{\color{red}}
c@{}*{8}{c@{\mkern2mu}} }
& 101 & . & 8 & 0 & 2 & 0 & 8 & 3 \\ \cmidrule[0.6pt](l{-0.385em}){2-8}\\ [-16.9pt]
96\;\rlap{\Large)} &9773 & . & 0 & 0 & 0 & 0 & 0 \\
& 96\phantom{00} & & \\ \cmidrule(l{1ex}){2-2}
& 17\phantom{0} & & \\
& 0\phantom{0} \\ \cmidrule(l{1ex}){2-2}
& 173 \\
& 96 \\ \cmidrule(l{1ex}){2-3}
& 77 & & 0 \\
& 76& & 8 \\ \cmidrule(l{1ex}){2-4}
& & & 2 & 0 \\
& & & & 0 \\ \cmidrule{3-5}
& & & 2 & 0 & 0 \\
& & & 1 & 9 & 2 \\ \cmidrule{3-6}
& & & & & 8 & 0 \\
& & & & & & 0 \\ \cmidrule{6-7}
& & & & & 8 & 0 & 0 \\
& & & & & 7 & 6 & 8 \\ \cmidrule{6-8}
& & & & & & 3 & 2 & 0 \\
& & & & & & 2 & 8 & 8 \\ \cmidrule{7-9}
& & & & & & & 3 & 2 & 0
\end{array}
\]
\end{document}
longdiv
package?longdiv
only does integersxlop
, but it's not internationalised yet, and for now is only adapted to the French way to make long divisions.