From 0ef3dfaccca426fb0f3b06fc106ef9b5b0423dad Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 23 Aug 2021 03:00:54 +0000
Subject: CTAN sync 202108230300

---
 .../contrib/profcollege/latex/PfCEquationPose1.tex | 49 +++++++++++-----------
 1 file changed, 24 insertions(+), 25 deletions(-)

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

diff --git a/macros/latex/contrib/profcollege/latex/PfCEquationPose1.tex b/macros/latex/contrib/profcollege/latex/PfCEquationPose1.tex
index 8bc7bb339f..735c09839d 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEquationPose1.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEquationPose1.tex
@@ -1,12 +1,12 @@
 % Licence    : Released under the LaTeX Project Public License v1.3c
 % or later, see http://www.latex-project.org/lppl.txtf
-\newcommand{\EquaBaseL}[5][]{%type ax=d ou b=cx
+\newcommand\EquaBaseL[5][]{%type ax=d ou b=cx
   \useKVdefault[ClesEquation]%
   \setKV[ClesEquation]{#1}%
   \ifx\bla#2\bla%on teste si le paramètre #2 est vide:
   % si oui, on est dans le cas b=cx. Eh bien on échange :)
   % Mais attention si les deux paramètres a et c sont vides...
-  \EquaBaseL[#1]{#4}{}{}{#3}
+  \EquaBaseL[#1]{#4}{0}{0}{#3}
   \else
   % si non, on est dans le cas ax=d
   \xintifboolexpr{#2==0}{%
@@ -30,14 +30,15 @@
         }{}
         }{}
       \end{align*}
-      \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2==1}{\useKV[ClesEquation]{Lettre}=\num{#5}}{\num{#2}\useKV[ClesEquation]{Lettre}=\num{#5}}$ a une unique solution : $\displaystyle\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\opdiv*{#5}{#2}{numequa}{resteequa}\opcmp{resteequa}{0}\ifopeq\opexport{numequa}{\numequa}\num{\numequa}\else\ifboolKV[ClesEquation]{Simplification}{\SSimplifie{#5}{#2}}{\frac{\num{#5}}{\num{#2}}}\fi$.%
-      }{}
+      \xdef\Coeffa{#2}%
+      \xdef\Coeffb{#5}%
+      \ifboolKV[ClesEquation]{Solution}{\EcrireSolutionEquation{#2}{#3}{#4}{#5}}{}%
     }
   }
   \fi
 }
 
-\newcommand{\EquaDeuxL}[5][]{%type ax+b=d ou b=cx+d$
+\newcommand\EquaDeuxL[5][]{%type ax+b=d ou b=cx+d$
   \useKVdefault[ClesEquation]%
   \setKV[ClesEquation]{#1}%
   \ifx\bla#2\bla%On échange en faisant attention à ne pas boucler : c doit être non vide
@@ -51,7 +52,7 @@
       }%
     }{%ELSE
       \xintifboolexpr{#3==0}{%ax+b=d
-        \EquaBaseL[#1]{#2}{}{}{#5}%
+        \EquaBaseL[#1]{#2}{0}{0}{#5}%
       }{%ax+b=d$ Ici
         \begin{align*}
           \xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\num{#5}\\
@@ -76,28 +77,27 @@
           }{}
           }{}
         \end{align*}
-        \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\num{#5}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.
-        }{}
+        \ifboolKV[ClesEquation]{Solution}{\EcrireSolutionEquation{#2}{#3}{#4}{#5}}{}%
       }
     }
   \fi
 }
 
-\newcommand{\EquaTroisL}[5][]{%ax+b=cx ou ax=cx+d
+\newcommand\EquaTroisL[5][]{%ax+b=cx ou ax=cx+d
   \useKVdefault[ClesEquation]%
   \setKV[ClesEquation]{#1}%
   \ifx\bla#3\bla%on inverse en faisant attention à la boucle #3<->#5
     \ifx\bla#5\bla%
       %% paramètre oublié
     \else
-      \EquaTroisL[#1]{#4}{#5}{#2}{}%
+      \EquaTroisL[#1]{#4}{#5}{#2}{0}%
     \fi
   \else
   \xintifboolexpr{#2==0}{%b=cx
-    \EquaBaseL[#1]{#4}{}{}{#3}
+    \EquaBaseL[#1]{#4}{0}{0}{#3}
   }{%
     \xintifboolexpr{#4==0}{%ax+b=0
-      \EquaDeuxL[#1]{#2}{#3}{}{0}
+      \EquaDeuxL[#1]{#2}{#3}{0}{0}
       }{%ax+b=cx
         \xintifboolexpr{#2==#4}{%
           \xintifboolexpr{#3==0}{%ax=ax
@@ -132,7 +132,7 @@
               }{}
               }{}
             \end{align*}
-            \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4==1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}
+            %\ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4==1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}
             }{%ax+b=cx+d avec a<c              % Autre cas délicat
               \begin{align*}%
                 \xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\xintifboolexpr{#4==1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\\
@@ -157,16 +157,16 @@
               }{}
               }{}
               \end{align*}
-              \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4==1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}%
+              %\ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4==1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}%
             }%
+            \ifboolKV[ClesEquation]{Solution}{\EcrireSolutionEquation{#2}{#3}{#4}{#5}}{}%
           }%
         }%
       }%
     \fi
   }%\\
-  % \\
 
-\newcommand{\ResolEquationL}[5][]{%
+\newcommand\ResolEquationL[5][]{%
   \useKVdefault[ClesEquation]%
   \setKV[ClesEquation]{#1}%
   \xintifboolexpr{#2==0}{%
@@ -178,23 +178,23 @@
       }%
     }%
     {%0x+b=cx+d$
-      \EquaDeuxL[#1]{#4}{#5}{}{#3}%
+      \EquaDeuxL[#1]{#4}{#5}{0}{#3}%
     }%
   }{%
     \xintifboolexpr{#4==0}{%ax+b=0x+d
-      \EquaDeuxL[#1]{#2}{#3}{}{#5}%
+      \EquaDeuxL[#1]{#2}{#3}{0}{#5}%
     }
     {%ax+b=cx+d$
       \xintifboolexpr{#3==0}{%
         \xintifboolexpr{#5==0}{%ax=cx
-          \EquaTroisL[#1]{#2}{0}{#4}{}%
+          \EquaTroisL[#1]{#2}{0}{#4}{0}%
         }%
         {%ax=cx+d
-          \EquaTroisL[#1]{#4}{#5}{#2}{}%
+          \EquaTroisL[#1]{#4}{#5}{#2}{0}%
         }%
       }%
       {\xintifboolexpr{#5==0}{%ax+b=cx
-          \EquaTroisL[#1]{#2}{#3}{#4}{}%
+          \EquaTroisL[#1]{#2}{#3}{#4}{0}%
         }%
         {%ax+b=cx+d -- ici
           \xintifboolexpr{#2==#4}{%
@@ -230,8 +230,7 @@
                 }{}
                 }{}
               \end{align*}
-              \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4==1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.%
-              }{}
+              %\ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4==1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}
             }{%ax+b=cx+d avec a<c              % Autre cas délicat
               \begin{align*}%
                 \xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\xintifboolexpr{#4==1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}\\
@@ -255,9 +254,9 @@
                 }{}
                 }{}
               \end{align*}
-              \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4==1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.%
-              }{}%
+              %\ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4==1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}%
             }%
+            \ifboolKV[ClesEquation]{Solution}{\EcrireSolutionEquation{#2}{#3}{#4}{#5}}{}%
           }%
         }%
       }%
-- 
cgit v1.2.3

