3

I want to display a long division procedure as illustrated. enter image description here

I did search but couldn't find what I'm looking for. Any help is much appreciated.

Eureka
  • 1,013
  • 3
    https://tex.stackexchange.com/questions/375983/long-division-help, https://tex.stackexchange.com/questions/374754/noob-latexit-long-division, https://tex.stackexchange.com/questions/131125/better-way-to-display-long-division/131131#131131, https://tex.stackexchange.com/questions/395703/more-on-formatting-of-long-division, etc. – Steven B. Segletes Feb 25 '19 at 00:14

1 Answers1

9

With the package longdivision, you obtain almost the desired output (but as a French, I don't known this strange notation, see the documentation of the package xlop about division for the French notation).

\documentclass{article}
\usepackage{longdivision}
\begin{document}
    \intlongdivision{12345}{13}
\end{document}

enter image description here

quark67
  • 4,166
  • 1
    (+1) Please edit it a bit so that the output fits the OP's picture fully (i.e. it should be 11700 instead of 117 in the third line). –  Feb 25 '19 at 06:09
  • @JouleV It’s why I say "you obtain almost the desired output" and "I don’t known this strange notation" (In France, we use other notation). I don’t known is my answer is perfect. If not, is this a bug of the longdivision package? – quark67 Feb 25 '19 at 11:54
  • @quark67, thank you. I wonder why this is not working if I want to do the long division of -37/44. My aim is to display that and write the continued fraction expansion. – Eureka Feb 25 '19 at 14:30
  • @Fib1123 The package longdivision doesn't handle negative numbers. You can use the command longdivision{37}{44} instead intlongdivision{37}{44}, this give a continued fraction expansion, but I don't known if the displayed output is what you want (decimal numbers in the continued fraction expansion, in French notation, there are not decimal numbers in the continued fraction expansion). – quark67 Feb 25 '19 at 15:05