texlive[67162] Master/texmf-dist: profcollege (19may23)

commits+karl at tug.org commits+karl at tug.org
Fri May 19 22:25:04 CEST 2023


Revision: 67162
          http://tug.org/svn/texlive?view=revision&revision=67162
Author:   karl
Date:     2023-05-19 22:25:04 +0200 (Fri, 19 May 2023)
Log Message:
-----------
profcollege (19may23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
    trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCDefiTables.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCModeleBarre.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresentationGraphique.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCPatronPaves.tex

Modified: trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex	2023-05-19 20:24:37 UTC (rev 67161)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex	2023-05-19 20:25:04 UTC (rev 67162)
@@ -4,11 +4,11 @@
 \setKVdefault[Cards]{Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,Landscape=false,Couleur=Cornsilk,Theme=Th\'eor\`eme\\de
   Pythagore,ThemeSol=Solution,AfficheTheme=false,Trame=false,Jointes=false,TrameVisible=false,RayonArc=5pt,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,Eleve=false,BackgroundAv=false,BackgroundAr=false,ImageAv=4813762.jpg,ImageAr=4813762.jpg,AffichageSolution=true,SolutionSeule=false,%
   % Pour la boite
-  NbCartes=16,TypeJeu=Loop,Niveau=1,Numero=1,ThemeJeu=Nombres relatifs,Commerce=false,
+  NbCartes=16,TypeJeu=Boucle,Niveau=1,Numero=1,ThemeJeu=Nombres relatifs,CouleurTheme=black,CouleurNiveau=black,CouleurType=black,CouleurNb=black,
   % Pour le trivial
   Trivial=false,Symboles={\faInfinity,\faSignal,\faProjectDiagram,\faHiking,\faRuler,\faLockOpen}
 }%
-\defKV[Cards]{ThemeJaiQuiA=\setKV[Cards]{AfficheTheme}}
+\defKV[Cards]{ThemeJaiQuiA=\setKV[Cards]{AfficheTheme}}%
 %
 \newtcolorbox{Mybox}[3]{%
   enhanced,%
@@ -20,7 +20,7 @@
   arc=\PfCRayonArc,%
   overlay unbroken and first={%
     \coordinate[yshift=-0.5\hauteurtitre] (A1) at (frame.north west);%
-    \coordinate[yshift=-0.5\hauteurtitre] (B1) at (frame.north east);%   
+    \coordinate[yshift=-0.5\hauteurtitre] (B1) at (frame.north east);%
     \coordinate[yshift=-\hauteurtitre] (A) at (frame.north west);%
     \coordinate[yshift=-\hauteurtitre] (B) at (frame.north east);%
     \coordinate[xshift=1.5pt,yshift=8mm] (S1) at (frame.south west);%
@@ -47,9 +47,9 @@
   colbacktitle=TrameCouleur,%
 }%
 
-\newcommand\PfCTexteJai{J'ai}
-\newcommand\PfCTexteJesuis{Je suis\dots}
-\newcommand\PfCTexteQuia{Qui a ?}
+\newcommand\PfCTexteJai{J'ai}%
+\newcommand\PfCTexteJesuis{Je suis\dots}%
+\newcommand\PfCTexteQuia{Qui a ?}%
 
 \makeatletter
 \newtcolorbox{MyboxJQ}[2]{%
@@ -59,7 +59,7 @@
   text fill,%
   width=\largeurcarte,%
   height=\hauteurcarte,%
-  arc=\PfCRayonArc,%\useKV[Cards]{RayonArc},%
+  arc=\PfCRayonArc,%
   underlay={%
     \ifboolKV[Cards]{BackgroundAv}{%
       \begin{tcbclipinterior}
@@ -143,9 +143,9 @@
   },%
   colback=white
 }%
-\makeatother
+%\makeatother
 
-\makeatletter
+%\makeatletter
 %https://tex.stackexchange.com/questions/347434/clip-background-image-inside-tcolorbox
 \newtcolorbox{MyboxSimpleAv}[1]{%
   enhanced,%
@@ -239,8 +239,8 @@
 \newlength{\PfCCardsEcartH}%Pour décaler sur une page paire
 \newlength{\PfCCardsV}%pour retenir en cas de décalage sur une page paire
 \newlength{\PfCCardsEcartV}%Pour décaler sur une page paire
-\setlength{\PfCCardsEcartH}{0pt}
-\setlength{\PfCCardsEcartV}{0pt}
+\setlength{\PfCCardsEcartH}{0pt}%
+\setlength{\PfCCardsEcartV}{0pt}%
 
 \NewDocumentEnvironment{Trame}{+b}{%
   \ifodd\thepage%
@@ -280,7 +280,7 @@
     \draw (C1)--(D1);%
     \draw (C2)--(D2);%
     \draw (C3)--(D3);%
-    }{}
+    }{}%
     % point pour placer les cartes
     \coordinate[xshift=\margeh+0.5\PfCCardsH,yshift=-0.5\PfCCardsV] (Carte1) at (A);%
     \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);%
@@ -295,51 +295,7 @@
   \end{tikzpicture}%
 }{}%
 
-\NewDocumentEnvironment{Trameold}{+b}{%
-  \begin{tikzpicture}[remember picture,overlay]
-    % quadrillages horizontal et vertical
-    \coordinate[yshift=-\margev] (A) at (current page.north west);%
-    \coordinate[yshift=-\margev] (B) at (current page.north east);%
-    \coordinate[yshift=-\hauteurcards] (A1) at (A);%
-    \coordinate[yshift=-\hauteurcards] (B1) at (B);%
-    \coordinate[yshift=-\hauteurcards] (A2) at (A1);%
-    \coordinate[yshift=-\hauteurcards] (B2) at (B1);%
-    \coordinate[yshift=-\hauteurcards] (A3) at (A2);%
-    \coordinate[yshift=-\hauteurcards] (B3) at (B2);%
-    \coordinate[yshift=-\hauteurcards] (A4) at (A3);%
-    \coordinate[yshift=-\hauteurcards] (B4) at (B3);%
-    \coordinate[xshift=\margeh] (C) at (current page.north west);%
-    \coordinate[xshift=\margeh] (D) at (current page.south west);%
-    \coordinate[xshift=\largeurcards] (C1) at (C);%
-    \coordinate[xshift=\largeurcards] (D1) at (D);%
-    \coordinate[xshift=\largeurcards] (C2) at (C1);%
-    \coordinate[xshift=\largeurcards] (D2) at (D1);%
-    \coordinate[xshift=\largeurcards] (C3) at (C2);%
-    \coordinate[xshift=\largeurcards] (D3) at (D2);%
-    \draw (A)--(B);%
-    \draw (A1)--(B1);%
-    \draw (A2)--(B2);%
-    \draw (A3)--(B3);%
-    \draw (A4)--(B4);%
-    \draw (C)--(D);%
-    \draw (C1)--(D1);%
-    \draw (C2)--(D2);%
-    \draw (C3)--(D3);%
-    % point pour placer les cartes
-    \coordinate[xshift=\margeh+0.5\largeurcards,yshift=-0.5\hauteurcards] (Carte1) at (A);%
-    \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);%
-    \coordinate[xshift=2\largeurcards,yshift=0mm] (Carte3) at (Carte1);%
-    \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte4) at (Carte1);%
-    \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte5) at (Carte2);%
-    \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte6) at (Carte3);%
-    \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte7) at (Carte4);%
-    \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte8) at (Carte5);%
-    \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte9) at (Carte6);%
-    #1%
-  \end{tikzpicture}%
-}{}%
-
-\NewDocumentCommand\Cartes{o +m}{%[2][]{%
+\NewDocumentCommand\Cartes{o +m}{%
   \useKVdefault[Cards]%
   \setKV[Cards]{#1}%
   \setsepchar[*]{§*/}%
@@ -366,20 +322,198 @@
   \colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}%
   \setlength{\PfCRayonArc}{\useKV[Cards]{RayonArc}}%
   \ifboolKV[Cards]{Trivial}{%
-    \xdef\PfCListeSymbolTrivial{\useKV[Cards]{Symboles}}%
-    \setsepchar{,}\readlist*\ListeSymbolesTrivial{\PfCListeSymbolTrivial}%
-    \setlength{\tabcolsep}{0.25\tabcolsep}
-    \ifboolKV[Cards]{Trame}{%
+    \CartesTrivial%
+  }{%
+    \ifboolKV[Cards]{JaiQuia}{%
+      \CartesJaiQuia%
+    }{%
+      \ifboolKV[Cards]{Loop}{%
+        \CartesLoop%
+      }{%
+        \CartesClassique%
+      }%
+    }%
+  }%
+}%
+
+\NewDocumentCommand\CartesClassique{}{%
+  \ifboolKV[Cards]{Trame}{%
+    \clearpage%
+    \thispagestyle{empty}%
+    \begin{Trame}
+      \multido{\i=1+1}{9}{%
+        \node[] at (Carte\i) {%
+          \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
+            \ListeCards[\i,1]%
+          \end{MyboxSimpleAv}%
+        };%
+      }%
+    \end{Trame}%
+    \ifboolKV[Cards]{AffichageSolution}{%
       \clearpage%
       \thispagestyle{empty}%
+      \begin{Trame}
+        \multido{\i=1+1}{3}{%
+          \node at (Carte\i) {%
+            \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+              \ListeCards[\fpeval{4-\i},2]%
+            \end{MyboxSimpleAr}%
+          };%
+        }%
+        \multido{\i=4+1}{3}{%
+          \node at (Carte\i) {%
+            \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+              \ListeCards[\fpeval{10-\i},2]%
+            \end{MyboxSimpleAr}%
+          };%
+        }%
+        \multido{\i=7+1}{3}{%
+          \node at (Carte\i) {%
+            \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+              \ListeCards[\fpeval{16-\i},2]%
+            \end{MyboxSimpleAr}%
+          };%
+        }%
+      \end{Trame}%
+      \clearpage%
+    }{}%
+  }{%
+    \ifboolKV[Cards]{SolutionSeule}{}{%
+      \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
+        \ListeCards[1,1]%
+      \end{MyboxSimpleAv}%
+    }%
+    \ifboolKV[Cards]{AffichageSolution}{%
+      \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+        \ListeCards[1,2]%
+      \end{MyboxSimpleAr}%
+    }{}%
+  }%
+}%
+
+\NewDocumentCommand\CartesLoop{}{%
+  \ifboolKV[Cards]{Trame}{%
+    \clearpage%
+    \thispagestyle{empty}%
+    \begin{Trame}
+      \multido{\i=1+1}{9}{%
+        \node at (Carte\i) {%
+          \begin{Mybox}{\ListeCards[\i,1]}{\useKV[Cards]{Theme}}{\ListeCards[\i,2]}%
+            \ListeCards[\i,3]%
+          \end{Mybox}%
+        };%
+      }%
+    \end{Trame}%
+    \clearpage%
+  }{%
+    \begin{Mybox}{\ListeCards[1,1]}{\useKV[Cards]{Theme}}{\ListeCards[1,2]}%
+      \ListeCards[1,3]%
+    \end{Mybox}%
+  }%
+}%
+
+\NewDocumentCommand\CartesJaiQuia{}{%
+  \ifboolKV[Cards]{Trame}{%
+    \clearpage%
+    \thispagestyle{empty}%
+    \begin{Trame}%
+      \multido{\i=1+1}{9}{%
+        \node at (Carte\i) {%
+          \begin{MyboxJQ}{\ListeCards[\i,1]}{\ListeCards[\i,2]}%
+            %% 
+          \end{MyboxJQ}%
+        };%
+      }%
+    \end{Trame}%
+    \clearpage%
+    \ifboolKV[Cards]{AffichageSolution}{%
+      \thispagestyle{empty}%
+      \begin{Trame}
+        \multido{\i=1+1}{3}{%
+          \node at (Carte\i) {%
+            \ifboolKV[Cards]{AfficheTheme}{%
+              \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
+              \end{MyboxJQAr}%
+            }{%
+              \begin{MyboxJQAr}{}%
+              \end{MyboxJQAr}%
+            }%
+          };%
+        }%
+        \multido{\i=4+1}{3}{%
+          \node at (Carte\i) {%
+            \ifboolKV[Cards]{AfficheTheme}{%
+              \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
+              \end{MyboxJQAr}%
+            }{%
+              \begin{MyboxJQAr}{}%
+              \end{MyboxJQAr}%
+            }%
+          };%
+        }%
+        \multido{\i=7+1}{3}{%
+          \node at (Carte\i) {%
+            \ifboolKV[Cards]{AfficheTheme}{%
+              \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
+              \end{MyboxJQAr}%
+            }{%
+              \begin{MyboxJQAr}{}%
+              \end{MyboxJQAr}%
+            }%
+          };%
+        }%
+      \end{Trame}%
+      \clearpage%
+    }{}%
+  }{%
+    \begin{MyboxJQ}{\ListeCards[1,1]}{\ListeCards[1,2]}%
+      %% 
+    \end{MyboxJQ}%
+    \ifboolKV[Cards]{AffichageSolution}{%
+      \ifboolKV[Cards]{AfficheTheme}{%
+        \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
+        \end{MyboxJQAr}%
+      }{%
+        \begin{MyboxJQAr}{}%
+        \end{MyboxJQAr}%
+      }%
+    }{}%
+  }%
+}%
+
+\NewDocumentCommand\CartesTrivial{}{%
+  \xdef\PfCListeSymbolTrivial{\useKV[Cards]{Symboles}}%
+  \setsepchar{,}\readlist*\ListeSymbolesTrivial{\PfCListeSymbolTrivial}%
+  \setlength{\tabcolsep}{0.25\tabcolsep}%
+  \ifboolKV[Cards]{Trame}{%
+    \clearpage%
+    \thispagestyle{empty}%
+    \begin{Trame}%
+      \multido{\i=1+1}{9}{%
+        \node[] at (Carte\i) {%
+          \begin{MyboxTrivial}%
+            \begin{center}
+              \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[9,m]}[hvlines]%
+                \xintFor* ##1 in{\xintSeq{1}{6}}\do{%
+                  \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\i,\fpeval{1+2*(##1-1)}]\\
+                }%
+              \end{NiceTabular}%
+            \end{center}%
+          \end{MyboxTrivial}%
+        };%
+      }%
+    \end{Trame}%
+    \ifboolKV[Cards]{AffichageSolution}{%
+      \clearpage%
+      \thispagestyle{empty}%
       \begin{Trame}%
-        \multido{\i=1+1}{9}{%
-          \node[] at (Carte\i) {%
+        \multido{\i=1+1}{3}{%
+          \node at (Carte\i) {%
             \begin{MyboxTrivial}%
-              \begin{center}
-                \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[9,m]}[hvlines]%
+              \begin{center}%
+                \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]%
                   \xintFor* ##1 in{\xintSeq{1}{6}}\do{%
-                    \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\i,\fpeval{1+2*(##1-1)}]\\
+                    \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{4-\i},\fpeval{2*##1}]\\
                   }%
                 \end{NiceTabular}%
               \end{center}%
@@ -386,220 +520,58 @@
             \end{MyboxTrivial}%
           };%
         }%
+        \multido{\i=4+1}{3}{%
+          \node at (Carte\i) {%
+            \begin{MyboxTrivial}%
+              \begin{center}%
+                \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]%
+                  \xintFor* ##1 in{\xintSeq{1}{6}}\do{%
+                    \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{10-\i},\fpeval{2*##1}]\\
+                  }%
+                \end{NiceTabular}%
+              \end{center}%
+            \end{MyboxTrivial}%
+          };%
+        }%
+        \multido{\i=7+1}{3}{%
+          \node at (Carte\i) {%
+            \begin{MyboxTrivial}%
+              \begin{center}%
+                \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]%
+                  \xintFor* ##1 in{\xintSeq{1}{6}}\do{%
+                    \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{16-\i},\fpeval{2*##1}]\\
+                  }%
+                \end{NiceTabular}%
+              \end{center}%
+            \end{MyboxTrivial}%
+          };%
+        }%
       \end{Trame}%
-      \ifboolKV[Cards]{AffichageSolution}{%
-        \clearpage%
-        \thispagestyle{empty}%
-        \begin{Trame}%
-          \multido{\i=1+1}{3}{%
-            \node at (Carte\i) {%
-              \begin{MyboxTrivial}%
-                \begin{center}%
-                  \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]%
-                    \xintFor* ##1 in{\xintSeq{1}{6}}\do{%
-                      \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{4-\i},\fpeval{2*##1}]\\
-                    }%
-                  \end{NiceTabular}%
-                \end{center}%
-              \end{MyboxTrivial}%
-            };%
+      \clearpage%
+    }{}%
+  }{%
+    \begin{MyboxTrivial}%
+      \begin{center}%
+        \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]%
+          \xintFor* ##1 in{\xintSeq{1}{6}}\do{%
+            \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[1,\fpeval{1+2*(##1-1)}]\\
           }%
-          \multido{\i=4+1}{3}{%
-            \node at (Carte\i) {%
-              \begin{MyboxTrivial}%
-                \begin{center}%
-                  \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]%
-                    \xintFor* ##1 in{\xintSeq{1}{6}}\do{%
-                      \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{10-\i},\fpeval{2*##1}]\\
-                    }%
-                  \end{NiceTabular}%
-                \end{center}%
-              \end{MyboxTrivial}%
-            };%
-          }%
-          \multido{\i=7+1}{3}{%
-            \node at (Carte\i) {%
-              \begin{MyboxTrivial}%
-                \begin{center}%
-                  \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]%
-                    \xintFor* ##1 in{\xintSeq{1}{6}}\do{%
-                      \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{16-\i},\fpeval{2*##1}]\\
-                    }%
-                  \end{NiceTabular}%
-                \end{center}%
-              \end{MyboxTrivial}%
-            };%
-          }%
-        \end{Trame}%
-        \clearpage%
-      }{}%
-    }{%
+        \end{NiceTabular}%
+      \end{center}%
+    \end{MyboxTrivial}%
+    \ifboolKV[Cards]{AffichageSolution}{%
       \begin{MyboxTrivial}%
         \begin{center}%
           \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]%
             \xintFor* ##1 in{\xintSeq{1}{6}}\do{%
-              \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[1,\fpeval{1+2*(##1-1)}]\\
+              \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[1,\fpeval{2*##1}]\\
             }%
           \end{NiceTabular}%
         \end{center}%
       \end{MyboxTrivial}%
-      \ifboolKV[Cards]{AffichageSolution}{%
-        \begin{MyboxTrivial}%
-          \begin{center}%
-            \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]%
-              \xintFor* ##1 in{\xintSeq{1}{6}}\do{%
-                \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[1,\fpeval{2*##1}]\\
-              }%
-            \end{NiceTabular}%
-          \end{center}%
-        \end{MyboxTrivial}%
-      }{}%
-    }%
-    \setlength{\tabcolsep}{4\tabcolsep}%
-  }{%
-    \ifboolKV[Cards]{JaiQuia}{%
-      \ifboolKV[Cards]{Trame}{%
-        \clearpage%
-        \thispagestyle{empty}%
-        \begin{Trame}%
-          \multido{\i=1+1}{9}{%
-            \node at (Carte\i) {%
-              \begin{MyboxJQ}{\ListeCards[\i,1]}{\ListeCards[\i,2]}%
-                %% 
-              \end{MyboxJQ}%
-            };%
-          }%
-        \end{Trame}%
-        \clearpage%
-        \ifboolKV[Cards]{AffichageSolution}{%
-          \thispagestyle{empty}%
-          \begin{Trame}
-            \multido{\i=1+1}{3}{%
-              \node at (Carte\i) {%
-                \ifboolKV[Cards]{AfficheTheme}{%
-                  \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
-                  \end{MyboxJQAr}%
-                }{%
-                  \begin{MyboxJQAr}{}%
-                  \end{MyboxJQAr}%
-                }%
-              };%
-            }%
-            \multido{\i=4+1}{3}{%
-              \node at (Carte\i) {%
-                \ifboolKV[Cards]{AfficheTheme}{%
-                  \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
-                  \end{MyboxJQAr}%
-                }{%
-                  \begin{MyboxJQAr}{}%
-                  \end{MyboxJQAr}%
-                }%
-              };%
-            }%
-            \multido{\i=7+1}{3}{%
-              \node at (Carte\i) {%
-                \ifboolKV[Cards]{AfficheTheme}{%
-                  \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
-                  \end{MyboxJQAr}%
-                }{%
-                  \begin{MyboxJQAr}{}%
-                  \end{MyboxJQAr}%
-                }%
-              };%
-            }%
-          \end{Trame}%
-          \clearpage%
-        }{}%
-      }{%
-        \begin{MyboxJQ}{\ListeCards[1,1]}{\ListeCards[1,2]}%
-          %%
-        \end{MyboxJQ}%
-        \ifboolKV[Cards]{AffichageSolution}{%
-          \ifboolKV[Cards]{AfficheTheme}{%
-            \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
-            \end{MyboxJQAr}%
-          }{%
-            \begin{MyboxJQAr}{}%
-            \end{MyboxJQAr}%
-          }%
-        }{}%
-      }%
-    }{%
-      \ifboolKV[Cards]{Loop}{%
-        \ifboolKV[Cards]{Trame}{%
-          \clearpage%
-          \thispagestyle{empty}%
-          \begin{Trame}
-            \multido{\i=1+1}{9}{%
-              \node at (Carte\i) {%
-                \begin{Mybox}{\ListeCards[\i,1]}{\useKV[Cards]{Theme}}{\ListeCards[\i,2]}%
-                  \ListeCards[\i,3]%
-                \end{Mybox}%
-              };%
-            }%
-          \end{Trame}%
-          \clearpage%
-        }{%
-          \begin{Mybox}{\ListeCards[1,1]}{\useKV[Cards]{Theme}}{\ListeCards[1,2]}%
-            \ListeCards[1,3]%
-          \end{Mybox}%
-        }%
-      }{%
-        \ifboolKV[Cards]{Trame}{%
-          \clearpage%
-          \thispagestyle{empty}%
-          \begin{Trame}
-            \multido{\i=1+1}{9}{%
-              \node[] at (Carte\i) {%
-                \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
-                  \ListeCards[\i,1]%
-                \end{MyboxSimpleAv}%
-              };%
-            }%
-          \end{Trame}%
-          \ifboolKV[Cards]{AffichageSolution}{%
-            \clearpage%
-            \thispagestyle{empty}%
-            \begin{Trame}
-              \multido{\i=1+1}{3}{%
-                \node at (Carte\i) {%
-                  \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
-                    \ListeCards[\fpeval{4-\i},2]%
-                  \end{MyboxSimpleAr}%
-                };%
-              }%
-              \multido{\i=4+1}{3}{%
-                \node at (Carte\i) {%
-                  \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
-                    \ListeCards[\fpeval{10-\i},2]%
-                  \end{MyboxSimpleAr}%
-                };%
-              }%
-              \multido{\i=7+1}{3}{%
-                \node at (Carte\i) {%
-                  \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
-                    \ListeCards[\fpeval{16-\i},2]%
-                  \end{MyboxSimpleAr}%
-                };%
-              }%
-            \end{Trame}%
-            \clearpage%
-          }{}%
-        }{%
-          \ifboolKV[Cards]{SolutionSeule}{}{%
-            \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
-              \ListeCards[1,1]%
-            \end{MyboxSimpleAv}%
-          }%
-          \ifboolKV[Cards]{AffichageSolution}{%
-            \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
-              \ListeCards[1,2]%
-            \end{MyboxSimpleAr}%
-          }{}%
-        }%
-      }%
-    }%
+    }{}%
   }%
+  \setlength{\tabcolsep}{4\tabcolsep}%
 }%
 
 \newcommand\SolutionCarte[2]{%
@@ -608,4 +580,174 @@
   \end{center}
   
   #2
+}%
+
+%%%%%%%% Boites
+\def\BuildBoiteCartesCCCode{%
+  Longueur=10cm;
+  Largeur=7cm;
+  Epaisseur=\useKV[Cards]{NbCartes}*1mm;
+  pair A[],B[],C[],D[];
+  A0=(0,0);
+  A1-A0=Epaisseur*(1,0);
+  A2-A1=Largeur*(1,0);
+  A3-A2=Epaisseur*(1,0);
+  A4-A3=Largeur*(1,0);
+  A5-A4=Epaisseur*(1,0);
+  A6-A5=Longueur*(0,1);
+  A7-A4=A6-A5;
+  A8-A3=A6-A5;
+  A9-A2=A6-A5;
+  A10-A1=A6-A5;
+  A11-A0=A6-A5;
+  A12-A11=A11-A10;
+  A13-A0=A0-A1;
+  B1-A1=Epaisseur*(0,-1);
+  B2-A2=Epaisseur*(0,-1);
+  B3-A3=Epaisseur*(0,-1);
+  B4-A4=Epaisseur*(0,-1);
+  C1=1/3[B1,B2];
+  C4=2/3[B1,B2];
+  C2-C1=B1-A1;
+  C3-C4=B1-A1;
+  C5-A2=(Epaisseur+5mm)*(0,-1);
+  C6-A3=C5-A2;
+  D1=1/5[A5,A6];
+  D2-D1=(Epaisseur+5mm)*(1,0);
+  D4=2/5[A5,A6];
+  D3-D4=D2-D1;
+  D5=3/5[A5,A6];
+  D6-D5=D3-D4;
+  D8=4/5[A5,A6];
+  D7-D8=D6-D5;
+  D9=1/3[A10,A9];
+  D10=2/3[A10,A9];
+  D11-D10=Epaisseur*(0,1);
+  D12-D9=D11-D10;
+  D17-A7=Epaisseur*(0,1);
+  D18-A8=D17-A7;
+  D19-D18=(1cm,Epaisseur+5mm);
+  D20-D17=(-1cm,Epaisseur+5mm);
+  picture Legende,LegendePDF;
+  pair M[];
+  M0=1/2[A8,A7];
+  M6=1/2[A3,A4];
+  M1=1/6[M0,M6];
+  M2=2/6[M0,M6];
+  M3=3/6[M0,M6];
+  M4=4/6[M0,M6];
+  M5=5/6[M0,M6];
+}%
+
+\NewDocumentCommand\BuildBoiteCartesCommerceC{}{%
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \BuildBoiteCartesCCCode;
+    %
+    trace chemin(A11,A12,A13,A0);
+    trace chemin(D9,A11,A0,1/3[A1,A2]);
+    trace chemin(D10,A6,A5,2/3[A1,A2]);
+    trace segment(A1,A10) dashed evenly;
+    trace segment(A1,1/5[A1,A10]);
+    trace segment(2/5[A1,A10],3/5[A1,A10]);
+    trace segment(4/5[A1,A10],A10);
+    trace marquesegment(1/5[A1,A10],2/5[A1,A10]);
+    trace marquesegment(3/5[A1,A10],4/5[A1,A10]);
+    trace segment(A2,A9);
+    trace segment(A3,A8);
+    trace segment(A4,A7);
+    trace segment(1/3[A1,A2],2/3[A1,A2]) dashed evenly;
+    trace marquesegment(1/3[A1,A2],2/3[A1,A2]);
+    % languettes basses
+    trace chemin(B1,B2);
+    trace chemin(B3,B4,A4);
+    trace chemin(C1,C2,C3,C4) shifted (B4-B2);;
+    picture Decoupe[];
+   Decoupe1=image(
+    trace chemin(B2,C5,C6,B3);
+    trace A2--B2 dashed evenly;
+    trace A3--B3 dashed evenly;
+    );
+    Decoupe2=image(
+    trace chemin(B2,C5,C6,A3);
+    trace A2--B2 dashed evenly;
+   );
+    trace Decoupe1;
+    trace symetrie(Decoupe2,iso(A2,A3),iso(C5,C6)) shifted(A0-A2);
+    trace symetrie(Decoupe2 shifted(A4-A2),iso(A0,A11),iso(A5,A6));
+    trace symetrie(Decoupe2 shifted(A4-A2),iso(A8,A4));
+    % languettes droites
+    trace polygone(D1,D2,D3,D4);
+    trace polygone(D5,D6,D7,D8);
+   % languettes hautes
+    path cc;
+    cc=cercles(iso(A10,A9),1/3[A10,A9]);
+    trace Hachurage((subpath(length cc/2,length cc) of cc)--cycle,60,0.25,1);
+    trace (subpath(length cc/2,length cc) of cc)--cycle dashed evenly;
+    trace polygone(D18,D17,D20,D19);
+    trace chemin(1/3[D18,D17],D18,D19,D20,D17,2/3[D18,D17]);
+    % label
+    drawoptions(withcolor \useKV[Cards]{CouleurTheme});
+    label(btex \bfseries\Large\useKV[Cards]{ThemeJeu} etex,M2);
+    drawoptions(withcolor \useKV[Cards]{CouleurNiveau});
+    label(btex \bfseries Niveau \useKV[Cards]{Niveau} etex,M3);
+    label(btex \bfseries Jeu \useKV[Cards]{Numero} etex,M4);
+    drawoptions(withcolor \useKV[Cards]{CouleurNb});
+    label(btex \bfseries\useKV[Cards]{NbCartes} cartes etex,M5);
+    drawoptions(withcolor \useKV[Cards]{CouleurType});
+    label(btex \bfseries\Huge\useKV[Cards]{TypeJeu} etex,M1);
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\BuildBoiteCartesCCCode;}]
+    trace chemin(A11,A12,A13,A0);
+    trace chemin(D9,A11,A0,1/3[A1,A2]);
+    trace chemin(D10,A6,A5,2/3[A1,A2]);
+    trace segment(A1,A10) dashed evenly;
+    trace segment(A1,1/5[A1,A10]);
+    trace segment(2/5[A1,A10],3/5[A1,A10]);
+    trace segment(4/5[A1,A10],A10);
+    trace marquesegment(1/5[A1,A10],2/5[A1,A10]);
+    trace marquesegment(3/5[A1,A10],4/5[A1,A10]);
+    trace segment(A2,A9);
+    trace segment(A3,A8);
+    trace segment(A4,A7);
+    trace segment(1/3[A1,A2],2/3[A1,A2]) dashed evenly;
+    trace marquesegment(1/3[A1,A2],2/3[A1,A2]);
+    % languettes basses
+    trace chemin(B1,B2);
+    trace chemin(B3,B4,A4);
+    trace chemin(C1,C2,C3,C4) shifted (B4-B2);;
+    picture Decoupe[];
+    Decoupe1=image(
+    trace chemin(B2,C5,C6,B3);
+    trace A2--B2 dashed evenly;
+    trace A3--B3 dashed evenly;
+    );
+    Decoupe2=image(
+    trace chemin(B2,C5,C6,A3);
+    trace A2--B2 dashed evenly;
+    );
+    trace Decoupe1;
+    trace symetrie(Decoupe2,iso(A2,A3),iso(C5,C6)) shifted(A0-A2);
+    trace symetrie(Decoupe2 shifted(A4-A2),iso(A0,A11),iso(A5,A6));
+    trace symetrie(Decoupe2 shifted(A4-A2),iso(A8,A4));
+    % languettes droites
+    trace polygone(D1,D2,D3,D4);
+    trace polygone(D5,D6,D7,D8);
+    % languettes hautes
+    path cc;
+    cc=cercles(iso(A10,A9),1/3[A10,A9]);
+    trace Hachurage((subpath(length cc/2,length cc) of cc)--cycle,60,0.25,1);
+    trace (subpath(length cc/2,length cc) of cc)--cycle dashed evenly;
+    trace polygone(D18,D17,D20,D19);
+    trace chemin(1/3[D18,D17],D18,D19,D20,D17,2/3[D18,D17]);
+  \end{mpost}
+  \fi
+}%
+
+\NewDocumentCommand\BoiteCartes{o}{%
+  \useKVdefault[Cards]%
+  \setKV[Cards]{#1}%
+  \BuildBoiteCartesCommerceC%
 }%
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCDefiTables.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCDefiTables.tex	2023-05-19 20:24:37 UTC (rev 67161)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCDefiTables.tex	2023-05-19 20:25:04 UTC (rev 67162)
@@ -2,7 +2,7 @@
 % Defi Table
 %%%
 
-\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm,Graines=false,Creation=false}
+\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm,Graines=false,Creation=false,ValeurMin=1,ValeurMax=10}
 \defKV[DefiTable]{Graine=\setKV[DefiTable]{Graines}}%
 
 \newcommand\MelangeListeNew[2]{%
@@ -32,7 +32,36 @@
   \reademptyitems%
 }%
 
+\NewDocumentCommand\JeConstruisLesProduits{mm}{%
+  \xintFor* ##1 in{\xintSeq{#1}{#2}}\do{%
+    \xintifForFirst{%
+      \xdef\ListeDesProduitsFoo{\fpeval{##1}}%
+      \xintFor* ##2 in{\xintSeq{2}{10}}\do{%
+        \xdef\ListeDesProduitsFoo{\ListeDesProduitsFoo/\fpeval{##1*##2}}%
+      }%
+    }{%
+      \xintFor* ##2 in{\xintSeq{1}{10}}\do{%
+        \xdef\JeCoupe{0}%
+        \xintFor* ##3 in{\xintSeq{#1}{\fpeval{##1-1}}}\do{%
+          \xintifboolexpr{\fpeval{##1*##2}>\fpeval{##3*10}}{}{%
+            \modulo{\fpeval{##1*##2}}{##3}\relax%
+            \xintifboolexpr{\remainder==0}{\xdef\JeCoupe{1}\xintBreakFor}{}%
+          }%
+        }%
+        \xintifboolexpr{\JeCoupe==1}{}{\xdef\ListeDesProduitsFoo{\ListeDesProduitsFoo/\fpeval{##1*##2}}}%
+      }%
+    }%
+  }%
+  \setsepchar[*]{/}%
+  \readlist*\ListeDesProduits{\ListeDesProduitsFoo}%
+  \xdef\NombreDeProduitATester{\ListeDesProduitslen}%
+}%
+
 \newcommand\DefiTableNombreLettreduCode[1]{%
+  \JeConstruisLesProduits{\useKV[DefiTable]{ValeurMin}}{\useKV[DefiTable]{ValeurMax}}%
+  \MelangeListeNew{\ListeDesProduitsFoo}{\NombreDeProduitATester}
+%  Les produits mélangés sont :\par
+  \readlist*\ListeDesProduits{\faa}%
   \xdef\ListeDesCaracteresFoo{a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/à/é/è/ê/ï/î/ô/ö/ù/ç/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/À/É/È/,/$?$/$;$/./$!$/$:$/-}
   \savecomparemode%
   \comparestrict%
@@ -79,7 +108,7 @@
     \xintifboolexpr{\PfCTotal==\ListeDesLettresUniqueslen}{\xdef\ListeCaracteresUniques{\ListeCaracteresUniques\ListeTotaleDesCaracteres[##1]/}}{}%
   }%
   %La liste des caractères uniques à ajouter
-  \MelangeListeNew{\ListeCaracteresUniques}{\fpeval{42-\ListeDesLettresUniqueslen}}%
+  \MelangeListeNew{\ListeCaracteresUniques}{\fpeval{\NombreDeProduitATester-\ListeDesLettresUniqueslen}}%
   %\par La liste des éléments à mélanger est :\par
   \xdef\ListeDesCaracteresAUtiliser{}
   \xintFor* ##1 in{\xintSeq{1}{\ListeDesLettresUniqueslen}}\do{%
@@ -86,14 +115,10 @@
     \xdef\ListeDesCaracteresAUtiliser{\ListeDesCaracteresAUtiliser \ListeDesLettresUniques[##1]/}%
   }%
   \xdef\ListeDesCaracteresAUtiliser{\ListeDesCaracteresAUtiliser \faa}
-  \MelangeListeNew{\ListeDesCaracteresAUtiliser}{42}
+  \MelangeListeNew{\ListeDesCaracteresAUtiliser}{\NombreDeProduitATester}
   %Finalement, on utilise ces caractères :\par
   \ignoreemptyitems%
   \readlist*\ListeFinaleDesCaracteres{\faa}
-  \xdef\ListeDesProduitsFoo{1/2/3/4/5/6/7/8/9/10/12/14/16/18/20/15/21/24/27/30/28/32/36/40/25/35/45/50/42/48/54/60/49/56/63/70/64/72/80/81/90/100}
-  \MelangeListeNew{\ListeDesProduitsFoo}{42}
-  %Les produits mélangés sont :\par
-  \readlist*\ListeDesProduits{\faa}%
   \restorecomparemode
   \reademptyitems
 }
@@ -103,9 +128,9 @@
   % 2 la table de décodage
   \useKVdefault[DefiTable]%
   \setKV[DefiTable]{#1}%
-  \ifboolKV[DefiTable]{Creation}{
+  \ifboolKV[DefiTable]{Creation}{%
     \ifboolKV[DefiTable]{Graines}{\PfCGraineAlea{\useKV[DefiTable]{Graine}}}{}%
-    \DefiTableNombreLettreduCode{#2}
+    \DefiTableNombreLettreduCode{#2}%
     \begin{center}
       \begin{tabular}{|>{\columncolor{gray!15}}c|*{10}{c|}}
         \hline
@@ -114,8 +139,8 @@
                                                         }\\\hline%
         \xintFor* ##1 in{\xintSeq{1}{10}}\do{%
         ##1\xintFor* ##2 in{\xintSeq{1}{10}}\do{%
-                                  &\xintFor* ##3 in{\xintSeq{1}{42}}\do{%
-                                    \xintifboolexpr{\fpeval{##1*##2}==\ListeDesProduits[##3]}{\ListeFinaleDesCaracteres[##3]}{}%
+                                  &\xintFor* ##3 in{\xintSeq{1}{\NombreDeProduitATester}}\do{%
+                                    \xintifboolexpr{\fpeval{##1*##2}==\ListeDesProduits[##3] 'and' any(\useKV[DefiTable]{ValeurMin}<=##2<=\useKV[DefiTable]{ValeurMax},\useKV[DefiTable]{ValeurMin}<=##1<=\useKV[DefiTable]{ValeurMax})}{\ListeFinaleDesCaracteres[##3]}{}%
                                     }%
                                     }\\\hline%
         }%
@@ -169,7 +194,7 @@
           \xintifForFirst{}{&}%
           \StrMid{\ListeDefiTableTableau[##1]}{##2}{##2}[\DefiTableMaLettre]%
           \IfStrEq{\DefiTableMaLettre}{*}{}{%
-            \xintFor* ##3 in{\xintSeq{1}{42}}\do{%
+            \xintFor* ##3 in{\xintSeq{1}{\NombreDeProduitATester}}\do{%
               \IfStrEq{\DefiTableMaLettre}{\ListeFinaleDesCaracteres[##3]}{\Block{}{\footnotesize\ListeDesProduits[##3]}}{}%
             }%
           }%

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCModeleBarre.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCModeleBarre.tex	2023-05-19 20:24:37 UTC (rev 67161)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCModeleBarre.tex	2023-05-19 20:25:04 UTC (rev 67162)
@@ -1,15 +1,15 @@
 %%%
 % Modele en barre
 %%%
-\setKVdefault[ClesModeleBarre]{Hauteur=0.5cm,Largeur=1cm,Separation=0,Homogene=false}%Separation pour conserver le lien avec les équations.
+\setKVdefault[ClesModeleBarre]{Hauteur=0.5cm,Largeur=1cm,Separation={0},Homogene=false}%Separation pour conserver le lien avec les équations.
 \defKV[ClesModeleBarre]{Longueur=\setKV[ClesModeleBarre]{Homogene}}%
 
 \newtoks\toklistemodelbarresup%
-\toklistemodelbarresup{}%
 \def\UpdateListeModelBarreSup#1\nil{\addtotok\toklistemodelbarresup{#1,}}%
 \newtoks\toklistemodelbarreinf%
-\toklistemodelbarreinf{}%
 \def\UpdateListeModelBarreInf#1\nil{\addtotok\toklistemodelbarreinf{#1,}}%
+\newtoks\toklistemodelbarresep%
+\def\UpdateListeModelBarreSep#1\nil{\addtotok\toklistemodelbarresep{#1,}}%
 
 \newcommand\ModeleBarre[3][]{%
   % #1 options
@@ -20,6 +20,9 @@
   \setsepchar{\\/ }%
   \readlist\ListeModelBarreSup{#2}%
   \readlist\ListeModelBarreInf{#3}%
+  \setsepchar{,}%
+  \xdef\fooSeparation{\useKV[ClesModeleBarre]{Separation}}
+  \readlist\ListeModelBarreSep{\fooSeparation}%
   \toklistemodelbarresup{}%
   \foreachitem\compteur\in\ListeModelBarreSup{%
     \foreachitem\valeur\in\ListeModelBarreSup[\compteurcnt]{%
@@ -32,10 +35,14 @@
       \expandafter\UpdateListeModelBarreInf\valeur\nil%
     }%
   }%
+  \toklistemodelbarresep{}%
+  \foreachitem\compteur\in\ListeModelBarreSep{%
+    \expandafter\UpdateListeModelBarreSep\compteur\nil%
+  }%
   \ifboolKV[ClesModeleBarre]{Homogene}{%
     \PfCMPDessineModelBarre{\the\toklistemodelbarresup}{\the\toklistemodelbarreinf}%
   }{%
-    \PfCMPDessineModelBarreNonHomogene{\the\toklistemodelbarresup}{\the\toklistemodelbarreinf}%
+    \PfCMPDessineModelBarreNonHomogene{\the\toklistemodelbarresup}{\the\toklistemodelbarreinf}{\the\toklistemodelbarresep}%
   }%
 }%
 
@@ -156,37 +163,42 @@
   \end{mplibcode}
 }%
 
-\newcommand\PfCMPDessineModelBarreNonHomogene[2]{%
-  \ifluatex%
-  \mplibforcehmode%
-  \begin{mplibcode}
-    Longueur:=\useKV[ClesModeleBarre]{Largeur};
-    Hauteur:=\useKV[ClesModeleBarre]{Hauteur};
-    Separation:=\useKV[ClesModeleBarre]{Separation};
-    
-    vardef Brique(expr col,nbfois)(text t)=
-    save $;
-    picture $;
-    $=image(
-    u:=Longueur;
-    if t="?":
-    draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) dashed evenly;
-    else:
-    remplis polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) withcolor col;
-    draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur));
-    fi;
-    if nbfois>0:
-    label(TEX(t),iso((0,0),(u*abs(nbfois),Hauteur)));
-    else:
-    label.bot(TEX(t),iso((0,0),(u*abs(nbfois),-Hauteur)));
-    drawdblarrow (0,-0.5*Hauteur)--(u*abs(nbfois),-0.5*Hauteur);
-    fi;
-    u:=1cm;
-    );
-    $
-    enddef;
-    
-    numeric MBnbcolsup;%compte combien de couleurs
+\def\PfCMPDessineModelBarreNHCode{%
+  numeric MBnbcolinf;%compte combien de couleurs
+  MBnbcolinf=0;
+  color MBColInf[];%Sauvegarde les couleurs de la barre inf
+  numeric MBnbinfoinf[];%compte combien d'infos par couleurs.
+  numeric MBnbcasesinf[][];
+  numeric MBnbcasesinftotal;
+  MBnbcasesinftotal=0;
+  string MBTextcasesinf[][];
+  vardef tata(text t)=
+  for p_=t:
+  if color p_:
+  MBnbcolinf:=MBnbcolinf+1;% on incrémente le nombre de couleurs
+  MBColInf[MBnbcolinf]:=p_;% on définit la couleur de la série de cases
+  MBnbinfoinf[MBnbcolinf]:=0;
+  else:
+  if numeric p_:
+  MBnbinfoinf[MBnbcolinf]:=MBnbinfoinf[MBnbcolinf]+1;
+  MBnbcasesinftotal:=MBnbcasesinftotal+p_;
+  MBnbcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
+  else:
+  MBTextcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
+  fi;
+  fi;
+  endfor;
+  enddef;
+  % 
+  vardef Separation(text t)=
+  for p_=t:
+  if p_>0:
+  nbdecal:=p_;
+  draw (u*nbdecal,-1.5Hauteur)--(u*nbdecal,1.5Hauteur) withpen pencircle scaled 1.5 dashed evenly withcolor red;
+  fi;
+  endfor;
+  enddef;
+  numeric MBnbcolsup;%compte combien de couleurs
     MBnbcolsup=0;
     color MBColSup[];%Sauvegarde les couleurs de la barre sup
     numeric MBnbinfosup[];%compte combien d'infos par couleurs.
@@ -211,35 +223,64 @@
     fi;
     endfor;
     enddef;
+}%
+
+\def\PfCMPDessineModelBarreBriqueCode{%
+  vardef Brique(expr col,nbfois)(text t)=
+  save $;
+  picture $;
+  $=image(
+  if t="?":
+  draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) dashed evenly;
+  else:
+  remplis polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) withcolor col;
+  draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur));
+  fi;
+  if nbfois>0:
+  label(TEX(t),iso((0,0),(u*abs(nbfois),Hauteur)));
+  else:
+  label.bot(TEX(t),iso((0,0),(u*abs(nbfois),-Hauteur)));
+  drawdblarrow (0,-0.5*Hauteur)--(u*abs(nbfois),-0.5*Hauteur);
+  fi;
+  );
+  $
+  enddef;
+}%
+
+\def\PfCMPDessineModelBarreBriqueCodePDF{%
+  vardef Brique(expr col,nbfois)(text t)=
+  save $;
+  picture $;
+  $=image(
+  if t="?":
+  draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) dashed evenly;
+  else:
+  remplis polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) withcolor col;
+  draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur));
+  fi;
+  if nbfois>0:
+  label(LATEX(t),iso((0,0),(u*abs(nbfois),Hauteur)));
+  else:
+  label.bot(LATEX(t),iso((0,0),(u*abs(nbfois),-Hauteur)));
+  drawdblarrow (0,-0.5*Hauteur)--(u*abs(nbfois),-0.5*Hauteur);
+  fi;
+  );
+  $
+  enddef;
+}%
     
+\newcommand\PfCMPDessineModelBarreNonHomogene[3]{%
+  \ifluatex%
+  \mplibforcehmode%
+  \begin{mplibcode}
+    \PfCMPDessineModelBarreNHCode
+    \PfCMPDessineModelBarreBriqueCode
+    
+    Longueur:=\useKV[ClesModeleBarre]{Largeur};
+    Hauteur:=\useKV[ClesModeleBarre]{Hauteur};
+    u:=Longueur;
+        
     toto(#1);
-
-    numeric MBnbcolinf;%compte combien de couleurs
-    MBnbcolinf=0;
-    color MBColInf[];%Sauvegarde les couleurs de la barre inf
-    numeric MBnbinfoinf[];%compte combien d'infos par couleurs.
-    numeric MBnbcasesinf[][];
-    numeric MBnbcasesinftotal;
-    MBnbcasesinftotal=0;
-    string MBTextcasesinf[][];
-    vardef tata(text t)=
-    for p_=t:
-    if color p_:
-    MBnbcolinf:=MBnbcolinf+1;% on incrémente le nombre de couleurs
-    MBColInf[MBnbcolinf]:=p_;% on définit la couleur de la série de cases
-    MBnbinfoinf[MBnbcolinf]:=0;
-    else:
-    if numeric p_:
-    MBnbinfoinf[MBnbcolinf]:=MBnbinfoinf[MBnbcolinf]+1;
-    MBnbcasesinftotal:=MBnbcasesinftotal+p_;
-    MBnbcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
-    else:
-    MBTextcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
-    fi;
-    fi;
-    endfor;
-    enddef;
-    
     tata(#2);
     
     pair VecteurDepla;
@@ -267,89 +308,11 @@
     endfor;
     endfor;
 
-    if Separation>0:
-    draw (u*Separation,-1.5Hauteur)--(u*Separation,1.5Hauteur) withpen pencircle scaled 1.5 dashed evenly withcolor red;
-    fi;
-
+    Separation(#3);
   \end{mplibcode}%
   \else
-  \begin{mpost}[mpsettings={Longueur:=\useKV[ClesModeleBarre]{Largeur};Hauteur:=\useKV[ClesModeleBarre]{Hauteur};Separation:=\useKV[ClesModeleBarre]{Separation};}]
-    vardef Brique(expr col,nbfois)(text t)=
-    save $;
-    picture $;
-    $=image(
-    u:=Longueur;
-    if t="?":
-    draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) dashed evenly;
-    else:
-    remplis polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) withcolor col;
-    draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur));
-    fi;
-    if nbfois>0:
-    label(LATEXProf(t),iso((0,0),(u*abs(nbfois),Hauteur)));
-    else:
-    label.bot(LATEXProf(t),iso((0,0),(u*abs(nbfois),-Hauteur)));
-    drawdblarrow (0,-0.5*Hauteur)--(u*abs(nbfois),-0.5*Hauteur);
-    fi;
-    u:=1cm;
-    );
-    $
-    enddef;
-    
-    numeric MBnbcolsup;%compte combien de couleurs
-    MBnbcolsup=0;
-    color MBColSup[];%Sauvegarde les couleurs de la barre sup
-    numeric MBnbinfosup[];%compte combien d'infos par couleurs.
-    numeric MBnbcasessup[][];
-    numeric MBnbcasessuptotal;
-    MBnbcasessuptotal=0;
-    string MBTextcasessup[][];
-    vardef toto(text t)=
-    for p_=t:
-    if color p_:
-    MBnbcolsup:=MBnbcolsup+1;% on incrémente le nombre de couleurs
-    MBColSup[MBnbcolsup]:=p_;% on définit la couleur de la série de cases
-    MBnbinfosup[MBnbcolsup]:=0;
-    else:
-    if numeric p_:
-    MBnbinfosup[MBnbcolsup]:=MBnbinfosup[MBnbcolsup]+1;
-    MBnbcasessuptotal:=MBnbcasessuptotal+p_;
-    MBnbcasessup[MBnbcolsup][MBnbinfosup[MBnbcolsup]]:=p_;
-    else:
-    MBTextcasessup[MBnbcolsup][MBnbinfosup[MBnbcolsup]]:=p_;
-    fi;
-    fi;
-    endfor;
-    enddef;
-    
+  \begin{mpost}[mpsettings={\PfCMPDessineModelBarreNHCode;\PfCMPDessineModelBarreBriqueCodePDF;Longueur:=\useKV[ClesModeleBarre]{Largeur};Hauteur:=\useKV[ClesModeleBarre]{Hauteur};u:=Longueur;}]
     toto(#1);
-
-    numeric MBnbcolinf;%compte combien de couleurs
-    MBnbcolinf=0;
-    color MBColInf[];%Sauvegarde les couleurs de la barre inf
-    numeric MBnbinfoinf[];%compte combien d'infos par couleurs.
-    numeric MBnbcasesinf[][];
-    numeric MBnbcasesinftotal;
-    MBnbcasesinftotal=0;
-    string MBTextcasesinf[][];
-    vardef tata(text t)=
-    for p_=t:
-    if color p_:
-    MBnbcolinf:=MBnbcolinf+1;% on incrémente le nombre de couleurs
-    MBColInf[MBnbcolinf]:=p_;% on définit la couleur de la série de cases
-    MBnbinfoinf[MBnbcolinf]:=0;
-    else:
-    if numeric p_:
-    MBnbinfoinf[MBnbcolinf]:=MBnbinfoinf[MBnbcolinf]+1;
-    MBnbcasesinftotal:=MBnbcasesinftotal+p_;
-    MBnbcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
-    else:
-    MBTextcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
-    fi;
-    fi;
-    endfor;
-    enddef;
-    
     tata(#2);
     
     pair VecteurDepla;
@@ -377,10 +340,7 @@
     endfor;
     endfor;
 
-    if Separation>0:
-    draw u*(Separation,-0.75)--u*(Separation,0.75) withpen pencircle scaled 1.5 dashed evenly withcolor red;
-    fi;
-
+    Separation(#3);
   \end{mpost}
   \fi
 }%
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex	2023-05-19 20:24:37 UTC (rev 67161)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex	2023-05-19 20:25:04 UTC (rev 67162)
@@ -5,7 +5,10 @@
 \defKV[ClesFonction]{Traces=\setKV[ClesFonction]{Codes}}%
 
 \newtoks\toklistePtsFn%pour la discipline
-
+\newtoks\tokPfCListeDesFonctions%
+\newtoks\tokPfCListeDesNomsFonctions%
+\def\UpdatePfCListeDesFonctions#1\nil{\addtotok\tokPfCListeDesFonctions{"#1",}}%
+\def\UpdatePfCListeDesNomsFonctions#1\nil{\addtotok\tokPfCListeDesNomsFonctions{"#1",}}%
 \def\UpdatePtsFn#1/#2/#3/#4\nil{\addtotok\toklistePtsFn{#1,(#2,#3),#4,}}%
 \def\UpdatePtsFN#1/#2/#3/#4\nil{\addtotok\toklistePtsFn{(#2,#3),}}%
 
@@ -15,7 +18,21 @@
   \ifboolKV[ClesFonction]{Trace}{%
     \useKVdefault[TraceG]%
     \setKV[TraceG]{#1}%
-    \MPTraceFonction[#1]{\useKV[ClesFonction]{Calcul}}%
+    \tokPfCListeDesFonctions{}%
+    \tokPfCListeDesNomsFonctions{}%
+    \xdef\PfCFooFn{\useKV[ClesFonction]{Calcul}}
+    \xdef\PfCFooNomFn{\useKV[TraceG]{NomCourbe}}
+    \ifx\bla\PfCFooFn\bla%
+    \else
+    \readlist*\ListeDesFonctions{\PfCFooFn}
+    \foreachitem\compteur\in\ListeDesFonctions{\expandafter\UpdatePfCListeDesFonctions\compteur\nil}%
+    \fi
+    \ifx\bla\PfCFooNomFn\bla
+    \else
+    \readlist*\ListeDesNomsFonctions{\PfCFooNomFn}
+    \foreachitem\compteur\in\ListeDesNomsFonctions{\expandafter\UpdatePfCListeDesNomsFonctions\compteur\nil}%
+    \fi
+    \TraceMultiGraphique{\the\tokPfCListeDesFonctions}{\the\tokPfCListeDesNomsFonctions}%
   }{%
     \ifboolKV[ClesFonction]{Points}{%
       \toklistePtsFn{}%
@@ -32,16 +49,14 @@
         \xdef\PfCFooListePoints{}
         \ifboolKV[ClesFonction]{Tangentes}{%
           \foreachitem\compteur\in\ListePoints{%
-            % \expandafter\UpdatePtsFn\compteur\nil%
             \xdef\PfCFooListePoints{\PfCFooListePoints \ListePoints[\compteurcnt,1],(\ListePoints[\compteurcnt,2],\ListePoints[\compteurcnt,3]),\ListePoints[\compteurcnt,4],}%
           }%
         }{%
           \foreachitem\compteur\in\ListePoints{%
-            % \expandafter\UpdatePtsFN\compteur\nil%
             \xdef\PfCFooListePoints{\PfCFooListePoints (\ListePoints[\compteurcnt,2],\ListePoints[\compteurcnt,3]),}%
           }%
         }%
-        \MPCourbeNew{\PfCFooListePoints}%\the\toklistePtsFn}%
+        \MPCourbeNew{\PfCFooListePoints}%
       }%
     }{%
       \setsepchar{,}\ignoreemptyitems%
@@ -63,6 +78,281 @@
   }%
 }%
 
+\def\PfCTraceMGCode{%
+  nbcourbe=\ListeDesFonctionslen;
+  % 
+  numeric borneinf[],bornesup[],pos[];
+  % 
+  vardef RetiensPos(text t)=
+  n:=0;
+  for p_=t:
+  n:=n+1;
+  pos[n]=p_;
+  endfor;
+  enddef;
+  % 
+  RetiensPos(\useKV[TraceG]{LabelC});
+  % 
+  vardef RetiensBorneInf(text t)=
+  borneinfmin=infinity;
+  n:=0;
+  for p_=t:
+  n:=n+1;
+  borneinf[n]=p_;
+  if borneinf[n]<borneinfmin:
+  borneinfmin:=borneinf[n]
+  fi;
+  endfor;
+  enddef;
+  % 
+  RetiensBorneInf(\useKV[TraceG]{Bornea});
+  % 
+  vardef RetiensBorneSup(text t)=
+  bornesupmax=-infinity;
+  n:=0;
+  for p_=t:
+  n:=n+1;
+  bornesup[n]=p_;
+  if bornesup[n]>bornesupmax:
+  bornesupmax:=bornesup[n]
+  fi;
+  endfor;
+  enddef;%
+  % 
+  RetiensBorneSup(\useKV[TraceG]{Borneb});
+  % 
+  nbpointsCourbe:=\useKV[TraceG]{NbPointsCourbe};
+  xmin=\useKV[TraceG]{Xmin};
+  xmax=\useKV[TraceG]{Xmax};
+  ymin=\useKV[TraceG]{Ymin};
+  ymax=\useKV[TraceG]{Ymax};
+  pasx=\useKV[TraceG]{Xstep};
+  pasy=\useKV[TraceG]{Ystep};
+  xu=1cm/\useKV[TraceG]{Xstep};
+  yu=1cm/\useKV[TraceG]{Ystep};
+  grillex=\useKV[TraceG]{PasGrilleX};
+  grilley=\useKV[TraceG]{PasGrilleY};
+  gradx=\useKV[TraceG]{PasGradX};
+  grady=\useKV[TraceG]{PasGradY};
+  Epaisseur:=\useKV[TraceG]{Epaisseur};
+  %
+  color colortrace[];
+  vardef RetiensCouleur(text t)=
+  n:=0;
+  for p_=t:
+  n:=n+1;
+  colortrace[n]=p_;
+  endfor;
+  enddef;
+  % 
+  RetiensCouleur(\useKV[TraceG]{CouleurTrace});
+  %
+  pair Origine;
+  Origine=(xmin,ymin)+\useKV[TraceG]{Origine};
+  %
+  boolean Grille,Vide,Graduations,Code,LegendeX,LegendeY;
+  Grille=\useKV[TraceG]{Grille};
+  Vide=\useKV[TraceG]{Vide};
+  Graduations=\useKV[TraceG]{Graduations};
+  Code=\useKV[TraceG]{Code};
+  LegendeX=\useKV[TraceG]{LegendeX};
+  LegendeY=\useKV[TraceG]{LegendeY};
+  %
+  vardef sin(expr t) = sind(c*t) enddef;
+  vardef cos(expr t) = cosd(c*t) enddef;
+  vardef tan(expr t) = sin(t)/cos(t) enddef;
+  vardef exp(expr t) = e**t enddef;
+  vardef ch(expr x)=(exp(x)+exp(-x))/2 enddef;
+  vardef sh(expr x)=(exp(x)-exp(-x))/2 enddef;
+  vardef ln(expr t) = mlog(t)/256 enddef;
+  vardef arcsin(expr x)=%Définition mathématique en radian
+    pi*angle((sqrt(1-x**2),x))/180
+  enddef;
+  vardef arccos(expr x)=%Définition mathématique en radian
+    pi*angle((x,sqrt(1-x**2)))/180
+  enddef;
+  def enplace=
+    xscaled xu yscaled yu shifted (Origine*cm)
+  enddef;
+  vardef placepoint(expr q,r)=
+   (q,r) enplace
+  enddef;
+  %
+  path Cb[];
+  %
+  vardef courbe[](expr a,b,nb)(text texte)=
+  path Courbe;
+  for i:=0 upto nb :
+  x@[i]:=(a+i*(b-a)/nb);
+  x:=x@[i];
+  y@[i]:=texte;
+  endfor ;
+  Cb@:=(x at .0*xu,y at .0*yu)
+  for i:=1 upto nb :
+  ..(x@[i]*xu,y@[i]*yu)
+  endfor;
+  Cb@:=Cb@ shifted (Origine*cm);
+  Courbe=Cb@;
+  Courbe
+  enddef;
+  %
+  vardef DessineCourbes(text texto)=
+  n:=0;
+  for p_=texto:
+  n:=n+1;
+  draw courbe[n](borneinf[n],bornesup[n],100)(scantokens p_) withpen (pencircle scaled Epaisseur) withcolor if unknown colortrace[n]:black else: colortrace[n] fi;
+  endfor;
+  enddef;
+  %
+  vardef NommeCourbes(text texto)=
+  n:=0;
+  for p_=texto:
+  n:=n+1;
+  numeric tp;
+  tp=pos[n]*length Cb[n];
+  pair PT,Tangente;
+  PT:=point (tp) of Cb[n];
+  Tangente:=unitvector(direction tp of Cb[n]);
+  label(TEX(p_) rotated angle(Tangente),PT+2mm*(Tangente rotated 90));
+  endfor;
+  enddef;
+  % 
+  vardef NommeCourbesPDF(text texto)=
+  n:=0;
+  for p_=texto:
+  n:=n+1;
+  numeric tp;
+  tp=pos[n]*length Cb[n];
+  pair PT,Tangente;
+  PT:=point (tp) of Cb[n];
+  Tangente:=unitvector(direction tp of Cb[n]);
+  label(LATEX(p_) rotated angle(Tangente),PT+2mm*(Tangente rotated 90));
+  endfor;
+  enddef;
+  %
+  vardef EffectuerTraces=
+  \useKV[TraceG]{Traces};
+  enddef;
+  %
+  vardef LegendeCourbe=
+  if LegendeX=true:
+  label.ulft(btex \useKV[TraceG]{LabelX} etex,u*(xmax,ypart(Origine)));
+  fi;
+  if LegendeY=true:
+  label.lrt(btex \useKV[TraceG]{LabelY} etex,u*(xpart(Origine),ymax));
+  fi;
+  enddef;
+}%
+
+\NewDocumentCommand\TraceMultiGraphique{mm}{%
+  % #1 paramètres
+  % #2 Liste fonctions
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \PfCTraceMGCode
+    if Grille:
+    drawoptions(withcolor 0.75white);
+    for k=xpart(Origine) step grillex until xmax:
+    trace u*(k,ymin)--u*(k,ymax);
+    endfor;
+    for k=xpart(Origine) step -grillex until xmin:
+    trace u*(k,ymin)--u*(k,ymax);
+    endfor;
+    for k=ypart(Origine) step grilley until ymax:
+    trace u*(xmin,k)--u*(xmax,k);
+    endfor;
+    for k=ypart(Origine) step -grilley until ymin:
+    trace u*(xmin,k)--u*(xmax,k);
+    endfor;
+    drawoptions();
+    fi;
+    if Graduations:
+    for k=gradx step gradx until bornesupmax:%xmax*gradx/grillex:
+    dotlabel.bot(TEX("\num{"&decimal(k)&"}"),(k*xu+xpart(Origine*cm),ypart(Origine*cm)));
+    endfor;
+    for k=-gradx step -gradx until borneinfmin:%xmin*gradx/grillex:
+    dotlabel.bot(TEX("\num{"&decimal(k)&"}"),(k*xu+xpart(Origine*cm),ypart(Origine*cm)));
+    endfor;
+    for k=grady step grady until ymax*grady/grilley:
+    dotlabel.lft(TEX("\num{"&decimal(k)&"}"),(xpart(Origine*cm),k*yu+ypart(Origine*cm)));
+    endfor;
+    for k=-grady step -grady until ymin*grady/grilley:
+    dotlabel.lft(TEX("\num{"&decimal(k)&"}"),(xpart(Origine*cm),k*yu+ypart(Origine*cm)));
+    endfor;
+    fi;
+%       
+    drawoptions(withpen pencircle scaled(1));
+    drawarrow (u*(0,ymin)--u*(0,ymax)) shifted (u*(xpart(Origine),0));
+    drawarrow (u*(xmin,0)--u*(xmax,0)) shifted (u*(0,ypart(Origine)));
+    label.llft(btex 0 etex,u*Origine);
+    drawoptions();
+    if Vide:
+    clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax));
+    else:
+    DessineCourbes(#1);
+    NommeCourbes(#2);
+    clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax));
+    % 
+    if Code:
+    EffectuerTraces;
+    fi;
+    fi;
+    LegendeCourbe;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\PfCTraceMGCode}]
+    if Grille:
+    drawoptions(withcolor 0.75white);
+    for k=xpart(Origine) step grillex until xmax:
+    trace u*(k,ymin)--u*(k,ymax);
+    endfor;
+    for k=xpart(Origine) step -grillex until xmin:
+    trace u*(k,ymin)--u*(k,ymax);
+    endfor;
+    for k=ypart(Origine) step grilley until ymax:
+    trace u*(xmin,k)--u*(xmax,k);
+    endfor;
+    for k=ypart(Origine) step -grilley until ymin:
+    trace u*(xmin,k)--u*(xmax,k);
+    endfor;
+    drawoptions();
+    fi;
+    if Graduations:
+    for k=gradx step gradx until bornesupmax:%xmax*gradx/grillex:
+    dotlabel.bot(LATEX("\num{"&decimal(k)&"}"),(k*xu+xpart(Origine*cm),ypart(Origine*cm)));
+    endfor;
+    for k=-gradx step -gradx until borneinfmin:%xmin*gradx/grillex:
+    dotlabel.bot(LATEX("\num{"&decimal(k)&"}"),(k*xu+xpart(Origine*cm),ypart(Origine*cm)));
+    endfor;
+    for k=grady step grady until ymax*grady/grilley:
+    dotlabel.lft(LATEX("\num{"&decimal(k)&"}"),(xpart(Origine*cm),k*yu+ypart(Origine*cm)));
+    endfor;
+    for k=-grady step -grady until ymin*grady/grilley:
+    dotlabel.lft(LATEX("\num{"&decimal(k)&"}"),(xpart(Origine*cm),k*yu+ypart(Origine*cm)));
+    endfor;
+    fi;
+%       
+    drawoptions(withpen pencircle scaled(1));
+    drawarrow (u*(0,ymin)--u*(0,ymax)) shifted (u*(xpart(Origine),0));
+    drawarrow (u*(xmin,0)--u*(xmax,0)) shifted (u*(0,ypart(Origine)));
+    label.llft(btex 0 etex,u*Origine);
+    drawoptions();
+    if Vide:
+    clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax));
+    else:
+    DessineCourbes(#1);
+    NommeCourbesPDF(#2);
+    clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax));
+    if Code:
+    EffectuerTraces;
+    fi;
+    fi;
+    LegendeCourbe;
+  \end{mpost}
+  \fi
+}
+
 \def\MPCourbeNew#1{%#2#3#4#5#6{%
   \ifluatex
   \mplibforcehmode

Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPatronPaves.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCPatronPaves.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCPatronPaves.tex	2023-05-19 20:25:04 UTC (rev 67162)
@@ -0,0 +1,246 @@
+\setKVdefault[ClesPatron]{Cube,Arete=1cm,ListeCouleurs={white},Pave=false,Largeur=2cm,Hauteur=1.5cm,Profondeur=1cm,Codes=false}%
+\defKV[ClesPatron]{Traces=\setKV[ClesPatron]{Codes}}%
+
+\newtoks\toklistepatron%
+\def\UpdatetoksPatron#1\nil{\addtotok\toklistepatron{"#1",}}%
+
+\NewDocumentCommand\Patron{om}{%
+  \useKVdefault[ClesPatron]%
+  \setKV[ClesPatron]{#1}%
+  \newtoks\toklistecouleur%
+  \xdef\ListeAvantCouleurs{\useKV[ClesPatron]{ListeCouleurs}}%
+  \readlist*\ListeCouleur{\ListeAvantCouleurs}%
+  \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}%
+  \ifboolKV[ClesPatron]{Pave}{%
+    \toklistepatron{}%
+    \readlist*\PfCListePatron{#2}%
+    \foreachitem\compteur\in\PfCListePatron{\expandafter\UpdatetoksPatron\compteur\nil}%
+    \MPPatronPave{\the\toklistepatron}{\the\toklistecouleur}%
+  }{%
+    \ifboolKV[ClesPatron]{Cube}{%
+      \toklistepatron{}%
+      \readlist*\PfCListePatron{#2}%
+      \foreachitem\compteur\in\PfCListePatron{\expandafter\UpdatetoksPatron\compteur\nil}%
+      \MPPatronCube{\the\toklistepatron}{\the\toklistecouleur}%
+    }{%
+    }%
+  }%
+}%
+
+\def\MPPatronCubeCode{%
+  Arete=\useKV[ClesPatron]{Arete};
+  %
+  pair C[],M[],N[],O[],P[];
+  %
+  color Col[],CoulDefaut;
+  CoulDefaut=white;
+  %
+  boolean Codes;
+  Codes=\useKV[ClesPatron]{Codes};
+  vardef Patron(text t)=
+  nblignes:=-1;
+  nbcol:=0;
+  nbfaces:=0;
+  for p_=t:
+  Long:=length p_;
+  nblignes:=nblignes+1;
+  nbcolonnes:=0;
+  for k=0 upto Long-1:
+  nbcolonnes:=nbcolonnes+1;
+  if substring(k,k+1) of p_="x":
+  nbfaces:=nbfaces+1;
+  nbcol:=nbcol+1;
+  if (unknown Col[nbcol]):
+  else:
+  if Col[nbcol]=white:
+  else:
+  fill ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes))) withcolor Col[nbcol];
+  fi;
+  fi;
+  trace (unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes));
+  C[nbfaces]=(center unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes));
+  M[nbfaces]=point(0) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+  N[nbfaces]=point(1) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+  O[nbfaces]=point(2) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+  P[nbfaces]=point(3) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+  fi;
+  endfor;
+  endfor;
+  enddef;
+  % 
+  vardef EffectuerTraces=
+  if Codes:
+  \useKV[ClesPatron]{Traces};
+  fi;
+  enddef;
+}%
+
+\def\MPPatronCube#1#2{%
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \MPPatronCubeCode
+    %
+    n:=0;
+    for p_=#2:
+    n:=n+1;
+    if color p_:
+    Col[n]=p_;
+    else:
+    Col[n]=CoulDefaut;
+    fi;
+    endfor;
+    %    
+    Patron(#1);
+    EffectuerTraces;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\MPPatronCubeCode;}]
+    %
+    n:=0;
+    for p_=#2:
+    n:=n+1;
+    if color p_:
+    Col[n]=p_;
+    else:
+    Col[n]=CoulDefaut;
+    fi;
+    endfor;
+    %    
+    Patron(#1);
+    EffectuerTraces;
+  \end{mpost}
+  \fi
+}
+
+\def\MPPatronPaveCode{%
+  Largeur=\useKV[ClesPatron]{Largeur};
+  Hauteur=\useKV[ClesPatron]{Hauteur};
+  Profondeur=\useKV[ClesPatron]{Profondeur};
+  % 
+  pair C[],M[],N[],O[],P[];
+  % 
+  color Col[],CoulDefaut;
+  CoulDefaut=white;
+  %
+  boolean Codes;
+  Codes=\useKV[ClesPatron]{Codes};
+  numeric DecalCol[];
+  vardef LectureLargeur(text t)=
+  for p_=t:
+  Long:=length p_;
+  endfor;
+  for k=1 upto Long-1:
+  for p_=t:
+  if substring(k,k+1) of p_="l":
+  DecalCol[k]:=Largeur;
+  elseif substring(k,k+1) of p_="h":
+  DecalCol[k]:=Hauteur;
+  elseif substring(k,k+1) of p_="p":
+  DecalCol[k]:=Profondeur;
+  fi;
+  endfor;
+  endfor;
+  enddef;
+  vardef Patron(text t)=
+  path PathPave;
+  nblignes:=-1;
+  nbcol:=0;
+  nbfaces:=0;
+  for p_=t:
+  Long:=length p_;
+  nbcolonnes:=0;
+  if substring(0,1) of p_="h":
+  YEchelle:=Hauteur;
+  elseif substring(0,1) of p_="l":
+  YEchelle:=Largeur;
+  elseif substring(0,1) of p_="p":
+  YEchelle:=Profondeur;
+  fi;
+  nblignes:=nblignes-YEchelle;
+  for k=1 upto Long-1:
+  if substring(k,k+1) of p_="l":
+  nbcol:=nbcol+1;
+  PathPave:=(unitsquare xscaled Largeur yscaled YEchelle) shifted ((nbcolonnes,nblignes));
+  nbfaces:=nbfaces+1;
+  C[nbfaces]=center PathPave;
+  M[nbfaces]=point(0) of PathPave;
+  N[nbfaces]=point(1) of PathPave;
+  O[nbfaces]=point(2) of PathPave;
+  P[nbfaces]=point(3) of PathPave;
+  elseif substring(k,k+1) of p_="h":
+  nbcol:=nbcol+1;
+  PathPave:=(unitsquare xscaled Hauteur yscaled YEchelle) shifted ((nbcolonnes,nblignes));
+  nbfaces:=nbfaces+1;
+  C[nbfaces]=center PathPave;
+  M[nbfaces]=point(0) of PathPave;
+  N[nbfaces]=point(1) of PathPave;
+  O[nbfaces]=point(2) of PathPave;
+  P[nbfaces]=point(3) of PathPave;
+  elseif substring(k,k+1) of p_="p":
+  nbcol:=nbcol+1;
+  PathPave:=(unitsquare xscaled Profondeur yscaled YEchelle) shifted ((nbcolonnes,nblignes));
+  nbfaces:=nbfaces+1;
+  C[nbfaces]=center PathPave;
+  M[nbfaces]=point(0) of PathPave;
+  N[nbfaces]=point(1) of PathPave;
+  O[nbfaces]=point(2) of PathPave;
+  P[nbfaces]=point(3) of PathPave;
+  fi;
+  if (unknown Col[nbcol]):
+  else:
+  if Col[nbcol]=white:
+  else:
+  fill PathPave withcolor Col[nbcol];
+  fi;
+  fi;
+  trace PathPave;
+  nbcolonnes:=nbcolonnes+DecalCol[k];
+  endfor;
+  endfor;
+  enddef;
+  % 
+  vardef EffectuerTraces=
+  if Codes:
+  \useKV[ClesPatron]{Traces};
+  fi;
+  enddef;
+}%
+
+\def\MPPatronPave#1#2{%
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \MPPatronPaveCode    
+    n:=0;
+    for p_=#2:
+    n:=n+1;
+    if color p_:
+    Col[n]=p_;
+    else:
+    Col[n]=CoulDefaut;
+    fi;
+    endfor;
+    %
+    LectureLargeur(#1);
+    Patron(#1);
+    EffectuerTraces;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\MPPatronPaveCode;}]
+    n:=0;
+    for p_=#2:
+    n:=n+1;
+    if color p_:
+    Col[n]=p_;
+    else:
+    Col[n]=CoulDefaut;
+    fi;
+    endfor;
+    % 
+    LectureLargeur(#1);
+    Patron(#1);
+    EffectuerTraces;
+  \end{mpost}
+  \fi
+}%
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPatronPaves.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresentationGraphique.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresentationGraphique.tex	2023-05-19 20:24:37 UTC (rev 67161)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresentationGraphique.tex	2023-05-19 20:25:04 UTC (rev 67162)
@@ -1,8 +1,10 @@
 %%%
 % Diff\'erentes représentations graphiques
 %%%
-\setKVdefault[TraceG]{Grille=false,Graduations=false,PasGradX=1,PasGradY=1,PasGrilleX=1,PasGrilleY=1,Xmin=-5.5,Xmax=5.5,Xstep=1,Ymin=-5.5,Ymax=5.5,Ystep=1,Bornea=-5.5,Borneb=5.5,LabelX={},LabelY={},LabelC=0.5,NomCourbe={},Origine={(5.5,5.5)},Fonction=false,Points=false,Invisible=false,CouleurPoint=red,CouleurTrace=black,Epaisseur=1,Relie=false,RelieSegment=false,Marque=dot,Code=false,Vide=false,NbPointsCourbe=100}%
+\setKVdefault[TraceG]{Grille=false,Graduations=false,PasGradX=1,PasGradY=1,PasGrilleX=1,PasGrilleY=1,Xmin=-5.5,Xmax=5.5,Xstep=1,Ymin=-5.5,Ymax=5.5,Ystep=1,Bornea=-5.5,Borneb=5.5,LabelX={},LabelY={},LegendeX=false,LegendeY=false,LabelC=0.5,NomCourbe={},Origine={(5.5,5.5)},Fonction=false,Points=false,Invisible=false,CouleurPoint=red,CouleurTrace=black,Epaisseur=1,Relie=false,RelieSegment=false,Marque=dot,Code=false,Vide=false,NbPointsCourbe=100}%
 \defKV[TraceG]{Traces=\setKV[TraceG]{Code}}%
+\defKV[TraceG]{LabelX=\setKV[TraceG]{LegendeX}}%
+\defKV[TraceG]{LabelY=\setKV[TraceG]{LegendeY}}%
 
 \newcommand\TraceGraphique[2][]{%
   \useKVdefault[TraceG]%
@@ -41,11 +43,11 @@
     color colorpoint,colortrace;
     colorpoint=\useKV[TraceG]{CouleurPoint};
     colortrace=\useKV[TraceG]{CouleurTrace};
-    boolean Grille;
+    boolean Grille,Graduations,LegendeX,LegendeY;
     Grille=\useKV[TraceG]{Grille};
-
-    boolean Graduations;
     Graduations=\useKV[TraceG]{Graduations};
+    LegendeX:=\useKV[TraceG]{LegendeX};
+    LegendeY:=\useKV[TraceG]{LegendeY};
 
     boolean Relie;
     Relie=\useKV[TraceG]{Relie};
@@ -122,9 +124,13 @@
     endfor;
     drawoptions();
     fi;
-    %on labelise les axes
+    % on labelise les axes
+    if LegendeX:
     label.urt(btex \useKV[TraceG]{LabelX} etex,(x.u*(xmax-xmin),ypart(Origine)));
+    fi;
+    if LegendeY:
     label.urt(btex \useKV[TraceG]{LabelY} etex,(xpart(Origine),y.u*(ymax-ymin)));
+    fi;
   \end{mplibcode}
   \else
   \mpxcommands{%
@@ -229,13 +235,12 @@
     pair Origine;
     Origine=(xmin,ymin)+\useKV[TraceG]{Origine};
 
-    boolean Grille,Vide;
+    boolean Grille,Vide,Graduations,LegendeX,LegendeY;
     Grille=\useKV[TraceG]{Grille};
     Vide=\useKV[TraceG]{Vide};
-
-    boolean Graduations;
     Graduations=\useKV[TraceG]{Graduations};
-
+    LegendeX:=\useKV[TraceG]{LegendeX};
+    LegendeY:=\useKV[TraceG]{LegendeY};
     vardef sin(expr t) = sind(c*t) enddef;
 
     vardef cos(expr t) = cosd(c*t) enddef;
@@ -332,11 +337,15 @@
     Tangente:=unitvector(direction t of Cb1);
     label(TEX("\useKV[TraceG]{NomCourbe}") rotated angle(Tangente),PT+2mm*(Tangente rotated 90));
     % fin labelisation
+    if \useKV[TraceG]{Code}:
+    \useKV[TraceG]{Traces}
+    fi;
     clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax));
+    if LegendeX:
     label.rt(btex \useKV[TraceG]{LabelX} etex,u*(xmax,ypart(Origine)));
+    fi;
+    if LegendeY:
     label.top(btex \useKV[TraceG]{LabelY} etex,u*(xpart(Origine),ymax));
-    if \useKV[TraceG]{Code}:
-    \useKV[TraceG]{Traces}
     fi;
     fi;
   \end{mplibcode}

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty	2023-05-19 20:24:37 UTC (rev 67161)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty	2023-05-19 20:25:04 UTC (rev 67162)
@@ -2,9 +2,9 @@
 % licence    : Released under the LaTeX Project Public License v1.3c
 % or later, see http://www.latex-project.org/lppl.txtf
 \NeedsTeXFormat{LaTeX2e}%
-\def\filedate{2023/05/15}%
+\def\filedate{2023/05/19}%
 \let\PfCfiledate\filedate%
-\def\fileversion{0.99-z-l}%
+\def\fileversion{0.99-z-m}%
 \let\PfCfileversion\fileversion%
 \ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]%
 
@@ -217,7 +217,7 @@
 \ooalign{$\genfrac{}{}{0pt}{0}{#1}{#2}$\cr\PfCdotover\cr}%
 }%
 
-\NewDocumentCommand\MultiCol{O{}mm}{%
+\NewDocumentCommand\MultiCol{O{}m+m}{%
   \setsepchar[*]{/}%
   \readlist*\ListeNombreCol{#2}%
   \setsepchar[*]{§}%
@@ -571,6 +571,7 @@
 }%\emoticon
 }%\raisebox
 }
+\input{PfCPatronPaves}
 \input{PfCErathostene}
 \input{PfCDobble}
 \input{PfCPavage}



More information about the tex-live-commits mailing list.