2

How can I draw the following scheme?

enter image description here

5

2 Answers 2

3

Something like this?

enter image description here

\documentclass{article}
\usepackage{array,booktabs}
\newcommand\ml[1]{\multicolumn{1}{l}{#1}}
\newcommand\lparen{\mkern1mu(\mkern1mu}
\newcommand\rparen{\mkern1mu)\mkern1mu}
\newcommand\pp{\phantom{\lparen}}

\begin{document}
\[
\setlength\arraycolsep{0pt}
\begin{array}{ *{11}{r} }
   198 & \rparen & 360 & \lparen & \ml{1} \\
   &&        198 & \pp \\
\cmidrule{3-4}
   && 162 & \rparen & 198 & \lparen & \ml{1} \\
   &&&& 162 & \pp \\
\cmidrule{5-6}
   &&&& 36 & \rparen & 162 & \lparen & \ml{4} \\
   &&&&&& 144 & \pp \\
\cmidrule{7-8}
   &&&&&& 18 & \rparen & 36 & \lparen & \ml{2} \\
   &&&&&&&& 36 & \pp\\
\cmidrule{9-10}
   &&&&&&&& \multicolumn{2}{c}{\times}
\end{array}
\]
\end{document}
1
1

This is typical example for doing macros recursive:

\def\divi #1)#2/#3=#4{#1)%
   \vtop{\hbox{#2}\hbox{#3}\smallskip\hrule width1.5em\smallskip\hbox{#4}}}
\def\0{\phantom0}

\divi 198)360(1/190={%
          \divi 162)198(1/162={%
                    \divi \036)162(4/144={%
                               \divi \018)36(2/36={%
                                          $\0\times$}}}}

\bye

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.