texlive[66990] Master/texmf-dist: profcollege (2may23)

commits+karl at tug.org commits+karl at tug.org
Tue May 2 22:28:49 CEST 2023


Revision: 66990
          http://tug.org/svn/texlive?view=revision&revision=66990
Author:   karl
Date:     2023-05-02 22:28:48 +0200 (Tue, 02 May 2023)
Log Message:
-----------
profcollege (2may23)

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/metapost/profcollege/PfCConstantes.mp
    trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalisson.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecDeci.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCDessinGradue.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCNombreAstral.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCPapiers.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCRLE.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCRappelsFormules.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterFraction.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCSquaro.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCTableauxUnites.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCTortueBase.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCVueCubes.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCPavage.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCPavageAvecMotifImage.tex
    trunk/Master/texmf-dist/tex/latex/profcollege/PfCSquaroaprioriold.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/metapost/profcollege/PfCConstantes.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCConstantes.mp	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCConstantes.mp	2023-05-02 20:28:48 UTC (rev 66990)
@@ -18,3 +18,19 @@
 vert=(0,1,0);
 jaune=rouge+vert;
 gris=0.8*white;
+
+%coloriage et lumière
+vardef Hsv(expr CC)=%CC couleur donnée en hsv d'après http://en.wikipedia.org/wiki/HSL_color_space
+  save $;
+  color $;
+  SSw:=floor(redpart(CC)/60);
+  SSh:=SSw mod 6;
+  SSf:=(redpart(CC)/60)-floor(SSw);
+  SSs:=greenpart((CC));
+  SSv:=bluepart((CC));
+  SSp:=SSv*(1-SSs);
+  SSq:=SSv*(1-SSf*SSs);
+  SSt:=SSv*(1-(1-SSf)*SSs);
+  if SSh=0: $=(SSv,SSt,SSp) elseif SSh=1:$=(SSq,SSv,SSp) elseif SSh=2:$=(SSp,SSv,SSt) elseif SSh=3:$=(SSp,SSq,SSv) elseif SSh=4:$=(SSt,SSp,SSv) elseif SSh=5:$=(SSv,SSp,SSq) fi;
+  $
+enddef;

Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp	2023-05-02 20:28:48 UTC (rev 66990)
@@ -14,6 +14,7 @@
 numeric Nblignes; Nblignes:=1;
 pair DebutListe; DebutListe=(0,0);
 boolean NumeroteLignes; NumeroteLignes=false;
+boolean NumeroteFinBloc; NumeroteFinBloc=false;
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% couleurs
 color CoulLignes; CoulLignes:=black;
@@ -1711,6 +1712,10 @@
 _coinprec:=(llcorner $);
 _coinprec:=_coinprec+(0,eb);
 numblocrep:=numblocrep-1;
+if NumeroteFinBloc=true:
+  label(TEX("\footnotesize"&decimal(Nblignes)&""),_coinprec+(-3*eb,2*eb));
+  Nblignes:=Nblignes+1;
+fi;
 $
 enddef;
 

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalisson.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalisson.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalisson.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -100,260 +100,144 @@
   \BuildCalisson{\the\tokcalissonlistetracesg}{\the\tokcalissonlistetracesd}%
 }%
 
+\def\BuildCalissonCode{%
+  boolean Solution;
+  Solution:=\useKV[Calisson]{Solution};
+  % 
+  color CouleurSolution;
+  CouleurSolution:=\useKV[Calisson]{Couleur};
+  %
+  Rayon=\useKV[Calisson]{Rayon};
+  Taille=\useKV[Calisson]{Taille};
+  %  
+  pair A,B,C,D,E,F,O;
+  O=(0,0);
+  path cc;
+  cc=cercles(O,Rayon);
+  D=pointarc(cc,30);
+  E=pointarc(cc,90);
+  F=pointarc(cc,150);
+  A=pointarc(cc,210);
+  B=pointarc(cc,270);
+  C=pointarc(cc,330);
+  path Gauche,Droit,Haut,Bas,TopGauche,BasDroit;
+  Gauche=F--A--B;
+  Droit=E--D--C;
+  Haut=F--E--D;
+  Bas=A--B--C;
+  TopGauche=E--F--A;
+  BasDroit=D--C--B;
+  %  
+  pair Hor,Ver,Horn;
+  Hor=(1/Taille)[E,F];
+  Ver=rotation(Hor,E,60);
+  Horn=rotation(Hor,E,120);
+  % On positionne les points
+  pair M[];
+  n=0;
+  % Partie Gauche -> ok
+  for k=0 upto Taille-1:
+  for l=0 upto Taille:
+  n:=n+1;
+  M[n]=E+k*(Ver-E)+l*(Hor-E);
+  % dotlabel.top(decimal(n),M[n]);
+  endfor;
+  endfor;
+  for k=Taille upto 2*Taille-1:
+  for l=0 upto (2*Taille-1-k):
+  n:=n+1;
+  M[n]=E+k*(Ver-E)+l*(Hor-E);
+  % dotlabel.top(decimal(n),M[n]);
+  endfor;
+  endfor;
+  % Partie Droite -> ok
+  for k=1 upto Taille:
+  n:=n+1;
+  M[n]=E+k*(Horn-E);
+  % dotlabel.top(decimal(n),M[n]);
+  endfor;
+  for k=1 upto Taille-1:
+  for l=0 upto Taille:
+  n:=n+1;
+  M[n]=E+k*(Ver-E)+l*(Horn-E);
+  % dotlabel.top(decimal(n),M[n]);
+  endfor;
+  endfor;
+  for k=Taille upto 2*Taille-1:
+  for l=0 upto (2*Taille-1-k):
+  n:=n+1;
+  M[n]=E+k*(Ver-E)+l*(Horn-E);
+  % dotlabel.top(decimal(n),M[n]);
+  endfor;
+  endfor;
+  % 
+  %
+  string Retiens;
+  Retiens="";
+  %
+  pair Depla;
+  Depla:=Hor;
+  %  
+  vardef LesTracesg(text t)=
+  trace polygone(A,B,C,D,E,F) withpen pencircle scaled 2;
+  for k=1 upto 2*Taille-1:
+  trace (point(k*length Gauche/(2*Taille)) of Gauche)--(point(k*length Droit/(2*Taille)) of Droit) dashed evenly;
+  trace (point(k*length Haut/(2*Taille)) of Haut)--(point(k*length Bas/(2*Taille)) of Bas) dashed evenly;
+  trace (point(k*length TopGauche/(2*Taille)) of TopGauche)--(point(k*length BasDroit/(2*Taille)) of BasDroit) dashed evenly;
+  endfor;
+  n:=0;
+  for p_=t:
+  n:=n+1;
+  for d=1 upto 3:
+  Retiens:=substring(d-1,d) of p_;
+  if d=1:Depla:=Hor
+  elseif d=2:Depla:=Ver
+  else : Depla:=Horn
+  fi;
+  if (Retiens="0") or (Retiens="f"):
+  elseif Retiens="t":
+  trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2;
+  elseif Retiens="s":
+  if Solution:
+  trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2 withcolor CouleurSolution;
+  fi;
+  fi;
+  endfor;
+  endfor;
+  enddef;
+  % 
+  vardef LesTracesd(text t)=
+  for p_=t:
+  n:=n+1;
+  for d=1 upto 3:
+  Retiens:=substring(d-1,d) of p_;
+  if d=1:Depla:=Horn
+  elseif d=2:Depla:=Ver
+  else : Depla:=Hor
+  fi;
+  if (Retiens="0") or (Retiens="f"):
+  elseif Retiens="t":
+  trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2;
+  elseif Retiens="s":
+  if Solution:
+  trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2 withcolor CouleurSolution;
+  fi;
+  fi;
+  endfor;
+  endfor;
+  enddef;
+}
+
 \NewDocumentCommand\BuildCalisson{m m}{%
   \ifluatex
   \mplibforcehmode
   \begin{mplibcode}
-    boolean Solution;
-    Solution:=\useKV[Calisson]{Solution};
-
-    color CouleurSolution;
-    CouleurSolution:=\useKV[Calisson]{Couleur};
-    
-    Rayon=\useKV[Calisson]{Rayon};
-    Taille=\useKV[Calisson]{Taille};
-    
-    pair A,B,C,D,E,F,O;
-    O=(0,0);
-    path cc;
-    cc=cercles(O,Rayon);
-    D=pointarc(cc,30);
-    E=pointarc(cc,90);
-    F=pointarc(cc,150);
-    A=pointarc(cc,210);
-    B=pointarc(cc,270);
-    C=pointarc(cc,330);
-    trace polygone(A,B,C,D,E,F) withpen pencircle scaled 2;
-    path Gauche,Droit,Haut,Bas,TopGauche,BasDroit;
-    Gauche=F--A--B;
-    Droit=E--D--C;
-    Haut=F--E--D;
-    Bas=A--B--C;
-    TopGauche=E--F--A;
-    BasDroit=D--C--B;
-    for k=1 upto 2*Taille-1:
-    trace (point(k*length Gauche/(2*Taille)) of Gauche)--(point(k*length Droit/(2*Taille)) of Droit) dashed evenly;
-    trace (point(k*length Haut/(2*Taille)) of Haut)--(point(k*length Bas/(2*Taille)) of Bas) dashed evenly;
-    trace (point(k*length TopGauche/(2*Taille)) of TopGauche)--(point(k*length BasDroit/(2*Taille)) of BasDroit) dashed evenly;
-    endfor;
-    
-    pair Hor,Ver,Horn;
-    Hor=(1/Taille)[E,F];
-    Ver=rotation(Hor,E,60);
-    Horn=rotation(Hor,E,120);
-
-    % On positionne les points
-    pair M[];
-    n=0;
-    %Partie Gauche -> ok
-    for k=0 upto Taille-1:
-    for l=0 upto Taille:
-    n:=n+1;
-    M[n]=E+k*(Ver-E)+l*(Hor-E);
-    %dotlabel.top(decimal(n),M[n]);
-    endfor;
-    endfor;
-    for k=Taille upto 2*Taille-1:
-    for l=0 upto (2*Taille-1-k):
-    n:=n+1;
-    M[n]=E+k*(Ver-E)+l*(Hor-E);
-    %dotlabel.top(decimal(n),M[n]);
-    endfor;
-    endfor;
-    % Partie Droite -> ok
-    for k=1 upto Taille:
-    n:=n+1;
-    M[n]=E+k*(Horn-E);
-    %dotlabel.top(decimal(n),M[n]);
-    endfor;
-    for k=1 upto Taille-1:
-    for l=0 upto Taille:
-    n:=n+1;
-    M[n]=E+k*(Ver-E)+l*(Horn-E);
-    %dotlabel.top(decimal(n),M[n]);
-    endfor;
-    endfor;
-    for k=Taille upto 2*Taille-1:
-    for l=0 upto (2*Taille-1-k):
-    n:=n+1;
-    M[n]=E+k*(Ver-E)+l*(Horn-E);
-    %dotlabel.top(decimal(n),M[n]);
-    endfor;
-    endfor;
-    %
-    
-    string Retiens;
-    Retiens="";
-
-    pair Depla;
-    Depla:=Hor;
-    
-    vardef LesTracesg(text t)=
-    n:=0;
-    for p_=t:
-    n:=n+1;
-    for d=1 upto 3:
-    Retiens:=substring(d-1,d) of p_;
-    if d=1:Depla:=Hor
-    elseif d=2:Depla:=Ver
-    else : Depla:=Horn
-    fi;
-    if (Retiens="0") or (Retiens="f"):
-    elseif Retiens="t":
-    trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2;
-    elseif Retiens="s":
-    if Solution:
-    trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2 withcolor CouleurSolution;
-    fi;
-    fi;
-    endfor;
-    endfor;
-    enddef;
-
-    vardef LesTracesd(text t)=
-    for p_=t:
-    n:=n+1;
-    for d=1 upto 3:
-    Retiens:=substring(d-1,d) of p_;
-    if d=1:Depla:=Horn
-    elseif d=2:Depla:=Ver
-    else : Depla:=Hor
-    fi;
-    if (Retiens="0") or (Retiens="f"):
-    elseif Retiens="t":
-    trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2;
-    elseif Retiens="s":
-    if Solution:
-    trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2 withcolor CouleurSolution;
-    fi;
-    fi;
-    endfor;
-    endfor;
-    enddef;
-    
+    \BuildCalissonCode
     LesTracesg(#1);
     LesTracesd(#2);
   \end{mplibcode}
   \else
-  \begin{mpost}[mpsettings={boolean Solution; Solution:=\useKV[Calisson]{Solution}; Rayon=\useKV[Calisson]{Rayon};Taille=\useKV[Calisson]{Taille};color CouleurSolution; CouleurSolution:=\useKV[Calisson]{Couleur};}]
-    pair A,B,C,D,E,F,O;
-    O=(0,0);
-    path cc;
-    cc=cercles(O,Rayon);
-    D=pointarc(cc,30);
-    E=pointarc(cc,90);
-    F=pointarc(cc,150);
-    A=pointarc(cc,210);
-    B=pointarc(cc,270);
-    C=pointarc(cc,330);
-    trace polygone(A,B,C,D,E,F) withpen pencircle scaled 2;
-    path Gauche,Droit,Haut,Bas,TopGauche,BasDroit;
-    Gauche=F--A--B;
-    Droit=E--D--C;
-    Haut=F--E--D;
-    Bas=A--B--C;
-    TopGauche=E--F--A;
-    BasDroit=D--C--B;
-    for k=1 upto 2*Taille-1:
-    trace (point(k*length Gauche/(2*Taille)) of Gauche)--(point(k*length Droit/(2*Taille)) of Droit) dashed evenly;
-    trace (point(k*length Haut/(2*Taille)) of Haut)--(point(k*length Bas/(2*Taille)) of Bas) dashed evenly;
-    trace (point(k*length TopGauche/(2*Taille)) of TopGauche)--(point(k*length BasDroit/(2*Taille)) of BasDroit) dashed evenly;
-    endfor;
-    
-    pair Hor,Ver,Horn;
-    Hor=(1/Taille)[E,F];
-    Ver=rotation(Hor,E,60);
-    Horn=rotation(Hor,E,120);
-
-    % On positionne les points
-    pair M[];
-    n=0;
-    %Partie Gauche -> ok
-    for k=0 upto Taille-1:
-    for l=0 upto Taille:
-    n:=n+1;
-    M[n]=E+k*(Ver-E)+l*(Hor-E);
-    %dotlabel.top(decimal(n),M[n]);
-    endfor;
-    endfor;
-    for k=Taille upto 2*Taille-1:
-    for l=0 upto (2*Taille-1-k):
-    n:=n+1;
-    M[n]=E+k*(Ver-E)+l*(Hor-E);
-    %dotlabel.top(decimal(n),M[n]);
-    endfor;
-    endfor;
-    % Partie Droite -> ok
-    for k=1 upto Taille:
-    n:=n+1;
-    M[n]=E+k*(Horn-E);
-    %dotlabel.top(decimal(n),M[n]);
-    endfor;
-    for k=1 upto Taille-1:
-    for l=0 upto Taille:
-    n:=n+1;
-    M[n]=E+k*(Ver-E)+l*(Horn-E);
-    %dotlabel.top(decimal(n),M[n]);
-    endfor;
-    endfor;
-    for k=Taille upto 2*Taille-1:
-    for l=0 upto (2*Taille-1-k):
-    n:=n+1;
-    M[n]=E+k*(Ver-E)+l*(Horn-E);
-    %dotlabel.top(decimal(n),M[n]);
-    endfor;
-    endfor;
-    %
-    
-    string Retiens;
-    Retiens="";
-
-    pair Depla;
-    Depla:=Hor;
-    
-    vardef LesTracesg(text t)=
-    n:=0;
-    for p_=t:
-    n:=n+1;
-    for d=1 upto 3:
-    Retiens:=substring(d-1,d) of p_;
-    if d=1:Depla:=Hor
-    elseif d=2:Depla:=Ver
-    else : Depla:=Horn
-    fi;
-    if (Retiens="0") or (Retiens="f"):
-    elseif Retiens="t":
-    trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2;
-    elseif Retiens="s":
-    if Solution:
-    trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2 withcolor CouleurSolution;
-    fi;
-    fi;
-    endfor;
-    endfor;
-    enddef;
-
-    vardef LesTracesd(text t)=
-    for p_=t:
-    n:=n+1;
-    for d=1 upto 3:
-    Retiens:=substring(d-1,d) of p_;
-    if d=1:Depla:=Horn
-    elseif d=2:Depla:=Ver
-    else : Depla:=Hor
-    fi;
-    if (Retiens="0") or (Retiens="f"):
-    elseif Retiens="t":
-    trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2;
-    elseif Retiens="s":
-    if Solution:
-    trace (chemin(Depla,E) shifted (M[n]-E)) withpen pencircle scaled 2 withcolor CouleurSolution;
-    fi;
-    fi;
-    endfor;
-    endfor;
-    enddef;
-    
+  \begin{mpost}[mpsettings={\BuildCalissonCode}]
     LesTracesg(#1);
     LesTracesd(#2);
   \end{mpost}

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -8,7 +8,7 @@
   text fill,%
   width=\largeurcarte,%
   height=\hauteurcarte,%
-  arc=5pt,%
+  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);%   
@@ -39,6 +39,7 @@
 }%
 
 \newcommand\PfCTexteJai{J'ai}
+\newcommand\PfCTexteJesuis{Je suis\dots}
 \newcommand\PfCTexteQuia{Qui a ?}
 
 \makeatletter
@@ -49,7 +50,7 @@
   text fill,%
   width=\largeurcarte,%
   height=\hauteurcarte,%
-  arc=5pt,%
+  arc=\PfCRayonArc,%\useKV[Cards]{RayonArc},%
   underlay={%
     \ifboolKV[Cards]{BackgroundAv}{%
       \begin{tcbclipinterior}
@@ -64,19 +65,33 @@
   },%
   overlay unbroken and first={%
     \coordinate[yshift=-0.5\hauteurtitre] (A1) at (frame.north west);
-    \coordinate[yshift=0\hauteurtitre] (S3) at (frame.center);
+    \ifboolKV[Cards]{Eleve}{%
+      \coordinate[yshift=0.1\hauteurcarte] (S3) at (frame.center);
+      \coordinate[yshift=-0.1\hauteurcarte] (S5) at (frame.center);
+    }{%
+      \coordinate (S3) at (frame.center);
+      \coordinate (S5) at (frame.center);
+    }%
     \coordinate[yshift=3mm] (C3) at (frame.south);
     \coordinate[xshift=\largeurcarte/2] (A3) at (A1);
+    %Partie Haute
     \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleur] (T1) at (A3){};
-    \node[TexteCouleur] (T1a) at (T1){\Large \PfCTexteJai};
-    \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleur] (T2) at (S3){};
-    \node[TexteCouleur] (T2a) at (T2){\Large \PfCTexteQuia};
+    \node[TexteCouleur] at (T1){\Large \PfCTexteJai};
     \node[minimum height=1cm,text width=\largeurcarte-6mm] (PointTexte1) at ($(A3)!0.5!(S3)$) {\begin{minipage}{\largeurcarte-6mm}%
         \begin{center}%
           #1%
         \end{center}%
-      \end{minipage}};
-    \node[minimum height=1cm,text width=\largeurcarte-6mm] (PointTexte2) at ($(C3)!0.5!(S3)$) {\begin{minipage}{\largeurcarte-6mm}%
+      \end{minipage}%
+    };
+    % Partie Milieu
+    \ifboolKV[Cards]{Eleve}{%
+      \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleur] (T3) at (S3){};
+    \node[TexteCouleur] at (T3){\Large \PfCTexteJesuis};
+    }{}
+    % Partie Basse
+    \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleur] (T2) at (S5){};
+    \node[TexteCouleur] at (T2){\Large \PfCTexteQuia};
+    \node[minimum height=1cm,text width=\largeurcarte-6mm] (PointTexte2) at ($(C3)!0.5!(S5)$) {\begin{minipage}{\largeurcarte-6mm}%
         \begin{center}%
           #2%
         \end{center}%
@@ -85,7 +100,7 @@
   colback=white
 }%
 %
-\newtcolorbox{MyboxJQAr}{%
+\newtcolorbox{MyboxJQAr}[1]{%
   enhanced,%
   nobeforeafter,%
   left=0pt,right=0pt,top=0pt,%
@@ -92,9 +107,9 @@
   text fill,%
   width=\largeurcarte,%
   height=\hauteurcarte,%
-  arc=5pt,%
+  arc=\PfCRayonArc,%
   underlay={%
-    \ifboolKV[Cards]{BackgroundAv}{%
+    \ifboolKV[Cards]{BackgroundAr}{%
       \begin{tcbclipinterior}
         \node[anchor=center,opacity=1]
         at (interior.center) {%
@@ -105,6 +120,18 @@
       \end{tcbclipinterior}%
     }{}%
   },%
+  overlay unbroken and first={%
+    \ifboolKV[Cards]{AfficheTheme}{%
+      % \coordinate[yshift=-0.5\hauteurtitre] (A) at (frame.north);%
+      \coordinate[yshift=-2.5mm] (A) at (frame.north);%
+      \node[anchor=north,rounded corners,draw=black,rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleur] at (A){\begin{minipage}{\largeurcarte-6mm}%
+         \begin{center}%
+        #1%
+         \end{center}%
+         \end{minipage}
+      };%
+    }{}%
+  },%
   colback=white
 }%
 \makeatother
@@ -118,7 +145,7 @@
   text fill,%
   width=\largeurcarte,%
   height=\hauteurcarte,%
-  arc=5pt,%
+  arc=\PfCRayonArc,%
   colback=white,%
   underlay={%
     \ifboolKV[Cards]{BackgroundAv}{%
@@ -151,7 +178,7 @@
   text fill,%
   width=\largeurcarte,%
   height=\hauteurcarte,%
-  arc=5pt,%
+  arc=\PfCRayonArc,%
   colback=white,%
   underlay={%
     \ifboolKV[Cards]{BackgroundAr}{%
@@ -183,7 +210,7 @@
   text fill,%
   width=\largeurcarte,%
   height=\hauteurcarte,%
-  arc=5pt,%
+  arc=\PfCRayonArc,%
   colback=white,%
   #1
 }%
@@ -197,6 +224,7 @@
 
 \newlength{\margeh}%
 \newlength{\margev}%
+\newlength{\PfCRayonArc}%
 
 \newlength{\PfCCardsH}%pour retenir en cas de décalage sur une page paire
 \newlength{\PfCCardsEcartH}%Pour décaler sur une page paire
@@ -233,6 +261,7 @@
     \coordinate[xshift=\largeurcards] (D2) at (D1);%
     \coordinate[xshift=\largeurcards] (C3) at (C2);%
     \coordinate[xshift=\largeurcards] (D3) at (D2);%
+    \ifboolKV[Cards]{TrameVisible}{%
     \draw (A)--(B);%
     \draw (A1)--(B1);%
     \draw (A2)--(B2);%
@@ -242,6 +271,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);%
@@ -301,11 +331,12 @@
 }{}%
 
 \setKVdefault[Cards]{Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,Landscape=false,Couleur=Cornsilk,Theme=Th\'eor\`eme\\de
-  Pythagore,ThemeSol=Solution,Trame=false,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,BackgroundAv=false,BackgroundAr=false,ImageAv=4813762.jpg,ImageAr=4813762.jpg,AffichageSolution=true,SolutionSeule=false,%
+  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 le trivial
   Trivial=false,Symboles={\faInfinity,\faSignal,\faProjectDiagram,\faHiking,\faRuler,\faLockOpen}
 }%
-
+\defKV[Cards]{ThemeJaiQuiA=\setKV[Cards]{AfficheTheme}}
+% 
 \NewDocumentCommand\Cartes{o +m}{%[2][]{%
   \useKVdefault[Cards]%
   \setKV[Cards]{#1}%
@@ -322,15 +353,16 @@
   }{%
     \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
     \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
-    \setlength{\largeurcards}{65mm}%
-    \setlength{\hauteurcards}{95mm}%
+    \ifboolKV[Cards]{Jointes}{\setlength{\largeurcards}{\largeurcarte}}{\setlength{\largeurcards}{65mm}}%
+    \ifboolKV[Cards]{Jointes}{\setlength{\hauteurcards}{\hauteurcarte}}{\setlength{\hauteurcards}{95mm}}%
     \setlength{\margeh}{(210mm-3\largeurcards)/2}%
-    \setlength{\margev}{(297mm-3\hauteurcards)/2}%
+    \setlength{\margev}{(297mm-3\hauteurcards)/2}
   }%
   \setlength{\hauteurtitre}{\fpeval{\useKV[Cards]{HauteurTheme}}mm}%
   \setlength{\largeurtitre}{\fpeval{(\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}-9)/2}mm}%
   \colorlet{TexteCouleur}{black}%
   \colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}%
+  \setlength{\PfCRayonArc}{\useKV[Cards]{RayonArc}}%
   \ifboolKV[Cards]{Trivial}{%
     \xdef\PfCListeSymbolTrivial{\useKV[Cards]{Symboles}}%
     \setsepchar{,}\readlist*\ListeSymbolesTrivial{\PfCListeSymbolTrivial}%
@@ -442,20 +474,35 @@
           \begin{Trame}
             \multido{\i=1+1}{3}{%
               \node at (Carte\i) {%
-                \begin{MyboxJQAr}%
-                \end{MyboxJQAr}%
+                \ifboolKV[Cards]{AfficheTheme}{%
+                  \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
+                  \end{MyboxJQAr}%
+                }{%
+                  \begin{MyboxJQAr}{}%
+                  \end{MyboxJQAr}%
+                }%
               };%
             }%
             \multido{\i=4+1}{3}{%
               \node at (Carte\i) {%
-                \begin{MyboxJQAr}%
-                \end{MyboxJQAr}%
+                \ifboolKV[Cards]{AfficheTheme}{%
+                  \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
+                  \end{MyboxJQAr}%
+                }{%
+                  \begin{MyboxJQAr}{}%
+                  \end{MyboxJQAr}%
+                }%
               };%
             }%
             \multido{\i=7+1}{3}{%
               \node at (Carte\i) {%
-                \begin{MyboxJQAr}%
-                \end{MyboxJQAr}%
+                \ifboolKV[Cards]{AfficheTheme}{%
+                  \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
+                  \end{MyboxJQAr}%
+                }{%
+                  \begin{MyboxJQAr}{}%
+                  \end{MyboxJQAr}%
+                }%
               };%
             }%
           \end{Trame}%
@@ -466,9 +513,13 @@
           %%
         \end{MyboxJQ}%
         \ifboolKV[Cards]{AffichageSolution}{%
-          \begin{MyboxJQAr}%
-            %% 
-          \end{MyboxJQAr}%
+          \ifboolKV[Cards]{AfficheTheme}{%
+            \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}%
+            \end{MyboxJQAr}%
+          }{%
+            \begin{MyboxJQAr}{}%
+            \end{MyboxJQAr}%
+          }%
         }{}%
       }%
     }{%

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecDeci.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecDeci.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecDeci.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -1,7 +1,7 @@
 %%%
 % Décomposition décimale
 %%
-\setKVdefault[DecompDeci]{Parentheses,Colore=false,CouleurU=Blue,CouleurD=Red,CouleurC=Green,Fleches=false,Details=false}
+\setKVdefault[DecompDeci]{Parentheses,Colore=false,CouleurU=Blue,CouleurD=Red,CouleurC=Green,Fleches=false,Details=false,ResultatSeul=false,SansMul=false}
 
 \newcounter{PfCNbDecDeci}
 \setcounter{PfCNbDecDeci}{0}
@@ -26,125 +26,146 @@
     \modulo{\fpeval{\PfCNombrePuisMax}}{3}%
     \xintifboolexpr{\remainder==0}{%
       \xdef\PfCDecDeciEcart{0}
-    }{\xintifboolexpr{\remainder==1}{\xdef\PfCDecDeciEcart{1}}{\xdef\PfCDecDeciEcart{2}}}
-    \ifboolKV[DecompDeci]{Fleches}{%
-      \colorlet{oldcolor}{black}%
-      % On affiche
-      \begin{center}
-        \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax}}}\do{%
-          \StrChar{#2}{##1}[\PfCNombreChiffre]%
+    }{\xintifboolexpr{\remainder==1}{\xdef\PfCDecDeciEcart{1}}{\xdef\PfCDecDeciEcart{2}}}%
+    %%%%
+    \ifboolKV[DecompDeci]{SansMul}{%
+      \ensuremath{%
+        \ifboolKV[DecompDeci]{ResultatSeul}{}{\num{#2}=}%
+        \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
+          \StrChar{#2}{##1}[\PfCNombreChiffre]
           \modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
-          \xintifboolexpr{\remainder==0}{%
-            \color{\useKV[DecompDeci]{CouleurU}}\tikzmarknode[anchor=south,inner ysep=2pt]{DDA-\thePfCNbDecDeci-##1}{\PfCNombreChiffre}{}\xintifForLast{}{\,\color{oldcolor}}}{%
-            \xintifboolexpr{\remainder==1}{%
-              \color{\useKV[DecompDeci]{CouleurC}}\tikzmarknode[anchor=south,inner ysep=2pt]{DDA-\thePfCNbDecDeci-##1}{\PfCNombreChiffre}{}}{%
-              \color{\useKV[DecompDeci]{CouleurD}}\tikzmarknode[anchor=south,inner ysep=2pt]{DDA-\thePfCNbDecDeci-##1}{\PfCNombreChiffre}{}%
+          % \colorlet{oldcolor}{.}
+          %\xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}}{%
+          %  \xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurC}}}{%
+          %    \color{\useKV[DecompDeci]{CouleurD}}%
+          %  }%
+          %}%
+          \xintifboolexpr{\PfCNombreChiffre==0}{}{%
+            \num{\fpeval{\PfCNombreChiffre*10^(\PfCNombrePuisMax-##1)}}%\color{oldcolor}%
+            \xintifForLast{}{+}%
+          }%
+        }%
+      }%
+    }{%
+      \ifboolKV[DecompDeci]{Fleches}{%
+        \colorlet{oldcolor}{black}%
+        % On affiche
+        \begin{center}
+          \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax}}}\do{%
+            \StrChar{#2}{##1}[\PfCNombreChiffre]%
+            \modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
+            \xintifboolexpr{\remainder==0}{%
+              \color{\useKV[DecompDeci]{CouleurU}}\tikzmarknode[anchor=south,inner ysep=2pt]{DDA-\thePfCNbDecDeci-##1}{\PfCNombreChiffre}{}\xintifForLast{}{\,\color{oldcolor}}}{%
+              \xintifboolexpr{\remainder==1}{%
+                \color{\useKV[DecompDeci]{CouleurC}}\tikzmarknode[anchor=south,inner ysep=2pt]{DDA-\thePfCNbDecDeci-##1}{\PfCNombreChiffre}{}}{%
+                \color{\useKV[DecompDeci]{CouleurD}}\tikzmarknode[anchor=south,inner ysep=2pt]{DDA-\thePfCNbDecDeci-##1}{\PfCNombreChiffre}{}%
+              }%
             }%
-          }%
-        }\color{oldcolor}%
-        
-        \vspace*{3em}
-        
-        \ifboolKV[DecompDeci]{Details}{%
+          }\color{oldcolor}%
+          
+          \vspace*{3em}
+          
+          \ifboolKV[DecompDeci]{Details}{%
+            \ensuremath{%
+              \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
+                \StrChar{#2}{##1}[\PfCNombreChiffre]
+                \modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
+                \colorlet{oldcolor}{.}
+                \xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}}{%
+                  \xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurC}}}{%
+                    \color{\useKV[DecompDeci]{CouleurD}}%
+                  }%
+                }%
+                \xintifboolexpr{\PfCNombreChiffre==0}{}{%
+                  \tikzmarknode[anchor=north,inner ysep=2pt]{DDC-\thePfCNbDecDeci-##1}{\boxed{\num{\fpeval{\PfCNombreChiffre*10^(\PfCNombrePuisMax-##1)}}}}\color{oldcolor}%
+                  \xintifForLast{}{+}%
+                }%
+              }%
+            }%
+            
+            \vspace*{3em}
+            
+          }{}%
+          
           \ensuremath{%
             \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
               \StrChar{#2}{##1}[\PfCNombreChiffre]
-              \modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
-              \colorlet{oldcolor}{.}
-              \xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}}{%
-                \xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurC}}}{%
-                  \color{\useKV[DecompDeci]{CouleurD}}%
+              \xintifboolexpr{\PfCNombreChiffre==0}{}{%
+                \modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
+                \colorlet{oldcolor}{.}
+                \xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}}{%
+                  \xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurC}}}{%
+                    \color{\useKV[DecompDeci]{CouleurD}}%
+                  }%
                 }%
-              }%
-              \xintifboolexpr{\PfCNombreChiffre==0}{}{%
-                \tikzmarknode[anchor=north,inner ysep=2pt]{DDC-\thePfCNbDecDeci-##1}{\boxed{\num{\fpeval{\PfCNombreChiffre*10^(\PfCNombrePuisMax-##1)}}}}\color{oldcolor}%
+                \tikzmarknode[anchor=north,inner ysep=2pt]{DDB-\thePfCNbDecDeci-##1}{\boxed{\PfCNombreChiffre\times\num{\fpeval{10^(\PfCNombrePuisMax-##1)}}}}{}\color{oldcolor}%
                 \xintifForLast{}{+}%
               }%
             }%
           }%
-
-          \vspace*{3em}
-          
-        }{}%
-        
-        \ensuremath{%
+        \end{center}
+        \begin{tikzpicture}[remember picture,overlay]
           \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
-            \StrChar{#2}{##1}[\PfCNombreChiffre]
-            \xintifboolexpr{\PfCNombreChiffre==0}{}{%
-              \modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
-              \colorlet{oldcolor}{.}
-              \xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}}{%
-                \xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurC}}}{%
-                  \color{\useKV[DecompDeci]{CouleurD}}%
-                }%
+            \StrChar{#2}{##1}[\PfCNombreChiffre]%
+            \modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
+            \xintifboolexpr{\remainder==0}{%
+              \colorlet{PfCDecDeciColor}{\useKV[DecompDeci]{CouleurU}}}{%
+              \xintifboolexpr{\remainder==1}{%
+                \colorlet{PfCDecDeciColor}{\useKV[DecompDeci]{CouleurC}}}{%
+                \colorlet{PfCDecDeciColor}{\useKV[DecompDeci]{CouleurD}}%
               }%
-              \tikzmarknode[anchor=north,inner ysep=2pt]{DDB-\thePfCNbDecDeci-##1}{\boxed{\PfCNombreChiffre\times\num{\fpeval{10^(\PfCNombrePuisMax-##1)}}}}{}\color{oldcolor}%
-              \xintifForLast{}{+}%
             }%
-          }%
-        }%
-      \end{center}
-      \begin{tikzpicture}[remember picture,overlay]
-        \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
-          \StrChar{#2}{##1}[\PfCNombreChiffre]%
-          \modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
-          \xintifboolexpr{\remainder==0}{%
-            \colorlet{PfCDecDeciColor}{\useKV[DecompDeci]{CouleurU}}}{%
-            \xintifboolexpr{\remainder==1}{%
-              \colorlet{PfCDecDeciColor}{\useKV[DecompDeci]{CouleurC}}}{%
-              \colorlet{PfCDecDeciColor}{\useKV[DecompDeci]{CouleurD}}%
+            \ifboolKV[DecompDeci]{Details}{%
+              \xintifboolexpr{\PfCNombreChiffre>0}{%
+                \draw[-stealth,PfCDecDeciColor] (pic cs:DDA-\thePfCNbDecDeci-##1) to (pic cs:DDC-\thePfCNbDecDeci-##1);
+                \node (DDD-\thePfCNbDecDeci-##1) at ($(pic cs:DDC-\thePfCNbDecDeci-##1)!0.35!(pic cs:DDB-\thePfCNbDecDeci-##1)$) {};
+                \draw[-stealth,PfCDecDeciColor] (DDD-\thePfCNbDecDeci-##1) to (pic cs:DDB-\thePfCNbDecDeci-##1);
+              }{}%
+            }{%
+              \xintifboolexpr{\PfCNombreChiffre>0}{%
+                \draw[-stealth,PfCDecDeciColor] (pic cs:DDA-\thePfCNbDecDeci-##1) to (pic cs:DDB-\thePfCNbDecDeci-##1);
+              }{}%
             }%
           }%
-          \ifboolKV[DecompDeci]{Details}{%
-            \xintifboolexpr{\PfCNombreChiffre>0}{%
-              \draw[-stealth,PfCDecDeciColor] (pic cs:DDA-\thePfCNbDecDeci-##1) to (pic cs:DDC-\thePfCNbDecDeci-##1);
-              \node (DDD-\thePfCNbDecDeci-##1) at ($(pic cs:DDC-\thePfCNbDecDeci-##1)!0.35!(pic cs:DDB-\thePfCNbDecDeci-##1)$) {};
-              \draw[-stealth,PfCDecDeciColor] (DDD-\thePfCNbDecDeci-##1) to (pic cs:DDB-\thePfCNbDecDeci-##1);
-            }{}%
-          }{%
-            \xintifboolexpr{\PfCNombreChiffre>0}{%
-              \draw[-stealth,PfCDecDeciColor] (pic cs:DDA-\thePfCNbDecDeci-##1) to (pic cs:DDB-\thePfCNbDecDeci-##1);
-            }{}%
-          }%
-        }%
-      \end{tikzpicture}
-    }{%
-      \ifboolKV[DecompDeci]{Colore}{%
-        \colorlet{oldcolor}{black}%
-        \ensuremath{%
-          \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax}}}\do{%
-            \StrChar{#2}{##1}[\PfCNombreChiffre]%
-            \modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
-            \xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}\PfCNombreChiffre\xintifForLast{}{\,\color{oldcolor}}}{%
-              \xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurC}}\PfCNombreChiffre}{%
-                \color{\useKV[DecompDeci]{CouleurD}}\PfCNombreChiffre%
+        \end{tikzpicture}
+      }{%
+        \ifboolKV[DecompDeci]{Colore}{%
+          \colorlet{oldcolor}{black}%
+          \ensuremath{%
+            \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax}}}\do{%
+              \StrChar{#2}{##1}[\PfCNombreChiffre]%
+              \modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
+              \xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}\PfCNombreChiffre\xintifForLast{}{\,\color{oldcolor}}}{%
+                \xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurC}}\PfCNombreChiffre}{%
+                  \color{\useKV[DecompDeci]{CouleurD}}\PfCNombreChiffre%
+                }%
               }%
-            }%
-          }\color{oldcolor}%
-          =        
-          \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
-            \StrChar{#2}{##1}[\PfCNombreChiffre]
-            \xintifboolexpr{\PfCNombreChiffre==0}{}{%
-              \modulo{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis-##1}}{3}
-              \colorlet{oldcolor}{.}
-              \xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}}{%
-                \xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurD}}}{%
-                  \color{\useKV[DecompDeci]{CouleurC}}%
+            }\color{oldcolor}%
+            =        
+            \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
+              \StrChar{#2}{##1}[\PfCNombreChiffre]
+              \xintifboolexpr{\PfCNombreChiffre==0}{}{%
+                \modulo{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis-##1}}{3}
+                \colorlet{oldcolor}{.}
+                \xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}}{%
+                  \xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurD}}}{%
+                    \color{\useKV[DecompDeci]{CouleurC}}%
+                  }%
                 }%
