6

The French divisional algorithm was taught in the 1960s in primary schools. It is an algorithm that allows you to quickly perform all divisions. In this algorithm, carried numbers are placed in front of the numbers so that subtractions do not have to be made. The French algorithm is explained here (in french):

division à la française

For example, in the division of 11945 by 47, the first step is to multiply 2×7 = 14, this result must be removed at 9. It's impossible; you have to put 1 in front of 9 and remove the 14 to 19. That's five. Carried number 1 must be added to the result of the next multiplication.

retenue division

A MWE:

\documentclass{article}
\usepackage{xlop}

\begin{document} 

\opidiv{11945}{47}

\end{document}

How to place this carried number in front of the numbers with xlop?

Translated with www.DeepL.com/Translator

0

2 Answers 2

5

Here is a solution with TiKz that uses the stylization of digits allowed by xlop with operandstyle, remainderstyle parameters. To do this, I have adapted my given solution to the following question: Drawing a circle around the numbers in xlop package

With xlop, when the style of a digit is applied by a macro, the last argument (the digit to be stylized) is provided by xlop itself to this macro.

Thus, the macro is declared with 2 arguments, but only the first one is provided to its call, xlop itself providing the last one.

I created two macros:

  1. The first macro called \chiffre creates a node with TiKz, it has two arguments: first is its name, the second the digit to stylize itself;

  2. The second macro called \retenue places the carried number at the bottom left of the digit (as I learned to do myself), its first argument is the name of the digit, its second argument is the carried number.

The code is as follows:

\documentclass{article}
\usepackage{xlop}
\usepackage{tikz}

\newcommand{\chiffre}[2]{\tikz[remember picture] \node[inner sep=0pt](#1){#2};}
\newcommand{\retenue}[2]{\tikz[remember picture,overlay] 
                          \node[inner sep=0pt,
                                outer sep=2pt,
                                anchor=north east,
                                font=\tiny]at(#1){#2} ;}

\begin{document} 
\opidiv[dividendbridge,
        operandstyle.1.3=\chiffre{a},
        remainderstyle.1.1=\chiffre{b},
        remainderstyle.2.1=\chiffre{c}]{11945}{47}
\retenue{a}{1}
\retenue{b}{4}
\retenue{c}{3}
\end{document}

Output:

retenue division à la française

Translated with www.DeepL.com/Translator

3

I didn't find a solution with xlop, but, since nobody answered yet, this is a manual workaround with tikzmark:

\documentclass{article}
\usepackage{xlop}
\usepackage{tikz}
\usetikzlibrary{tikzmark}

\begin{document} 

\tikzmark{mydiv}\opidiv[dividendbridge, columnwidth=1.1em]{11945}{47}
\begin{tikzpicture}[overlay,remember picture]
    \node[font=\tiny, shift={(2.3em,8.75ex)}] at (pic cs:mydiv)
    {1};
    \node[draw=red, shift={(2.6em,9ex)}, circle, thick, text width=6pt] at (pic cs:mydiv)
    {};
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .