From 05f8146ef2eea2cd71b9c96583c6d893e6c76af5 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 25 Mar 2024 03:03:04 +0000
Subject: CTAN sync 202403250302

---
 macros/latex/contrib/profcollege/latex/PfCDistributivite.tex | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'macros/latex/contrib/profcollege/latex/PfCDistributivite.tex')

diff --git a/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex b/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex
index 1e8f371cdf..ad0dd8885d 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex
@@ -430,7 +430,9 @@
   \fi
 }
 
-\newcommand\Affichage[4][]{%
+% \newcommand\Affichage[4][]{%
+
+\NewDocumentCommand\Affichage{ommm}{%
   \setKV[ClesDistributivite]{#1}%On lit les arguments optionnels
   \def\LETTRE{\useKV[ClesDistributivite]{Lettre}}%
   \ensuremath{%
@@ -594,10 +596,12 @@
             }{%
               \ifboolKV[ClesDistributivite]{Numerique}{%
                 \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==0}{%
-                  \num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}\multido{\i=2+1}{4}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}%
+                  % \num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}\multido{\i=2+1}{4}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}%
+                  \num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}\xintFor* ##1 in{\xintSeq{2}{4}}\do{=\Distri[Numerique,Etape=##1]{#2}{#3}{#4}{#5}}%
                 }{%
                   \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==-1}{%
-                    \Distri[Numerique,Etape=3]{#2}{#3}{#4}{#5}\multido{\i=2+-1}{2}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}=\num{\fpeval{(#2+#3)*(#4+#5)}}%
+                    % \Distri[Numerique,Etape=3]{#2}{#3}{#4}{#5}\multido{\i=2+-1}{2}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}=\num{\fpeval{(#2+#3)*(#4+#5)}}%
+                    \Distri[Numerique,Etape=3]{#2}{#3}{#4}{#5}\xintFor* ##1 in{\xintSeq{2}{0}}\do{=\Distri[Numerique,Etape=##1]{#2}{#3}{#4}{#5}}=\num{\fpeval{(#2+#3)*(#4+#5)}}%
                   }{%
                     \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==1}{\num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}}{}%
                     \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==2}{\num{\fpeval{#2+#3}}\times(\num{#4}\xintifboolexpr{#5>0}{+}{-}\num{\fpeval{abs(#5)}})}{}%
-- 
cgit v1.2.3

