How to set up European/French style long division in TeX?

1,526

you have to use Xlop package (http://ctan.mines-albi.fr/macros/generic/xlop/doc/xlop-doc-fr.pdf)

\documentclass[A4paper,french]{article}
\usepackage[french]{babel}
\usepackage{xlop}

\begin{document}

\opdiv[decimalsepsymbol={,},displayintermediary=all,voperation=top]
{198}{12}

\end{document}

enter image description here

Share:
1,526

Related videos on Youtube

ASertacAkkaya
Author by

ASertacAkkaya

Updated on May 21, 2020

Comments

  • ASertacAkkaya
    ASertacAkkaya over 3 years

    How exactly can one achieve French Style Long Division?

    French Style Long Division

    Is line drawing/table/array formatting my only way here? I'm really new into TeX/LaTeX trying to find my way around it for elementary math, but some things leave me puzzled.

    I found out there's a package called polynom to use polynomial division, but which only achieves American style long division. An array solution got closer, and xlop solution was the closest, yet issue with xlop is that you can't use subtitutional/polynomial values like AB/C (or so it seems?). MathML seems to achieve all these elementary math stuff except, well, MathML isn't as much supported yet. So until then, maybe TeX is not my solution at all, even, if so, what would I use?

    Update:

    Trying to define my own command in arrays I've come as close as this, though since I don't know how positioning works yet in arrays:

    \documentclass{article}
    \newcommand\frdiv[5]{%
        \[
        \renewcommand\arraystretch{1.5}
        \begin{array}{l| l}
        #1 & #2 \\
        \cline{2-2}
        #3 & #4 \\
        \cline{1-1}
        #5 & \\
        \end{array}
        \]
    }
    
    
    \begin{document}
    
        \frdiv{ABC}{AB}{XY}{D}{R}
    
    \end{document}
    

    enter image description here

    • Keks Dose
      Keks Dose over 5 years
      And this here does not help you: tex.stackexchange.com/questions/149975/…
    • ASertacAkkaya
      ASertacAkkaya over 5 years
      xlop only helps as much as "numbers" are used, and inline division isn't what I'm looking for, so no.
  • pzorba75
    pzorba75 over 5 years
    Xlop doesn't print the decimal separator according to french rule, for instance it prints 16.5 instead of 16,5. How to fix that?
  • rpapa
    rpapa over 5 years
    Call with the option decimalsepsymbol={,} see above the solution
  • ASertacAkkaya
    ASertacAkkaya over 5 years
    Trying to achieve showing polynomials and/or placeholder letters as well.