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






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

Translated with www.DeepL.com/Translator


2 Answers 2


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:


\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} ;}



retenue division à la française

Translated with www.DeepL.com/Translator


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



\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)
    \node[draw=red, shift={(2.6em,9ex)}, circle, thick, text width=6pt] at (pic cs:mydiv)

enter image description here

You must log in to answer this question.

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