+                \boxed{\PfCNombreChiffre\times\num{\fpeval{10^(\PfCNombrePuisMax-##1)}}}\color{oldcolor}%
+                \xintifForLast{}{+}%
               }%
-              \boxed{\PfCNombreChiffre\times\num{\fpeval{10^(\PfCNombrePuisMax-##1)}}}\color{oldcolor}%
-              \xintifForLast{}{+}%
             }%
-          }%
-        }
-      }{%
-        \ensuremath{%
-          \num{#2}=
-          \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
-            \StrChar{#2}{##1}[\PfCNombreChiffre]
-            \xintifboolexpr{\PfCNombreChiffre==0}{}{%
-              \ifboolKV[DecompDeci]{Parentheses}{\left(}{}\PfCNombreChiffre\times\num{\fpeval{10^(\PfCNombrePuisMax-##1)}}\ifboolKV[DecompDeci]{Parentheses}{\right)}{}%
-              \xintifForLast{}{+}%
+          }
+        }{%
+          \ensuremath{%
+            \ifboolKV[DecompDeci]{ResultatSeul}{}{\num{#2}=}%
+            \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
+              \StrChar{#2}{##1}[\PfCNombreChiffre]
+              \xintifboolexpr{\PfCNombreChiffre==0}{}{%
+                \ifboolKV[DecompDeci]{Parentheses}{\left(}{}\PfCNombreChiffre\times\num{\fpeval{10^(\PfCNombrePuisMax-##1)}}\ifboolKV[DecompDeci]{Parentheses}{\right)}{}%
+                \xintifForLast{}{+}%
+              }%
             }%
           }%
         }%
@@ -163,15 +184,29 @@
         \xdef\PfCRetiensPuis{\fpeval{\PfCRetiensPuis+1}}%
       }{}%
     }%
-    \ensuremath{%
-      \num{#2}=
-      \xintFor* ##1 in {\xintSeq{1}{\PfCNombrePuisMax-\PfCRetiensPuis}}\do{%
-        \StrChar{\PfCRetiensNombreEntier}{##1}[\PfCNombreChiffre]
-        \xintifboolexpr{\PfCNombreChiffre==0}{}{%
-          \ifboolKV[DecompDeci]{Parentheses}{\left(}{}\PfCNombreChiffre\times\num{\fpeval{10^(\PfCNombrePuisMax-##1-\PfCPuisDeci-1)}}\ifboolKV[DecompDeci]{Parentheses}{\right)}{}%
-          \xintifForLast{}{+}%
+    %%
+    \ifboolKV[DecompDeci]{SansMul}{%
+      \ensuremath{%
+        \ifboolKV[DecompDeci]{ResultatSeul}{}{\num{#2}=}%
+        \xintFor* ##1 in {\xintSeq{1}{\PfCNombrePuisMax-\PfCRetiensPuis}}\do{%
+          \StrChar{\PfCRetiensNombreEntier}{##1}[\PfCNombreChiffre]
+          \xintifboolexpr{\PfCNombreChiffre==0}{}{%
+            \num{\fpeval{\PfCNombreChiffre*10^(\PfCNombrePuisMax-##1-\PfCPuisDeci-1)}}%
+            \xintifForLast{}{+}%
+          }%
         }%
       }%
+    }{%
+      \ensuremath{%
+        \ifboolKV[DecompDeci]{ResultatSeul}{}{\num{#2}=}%
+        \xintFor* ##1 in {\xintSeq{1}{\PfCNombrePuisMax-\PfCRetiensPuis}}\do{%
+          \StrChar{\PfCRetiensNombreEntier}{##1}[\PfCNombreChiffre]
+          \xintifboolexpr{\PfCNombreChiffre==0}{}{%
+            \ifboolKV[DecompDeci]{Parentheses}{\left(}{}\PfCNombreChiffre\times\num{\fpeval{10^(\PfCNombrePuisMax-##1-\PfCPuisDeci-1)}}\ifboolKV[DecompDeci]{Parentheses}{\right)}{}%
+            \xintifForLast{}{+}%
+          }%
+        }%
+      }%
     }%
   }%
 }%
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCDessinGradue.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCDessinGradue.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCDessinGradue.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -4,69 +4,76 @@
 \setKVdefault[DessinGradue]{Lignes=10,Debut=-5,Fin=5,Pas=10,Solution=false,EcartVertical=1.5,LignesIdentiques,Longueur=10,Echelle=1,Droites=false,DemiDroites=false,OrigineVariable=false,Code=false}
 \defKV[DessinGradue]{Traces=\setKV[DessinGradue]{Code}}%
 
+\def\TraceDessinGradueCompletCode{%
+  % Paramètres
+  LongueurLigne=\useKV[DessinGradue]{Longueur};
+  EcartVertical=\useKV[DessinGradue]{EcartVertical};
+  Pas:=\useKV[DessinGradue]{Pas};
+  NbLignes=\useKV[DessinGradue]{Lignes};
+  Echelle=\useKV[DessinGradue]{Echelle};
+  Debut:=\useKV[DessinGradue]{Debut};
+  Fin:=\useKV[DessinGradue]{Fin};
+  % 
+  boolean Solution,Droites,DemiDroites,LignesIdentiques,OrigineVariable,Code;
+  Solution=\useKV[DessinGradue]{Solution};
+  LignesIdentiques:=\useKV[DessinGradue]{LignesIdentiques};
+  OrigineVariable:=\useKV[DessinGradue]{OrigineVariable};
+  Droites=\useKV[DessinGradue]{Droites};
+  DemiDroites=\useKV[DessinGradue]{DemiDroites};
+  Code=\useKV[DessinGradue]{Code};
+  vardef EffectuerLesTraces=
+  if Code:
+  \useKV[DessinGradue]{Traces};
+  fi;
+  enddef;
+  % 
+  pair La,Lb,Lab[];
+  pair 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',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'';
+  % 
+  La=(0,0);
+  Lb-La=u*(LongueurLigne,0);
+  % 
+  % On définit une fonction pour tracer les lignes en fonction du pas "Partage"
+  vardef TraceLignes(expr Partage)=
+  save RecupLigne;
+  picture RecupLigne;
+  RecupLigne=image(
+  if Droites:
+  drawarrow 1.05[Lb,La]--1.05[La,Lb];
+  elseif DemiDroites:
+  drawarrow La--1.05[La,Lb];
+  else:
+  trace segment(La,Lb);
+  fi;
+  for kl=0 upto Partage:
+  Lab[kl]:=(kl/Partage)[La,Lb];
+  trace (Lab[kl]+u*(0,-0.1))--(Lab[kl]+u*(0,0.1));
+  endfor;
+  );
+  RecupLigne
+  enddef;
+  % On définit une fonction pour nommer les points nécessaires.
+  vardef DefinirPoints(text t)=
+  numeric nblignes,nbpas;
+  n:=0;
+  for p_=t:
+  n:=n+1;
+  if (n mod 3)=1:
+  nblignes:=p_;
+  elseif (n mod 3)=2:
+  nbpas:=p_;
+  elseif (n mod 3)=0:
+  p_=(nbpas/TotalPas[nblignes])[La,Lb] shifted(u*(0,(nblignes-1)*(-EcartVertical)));
+  fi;
+  endfor;
+  enddef;
+}
+
 \def\TraceDessinGradueComplet#1#2#3{%
   \ifluatex
   \mplibforcehmode
   \begin{mplibcode}
-    % Paramètres
-    LongueurLigne=\useKV[DessinGradue]{Longueur};
-    EcartVertical=\useKV[DessinGradue]{EcartVertical};
-    Pas:=\useKV[DessinGradue]{Pas};
-    NbLignes=\useKV[DessinGradue]{Lignes};
-    Echelle=\useKV[DessinGradue]{Echelle};
-    Debut:=\useKV[DessinGradue]{Debut};
-    Fin:=\useKV[DessinGradue]{Fin};
-    
-    boolean Solution,Droites,DemiDroites,LignesIdentiques,OrigineVariable,Code;
-    Solution=\useKV[DessinGradue]{Solution};
-    LignesIdentiques:=\useKV[DessinGradue]{LignesIdentiques};
-    OrigineVariable:=\useKV[DessinGradue]{OrigineVariable};
-    Droites=\useKV[DessinGradue]{Droites};
-    DemiDroites=\useKV[DessinGradue]{DemiDroites};
-    Code=\useKV[DessinGradue]{Code};
-
-    pair La,Lb,Lab[];
-    pair 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',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'';
-    
-    La=(0,0);
-    Lb-La=u*(\useKV[DessinGradue]{Longueur},0);
-
-    % On définit une fonction pour tracer les lignes en fonction du pas "Partage"
-    vardef TraceLignes(expr Partage)=
-    save RecupLigne;
-    picture RecupLigne;
-    RecupLigne=image(
-    if \useKV[DessinGradue]{Droites}:
-    drawarrow 1.05[Lb,La]--1.05[La,Lb];
-    elseif \useKV[DessinGradue]{DemiDroites}:
-    drawarrow La--1.05[La,Lb];
-    else:
-    trace segment(La,Lb);
-    fi;
-    for kl=0 upto Partage:
-    Lab[kl]:=(kl/Partage)[La,Lb];
-    trace (Lab[kl]+u*(0,-0.1))--(Lab[kl]+u*(0,0.1));
-    endfor;
-    );
-    RecupLigne
-    enddef;
-
-    % On définit une fonction pour nommer les points nécessaires.
-    vardef DefinirPoints(text t)=
-    numeric nblignes,nbpas;
-    n:=0;
-    for p_=t:
-    n:=n+1;
-    if (n mod 3)=1:
-    nblignes:=p_;
-    elseif (n mod 3)=2:
-    nbpas:=p_;
-    elseif (n mod 3)=0:
-    p_=(nbpas/TotalPas[nblignes])[La,Lb] shifted(u*(0,(nblignes-1)*(-EcartVertical)));
-    fi;
-    endfor;
-    enddef;
-
+    \TraceDessinGradueCompletCode%
     % On détermine le nombre de lignes et les origines particulières
     pair OrigA[],OrigB[];
     if LignesIdentiques:
@@ -141,69 +148,7 @@
     trace EnsembleLignes scaled \useKV[DessinGradue]{Echelle};
   \end{mplibcode}
   \else
-  \begin{mpost}[mpsettings={%
-    LongueurLigne=\useKV[DessinGradue]{Longueur};
-    EcartVertical=\useKV[DessinGradue]{EcartVertical};
-    Pas:=\useKV[DessinGradue]{Pas};
-    NbLignes=\useKV[DessinGradue]{Lignes};
-    Echelle=\useKV[DessinGradue]{Echelle};
-    Debut:=\useKV[DessinGradue]{Debut};
-    Fin:=\useKV[DessinGradue]{Fin};
-    boolean Solution,Droites,DemiDroites,LignesIdentiques,OrigineVariable,Code;
-    Solution=\useKV[DessinGradue]{Solution};
-    LignesIdentiques:=\useKV[DessinGradue]{LignesIdentiques};
-    OrigineVariable:=\useKV[DessinGradue]{OrigineVariable};
-    Droites=\useKV[DessinGradue]{Droites};
-    DemiDroites=\useKV[DessinGradue]{DemiDroites};
-    Code=\useKV[DessinGradue]{Code};
-    vardef EffectuerLesTraces=
-    if Code:
-    \useKV[DessinGradue]{Traces};
-    fi;
-    enddef;
-    }]
-    pair La,Lb,Lab[];
-    pair 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',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'';
-    
-    La=(0,0);
-    Lb-La=u*(\useKV[DessinGradue]{Longueur},0);
-
-    % On définit une fonction pour tracer les lignes en fonction du pas "Partage"
-    vardef TraceLignes(expr Partage)=
-    save RecupLigne;
-    picture RecupLigne;
-    RecupLigne=image(
-    if \useKV[DessinGradue]{Droites}:
-    drawarrow 1.05[Lb,La]--1.05[La,Lb];
-    elseif \useKV[DessinGradue]{DemiDroites}:
-    drawarrow La--1.05[La,Lb];
-    else:
-    trace segment(La,Lb);
-    fi;
-    for kl=0 upto Partage:
-    Lab[kl]:=(kl/Partage)[La,Lb];
-    trace (Lab[kl]+u*(0,-0.1))--(Lab[kl]+u*(0,0.1));
-    endfor;
-    );
-    RecupLigne
-    enddef;
-
-    % On définit une fonction pour nommer les points nécessaires.
-    vardef DefinirPoints(text t)=
-    numeric nblignes,nbpas;
-    n:=0;
-    for p_=t:
-    n:=n+1;
-    if (n mod 3)=1:
-    nblignes:=p_;
-    elseif (n mod 3)=2:
-    nbpas:=p_;
-    elseif (n mod 3)=0:
-    p_=(nbpas/TotalPas[nblignes])[La,Lb] shifted(u*(0,(nblignes-1)*(-EcartVertical)));
-    fi;
-    endfor;
-    enddef;
-
+  \begin{mpost}[mpsettings={\TraceDessinGradueCompletCode}]
     % On détermine le nombre de lignes et les origines particulières
     pair OrigA[],OrigB[];
     if LignesIdentiques:

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -15,7 +15,6 @@
   \readlist*\ListePfCEngrenages{#2}%
   \setsepchar{,}
   \xdef\PfCFooEngrenages{}
-  % \foreachitem\compteur\in\ListePfCEngrenages{\expandafter\UpdatetoksEngrenages\compteur\nil}%
   \foreachitem\compteur\in\ListePfCEngrenages{%
     \xdef\PfCFooEngrenages{\PfCFooEngrenages \ListePfCEngrenages[\compteurcnt,1],\ListePfCEngrenages[\compteurcnt,2],}%
   }%
@@ -22,114 +21,73 @@
   \BuildEngrenages{\PfCFooEngrenages}%
 }%
 
+\def\BuildEngrenagesCode#1{%
+  u:=\useKV[Engrenages]{Unite};
+  CouleurEngrenage=\useKV[Engrenages]{Couleur};
+  %  
+  vardef LectureDonnees(text t)=
+  n:=0;k=0;l=0;
+  for p_=t:
+  n:=n+1;
+  if (n mod 2)=0:
+  l:=l+1;
+  Zz[l]=p_;
+  else:
+  k:=k+1;
+  Mm[k]=p_;
+  fi;
+  endfor;
+  enddef;
+  %  
+  LectureDonnees(#1);
+  %
+  pair K;
+  K=(0,0);
+  picture EngrenageFinal;
+  EngrenageFinal=image(
+  trace Engrenage(Mm[1],Zz[1],(0,0));
+  %
+  Signe=1;
+  %  
+  for w=2 upto (n div 2):
+  K:=K+pointarc(cercles((0,0),u*Mm[w]*(Zz[w-1]+Zz[w])*0.5+0.04*u),0);
+  AngleRot[w]:=360/(2*Zz[w]);
+  if w=2:
+  trace rotation(Engrenage(Mm[w],Zz[w],K),K,180-AngleRot[w]);
+  if (Zz[w] mod 2)=0:
+  Signe:=Signe*(-1);
+  fi;
+  else:
+  if (Zz[w] mod 2)=1:
+  if Signe=-1:
+  trace rotation(Engrenage(Mm[w],Zz[w],K),K,180);
+  else:
+  trace rotation(Engrenage(Mm[w],Zz[w],K),K,180-AngleRot[w]);
+  fi;
+  else:
+  Signe:=Signe*(-1);
+  if Signe=1:
+  trace rotation(Engrenage(Mm[w],Zz[w],K),K,180);
+  else:
+  trace rotation(Engrenage(Mm[w],Zz[w],K),K,180-AngleRot[w]);
+  fi;
+  fi;
+  fi;
+  endfor;
+  );
+}
+
 \NewDocumentCommand\BuildEngrenages{m}{%
   \ifluatex
   \mplibforcehmode
   \begin{mplibcode}
     input PfCEngrenages;
-    
-    u:=\useKV[Engrenages]{Unite};
-    CouleurEngrenage=\useKV[Engrenages]{Couleur};
-    
-    vardef LectureDonnees(text t)=
-    n:=0;k=0;l=0;
-    for p_=t:
-    n:=n+1;
-    if (n mod 2)=0:
-    l:=l+1;
-    Zz[l]=p_;
-    else:
-    k:=k+1;
-    Mm[k]=p_;
-    fi;
-    endfor;
-    enddef;
-    
-    LectureDonnees(#1);
-
-    pair K;
-    K=(0,0);
-
-    trace Engrenage(Mm[1],Zz[1],(0,0));
-    
-    Signe=1;
-    
-    for w=2 upto (n div 2):
-    K:=K+pointarc(cercles((0,0),u*Mm[w]*(Zz[w-1]+Zz[w])*0.5+0.04*u),0);
-    AngleRot[w]:=360/(2*Zz[w]);
-    if w=2:
-    trace rotation(Engrenage(Mm[w],Zz[w],K),K,180-AngleRot[w]);
-    if (Zz[w] mod 2)=0:
-    Signe:=Signe*(-1);
-    fi;
-    else:
-    if (Zz[w] mod 2)=1:
-    if Signe=-1:
-    trace rotation(Engrenage(Mm[w],Zz[w],K),K,180);
-    else:
-    trace rotation(Engrenage(Mm[w],Zz[w],K),K,180-AngleRot[w]);
-    fi;
-    else:
-    Signe:=Signe*(-1);
-    if Signe=1:
-trace rotation(Engrenage(Mm[w],Zz[w],K),K,180);
-    else:
-trace rotation(Engrenage(Mm[w],Zz[w],K),K,180-AngleRot[w]);
-    fi;
-    fi;
-    fi;
-    endfor;
+    \BuildEngrenagesCode{#1}
+    trace EngrenageFinal;
   \end{mplibcode}
   \else
-  \begin{mpost}[mpsettings={input PfCEngrenages;u:=\useKV[Engrenages]{Unite};CouleurEngrenage=\useKV[Engrenages]{Couleur};}]
-    vardef LectureDonnees(text t)=
-    n:=0;k=0;l=0;
-    for p_=t:
-    n:=n+1;
-    if (n mod 2)=0:
-    l:=l+1;
-    Zz[l]=p_;
-    else:
-    k:=k+1;
-    Mm[k]=p_;
-    fi;
-    endfor;
-    enddef;
-    
-    LectureDonnees(#1);
-
-    pair K;
-    K=(0,0);
-
-    trace Engrenage(Mm[1],Zz[1],(0,0));
-    
-    Signe=1;
-    
-    for w=2 upto (n div 2):
-    K:=K+pointarc(cercles((0,0),u*Mm[w]*(Zz[w-1]+Zz[w])*0.5+0.04*u),0);
-    AngleRot[w]:=360/(2*Zz[w]);
-    if w=2:
-    trace rotation(Engrenage(Mm[w],Zz[w],K),K,180-AngleRot[w]);
-    if (Zz[w] mod 2)=0:
-    Signe:=Signe*(-1);
-    fi;
-    else:
-    if (Zz[w] mod 2)=1:
-    if Signe=-1:
-    trace rotation(Engrenage(Mm[w],Zz[w],K),K,180);
-    else:
-    trace rotation(Engrenage(Mm[w],Zz[w],K),K,180-AngleRot[w]);
-    fi;
-    else:
-    Signe:=Signe*(-1);
-    if Signe=1:
-trace rotation(Engrenage(Mm[w],Zz[w],K),K,180);
-    else:
-trace rotation(Engrenage(Mm[w],Zz[w],K),K,180-AngleRot[w]);
-    fi;
-    fi;
-    fi;
-    endfor;
+  \begin{mpost}[mpsettings={input PfCEngrenages;\BuildEngrenagesCode{#1}}]
+    trace EngrenageFinal;
   \end{mpost}
   \fi
-}
\ No newline at end of file
+}%
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCNombreAstral.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCNombreAstral.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCNombreAstral.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -1,7 +1,7 @@
 %%%
 % Nombre Astral
 %%%
-\setKVdefault[NombreAstral]{Solution=false,Graines=false,Echelle=1}
+\setKVdefault[NombreAstral]{Solution=false,Graines=false,Echelle=1,Couleur=LightSteelBlue}
 \defKV[NombreAstral]{Graine=\setKV[NombreAstral]{Graines}}%
 
 \newtoks\toklisteNANombres%
@@ -51,9 +51,12 @@
   \mplibforcehmode
   \begin{mplibcode}
     Cible=\PfCNACible;
+
+    color MiseEnValeurSol;
+    MiseEnValeurSol=\useKV[NombreAstral]{Couleur};
     
     boolean Solution;
-    Solution:=\useKV[NombreAstral]{Solution};
+    Solution=\useKV[NombreAstral]{Solution};
 
     Echelle:=\useKV[NombreAstral]{Echelle};
     
@@ -102,11 +105,19 @@
     fill ca[k] withcolor white;
     trace ca[k];
     endfor;
+
+    vardef DefinirRappel(text t)=
+    n:=0;
+    for p_=t:
+    n:=n+1;
+    Rappel[n]=p_;
+    endfor;
+    enddef;
+    
     vardef Affichage(text t)=
     n:=0;
     for p_=t:
     n:=n+1;
-    Rappel[n]=p_;
     label(TEX("\Large"&p_),A[n]);
     endfor;
     enddef;
@@ -115,16 +126,20 @@
     k:=0;
     for p_=t:
     k:=k+1;
-    fill ca[p_] withcolor white;
+    fill ca[p_] withcolor if Solution=false: white else: MiseEnValeurSol fi;
     trace ca[p_];
     label(TEX("\Large"&Rappel[p_]),u*(-7,5.6-1.5k));
     trace cercles(u*(-7,5.6-1.5k),0.6u);
     endfor;
     enddef;
-    
+
+    DefinirRappel(#1);
+    if Solution=false:
     Affichage(#1);
-    if Solution=false:
     Suppression(#2);
+    else:
+    Suppression(#2);
+    Affichage(#1);
     fi;
     picture recap;%
     recap:=currentpicture scaled Echelle;%
@@ -134,6 +149,8 @@
   \else
   \begin{mpost}[mpsettings={%
       Echelle:=\useKV[NombreAstral]{Echelle};
+      color MiseEnValeurSol;
+      MiseEnValeurSol=\useKV[NombreAstral]{Couleur};
       Cible=\PfCNACible;boolean Solution;Solution:=\useKV[NombreAstral]{Solution};
       string Rappel[];
       n:=0;
@@ -187,11 +204,20 @@
     fill ca[k] withcolor white;
     trace ca[k];
     endfor;
+
+    vardef DefinirRappel(text t)=
+    n:=0;
+    for p_=t:
+    n:=n+1;
+    Rappel[n]=p_;
+    endfor;
+    enddef;
+    
     vardef Affichage(text t)=
     n:=0;
     for p_=t:
     n:=n+1;
-    label(LATEX("\noexpand\Large"&Rappel[n]),A[n]);
+    label(LATEX("\noexpand\Large"&p_),A[n]);
     endfor;
     enddef;
     
@@ -199,7 +225,7 @@
     k:=0;
     for p_=t:
     k:=k+1;
-    fill ca[p_] withcolor white;
+    fill ca[p_] withcolor if Solution=false: white else: MiseEnValeurSol fi;
     trace ca[p_];
     label(LATEX("\noexpand\Large"&Rappel[p_]),u*(-7,5.6-1.5k));
     trace cercles(u*(-7,5.6-1.5k),0.6u);
@@ -206,11 +232,14 @@
     endfor;
     enddef;
 
+    DefinirRappel(#1);
+    if Solution=false:
     Affichage(#1);
-    if Solution=false:
     Suppression(#2);
+    else:
+    Suppression(#2);
+    Affichage(#1);
     fi;
-
     picture recap;%
     recap:=currentpicture scaled Echelle;%
     currentpicture:=nullpicture;%

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPapiers.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCPapiers.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCPapiers.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -27,306 +27,264 @@
 %  \fi
 %}
 
-\def\MPGrille#1#2#3#4{%
-  \ifluatex%
-  \mplibforcehmode%
-  \begin{mplibcode}%
-    path horizon,verticon;
-    horizon=(0,0)--(#1*cm,0);
-    verticon=(0,0)--(0,#2*cm);
-    drawoptions(withcolor #3);
-    for k=0 step (#4*100) until (#1*100):
-    draw verticon shifted(((k/100)*cm,0));
-    endfor;
-    for k=0 step (#4*100) until (#2*100):
-    draw horizon shifted((0,(k/100)*cm));
-    endfor;
-  \end{mplibcode}%
-  \else%
-  \begin{mpost}%
-    path horizon,verticon;
-    horizon=(0,0)--(#1*cm,0);
-    verticon=(0,0)--(0,#2*cm);
-    drawoptions(withcolor #3);
-    for k=0 step 0.5 until #1:
-    draw verticon shifted((k*cm,0));
-    endfor;
-    for k=0 step 0.5 until #2:
-    draw horizon shifted((0,k*cm));
-    endfor;
-  \end{mpost}%
-  \fi%
+\def\MPGrilleCode{%
+  PapierLargeur=\PapierLargeur;
+  PapierHauteur=\PapierHauteur;
+  PapierGrille=\PapierGrille;
+  PapierGrillePointe=\PapierGrillePointe;
+  color PapierCouleur;
+  PapierCouleur=\useKV[Papiers]{Couleur};
+  %
+  path horizon,verticon;
+  horizon=(0,0)--(PapierLargeur*cm,0);
+  verticon=(0,0)--(0,PapierHauteur*cm);
+  vardef Papier=
+  picture Papiers;
+  Papiers=image(
+  drawoptions(withcolor PapierCouleur);
+  if PapierGrillePointe>0:
+  for k=0 step (PapierGrillePointe*100) until (PapierLargeur*100):
+  for l=0 step (PapierGrillePointe*100) until (PapierHauteur*100):
+  fill (cercles((0,0),1pt) shifted(((k/100)*cm,(l/100)*cm)));
+  endfor;
+  endfor;
+  else:
+  for k=0 step (PapierGrille*100) until (PapierLargeur*100):
+  draw verticon shifted(((k/100)*cm,0));
+  endfor;
+  for k=0 step (PapierGrille*100) until (PapierHauteur*100):
+  draw horizon shifted((0,(k/100)*cm));
+  endfor;
+  fi;
+  );
+  Papiers
+  enddef;
 }%
 
-\def\MPGrillePointe#1#2#3#4{%
+\def\MPGrille{%
   \ifluatex%
   \mplibforcehmode%
   \begin{mplibcode}%
-    drawoptions(withcolor #3);
-    for k=0 step (#4*100) until (#1*100):
-    for l=0 step (#4*100) until (#2*100):
-    fill (cercles((0,0),1pt) shifted(((k/100)*cm,(l/100)*cm)));
-    endfor;
-    endfor;
+    \MPGrilleCode
+    trace Papier;
   \end{mplibcode}%
   \else%
-  \begin{mpost}%
-    drawoptions(withcolor #3);
-    for k=0 step (#4*100) until (#1*100):
-    for l=0 step (#4*100) until (#2*100):
-    fill (cercles((0,0),0.5pt) shifted(((k/100)*cm,(l/100)*cm)));
-    endfor;
-    endfor;
+  \begin{mpost}[mpsettings={\MPGrilleCode}]
+    trace Papier;
   \end{mpost}%
   \fi%
 }%
 
-\def\MPCinq#1#2#3{%
-  \ifluatex%
-  \mplibforcehmode%
-  \begin{mplibcode}%
-    path horizon,verticon;
-    horizon=(0,0)--(#1*cm,0);
-    verticon=(0,0)--(0,#2*cm);
-    drawoptions(withcolor #3);
-    for k=0 step 0.5 until #1:
-    draw verticon shifted((k*cm,0));
-    endfor;
-    for k=0 step 0.5 until #2:
-    draw horizon shifted((0,k*cm));
-    endfor;
-    if \useKV[Papiers]{CodeAfter}:
-    \useKV[Papiers]{Traces};
-    fi;
-  \end{mplibcode}%
-  \else%
-  \begin{mpost}
-    path horizon,verticon;
-    horizon=(0,0)--(#1*cm,0);
-    verticon=(0,0)--(0,#2*cm);
-    drawoptions(withcolor #3);
-    for k=0 step 0.5 until #1:
-    draw verticon shifted((k*cm,0));
-    endfor;
-    for k=0 step 0.5 until #2:
-    draw horizon shifted((0,k*cm));
-    endfor;
-  \end{mpost}%
-  \fi%
+\def\MPCinq{%
+  \xdef\PapierGrille{0.5}%
+  \MPGrille
 }%
 
-\def\MPSeyes#1#2#3{%
+\def\MPSeyesCode{%
+  PapierLargeur=\PapierLargeur;
+  PapierHauteur=\PapierHauteur;
+  color PapierCouleur;
+  PapierCouleur=\useKV[Papiers]{Couleur};
+  u:=\useKV[Papiers]{Echelle};
+  path horizon,verticon;
+  horizon=(0,0)--(PapierLargeur*cm,0);
+  verticon=(0,0)--(0,PapierHauteur*cm);
+  vardef Seyes=
+  picture PapierSeyes;
+  PapierSeyes=image(
+  drawoptions(withcolor PapierCouleur);
+  for k=0 step u until (PapierLargeur*10):
+  draw verticon shifted(((k/10)*cm,0));
+  endfor;
+  for k=0 step (u/4) until (PapierHauteur*10):
+  draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 0.5;
+  endfor;
+  for k=0 step u until (PapierHauteur*10):
+  draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 1.25;
+  endfor;
+  );
+  PapierSeyes
+  enddef;
+}
+
+\def\MPSeyes{%
   \ifluatex%
   \mplibforcehmode%
   \begin{mplibcode}%
-    u:=\useKV[Papiers]{Echelle};
-    path horizon,verticon;
-    horizon=(0,0)--(#1*cm,0);
-    verticon=(0,0)--(0,#2*cm);
-    drawoptions(withcolor #3);
-    for k=0 step u until (#1*10):
-    draw verticon shifted(((k/10)*cm,0));
-    endfor;
-    for k=0 step (u/4) until (#2*10):
-    draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 0.5;
-    endfor;
-    for k=0 step u until (#2*10):
-    draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 1.25;
-    endfor;
+    \MPSeyesCode
+    trace Seyes;
   \end{mplibcode}%
   \else%
-  \begin{mpost}[mpsettings={u:=\useKV[Papiers]{Echelle};}]%
-    path horizon,verticon;
-    horizon=(0,0)--(#1*cm,0);
-    verticon=(0,0)--(0,#2*cm);
-    drawoptions(withcolor #3);
-    for k=0 step u until (#1*10):
-    draw verticon shifted(((k/10)*cm,0));
-    endfor;
-    for k=0 step (u/4) until (#2*10):
-    draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 0.5;
-    endfor;
-    for k=0 step u until (#2*10):
-    draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 1.25;
-    endfor;
+  \begin{mpost}[mpsettings={\MPSeyesCode}]%
+    trace Seyes;
   \end{mpost}
   \fi%
 }%
 
-\def\MPMillimetre#1#2#3{%
+\def\MPMillimetreCode{%
+  PapierLargeur=\PapierLargeur;
+  PapierHauteur=\PapierHauteur;
+  color PapierCouleur;
+  PapierCouleur=\useKV[Papiers]{Couleur};
+  path horizon,verticon;
+  horizon=(0,0)--(PapierLargeur*cm,0);
+  verticon=(0,0)--(0,PapierHauteur*cm);
+  vardef MPMilli=
+  picture MPMillimetre;
+  MPMillimetre=image(
+  drawoptions(withcolor PapierCouleur);
+  for k=0 step 1 until (PapierLargeur*10):
+  draw verticon shifted(((k/10)*cm,0)) withpen pencircle scaled 0.2;
+  endfor;
+  for k=0 step 5 until (PapierLargeur*10):
+  draw verticon shifted(((k/10)*cm,0)) withpen pencircle scaled 0.5;
+  endfor;
+  for k=0 step 1 until (PapierLargeur):
+  draw verticon shifted((k*cm,0)) withpen pencircle scaled 1.25;
+  endfor;
+  for k=0 step 1 until (PapierHauteur*10):
+  draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 0.2;
+  endfor;
+  for k=0 step 5 until (PapierHauteur*10):
+  draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 0.5;
+  endfor;
+  for k=0 step 1 until (PapierHauteur):
+  draw horizon shifted((0,k*cm)) withpen pencircle scaled 1.25;
+  endfor;
+  );
+  MPMillimetre
+  enddef;
+}
+
+\def\MPMillimetre{%
   \ifluatex%
   \mplibforcehmode%
   \begin{mplibcode}%
-    path horizon,verticon;
-    horizon=(0,0)--(#1*cm,0);
-    verticon=(0,0)--(0,#2*cm);
-    drawoptions(withcolor #3);
-    for k=0 step 1 until (#1*10):
-    draw verticon shifted(((k/10)*cm,0)) withpen pencircle scaled 0.2;
-    endfor;
-    for k=0 step 5 until (#1*10):
-    draw verticon shifted(((k/10)*cm,0)) withpen pencircle scaled 0.5;
-    endfor;
-    for k=0 step 1 until (#1):
-    draw verticon shifted((k*cm,0)) withpen pencircle scaled 1.25;
-    endfor;
-    for k=0 step 1 until (#2*10):
-    draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 0.2;
-    endfor;
-    for k=0 step 5 until (#2*10):
-    draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 0.5;
-    endfor;
-    for k=0 step 1 until (#2):
-    draw horizon shifted((0,k*cm)) withpen pencircle scaled 1.25;
-    endfor;
+    \MPMillimetreCode
+    trace MPMilli;
   \end{mplibcode}%
   \else%
-  \begin{mpost}%
-    path horizon,verticon;
-    horizon=(0,0)--(#1*cm,0);
-    verticon=(0,0)--(0,#2*cm);
-    drawoptions(withcolor #3);
-    for k=0 step 1 until (#1*10):
-    draw verticon shifted(((k/10)*cm,0)) withpen pencircle scaled 0.2;
-    endfor;
-    for k=0 step 5 until (#1*10):
-    draw verticon shifted(((k/10)*cm,0)) withpen pencircle scaled 0.5;
-    endfor;
-    for k=0 step 1 until (#1):
-    draw verticon shifted((k*cm,0)) withpen pencircle scaled 1.25;
-    endfor;
-    for k=0 step 1 until (#2*10):
-    draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 0.2;
-    endfor;
-    for k=0 step 5 until (#2*10):
-    draw horizon shifted((0,(k/10)*cm)) withpen pencircle scaled 0.5;
-    endfor;
-    for k=0 step 1 until (#2):
-    draw horizon shifted((0,k*cm)) withpen pencircle scaled 1.25;
-    endfor;
+  \begin{mpost}[mpsettings={\MPMillimetreCode}]
+    trace MPMilli;
   \end{mpost}%
   \fi%
 }%
 
-\def\MPIsometrique#1#2#3{%
+\def\MPIsometriqueCode{%
+  PapierLargeur=\PapierLargeur;
+  PapierHauteur=\PapierHauteur;
+  color PapierCouleur;
+  PapierCouleur=\useKV[Papiers]{Couleur};
+  path diagon,antidiagon;
+  diagon=(0,0)--PapierHauteur*cm*(sqrt(3),1);
+  antidiagon=(0,0)--PapierHauteur*cm*(-sqrt(3),1);
+  vardef MPIso=
+  picture MPIsom;
+  MPIsom=image(
+  drawoptions(withcolor PapierCouleur);
+  for k=0 upto 2*(PapierLargeur+PapierHauteur):
+  draw antidiagon shifted((k*cm,0));
+  endfor;
+  for k=-(2*ceiling(PapierLargeur+PapierHauteur)) upto (2*ceiling(PapierLargeur+PapierHauteur)):
+  draw diagon shifted((k*cm,0));
+  endfor;
+  clip currentpicture to polygone((0,0),(PapierLargeur*cm,0),(PapierLargeur*cm,PapierHauteur*cm),(0,PapierHauteur*cm));
+  );
+  MPIsom
+  enddef;
+}
+
+\def\MPIsometrique{%
   \ifluatex%
   \mplibforcehmode%
   \begin{mplibcode}%
-    path diagon,antidiagon;
-    diagon=(0,0)--#2*(sqrt(3)*cm,1*cm);
-    antidiagon=(0,0)--#2*(-sqrt(3)*cm,1*cm);
-    drawoptions(withcolor #3);
-    for k=0 step 1 until (#1):
-    draw diagon shifted((k*cm,0));
-    draw antidiagon shifted((k*cm,0));
-    endfor;
-    for k=0 step (sqrt(3)/3) until (#2):
-    draw diagon shifted((0,k*cm));
-    draw antidiagon shifted((#1*cm,k*cm));
-    endfor;
-    clip currentpicture to polygone((0,0),(#1*cm,0),(#1*cm,#2*cm),(0,#2*cm));
+    \MPIsometriqueCode
+    trace MPIso;
   \end{mplibcode}%
   \else%
-  \begin{mpost}%
-    path diagon,antidiagon;
-    diagon=(0,0)--#2*(sqrt(3)*cm,1*cm);
-    antidiagon=(0,0)--#2*(-sqrt(3)*cm,1*cm);
-    drawoptions(withcolor #3);
-    for k=0 step 1 until (#1):
-    draw diagon shifted((k*cm,0));
-    draw antidiagon shifted((k*cm,0));
-    endfor;
-    for k=0 step (sqrt(3)/3) until (#2):
-    draw diagon shifted((0,k*cm));
-    draw antidiagon shifted((#1*cm,k*cm));
-    endfor;
-    clip currentpicture to polygone((0,0),(#1*cm,0),(#1*cm,#2*cm),(0,#2*cm));
+  \begin{mpost}[mpsettings={\MPIsometriqueCode}]
+    trace MPIso;
   \end{mpost}%
   \fi%
 }%
 
-\def\MPIsometriquePointe#1#2#3{%
+\def\MPIsometriquePointeCode{%
+  PapierLargeur=\PapierLargeur;
+  PapierHauteur=\PapierHauteur;
+  color PapierCouleur;
+  PapierCouleur=\useKV[Papiers]{Couleur};
+  pair diagon,antidiagon;
+  diagon=(1pt,1pt);
+  antidiagon=(1pt+0.5cm,1pt+0.5*(sqrt(3)*1cm/3));
+  vardef TraceIsoPointe=
+  picture PapierIsoPointe;
+  PapierIsoPointe=image(
+  drawoptions(withcolor PapierCouleur);
+  for k=0 step (sqrt(3)/3) until (PapierHauteur):
+  for l=0 step 1 until (PapierLargeur):
+  fill (cercles(diagon,1pt) shifted((l*cm,k*cm)));
+  fill (cercles(antidiagon,1pt) shifted((l*cm,k*cm)));
+  endfor;
+  endfor;
+  clip currentpicture to polygone((0,0),(PapierLargeur*cm+2pt,0),(PapierLargeur*cm+2pt,PapierHauteur*cm+1pt),(0,PapierHauteur*cm+1pt));
+  );
+  PapierIsoPointe
+  enddef;
+}
+    
+\def\MPIsometriquePointe{%
   \ifluatex%
   \mplibforcehmode%
   \begin{mplibcode}%
-    pair diagon,antidiagon;
-    diagon=(1pt,1pt);
-    antidiagon=(1pt+0.5cm,1pt+0.5*(sqrt(3)*1cm/3));
-    drawoptions(withcolor #3);
-    for k=0 step (sqrt(3)/3) until (#2):
-    for l=0 step 1 until (#1):
-    fill (cercles(diagon,1pt) shifted((l*cm,k*cm)));
-    fill (cercles(antidiagon,1pt) shifted((l*cm,k*cm)));
-    endfor;
-    endfor;
-    clip currentpicture to polygone((0,0),(#1*cm+2pt,0),(#1*cm+2pt,#2*cm+1pt),(0,#2*cm+1pt));
+    \MPIsometriquePointeCode
+    trace TraceIsoPointe;
   \end{mplibcode}%
   \else%
-  \begin{mpost}%
-    pair diagon,antidiagon;
-    diagon=(1pt,1pt);
-    antidiagon=(1pt+0.5cm,1pt+0.5*(sqrt(3)*1cm/3));
-    drawoptions(withcolor #3);
-    for k=0 step (sqrt(3)/3) until (#2):
-    for l=0 step 1 until (#1):
-    fill (cercles(diagon,1pt) shifted((l*cm,k*cm)));
-    fill (cercles(antidiagon,1pt) shifted((l*cm,k*cm)));
-    endfor;
-    endfor;
-    clip currentpicture to polygone((0,0),(#1*cm+2pt,0),(#1*cm+2pt,#2*cm+1pt),(0,#2*cm+1pt));
+  \begin{mpost}[mpsettings={\MPIsometriquePointeCode}]
+    trace TraceIsoPointe;
   \end{mpost}%
   \fi%
 }%
 
-\def\MPTriangulaire#1#2#3{%
+\def\MPTriangulaireCode{%
+  PapierLargeur=\PapierLargeur;
+  PapierHauteur=\PapierHauteur;
+  color PapierCouleur;
+  PapierCouleur=\useKV[Papiers]{Couleur};
+  path horizon,diagon,antidiagon;
+  horizon=(0,0)--(PapierLargeur*cm,0);
+  diagon=(0,0)--PapierHauteur*cm*(sqrt(3)/3,1);
+  antidiagon=(0,0)--PapierHauteur*cm*(-sqrt(3)/3,1);
+  vardef PapierTri=
+  picture PapierTriangle;
+  PapierTriangle=image(
+  drawoptions(withcolor PapierCouleur);
+  for k=0 upto 2*ceiling(PapierLargeur):
+  draw diagon shifted((k*cm,0));
+  draw antidiagon shifted((k*cm,0));
+  endfor;
+  for k=sqrt(3) step (sqrt(3)) until (PapierHauteur):
+  draw diagon shifted((0,k*cm));
+  endfor;
+  for k=0 step (sqrt(3)/2) until (PapierHauteur):
+  draw horizon shifted((0,k*cm));
+  endfor;
+  clip currentpicture to polygone((0,0),(PapierLargeur*cm,0),(PapierLargeur*cm,PapierHauteur*cm),(0,PapierHauteur*cm));
+  );
+  PapierTriangle
+  enddef;
+}
+
+\def\MPTriangulaire{%
   \ifluatex%
   \mplibforcehmode%
   \begin{mplibcode}%
-    path horizon,diagon,antidiagon;
-    horizon=(0,0)--(#1*cm,0);
-    diagon=(0,0)--#2*(sqrt(3)*cm/3,1*cm);
-    antidiagon=(0,0)--#2*(-sqrt(3)*cm/3,1*cm);
-    drawoptions(withcolor #3);
-    for k=0 step 1 until #1:
-    draw diagon shifted((k*cm,0));
-    endfor;
-    for k=0 step (sqrt(3)) until (#2):
-    draw diagon shifted((0,k*cm));
-    endfor;
-    for k=0 step 1 until (#1):
-    draw antidiagon shifted((k*cm,0));
-    endfor;
-    for k=0 step (sqrt(3)) until (#2):
-    draw antidiagon shifted((#1*cm,k*cm));
-    endfor;
-    for k=0 step (sqrt(3)/2) until (#2):
-    draw horizon shifted((0,k*cm));
-    endfor;
-    clip currentpicture to polygone((0,0),(#1*cm,0),(#1*cm,#2*cm),(0,#2*cm));
+    \MPTriangulaireCode
+    trace PapierTri;
   \end{mplibcode}%
   \else%
-  \begin{mpost}%
-    path horizon,diagon,antidiagon;
-    horizon=(0,0)--(#1*cm,0);
-    diagon=(0,0)--#2*(sqrt(3)*cm/3,1*cm);
-    antidiagon=(0,0)--#2*(-sqrt(3)*cm/3,1*cm);
-    drawoptions(withcolor #3);
-    for k=0 step 1 until #1:
-    draw diagon shifted((k*cm,0));
-    endfor;
-    for k=0 step (sqrt(3)) until (#2):
-    draw diagon shifted((0,k*cm));
-    endfor;
-    for k=0 step 1 until (#1):
-    draw antidiagon shifted((k*cm,0));
-    endfor;
-    for k=0 step (sqrt(3)) until (#2):
-    draw antidiagon shifted((#1*cm,k*cm));
-    endfor;
-    for k=0 step (sqrt(3)/2) until (#2):
-    draw horizon shifted((0,k*cm));
-    endfor;
-    clip currentpicture to polygone((0,0),(#1*cm,0),(#1*cm,#2*cm),(0,#2*cm));
+  \begin{mpost}[mpsettings={\MPTriangulaireCode}]
+    trace PapierTri;
   \end{mpost}%
   \fi%
 }%
@@ -335,6 +293,33 @@
 
 \newlength{\PapierLeftCurrent}
 
+\def\PfCPapierTest{%
+  \xintifboolexpr{\useKV[Papiers]{GrillePointe}>0 || \useKV[Papiers]{Grille}>0}{%
+    \MPGrille%
+  }{\ifboolKV[Papiers]{Baseline}{%
+      \MPBaseLineSkip{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
+    }{%
+      \ifboolKV[Papiers]{IsometriquePointe}{%
+        \MPIsometriquePointe%
+      }{%
+        \ifboolKV[Papiers]{Triangle}{%
+          \MPTriangulaire%
+        }{\ifboolKV[Papiers]{Millimetre}{%
+            \MPMillimetre%
+          }{\ifboolKV[Papiers]{Isometrique}{%
+              \MPIsometrique%
+            }{\ifboolKV[Papiers]{Seyes}{%
+                \MPSeyes%
+              }{\MPCinq%
+              }%
+            }%
+          }%
+        }%
+      }%
+    }%
+  }%
+}%
+
 \newcommand\Papiers[1][]{%
   \useKVdefault[Papiers]%
   \setKV[Papiers]{#1}%
@@ -355,34 +340,7 @@
     \xdef\PapierLargeur{\fpeval{\textwidth/1cm}}%
     \begin{tikzpicture}[remember picture,overlay]%
       \node[anchor=south west,inner sep=0pt,transform canvas={xshift=\PapierLeft,yshift=\PapierBottom}] at (current page.south west) {%
-        \xintifboolexpr{\useKV[Papiers]{GrillePointe}>0}{%
-          \MPGrillePointe{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}{\PapierGrillePointe}%
-        }{%
-          \xintifboolexpr{\useKV[Papiers]{Grille}>0}{%
-            \MPGrille{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}{\PapierGrille}%
-          }{\ifboolKV[Papiers]{Baseline}{%
-              \MPBaseLineSkip{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-            }{%
-              \ifboolKV[Papiers]{IsometriquePointe}{%
-                \MPIsometriquePointe{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-              }{%
-                \ifboolKV[Papiers]{Triangle}{%
-                  \MPTriangulaire{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                }{\ifboolKV[Papiers]{Millimetre}{%
-                    \MPMillimetre{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                  }{\ifboolKV[Papiers]{Isometrique}{%
-                      \MPIsometrique{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                    }{\ifboolKV[Papiers]{Seyes}{%
-                        \MPSeyes{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                      }{\MPCinq{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                      }%
-                    }%
-                  }%
-                }%
-              }%
-            }%
-          }%
-        }%
+        \PfCPapierTest%
       };%
     \end{tikzpicture}%
   }{%
@@ -398,60 +356,11 @@
       \xdef\PapierLargeur{\fpeval{\paperwidth/1cm}}%
       \begin{tikzpicture}[remember picture,overlay]%
         \node[anchor=south west,inner sep=0pt] at (current page.south west) {%
-          \xintifboolexpr{\useKV[Papiers]{GrillePointe}>0}{%
-            \MPGrillePointe{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}{\PapierGrillePointe}%
-          }{%
-            \xintifboolexpr{\useKV[Papiers]{Grille}>0}{%
-              \MPGrille{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}{\PapierGrille}%
-            }{\ifboolKV[Papiers]{IsometriquePointe}{%
-                \MPIsometriquePointe{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-              }{\ifboolKV[Papiers]{Triangle}{%
-                  \MPTriangulaire{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                }{\ifboolKV[Papiers]{Millimetre}{%
-                    \MPMillimetre{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                  }{\ifboolKV[Papiers]{Isometrique}{%
-                      \MPIsometrique{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                    }{\ifboolKV[Papiers]{Seyes}{%
-                        \MPSeyes{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                      }{\MPCinq{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                      }%
-                    }%
-                  }%
-                }%
-              }%
-            }%
-          }%
+          \PfCPapierTest%
         };%
       \end{tikzpicture}%
     }{%
-      \xintifboolexpr{\useKV[Papiers]{GrillePointe}>0}{%
-        \MPGrillePointe{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}{\PapierGrillePointe}%
-      }{%
-        \xintifboolexpr{\useKV[Papiers]{Grille}>0}{%
-          \MPGrille{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}{\PapierGrille}%
-        }{\ifboolKV[Papiers]{Baseline}{%
-            \MPBaseLineSkip{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-          }{%
-            \ifboolKV[Papiers]{IsometriquePointe}{%
-              \MPIsometriquePointe{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-            }{%
-              \ifboolKV[Papiers]{Triangle}{%
-                \MPTriangulaire{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-              }{\ifboolKV[Papiers]{Millimetre}{%
-                  \MPMillimetre{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                }{\ifboolKV[Papiers]{Isometrique}{%
-                    \MPIsometrique{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                  }{\ifboolKV[Papiers]{Seyes}{%
-                      \MPSeyes{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                    }{\MPCinq{\PapierLargeur}{\PapierHauteur}{\PapierCouleur}%
-                    }%
-                  }%
-                }%
-              }%
-            }%
-          }%
-        }%
-      }%
+      \PfCPapierTest
     }%
   }%
 }%
\ No newline at end of file

Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPavage.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCPavage.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCPavage.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -0,0 +1,1216 @@
+%%%
+% Pavage
+%%%
+\setKVdefault[Pavage]{%
+  Before=false,
+  Niveau=3,
+  Couleur=white,
+  Backgrounds=false,
+  Numerotation=false,
+  Depart=0,
+  Complete=false,
+  After=false,
+  Demo=false,
+  Regulier=false,
+  Cote=1,
+  Lignes=4,
+  Colonnes=4,
+  SemiRegulier=false,
+  Reseau=false,
+  Basei={u*(0.75,0)},
+  Basej={u*(0,0.5)},
+  Quadrilatere=false,
+  Escher=false,
+  Rayon=1,
+  Epaisseur=1,
+  Position=0.5,
+  Ecart=10,
+  Colore=false,
+  CouleurUn=white,
+  CouleurDeux=white,
+  CouleurTrois=white,
+  CouleurQuatre=white
+}%
+\defKV[Pavage]{Motif=\setKV[Pavage]{Before}}%
+\defKV[Pavage]{Traces=\setKV[Pavage]{After}}%
+\defKV[Pavage]{ArrierePlan=\setKV[Pavage]{Backgrounds}}%
+\defKV[Pavage]{CouleurUn=\setKV[Pavage]{Colore}}%
+\defKV[Pavage]{CouleurDeux=\setKV[Pavage]{Colore}}%
+\defKV[Pavage]{CouleurTrois=\setKV[Pavage]{Colore}}%
+\defKV[Pavage]{CouleurQuatre=\setKV[Pavage]{Colore}}%
+
+\def\MPPavageBase{%
+  boolean Before,Numerote,Complete,Backgrounds,After,Demo;
+  Before=\useKV[Pavage]{Before};
+  After=\useKV[Pavage]{After};
+  Numerote=\useKV[Pavage]{Numerotation};
+  Complete=\useKV[Pavage]{Complete};
+  Backgrounds=\useKV[Pavage]{Backgrounds};
+  Demo=\useKV[Pavage]{Demo};
+  color ColPavage,ColArrierePlan;
+  ColPavage=\useKV[Pavage]{Couleur};
+  ColArrierePlan=if Backgrounds:\useKV[Pavage]{ArrierePlan} else:ColPavage fi;
+  Niveau=\useKV[Pavage]{Niveau};
+  Depart=\useKV[Pavage]{Depart};
+  Epaisseur=\useKV[Pavage]{Epaisseur};
+  vardef pavages(expr chemin,tour,coul)=
+  if Backgrounds:
+  fill CadrePavage withcolor ColArrierePlan;
+  fi;
+  save Base;
+  picture Base;
+  pair A,B,C,D;
+  A=u*(0,0);
+  B=u*(1,0);
+  C=u*(1,1);
+  D=u*(0,1);
+  path especes;
+  especes=chemin--rotation(chemin,B,-90)--reverse(rotation(symetrie(chemin,B,C),B,-90))--rotation(chemin,B,90)--cycle;
+  if tour=0:
+    Base=image(
+      trace chemin;
+      );
+  elseif tour=1:
+    Base=image(
+      fill especes withcolor coul;
+      trace especes;
+      A:=A shifted(u*(0,-1));
+      B:=B shifted(u*(1,-1));
+      C:=C shifted(u*(1,0));
+      );
+  elseif tour>=2:
+    Base=pavages(chemin,tour-1,coul);
+    Base:=image(
+      trace Base;
+      trace symetrie(Base,B,C);
+      trace rotation(symetrie(Base,B,C),B,-90);
+      trace rotation(Base,B,90);
+      A:=A shifted(u*(0,-(2**(tour-1))));
+      B:=B shifted(u*(2**(tour-1),-(2**(tour-1))));
+      C:=C shifted(u*(2**(tour-1),0));
+      );
+  fi;
+  Base
+enddef;
+%
+vardef pavagescar(expr chemin,tour,coul)=
+  save BaseCar;
+  picture BaseCar;
+  pair A,B,C,D;
+  A=u*(0,0);
+  B=u*(1,0);
+  C=u*(1,1);
+  D=u*(0,1);
+  if tour=0:
+    BaseCar=image(
+      trace chemin;
+      trace A--B--C--D--cycle dashed dashpattern(on12bp off6bp on3bp off 6bp) withcolor gris;
+      );
+  elseif tour=1:
+    BaseCar=image(
+      trace chemin;
+      drawoptions(dashed evenly);
+      trace rotation(chemin,B,-90);
+      trace reverse(rotation(symetrie(chemin,B,C),B,-90));
+      trace rotation(chemin,B,90);
+      drawoptions();
+      A:=A shifted(u*(0,-1));
+      B:=B shifted(u*(1,-1));
+      C:=C shifted(u*(1,0));
+      trace A--B--C--D--cycle dashed dashpattern(on12bp off6bp on3bp off 6bp) withcolor gris;
+      trace iso(A,D)--iso(B,C) dashed dashpattern(on12bp off6bp on3bp off 6bp) withcolor gris;
+      trace iso(A,B)--iso(C,D) dashed dashpattern(on12bp off6bp on3bp off 6bp) withcolor gris;
+      );
+  elseif tour>=2:
+    BaseCar=image(
+      trace pavages(chemin,tour-1,coul);
+      trace symetrie(pavages(chemin,tour-1,coul),B,C);%coul+0.5blanc
+      trace rotation(symetrie(pavages(chemin,tour-1,coul),B,C),B,-90);
+      trace rotation(pavages(chemin,tour-1,coul),B,90);
+      A:=A shifted(u*(0,-(2**(tour-1))));
+      B:=B shifted(u*(2**(tour-1),-(2**(tour-1))));
+      C:=C shifted(u*(2**(tour-1),0));
+      );
+  fi;
+  BaseCar
+  enddef;
+  %
+  vardef CadrePavage=
+  u*(0,1)--u*(0,-(2**Niveau-1))--u*(2**Niveau,-(2**Niveau-1))--u*(2**(Niveau),1)--cycle
+  enddef;
+  %
+  vardef Numerotation=
+  n:=Depart;
+  pair B;
+  B=u*(1,0);
+  if Complete:
+  for k=0 upto 2**(Niveau)-2:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  if (k mod 2)=0:
+  label(TEX(decimal(n)),B+u*(2l,-k));
+  else:
+  if l<(2**(Niveau-1))-1:
+  label(TEX(decimal(n)),B+u*(2l+1,-k));
+  else:
+  n:=n-1;
+  fi;
+  fi;
+  endfor;
+  endfor;
+  else:
+  for k=0 upto (2**(Niveau-1))-1:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  label(TEX(decimal(n)),B+2u*(l,-k));
+  endfor;
+  endfor;
+  fi;
+  enddef;
+  %
+  vardef NumerotationPDF=
+  n:=Depart;
+  pair B;
+  B=u*(1,0);
+  if Complete:
+  for k=0 upto 2**(Niveau)-2:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  if (k mod 2)=0:
+  label(TEX(decimal(n)),B+u*(2l,-k));
+  else:
+  if l<(2**(Niveau-1))-1:
+  label(LATEX(decimal(n)),B+u*(2l+1,-k));
+  fi;
+  fi;
+  endfor;
+  endfor;
+  else:
+  for k=0 upto (2**(Niveau-1))-1:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  label(LATEX(decimal(n)),B+2u*(l,-k));
+  endfor;
+  endfor;
+  fi;
+  enddef;
+  %
+  vardef PlacePointSupport=
+  n:=Depart;
+  pair K[],L[],M[],N[];
+  K[0]=u*(0,0);
+  M[0]=u*(1,1);
+  if Complete:
+  for k=0 upto 2**(Niveau)-2:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  if (k mod 2)=0:
+  K[n]:=K0+u*(2l,-k);
+  M[n]:=M0+u*(2l,-k);
+  else:
+  if l<(2**(Niveau-1))-1:
+  K[n]:=K0+u*(2l+1,-k);
+  M[n]:=M0+u*(2l+1,-k);
+  else:
+  n:=n-1;
+  fi;
+  fi;
+  endfor;
+  endfor;
+  else:
+  for k=0 upto (2**(Niveau-1))-1:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  K[n]=K[0]+2u*(l,-k);
+  M[n]=M[0]+2u*(l,-k);
+  endfor;
+  endfor;
+  fi;
+  enddef;
+  vardef EffectuerTraces=
+  \useKV[Pavage]{Traces}
+  enddef;
+}%
+
+\def\MPReseauRegulier{%
+  boolean Before,Numerote,Backgrounds,After;
+  Before=\useKV[Pavage]{Before};
+  After=\useKV[Pavage]{After};
+  Numerote=\useKV[Pavage]{Numerotation};
+  Backgrounds=\useKV[Pavage]{Backgrounds};
+  color ColPavage,ColArrierePlan;
+  ColPavage=\useKV[Pavage]{Couleur};
+  ColArrierePlan=if Backgrounds:\useKV[Pavage]{ArrierePlan} else:ColPavage fi;
+  Cote=\useKV[Pavage]{Cote};
+  Lignes=\useKV[Pavage]{Lignes};
+  Colonnes=\useKV[Pavage]{Colonnes};
+  Niveau=\useKV[Pavage]{Niveau};
+  Depart=\useKV[Pavage]{Depart};
+  Epaisseur=\useKV[Pavage]{Epaisseur};
+  pair A[];
+  A1=(0,0);
+  A2-A1=u*Cote*(1,0);
+  vardef PavageRegulier(expr Niv)=
+  picture Retour;
+  if Niv=3:
+  A3=rotation(A2,A1,60);
+  path TriBase,CadrePavage;
+  TriBase=polygone(A1,A2,A3);
+  CadrePavage=polygone(A1,Cote*cm*(Colonnes,0),Cote*cm*(Colonnes,0.5*sqrt(3)*Lignes),Cote*cm*(0,0.5*sqrt(3)*Lignes));
+  Retour=image(
+  fill CadrePavage withcolor ColPavage;
+  for k=0 upto Lignes:
+  for l=-1 upto Colonnes+1:
+  if k mod 2=0:
+  trace TriBase shifted (Cote*cm*(l,0.5*sqrt(3)*k));
+  else:
+  trace TriBase shifted (Cote*cm*(l+0.5,0.5*sqrt(3)*k));
+  fi;
+  endfor;
+  endfor;
+  clip currentpicture to CadrePavage;
+  trace CadrePavage withpen pencircle scaled Epaisseur;
+  );
+  elseif Niv=4:
+  A3=rotation(A1,A2,-90);
+  A4-A3=A1-A2;
+  path QuadriBase,CadrePavage;
+  QuadriBase=polygone(A1,A2,A3,A4);
+  CadrePavage=polygone(A1,Cote*cm*(Colonnes,0),Cote*cm*(Colonnes,Lignes),Cote*cm*(0,Lignes));
+  Retour=image(
+  fill CadrePavage withcolor ColPavage;
+  for k=0 upto Lignes-1:
+  for l=0 upto Colonnes-1:
+  trace QuadriBase shifted (Cote*cm*(l,k));
+  endfor;
+  endfor;
+  clip currentpicture to CadrePavage;
+  trace CadrePavage withpen pencircle scaled Epaisseur;
+  );
+  elseif Niv=6:
+  A3=rotation(A1,A2,-120);
+  A4=rotation(A2,A3,-120);
+  A5=rotation(A3,A4,-120);
+  A6=rotation(A4,A5,-120);  
+  path HexaBase,CadrePavage;
+  HexaBase=polygone(A1,A2,A3,A4,A5,A6);
+  CadrePavage=polygone(Cote*cm*(1,0),Cote*cm*(3*Colonnes,0),Cote*cm*(3*Colonnes,sqrt(3)*(Lignes-1)),Cote*cm*(1,sqrt(3)*(Lignes-1)));
+  Retour=image(%
+  fill CadrePavage withcolor ColPavage;
+  for k=-1 upto 2*Lignes+1:
+  for l=-1 upto Colonnes+1:
+  if k mod 2=1:
+  trace HexaBase shifted (Cote*cm*(3*l,0.5*sqrt(3)*k));
+  else:
+  trace HexaBase shifted (Cote*cm*(1.5+3*l,sqrt(3)+0.5*sqrt(3)*k));
+  fi;
+  endfor;
+  endfor;
+  clip currentpicture to CadrePavage;
+  trace CadrePavage withpen pencircle scaled Epaisseur;
+  );
+  fi;
+  Retour
+  enddef;
+  % 
+  vardef PlacePointSupport=
+  n:=Depart;
+  pair B;pair C;pair vdepla;
+  pair Hexa[],Hexb[],Hexc[],Hexd[],Hexe[],Hexf[];
+  pair Cara[],Carb[],Carc[],Card[];
+  pair Tria[],Trib[],Tric[];
+  path Maille[];
+  if Niveau=3:
+    B=iso(A1,A2,A3);
+    C=symetrie(B,A2,A3);
+    for k=1 upto Lignes:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        if k mod 2=1:
+        nbv:=(k-1)*1.5;
+          if l mod 2=1:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+          else:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3)+(C-B);
+          fi;
+          else:
+          nbv:=(k-1)*1.5+0.5;
+        if l mod 2=1:
+        vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+        else:
+        vdepla:=(Cote*cm*((l-1) div 2),(nbv*Cote*cm*sqrt(3)/3))+(xpart(C-B),-ypart(C-B));
+        fi;
+        fi;
+        if (n mod 2)=0:
+        Tria[n]=rotation(A1,B,180) shifted vdepla;
+        Trib[n]=rotation(A2,B,180) shifted vdepla;
+        Tric[n]=rotation(A3,B,180) shifted vdepla;
+        else:
+        Tria[n]-A1=vdepla;
+        Trib[n]-A2=vdepla;
+        Tric[n]-A3=vdepla;
+        fi;
+        Maille[n]=polygone(Tria[n],Trib[n],Tric[n]);
+  endfor;
+  endfor;
+  elseif Niveau=4:
+  B=iso(A1,A2,A3,A4);
+  for k=1 upto Lignes:
+  for l=1 upto Colonnes:
+  n:=n+1;
+  vdepla:=Cote*cm*((l-1),(k-1));
+  Cara[n]-A1=vdepla;
+  Carb[n]-A2=vdepla;
+  Carc[n]-A3=vdepla;
+  Card[n]-A4=vdepla;
+  Maille[n]=polygone(Cara[n],Carb[n],Carc[n],Card[n]);
+  endfor;
+  endfor;
+  elseif Niveau=6:
+  B=iso(A1,A2,A3,A4,A5,A6);
+  C=symetrie(B,A3,A4);
+    for k=1 upto Lignes-1:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        nbv:=(k-1)*3;
+        if l mod 2=1:
+          vdepla:=(1.5*Cote*cm*(l-1)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3);
+        else:
+          vdepla:=(1.5*Cote*cm*(l-2)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3)+(C-B);
+        fi;
+        if k=Lignes-1:
+        if l mod 2=1:
+        Hexa[n]-A1=vdepla;
+        Hexb[n]-A2=vdepla;
+        Hexc[n]-A3=vdepla;
+        Hexd[n]-A4=vdepla;
+        Hexe[n]-A5=vdepla;
+        Hexf[n]-A6=vdepla;
+        else:
+        n:=n-1;
+        fi;
+        else:
+        Hexa[n]-A1=vdepla;
+        Hexb[n]-A2=vdepla;
+        Hexc[n]-A3=vdepla;
+        Hexd[n]-A4=vdepla;
+        Hexe[n]-A5=vdepla;
+        Hexf[n]-A6=vdepla;
+        fi;
+        Maille[n]:=polygone(Hexa[n],Hexb[n],Hexc[n],Hexd[n],Hexe[n],Hexf[n]);
+      endfor;
+    endfor;
+  fi;
+  enddef;
+  %
+  vardef Numerotation=
+  n:=Depart;
+  pair B;pair C;pair vdepla;
+  if Niveau=3:
+    B=iso(A1,A2,A3);
+    C=symetrie(B,A2,A3);
+    for k=1 upto Lignes:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        if k mod 2=1:
+        nbv:=(k-1)*1.5;
+          if l mod 2=1:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+          else:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3)+(C-B);
+          fi;
+          else:
+          nbv:=(k-1)*1.5+0.5;
+        if l mod 2=1:
+        vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+        else:
+        vdepla:=(Cote*cm*((l-1) div 2),(nbv*Cote*cm*sqrt(3)/3))+(xpart(C-B),-ypart(C-B));
+        fi;
+        fi;
+        label(TEX(decimal(n)),B shifted vdepla);
+    endfor;
+  endfor;
+  elseif Niveau=4:
+  B=iso(A1,A2,A3,A4);
+  for k=1 upto Lignes:
+  for l=1 upto Colonnes:
+  n:=n+1;
+  vdepla:=Cote*cm*((l-1),(k-1));
+  label(TEX(decimal(n)),B shifted vdepla);
+  endfor;
+  endfor;
+  elseif Niveau=6:
+  B=iso(A1,A2,A3,A4,A5,A6);
+  C=symetrie(B,A3,A4);
+    for k=1 upto Lignes-1:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        nbv:=(k-1)*3;
+        if l mod 2=1:
+          vdepla:=(1.5*Cote*cm*(l-1)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3);
+        else:
+          vdepla:=(1.5*Cote*cm*(l-2)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3)+(C-B);
+        fi;
+        if k=Lignes-1:
+        if l mod 2=1:
+        label(TEX(decimal(n)),B shifted vdepla);
+        else:
+        n:=n-1;
+        fi;
+        else:
+        label(TEX(decimal(n)),B shifted vdepla);
+        fi;
+      endfor;
+    endfor;
+  fi;
+  enddef;
+  %
+  vardef NumerotationPDF=
+  n:=Depart;
+  pair B;pair C;pair vdepla;
+  if Niveau=3:
+    B=iso(A1,A2,A3);
+    C=symetrie(B,A2,A3);
+    for k=1 upto Lignes:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        if k mod 2=1:
+        nbv:=(k-1)*1.5;
+          if l mod 2=1:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+          else:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3)+(C-B);
+          fi;
+          else:
+          nbv:=(k-1)*1.5+0.5;
+        if l mod 2=1:
+        vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+        else:
+        vdepla:=(Cote*cm*((l-1) div 2),(nbv*Cote*cm*sqrt(3)/3))+(xpart(C-B),-ypart(C-B));
+        fi;
+        fi;
+        label(LATEX(decimal(n)),B shifted vdepla);
+    endfor;
+  endfor;
+  elseif Niveau=4:
+  B=iso(A1,A2,A3,A4);
+  for k=1 upto Lignes:
+  for l=1 upto Colonnes:
+  n:=n+1;
+  vdepla:=Cote*cm*((l-1),(k-1));
+  label(LATEX(decimal(n)),B shifted vdepla);
+  endfor;
+  endfor;
+  elseif Niveau=6:
+  B=iso(A1,A2,A3,A4,A5,A6);
+  C=symetrie(B,A3,A4);
+    for k=1 upto Lignes-1:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        nbv:=(k-1)*3;
+        if l mod 2=1:
+          vdepla:=(1.5*Cote*cm*(l-1)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3);
+        else:
+          vdepla:=(1.5*Cote*cm*(l-2)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3)+(C-B);
+        fi;
+        if k=Lignes-1:
+        if l mod 2=1:
+        label(LATEX(decimal(n)),B shifted vdepla);
+        else:
+        n:=n-1;
+        fi;
+        else:
+        label(LATEX(decimal(n)),B shifted vdepla);
+        fi;
+      endfor;
+    endfor;
+  fi;
+  enddef;
+  vardef EffectuerTraces=
+  \useKV[Pavage]{Traces}
+  enddef;
+}%
+
+\def\MPReseauCode{%
+  boolean Before,Numerote,Backgrounds,After;
+  Before=\useKV[Pavage]{Before};
+  After=\useKV[Pavage]{After};
+  Numerote=\useKV[Pavage]{Numerotation};
+  Backgrounds=\useKV[Pavage]{Backgrounds};
+  color ColPavage,ColArrierePlan;
+  ColPavage=\useKV[Pavage]{Couleur};
+  ColArrierePlan=if Backgrounds:\useKV[Pavage]{ArrierePlan} else:ColPavage fi;
+  Cote=\useKV[Pavage]{Cote};
+  Lignes=\useKV[Pavage]{Lignes};
+  Colonnes=\useKV[Pavage]{Colonnes};
+  Niveau=\useKV[Pavage]{Niveau};
+  Depart=\useKV[Pavage]{Depart};
+  Epaisseur=\useKV[Pavage]{Epaisseur};
+  pair basei,basej;
+  basei=\useKV[Pavage]{Basei};
+  basej=\useKV[Pavage]{Basej};
+  vardef PavageReseau=
+  for k=0 upto Lignes-1:
+  for l=0 upto Colonnes -1:
+  trace Motif shifted (k*basei+l*basej);
+  endfor;
+  endfor;
+  enddef;
+  vardef Numerotation=
+  n:=Depart;
+  k:=0;
+  pair A[],B[];
+  A[0]=point(0) of Motif;
+  B[0]=A[0];
+  forever:
+  k:=k+1;
+  A[k]=point(k) of Motif;
+  B[0]:=B[0]+A[k];
+  exitif A[k]=A[0];
+  endfor;
+  B[0]:=B[0]/k;
+  for k=0 upto Lignes-1:
+  for l=0 upto Colonnes -1:
+  n:=n+1;
+  label(decimal(n),B[0] shifted(k*basei+l*basej));
+  endfor;
+  endfor;
+  enddef;
+  vardef PlacePointSupport=
+  pair M[][];
+  path Maille[];
+  n:=Depart;
+  k:=0;
+  pair A[],B[];
+  A[0]=point(0) of Motif;
+  forever:
+  k:=k+1;
+  A[k]=point(k) of Motif;
+  B[0]:=B[0]+A[k];
+  exitif A[k]=A[0];
+  endfor;
+  B[0]:=B[0]/k;
+  NbSommet:=k;
+  for k=0 upto Lignes-1:
+  for l=0 upto Colonnes -1:
+  n:=n+1;
+  for m=1 upto NbSommet:
+  M[n][m]=A[m] shifted (k*basei+l*basej);
+  endfor;
+  Maille[n]=polygone(M[n][1] for r=2 upto NbSommet:,M[n][r] endfor);
+  endfor;
+  endfor;
+  enddef;
+  vardef EffectuerTraces=
+  \useKV[Pavage]{Traces}
+  enddef;
+}%
+
+\def\MPPeriodiqueCode{%
+  boolean Before,Numerote,Backgrounds,After;
+  Before=\useKV[Pavage]{Before};
+  After=\useKV[Pavage]{After};
+  Numerote=\useKV[Pavage]{Numerotation};
+  Backgrounds=\useKV[Pavage]{Backgrounds};
+  color ColPavage,ColArrierePlan;
+  ColPavage=\useKV[Pavage]{Couleur};
+  ColArrierePlan=if Backgrounds:\useKV[Pavage]{ArrierePlan} else:ColPavage fi;
+  Cote=\useKV[Pavage]{Cote};
+  Lignes=\useKV[Pavage]{Lignes};
+  Colonnes=\useKV[Pavage]{Colonnes};
+  Niveau=\useKV[Pavage]{Niveau};
+  Depart=\useKV[Pavage]{Depart};
+  Epaisseur=\useKV[Pavage]{Epaisseur};
+  pair basei,basej;
+  vardef PavagePeriodique=
+  basei=iso(A1,A2)-iso(A1,A0);
+  basej=iso(A0,A3)-iso(A1,A0);
+  path CadrePavage;
+  pair Cpa[];
+  Cpa1=(0,ypart(-2*basej));
+  Cpa2=(xpart(2*Colonnes*basei),ypart(-2*basej));
+  Cpa3=(xpart(2*Colonnes*basei),ypart(2*Lignes*basej));
+  Cpa4=(0,ypart(2*Lignes*basej));
+  CadrePavage=Cpa1--Cpa2--Cpa3--Cpa4--cycle;
+  picture BlocContour,BlocPavage;
+  BlocContour=image(
+  for k=-Lignes upto Lignes+1:
+  for l=-1 upto Colonnes+1:
+  if ColPavage<>white:
+  fill Motif shifted (2*l*basei+2*k*basej) withcolor ColPavage;
+  fill symetrie(Motif,iso(A1,A2)) shifted (2*l*basei+2*k*basej) withcolor ColPavage;
+  fi;
+  trace Motif shifted (2*l*basei+2*k*basej);
+  trace symetrie(Motif,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  endfor;
+  endfor;
+  drawoptions();
+  );
+  BlocPavage=image(
+  trace BlocContour;
+  clip currentpicture to CadrePavage;
+  trace CadrePavage withpen pencircle scaled Epaisseur;
+  );
+  BlocPavage
+  enddef;
+  vardef Numerotation=
+  n:=-1;
+  pair ISO;
+  for k=-Lignes upto Lignes+1:
+  for l=-1 upto Colonnes+1:
+  n:=n+2;
+  ISO:=B[0] shifted (2*l*basei+2*k*basej);
+  if (xpart(ISO)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISO)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISO)>ypart(Cpa1+u*(0.2,0))) and (ypart(ISO)<ypart(Cpa4-u*(0.2,0))):
+  label(TEX(decimal(n)),ISO);
+  else:
+  n:=n-2;
+  fi;
+  endfor;
+  endfor;
+  %2eme tour
+  n:=-1;
+  for k=-Lignes upto Lignes+1:
+  for l=-1 upto Colonnes+1:
+  n:=n+2;
+  ISO:=symetrie(B[0],iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  if (xpart(ISO)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISO)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISO)>ypart(Cpa1+u*(0,0.2))) and (ypart(ISO)<ypart(Cpa4-u*(0,0.2))):
+  label(TEX(decimal(n+1)),ISO);
+  else:
+  n:=n-2;
+  fi;
+  endfor;
+  endfor;
+  enddef;
+  vardef PlacePointSupport=
+  path Maille[];
+  pair QuadA[],QuadB[],QuadC[],QuadD[];
+  n:=-1;
+  pair ISO;
+  for k=-Lignes upto Lignes+1:
+  for l=-1 upto Colonnes+1:
+  n:=n+2;
+  ISO:=B[0] shifted (2*l*basei+2*k*basej);
+  if (xpart(ISO)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISO)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISO)>ypart(Cpa1+u*(0,0.2))) and (ypart(ISO)<ypart(Cpa4-u*(0,0.2))):
+  QuadA[n]=A0 shifted (2*l*basei+2*k*basej);
+  QuadB[n]=A1 shifted (2*l*basei+2*k*basej);
+  QuadC[n]=A2 shifted (2*l*basei+2*k*basej);
+  QuadD[n]=A3 shifted (2*l*basei+2*k*basej);
+  Maille[n]=polygone(QuadA[n],QuadB[n],QuadC[n],QuadD[n]);
+  else:
+  n:=n-2;
+  fi;
+  endfor;
+  endfor;
+  %2eme tour
+  n:=-1;
+  for k=-Lignes upto Lignes+1:
+  for l=-1 upto Colonnes+1:
+  n:=n+2;
+  ISO:=symetrie(B[0],iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  if (xpart(ISO)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISO)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISO)>ypart(Cpa1+u*(0,0.2))) and (ypart(ISO)<ypart(Cpa4-u*(0,0.2))):
+  QuadA[n+1]=symetrie(A0,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  QuadB[n+1]=symetrie(A1,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  QuadC[n+1]=symetrie(A2,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  QuadD[n+1]=symetrie(A3,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  Maille[n+1]=polygone(QuadA[n+1],QuadB[n+1],QuadC[n+1],QuadD[n+1]);
+  else:
+  n:=n-2;
+  fi;
+  endfor;
+  endfor;
+  enddef;
+  vardef EffectuerTraces=
+  \useKV[Pavage]{Traces}
+  enddef;
+}%
+
+\def\MPPavageEscherCode{%
+  boolean Before,Numerote,Backgrounds,After,Colore;
+  Before=\useKV[Pavage]{Before};
+  After=\useKV[Pavage]{After};
+  Numerote=\useKV[Pavage]{Numerotation};
+  Backgrounds=\useKV[Pavage]{Backgrounds};
+  Colore=\useKV[Pavage]{Colore};
+  color ColPavage,ColArrierePlan,CouleurUn,CouleurDeux,CouleurTrois,CouleurQuatre;
+  if Colore:
+  CouleurUn=\useKV[Pavage]{CouleurUn};
+  CouleurDeux=\useKV[Pavage]{CouleurDeux};
+  CouleurTrois=\useKV[Pavage]{CouleurTrois};
+  CouleurQuatre=\useKV[Pavage]{CouleurQuatre};
+  fi;
+  ColPavage=\useKV[Pavage]{Couleur};
+  ColArrierePlan=if Backgrounds:\useKV[Pavage]{ArrierePlan} else:ColPavage fi;
+  Cote=\useKV[Pavage]{Cote};
+  Rayon=\useKV[Pavage]{Rayon};
+  Lignes=\useKV[Pavage]{Lignes};
+  Colonnes=\useKV[Pavage]{Colonnes};
+  Niveau=\useKV[Pavage]{Niveau};
+  Depart=\useKV[Pavage]{Depart};
+  Ecart=\useKV[Pavage]{Ecart};
+  Position=\useKV[Pavage]{Position};
+  Epaisseur=\useKV[Pavage]{Epaisseur};
+  pair basei,basej;
+  picture Motif;
+  vardef PavageEscher=
+  path cc;
+  cc=cercles((0,0),u*Rayon);
+  if Niveau=3:
+  pair O[];
+  O1=pointarc(cc,0);
+  O3=pointarc(cc,120);
+  O5=pointarc(cc,240);
+  O2=Position[O3,O1]+Ecart*unitvector((O3-O1) rotated -90);
+  O4=rotation(O2,O3,-120);
+  O6=rotation(O4,O5,-120);
+  picture Motif;
+  Motif=image(
+  if Colore:
+  if known CouleurUn: fill polygone(O1,O2,O3,O4,O5,O6) withcolor CouleurUn fi;
+  if known CouleurDeux: fill rotation(polygone(O1,O2,O3,O4,O5,O6),O1,120) withcolor CouleurDeux fi;
+  if known CouleurTrois:fill rotation(polygone(O1,O2,O3,O4,O5,O6),O1,-120) withcolor CouleurTrois fi;
+  fi;
+  trace polygone(O1,O2,O3,O4,O5,O6);
+  trace rotation(polygone(O1,O2,O3,O4,O5,O6),O1,120);
+  trace rotation(polygone(O1,O2,O3,O4,O5,O6),O1,-120);
+  );
+  basei=(rotation(O2,O1,-120)-O4);
+  basej:=(rotation(O5,O1,-120)-O5);
+  elseif Niveau=4:
+  pair O[];
+  O1=pointarc(cc,0);
+  O3=pointarc(cc,90);
+  O5=pointarc(cc,180);
+  O7=pointarc(cc,270);
+  O2=Position[O3,O1]+Ecart*unitvector((O3-O1) rotated -90);
+  O4=rotation(O2,O3,-90);
+  O6=rotation(O4,O5,-90);
+  O8=rotation(O6,O7,-90);
+  picture Motif;
+  Motif=image(
+  if Colore:
+  if known CouleurUn: fill polygone(O1,O2,O3,O4,O5,O6,O7,O8) withcolor CouleurUn fi;
+  if known CouleurDeux: fill rotation(polygone(O1,O2,O3,O4,O5,O6,O7,O8),O1,90) withcolor CouleurDeux fi;
+  if known CouleurTrois:fill rotation(polygone(O1,O2,O3,O4,O5,O6,O7,O8),O1,180) withcolor CouleurTrois fi;
+  if known CouleurQuatre:fill rotation(polygone(O1,O2,O3,O4,O5,O6,O7,O8),O1,270) withcolor CouleurQuatre fi;
+  fi;
+  trace polygone(O1,O2,O3,O4,O5,O6,O7,O8);
+  trace rotation(polygone(O1,O2,O3,O4,O5,O6,O7,O8),O1,90);
+  trace rotation(polygone(O1,O2,O3,O4,O5,O6,O7,O8),O1,180);
+  trace rotation(polygone(O1,O2,O3,O4,O5,O6,O7,O8),O1,270);
+  );
+  basei=(rotation(O5,O1,180)-O5);
+  basej:=(rotation(O5,O1,-90)-O5);
+  elseif Niveau=6:
+  pair O[];
+  O1=pointarc(cc,0);
+  O3=pointarc(cc,60);
+  O5=pointarc(cc,120);
+  O7=pointarc(cc,180);
+  O9=pointarc(cc,240);
+  O11=pointarc(cc,300);
+  O2=Position[O3,O1]+Ecart*unitvector((O3-O1) rotated -90);
+  O4=rotation(O2,O3,-120);
+  O6=rotation(O4,O5,-120);
+  O8=rotation(O6,O7,-120);
+  O10=rotation(O8,O9,-120);
+  O12=rotation(O10,O11,-120);
+  picture Motif;
+  Motif=image(
+  if Colore:
+  if known CouleurUn: fill polygone(O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12) withcolor CouleurUn fi;
+  if known CouleurDeux: fill rotation(polygone(O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12),O1,120) withcolor CouleurDeux fi;
+  if known CouleurTrois: fill rotation(polygone(O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12),O1,-120) withcolor CouleurTrois fi;
+  fi;
+  trace polygone(O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12);
+  trace rotation(polygone(O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12),O1,120);
+  trace rotation(polygone(O1,O2,O3,O4,O5,O6,O7,O8,O9,O10,O11,O12),O1,-120);
+  );
+  basei=(rotation(O4,O1,-120)-O6);
+  basej:=(rotation(O9,O1,-120)-O9);
+  fi;
+  path CadrePavage;
+  pair Cpa[];
+  Cpa1=(0,ypart(-2*basej));
+  Cpa2=(xpart(2*Colonnes*basei),ypart(-2*basej));
+  Cpa3=(xpart(2*Colonnes*basei),ypart(2*Lignes*basej));
+  Cpa4=(0,ypart(2*Lignes*basej));
+  CadrePavage=Cpa1--Cpa2--Cpa3--Cpa4--cycle;
+  picture BlocContour,BlocPavage;
+  BlocContour=image(
+  for k=-2*Lignes upto 2*Lignes:
+  for l=-2*Colonnes upto 2*Colonnes:
+  trace Motif shifted (l*basei+k*basej);
+  endfor;
+  endfor;
+  );
+  BlocPavage=image(
+  trace BlocContour;
+  clip currentpicture to CadrePavage;
+  trace CadrePavage withpen pencircle scaled Epaisseur;
+  );
+  BlocPavage
+  enddef;
+  vardef BaryMotif(expr nimech)=
+  save Escherbary;
+  pair Escherbary,EB[],EBSom;
+  tour:=0;
+  EB[0]=point(0) of nimech;
+  EBSom=(0,0);
+  forever:
+  tour:=tour+1;
+  EB[tour]=point(tour) of nimech;
+  EBSom:=EBSom+EB[tour];
+  exitif EB[tour]=EB[0];
+  endfor;
+  Escherbary=EBSom/tour;
+  Escherbary
+  enddef;
+  % 
+  vardef Numerotation=
+  pair ISORetiens;
+  for k=1 upto TotalMaille:
+  ISORetiens:=BaryMotif(Maille[k]);
+  label(TEX(""&decimal(k)&""),ISORetiens);
+  endfor;
+  enddef;
+  %
+  vardef AssocierPoint(expr nbpt,ll,kk,aanngg)=
+  PointE[nbpt][1]=rotation(O1,O1,aanngg) shifted (ll*basei+kk*basej);
+  PointE[nbpt][2]=rotation(O2,O1,aanngg) shifted (ll*basei+kk*basej);
+  PointE[nbpt][3]=rotation(O3,O1,aanngg) shifted (ll*basei+kk*basej);
+  PointE[nbpt][4]=rotation(O4,O1,aanngg) shifted (ll*basei+kk*basej);
+  PointE[nbpt][5]=rotation(O5,O1,aanngg) shifted (ll*basei+kk*basej);
+  PointE[nbpt][6]=rotation(O6,O1,aanngg) shifted (ll*basei+kk*basej);
+  if Niveau>3:
+  PointE[nbpt][7]=rotation(O7,O1,aanngg) shifted (ll*basei+kk*basej);
+  PointE[nbpt][8]=rotation(O8,O1,aanngg) shifted (ll*basei+kk*basej);
+  fi;
+  if Niveau>4:
+  PointE[nbpt][9]=rotation(O9,O1,aanngg) shifted (ll*basei+kk*basej);
+  PointE[nbpt][10]=rotation(O10,O1,aanngg) shifted (ll*basei+kk*basej);
+  PointE[nbpt][11]=rotation(O11,O1,aanngg) shifted (ll*basei+kk*basej);
+  PointE[nbpt][12]=rotation(O12,O1,aanngg) shifted (ll*basei+kk*basej);
+  fi;
+  enddef;
+  vardef AssocierMaille(expr nbpt)=
+  Maille[nbpt]=if Niveau=3:
+  polygone(PointE[nbpt][1],PointE[nbpt][2],PointE[nbpt][3],PointE[nbpt][4],PointE[nbpt][5],PointE[nbpt][6])
+  elseif Niveau=4:
+  polygone(PointE[nbpt][1],PointE[nbpt][2],PointE[nbpt][3],PointE[nbpt][4],PointE[nbpt][5],PointE[nbpt][6],PointE[nbpt][7],PointE[nbpt][8])
+  elseif Niveau=6:
+  polygone(PointE[nbpt][1],PointE[nbpt][2],PointE[nbpt][3],PointE[nbpt][4],PointE[nbpt][5],PointE[nbpt][6],PointE[nbpt][7],PointE[nbpt][8],PointE[nbpt][9],PointE[nbpt][10],PointE[nbpt][11],PointE[nbpt][12])
+  fi;
+  enddef;
+  vardef PlacePointSupport=
+  pair PointE[][];
+  path Maille[];
+  pair ISO[];
+  if Niveau=3:
+  ISO1:=(0,0);
+  ISO2=rotation(ISO1,O1,120);
+  ISO3=rotation(ISO1,O1,-120);
+  basei=(rotation(O2,O1,-120)-O4);
+  basej:=(rotation(O5,O1,-120)-O5);
+  elseif Niveau=4:
+  ISO1=(0,0);
+  ISO2=rotation(ISO1,O1,90);
+  ISO3=rotation(ISO1,O1,180);
+  ISO4=rotation(ISO1,O1,270);
+  basei=(rotation(O5,O1,180)-O5);
+  basej:=(rotation(O5,O1,-90)-O5);
+  elseif Niveau=6:
+  ISO1=(0,0);
+  ISO2=rotation(ISO1,O1,120);
+  ISO3=rotation(ISO1,O1,-120);
+  basei=(rotation(O4,O1,-120)-O6);
+  basej:=(rotation(O9,O1,-120)-O9);
+  fi;
+  n:=0;
+  pair ISORetiens;
+  for k=-2*Lignes upto 2*Lignes:
+  for l=-2*Colonnes upto 2*Colonnes:
+  n:=n+1;
+  ISORetiens:=ISO1 shifted (l*basei+k*basej);
+  if (xpart(ISORetiens)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISORetiens)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISORetiens)>ypart(Cpa1+u*(0,0.2))) and (ypart(ISORetiens)<ypart(Cpa4-u*(0,0.2))):
+  AssocierPoint(n,l,k,0);
+  AssocierMaille(n);
+  else:
+  n:=n-1;
+  fi;
+  n:=n+1;
+  ISORetiens:=ISO2 shifted (l*basei+k*basej);
+  if (xpart(ISORetiens)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISORetiens)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISORetiens)>ypart(Cpa1+u*(0,0.2))) and (ypart(ISORetiens)<ypart(Cpa4-u*(0,0.2))):
+  if Niveau=4:
+  AssocierPoint(n,l,k,90);
+  else:
+  AssocierPoint(n,l,k,120);
+  fi;
+  AssocierMaille(n);
+  else:
+  n:=n-1;
+  fi;
+  n:=n+1;
+  ISORetiens:=ISO3 shifted (l*basei+k*basej);
+  if (xpart(ISORetiens)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISORetiens)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISORetiens)>ypart(Cpa1+u*(0,0.2))) and (ypart(ISORetiens)<ypart(Cpa4-u*(0,0.2))):
+  if Niveau=4:
+  AssocierPoint(n,l,k,180);
+  else:
+  AssocierPoint(n,l,k,-120);
+  fi;
+  AssocierMaille(n);
+  else:
+  n:=n-1;
+  fi;
+  if Niveau=4:
+  n:=n+1;
+  ISORetiens:=ISO4 shifted (l*basei+k*basej);
+  if (xpart(ISORetiens)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISORetiens)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISORetiens)>ypart(Cpa1+u*(0,0.2))) and (ypart(ISORetiens)<ypart(Cpa4-u*(0,0.2))):
+  AssocierPoint(n,l,k,270);
+  AssocierMaille(n);
+  else:
+  n:=n-1;
+  fi;
+  fi;
+  endfor;
+  endfor;
+  TotalMaille=n;
+  enddef;
+  %
+  vardef EffectuerTraces=
+  \useKV[Pavage]{Traces}
+  enddef;
+}%
+
+\def\MPPavageEscher{%
+  \ifluatex%
+  \mplibforcehmode%
+  \begin{mplibcode}
+    \MPPavageEscherCode
+    picture Motif;
+    trace PavageEscher;
+    PlacePointSupport;
+    if After:
+    EffectuerTraces;
+    fi;
+    if Numerote:
+    Numerotation;
+    fi;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\MPPavageEscherCode}]
+    picture Motif;
+    trace PavageEscher;
+    PlacePointSupport;
+    if After:
+    EffectuerTraces;
+    fi;
+    if Numerote:
+    Numerotation;
+    fi;
+  \end{mpost}
+  \fi%
+}%
+
+\def\MPPeriodique{%
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \MPPeriodiqueCode
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=(0,0)--u*(1,-2)--u*(2,0.5)--u*(0.75,1)--cycle;
+    fi;
+    pair A[],B[];
+    A[0]=point(0) of Motif;
+    B[0]=A[0];
+    k:=0;
+    forever:
+    k:=k+1;
+    A[k]=point(k) of Motif;
+    B[0]:=B[0]+A[k];
+    exitif A[k]=A[0];
+    endfor;
+    B[0]:=B[0]/k;
+    trace PavagePeriodique;
+    PlacePointSupport;
+    if After:
+    EffectuerTraces;
+    fi;
+    if Numerote:
+    Numerotation;
+    fi;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[\MPPeriodiqueCode]
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=(0,0)--u*(1,-2)--u*(2,0.5)--u*(0.75,1)--cycle;
+    fi;
+    pair A[],B[];
+    A[0]=point(0) of Motif;
+    B[0]=A[0];
+    k:=0;
+    forever:
+    k:=k+1;
+    A[k]=point(k) of Motif;
+    B[0]:=B[0]+A[k];
+    exitif A[k]=A[0];
+    endfor;
+    B[0]:=B[0]/k;
+    trace PavagePeriodique;
+    PlacePointSupport;
+%    if Numerote:
+%    Numerotation;
+%    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mpost}
+  \fi
+}%
+
+\def\MPReseau{%
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \MPReseauCode
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=u*(0,0)--u*(0.75,0)--u*(1,0.5)--u*(0.25,0.5)--cycle;
+    fi;
+    PavageReseau;
+    PlacePointSupport;
+    if After:
+    EffectuerTraces;
+    fi;
+    if Numerote:
+    Numerotation;
+    fi;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\MPReseauCode}]
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=u*(0,0)--u*(0.75,0)--u*(1,0.5)--u*(0.25,0.5)--cycle;
+    fi;
+    PavageReseau;
+    PlacePointSupport;
+    if After:
+    EffectuerTraces;
+    fi;
+    if Numerote:
+    Numerotation;
+    fi;
+  \end{mpost}
+  \fi
+}%
+
+\def\MPRegulier{%
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \MPReseauRegulier
+    trace PavageRegulier(Niveau);
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\MPReseauRegulier}]
+    trace PavageRegulier(Niveau);
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mpost}
+  \fi
+}%
+
+\def\MPPavage{%
+  \ifluatex%
+  \mplibforcehmode%
+  \begin{mplibcode}%
+    \MPPavageBase
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=u*(0,0)..u*(0.25,.1)..u*(0.5,0.7)..u*(1,1);
+    fi;
+    if Demo:
+    trace pavagescar(Motif,0,ColPavage);
+    else:
+    trace pavages(Motif,Niveau,ColPavage);
+    fi;
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+    if Demo=false:
+    trace CadrePavage withpen pencircle scaled Epaisseur;
+    fi;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\MPPavageBase}]
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=u*(0,0)..u*(0.25,.1)..u*(0.5,0.7)..u*(1,1);
+    fi;
+    trace pavages(Motif,Niveau,ColPavage);
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+    trace CadrePavage withpen pencircle scaled Epaisseur;
+  \end{mpost}
+  \fi%
+}%
+
+\NewDocumentCommand\Pavage{o}{%
+  \useKVdefault[Pavage]%
+  \setKV[Pavage]{#1}%
+  \ifboolKV[Pavage]{Regulier}{%
+    \MPRegulier%
+  }{%
+    \ifboolKV[Pavage]{SemiRegulier}{%
+      % 
+    }{%
+      \ifboolKV[Pavage]{Reseau}{%
+        \MPReseau%
+      }{%
+        \ifboolKV[Pavage]{Quadrilatere}{%
+          \MPPeriodique%
+        }{%
+          \ifboolKV[Pavage]{Escher}{%
+            \MPPavageEscher%
+          }{%
+            \MPPavage%
+          }%
+        }%
+      }%
+    }%
+  }%
+}%
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPavage.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPavageAvecMotifImage.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCPavageAvecMotifImage.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCPavageAvecMotifImage.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -0,0 +1,1040 @@
+%%%
+% Pavage
+%%%
+\setKVdefault[Pavage]{%
+  Before=false,
+  Niveau=3,
+  Couleur=orange,
+  Backgrounds=false,
+  Numerotation=false,
+  Depart=0,
+  Complete=false,
+  After=false,
+  Demo=false,
+  Regulier=false,
+  Cote=1,
+  Lignes=4,
+  Colonnes=4,
+  SemiRegulier=false,
+  Reseau=false,
+  Basei={u*(0.75,0)},
+  Basej={u*(0,0.5)},
+  Periodique=false,
+  Image=false
+}%
+\defKV[Pavage]{Motif=\setKV[Pavage]{Before}}
+\defKV[Pavage]{Traces=\setKV[Pavage]{After}}
+\defKV[Pavage]{ArrierePlan=\setKV[Pavage]{Backgrounds}}
+
+\def\MPPavageBase{%
+  boolean Before,Numerote,Complete,Backgrounds,After,Demo;
+  Before=\useKV[Pavage]{Before};
+  After=\useKV[Pavage]{After};
+  Numerote=\useKV[Pavage]{Numerotation};
+  Complete=\useKV[Pavage]{Complete};
+  Backgrounds=\useKV[Pavage]{Backgrounds};
+  Demo=\useKV[Pavage]{Demo};
+  color ColPavage,ColArrierePlan;
+  ColPavage=\useKV[Pavage]{Couleur};
+  ColArrierePlan=if Backgrounds:\useKV[Pavage]{ArrierePlan} else:ColPavage fi;
+  Niveau=\useKV[Pavage]{Niveau};
+  Depart=\useKV[Pavage]{Depart};
+  vardef pavages(expr chemin,tour,coul)=
+  if Backgrounds:
+  fill CadrePavage withcolor ColArrierePlan;
+  trace CadrePavage;
+  fi;
+  save Base;
+  picture Base;
+  pair A,B,C,D;
+  A=u*(0,0);
+  B=u*(1,0);
+  C=u*(1,1);
+  D=u*(0,1);
+  path especes;
+  especes=chemin--rotation(chemin,B,-90)--reverse(rotation(symetrie(chemin,B,C),B,-90))--rotation(chemin,B,90)--cycle;
+  if tour=0:
+    Base=image(
+      trace chemin;
+      );
+  elseif tour=1:
+    Base=image(
+      fill especes withcolor coul;
+      trace especes;
+      A:=A shifted(u*(0,-1));
+      B:=B shifted(u*(1,-1));
+      C:=C shifted(u*(1,0));
+      );
+  elseif tour>=2:
+    Base=pavages(chemin,tour-1,coul);
+    Base:=image(
+      trace Base;
+      trace symetrie(Base,B,C);
+      trace rotation(symetrie(Base,B,C),B,-90);
+      trace rotation(Base,B,90);
+      A:=A shifted(u*(0,-(2**(tour-1))));
+      B:=B shifted(u*(2**(tour-1),-(2**(tour-1))));
+      C:=C shifted(u*(2**(tour-1),0));
+      );
+  fi;
+  Base
+enddef;
+%
+vardef pavagescar(expr chemin,tour,coul)=
+  save BaseCar;
+  picture BaseCar;
+  pair A,B,C,D;
+  A=u*(0,0);
+  B=u*(1,0);
+  C=u*(1,1);
+  D=u*(0,1);
+  if tour=0:
+    BaseCar=image(
+      trace chemin;
+      trace A--B--C--D--cycle dashed dashpattern(on12bp off6bp on3bp off 6bp) withcolor gris;
+      );
+  elseif tour=1:
+    BaseCar=image(
+      trace chemin;
+      drawoptions(dashed evenly);
+      trace rotation(chemin,B,-90);
+      trace reverse(rotation(symetrie(chemin,B,C),B,-90));
+      trace rotation(chemin,B,90);
+      drawoptions();
+      A:=A shifted(u*(0,-1));
+      B:=B shifted(u*(1,-1));
+      C:=C shifted(u*(1,0));
+      trace A--B--C--D--cycle dashed dashpattern(on12bp off6bp on3bp off 6bp) withcolor gris;
+      trace iso(A,D)--iso(B,C) dashed dashpattern(on12bp off6bp on3bp off 6bp) withcolor gris;
+      trace iso(A,B)--iso(C,D) dashed dashpattern(on12bp off6bp on3bp off 6bp) withcolor gris;
+      );
+  elseif tour>=2:
+    BaseCar=image(
+      trace pavages(chemin,tour-1,coul);
+      trace symetrie(pavages(chemin,tour-1,coul),B,C);%coul+0.5blanc
+      trace rotation(symetrie(pavages(chemin,tour-1,coul),B,C),B,-90);
+      trace rotation(pavages(chemin,tour-1,coul),B,90);
+      A:=A shifted(u*(0,-(2**(tour-1))));
+      B:=B shifted(u*(2**(tour-1),-(2**(tour-1))));
+      C:=C shifted(u*(2**(tour-1),0));
+      );
+  fi;
+  BaseCar
+  enddef;
+  %
+  vardef CadrePavage=
+  u*(0,1)--u*(0,-(2**Niveau-1))--u*(2**Niveau,-(2**Niveau-1))--u*(2**(Niveau),1)--cycle
+  enddef;
+  %
+  vardef Numerotation=
+  n:=Depart;
+  pair B;
+  B=u*(1,0);
+  if Complete:
+  for k=0 upto 2**(Niveau)-2:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  if (k mod 2)=0:
+  label(TEX(decimal(n)),B+u*(2l,-k));
+  else:
+  if l<(2**(Niveau-1))-1:
+  label(TEX(decimal(n)),B+u*(2l+1,-k));
+  else:
+  n:=n-1;
+  fi;
+  fi;
+  endfor;
+  endfor;
+  else:
+  for k=0 upto (2**(Niveau-1))-1:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  label(TEX(decimal(n)),B+2u*(l,-k));
+  endfor;
+  endfor;
+  fi;
+  enddef;
+  %
+  vardef NumerotationPDF=
+  n:=Depart;
+  pair B;
+  B=u*(1,0);
+  if Complete:
+  for k=0 upto 2**(Niveau)-2:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  if (k mod 2)=0:
+  label(TEX(decimal(n)),B+u*(2l,-k));
+  else:
+  if l<(2**(Niveau-1))-1:
+  label(LATEX(decimal(n)),B+u*(2l+1,-k));
+  fi;
+  fi;
+  endfor;
+  endfor;
+  else:
+  for k=0 upto (2**(Niveau-1))-1:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  label(LATEX(decimal(n)),B+2u*(l,-k));
+  endfor;
+  endfor;
+  fi;
+  enddef;
+  %
+  vardef PlacePointSupport=
+  n:=Depart;
+  pair K[],L[],M[],N[];
+  K[0]=u*(0,0);
+  M[0]=u*(1,1);
+  if Complete:
+  for k=0 upto 2**(Niveau)-2:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  if (k mod 2)=0:
+  K[n]:=K0+u*(2l,-k);
+  M[n]:=M0+u*(2l,-k);
+  else:
+  if l<(2**(Niveau-1))-1:
+  K[n]:=K0+u*(2l+1,-k);
+  M[n]:=M0+u*(2l+1,-k);
+  else:
+  n:=n-1;
+  fi;
+  fi;
+  endfor;
+  endfor;
+  else:
+  for k=0 upto (2**(Niveau-1))-1:
+  for l=0 upto (2**(Niveau-1))-1:
+  n:=n+1;
+  K[n]=K[0]+2u*(l,-k);
+  M[n]=M[0]+2u*(l,-k);
+  endfor;
+  endfor;
+  fi;
+  enddef;
+  vardef EffectuerTraces=
+  \useKV[Pavage]{Traces}
+  enddef;
+}
+
+\def\MPReseauRegulier{
+  boolean Before,Numerote,Backgrounds,After;
+  Before=\useKV[Pavage]{Before};
+  After=\useKV[Pavage]{After};
+  Numerote=\useKV[Pavage]{Numerotation};
+  Backgrounds=\useKV[Pavage]{Backgrounds};
+  color ColPavage,ColArrierePlan;
+  ColPavage=\useKV[Pavage]{Couleur};
+  ColArrierePlan=if Backgrounds:\useKV[Pavage]{ArrierePlan} else:ColPavage fi;
+  Cote=\useKV[Pavage]{Cote};
+  Lignes=\useKV[Pavage]{Lignes};
+  Colonnes=\useKV[Pavage]{Colonnes};
+  Niveau=\useKV[Pavage]{Niveau};
+  Depart=\useKV[Pavage]{Depart};
+  pair A[];
+  A1=(0,0);
+  A2-A1=u*Cote*(1,0);
+  vardef PavageRegulier(expr Niv)=
+  picture Retour;
+  if Niv=3:
+  A3=rotation(A2,A1,60);
+  path TriBase,CadrePavage;
+  TriBase=polygone(A1,A2,A3);
+  CadrePavage=polygone(A1,Cote*cm*(Colonnes,0),Cote*cm*(Colonnes,0.5*sqrt(3)*Lignes),Cote*cm*(0,0.5*sqrt(3)*Lignes));
+  Retour=image(
+  fill CadrePavage withcolor ColPavage;
+  for k=0 upto Lignes:
+  for l=-1 upto Colonnes+1:
+  if k mod 2=0:
+  trace TriBase shifted (Cote*cm*(l,0.5*sqrt(3)*k));
+  else:
+  trace TriBase shifted (Cote*cm*(l+0.5,0.5*sqrt(3)*k));
+  fi;
+  endfor;
+  endfor;
+  clip currentpicture to CadrePavage;
+  trace CadrePavage withpen pencircle scaled 1.5;
+  );
+  elseif Niv=4:
+  A3=rotation(A1,A2,-90);
+  A4-A3=A1-A2;
+  path QuadriBase,CadrePavage;
+  QuadriBase=polygone(A1,A2,A3,A4);
+  CadrePavage=polygone(A1,Cote*cm*(Colonnes,0),Cote*cm*(Colonnes,Lignes),Cote*cm*(0,Lignes));
+  Retour=image(
+  fill CadrePavage withcolor ColPavage;
+  for k=0 upto Lignes-1:
+  for l=0 upto Colonnes-1:
+  trace QuadriBase shifted (Cote*cm*(l,k));
+  endfor;
+  endfor;
+  clip currentpicture to CadrePavage;
+  trace CadrePavage withpen pencircle scaled 1.5;
+  );
+  elseif Niv=6:
+  A3=rotation(A1,A2,-120);
+  A4=rotation(A2,A3,-120);
+  A5=rotation(A3,A4,-120);
+  A6=rotation(A4,A5,-120);  
+  path HexaBase,CadrePavage;
+  HexaBase=polygone(A1,A2,A3,A4,A5,A6);
+  CadrePavage=polygone(Cote*cm*(1,0),Cote*cm*(3*Colonnes,0),Cote*cm*(3*Colonnes,sqrt(3)*(Lignes-1)),Cote*cm*(1,sqrt(3)*(Lignes-1)));
+  Retour=image(%
+  fill CadrePavage withcolor ColPavage;
+  for k=-1 upto 2*Lignes+1:
+  for l=-1 upto Colonnes+1:
+  if k mod 2=1:
+  trace HexaBase shifted (Cote*cm*(3*l,0.5*sqrt(3)*k));
+  else:
+  trace HexaBase shifted (Cote*cm*(1.5+3*l,sqrt(3)+0.5*sqrt(3)*k));
+  fi;
+  endfor;
+  endfor;
+  clip currentpicture to CadrePavage;
+  trace CadrePavage withpen pencircle scaled 1.5;
+  );
+  fi;
+  Retour
+  enddef;
+  % 
+  vardef PlacePointSupport=
+  n:=Depart;
+  pair B;pair C;pair vdepla;
+  pair Hexa[],Hexb[],Hexc[],Hexd[],Hexe[],Hexf[];
+  pair Cara[],Carb[],Carc[],Card[];
+  pair Tria[],Trib[],Tric[];
+  if Niveau=3:
+    B=iso(A1,A2,A3);
+    C=symetrie(B,A2,A3);
+    for k=1 upto Lignes:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        if k mod 2=1:
+        nbv:=(k-1)*1.5;
+          if l mod 2=1:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+          else:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3)+(C-B);
+          fi;
+          else:
+          nbv:=(k-1)*1.5+0.5;
+        if l mod 2=1:
+        vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+        else:
+        vdepla:=(Cote*cm*((l-1) div 2),(nbv*Cote*cm*sqrt(3)/3))+(xpart(C-B),-ypart(C-B));
+        fi;
+        fi;
+        if (n mod 2)=0:
+        Tria[n]=rotation(A1,B,180) shifted vdepla;
+        Trib[n]=rotation(A2,B,180) shifted vdepla;
+        Tric[n]=rotation(A3,B,180) shifted vdepla;
+        else:
+        Tria[n]-A1=vdepla;
+        Trib[n]-A2=vdepla;
+        Tric[n]-A3=vdepla;
+        fi;
+  endfor;
+  endfor;
+  elseif Niveau=4:
+  B=iso(A1,A2,A3,A4);
+  for k=1 upto Lignes:
+  for l=1 upto Colonnes:
+  n:=n+1;
+  vdepla:=Cote*cm*((l-1),(k-1));
+  Cara[n]-A1=vdepla;
+  Carb[n]-A2=vdepla;
+  Carc[n]-A3=vdepla;
+  Card[n]-A4=vdepla;
+  endfor;
+  endfor;
+  elseif Niveau=6:
+  B=iso(A1,A2,A3,A4,A5,A6);
+  C=symetrie(B,A3,A4);
+    for k=1 upto Lignes-1:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        nbv:=(k-1)*3;
+        if l mod 2=1:
+          vdepla:=(1.5*Cote*cm*(l-1)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3);
+        else:
+          vdepla:=(1.5*Cote*cm*(l-2)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3)+(C-B);
+        fi;
+        if k=Lignes-1:
+        if l mod 2=1:
+        Hexa[n]-A1=vdepla;
+        Hexb[n]-A2=vdepla;
+        Hexc[n]-A3=vdepla;
+        Hexd[n]-A4=vdepla;
+        Hexe[n]-A5=vdepla;
+        Hexf[n]-A6=vdepla;
+        else:
+        n:=n-1;
+        fi;
+        else:
+        Hexa[n]-A1=vdepla;
+        Hexb[n]-A2=vdepla;
+        Hexc[n]-A3=vdepla;
+        Hexd[n]-A4=vdepla;
+        Hexe[n]-A5=vdepla;
+        Hexf[n]-A6=vdepla;
+        fi;
+      endfor;
+    endfor;
+  fi;
+  enddef;
+  %
+  vardef Numerotation=
+  n:=Depart;
+  pair B;pair C;pair vdepla;
+  if Niveau=3:
+    B=iso(A1,A2,A3);
+    C=symetrie(B,A2,A3);
+    for k=1 upto Lignes:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        if k mod 2=1:
+        nbv:=(k-1)*1.5;
+          if l mod 2=1:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+          else:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3)+(C-B);
+          fi;
+          else:
+          nbv:=(k-1)*1.5+0.5;
+        if l mod 2=1:
+        vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+        else:
+        vdepla:=(Cote*cm*((l-1) div 2),(nbv*Cote*cm*sqrt(3)/3))+(xpart(C-B),-ypart(C-B));
+        fi;
+        fi;
+        label(TEX(decimal(n)),B shifted vdepla);
+    endfor;
+  endfor;
+  elseif Niveau=4:
+  B=iso(A1,A2,A3,A4);
+  for k=1 upto Lignes:
+  for l=1 upto Colonnes:
+  n:=n+1;
+  vdepla:=Cote*cm*((l-1),(k-1));
+  label(TEX(decimal(n)),B shifted vdepla);
+  endfor;
+  endfor;
+  elseif Niveau=6:
+  B=iso(A1,A2,A3,A4,A5,A6);
+  C=symetrie(B,A3,A4);
+    for k=1 upto Lignes-1:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        nbv:=(k-1)*3;
+        if l mod 2=1:
+          vdepla:=(1.5*Cote*cm*(l-1)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3);
+        else:
+          vdepla:=(1.5*Cote*cm*(l-2)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3)+(C-B);
+        fi;
+        if k=Lignes-1:
+        if l mod 2=1:
+        label(TEX(decimal(n)),B shifted vdepla);
+        else:
+        n:=n-1;
+        fi;
+        else:
+        label(TEX(decimal(n)),B shifted vdepla);
+        fi;
+      endfor;
+    endfor;
+  fi;
+  enddef;
+  %
+  vardef NumerotationPDF=
+  n:=Depart;
+  pair B;pair C;pair vdepla;
+  if Niveau=3:
+    B=iso(A1,A2,A3);
+    C=symetrie(B,A2,A3);
+    for k=1 upto Lignes:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        if k mod 2=1:
+        nbv:=(k-1)*1.5;
+          if l mod 2=1:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+          else:
+          vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3)+(C-B);
+          fi;
+          else:
+          nbv:=(k-1)*1.5+0.5;
+        if l mod 2=1:
+        vdepla:=(Cote*cm*((l-1) div 2),nbv*Cote*cm*sqrt(3)/3);
+        else:
+        vdepla:=(Cote*cm*((l-1) div 2),(nbv*Cote*cm*sqrt(3)/3))+(xpart(C-B),-ypart(C-B));
+        fi;
+        fi;
+        label(LATEX(decimal(n)),B shifted vdepla);
+    endfor;
+  endfor;
+  elseif Niveau=4:
+  B=iso(A1,A2,A3,A4);
+  for k=1 upto Lignes:
+  for l=1 upto Colonnes:
+  n:=n+1;
+  vdepla:=Cote*cm*((l-1),(k-1));
+  label(LATEX(decimal(n)),B shifted vdepla);
+  endfor;
+  endfor;
+  elseif Niveau=6:
+  B=iso(A1,A2,A3,A4,A5,A6);
+  C=symetrie(B,A3,A4);
+    for k=1 upto Lignes-1:
+      for l=1 upto 2*Colonnes-1:
+        n:=n+1;
+        nbv:=(k-1)*3;
+        if l mod 2=1:
+          vdepla:=(1.5*Cote*cm*(l-1)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3);
+        else:
+          vdepla:=(1.5*Cote*cm*(l-2)+1.5*Cote*cm,nbv*Cote*cm*sqrt(3)/3)+(C-B);
+        fi;
+        if k=Lignes-1:
+        if l mod 2=1:
+        label(LATEX(decimal(n)),B shifted vdepla);
+        else:
+        n:=n-1;
+        fi;
+        else:
+        label(LATEX(decimal(n)),B shifted vdepla);
+        fi;
+      endfor;
+    endfor;
+  fi;
+  enddef;
+  vardef EffectuerTraces=
+  \useKV[Pavage]{Traces}
+  enddef;
+}
+
+\def\MPReseauCode{%
+  boolean Before,Numerote,Backgrounds,After;
+  Before=\useKV[Pavage]{Before};
+  After=\useKV[Pavage]{After};
+  Numerote=\useKV[Pavage]{Numerotation};
+  Backgrounds=\useKV[Pavage]{Backgrounds};
+  color ColPavage,ColArrierePlan;
+  ColPavage=\useKV[Pavage]{Couleur};
+  ColArrierePlan=if Backgrounds:\useKV[Pavage]{ArrierePlan} else:ColPavage fi;
+  Cote=\useKV[Pavage]{Cote};
+  Lignes=\useKV[Pavage]{Lignes};
+  Colonnes=\useKV[Pavage]{Colonnes};
+  Niveau=\useKV[Pavage]{Niveau};
+  Depart=\useKV[Pavage]{Depart};
+  pair basei,basej;
+  basei=\useKV[Pavage]{Basei};
+  basej=\useKV[Pavage]{Basej};
+  vardef PavageReseau=
+  for k=0 upto Lignes-1:
+  for l=0 upto Colonnes -1:
+  trace Motif shifted (k*basei+l*basej);
+  endfor;
+  endfor;
+  enddef;
+  vardef Numerotation=
+  n:=0;
+  k:=0;
+  pair A[],B[];
+  A[0]=point(0) of Motif;
+  B[0]=A[0];
+  forever:
+  k:=k+1;
+  A[k]=point(k) of Motif;
+  B[0]:=B[0]+A[k];
+  exitif A[k]=A[0];
+  endfor;
+  B[0]:=B[0]/k;
+  for k=0 upto Lignes-1:
+  for l=0 upto Colonnes -1:
+  n:=n+1;
+  label(decimal(n),B[0] shifted(k*basei+l*basej));
+  endfor;
+  endfor;
+  enddef;
+  vardef PlacePointSupport=
+  pair M[][];
+  n:=0;
+  k:=0;
+  pair A[],B[];
+  A[0]=point(0) of Motif;
+  forever:
+  k:=k+1;
+  A[k]=point(k) of Motif;
+  B[0]:=B[0]+A[k];
+  exitif A[k]=A[0];
+  endfor;
+  B[0]:=B[0]/k;
+  NbSommet:=k;
+  for k=0 upto Lignes-1:
+  for l=0 upto Colonnes -1:
+  n:=n+1;
+  for m=1 upto NbSommet:
+  M[n][m]=A[m] shifted (k*basei+l*basej);
+  endfor;
+  endfor;
+  endfor;
+  enddef;
+  vardef EffectuerTraces=
+  \useKV[Pavage]{Traces}
+  enddef;
+}
+
+\def\MPPeriodiqueCode{%
+  boolean Before,Numerote,Backgrounds,After;
+  Before=\useKV[Pavage]{Before};
+  After=\useKV[Pavage]{After};
+  Numerote=\useKV[Pavage]{Numerotation};
+  Backgrounds=\useKV[Pavage]{Backgrounds};
+  color ColPavage,ColArrierePlan;
+  ColPavage=\useKV[Pavage]{Couleur};
+  ColArrierePlan=if Backgrounds:\useKV[Pavage]{ArrierePlan} else:ColPavage fi;
+  Cote=\useKV[Pavage]{Cote};
+  Lignes=\useKV[Pavage]{Lignes};
+  Colonnes=\useKV[Pavage]{Colonnes};
+  Niveau=\useKV[Pavage]{Niveau};
+  Depart=\useKV[Pavage]{Depart};
+  pair basei,basej;
+  vardef PavagePeriodique=
+  basei=iso(A1,A2)-iso(A1,A0);
+  basej=iso(A0,A3)-iso(A1,A0);
+  path CadrePavage;
+  pair Cpa[];
+  Cpa1=(0,ypart(-2*basej));
+  Cpa2=(xpart(2*Colonnes*basei),ypart(-2*basej));
+  Cpa3=(xpart(2*Colonnes*basei),ypart(2*Lignes*basej));
+  Cpa4=(0,ypart(2*Lignes*basej));
+  CadrePavage=Cpa1--Cpa2--Cpa3--Cpa4--cycle;
+  %drawarrow iso(A1,A0)--(iso(A1,A0)+basei);
+  %drawarrow iso(A1,A0)--(iso(A1,A0)+basej);
+  picture BlocContour,BlocPavage;
+  BlocContour=image(
+  for k=-Lignes upto Lignes+1:
+  for l=-1 upto Colonnes+1:
+  fill Motif shifted (2*l*basei+2*k*basej) withcolor ColPavage;
+  fill symetrie(Motif,iso(A1,A2)) shifted (2*l*basei+2*k*basej) withcolor ColPavage;
+  trace Motif shifted (2*l*basei+2*k*basej);
+  trace symetrie(Motif,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  endfor;
+  endfor;
+  drawoptions();
+  );
+  BlocPavage=image(
+  trace BlocContour;
+  %trace BlocContour shifted(4*basei+2*basej);
+  clip currentpicture to CadrePavage;
+  trace CadrePavage withpen pencircle scaled 2;
+  );
+  BlocPavage
+  enddef;
+  vardef Numerotation=
+  n:=-1;
+  pair ISO;
+  for k=-Lignes upto Lignes+1:
+  for l=-1 upto Colonnes+1:
+  n:=n+2;
+  ISO:=B[0] shifted (2*l*basei+2*k*basej);
+  if (xpart(ISO)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISO)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISO)>ypart(Cpa1+u*(0.2,0))) and (ypart(ISO)<ypart(Cpa4-u*(0.2,0))):
+  label(decimal(n),ISO);
+  else:
+  n:=n-2;
+  fi;
+  endfor;
+  endfor;
+  %2eme tour
+  n:=-1;
+  for k=-Lignes upto Lignes+1:
+  for l=-1 upto Colonnes+1:
+  n:=n+2;
+  ISO:=symetrie(B[0],iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  if (xpart(ISO)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISO)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISO)>ypart(Cpa1+u*(0.2,0))) and (ypart(ISO)<ypart(Cpa4-u*(0.2,0))):
+  label(decimal(n+1),ISO);
+  else:
+  n:=n-2;
+  fi;
+  endfor;
+  endfor;
+  enddef;
+  vardef PlacePointSupport=
+  pair QuadA[],QuadB[],QuadC[],QuadD[];
+  n:=-1;
+  pair ISO;
+  for k=-Lignes upto Lignes+1:
+  for l=-1 upto Colonnes+1:
+  n:=n+2;
+  ISO:=B[0] shifted (2*l*basei+2*k*basej);
+  if (xpart(ISO)>xpart(Cpa1)) and (xpart(ISO)<xpart(Cpa2)) and (ypart(ISO)>ypart(Cpa1)) and (ypart(ISO)<ypart(Cpa4)):
+  QuadA[n]=A0 shifted (2*l*basei+2*k*basej);
+  QuadB[n]=A1 shifted (2*l*basei+2*k*basej);
+  QuadC[n]=A2 shifted (2*l*basei+2*k*basej);
+  QuadD[n]=A3 shifted (2*l*basei+2*k*basej);
+  else:
+  n:=n-2;
+  fi;
+  endfor;
+  endfor;
+  %2eme tour
+  n:=-1;
+  for k=-Lignes upto Lignes+1:
+  for l=-1 upto Colonnes+1:
+  n:=n+2;
+  ISO:=symetrie(B[0],iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  if (xpart(ISO)>xpart(Cpa1+u*(0.1,0))) and (xpart(ISO)<xpart(Cpa2)) and (ypart(ISO)>ypart(Cpa1)) and (ypart(ISO)<ypart(Cpa4)):
+  QuadA[n+1]=symetrie(A0,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  QuadB[n+1]=symetrie(A1,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  QuadC[n+1]=symetrie(A2,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  QuadD[n+1]=symetrie(A3,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+  else:
+  n:=n-2;
+  fi;
+  endfor;
+  endfor;
+  enddef;
+  vardef EffectuerTraces=
+  \useKV[Pavage]{Traces}
+  enddef;
+}
+
+\def\MPPavageImageCode{%
+  boolean Before,Numerote,Backgrounds,After;
+  Before=\useKV[Pavage]{Before};
+  After=\useKV[Pavage]{After};
+  Numerote=\useKV[Pavage]{Numerotation};
+  Backgrounds=\useKV[Pavage]{Backgrounds};
+  color ColPavage,ColArrierePlan;
+  ColPavage=\useKV[Pavage]{Couleur};
+  ColArrierePlan=if Backgrounds:\useKV[Pavage]{ArrierePlan} else:ColPavage fi;
+  Cote=\useKV[Pavage]{Cote};
+  Lignes=\useKV[Pavage]{Lignes};
+  Colonnes=\useKV[Pavage]{Colonnes};
+  Niveau=\useKV[Pavage]{Niveau};
+  Depart=\useKV[Pavage]{Depart};
+  pair basei,basej;
+  %basei=\useKV[Pavage]{Basei};
+  %basej=\useKV[Pavage]{Basej};
+  vardef PavageImage=
+  basei=(rotation(O2,O1,-120)-O4);
+  basej:=(rotation(O5,O1,-120)-O5);
+  path CadrePavage;
+  pair Cpa[];
+  Cpa1=(0,ypart(-2*basej));
+  Cpa2=(xpart(2*Colonnes*basei),ypart(-2*basej));
+  Cpa3=(xpart(2*Colonnes*basei),ypart(2*Lignes*basej));
+  Cpa4=(0,ypart(2*Lignes*basej));
+  CadrePavage=Cpa1--Cpa2--Cpa3--Cpa4--cycle;
+  %drawarrow iso(A1,A0)--(iso(A1,A0)+basei);
+  %drawarrow iso(A1,A0)--(iso(A1,A0)+basej);
+  picture BlocContour,BlocPavage;
+  BlocContour=image(
+  for k=0 upto Lignes:
+  for l=0 upto Colonnes:
+  %fill Motif shifted (l*basei+k*basej) withcolor Cornsilk;
+  trace Motif shifted (l*basei+k*basej);
+  endfor;
+  endfor;
+  drawoptions();
+  );
+  BlocPavage=image(
+  trace BlocContour;
+  %trace BlocContour shifted(4*basei+2*basej);
+  %clip currentpicture to CadrePavage;
+  %trace CadrePavage withpen pencircle scaled 2;
+  );
+  BlocPavage
+  enddef;
+%  vardef Numerotation=
+%  n:=-1;
+%  pair ISO;
+%  for k=-Lignes upto Lignes+1:
+%  for l=-1 upto Colonnes+1:
+%  n:=n+2;
+%  ISO:=B[0] shifted (2*l*basei+2*k*basej);
+%  if (xpart(ISO)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISO)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISO)>ypart(Cpa1+u*(0.2,0))%) and (ypart(ISO)<ypart(Cpa4-u*(0.2,0))):
+%  label(decimal(n),ISO);
+%  else:
+%  n:=n-2;
+%  fi;
+%  endfor;
+%  endfor;
+%  %2eme tour
+%  n:=-1;
+%  for k=-Lignes upto Lignes+1:
+%  for l=-1 upto Colonnes+1:
+%  n:=n+2;
+%  ISO:=symetrie(B[0],iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+%  if (xpart(ISO)>xpart(Cpa1+u*(0.2,0))) and (xpart(ISO)<xpart(Cpa2-u*(0.2,0))) and (ypart(ISO)>ypart(Cpa1+u*(0.2,0))) and (ypart(ISO)<ypart(Cpa4-u*(0.2,0))):
+%  label(decimal(n+1),ISO);
+%  else:
+%  n:=n-2;
+%  fi;
+%  endfor;
+%  endfor;
+%  enddef;
+%  vardef PlacePointSupport=
+%  pair QuadA[],QuadB[],QuadC[],QuadD[];
+%  n:=-1;
+%  pair ISO;
+%  for k=-Lignes upto Lignes+1:
+%  for l=-1 upto Colonnes+1:
+%  n:=n+2;
+%  ISO:=B[0] shifted (2*l*basei+2*k*basej);
+%  if (xpart(ISO)>xpart(Cpa1)) and (xpart(ISO)<xpart(Cpa2)) and (ypart(ISO)>ypart(Cpa1)) and (ypart(ISO)<ypart(Cpa4)):
+%  QuadA[n]=A0 shifted (2*l*basei+2*k*basej);
+%  QuadB[n]=A1 shifted (2*l*basei+2*k*basej);
+%  QuadC[n]=A2 shifted (2*l*basei+2*k*basej);
+%  QuadD[n]=A3 shifted (2*l*basei+2*k*basej);
+%  else:
+%  n:=n-2;
+%  fi;
+%  endfor;
+%  endfor;
+%  %2eme tour
+%  n:=-1;
+%  for k=-Lignes upto Lignes+1:
+%  for l=-1 upto Colonnes+1:
+%  n:=n+2;
+%  ISO:=symetrie(B[0],iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+%  if (xpart(ISO)>xpart(Cpa1+u*(0.1,0))) and (xpart(ISO)<xpart(Cpa2)) and (ypart(ISO)>ypart(Cpa1)) and (ypart(ISO)<ypart(Cpa4)):
+%  QuadA[n+1]=symetrie(A0,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+%  QuadB[n+1]=symetrie(A1,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+%  QuadC[n+1]=symetrie(A2,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+%  QuadD[n+1]=symetrie(A3,iso(A1,A2)) shifted (2*l*basei+2*k*basej);
+%  else:
+%  n:=n-2;
+%  fi;
+%  endfor;
+%  endfor;
+%  enddef;
+  vardef EffectuerTraces=
+  \useKV[Pavage]{Traces}
+  enddef;
+}
+
+\def\MPPavageImage{%
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \MPPavageImageCode
+    picture Motif;
+    if Before:
+    \PfCImagePavage
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    picture BaseImage;
+    BaseImage=image(
+    trace fullsquare scaled 1cm;
+    );
+    Motif=BaseImage;
+    fi;
+    trace PavageImage;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mplibcode}
+  \fi
+}
+
+\def\MPPeriodique{%
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \MPPeriodiqueCode
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=(0,0)--u*(1,-2)--u*(2,0.5)--u*(0.75,1)--cycle;
+    fi;
+    pair A[],B[];
+    A[0]=point(0) of Motif;
+    B[0]=A[0];
+    k:=0;
+    forever:
+    k:=k+1;
+    A[k]=point(k) of Motif;
+    B[0]:=B[0]+A[k];
+    exitif A[k]=A[0];
+    endfor;
+    B[0]:=B[0]/k;
+    trace PavagePeriodique;
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[\MPPeriodiqueCode]
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=(0,0)--u*(1,-2)--u*(2,0.5)--u*(0.75,1)--cycle;
+    fi;
+    pair A[],B[];
+    A[0]=point(0) of Motif;
+    B[0]=A[0];
+    k:=0;
+    forever:
+    k:=k+1;
+    A[k]=point(k) of Motif;
+    B[0]:=B[0]+A[k];
+    exitif A[k]=A[0];
+    endfor;
+    B[0]:=B[0]/k;
+    trace PavagePeriodique;
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mpost}
+  \fi
+}
+
+\def\MPReseau{%
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \MPReseauCode
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=u*(0,0)--u*(0.75,0)--u*(1,0.5)--u*(0.25,0.5)--cycle;
+    fi;
+    PavageReseau;
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\MPReseauCode}]
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=u*(0,0)--u*(0.75,0)--u*(1,0.5)--u*(0.25,0.5)--cycle;
+    fi;
+    PavageReseau;
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mpost}
+  \fi
+}
+
+\def\MPRegulier{%
+  \ifluatex
+  \mplibforcehmode
+  \begin{mplibcode}
+    \MPReseauRegulier
+    trace PavageRegulier(Niveau);
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\MPReseauRegulier}]
+    trace PavageRegulier(Niveau);
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mpost}
+  \fi
+}%
+
+\def\MPPavage{%
+  \ifluatex%
+  \mplibforcehmode%
+  \begin{mplibcode}%
+    \MPPavageBase
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=u*(0,0)..u*(0.25,.1)..u*(0.5,0.7)..u*(1,1);
+    fi;
+    if Demo:
+    trace pavagescar(Motif,0,ColPavage);
+    else:
+    trace pavages(Motif,Niveau,ColPavage);
+    fi;
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\MPPavageBase}]
+    path Motif;
+    if Before:
+    Motif=\useKV[Pavage]{Motif};
+    else:
+    Motif=u*(0,0)..u*(0.25,.1)..u*(0.5,0.7)..u*(1,1);
+    fi;
+    trace pavages(Motif,Niveau,ColPavage);
+    PlacePointSupport;
+    if Numerote:
+    Numerotation;
+    fi;
+    if After:
+    EffectuerTraces;
+    fi;
+  \end{mpost}
+  \fi%
+}
+
+\NewDocumentCommand\Pavage{o}{%
+  \useKVdefault[Pavage]%
+  \setKV[Pavage]{#1}%
+  \ifboolKV[Pavage]{Regulier}{%
+    \MPRegulier%
+  }{%
+    \ifboolKV[Pavage]{SemiRegulier}{%
+      % 
+    }{%
+      \ifboolKV[Pavage]{Reseau}{%
+        \MPReseau
+      }{%
+        \ifboolKV[Pavage]{Periodique}{%
+          \MPPeriodique%
+        }{%
+          \ifboolKV[Pavage]{Image}{%
+            \MPPavageImage%
+          }{%
+            \MPPavage%
+          }%
+        }%
+      }%
+    }%
+  }%
+}%
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPavageAvecMotifImage.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRLE.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCRLE.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCRLE.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -18,93 +18,114 @@
   \BuildRLE{\the\toklisterle}%
 }
 
+\def\BuildRLECode{%
+  Taille:=\useKV[RLE]{Taille};
+  u:=\useKV[RLE]{Unite};
+  boolean Solution,Enonce;
+  Solution:=\useKV[RLE]{Solution};
+  Enonce:=\useKV[RLE]{Enonce};
+  %  
+  color RLEFill;
+  RLEFill=white;
+  %
+  numeric nbretenir[][];
+  %
+  vardef NombreLigne(text t)=
+  retiens:=0;
+  nblignes:=0;
+  for p_=t:
+  retiens:=retiens+p_;
+  if retiens=Taille:
+  nblignes:=nblignes+1;
+  retiens:=0;
+  fi;
+  endfor;
+  enddef;
+  %
+  path Square;
+  Square=unitsquare scaled u;
+  %
+  vardef RLE(text t)=
+  nbcoups:=0;
+  nbcases:=0;
+  nbcaseslignes:=0;
+  cptretiensnb:=0;
+  cptretiensnblignes:=1;
+  for p_=t:
+  if p_=0:
+  cptretiensnb:=cptretiensnb+1;
+  nbretenir[cptretiensnblignes][cptretiensnb]=p_;
+  RLEFill:=black;
+  else:
+  nbcoups:=nbcoups+1;
+  for l=0 upto p_-1:
+  if Solution: fill ((Square scaled 0.95) shifted(u*((nbcases mod Taille)+l,-(nbcases div Taille))+u*(0.025,0.025))) withcolor RLEFill; fi;
+  trace (Square shifted(u*((nbcases mod Taille)+l,-(nbcases div Taille))));
+  endfor;
+  nbcaseslignes:=nbcaseslignes+p_;
+  nbcases:=nbcases+p_;
+  if (nbcaseslignes mod Taille)=0:
+  RLEFill:=white;
+  cptretiensnb:=cptretiensnb+1;
+  nbretenir[cptretiensnblignes][cptretiensnb]=p_;
+  cptretiensnblignes:=cptretiensnblignes+1;
+  cptretiensnb:=0;
+  else:
+  if RLEFill=white: RLEFill:=black else: RLEFill:=white fi;
+  cptretiensnb:=cptretiensnb+1;
+  nbretenir[cptretiensnblignes][cptretiensnb]=p_;
+  fi;
+  fi;
+  endfor;
+  enddef;
+  % 
+  string Sequence[];
+  % 
+  boolean STOP;
+  STOP:=false;
+  %
+  vardef Affichage=
+  for k=1 upto nblignes:
+  Sequence[k]=decimal(nbretenir[k][1]);
+  n:=1;
+  forever:
+  n:=n+1;
+  if unknown nbretenir[k][n]:
+  STOP:=true;
+  else:
+  Sequence[k]:=Sequence[k]&","&decimal(nbretenir[k][n]);
+  fi;
+  exitif STOP;
+  endfor;
+  label.rt(TEX(Sequence[k]),u*(Taille+1,-k+1+0.5));
+  STOP:=false;
+  endfor;
+  enddef;
+  %
+  vardef AffichagePDF=
+  for k=1 upto nblignes:
+  Sequence[k]=decimal(nbretenir[k][1]);
+  n:=1;
+  forever:
+  n:=n+1;
+  if unknown nbretenir[k][n]:
+  STOP:=true;
+  else:
+  Sequence[k]:=Sequence[k]&","&decimal(nbretenir[k][n]);
+  fi;
+  exitif STOP;
+  endfor;
+  label.rt(LATEX(Sequence[k]),u*(Taille+1,-k+1+0.5));
+  STOP:=false;
+  endfor;
+  enddef;
+}
+
 \NewDocumentCommand\BuildRLE{m}{%
   \ifluatex
   \mplibforcehmode
   \begin{mplibcode}
-    Taille:=\useKV[RLE]{Taille};
-    u:=\useKV[RLE]{Unite};
-    boolean Solution,Enonce;
-    Solution:=\useKV[RLE]{Solution};
-    Enonce:=\useKV[RLE]{Enonce};
-    
-    color RLEFill;
-    RLEFill=white;
-
-    numeric nbretenir[][];
-    
-    vardef NombreLigne(text t)=
-    retiens:=0;
-    nblignes:=0;
-    for p_=t:
-    retiens:=retiens+p_;
-    if retiens=Taille:
-    nblignes:=nblignes+1;
-    retiens:=0;
-    fi;
-    endfor;
-    enddef;
-
-    path Square;
-    Square=unitsquare scaled u;
-
-    vardef RLE(text t)=
-    nbcoups:=0;
-    nbcases:=0;
-    nbcaseslignes:=0;
-    cptretiensnb:=0;
-    cptretiensnblignes:=1;
-    for p_=t:
-    if p_=0:
-    cptretiensnb:=cptretiensnb+1;
-    nbretenir[cptretiensnblignes][cptretiensnb]=p_;
-    RLEFill:=black;
-    else:
-    nbcoups:=nbcoups+1;
-    for l=0 upto p_-1:
-        if Solution: fill ((Square scaled 0.95) shifted(u*((nbcases mod Taille)+l,-(nbcases div Taille))+u*(0.025,0.025))) withcolor RLEFill; fi;
-    trace (Square shifted(u*((nbcases mod Taille)+l,-(nbcases div Taille))));
-    endfor;
-    nbcaseslignes:=nbcaseslignes+p_;
-    nbcases:=nbcases+p_;
-    if (nbcaseslignes mod Taille)=0:
-    RLEFill:=white;
-    cptretiensnb:=cptretiensnb+1;
-    nbretenir[cptretiensnblignes][cptretiensnb]=p_;
-    cptretiensnblignes:=cptretiensnblignes+1;
-    cptretiensnb:=0;
-    else:
-    if RLEFill=white: RLEFill:=black else: RLEFill:=white fi;
-    cptretiensnb:=cptretiensnb+1;
-    nbretenir[cptretiensnblignes][cptretiensnb]=p_;
-    fi;
-    fi;
-    endfor;
-    enddef;
-
-    string Sequence[];
-
-    boolean STOP;
-    STOP:=false;
-    
-    vardef Affichage=
-    for k=1 upto nblignes:
-    Sequence[k]=decimal(nbretenir[k][1]);
-    n:=1;
-    forever:
-    n:=n+1;
-    if unknown nbretenir[k][n]:
-    STOP:=true;
-    else:
-    Sequence[k]:=Sequence[k]&","&decimal(nbretenir[k][n]);
-    fi;
-    exitif STOP;
-    endfor;
-    label.rt(TEX(Sequence[k]),u*(Taille+1,-k+1+0.5));
-    STOP:=false;
-    endfor;
-    enddef;
-    
+    \BuildRLECode    
     NombreLigne(#1);
     RLE(#1);
     if Enonce:
@@ -112,94 +133,11 @@
     fi;
   \end{mplibcode}
   \else
-  \begin{mpost}[mpsettings={%
-    Taille:=\useKV[RLE]{Taille};
-    u:=\useKV[RLE]{Unite};
-    boolean Solution,Enonce;
-    Solution:=\useKV[RLE]{Solution};
-    Enonce:=\useKV[RLE]{Enonce};
-    }]
-    color RLEFill;
-    RLEFill=white;
-
-    numeric nbretenir[][];
-    
-    vardef NombreLigne(text t)=
-    retiens:=0;
-    nblignes:=0;
-    for p_=t:
-    retiens:=retiens+p_;
-    if retiens=Taille:
-    nblignes:=nblignes+1;
-    retiens:=0;
-    fi;
-    endfor;
-    enddef;
-
-    path Square;
-    Square=unitsquare scaled u;
-
-    vardef RLE(text t)=
-    nbcoups:=0;
-    nbcases:=0;
-    nbcaseslignes:=0;
-    cptretiensnb:=0;
-    cptretiensnblignes:=1;
-    for p_=t:
-    if p_=0:
-    cptretiensnb:=cptretiensnb+1;
-    nbretenir[cptretiensnblignes][cptretiensnb]=p_;
-    RLEFill:=black;
-    else:
-    nbcoups:=nbcoups+1;
-    for l=0 upto p_-1:
-        if Solution: fill ((Square scaled 0.95) shifted(u*((nbcases mod Taille)+l,-(nbcases div Taille))+u*(0.025,0.025))) withcolor RLEFill; fi;
-    trace (Square shifted(u*((nbcases mod Taille)+l,-(nbcases div Taille))));
-    endfor;
-    nbcaseslignes:=nbcaseslignes+p_;
-    nbcases:=nbcases+p_;
-    if (nbcaseslignes mod Taille)=0:
-    RLEFill:=white;
-    cptretiensnb:=cptretiensnb+1;
-    nbretenir[cptretiensnblignes][cptretiensnb]=p_;
-    cptretiensnblignes:=cptretiensnblignes+1;
-    cptretiensnb:=0;
-    else:
-    if RLEFill=white: RLEFill:=black else: RLEFill:=white fi;
-    cptretiensnb:=cptretiensnb+1;
-    nbretenir[cptretiensnblignes][cptretiensnb]=p_;
-    fi;
-    fi;
-    endfor;
-    enddef;
-
-    string Sequence[];
-
-    boolean STOP;
-    STOP:=false;
-    
-    vardef Affichage=
-    for k=1 upto nblignes:
-    Sequence[k]=decimal(nbretenir[k][1]);
-    n:=1;
-    forever:
-    n:=n+1;
-    if unknown nbretenir[k][n]:
-    STOP:=true;
-    else:
-    Sequence[k]:=Sequence[k]&","&decimal(nbretenir[k][n]);
-    fi;
-    exitif STOP;
-    endfor;
-    label.rt(LATEX(Sequence[k]),u*(Taille+1,-k+1+0.5));
-    STOP:=false;
-    endfor;
-    enddef;
-    
+  \begin{mpost}[mpsettings={\BuildRLECode}]
     NombreLigne(#1);
     RLE(#1);
     if Enonce:
-    Affichage;
+    AffichagePDF;
     fi;    
   \end{mpost}
   \fi

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRappelsFormules.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCRappelsFormules.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCRappelsFormules.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -3,43 +3,37 @@
 %%%
 \setKVdefault[ClesFormule]{Perimetre=false,Aire=false,Volume=false,Surface=carr\'e,Solide=pav\'e,Angle=0,Ancre={(0,0)},Largeur=5cm,Couleur=white,EchelleEspace=70,Echelle=1cm}
 
+\def\MPFigureCarreCode{%
+  u:=\useKV[ClesFormule]{Echelle};
+  vardef FigCarre=
+  drawoptions(dashed dashpattern(on1cm));
+  pair A,B,C,D;
+  A=u*(1,1);
+  B-A=u*(2,0);
+  C=rotation(A,B,-90);
+  D-C=A-B;
+  draw polygone(A,B,C,D);
+  draw codeperp(A,B,C,5);
+  draw codeperp(B,C,D,5);
+  draw codeperp(C,D,A,5);
+  draw codeperp(D,A,B,5);
+  marque_s:=marque_s/3;
+  draw Codelongueur(A,B,B,C,C,D,D,A,2);
+  marque_s:=marque_s*3;
+  draw appelation(A,B,-3mm,btex $c$ etex);
+  enddef;
+}%
+
 \def\MPFigureCarre{%
   \ifluatex
   \mplibforcehmode
   \begin{mplibcode}
-    u:=\useKV[ClesFormule]{Echelle};
-    drawoptions( dashed dashpattern(on1cm));
-    pair A,B,C,D;
-    A=u*(1,1);
-    B-A=u*(2,0);
-    C=rotation(A,B,-90);
-    D-C=A-B;
-    draw polygone(A,B,C,D);
-    draw codeperp(A,B,C,5);
-    draw codeperp(B,C,D,5);
-    draw codeperp(C,D,A,5);
-    draw codeperp(D,A,B,5);
-    marque_s:=marque_s/3;
-    draw Codelongueur(A,B,B,C,C,D,D,A,2);
-    marque_s:=marque_s*3;
-    draw appelation(A,B,-3mm,btex $c$ etex);
+    \MPFigureCarreCode
+    FigCarre;
   \end{mplibcode}
   \else
-  \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
-    pair A,B,C,D;
-    A=u*(1,1);
-    B-A=u*(2,0);
-    C=rotation(A,B,-90);
-    D-C=A-B;
-    draw polygone(A,B,C,D);
-    draw codeperp(A,B,C,5);
-    draw codeperp(B,C,D,5);
-    draw codeperp(C,D,A,5);
-    draw codeperp(D,A,B,5);
-    marque_s:=marque_s/3;
-    draw Codelongueur(A,B,B,C,C,D,D,A,2);
-    marque_s:=marque_s*3;
-    draw appelation(A,B,-3mm,btex $c$ etex);
+  \begin{mpost}[mpsettings={\MPFigureCarreCode}]
+    FigCarre;
   \end{mpost}
   \fi
 }

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterFraction.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterFraction.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterFraction.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -1,969 +1,557 @@
 %%%
 % Fractions
 %%%
-\setKVdefault[ClesFraction]{Rayon=2cm,Disque,Regulier=false,Segment=false,Rectangle=false,Longueur=5cm,Largeur=2cm,Cotes=5,Triangle=false,Parts=3,Couleur=green,Reponse=false,Multiple=1,Hachures=false,Epaisseur=1}
+\setKVdefault[ClesFraction]{Rayon=2cm,Disque,Regulier=false,Segment=false,Rectangle=false,Longueur=5cm,Largeur=2cm,Cotes=5,Triangle=false,Parts=3,Eprouvette=false,Couleur=green,Reponse=false,Multiple=1,Hachures=false,Epaisseur=1}
 
-\def\MPFractionTriangle#1#2#3#4#5{%
-  % #1 longueur du c\^ot\'e
-  % #2 partage sur le c\^ot\'e
-  % #3 num
-  % #4 d\'eno (attention : = #2^2)
-  % #5 couleur
-  \ifluatex
-   \mplibforcehmode
-   \begin{mplibcode}
-     nbtriangle=0;
-
-     vardef Ligne(expr longueur)=
-     for k=0 upto 2*(longueur-1):
-     nbtriangle:=nbtriangle+1;
-     if (k mod 2)=0:
-     M[nbtriangle]=(Tria shifted(0.5*k*(1/nbparts)*(B-A)))  shifted((nbparts-longueur)*(1/nbparts)*(C-A));
-     else:
-     M[nbtriangle]=(Trir shifted(0.5*(k-1)*(1/nbparts)*(B-A)))  shifted((nbparts-longueur)*(1/nbparts)*(C-A));
-     fi;
-     endfor;
-     enddef;
-
-     pair A,B,C;
-     A=u*(0.5,0.5);
-     B-A=(#1,0);
-     C=rotation(B,A,60);
-
-     nbparts:=#2;
-
-     path M[];
-
-     path Tria,Trir;
-     Tria=polygone(A,(1/nbparts)[A,B],(1/nbparts)[A,C]);
-     Trir=symetrie(Tria,(1/nbparts)[A,B],(1/nbparts)[A,C]);
-
-     for k=nbparts downto 1:
-     Ligne(k);
-     endfor;
-     
-     m:=#3 div #4;
-
-     drawoptions(shifted(m*(#1+1cm,0)));
-     for l=1 upto (#3 mod #4):
-     fill M[l] withcolor #5;
-     for k=1 upto nbparts:
-     trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]);
-     trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]);
-     trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]);
-     endfor;
-     endfor;
-     
-     for l=0 upto (m-1):
-     drawoptions(shifted(l*(#1+1cm,0)));
-     remplis polygone(A,B,C) withcolor #5;
-     for k=1 upto nbparts:
-     trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]);
-     trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]);
-     trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]);
-     endfor;
-     endfor;
-   \end{mplibcode}
-     \else
-     \begin{mpost}
-            nbtriangle=0;
-
-     vardef Ligne(expr longueur)=
-     for k=0 upto 2*(longueur-1):
-     nbtriangle:=nbtriangle+1;
-     if (k mod 2)=0:
-     M[nbtriangle]=(Tria shifted(0.5*k*(1/nbparts)*(B-A)))  shifted((nbparts-longueur)*(1/nbparts)*(C-A));
-     else:
-     M[nbtriangle]=(Trir shifted(0.5*(k-1)*(1/nbparts)*(B-A)))  shifted((nbparts-longueur)*(1/nbparts)*(C-A));
-     fi;
-     endfor;
-     enddef;
-
-     pair A,B,C;
-     A=u*(0.5,0.5);
-     B-A=(#1,0);
-     C=rotation(B,A,60);
-
-     nbparts:=#2;
-
-     path M[];
-
-     path Tria,Trir;
-     Tria=polygone(A,(1/nbparts)[A,B],(1/nbparts)[A,C]);
-     Trir=symetrie(Tria,(1/nbparts)[A,B],(1/nbparts)[A,C]);
-
-     for k=nbparts downto 1:
-     Ligne(k);
-     endfor;
-     
-     m:=#3 div #4;
-
-     drawoptions(shifted(m*(#1+1cm,0)));
-     for l=1 upto (#3 mod #4):
-     fill M[l] withcolor #5;
-     for k=1 upto nbparts:
-     trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]);
-     trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]);
-     trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]);
-     endfor;
-     endfor;
-     
-     for l=0 upto (m-1):
-     drawoptions(shifted(l*(#1+1cm,0)));
-     remplis polygone(A,B,C) withcolor #5;
-     for k=1 upto nbparts:
-     trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]);
-     trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]);
-     trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]);
-     endfor;
-     endfor;
-     \end{mpost}
-   \fi
- }
-
- \def\MPFractionTriangleH#1#2#3#4#5#6{
-  % #1 longueur du c\^ot\'e
-  % #2 partage sur le c\^ot\'e
-  % #3 num
-  % #4 d\'eno (attention : = #2^2)
-  % #5 couleur
-  % #6 \'epaisseur
-  \ifluatex
-   \mplibforcehmode
-   \begin{mplibcode}
-          nbtriangle=0;
-
-     vardef Ligne(expr longueur)=
-     for k=0 upto 2*(longueur-1):
-     nbtriangle:=nbtriangle+1;
-     if (k mod 2)=0:
-     M[nbtriangle]=(Tria shifted(0.5*k*(1/nbparts)*(B-A)))  shifted((nbparts-longueur)*(1/nbparts)*(C-A));
-     else:
-     M[nbtriangle]=(Trir shifted(0.5*(k-1)*(1/nbparts)*(B-A)))  shifted((nbparts-longueur)*(1/nbparts)*(C-A));
-     fi;
-     endfor;
-     enddef;
-
-     pair A,B,C;
-     A=u*(0.5,0.5);
-     B-A=(#1,0);
-     C=rotation(B,A,60);
-
-     nbparts:=#2;
-
-     path M[];
-
-     path Tria,Trir;
-     Tria=polygone(A,(1/nbparts)[A,B],(1/nbparts)[A,C]);
-     Trir=symetrie(Tria,(1/nbparts)[A,B],(1/nbparts)[A,C]);
-
-     for k=nbparts downto 1:
-     Ligne(k);
-     endfor;
-     
-     m:=#3 div #4;
-
-     for l=1 upto (#3 mod #4):
-     drawoptions(withpen pencircle scaled #6);
-     trace hachurage(M[l] shifted(m*(#1+1cm,0)),90,0.2,0) withcolor #5;%M[l] withcolor #5;
-     for k=1 upto nbparts:
-     drawoptions(withpen pencircle scaled #6);
-     trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]) shifted(m*(#1+1cm,0));
-     trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]) shifted(m*(#1+1cm,0));
-     trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]) shifted(m*(#1+1cm,0));
-     endfor;
-     endfor;
-     
-     for l=0 upto (m-1):
-     drawoptions(shifted(l*(#1+1cm,0)) withpen pencircle scaled #6);
-     trace hachurage(polygone(A,B,C),90,0.2,0) withcolor #5;%polygone(A,B,C) withcolor #5;
-          drawoptions(shifted(l*(#1+1cm,0)) withpen pencircle scaled #6);
-     for k=1 upto nbparts:
-     trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]);
-     trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]);
-     trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]);
-     endfor;
-     endfor;
-   \end{mplibcode}
-     \else
-     \begin{mpost}
-       nbtriangle=0;
-
-     vardef Ligne(expr longueur)=
-     for k=0 upto 2*(longueur-1):
-     nbtriangle:=nbtriangle+1;
-     if (k mod 2)=0:
-     M[nbtriangle]=(Tria shifted(0.5*k*(1/nbparts)*(B-A)))  shifted((nbparts-longueur)*(1/nbparts)*(C-A));
-     else:
-     M[nbtriangle]=(Trir shifted(0.5*(k-1)*(1/nbparts)*(B-A)))  shifted((nbparts-longueur)*(1/nbparts)*(C-A));
-     fi;
-     endfor;
-     enddef;
-
-     pair A,B,C;
-     A=u*(0.5,0.5);
-     B-A=(#1,0);
-     C=rotation(B,A,60);
-
-     nbparts:=#2;
-
-     path M[];
-
-     path Tria,Trir;
-     Tria=polygone(A,(1/nbparts)[A,B],(1/nbparts)[A,C]);
-     Trir=symetrie(Tria,(1/nbparts)[A,B],(1/nbparts)[A,C]);
-
-     for k=nbparts downto 1:
-     Ligne(k);
-     endfor;
-
-     diversite=floor(uniformdeviate(#2**2-#3-1));
-     
-     for k=(1+diversite) upto (#3+diversite):
-     drawoptions(withpen pencircle scaled #6);
-     trace hachurage(M[k],90,0.2,0) withcolor #5;
-     endfor;
-     drawoptions(withpen pencircle scaled #6);
-     
-     for k=1 upto nbparts:
-     trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]);
-     trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]);
-     trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]);
-     endfor;
-     \end{mpost}
-   \fi
- }
-
-\def\MPFractionRegulier#1#2#3#4#5{%
-  % #1 rayon, #2 nb c\^ot\'es, #3 num, #4 deno, #5 couleur
-  \ifluatex
-   \mplibforcehmode
-  \begin{mplibcode}
-    pair O,A[],B[];
-    O=u*(0,0);
-    path cc,cd;
-    cc=cercles(O,#1);
-    for k=0 upto #2:
-    A[k]=pointarc(cc,k*(360/#2));
-    endfor;
-    cd=polygone(A0 for k=1 upto #2-1:,A[k] endfor);
-    for k=0 upto #4-1:
-    B[k]=point(k*(#2/#4)) of cd;
-    endfor;
-    picture fondcolore;
-    fondcolore=image(
-    remplis O--arccercle(B[0],B[#3 mod #4],O)--cycle withcolor #5;
-    clip currentpicture to cd;
-    for k=0 upto #4-1:
-    draw segment(O,B[k]) cutafter cd;
-    endfor;
-    trace cd;
-    );
-    currentpicture:=nullpicture;
-    m=#3 div #4;
-    if (#3 mod #4)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto (m-1):
-    fill cd shifted(l*(#1*2+0.5cm,0)) withcolor #5;
-    trace cd shifted(l*(#1*2+0.5cm,0));
-    if #4>1:
-    for k=0 upto #4-1:
-    draw (segment(O,B[k]) cutafter cd) shifted(l*(#1*2+0.5cm,0));
-    endfor;
-    fi;
-    endfor;
-    fi;
-    draw fondcolore shifted(m*(#1*2+0.5cm,0));
-    draw cd shifted(m*(#1*2+0.5cm,0));
-    if #4>1:
-    for k=0 upto #4-1:
-    draw (segment(O,B[k]) cutafter cd) shifted(m*(#1*2+0.5cm,0));
-    endfor;
-    fi;
-  \end{mplibcode}
-  \else
-  \begin{mpost}
-        pair O,A[],B[];
-    O=u*(0,0);
-    path cc,cd;
-    cc=cercles(O,#1);
-    for k=0 upto #2:
-    A[k]=pointarc(cc,k*(360/#2));
-    endfor;
-    cd=polygone(A0 for k=1 upto #2-1:,A[k] endfor);
-    for k=0 upto #4-1:
-    B[k]=point(k*(#2/#4)) of cd;
-    endfor;
-    picture fondcolore;
-    fondcolore=image(
-    remplis O--arccercle(B[0],B[#3 mod #4],O)--cycle withcolor #5;
-    clip currentpicture to cd;
-    for k=0 upto #4-1:
-    draw segment(O,B[k]) cutafter cd;
-    endfor;
-    trace cd;
-    );
-    currentpicture:=nullpicture;
-    m=#3 div #4;
-    if (#3 mod #4)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto (m-1):
-    fill cd shifted(l*(#1*2+0.5cm,0)) withcolor #5;
-    trace cd shifted(l*(#1*2+0.5cm,0));
-    if #4>1:
-    for k=0 upto #4-1:
-    draw (segment(O,B[k]) cutafter cd) shifted(l*(#1*2+0.5cm,0));
-    endfor;
-    fi;
-    endfor;
-    fi;
-    draw fondcolore shifted(m*(#1*2+0.5cm,0));
-    draw cd shifted(m*(#1*2+0.5cm,0));
-    if #4>1:
-    for k=0 upto #4-1:
-    draw (segment(O,B[k]) cutafter cd) shifted(m*(#1*2+0.5cm,0));
-    endfor;
-    fi;
-  \end{mpost}
-  \fi
+\def\MPFractionEprouvetteCode{%
+  Hauteur=\useKV[ClesFraction]{Longueur};
+  color ColEprou;
+  ColEprou=\useKV[ClesFraction]{Couleur};
+  boolean Hachures,Reponse;
+  Reponse=\useKV[ClesFraction]{Reponse};
+  Hachures=\useKV[ClesFraction]{Hachures};
+  Epaisseur=\useKV[ClesFraction]{Epaisseur};
+  vardef eprouvette(expr deno,nume)=
+  picture PfCEprou,PfCEprouGrad;
+  path Cc;
+  Cc=cercles((0,0),1u) yscaled 0.2;
+  PfCEprouGrad=image(
+  trace Cc shifted((0,Hauteur));
+  trace subpath(0,length Cc/2) of Cc dashed evenly;
+  trace subpath(length Cc/2,length Cc) of Cc;
+  trace segment(point(0) of Cc,point(0) of Cc shifted((0,Hauteur)));
+  trace segment(point(length Cc/2) of Cc,point(length Cc/2) of (Cc shifted((0,Hauteur))));
+  for k=1 upto (deno-1):
+  trace (subpath(length Cc/2,length Cc*0.7) of Cc) shifted ((k/deno)*(0,Hauteur));
+  endfor;
+  );
+  m=nume div deno;
+  if (nume mod deno)=0:m:=m-1; fi;
+  PfCEprou=image(%
+  path Volume,VolumeComplet;
+  Volume=(point(0) of Cc)--(subpath(0,length Cc/2) of Cc shifted(((nume mod deno)/deno)*(0,Hauteur)))--(point(length Cc/2) of Cc shifted(((nume mod deno)/deno)*(0,Hauteur)))--(subpath(length Cc/2,length Cc) of Cc)--cycle;
+  VolumeComplet=(point(0) of Cc)--(subpath(0,length Cc/2) of Cc shifted((0,Hauteur)))--(point(length Cc/2) of Cc)--(subpath(length Cc/2,length Cc) of Cc)--cycle;
+  if m>0:
+  for l=0 upto (m-1):
+  if Reponse:
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(VolumeComplet shifted(l*(3u,0)),60,0.2,0) withcolor ColEprou;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  else:
+  remplis (VolumeComplet shifted(l*(3u,0))) withcolor ColEprou;
+  fi;
+  fi;
+  endfor;
+  fi;
+  if (nume mod deno)<>0:
+  if Reponse:
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(Volume shifted(m*(3u,0)),60,0.2,0) withcolor ColEprou;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  else:
+  remplis (Volume shifted(m*(3u,0))) withcolor ColEprou;
+  fi;
+  trace (Cc shifted(((nume mod deno)/deno)*(0,Hauteur))) shifted(m*(3u,0));
+  fi;
+  else:
+  if Reponse:
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(VolumeComplet shifted(m*(3u,0)),60,0.2,0) withcolor ColEprou;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  else:
+  remplis (VolumeComplet shifted(m*(3u,0))) withcolor ColEprou;
+  fi;
+  fi;
+  fi;
+  for k=0 upto m:
+  trace PfCEprouGrad shifted((3u*k,0));
+  endfor;
+  );
+  PfCEprou
+  enddef;
 }
-
-\def\MPFractionRegulierH#1#2#3#4#5#6{%
-  % #1 rayon, #2 nb c\^ot\'es, #3 num, #4 deno, #5 couleur, #6 épaisseur
+  
+\def\MPFractionEprouvette#1#2{%
+  % #1 num
+  % #2 d\'eno
   \ifluatex
-   \mplibforcehmode
+  \mplibforcehmode
   \begin{mplibcode}
-    pair O,A[],B[];
-    O=u*(0,0);
-    path cc,cd;
-    cc=cercles(O,#1);
-    for k=0 upto #2:
-    A[k]=pointarc(cc,k*(360/#2));
-    endfor;
-    cd=polygone(A0 for k=1 upto #2-1:,A[k] endfor);
-    for k=0 upto #4-1:
-    B[k]=point(k*(#2/#4)) of cd;
-    endfor;
-    picture fondcolore;
-    fondcolore=image(%
-    drawoptions(withpen pencircle scaled #6);
-    trace hachurage(O--arccercle(B[0],B[#3 mod #4],O)--cycle,1.5*360/#2,0.25,0) withcolor #5;
-    clip currentpicture to cd;
-    drawoptions(withpen pencircle scaled #6);
-    for k=0 upto #4-1:
-    draw segment(O,B[k]) cutafter cd;
-    endfor;
-    trace cd;
-    );
-    currentpicture:=nullpicture;
-    m=#3 div #4;
-    if (#3 mod #4)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto (m-1):
-    drawoptions(withpen pencircle scaled #6);
-    trace hachurage(cd shifted(l*(#1*2+0.5cm,0)),1.5*360/#2,0.25,0) withcolor #5;
-    drawoptions(withpen pencircle scaled #6);
-    trace cd shifted(l*(#1*2+0.5cm,0));
-    if #4>1:
-    for k=0 upto #4-1:
-    drawoptions(withpen pencircle scaled #6);
-    draw (segment(O,B[k]) cutafter cd) shifted(l*(#1*2+0.5cm,0));
-    endfor;
-    fi;
-    endfor;
-    fi;
-    draw fondcolore shifted(m*(#1*2+0.5cm,0));
-    drawoptions(withpen pencircle scaled #6);
-    draw cd shifted(m*(#1*2+0.5cm,0));
-    if #4>1:
-    drawoptions(withpen pencircle scaled #6);
-    for k=0 upto #4-1:
-    draw (segment(O,B[k]) cutafter cd) shifted(m*(#1*2+0.5cm,0));
-    endfor;
-    fi;
+    \MPFractionEprouvetteCode
+    trace eprouvette(#2,#1);
   \end{mplibcode}
   \else
-\begin{mpost}
-    pair O,A[],B[];
-    O=u*(0,0);
-    path cc,cd;
-    cc=cercles(O,#1);
-    for k=0 upto #2:
-    A[k]=pointarc(cc,k*(360/#2));
-    endfor;
-    cd=polygone(A0 for k=1 upto #2-1:,A[k] endfor);
-    for k=0 upto #4-1:
-    B[k]=point(k*(#2/#4)) of cd;
-    endfor;
-    picture fondcolore;
-    fondcolore=image(%
-    drawoptions(withpen pencircle scaled #6);
-    trace hachurage(O--arccercle(B[0],B[#3 mod #4],O)--cycle,1.5*360/#2,0.25,0) withcolor #5;
-    clip currentpicture to cd;
-    drawoptions(withpen pencircle scaled #6);
-    for k=0 upto #4-1:
-    draw segment(O,B[k]) cutafter cd;
-    endfor;
-    trace cd;
-    );
-    currentpicture:=nullpicture;
-    m=#3 div #4;
-    if (#3 mod #4)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto (m-1):
-    drawoptions(withpen pencircle scaled #6);
-    trace hachurage(cd shifted(l*(#1*2+0.5cm,0)),1.5*360/#2,0.25,0) withcolor #5;
-    drawoptions(withpen pencircle scaled #6);
-    trace cd shifted(l*(#1*2+0.5cm,0));
-    if #4>1:
-    for k=0 upto #4-1:
-    drawoptions(withpen pencircle scaled #6);
-    draw (segment(O,B[k]) cutafter cd) shifted(l*(#1*2+0.5cm,0));
-    endfor;
-    fi;
-    endfor;
-    fi;
-    draw fondcolore shifted(m*(#1*2+0.5cm,0));
-    drawoptions(withpen pencircle scaled #6);
-    draw cd shifted(m*(#1*2+0.5cm,0));
-    if #4>1:
-    drawoptions(withpen pencircle scaled #6);
-    for k=0 upto #4-1:
-    draw (segment(O,B[k]) cutafter cd) shifted(m*(#1*2+0.5cm,0));
-    endfor;
-    fi;
+  \begin{mpost}[mpsettings={\MPFractionEprouvetteCode}]
+    trace eprouvette(#2,#1);
   \end{mpost}
   \fi
 }
 
-\def\MPFractionRectangle#1#2#3#4#5#6{%
-  % #1 longueur, #2 largeur, #3 num, #4 deno, #5 couleur, #6 multiple
+\def\MPFractionRegulierCode{%
+  Rayon=\useKV[ClesFraction]{Rayon};
+  Cotes=\useKV[ClesFraction]{Cotes};
+  color ColPolyReg;
+  ColPolyReg=\useKV[ClesFraction]{Couleur};
+  boolean Hachures,Reponse;
+  Reponse=\useKV[ClesFraction]{Reponse};
+  Hachures=\useKV[ClesFraction]{Hachures};
+  Epaisseur=\useKV[ClesFraction]{Epaisseur};
+  pair O,A[],B[];
+  O=u*(0,0);
+  path cc,cd;
+  cc=cercles(O,Rayon);
+  for k=0 upto Cotes:
+  A[k]=pointarc(cc,k*(360/Cotes));
+  endfor;
+  cd=polygone(A0 for k=1 upto Cotes-1:,A[k] endfor);
+  vardef FractionPolyReg(expr nume,deno)=
+  for k=0 upto deno-1:
+  B[k]=point(k*(Cotes/deno)) of cd;
+  endfor;
+  picture fondcolore,FractionPoly;
+  fondcolore=image(
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(O--arccercle(B[0],B[nume mod deno],O)--cycle,1.5*360/Cotes,0.25,0) withcolor ColPolyReg;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  else:
+  remplis O--arccercle(B[0],B[nume mod deno],O)--cycle withcolor ColPolyReg;
+  fi;
+  clip currentpicture to cd;
+  for k=0 upto deno-1:
+  draw segment(O,B[k]) cutafter cd;
+  endfor;
+  trace cd;
+  );
+  currentpicture:=nullpicture;
+  m=nume div deno;
+  if (nume mod deno)=0:m:=m-1; fi;
+  FractionPoly=image(
+  if m>0:
+  for l=0 upto (m-1):
+  if Reponse:
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(cd shifted(l*(Rayon*2+0.5cm,0)),1.5*360/Cotes,0.25,0) withcolor ColPolyReg;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  else:
+  fill cd shifted(l*(Rayon*2+0.5cm,0)) withcolor ColPolyReg;
+  fi;
+  fi;
+  trace cd shifted(l*(Rayon*2+0.5cm,0));
+  if deno>1:
+  for k=0 upto deno-1:
+  draw (segment(O,B[k]) cutafter cd) shifted(l*(Rayon*2+0.5cm,0));
+  endfor;
+  fi;
+  endfor;
+  fi;
+  if Reponse:
+  draw fondcolore shifted(m*(Rayon*2+0.5cm,0));
+  fi;
+  draw cd shifted(m*(Rayon*2+0.5cm,0));
+  if deno>1:
+  for k=0 upto deno-1:
+  draw (segment(O,B[k]) cutafter cd) shifted(m*(Rayon*2+0.5cm,0));
+  endfor;
+  fi;
+  );
+  FractionPoly
+  enddef;
+}%
+
+\def\MPFractionRegulier#1#2{%
+  % #1 num, #2 deno
   \ifluatex
-   \mplibforcehmode
+  \mplibforcehmode
   \begin{mplibcode}
-    pair A,B,C,D,M[],N[],R[],S[];
-    A=(1,1);
-    B-A=(#1,0);
-    C-B=(0,#2);
-    D-C=A-B;
-    numeric parts;
-    parts=(#4 div #6);
-    for k=0 upto parts:
-    M[k]=(k/parts)[A,B];
-    N[k]=(k/parts)[D,C];
-    endfor;
-    if #6>1:
-    for k=0 upto #6:
-    R[k]=(k/#6)[A,D];
-    S[k]=(k/#6)[B,C];
-    endfor;
-    fi;
-    picture FondRectangle;
-    FondRectangle=image(%
-    draw polygone(A,B,C,D);
-    for k=1 upto (parts-1):
-    draw segment(M[k],N[k]);
-    endfor;
-    if #6>1:
-    for k=1 upto (#6-1):
-    draw segment(R[k],S[k]);
-    endfor;
-    fi;
-    );
-    picture FondRectangleColorie;
-    FondRectangleColorie=image(%
-    if #6=1:
-    remplis polygone(A,M[#3 mod #4],N[#3 mod #4],D) withcolor #5;
-    else:
-    DDiv=(#3 mod #4) div parts;
-    MMod=(#3 mod #4) mod parts;
-    remplis polygone(A,B,S[DDiv],R[DDiv]) withcolor #5;
-    remplis polygone(R[DDiv],(xpart(M[MMod]),ypart(R[DDiv])),(xpart(M[MMod]),ypart(R[DDiv+1])),R[DDiv+1]) withcolor #5;
-    fi;
-    );    
-    m=#3 div #4;
-    if (#3 mod #4)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto m-1:
-    remplis (polygone(A,B,C,D) shifted(l*(#1+1cm,0))) withcolor #5;
-    trace FondRectangle shifted(l*(#1+1cm,0));
-    endfor;
-    fi;
-    if (#3 mod #4)<>0:
-    trace FondRectangleColorie shifted(m*(#1+1cm,0));
-    else:
-    remplis (polygone(A,B,C,D) shifted(m*(#1+1cm,0))) withcolor #5;
-    fi;
-    trace FondRectangle shifted(m*(#1+1cm,0));
+    \MPFractionRegulierCode
+    trace FractionPolyReg(#1,#2);
   \end{mplibcode}
   \else
-\begin{mpost}
-      pair A,B,C,D,M[],N[],R[],S[];
-    A=(1,1);
-    B-A=(#1,0);
-    C-B=(0,#2);
-    D-C=A-B;
-    numeric parts;
-    parts=(#4 div #6);
-    for k=0 upto parts:
-    M[k]=(k/parts)[A,B];
-    N[k]=(k/parts)[D,C];
-    endfor;
-    if #6>1:
-    for k=0 upto #6:
-    R[k]=(k/#6)[A,D];
-    S[k]=(k/#6)[B,C];
-    endfor;
-    fi;
-    picture FondRectangle;
-    FondRectangle=image(%
-    draw polygone(A,B,C,D);
-    for k=1 upto (parts-1):
-    draw segment(M[k],N[k]);
-    endfor;
-    if #6>1:
-    for k=1 upto (#6-1):
-    draw segment(R[k],S[k]);
-    endfor;
-    fi;
-    );
-    picture FondRectangleColorie;
-    FondRectangleColorie=image(%
-    if #6=1:
-    remplis polygone(A,M[#3 mod #4],N[#3 mod #4],D) withcolor #5;
-    else:
-    DDiv=(#3 mod #4) div parts;
-    MMod=(#3 mod #4) mod parts;
-    remplis polygone(A,B,S[DDiv],R[DDiv]) withcolor #5;
-    remplis polygone(R[DDiv],(xpart(M[MMod]),ypart(R[DDiv])),(xpart(M[MMod]),ypart(R[DDiv+1])),R[DDiv+1]) withcolor #5;
-    fi;
-    );    
-    m=#3 div #4;
-    if (#3 mod #4)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto m-1:
-    remplis (polygone(A,B,C,D) shifted(l*(#1+1cm,0))) withcolor #5;
-    trace FondRectangle shifted(l*(#1+1cm,0));
-    endfor;
-    fi;
-    if (#3 mod #4)<>0:
-    trace FondRectangleColorie shifted(m*(#1+1cm,0));
-    else:
-    remplis (polygone(A,B,C,D) shifted(m*(#1+1cm,0))) withcolor #5;
-    fi;
-    trace FondRectangle shifted(m*(#1+1cm,0));
+  \begin{mpost}[mpsettings={\MPFractionRegulierCode}]
+    trace FractionPolyReg(#1,#2);
   \end{mpost}
   \fi
-}
+}%
 
-\def\MPFractionRectangleH#1#2#3#4#5#6#7{%
-  % #1 longueur, #2 largeur, #3 num, #4 deno, #5 couleur, #6 multiple
+\def\MPFractionTriangleCode{%
+  Longueur:=\useKV[ClesFraction]{Longueur};
+  nbparts:=\useKV[ClesFraction]{Parts};
+  color ColTriangle;
+  ColTriangle=\useKV[ClesFraction]{Couleur};
+  boolean Hachures,Reponse;
+  Reponse=\useKV[ClesFraction]{Reponse};
+  Hachures=\useKV[ClesFraction]{Hachures};
+  Epaisseur=\useKV[ClesFraction]{Epaisseur};
+  nbtriangle=0;
+  %
+  vardef Ligne(expr longueur)=
+  for k=0 upto 2*(longueur-1):
+  nbtriangle:=nbtriangle+1;
+  if (k mod 2)=0:
+  M[nbtriangle]=(Tria shifted(0.5*k*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+  else:
+  M[nbtriangle]=(Trir shifted(0.5*(k-1)*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+  fi;
+  endfor;
+  enddef;
+  %
+  pair A,B,C;
+  A=u*(0.5,0.5);
+  B-A=(Longueur,0);
+  C=rotation(B,A,60);
+  %
+  path Tria,Trir,M[];
+  Tria=polygone(A,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+  Trir=symetrie(Tria,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+  %
+  for k=nbparts downto 1:
+  Ligne(k);
+  endfor;
+  %
+  vardef FractionTriangle(expr nume,deno)=
+  m:=nume div deno;
+  picture RetourFraction;
+  RetourFraction=image(
+  for l=1 upto (nume mod deno):
+  if Reponse:
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(M[l] shifted(m*(Longueur+1cm,0)),90,0.2,0) withcolor ColTriangle;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  else:
+  fill (M[l] shifted(m*(Longueur+1cm,0))) withcolor ColTriangle;
+  fi;
+  fi;
+  for k=1 upto nbparts:
+  trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]) shifted(m*(Longueur+1cm,0));
+  trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]) shifted(m*(Longueur+1cm,0));
+  trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]) shifted(m*(Longueur+1cm,0));
+  endfor;
+  endfor;
+  % 
+  for l=0 upto (m-1):
+  if Reponse:
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(polygone(A,B,C) shifted(l*(Longueur+1cm,0)),90,0.2,0) withcolor ColTriangle;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  else:
+  remplis polygone(A,B,C) withcolor ColRectangle;
+  fi;
+  fi;
+  for k=1 upto nbparts:
+  trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]) shifted(l*(Longueur+1cm,0));
+  trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]) shifted(l*(Longueur+1cm,0));
+  trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]) shifted(l*(Longueur+1cm,0));
+  endfor;
+  endfor;
+  );
+  RetourFraction
+  enddef;
+}%
+
+\def\MPFractionTriangle#1#2{%
+  % #1 num #2 d\'eno (attention : = partage^2)
   \ifluatex
-   \mplibforcehmode
+  \mplibforcehmode
   \begin{mplibcode}
-    pair A,B,C,D,M[],N[],R[],S[];
-    A=(1,1);
-    B-A=(#1,0);
-    C-B=(0,#2);
-    D-C=A-B;
-    numeric parts;
-    parts=(#4 div #6);
-    for k=0 upto parts:
-    M[k]=(k/parts)[A,B];
-    N[k]=(k/parts)[D,C];
-    endfor;
-    if #6>1:
-    for k=0 upto #6:
-    R[k]=(k/#6)[A,D];
-    S[k]=(k/#6)[B,C];
-    endfor;
-    fi;
-    picture FondRectangle;
-    FondRectangle=image(%
-    draw polygone(A,B,C,D);
-    for k=1 upto (parts-1):
-    draw segment(M[k],N[k]);
-    endfor;
-    if #6>1:
-    for k=1 upto (#6-1):
-    draw segment(R[k],S[k]);
-    endfor;
-    fi;
-    );
-    picture FondRectangleColorie;
-    FondRectangleColorie=image(%
-    if #6=1:
-    drawoptions(withpen pencircle scaled#7);
-    trace hachurage(polygone(A,M[#3 mod #4],N[#3 mod #4],D),45,0.25,0) withcolor #5;
-    else:
-    DDiv=(#3 mod #4) div parts;
-    MMod=(#3 mod #4) mod parts;
-    drawoptions(withpen pencircle scaled#7);
-    trace hachurage(polygone(A,B,S[DDiv],R[DDiv]),45,0.25,0) withcolor #5;
-        drawoptions(withpen pencircle scaled#7);
-    trace hachurage(polygone(R[DDiv],(xpart(M[MMod]),ypart(R[DDiv])),(xpart(M[MMod]),ypart(R[DDiv+1])),R[DDiv+1]),45,0.25,0) withcolor #5;
-    fi;
-    );    
-    m=#3 div #4;
-    if (#3 mod #4)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto m-1:
-        drawoptions(withpen pencircle scaled#7);
-        trace hachurage(polygone(A,B,C,D) shifted(l*(#1+1cm,0)),45,0.25,0) withcolor #5;
-            drawoptions(withpen pencircle scaled#7);
-    trace FondRectangle shifted(l*(#1+1cm,0));
-    endfor;
-    fi;
-    if (#3 mod #4)<>0:
-        drawoptions(withpen pencircle scaled#7);
-    trace FondRectangleColorie shifted(m*(#1+1cm,0));
-    else:
-        drawoptions(withpen pencircle scaled#7);
-    trace hachurage(polygone(A,B,C,D) shifted(m*(#1+1cm,0)),45,0.25,0) withcolor #5;
-    fi;
-        drawoptions(withpen pencircle scaled#7);
-    trace FondRectangle shifted(m*(#1+1cm,0));
+    \MPFractionTriangleCode
+    draw FractionTriangle(#1,#2);
   \end{mplibcode}
   \else
-\begin{mpost}
-    pair A,B,C,D,M[],N[],R[],S[];
-    A=(1,1);
-    B-A=(#1,0);
-    C-B=(0,#2);
-    D-C=A-B;
-    numeric parts;
-    parts=(#4 div #6);
-    for k=0 upto parts:
-    M[k]=(k/parts)[A,B];
-    N[k]=(k/parts)[D,C];
-    endfor;
-    if #6>1:
-    for k=0 upto #6:
-    R[k]=(k/#6)[A,D];
-    S[k]=(k/#6)[B,C];
-    endfor;
-    fi;
-    if #6=1:
-    drawoptions(withpen pencircle scaled#7);
-    draw hachurage(polygone(A,M[#3],N[#3],D),45,0.25,0) withcolor #5;
-    else:
-    DDiv=#3 div parts;
-    MMod=#3 mod parts;
-    drawoptions(withpen pencircle scaled#7);
-    draw hachurage(polygone(A,B,S[DDiv],R[DDiv]),45,0.25,0) withcolor #5;
-    drawoptions(withpen pencircle scaled#7);
-    draw hachurage(polygone(R[DDiv],(xpart(M[MMod]),ypart(R[DDiv])),(xpart(M[MMod]),ypart(R[DDiv+1])),R[DDiv+1]),45,0.25,0) withcolor #5;
-    fi;
-    drawoptions(withpen pencircle scaled#7);
-    draw polygone(A,B,C,D);
-    for k=1 upto (parts-1):
-    draw segment(M[k],N[k]);
-    endfor;
-    if #6>1:
-    for k=1 upto (#6-1):
-    draw segment(R[k],S[k]);
-    endfor;
-    drawoptions();
-    fi;
+  \begin{mpost}[mpsettings={\MPFractionTriangleCode}]
+    draw FractionTriangle(#1,#2);
   \end{mpost}
   \fi
-}
+}%
 
-\def\MPFractionDisque#1#2#3#4{%
-  \ifluatex
-   \mplibforcehmode
+\def\MPFractionRectangleCode{%
+  Longueur=\useKV[ClesFraction]{Longueur};
+  Largeur=\useKV[ClesFraction]{Largeur};
+  color ColRectangle;
+  ColRectangle=\useKV[ClesFraction]{Couleur};
+  boolean Hachures,Reponse;
+  Reponse=\useKV[ClesFraction]{Reponse};
+  Hachures=\useKV[ClesFraction]{Hachures};
+  Epaisseur=\useKV[ClesFraction]{Epaisseur};
+  Multiple=\useKV[ClesFraction]{Multiple};
+  %
+  pair A,B,C,D,M[],N[],R[],S[];
+  A=(1,1);
+  B-A=(Longueur,0);
+  C-B=(0,Largeur);
+  D-C=A-B;
+  vardef FractionRectangle(expr nume,deno)=
+  m=nume div deno;
+  if (nume mod deno)=0:m:=m-1; fi;
+  numeric parts;
+  parts=(deno div Multiple);
+  for k=0 upto parts:
+  M[k]=(k/parts)[A,B];
+  N[k]=(k/parts)[D,C];
+  endfor;
+  if Multiple>1:
+  for k=0 upto Multiple:
+  R[k]=(k/Multiple)[A,D];
+  S[k]=(k/Multiple)[B,C];
+  endfor;
+  fi;
+  picture FondRectangle;
+  FondRectangle=image(%
+  draw polygone(A,B,C,D);
+  for k=1 upto (parts-1):
+  draw segment(M[k],N[k]);
+  endfor;
+  if Multiple>1:
+  for k=1 upto (Multiple-1):
+  draw segment(R[k],S[k]);
+  endfor;
+  fi;
+  );
+  picture FondRectangleColorie;
+  FondRectangleColorie=image(%
+  if Multiple=1:
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(polygone(A,M[nume mod deno],N[nume mod deno],D),45,0.25,0) withcolor ColRectangle;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  else:
+  remplis polygone(A,M[nume mod deno],N[nume mod deno],D) withcolor ColRectangle;
+  fi;
+  else:
+  DDiv=(nume mod deno) div parts;
+  MMod=(nume mod deno) mod parts;
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(polygone(A,B,S[DDiv],R[DDiv]),45,0.25,0) withcolor ColRectangle;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(polygone(R[DDiv],(xpart(M[MMod]),ypart(R[DDiv])),(xpart(M[MMod]),ypart(R[DDiv+1])),R[DDiv+1]),45,0.25,0) withcolor ColRectangle;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  else:
+  remplis polygone(A,B,S[DDiv],R[DDiv]) withcolor ColRectangle;
+  remplis polygone(R[DDiv],(xpart(M[MMod]),ypart(R[DDiv])),(xpart(M[MMod]),ypart(R[DDiv+1])),R[DDiv+1]) withcolor ColRectangle;
+  fi;
+  fi;
+  );
+  picture RetourRectangle;
+  RetourRectangle=image(
+  if m>0:
+  for l=0 upto m-1:
+  if Reponse:
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  trace hachurage(polygone(A,B,C,D) shifted(l*(Longueur+1cm,0)),45,0.25,0) withcolor ColRectangle;
+  drawoptions(withpen pencircle scaled Epaisseur);
+  else:
+  remplis (polygone(A,B,C,D) shifted(l*(Longueur+1cm,0))) withcolor ColRectangle;
+  fi;
+  fi;
+  trace FondRectangle shifted(l*(Longueur+1cm,0));
+  endfor;
+  fi;
+  if (nume mod deno)<>0:
+  if Reponse:
+  trace FondRectangleColorie shifted(m*(Longueur+1cm,0));
+  fi;
+  else:
+  if Reponse:
+  if Hachures:
+  trace hachurage(polygone(A,B,C,D) shifted(m*(Longueur+1cm,0)),45,0.25,0) withcolor ColRectangle;
+  else:
+  remplis (polygone(A,B,C,D) shifted(m*(Longueur+1cm,0))) withcolor ColRectangle;
+  fi;
+  fi;
+  fi;
+  trace FondRectangle shifted(m*(Longueur+1cm,0));
+  );
+  RetourRectangle
+  enddef;
+}%
+
+\def\MPFractionRectangle#1#2{%
+  % #1 num, #2 deno
+  \ifluatex%
+  \mplibforcehmode%
   \begin{mplibcode}
-    pair A,B[];
-    A=(0,0);
-    path cc;
-    cc=cercles(A,#1);
-    for k=0 upto #3:
-    B[k]=pointarc(cc,(360/#3)*k);
-    endfor;
-    m=(#2 div #3);
-    if (#2 mod #3)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto (m-1):
-    fill cc shifted(l*(2*#1+1cm,0)) withcolor #4;
-    endfor;
-    fi;
-    fill ((A--B0--arccercle(B[0],B[#2 mod #3],A)--cycle) shifted (m*(2*#1+1cm,0))) withcolor #4;
-    for l=0 upto m:
-    draw cc shifted(l*(2*#1+1cm,0));
-    for k=0 upto (#3-1):
-    draw segment(A,B[k]) shifted(l*(2*#1+1cm,0));
-    endfor;
-    endfor;
+    \MPFractionRectangleCode
+    trace FractionRectangle(#1,#2);
   \end{mplibcode}
-  \else
-  \begin{mpost}
-    pair A,B[];
-    A=(0,0);
-    path cc;
-    cc=cercles(A,#1);
-    for k=0 upto #3:
-    B[k]=pointarc(cc,(360/#3)*k);
-    endfor;
-    m=#2 div #3;
-    if (#2 mod #3)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto (m-1):
-    fill cc shifted(l*(2*#1+1cm,0)) withcolor #4;
-    endfor;
-    fi;
-    fill ((A--B0--arccercle(B[0],B[#2 mod #3],A)--cycle) shifted (m*(2*#1+1cm,0))) withcolor #4;
-    for l=0 upto m:
-    draw cc shifted(l*(2*#1+1cm,0));
-    for k=0 upto (#3-1):
-    draw segment(A,B[k]) shifted(l*(2*#1+1cm,0));
-    endfor;
-    endfor;
+  \else%
+  \begin{mpost}[mpsettings={\MPFractionRectangleCode}]
+    trace FractionRectangle(#1,#2);
   \end{mpost}
-  \fi
-}
+  \fi%
+}%
 
-\def\MPFractionDisqueH#1#2#3#4#5{%
+\def\MPFractionDisqueCode{%
+  Rayon=\useKV[ClesFraction]{Rayon};
+  Epaisseur=\useKV[ClesFraction]{Epaisseur};
+  color ColDisque;
+  ColDisque=\useKV[ClesFraction]{Couleur};
+  boolean Hachures,Reponse;
+  Hachures=\useKV[ClesFraction]{Hachures};
+  Reponse:=\useKV[ClesFraction]{Reponse};
+  %
+  pair A,B[];
+  A=(0,0);
+  path cc;
+  cc=cercles(A,Rayon);
+  vardef FractionDisque(expr nume,deno)=
+  for k=0 upto deno:
+  B[k]=pointarc(cc,(360/deno)*k);
+  endfor;
+  m=(nume div deno);
+  if (nume mod deno)=0:m:=m-1; fi;
+  picture RetourFraction;
+  RetourFraction=image(%
+  if Reponse:
+  if m>0:
+  for l=0 upto (m-1):
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  draw hachurage(cc shifted(l*(2*Rayon+1cm,0)),1.5*360/deno,0.25,0) withcolor ColDisque;
+  else:
+  fill cc shifted(l*(2*Rayon+1cm,0)) withcolor ColDisque;
+  fi;
+  endfor;
+  fi;
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  draw hachurage((A--B0--arccercle(B[0],B[nume mod deno],A)--cycle) shifted(m*(2*Rayon+1cm,0)),1.5*360/deno,0.25,0) withcolor ColDisque;
+  else:
+  fill ((A--B0--arccercle(B[0],B[nume mod deno],A)--cycle) shifted (m*(2*Rayon+1cm,0))) withcolor ColDisque;
+  fi;
+  fi;
+  for l=0 upto m:
+  draw cc shifted(l*(2*Rayon+1cm,0));
+  for k=0 upto (deno-1):
+  draw segment(A,B[k]) shifted(l*(2*Rayon+1cm,0));
+  endfor;
+  endfor;
+  );
+  RetourFraction
+  enddef;
+}%
+
+\NewDocumentCommand\MPFractionDisque{mm}{%
   \ifluatex
-   \mplibforcehmode
+  \mplibforcehmode
   \begin{mplibcode}
-    pair A,B[];
-    A=(0,0);
-    path cc;
-    cc=cercles(A,#1);
-    for k=0 upto #3:
-    B[k]=pointarc(cc,(360/#3)*k);
-    endfor;
-    m=#2 div #3;
-    if (#2 mod #3)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto (m-1):
-    drawoptions(withpen pencircle scaled#5);
-    draw hachurage(cc shifted(l*(2*#1+1cm,0)),1.5*360/#3,0.25,0) withcolor #4;
-    endfor;
-    fi;
-    drawoptions(withpen pencircle scaled#5);
-    draw hachurage((A--B0--arccercle(B[0],B[#2 mod #3],A)--cycle) shifted(m*(2*#1+1cm,0)),1.5*360/#3,0.25,0) withcolor #4;
-    drawoptions(withpen pencircle scaled#5);
-    for l=0 upto m:
-    draw cc shifted(l*(2*#1+1cm,0));
-    for k=0 upto (#3-1):
-    draw segment(A,B[k]) shifted(l*(2*#1+1cm,0));
-    endfor;
-    endfor;
+    \MPFractionDisqueCode
+    trace FractionDisque(#1,#2);
   \end{mplibcode}
   \else
-  \begin{mpost}
-    pair A,B[];
-    A=(0,0);
-    path cc;
-    cc=cercles(A,#1);
-    for k=0 upto #3:
-    B[k]=pointarc(cc,(360/#3)*k);
-    endfor;
-    m=#2 div #3;
-    if (#2 mod #3)=0:m:=m-1; fi;
-    if m>0:
-    for l=0 upto (m-1):
-    drawoptions(withpen pencircle scaled#5);
-    draw hachurage(cc shifted(l*(2*#1+1cm,0)),1.5*360/#3,0.25,0) withcolor #4;
-    endfor;
-    fi;
-    drawoptions(withpen pencircle scaled#5);
-    draw hachurage((A--B0--arccercle(B[0],B[#2 mod #3],A)--cycle) shifted(m*(2*#1+1cm,0)),1.5*360/#3,0.25,0) withcolor #4;
-    drawoptions(withpen pencircle scaled#5);
-    for l=0 upto m:
-    draw cc shifted(l*(2*#1+1cm,0));
-    for k=0 upto (#3-1):
-    draw segment(A,B[k]) shifted(l*(2*#1+1cm,0));
-    endfor;
-    endfor;
+  \begin{mpost}[mpsettings={\MPFractionDisqueCode}]
+    trace FractionDisque(#1,#2);
   \end{mpost}
   \fi
 }
 
-\def\MPFractionSegment#1#2#3#4{
-  \ifluatex
-   \mplibforcehmode
-  \begin{mplibcode}
-    pair A,C,B[];
-    A=(0,0);
-    C-A=(#1,0);
-    for k=0 upto #3:
-    B[k]=(k/#3)[A,C];
-    endfor;
-    m=#2 div #3;
-    if m>0:
-    for l=0 upto (m-1):
-    draw (segment(B[0],B[#3]) shifted(l*(#1+1cm,0))) withpen pencircle scaled 2 withcolor #4;
-    endfor;
-    fi;
-    if (#2 mod #3)<>0:
-    draw (segment(B[0],B[#2 mod #3]) shifted(m*(#1+1cm,0))) withpen pencircle scaled 2 withcolor #4;
-    draw segment(A,C) shifted(m*(#1+1cm,0));
-    fi;
-    marque_p:="tiretv";
-    for l=0 upto m-1:
-    for k=0 upto #3:
-    pointe(B[k] shifted(l*(#1+1cm,0)));
-    endfor;
-    endfor;
-    if (#2 mod #3)<>0:
-    for k=0 upto #3:
-    pointe(B[k] shifted(m*(#1+1cm,0)));
-    endfor;
-    fi;
-  \end{mplibcode}
-  \else
-  \begin{mpost}
-        pair A,C,B[];
-    A=(0,0);
-    C-A=(#1,0);
-    for k=0 upto #3:
-    B[k]=(k/#3)[A,C];
-    endfor;
-    m=#2 div #3;
-    if m>0:
-    for l=0 upto (m-1):
-    draw (segment(B[0],B[#3]) shifted(l*(#1+1cm,0))) withpen pencircle scaled 2 withcolor #4;
-    endfor;
-    fi;
-    if (#2 mod #3)<>0:
-    draw (segment(B[0],B[#2 mod #3]) shifted(m*(#1+1cm,0))) withpen pencircle scaled 2 withcolor #4;
-    draw segment(A,C) shifted(m*(#1+1cm,0));
-    fi;
-    marque_p:="tiretv";
-    for l=0 upto m-1:
-    for k=0 upto #3:
-    pointe(B[k] shifted(l*(#1+1cm,0)));
-    endfor;
-    endfor;
-    if (#2 mod #3)<>0:
-    for k=0 upto #3:
-    pointe(B[k] shifted(m*(#1+1cm,0)));
-    endfor;
-    fi;
-  \end{mpost}
-  \fi
+\def\MPFractionSegmentCode{%
+  Longueur=\useKV[ClesFraction]{Longueur};
+  color ColSegment;
+  ColSegment=\useKV[ClesFraction]{Couleur};
+  boolean Hachures,Reponse;
+  Reponse=\useKV[ClesFraction]{Reponse};
+  Hachures=\useKV[ClesFraction]{Hachures};
+  Epaisseur=\useKV[ClesFraction]{Epaisseur};
+  %
+  pair A,C,B[];
+  A=(0,0);
+  C-A=(Longueur,0);
+  %
+  vardef FractionSegment(expr nume,deno)=
+  for k=0 upto deno:
+  B[k]=(k/deno)[A,C];
+  endfor;
+  m=nume div deno;
+  picture RetourFraction;
+  RetourFraction=image(
+  if m>0:
+  for l=0 upto (m-1):
+  if Reponse:
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  draw hachurage(polygone(B[0]+u*(0,-0.15),B[deno]+u*(0,-0.15),B[deno]+u*(0,0.15),B[0]+u*(0,0.15)) shifted(l*(Longueur+1cm,0)),120,0.2,0) withcolor ColSegment;
+  drawoptions();
+  else:
+  draw (segment(B[0],B[deno]) shifted(l*(Longueur+1cm,0))) withpen pencircle scaled 2 withcolor ColSegment;
+  fi;
+  fi;
+  draw (segment(B[0],B[deno]) shifted(l*(Longueur+1cm,0)));
+  endfor;
+  fi;
+  if (nume mod deno)<>0:
+  if Reponse:
+  if Hachures:
+  drawoptions(withpen pencircle scaled Epaisseur);
+  draw hachurage(polygone(B[0]+u*(0,-0.15),B[nume mod deno]+u*(0,-0.15),B[nume mod deno]+u*(0,0.15),B[0]+u*(0,0.15)) shifted(m*(Longueur+1cm,0)),120,0.2,0) withcolor ColSegment;
+  drawoptions();
+  else:
+  draw (segment(B[0],B[nume mod deno]) shifted(m*(Longueur+1cm,0))) withpen pencircle scaled 2 withcolor ColSegment;
+  draw segment(A,C) shifted(m*(Longueur+1cm,0));
+  fi;
+  fi;
+  draw (segment(B[0],B[nume mod deno]) shifted(m*(Longueur+1cm,0)));
+  draw segment(A,C) shifted(m*(Longueur+1cm,0));
+  fi;
+  marque_p:="tiretv";
+  for l=0 upto m-1:
+  for k=0 upto deno:
+  pointe(B[k] shifted(l*(Longueur+1cm,0)));
+  endfor;
+  endfor;
+  if (nume mod deno)<>0:
+  for k=0 upto deno:
+  pointe(B[k] shifted(m*(Longueur+1cm,0)));
+  endfor;
+  fi;
+  );
+  RetourFraction
+  enddef;
 }
 
-\def\MPFractionSegmentH#1#2#3#4#5{%
+\NewDocumentCommand\MPFractionSegment{mm}{%
   \ifluatex
-   \mplibforcehmode
+  \mplibforcehmode
   \begin{mplibcode}
-    pair A,C,B[];
-    A=(0,0);
-    C-A=(#1,0);
-    for k=0 upto #3:
-    B[k]=(k/#3)[A,C];
-    endfor;
-    m=#2 div #3;
-    if m>0:
-    for l=0 upto (m-1):
-    drawoptions(withpen pencircle scaled#5);
-    draw hachurage(polygone(B[0]+u*(0,-0.15),B[#3]+u*(0,-0.15),B[#3]+u*(0,0.15),B[0]+u*(0,0.15)) shifted(l*(#1+1cm,0)),120,0.2,0) withcolor #4;
-    drawoptions(withpen pencircle scaled#5);
-    draw segment(A,C) shifted(l*(#1+1cm,0));
-    endfor;
-    fi;
-    if (#2 mod #3)<>0:
-    drawoptions(withpen pencircle scaled#5);
-    draw hachurage(polygone(B[0]+u*(0,-0.15),B[#2 mod #3]+u*(0,-0.15),B[#2 mod #3]+u*(0,0.15),B[0]+u*(0,0.15)) shifted(m*(#1+1cm,0)),120,0.2,0) withcolor #4;
-            drawoptions(withpen pencircle scaled#5);
-    draw segment(A,C) shifted(m*(#1+1cm,0));
-    fi;
-    marque_p:="tiretv";
-    for l=0 upto m-1:
-    for k=0 upto #3:
-    pointe(B[k] shifted(l*(#1+1cm,0)));
-    endfor;
-    endfor;
-    if (#2 mod #3)<>0:
-    for k=0 upto #3:
-    pointe(B[k] shifted(m*(#1+1cm,0)));
-    endfor;
-    fi;
+    \MPFractionSegmentCode
+    trace FractionSegment(#1,#2);
   \end{mplibcode}
   \else
-  \begin{mpost}
-        pair A,C,B[];
-    A=(0,0);
-    C-A=(#1,0);
-    for k=0 upto #3:
-    B[k]=(k/#3)[A,C];
-    endfor;
-    m=#2 div #3;
-    if m>0:
-    for l=0 upto (m-1):
-    drawoptions(withpen pencircle scaled#5);
-    draw hachurage(polygone(B[0]+u*(0,-0.15),B[#3]+u*(0,-0.15),B[#3]+u*(0,0.15),B[0]+u*(0,0.15)) shifted(l*(#1+1cm,0)),120,0.2,0) withcolor #4;
-    drawoptions(withpen pencircle scaled#5);
-    draw segment(A,C) shifted(l*(#1+1cm,0));
-    endfor;
-    fi;
-    if (#2 mod #3)<>0:
-    drawoptions(withpen pencircle scaled#5);
-    draw hachurage(polygone(B[0]+u*(0,-0.15),B[#2 mod #3]+u*(0,-0.15),B[#2 mod #3]+u*(0,0.15),B[0]+u*(0,0.15)) shifted(m*(#1+1cm,0)),120,0.2,0) withcolor #4;
-            drawoptions(withpen pencircle scaled#5);
-    draw segment(A,C) shifted(m*(#1+1cm,0));
-    fi;
-    marque_p:="tiretv";
-    for l=0 upto m-1:
-    for k=0 upto #3:
-    pointe(B[k] shifted(l*(#1+1cm,0)));
-    endfor;
-    endfor;
-    if (#2 mod #3)<>0:
-    for k=0 upto #3:
-    pointe(B[k] shifted(m*(#1+1cm,0)));
-    endfor;
-    fi;
+  \begin{mpost}[mpsettings={\MPFractionSegmentCode}]
+    trace FractionSegment(#1,#2);
   \end{mpost}
   \fi
 }
 
-\newcommand\Fraction[2][]{%
+\NewDocumentCommand\Fraction{o m}{%
   \useKVdefault[ClesFraction]%
   \setKV[ClesFraction]{#1}%
   \setsepchar[*]{/}%
   \readlist*\ListeFraction{#2}%
-  \ifboolKV[ClesFraction]{Triangle}{%
-    \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
-      \ifboolKV[ClesFraction]{Hachures}{%
-        \MPFractionTriangleH{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Parts}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}%
-      }{%
-        \MPFractionTriangle{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Parts}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
-      }%
+  \ifboolKV[ClesFraction]{Eprouvette}{%
+    \MPFractionEprouvette{\ListeFraction[1]}{\ListeFraction[2]}%
   }{%
-    \ifboolKV[ClesFraction]{Regulier}{%
-      \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
-      \ifboolKV[ClesFraction]{Hachures}{%
-        \MPFractionRegulierH{\useKV[ClesFraction]{Rayon}}{\useKV[ClesFraction]{Cotes}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}%
+    \ifboolKV[ClesFraction]{Triangle}{%
+      \MPFractionTriangle{\ListeFraction[1]}{\ListeFraction[2]}%
+    }{%
+      \ifboolKV[ClesFraction]{Regulier}{%
+        \MPFractionRegulier{\ListeFraction[1]}{\ListeFraction[2]}%
       }{%
-        \MPFractionRegulier{\useKV[ClesFraction]{Rayon}}{\useKV[ClesFraction]{Cotes}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
-      }%
-    }{%
-      \ifboolKV[ClesFraction]{Segment}{%
-        \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
-        \ifboolKV[ClesFraction]{Hachures}{%
-          \MPFractionSegmentH{\useKV[ClesFraction]{Longueur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}%
+        \ifboolKV[ClesFraction]{Segment}{%
+          \MPFractionSegment{\ListeFraction[1]}{\ListeFraction[2]}%
         }{%
-          \MPFractionSegment{\useKV[ClesFraction]{Longueur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
-        }%
-      }{%
-        \ifboolKV[ClesFraction]{Rectangle}{%rectangle
-          \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
-          \ifboolKV[ClesFraction]{Hachures}{%
-            \MPFractionRectangleH{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Largeur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Multiple}}{\useKV[ClesFraction]{Epaisseur}}%
+          \ifboolKV[ClesFraction]{Rectangle}{%
+            \MPFractionRectangle{\ListeFraction[1]}{\ListeFraction[2]}%
           }{%
-            \MPFractionRectangle{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Largeur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Multiple}}%
+            \MPFractionDisque{\ListeFraction[1]}{\ListeFraction[2]}%
           }%
-        }{%disque
-          \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
-          \ifboolKV[ClesFraction]{Hachures}{%
-            \MPFractionDisqueH{\useKV[ClesFraction]{Rayon}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}% 
-          }{%
-            \MPFractionDisque{\useKV[ClesFraction]{Rayon}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
-          }%
         }%
       }%
     }%

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCSquaro.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCSquaro.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCSquaro.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -6,31 +6,33 @@
 
 \NewDocumentCommand\SquarO{o}{%
   \useKVdefault[Squaro]%
-  \setKVdefault[Squaro]{#1}%
-  \ifboolKV[Squaro]{Solution}{\BuildSquaroSolution}{\BuildSquaro}%
+  \setKV[Squaro]{#1}%
+  \BuildSquaro%
+}%
+
+\def\BuildSquarobase{%
+  numeric Longueur,Largeur;
+  Longueur=\useKV[Squaro]{Longueur};
+  Largeur=\useKV[Squaro]{Largeur};
+  boolean Solution,Graines;
+  Solution=\useKV[Squaro]{Solution};
+  Graines=\useKV[Squaro]{Graines};
+  if Graines:
+  randomseed:=\useKV[Squaro]{Graine};
+  fi;
+  %
+  u:=\useKV[Squaro]{Echelle};
+  %
+  p:=0;
+  pair A[];%centre des carrés.
+  boolean Allume[][];
 }
 
 \NewDocumentCommand\BuildSquaro{}{%
   \ifluatex
-    \mplibforcehmode
-  \xdef\PfCSquaroNom{\useKV[Squaro]{Nom}}%
-  \begin{mplibcode}[\PfCSquaroNom]
-    numeric Longueur,Largeur;
-    Longueur=\useKV[Squaro]{Longueur};
-    Largeur=\useKV[Squaro]{Largeur};
-    boolean Solution,Graines;
-    Solution=\useKV[Squaro]{Solution};
-    Graines:=\useKV[Squaro]{Graines};
-    if Graines:
-    randomseed:=\useKV[Squaro]{Graine};
-    fi;
-    
-    u:=\useKV[Squaro]{Echelle};
-    
-    p:=0;
-    pair A[];%centre des carrés.
-    boolean Allume[][];
-    
+  \mplibforcehmode
+  \begin{mplibcode}
+    \BuildSquarobase
     for k=0 upto Longueur-1:
     for l=0 upto Largeur-1:
     p:=p+1;
@@ -63,20 +65,13 @@
     label(TEX(decimal(Retiens)),u*(l+0.5,-k+0.5));
     endfor;
     endfor;
- \end{mplibcode}
- \fi
-}
-
-\NewDocumentCommand\BuildSquaroSolution{}{%
-  \ifluatex
-  \mplibforcehmode
-  \xdef\PfCSquaroNom{\useKV[Squaro]{Nom}}%
-  \begin{mplibcode}[\PfCSquaroNom]
-    u:=\useKV[Squaro]{Echelle};
-    p:=0;
+  \end{mplibcode}
+  \else
+  \begin{mpost}[mpsettings={\BuildSquarobase}]
     for k=0 upto Longueur-1:
     for l=0 upto Largeur-1:
     p:=p+1;
+    A[p]=u*(k,-l);
     trace (unitsquare scaled u) shifted A[p];
     endfor;
     endfor;
@@ -83,9 +78,12 @@
 
     for k=0 upto Largeur:
     for l=0 upto Longueur:
-    if Allume[k][l]=true:
-    fill cercles(u*(l,-k+1),1mm);
+    m:=uniformdeviate(1);
+    if m<0.5:
+    Allume[k][l]=true;
+    fill cercles(u*(l,-k+1),1mm) if Solution=false:withcolor white fi;
     else:
+    Allume[k][l]=false;
     fill cercles(u*(l,-k+1),1mm) withcolor white;
     fi;
     trace cercles(u*(l,-k+1),1mm);
@@ -99,9 +97,9 @@
     if Allume[k][l+1]:Retiens:=Retiens+1 fi;
     if Allume[k+1][l]:Retiens:=Retiens+1 fi;
     if Allume[k+1][l+1]:Retiens:=Retiens+1 fi;
-    label(TEX(decimal(Retiens)),u*(l+0.5,-k+0.5));
+    label(LATEX(decimal(Retiens)),u*(l+0.5,-k+0.5));
     endfor;
     endfor;
- \end{mplibcode}
+  \end{mpost}
  \fi
 }%
\ No newline at end of file

Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCSquaroaprioriold.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCSquaroaprioriold.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCSquaroaprioriold.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -0,0 +1,107 @@
+%%%
+% Squaro
+%%%
+\setKVdefault[Squaro]{Solution=false,Longueur=8,Largeur=8,Echelle=8mm,Nom=Jeu1,Graines=false}
+\defKV[Squaro]{Graine=\setKV[Squaro]{Graines}}%
+
+\NewDocumentCommand\SquarO{o}{%
+  \useKVdefault[Squaro]%
+  \setKVdefault[Squaro]{#1}%
+  \ifboolKV[Squaro]{Solution}{\BuildSquaroSolution}{\BuildSquaro}%
+}
+
+\NewDocumentCommand\BuildSquaro{}{%
+  \ifluatex
+  \mplibforcehmode
+  \xdef\PfCSquaroNom{\useKV[Squaro]{Nom}}%
+  \begin{mplibcode}[\PfCSquaroNom]
+    numeric Longueur,Largeur;
+    Longueur=\useKV[Squaro]{Longueur};
+    Largeur=\useKV[Squaro]{Largeur};
+    boolean Solution,Graines;
+    Solution=\useKV[Squaro]{Solution};
+    Graines:=\useKV[Squaro]{Graines};
+    if Graines:
+    randomseed:=\useKV[Squaro]{Graine};
+    fi;
+    
+    u:=\useKV[Squaro]{Echelle};
+    
+    p:=0;
+    pair A[];%centre des carrés.
+    boolean Allume[][];
+    
+    for k=0 upto Longueur-1:
+    for l=0 upto Largeur-1:
+    p:=p+1;
+    A[p]=u*(k,-l);
+    trace (unitsquare scaled u) shifted A[p];
+    endfor;
+    endfor;
+
+    for k=0 upto Largeur:
+    for l=0 upto Longueur:
+    m:=uniformdeviate(1);
+    if m<0.5:
+    Allume[k][l]=true;
+    fill cercles(u*(l,-k+1),1mm) if Solution=false:withcolor white fi;
+    else:
+    Allume[k][l]=false;
+    fill cercles(u*(l,-k+1),1mm) withcolor white;
+    fi;
+    trace cercles(u*(l,-k+1),1mm);
+    endfor;
+    endfor;
+
+    for k=0 upto Largeur-1:
+    for l=0 upto Longueur-1:
+    Retiens:=0;
+    if Allume[k][l]:Retiens:=Retiens+1 fi;
+    if Allume[k][l+1]:Retiens:=Retiens+1 fi;
+    if Allume[k+1][l]:Retiens:=Retiens+1 fi;
+    if Allume[k+1][l+1]:Retiens:=Retiens+1 fi;
+    label(TEX(decimal(Retiens)),u*(l+0.5,-k+0.5));
+    endfor;
+    endfor;
+ \end{mplibcode}
+ \fi
+}
+
+\NewDocumentCommand\BuildSquaroSolution{}{%
+  \ifluatex
+  \mplibforcehmode
+  \xdef\PfCSquaroNom{\useKV[Squaro]{Nom}}%
+  \begin{mplibcode}[\PfCSquaroNom]
+    u:=\useKV[Squaro]{Echelle};
+    p:=0;
+    for k=0 upto Longueur-1:
+    for l=0 upto Largeur-1:
+    p:=p+1;
+    trace (unitsquare scaled u) shifted A[p];
+    endfor;
+    endfor;
+
+    for k=0 upto Largeur:
+    for l=0 upto Longueur:
+    if Allume[k][l]=true:
+    fill cercles(u*(l,-k+1),1mm);
+    else:
+    fill cercles(u*(l,-k+1),1mm) withcolor white;
+    fi;
+    trace cercles(u*(l,-k+1),1mm);
+    endfor;
+    endfor;
+
+    for k=0 upto Largeur-1:
+    for l=0 upto Longueur-1:
+    Retiens:=0;
+    if Allume[k][l]:Retiens:=Retiens+1 fi;
+    if Allume[k][l+1]:Retiens:=Retiens+1 fi;
+    if Allume[k+1][l]:Retiens:=Retiens+1 fi;
+    if Allume[k+1][l+1]:Retiens:=Retiens+1 fi;
+    label(TEX(decimal(Retiens)),u*(l+0.5,-k+0.5));
+    endfor;
+    endfor;
+ \end{mplibcode}
+ \fi
+}%
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCSquaroaprioriold.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -229,6 +229,46 @@
   \num{\TotalECC}%
 }
 
+\def\NewMPDiagBarreHorCode{%
+  Longueur:=\useKV[ClesStat]{Longueur};
+  Hauteur:=\useKV[ClesStat]{Hauteur};
+  Ecart:=\useKV[ClesStat]{EcartBarre};
+  ExposantDivMax:=\ExposantDivMax;
+  ecarthachures=\useKV[ClesStat]{EcartHachures};
+  epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};
+  boolean Hachures,Bicolore,Grille,AffichageDonnee,LegendeVide;
+  Hachures=\useKV[ClesStat]{Hachures};
+  Bicolore=\useKV[ClesStat]{Bicolore};
+  Grille=\useKV[ClesStat]{Grille};
+  AffichageDonnee=\useKV[ClesStat]{AffichageDonnee};
+  LegendeVide=\useKV[ClesStat]{LegendeVide};
+  vardef CalculNombreDonneesEtDonneeMax(text t)=
+  nbdon:=0;%nombre de données
+  DonneeMax:=0;%donnée DonneeMaximale
+  for p_=t:
+  nbdon:=nbdon+1;
+  if p_>DonneeMax:
+  DonneeMax:=p_;
+  fi;
+  endfor;
+  enddef;
+  vardef ListeDonnees(text t)=
+  n:=0;
+  for p_=t:
+  n:=n+1;
+  Donnees[n]:=p_;
+  endfor;
+  enddef;
+  vardef RecuperationCouleurs(text t)=
+  color Col[];
+  n:=0;
+  for p_=t:
+  n:=n+1;
+  Col[n]=p_;
+  endfor;
+  enddef;
+}
+
 % Construction d'un diagramme en barres horizontal
 \newcommand\NewMPDiagBarreHor[4]{%
   % #1 Liste des noms
@@ -238,47 +278,7 @@
   \ifluatex%
   \mplibforcehmode%
   \begin{mplibcode}%
-    Longueur:=\useKV[ClesStat]{Longueur};
-    Hauteur:=\useKV[ClesStat]{Hauteur};
-    Ecart:=\useKV[ClesStat]{EcartBarre};
-    ExposantDivMax:=\ExposantDivMax;
-    ecarthachures=\useKV[ClesStat]{EcartHachures};
-    epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};
-    boolean Hachures;
-    Hachures=\useKV[ClesStat]{Hachures};
-    boolean Bicolore;
-    Bicolore=\useKV[ClesStat]{Bicolore};
-    boolean Grille;
-    Grille=\useKV[ClesStat]{Grille};
-    boolean AffichageDonnee;
-    AffichageDonnee=\useKV[ClesStat]{AffichageDonnee};
-    boolean LegendeVide;
-    LegendeVide=\useKV[ClesStat]{LegendeVide};
-    vardef CalculNombreDonneesEtDonneeMax(text t)=
-    nbdon:=0;%nombre de données
-    DonneeMax:=0;%donnée DonneeMaximale
-    for p_=t:
-    nbdon:=nbdon+1;
-    if p_>DonneeMax:
-    DonneeMax:=p_;
-    fi;
-    endfor;
-    enddef;
-    vardef ListeDonnees(text t)=
-    n:=0;
-    for p_=t:
-    n:=n+1;
-    Donnees[n]:=p_;
-    endfor;
-    enddef;
-    vardef RecuperationCouleurs(text t)=
-    color Col[];
-    n:=0;
-    for p_=t:
-    n:=n+1;
-    Col[n]=p_;
-    endfor;
-    enddef;
+    \NewMPDiagBarreHorCode%
     vardef TraceDiag=
     if Grille:
     pair Zz[];%Pour déterminer "le dernier point"
@@ -353,49 +353,7 @@
     fi;
   \end{mplibcode}
   \else%
-  \begin{mpost}[mpsettings={%
-      Longueur:=\useKV[ClesStat]{Longueur};
-      Hauteur:=\useKV[ClesStat]{Hauteur};
-      Ecart:=\useKV[ClesStat]{EcartBarre};
-      ExposantDivMax:=\ExposantDivMax;
-      ecarthachures=\useKV[ClesStat]{EcartHachures};
-      epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};
-      boolean Hachures;
-      Hachures=\useKV[ClesStat]{Hachures};
-      boolean Bicolore;
-      Bicolore=\useKV[ClesStat]{Bicolore};
-      boolean Grille;
-      Grille=\useKV[ClesStat]{Grille};
-      boolean AffichageDonnee;
-      AffichageDonnee=\useKV[ClesStat]{AffichageDonnee};
-      boolean LegendeVide;
-      LegendeVide=\useKV[ClesStat]{LegendeVide};
-    }]
-    vardef CalculNombreDonneesEtDonneeMax(text t)=
-    nbdon:=0;%nombre de données
-    DonneeMax:=0;%donnée DonneeMaximale
-    for p_=t:
-    nbdon:=nbdon+1;
-    if p_>DonneeMax:
-    DonneeMax:=p_;
-    fi;
-    endfor;
-    enddef;
-    vardef ListeDonnees(text t)=
-    n:=0;
-    for p_=t:
-    n:=n+1;
-    Donnees[n]:=p_;
-    endfor;
-    enddef;
-    vardef RecuperationCouleurs(text t)=
-    color Col[];
-    n:=0;
-    for p_=t:
-    n:=n+1;
-    Col[n]=p_;
-    endfor;
-    enddef;
+  \begin{mpost}[mpsettings={\NewMPDiagBarreHorCode}]
     vardef TraceDiag=
     if Grille:
     pair Zz[];%Pour déterminer "le dernier point"
@@ -472,37 +430,70 @@
   \fi%
 }%
 
+\def\MPStatNewCode{%
+  maxx:=0;
+  maxy:=0;
+  unitex:=\useKV[ClesStat]{Unitex}*cm;
+  unitey:=\useKV[ClesStat]{Unitey}*cm;
+  xpartorigine:=\useKV[ClesStat]{Origine};
+  AngleRotation=\useKV[ClesStat]{AngleRotationAbscisse};
+  boolean Rotation,Lecture,LectureFine,AideLecture,DonneesSup,Reponses,Qualitatif,Tiret;
+  Rotation=\useKV[ClesStat]{AbscisseRotation};
+  Lecture:=\useKV[ClesStat]{Lecture};
+  LectureFine:=\useKV[ClesStat]{LectureFine};
+  AideLecture:=\useKV[ClesStat]{AideLecture};
+  DonneesSup:=\useKV[ClesStat]{DonneesSup};
+  Reponses:=\useKV[ClesStat]{Reponses};
+  epaisseurbatons=\useKV[ClesStat]{EpaisseurBatons};
+  Qualitatif=\useKV[ClesStat]{Qualitatif};
+  Tiret=\useKV[ClesStat]{Tiret};
+  color CoulDefaut;
+  CoulDefaut=\useKV[ClesStat]{CouleurDefaut};
+  Depart=\useKV[ClesStat]{Depart};
+  % 
+  pair A[],B[],P[];
+  vardef toto(text t)=%points quantitatif
+  n:=0;
+  for p_=t:
+  if pair p_:
+  n:=n+1;
+  P[n]=((xpart(p_)-(xpartorigine))*unitex,ypart(p_)*unitey);
+  if xpart(p_)>maxx:
+  maxx:=xpart(p_)-(xpartorigine);
+  fi;
+  if ypart(p_)>maxy:
+  maxy:=ypart(p_);
+  fi;
+  A[n]=unitex*(xpart(p_)-(xpartorigine),0);
+  B[n]=unitey*(0,ypart(p_));
+  fi;
+  endfor;
+  enddef;
+  vardef tutu(text t)=%points qualitatif
+  n:=0;
+  for p_=t:
+  if numeric p_:
+  P[n]=((n)*unitex,unitey*(p_-Depart));
+  B[n]=(0,unitey*(p_-Depart));
+  if p_>maxy:
+  maxy:=p_;
+  fi;
+  else:
+  n:=n+1;
+  A[n]=unitex*(n,0);
+  fi;
+  endfor;
+  maxy:=maxy-Depart;
+  maxx:=n;
+  enddef;
+}
+
 % Construction du graphique en bâtons
 \newcommand\MPStatNew[2]{%
   \ifluatex
   \mplibforcehmode
   \begin{mplibcode}
-    maxx:=0;
-    maxy:=0;
-    unitex:=\useKV[ClesStat]{Unitex}*cm;
-    unitey:=\useKV[ClesStat]{Unitey}*cm;
-    xpartorigine:=\useKV[ClesStat]{Origine};
-    AngleRotation=\useKV[ClesStat]{AngleRotationAbscisse};
-    boolean Rotation;
-    Rotation=\useKV[ClesStat]{AbscisseRotation};
-    boolean Lecture;
-    Lecture:=\useKV[ClesStat]{Lecture};
-    boolean LectureFine;
-    LectureFine:=\useKV[ClesStat]{LectureFine};
-    boolean AideLecture;
-    AideLecture:=\useKV[ClesStat]{AideLecture};
-    boolean DonneesSup;
-    DonneesSup:=\useKV[ClesStat]{DonneesSup};
-    boolean Reponses;
-    Reponses:=\useKV[ClesStat]{Reponses};
-    epaisseurbatons=\useKV[ClesStat]{EpaisseurBatons};
-    boolean Qualitatif;
-    Qualitatif=\useKV[ClesStat]{Qualitatif};
-    boolean Tiret;
-    Tiret=\useKV[ClesStat]{Tiret};
-    color CoulDefaut;
-    CoulDefaut=\useKV[ClesStat]{CouleurDefaut};
-    Depart=\useKV[ClesStat]{Depart};
+    \MPStatNewCode
     % on r\'ecup\`ere les couleurs
     color Col[];
     n:=0;
@@ -514,42 +505,6 @@
     Col[n]=CoulDefaut;
     fi;
     endfor;
-    % 
-    pair A[],B[],P[];
-    vardef toto(text t)=%points quantitatif
-    n:=0;
-    for p_=t:
-    if pair p_:
-    n:=n+1;
-    P[n]=((xpart(p_)-(xpartorigine))*unitex,ypart(p_)*unitey);
-    if xpart(p_)>maxx:
-    maxx:=xpart(p_)-(xpartorigine);
-    fi;
-    if ypart(p_)>maxy:
-    maxy:=ypart(p_);
-    fi;
-    A[n]=unitex*(xpart(p_)-(xpartorigine),0);
-    B[n]=unitey*(0,ypart(p_));
-    fi;
-    endfor;
-    enddef;
-    vardef tutu(text t)=%points qualitatif
-    n:=0;
-    for p_=t:
-    if numeric p_:
-    P[n]=((n)*unitex,unitey*(p_-Depart));
-    B[n]=(0,unitey*(p_-Depart));
-    if p_>maxy:
-    maxy:=p_;
-    fi;
-    else:
-    n:=n+1;
-    A[n]=unitex*(n,0);
-    fi;
-    endfor;
-    maxy:=maxy-Depart;
-    maxx:=n;
-    enddef;
     vardef tata(text t)=%affichage quantitatif
     l=0;
     for p_=t:
@@ -659,33 +614,7 @@
     if Qualitatif: titi(#1); else:tata(#1); fi;
   \end{mplibcode}
   \else
-  \begin{mpost}[mpsettings={%
-      unitex:=\useKV[ClesStat]{Unitex}*cm;
-      unitey:=\useKV[ClesStat]{Unitey}*cm;
-      xpartorigine:=\useKV[ClesStat]{Origine};
-      AngleRotation=\useKV[ClesStat]{AngleRotationAbscisse};
-      boolean Rotation,Lecture;
-      Rotation=\useKV[ClesStat]{AbscisseRotation};
-%      boolean Lecture;
-      Lecture:=\useKV[ClesStat]{Lecture};
-      boolean LectureFine;
-      LectureFine:=\useKV[ClesStat]{LectureFine};
-      boolean AideLecture;
-      AideLecture:=\useKV[ClesStat]{AideLecture};
-      boolean DonneesSup;
-      DonneesSup:=\useKV[ClesStat]{DonneesSup};
-      boolean Reponses;
-      Reponses:=\useKV[ClesStat]{Reponses};
-      epaisseurbatons=\useKV[ClesStat]{EpaisseurBatons};
-      boolean Qualitatif;
-      Qualitatif=\useKV[ClesStat]{Qualitatif};
-      boolean Tiret;
-      Tiret=\useKV[ClesStat]{Tiret};
-      color CoulDefaut;
-      CoulDefaut=\useKV[ClesStat]{CouleurDefaut};
-      Depart=\useKV[ClesStat]{Depart};}]
-    maxx:=0;
-    maxy:=0;
+  \begin{mpost}[mpsettings={\MPStatNewCode}]
     % on r\'ecup\`ere les couleurs
     color Col[];
     n:=0;
@@ -698,24 +627,6 @@
     fi;
     endfor;
     % 
-    pair A[],B[],P[];
-    vardef toto(text t)=%points quantitatif
-    n:=0;
-    for p_=t:
-    if pair p_:
-    n:=n+1;
-    P[n]=((xpart(p_)-(xpartorigine))*unitex,ypart(p_)*unitey);
-    if xpart(p_)>maxx:
-    maxx:=xpart(p_)-(xpartorigine);
-    fi;
-    if ypart(p_)>maxy:
-    maxy:=ypart(p_);
-    fi;
-    A[n]=unitex*(xpart(p_)-(xpartorigine),0);
-    B[n]=unitey*(0,ypart(p_));
-    fi;
-    endfor;
-    enddef;
     vardef tata(text t)=%affichage quantitatif
     l=0;
     for p_=t:
@@ -741,22 +652,6 @@
     fi;
     endfor;
     enddef;
-    vardef tutu(text t)=%points qualitatif
-    n:=0;
-    for p_=t:
-    if numeric p_:
-    P[n]=((n)*unitex,unitey*p_);
-    B[n]=(0,unitey*p_);
-    if p_>maxy:
-    maxy:=p_;
-    fi;
-    else:
-    n:=n+1;
-    A[n]=unitex*(n,0);
-    fi;
-    endfor;
-    maxx:=n;
-    enddef;
     vardef titi(text t)=%affichage qualitatif
     l:=0;
     for p_=t:
@@ -843,6 +738,102 @@
   \fi
 }
 
+\def\NewMPStatCirculaireCodeQ{%
+  Rayon:=\useKV[ClesStat]{Rayon};
+  ecarthachures=\useKV[ClesStat]{EcartHachures};
+  epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};
+  boolean AffichageAngle,AffichageDonnee,Hachures,Inverse,Legende,LegendeVide,Retour,ACompleter;
+  AffichageAngle=\useKV[ClesStat]{AffichageAngle};
+  AffichageDonnee=\useKV[ClesStat]{AffichageDonnee};
+  Hachures=\useKV[ClesStat]{Hachures};
+  Inverse=\useKV[ClesStat]{LectureInverse};
+  Legende=\useKV[ClesStat]{Legende};
+  LegendeVide=\useKV[ClesStat]{LegendeVide};
+  Retour=false;
+  ACompleter=\useKV[ClesStat]{ACompleter};
+  % 
+  pair A[],O,B[],C[],D[];
+  O=(0,0);
+  n:=0;
+  numeric total[],ang[];
+  total[0]=0;
+  ang[0]:=0;
+  path cc;
+  cc=(fullcircle scaled (2*Rayon));
+  vardef AfficheLegende(text t)=
+  picture ResultatLegende;
+  ResultatLegende=image(
+  for p_=t:
+  if string p_:
+  n:=n+1;
+  C[n]=A[n-1] rotatedabout(O,if Inverse:-1* fi(ang[n]-ang[n-1])/2);
+  draw 0.95[O,C[n]]--1.05[O,C[n]];
+  C[n]:=1.05[O,C[n]];
+  Test(n);
+  if (xpart(C[n])>xpart(O)) and (ypart(C[n])>ypart(O)):
+  D[n]=C[n]+(0.5cm,0);
+  draw C[n]--D[n];
+  if Retour=false:label.urt(TEX(p_),D[n]);fi;
+  fi;
+  if (xpart(C[n])<xpart(O)) and (ypart(C[n])>ypart(O)):
+  D[n]=C[n]-(0.5cm,0);
+  draw C[n]--D[n];
+  if Retour=false:label.ulft(TEX(p_),D[n]);fi;
+  fi;
+  if (xpart(C[n])<xpart(O)) and (ypart(C[n])<ypart(O)):
+  D[n]=C[n]-(0.5cm,0);
+  draw C[n]--D[n];
+  if Retour=false:label.llft(TEX(p_),D[n]);fi;
+  fi;
+  if (xpart(C[n])>xpart(O)) and (ypart(C[n])<ypart(O)):
+  D[n]=C[n]+(0.5cm,0);
+  draw C[n]--D[n];
+  if Retour=false:label.lrt(TEX(p_),D[n]);fi;
+  fi;
+  fi;
+  endfor;
+  );
+  ResultatLegende
+  % fi;
+  enddef;
+  vardef AfficheLegendePDF(text t)=
+  picture ResultatLegende;
+  ResultatLegende=image(
+  for p_=t:
+  if string p_:
+  n:=n+1;
+  C[n]=A[n-1] rotatedabout(O,if Inverse:-1* fi(ang[n]-ang[n-1])/2);
+  draw 0.95[O,C[n]]--1.05[O,C[n]];
+  C[n]:=1.05[O,C[n]];
+  Test(n);
+  if (xpart(C[n])>xpart(O)) and (ypart(C[n])>ypart(O)):
+  D[n]=C[n]+(0.5cm,0);
+  draw C[n]--D[n];
+  if Retour=false:label.urt(LATEX(p_),D[n]);fi;
+  fi;
+  if (xpart(C[n])<xpart(O)) and (ypart(C[n])>ypart(O)):
+  D[n]=C[n]-(0.5cm,0);
+  draw C[n]--D[n];
+  if Retour=false:label.ulft(LATEX(p_),D[n]);fi;
+  fi;
+  if (xpart(C[n])<xpart(O)) and (ypart(C[n])<ypart(O)):
+  D[n]=C[n]-(0.5cm,0);
+  draw C[n]--D[n];
+  if Retour=false:label.llft(LATEX(p_),D[n]);fi;
+  fi;
+  if (xpart(C[n])>xpart(O)) and (ypart(C[n])<ypart(O)):
+  D[n]=C[n]+(0.5cm,0);
+  draw C[n]--D[n];
+  if Retour=false:label.lrt(LATEX(p_),D[n]);fi;
+  fi;
+  fi;
+  endfor;
+  );
+  ResultatLegende
+  % fi;
+  enddef;
+}
+
 % la construction du graphique qualitatif
 \def\NewMPStatCirculaireQ#1#2#3#4{%
   %#1 : la liste des données
@@ -852,33 +843,12 @@
   \ifluatex
   \mplibforcehmode
   \begin{mplibcode}
-    Rayon:=\useKV[ClesStat]{Rayon};
-    ecarthachures=\useKV[ClesStat]{EcartHachures};
-    epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};
-    boolean AffichageAngle;
-    AffichageAngle=\useKV[ClesStat]{AffichageAngle};
-    boolean AffichageDonnee;
-    AffichageDonnee=\useKV[ClesStat]{AffichageDonnee};
-    boolean Hachures;
-    Hachures=\useKV[ClesStat]{Hachures};
-    boolean Inverse;
-    Inverse=\useKV[ClesStat]{LectureInverse};
-    boolean Legende;
-    Legende=\useKV[ClesStat]{Legende};
-    boolean LegendeVide;
-    LegendeVide=\useKV[ClesStat]{LegendeVide};
-    boolean Retour;
-    Retour=false;
-    boolean ACompleter;
-    ACompleter=\useKV[ClesStat]{ACompleter};
-    pair A[],O,B[],C[],D[];
-    O=(0,0);
-    n:=0;
-    numeric total[],ang[];
-    total[0]=0;
-    ang[0]:=0;
-    path cc;
-    cc=(fullcircle scaled (2*Rayon));
+    \NewMPStatCirculaireCodeQ
+    if Inverse=false:
+    A[0]=point(0) of cc;
+    else:
+    A[0]=point(180) of cc;
+    fi;
     % on r\'ecup\`ere les couleurs
     color Col[];
     n:=0;
@@ -886,11 +856,6 @@
     n:=n+1;
     Col[n]=p_;
     endfor;
-    if Inverse=false:
-    A[0]=point(0) of cc;
-    else:
-    A[0]=point(180) of cc;
-    fi;
     vardef toto(text t)=
     n:=0;
     for p_=t:
@@ -989,37 +954,6 @@
     draw (subpath(0,length cc/2) of cc)--cycle if Hachures: withpen pencircle scaled2 fi;;
     fi;
     n:=0;
-    if Legende:
-    for p_=t:
-    if string p_:
-    n:=n+1;
-    C[n]=A[n-1] rotatedabout(O,if Inverse:-1* fi(ang[n]-ang[n-1])/2);
-    draw 0.95[O,C[n]]--1.05[O,C[n]];
-    C[n]:=1.05[O,C[n]];
-    Test(n);
-    if (xpart(C[n])>xpart(O)) and (ypart(C[n])>ypart(O)):
-    D[n]=C[n]+(0.5cm,0);
-    draw C[n]--D[n];
-    if Retour=false:label.urt(TEX(p_),D[n]);fi;
-    fi;
-    if (xpart(C[n])<xpart(O)) and (ypart(C[n])>ypart(O)):
-    D[n]=C[n]-(0.5cm,0);
-    draw C[n]--D[n];
-    if Retour=false:label.ulft(TEX(p_),D[n]);fi;
-    fi;
-    if (xpart(C[n])<xpart(O)) and (ypart(C[n])<ypart(O)):
-    D[n]=C[n]-(0.5cm,0);
-    draw C[n]--D[n];
-    if Retour=false:label.llft(TEX(p_),D[n]);fi;
-    fi;
-    if (xpart(C[n])>xpart(O)) and (ypart(C[n])<ypart(O)):
-    D[n]=C[n]+(0.5cm,0);
-    draw C[n]--D[n];
-    if Retour=false:label.lrt(TEX(p_),D[n]);fi;
-    fi;
-    fi;
-    endfor;
-    fi;
     enddef;
     vardef Test(expr nb)=
     Retour:=false;
@@ -1035,29 +969,13 @@
     enddef;    
     Figure(-10u,-10u,10u,10u);
     toto(#1);
+    if Legende:
+    n:=0;
+    draw AfficheLegende(#1);
+    fi;
   \end{mplibcode}
   \else
-  \begin{mpost}[mpsettings={%
-      Rayon:=\useKV[ClesStat]{Rayon};
-      ecarthachures=\useKV[ClesStat]{EcartHachures};
-      epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};
-      boolean AffichageAngle;
-      AffichageAngle=\useKV[ClesStat]{AffichageAngle};
-      boolean AffichageDonnee;
-      AffichageDonnee=\useKV[ClesStat]{AffichageDonnee};
-      boolean Hachures;
-      Hachures=\useKV[ClesStat]{Hachures};
-      boolean Inverse;
-      Inverse=\useKV[ClesStat]{LectureInverse};
-      boolean Legende;
-      Legende=\useKV[ClesStat]{Legende};
-      boolean LegendeVide;
-      LegendeVide=\useKV[ClesStat]{LegendeVide};
-      boolean ACompleter;
-      ACompleter=\useKV[ClesStat]{ACompleter};
-    }]
-    boolean Retour;
-    Retour=false;
+  \begin{mpost}[mpsettings={\NewMPStatCirculaireCodeQ}]
     pair A[],O,B[],C[],D[];
     O=(0,0);
     n:=0;
@@ -1175,40 +1093,6 @@
     else:
     draw (subpath(0,length cc/2) of cc)--cycle if Hachures: withpen pencircle scaled2 fi;;
     fi;
-    n:=0;
-    if Legende:
-    for p_=t:
-    if string p_:
-    n:=n+1;
-    C[n]=A[n-1] rotatedabout(O,if Inverse:-1* fi(ang[n]-ang[n-1])/2);
-    draw 0.95[O,C[n]]--1.05[O,C[n]];
-    C[n]:=1.05[O,C[n]];
-    Test(n);
-    if Retour=false:
-    if (xpart(C[n])>xpart(O)) and (ypart(C[n])>ypart(O)):
-    D[n]=C[n]+(0.5cm,0);
-    draw C[n]--D[n];
-    label.urt(LATEX(p_),D[n]);
-    fi;
-    if (xpart(C[n])<xpart(O)) and (ypart(C[n])>ypart(O)):
-    D[n]=C[n]-(0.5cm,0);
-    draw C[n]--D[n];
-    label.ulft(LATEX(p_),D[n]);
-    fi;
-    if (xpart(C[n])<xpart(O)) and (ypart(C[n])<ypart(O)):
-    D[n]=C[n]-(0.5cm,0);
-    draw C[n]--D[n];
-    label.llft(LATEX(p_),D[n]);
-    fi;
-    if (xpart(C[n])>xpart(O)) and (ypart(C[n])<ypart(O)):
-    D[n]=C[n]+(0.5cm,0);
-    draw C[n]--D[n];
-    label.lrt(LATEX(p_),D[n]);
-    fi;
-    fi;
-    fi;
-    endfor;
-    fi;
     enddef;
     vardef Test(expr nb)=
     Retour:=false;
@@ -1224,6 +1108,10 @@
     enddef;    
     Figure(-10u,-10u,10u,10u);
     toto(#1);
+    if Legende:
+    n:=0;
+    draw AfficheLegendePDF(#1);
+    fi;
   \end{mpost}
   \fi
 }%

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCTableauxUnites.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCTableauxUnites.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCTableauxUnites.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -1,7 +1,7 @@
 %%%
 % Tableaux d'unit\'es
 %%%
-\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1,Octet=false}
+\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1,Octet=false,CouleurGN=white,CadreGN=black}
 
 \newcommand\PfCTBstrut{\rule[-1.2ex]{0pt}{3.8ex}}% Top and Bottom strut
 \newcommand\PfCTstrut{\rule{0pt}{3.8ex}}% Top strut
@@ -1025,7 +1025,7 @@
       \end{NiceTabular}%
     \end{center}%
     \setlength{\tabcolsep}{100\tabcolsep}%
-  }{}%  
+  }{}%
   %
   %%% Prise en compte de la cl\'e Metre
   %
@@ -1386,4 +1386,97 @@
   \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (7-|3.5) to node[midway,left]{\footnotesize$\div\num{\PfCCoefConversion}$}(5-|2.5);
   \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (5-|2.5) to node[midway,left]{\footnotesize$\div\num{\PfCCoefConversion}$}(3-|1.5);
 \end{NiceTabular}%
+}%
+
+%%%
+% Glisse Nombre
+%%%
+\NewDocumentCommand\GlisseNombre{o m}{%
+  \useKVdefault[ClesTableaux]%
+  \setKV[ClesTableaux]{#1}%
+  \colorlet{PfCCouleurFondGN}{\useKV[ClesTableaux]{CouleurGN}}%
+  \colorlet{PfCCouleurCadreGN}{\useKV[ClesTableaux]{CadreGN}}%
+  \xintifboolexpr{\useKV[ClesTableaux]{NbLignes}<10}{\setKV[ClesTableaux]{NbLignes=10}}{}%
+  \ifboolKV[ClesTableaux]{Entiers}{%
+    \colorlet{PfCCouleurA}{\useKV[ClesTableaux]{CouleurG}}%
+    \colorlet{PfCCouleurB}{\useKV[ClesTableaux]{CouleurM}}%
+    \colorlet{PfCCouleurC}{\useKV[ClesTableaux]{CouleurM}}%
+    \colorlet{PfCCouleurD}{\useKV[ClesTableaux]{Couleurm}}%
+    \colorlet{PfCCouleurE}{\useKV[ClesTableaux]{Couleurm}}%
+    \colorlet{PfCCouleurF}{\useKV[ClesTableaux]{Couleuru}}%
+    \setsepchar{,}%
+    \readlist*\PfCNomUnites{Milliards,Centaines\\de millions,Dizaines\\de millions,Millions,Centaines\\de milliers,Dizaines\\de milliers,Milliers,Centaines,Dizaines,Unités}%
+  }{%
+    \colorlet{PfCCouleurA}{\useKV[ClesTableaux]{Couleurm}}%
+    \colorlet{PfCCouleurB}{\useKV[ClesTableaux]{Couleurm}}%
+    \colorlet{PfCCouleurC}{\useKV[ClesTableaux]{Couleuru}}%
+    \colorlet{PfCCouleurD}{\useKV[ClesTableaux]{Couleuru}}%
+    \colorlet{PfCCouleurE}{\useKV[ClesTableaux]{Couleurd}}%
+    \colorlet{PfCCouleurF}{\useKV[ClesTableaux]{Couleurd}}%
+    \setsepchar{,}%
+    \readlist*\PfCNomUnites{Centaines\\de milliers,Dizaines\\de milliers,Milliers,Centaines,Dizaines,Unités,Dixièmes,Centièmes,Millièmes,Dix-millièmes}%
+  }%
+  \begin{center}
+    \fcolorbox{PfCCouleurCadreGN}{PfCCouleurFondGN}{%
+      \begin{minipage}{0.8\linewidth}%
+        \setlength{\tabcolsep}{0.01\tabcolsep}%
+        \begin{center}%
+          \xdef\PfCDerniereColonne{11}%
+          \begin{NiceTabular}{*{6}{wc{30pt}wc{10pt}}*{4}{wc{30pt}wc{10pt}}wc{30pt}}%
+            \CodeBefore%
+            \tikz\draw[draw=black,fill=PfCCouleurA] (1|-5)--(2|-1)--(3|-1)--++(20pt,0)--(2|-5)--cycle;%m->A
+            \tikz\draw[draw=black,fill=PfCCouleurB] (3|-5)--(4|-1)--(5|-1)--++(20pt,0)--(4|-5)--cycle;%m->B
+            \tikz\draw[draw=black,fill=PfCCouleurB] (5|-5)--(6|-1)--(7|-1)--++(20pt,0)--(6|-5)--cycle;%m->B
+            \tikz\draw[draw=black,fill=PfCCouleurC] (7|-5)--(8|-1)--(9|-1)--++(20pt,0)--(8|-5)--cycle;%u->C
+            \tikz\draw[draw=black,fill=PfCCouleurD] (9|-5)--(10|-1)--(11|-1)--++(20pt,0)--(10|-5)--cycle;%u->D
+            \tikz\draw[draw=black,fill=PfCCouleurD] (11|-5)--(12|-1)--(13|-1)--++(20pt,0)--(12|-5)--cycle;%u->D
+            \tikz\draw[draw=black,fill=PfCCouleurE] (13|-5)--(14|-1)--(15|-1)--++(20pt,0)--(14|-5)--cycle;%d->E
+            \tikz\draw[draw=black,fill=PfCCouleurF] (15|-5)--(16|-1)--(17|-1)--++(20pt,0)--(16|-5)--cycle;%d->F
+            \tikz\draw[draw=black,fill=PfCCouleurF] (17|-5)--(18|-1)--(19|-1)--++(20pt,0)--(18|-5)--cycle;%d->F
+            \tikz\draw[draw=black,fill=PfCCouleurF] (19|-5)--(20|-1)--(21|-1)--++(20pt,0)--(20|-5)--cycle;%d->F
+            % 
+            \Body
+            %% Pour décaler et laisser la place nécessaire
+            \xintFor* ##1 in {\xintSeq{1}{4}}\do{%
+              &&&&&&&&&&&&&&&&&&&&\\
+            }%
+            %% Lignes vierges 
+            \xintFor* ##1 in {\xintSeq{1}{\fpeval{\useKV[ClesTableaux]{NbLignes}-2}}}\do{%
+              &&&&&&&&&&&&&&&&&&&&\\
+            }%
+            &&&&&&&&&&&\ifboolKV[ClesTableaux]{Entiers}{}{\Huge\bfseries ,}&&&&&&&&&\\
+            &&&&&&&&&&&&&&&&&&&&\\
+            \CodeAfter
+            \tikz\draw (last-|1)--(last-|\fpeval{2*\PfCDerniereColonne-2});
+            \xintFor* ##1 in {\xintSeq{1}{\fpeval{2*\PfCDerniereColonne-2}}}\do{%
+              \tikz\draw[dashed] (5-|##1)--(\fpeval{5+\useKV[ClesTableaux]{NbLignes}}-|##1);%
+              \tikz\draw (5-|##1)--(\fpeval{7}-|##1);%
+              \tikz\draw (\fpeval{5+\useKV[ClesTableaux]{NbLignes}}-|##1)--(\fpeval{3+\useKV[ClesTableaux]{NbLignes}}-|##1);%
+            }%
+            % 
+            \tikz\node[rotate=60] at (2|-3) {\begin{minipage}{60pt}\begin{center}\scriptsize \PfCNomUnites[1]\end{center}\end{minipage}};%
+            \tikz\node[rotate=60] at (4|-3) {\begin{minipage}{60pt}\begin{center}\scriptsize \PfCNomUnites[2]\end{center}\end{minipage}};%
+            \tikz\node[rotate=60] at (6|-3) {\begin{minipage}{60pt}\begin{center}\scriptsize \PfCNomUnites[3]\end{center}\end{minipage}};%
+            \tikz\node[rotate=60] at (8|-3) {\begin{minipage}{60pt}\begin{center}\scriptsize \PfCNomUnites[4]\end{center}\end{minipage}};%
+            \tikz\node[rotate=60] at (10|-3) {\begin{minipage}{60pt}\begin{center}\scriptsize \PfCNomUnites[5]\end{center}\end{minipage}};%
+            \tikz\node[rotate=60] at (12|-3) {\begin{minipage}{60pt}\begin{center}\scriptsize \PfCNomUnites[6]\end{center}\end{minipage}};%
+            \tikz\node[rotate=60] at (14|-3) {\begin{minipage}{60pt}\begin{center}\scriptsize \PfCNomUnites[7]\end{center}\end{minipage}};%
+            \tikz\node[rotate=60] at (16|-3) {\begin{minipage}{60pt}\begin{center}\scriptsize \PfCNomUnites[8]\end{center}\end{minipage}};%
+            \tikz\node[rotate=60] at (18|-3) {\begin{minipage}{60pt}\begin{center}\scriptsize \PfCNomUnites[9]\end{center}\end{minipage}};%
+            \tikz\node[rotate=60] at (20|-3) {\begin{minipage}{60pt}\begin{center}\scriptsize \PfCNomUnites[10]\end{center}\end{minipage}};%
+          \end{NiceTabular}%
+        \end{center}%
+        \setlength{\tabcolsep}{100\tabcolsep}%
+      \end{minipage}%
+    }%
+  \end{center}
+  \begin{center}
+    \begin{NiceTabular}{m{0.97\linewidth}}%
+      \xintFor* ##1 in{\xintSeq{1}{\fpeval{\useKV[ClesTableaux]{NbLignes}-4}}}\do{%
+        \Block[fill=PfCCouleurFondGN]{}{\phantom{A}}\\
+      }%
+      \CodeAfter%
+      \tikz\draw (1-|1) rectangle (last-|last);%
+    \end{NiceTabular}
+  \end{center}
 }%
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCTortueBase.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCTortueBase.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCTortueBase.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -6,6 +6,7 @@
   Etapes=false,%Pour arrêter la construction à une étape particulière
   Nom=\jobname,%Pour la sauvegarde du fichier mp
   Grille=false,%Pour faire apparaître une grille
+  Couleur=black,%Couleur du tracé
   LargeurG=10,%Largeur Grille
   HauteurG=10,%Hauteur Grille
   TortueD=false,%Affiche la tortue au départ
@@ -194,7 +195,7 @@
   \mplibforcehmode
   \begin{mplibcode}
     input PfCTurtleTestRemplis.mp;
-
+    drawoptions(withcolor \useKV[Tortue]{Couleur});
     pair Depart;
     Depart=\useKV[Tortue]{Depart} if \useKV[Tortue]{Cases}:+(15,15)fi;
     pair A[],B[];

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCVueCubes.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCVueCubes.tex	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCVueCubes.tex	2023-05-02 20:28:48 UTC (rev 66990)
@@ -161,8 +161,6 @@
     draw Projette((k/Hauteur)[Adg0,Adg3])--Projette((k/Hauteur)[Adg1,Adg2]);
     endfor;
     fi;
-    
-    %draw (llcorner currentpicture)--(lrcorner currentpicture)--(urcorner currentpicture)--(ulcorner currentpicture)--cycle;
   \end{mplibcode}
   \ifboolKV[VueCubes]{Grilles}{}{%
     \hspace*{1.5cm}

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty	2023-05-02 20:28:01 UTC (rev 66989)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty	2023-05-02 20:28:48 UTC (rev 66990)
@@ -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/04/17}%
+\def\filedate{2023/05/01}%
 \let\PfCfiledate\filedate%
-\def\fileversion{0.99-z-j}%
+\def\fileversion{0.99-z-k}%
 \let\PfCfileversion\fileversion%
 \ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]%
 
@@ -569,7 +569,7 @@
 }%\emoticon
 }%\raisebox
 }
-
+\input{PfCPavage}
 \input{PfCNonogramme}
 \input{PfCJeuRangement}
 \input{PfCTrio}



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