texlive[71706] Master/texmf-dist: profcollege (4jul24)
commits+karl at tug.org
commits+karl at tug.org
Thu Jul 4 22:28:17 CEST 2024
Revision: 71706
https://tug.org/svn/texlive?view=revision&revision=71706
Author: karl
Date: 2024-07-04 22:28:16 +0200 (Thu, 04 Jul 2024)
Log Message:
-----------
profcollege (4jul24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/profcollege/profcollege-doc.zip
trunk/Master/texmf-dist/metapost/profcollege/PfCMonde.mp
trunk/Master/texmf-dist/metapost/profcollege/PfCObjets.mp
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractions.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartographie.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCFonctionAffine.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulJap.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulPiecesPuzzle.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCPatronPaves.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCPixelArt.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCQuestionsRelier.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCSolides.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCTortueBase.tex
trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/profcollege/profcollege-doc.pdf
trunk/Master/texmf-dist/tex/latex/profcollege/PfCArbreCalcul.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCInfixRPN.sty
trunk/Master/texmf-dist/tex/latex/profcollege/PfCProbaFrequence.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCUrneProba.tex
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
Deleted: trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
===================================================================
(Binary files differ)
Added: trunk/Master/texmf-dist/doc/latex/profcollege/profcollege-doc.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/profcollege/profcollege-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/profcollege/profcollege-doc.pdf 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/doc/latex/profcollege/profcollege-doc.pdf 2024-07-04 20:28:16 UTC (rev 71706)
Property changes on: trunk/Master/texmf-dist/doc/latex/profcollege/profcollege-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/profcollege/profcollege-doc.zip
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCMonde.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCMonde.mp 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCMonde.mp 2024-07-04 20:28:16 UTC (rev 71706)
@@ -151,6 +151,15 @@
vardef FZ(expr t,v)=rayon*sind(c*t)
enddef;
+vardef FXx(expr t,v)=rayon*cosd(t)*cosd(v)
+enddef;
+
+vardef FYy(expr t,v)=rayon*cosd(t)*sind(v)
+enddef;
+
+vardef FZz(expr t,v)=rayon*sind(t)
+enddef;
+
%Param\xE8tres et macros de repr\xE9sentation
vardef Initialisation(expr r,t,p,d)=
Rho:=r;
@@ -227,6 +236,25 @@
MaillageS;
enddef;
+vardef MaillageSphereCoord=
+% InitialiseMaillage(((phim div 10)+1)*pi/12,((phip div 10)-1)*pi/12,pi/12,-pi,pi,pi/12);
+ InitialiseMaillage(-pi/2,pi/2,pi/18,-pi,pi,pi/12);
+ %MaillageS;
+ path Maillage[];
+ nbmor:=0;
+ for k=-90 step 10 until 90:
+ for l=-180 step 10 until 180:
+ nbl:=nbl+1;
+ if ProduitScalaire(1/2[(FXx(k,l),FYy(k,l),FZz(k,l)),(FXx(k+10,l+10),FYy(k+10,l+10),FZz(k+10,l+10))]-pte3,Oeil-pte3)>0:
+ nbmor:=nbmor+1;
+ Maillage[nbmor]=Projgeo((FXx(k,l),FYy(k,l),FZz(k,l)))..Projgeo((FXx(k,l+10),FYy(k,l+10),FZz(k,l+10)));
+ draw Maillage[nbmor] if k=0: withpen pencircle scaled 1 withcolor Crimson fi;
+ draw Projgeo((FXx(k,l),FYy(k,l),FZz(k,l)))..Projgeo((FXx(k+10,l),FYy(k+10,l),FZz(k+10,l))) if l=0:withpen pencircle scaled 1 withcolor LightSteelBlue fi;
+ fi;
+ endfor;
+ endfor;
+enddef;
+
boolean maille;
maille=false;
@@ -276,9 +304,19 @@
numeric ll;
ll:=0;
nbpts:=scantokens readfrom nomfichier;
- for k=1 upto (nbpts div 3):
+% for k=1 upto (nbpts div 3):
+% pair latlon;
+% latlon=((scantokens readfrom nomfichier)+(scantokens readfrom nomfichier)+(scantokens readfrom nomfichier))/3;
+ if nbpts<Allegee:
+ Alleg:=1;
+ else:
+ Alleg:=Allegee;
+ fi;
+ for k=1 upto (nbpts div Alleg):
pair latlon;
- latlon=((scantokens readfrom nomfichier)+(scantokens readfrom nomfichier)+(scantokens readfrom nomfichier))/3;
+ latlon=((scantokens readfrom nomfichier) for l=2 upto Alleg:
+ +(scantokens readfrom nomfichier)
+ endfor)/Alleg;
Coord[k]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60)));
if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)):
if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0:
@@ -295,7 +333,7 @@
path pays;
if ll>0:
pays=Projgeo(Pays[1])
- for l=2 upto (nbpts div 3):
+ for l=2 upto (nbpts div Alleg):%(nbpts div 3):
--Projgeo(Pays[l])
endfor;
if noncolore=true:
@@ -303,7 +341,7 @@
else:
fill pays--cycle withcolor fond;
fi;
- draw pays;
+ draw pays withpen pencircle scaled 0.25;
clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4);
fi;
enddef;
@@ -319,9 +357,19 @@
ll:=0;
nbpts:=scantokens readfrom nomfichiermul;
fond=scantokens readfrom nomfichiermul;
- for k=1 upto nbpts:
+ %if nbpts<Allegee:
+ Alleg:=1;
+ %else:
+ % Alleg:=2;%pas Allegee car sinon des artefacts apparaissent
+ %fi;
+ for k=1 upto (nbpts div Alleg):
pair latlon;
- latlon=scantokens readfrom nomfichiermul;
+ latlon=((scantokens readfrom nomfichiermul) for l=2 upto Alleg:
+ +(scantokens readfrom nomfichiermul)
+ endfor)/Alleg;
+% for k=1 upto nbpts:
+% pair latlon;
+% latlon=scantokens readfrom nomfichiermul;
Coord[k]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60)));
if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)):
if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0:
@@ -337,7 +385,7 @@
path pays;
if ll>0:
pays=Projgeo(Pays[1])
- for l=2 upto nbpts:
+ for l=2 upto (nbpts div Alleg):%nbpts:
--Projgeo(Pays[l])
endfor;
if noncolore=true:
@@ -345,9 +393,15 @@
else:
fill pays--cycle withcolor fond;
fi;
- draw pays;
+ draw pays withpen pencircle scaled 0.25;
clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4);
fi;
+ % rustine pour tout lire chaque partie de Ile.dat
+ if Alleg>1:
+ for po=1 upto (nbpts mod Alleg):
+ poubelle:=scantokens readfrom nomfichiermul;
+ endfor;
+ fi;
endfor;
closefrom nomfichiermul;
enddef;
@@ -1641,6 +1695,11 @@
MaillageSphere;
drawoptions();
fi;
+ if maillagecoord=true:
+ drawoptions(withpen pencircle scaled 0.25 withcolor couleurmaillage);
+ MaillageSphereCoord;
+ drawoptions();
+ fi;
if maille=true:
Maille;
fi;
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCObjets.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCObjets.mp 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCObjets.mp 2024-07-04 20:28:16 UTC (rev 71706)
@@ -661,6 +661,55 @@
endfor;
enddef;
+vardef DessineFusionCoul=
+ save _fusion;
+ picture _fusion;
+ tapj:=0;
+ color Fc[][];color cou[];
+ for l=1 upto nbobj:
+ for k=0 upto apj[l]:
+ cpt[tapj]:=tapj;
+ cou[tapj]:=Outcolor[l];
+ Fc[tapj].nb:=OTFc[l][k].nb;
+ for p=1 upto Fc[tapj].nb:
+ Fc[tapj][p]:=OTFc[l][k][p];
+ endfor;
+ Fc[tapj].iso:=OTFc[l][k].iso;
+ ALT[tapj]:=ALT[l][k];
+ Vue[tapj]:=Vue[l][k];
+ if Ferme[l]:
+ if Vue[tapj]=false:
+ tapj:=tapj-1;
+ fi;
+ fi;
+ tapj:=tapj+1;
+ endfor;
+ endfor;
+ tapj:=tapj-1;
+ QS(0,tapj);
+ for k=0 upto tapj:
+ fill for l=1 upto Fc[cpt[k]].nb:
+ Projette(Fc[cpt[k]][l])--
+ endfor
+ cycle withcolor if Vue[cpt[k]]:
+ abs(lumin(cpt[k]))*cou[cpt[k]] fi;
+ if traits:
+ draw for l=1 upto Fc[cpt[k]].nb:
+ Projette(Fc[cpt[k]][l])--
+ endfor
+ cycle withpen pencircle scaled0.25bp;
+ %add by cp 22/08/2011
+ else:
+ draw for l=1 upto Fc[cpt[k]].nb:
+ Projette(Fc[cpt[k]][l])--
+ endfor
+ cycle withcolor if Vue[cpt[k]]:
+ abs(lumin(cpt[k]))*cou[cpt[k]] fi;
+ %fin add
+ fi;
+ endfor;
+enddef;
+
vardef Objettore[](expr Rn,rn)=
Outcolor.@:=outcolor;
Incolor.@:=incolor;
@@ -1727,8 +1776,8 @@
tcpt.@[0]:=0;
OTFc.@[0].nb:=3;
OTFc.@[0][1]:=Image(Sommet0);
- OTFc.@[0][2]:=Image(Sommet2);
- OTFc.@[0][3]:=Image(Sommet1);
+ OTFc.@[0][2]:=Image(Sommet1);
+ OTFc.@[0][3]:=Image(Sommet2);
OTFc.@[0].iso:=(OTFc.@[0][1]+OTFc.@[0][2]+OTFc.@[0][3])/3;
tcpt.@[1]:=1;
OTFc.@[1].nb:=3;
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCArbreCalcul.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCArbreCalcul.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCArbreCalcul.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -0,0 +1,543 @@
+%%%
+% Arbre de calculs
+%%%
+\newtoks\toklistearbre%
+\newtoks\toklistearbrefractions%
+\newtoks\toklistearbreexpressions%
+
+\def\UpdatetoksArbreCalcul#1\nil{\IfDecimal{#1}{\addtotok\toklistearbre{#1,}}{\addtotok\toklistearbre{"#1",}}}%
+\def\UpdatetoksArbreFractions#1\nil{\addtotok\toklistearbrefractions{"#1",}}%
+\def\UpdatetoksArbreExpressions#1\nil{\addtotok\toklistearbreexpressions{"#1",}}%
+
+\setKVdefault[ArbreCalcul]{Correction=false,Couleur=LightSteelBlue,Substitue=7,Litteral=false,Largeur=8mm,LargeurC=8mm,Ecart=1.5cm,Hauteur=10mm,Lettre="x",CouleurDepart=LightGreen,Fractions=false,Nombres={},Expressions={},Etape=infinity}%
+\defKV[ArbreCalcul]{Fraction=\setKV[ArbreCalcul]{Fractions}}%
+
+\NewDocumentCommand\ArbreCalcul{om}{%
+ \useKVdefault[ArbreCalcul]%
+ \setKV[ArbreCalcul]{#1}%
+ \toklistearbre{}%
+ \toklistearbrefractions{}%
+ \toklistearbreexpressions{}%
+ \infixtoRPN{#2}%
+ \setsepchar{ }\ignoreemptyitems%
+ \readlist*\ListeNombres{\RPN}%
+ \reademptyitems%
+ \foreachitem\compteur\in\ListeNombres{\expandafter\UpdatetoksArbreCalcul\compteur\nil}%
+ \ifboolKV[ArbreCalcul]{Fractions}{%
+ \xdef\Foo{\useKV[ArbreCalcul]{Nombres}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeFractions{\Foo}%
+ \reademptyitems
+ \foreachitem\compteur\in\ListeFractions{\expandafter\UpdatetoksArbreFractions\compteur\nil}%
+ \BuildArbreCalculFraction{\the\toklistearbre}{\the\toklistearbrefractions}%
+ }{%
+ \ifboolKV[ArbreCalcul]{Litteral}{
+ \xdef\Foo{\useKV[ArbreCalcul]{Nombres}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeFractions{\Foo}%
+ \reademptyitems
+ \foreachitem\compteur\in\ListeFractions{\expandafter\UpdatetoksArbreFractions\compteur\nil}%
+ \xdef\Foo{\useKV[ArbreCalcul]{Expressions}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeExpressions{\Foo}%
+ \reademptyitems
+ \foreachitem\compteur\in\ListeExpressions{\expandafter\UpdatetoksArbreExpressions\compteur\nil}%
+% listarbre : \the\toklistearbre%
+%
+% listfracions : \the\toklistearbrefractions
+%
+% listexpressions : \the\toklistearbreexpressions
+ \BuildArbreCalculLitteral{\the\toklistearbre}{\the\toklistearbrefractions}{\the\toklistearbreexpressions}%
+ }{%
+ \BuildArbreCalcul{\the\toklistearbre}%
+ }%
+ }%
+}%
+
+\NewDocumentCommand\BuildArbreCalcul{m}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ boolean Correction,Litteral,Allume[];
+ Correction=\useKV[ArbreCalcul]{Correction};
+ Litteral=\useKV[ArbreCalcul]{Litteral};
+
+ NombreSubstitue=\useKV[ArbreCalcul]{Substitue};
+
+ etape=0;
+ Etape=\useKV[ArbreCalcul]{Etape};
+
+ color Evidence,CoulDepart;
+ Evidence=\useKV[ArbreCalcul]{Couleur};
+ CoulDepart=\useKV[ArbreCalcul]{CouleurDepart};
+
+ pair pointprec;
+
+ path base[];
+ base1=unitsquare xscaled \useKV[ArbreCalcul]{Largeur} yscaled 5mm;
+ base2=fullcircle scaled 5mm;
+ base3=unitsquare xscaled \useKV[ArbreCalcul]{LargeurC} yscaled 5mm;
+
+ vardef BlocCalcul(expr Ba,Bb,op,cha,chb)=%
+ % Ba point gauche
+ % Bb point droite
+ % op opération à afficher
+ etape:=etape+1;
+ save $;
+ picture $;
+ path cc[];
+ pair Bc;
+ Bc=(0.5*(xpart(Ba)+xpart(Bb)),if ypart(Bb)<ypart(Ba):ypart(Bb) else:ypart(Ba) fi -0.75u);
+ pointprec:=Bc+u*(0,-0.75);
+ $=image(
+ if Allume[numeropoint-1]=true:
+ cc1=base3 shifted (Ba-center base3);
+ else:
+ cc1=base1 shifted (Ba-center base1);
+ fi;
+ if Allume[numeropoint]=true:
+ cc2=base3 shifted (Bb-center base3);
+ else:
+ cc2=base1 shifted (Bb-center base1);
+ fi;
+
+ cc3=(fullcircle scaled 5mm) shifted Bc;
+ cc4=base3 shifted (pointprec-center base3);
+ if op="mul":
+ label(TEX("$\times$"),Bc);
+ ValeurPile[numeropoint-1]:=cha*chb;
+ elseif op="add":
+ label(TEX("$+$"),Bc);
+ ValeurPile[numeropoint-1]:=cha+chb;
+ elseif op="sub":
+ label(TEX("$\_$"),Bc);
+ ValeurPile[numeropoint-1]:=cha-chb;
+ elseif op="div":
+ label(TEX("$\div$"),Bc);
+ ValeurPile[numeropoint-1]:=cha/chb;
+ fi;
+ if Correction:
+ if etape<Etape+1:
+ fill cc4 withcolor Evidence;
+ label(TEX("\num{"&decimal(ValeurPile[numeropoint-1])&"}"),pointprec);
+ fi;
+ fi;
+ for l=1 upto 4:
+ trace cc[l];
+ endfor;
+ draw (Ba--Bc) cutbefore cc1 cutafter cc3;
+ draw (Bb--Bc) cutbefore cc2 cutafter cc3;
+ draw (Bc--pointprec) cutbefore cc3 cutafter cc4;
+ );
+ $
+ enddef;
+
+ numeric Valeurs[];
+ numeric Valeursa[];
+
+ string Operations[];
+
+ numeric numeropoint;
+ numeropoint=0;
+
+ numeric ValeurPile[];
+
+ vardef RecupDonnees(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ if numeric p_:
+ Valeurs[n]=p_;
+ Operations[n]="";
+ else:
+ Valeurs[n]=infinity;
+ Operations[n]=p_;
+ fi;
+ endfor;
+ n:=n+1;
+ Operations[n]="stop";
+ nbtotal=n;
+ for k=1 upto nbtotal:
+ ValeurPile[k]=0;
+ endfor;
+ enddef;
+
+ pair A[];
+ ecart=\useKV[ArbreCalcul]{Ecart};
+
+ RecupDonnees(#1);
+
+ A[0]=(0,0);
+ k=0;
+ nbetape:=0;
+
+ for p_=#1:
+ k:=k+1;
+ if numeric p_:
+ numeropoint:=numeropoint+1;
+ if unknown A[numeropoint]:A[numeropoint]-A[numeropoint-1]=ecart*(1,0);Allume[numeropoint]=false; else:
+ A[numeropoint]:=A[numeropoint-1]+ecart*(1,0); Allume[numeropoint]:=false;
+ fi;
+ if Valeurs[k]=0:Valeursa[k]:=NombreSubstitue else: Valeursa[k]=Valeurs[k] fi;
+ if Operations[k+1]="neg":
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart; if Litteral:
+ label(TEX("$\useKV[ArbreCalcul]{Lettre}$"),A[numeropoint]);
+ else:
+ label(TEX("\num{"&decimal(-Valeursa[k])&"}"),A[numeropoint]);
+ fi;
+ else:
+ label(TEX("\num{"&decimal(-Valeursa[k])&"}"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=-Valeursa[k];
+ else:
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart;if Litteral:
+ label(TEX("$\useKV[ArbreCalcul]{Lettre}$"),A[numeropoint]);
+ else:
+ label(TEX("\num{"&decimal(Valeursa[k])&"}"),A[numeropoint]);
+ fi;
+ else:
+ label(TEX("\num{"&decimal(Valeursa[k])&"}"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=Valeursa[k];
+ fi;
+ elseif string p_:
+ if p_<>"neg":
+ trace BlocCalcul(A[numeropoint-1],A[numeropoint],Operations[k],ValeurPile[numeropoint-1],ValeurPile[numeropoint]);
+ A[numeropoint-1]:=pointprec;
+ Allume[numeropoint-1]:=true;
+ numeropoint:=numeropoint-1;
+ fi;
+ fi;
+ endfor;
+ \end{mplibcode}
+ \fi
+}%
+
+\NewDocumentCommand\BuildArbreCalculFraction{mm}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ boolean Correction,Allume[];
+ Correction=\useKV[ArbreCalcul]{Correction};
+
+ string Fraction;
+ Fraction=\useKV[ArbreCalcul]{Fraction};
+
+ color Evidence,CoulDepart;
+ Evidence=\useKV[ArbreCalcul]{Couleur};
+ CoulDepart=\useKV[ArbreCalcul]{CouleurDepart};
+
+ pair pointprec;
+
+ path base[];
+ base1=unitsquare xscaled \useKV[ArbreCalcul]{Largeur} yscaled \useKV[ArbreCalcul]{Hauteur};
+ base2=fullcircle scaled 5mm;
+ base3=unitsquare xscaled \useKV[ArbreCalcul]{LargeurC} yscaled \useKV[ArbreCalcul]{Hauteur};
+
+ vardef BlocCalcul(expr Ba,Bb,op,cha,chb)=%
+ % Ba point gauche
+ % Bb point droite
+ % op opération à afficher
+ etape:=etape+1;
+ save $;
+ picture $;
+ path cc[];
+ pair Bc;
+ Bc=(0.5*(xpart(Ba)+xpart(Bb)),if ypart(Bb)<ypart(Ba):ypart(Bb) else:ypart(Ba) fi -0.75u);
+ pointprec:=Bc+u*(0,-1.25);
+ $=image(
+ if Allume[numeropoint-1]=true:
+ cc1=base3 shifted (Ba-center base3);
+ else:
+ cc1=base1 shifted (Ba-center base1);
+ fi;
+ if Allume[numeropoint]=true:
+ cc2=base3 shifted (Bb-center base3);
+ else:
+ cc2=base1 shifted (Bb-center base1);
+ fi;
+ cc3=(fullcircle scaled 5mm) shifted Bc;
+ cc4=base3 shifted (pointprec-center base3);
+ if op="mul":
+ label(TEX("$\times$\MulFraction[Seul][3]{"&cha&"}{"&chb&"}[\ResultatMul]"),Bc);
+ ValeurPile[numeropoint-1]:="\ResultatMul";
+ elseif op="add":
+ label(TEX("$+$\AddFraction[Seul][3]{"&cha&"}{"&chb&"}[\ResultatAdd]"),Bc);
+ ValeurPile[numeropoint-1]:="\ResultatAdd";
+ elseif op="sub":
+ label(TEX("$\_$\SousFraction[Seul][3]{"&cha&"}{"&chb&"}[\ResultatSous]"),Bc);
+ ValeurPile[numeropoint-1]:="\ResultatSous";
+ elseif op="div":
+ label(TEX("$\div$\DivFraction[Seul][3]{"&cha&"}{"&chb&"}[\ResultatDiv]"),Bc);
+ ValeurPile[numeropoint-1]:="\ResultatDiv";
+ fi;
+ if Correction:
+ if etape<Etape+1:
+ fill cc4 withcolor Evidence;
+ label(TEX("$\displaystyle\tofrac{"&ValeurPile[numeropoint-1]&"}$"),pointprec);
+ fi;
+ fi;
+ for l=1 upto 4:
+ trace cc[l];
+ endfor;
+ draw (Ba--Bc) cutbefore cc1 cutafter cc3;
+ draw (Bb--Bc) cutbefore cc2 cutafter cc3;
+ draw (Bc--pointprec) cutbefore cc3 cutafter cc4;
+ );
+ $
+ enddef;
+
+ numeric Valeurs[];
+ string Valeursa[];
+
+ string Operations[];
+
+ numeric numeropoint;
+ numeropoint=0;
+
+ string ValeurPile[];
+
+ vardef RecupDonnees(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ if numeric p_:
+ Valeurs[n]=p_;
+ Operations[n]="";
+ else:
+ Valeurs[n]=infinity;
+ Operations[n]=p_;
+ fi;
+ endfor;
+ n:=n+1;
+ Operations[n]="stop";
+ nbtotal=n;
+ for k=1 upto nbtotal:
+ ValeurPile[k]="0";
+ endfor;
+ enddef;
+
+ vardef RecupFractions(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Valeursa[n]=p_;
+ endfor;
+ enddef;
+
+ pair A[];
+ ecart=\useKV[ArbreCalcul]{Ecart};
+
+ RecupDonnees(#1);
+ RecupFractions(#2);
+
+ etape=0;
+ Etape=\useKV[ArbreCalcul]{Etape};
+
+ A[0]=(0,0);
+ k=0;
+ nbetape:=0;
+
+ for p_=#1:
+ k:=k+1;
+ if numeric p_:
+ numeropoint:=numeropoint+1;
+ if unknown A[numeropoint]:A[numeropoint]-A[numeropoint-1]=ecart*(1,0);Allume[numeropoint]=false; else:
+ A[numeropoint]:=A[numeropoint-1]+ecart*(1,0); Allume[numeropoint]:=false;
+ fi;
+ if Valeurs[k]=0:Valeursa[Valeurs[k]]:=\useKV[ArbreCalcul]{Fraction} fi;
+ if Operations[k+1]="neg":
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart;
+ label(TEX("$\displaystyle\tofrac{"&-Valeursa[Valeurs[k]]&"}$"),A[numeropoint]);
+ else:
+ label(TEX("$\displaystyle\tofrac{"&-Valeursa[Valeurs[k]]&"}$"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=decimal(-Valeursa[Valeurs[k]]);
+ else:
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart;
+ label(TEX("$\displaystyle\tofrac{"&Valeursa[Valeurs[k]]&"}$"),A[numeropoint]);
+ else:
+ label(TEX("$\displaystyle\tofrac{"&Valeursa[Valeurs[k]]&"}$"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=Valeursa[Valeurs[k]];
+ fi;
+ elseif string p_:
+ if p_<>"neg":
+ trace BlocCalcul(A[numeropoint-1],A[numeropoint],Operations[k],ValeurPile[numeropoint-1],ValeurPile[numeropoint]);
+ A[numeropoint-1]:=pointprec;
+ Allume[numeropoint-1]:=true;
+ numeropoint:=numeropoint-1;
+ fi;
+ fi;
+ endfor;
+ \end{mplibcode}
+ \fi
+}%
+
+\NewDocumentCommand\BuildArbreCalculLitteral{mmm}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ boolean Correction,Allume[];
+ Correction=\useKV[ArbreCalcul]{Correction};
+
+ color Evidence,CoulDepart;
+ Evidence=\useKV[ArbreCalcul]{Couleur};
+ CoulDepart=\useKV[ArbreCalcul]{CouleurDepart};
+
+ pair pointprec;
+
+ path base[];
+ base1=unitsquare xscaled \useKV[ArbreCalcul]{Largeur} yscaled \useKV[ArbreCalcul]{Hauteur};
+ base2=fullcircle scaled 5mm;
+ base3=unitsquare xscaled \useKV[ArbreCalcul]{LargeurC} yscaled \useKV[ArbreCalcul]{Hauteur};
+
+ vardef BlocCalcul(expr Ba,Bb,op,cha,chb)=%
+ % Ba point gauche
+ % Bb point droite
+ % op opération à afficher
+ etape:=etape+1;
+ save $;
+ picture $;
+ path cc[];
+ pair Bc;
+ Bc=(0.5*(xpart(Ba)+xpart(Bb)),if ypart(Bb)<ypart(Ba):ypart(Bb) else:ypart(Ba) fi -0.75u);
+ pointprec:=Bc+u*(0,-1.25);
+ $=image(
+ if Allume[numeropoint-1]=true:
+ cc1=base3 shifted (Ba-center base3);
+ else:
+ cc1=base1 shifted (Ba-center base1);
+ fi;
+ if Allume[numeropoint]=true:
+ cc2=base3 shifted (Bb-center base3);
+ else:
+ cc2=base1 shifted (Bb-center base1);
+ fi;
+ cc3=(fullcircle scaled 5mm) shifted Bc;
+ cc4=base3 shifted (pointprec-center base3);
+ if op="mul":
+ label(TEX("$\times$"),Bc);
+ ValeurPile[numeropoint-1]:="";
+ elseif op="add":
+ label(TEX("$+$"),Bc);
+ ValeurPile[numeropoint-1]:="";
+ elseif op="sub":
+ label(TEX("$\_$"),Bc);
+ ValeurPile[numeropoint-1]:="";
+ elseif op="div":
+ label(TEX("$\div$"),Bc);
+ ValeurPile[numeropoint-1]:="";
+ fi;
+ if Correction:
+ if etape<Etape+1:
+ fill cc4 withcolor Evidence;
+ label(TEX("$"&Valeursc[etape]&"$"),pointprec);
+ fi;
+ fi;
+ for l=1 upto 4:
+ trace cc[l];
+ endfor;
+ draw (Ba--Bc) cutbefore cc1 cutafter cc3;
+ draw (Bb--Bc) cutbefore cc2 cutafter cc3;
+ draw (Bc--pointprec) cutbefore cc3 cutafter cc4;
+ );
+ $
+ enddef;
+
+ numeric Valeurs[];
+ string Valeursa[];
+ string Valeursc[];
+
+ string Operations[];
+
+ numeric numeropoint;
+ numeropoint=0;
+
+ string ValeurPile[];
+
+ vardef RecupDonnees(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ if numeric p_:
+ Valeurs[n]=p_;
+ Operations[n]="";
+ else:
+ Valeurs[n]=infinity;
+ Operations[n]=p_;
+ fi;
+ endfor;
+ n:=n+1;
+ Operations[n]="stop";
+ nbtotal=n;
+ for k=1 upto nbtotal:
+ ValeurPile[k]="0";
+ endfor;
+ enddef;
+
+ vardef RecupFractions(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Valeursa[n]=p_;
+ endfor;
+ enddef;
+
+ vardef RecupCorrections(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Valeursc[n]=p_;
+ endfor;
+ enddef;
+
+ pair A[];
+ ecart=\useKV[ArbreCalcul]{Ecart};
+
+ RecupDonnees(#1);
+ RecupFractions(#2);
+ RecupCorrections(#3);
+
+ etape=0;
+ Etape=\useKV[ArbreCalcul]{Etape};
+
+ A[0]=(0,0);
+ k=0;
+ nbetape:=0;
+
+ for p_=#1:
+ k:=k+1;
+ if numeric p_:
+ numeropoint:=numeropoint+1;
+ if unknown A[numeropoint]:A[numeropoint]-A[numeropoint-1]=ecart*(1,0);Allume[numeropoint]=false; else:
+ A[numeropoint]:=A[numeropoint-1]+ecart*(1,0); Allume[numeropoint]:=false;
+ fi;
+ if Valeurs[k]=0:Valeursa[Valeurs[k]]:=\useKV[ArbreCalcul]{Lettre} fi;
+ if Operations[k+1]="neg":
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart;
+ label(TEX("$"&-Valeursa[Valeurs[k]]&"$"),A[numeropoint]);
+ else:
+ label(TEX("$"&-Valeursa[Valeurs[k]]&"$"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=decimal(-Valeursa[Valeurs[k]]);
+ else:
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart;
+ label(TEX("$"&Valeursa[Valeurs[k]]&"$"),A[numeropoint]);
+ else:
+ label(TEX("$"&Valeursa[Valeurs[k]]&"$"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=Valeursa[Valeurs[k]];
+ fi;
+ elseif string p_:
+ if p_<>"neg":
+ trace BlocCalcul(A[numeropoint-1],A[numeropoint],Operations[k],ValeurPile[numeropoint-1],ValeurPile[numeropoint]);
+ A[numeropoint-1]:=pointprec;
+ Allume[numeropoint-1]:=true;
+ numeropoint:=numeropoint-1;
+ fi;
+ fi;
+ endfor;
+ \end{mplibcode}
+ \fi
+}%
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCArbreCalcul.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractions.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractions.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractions.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -1,4 +1,4 @@
-\setKVdefault[CalculsFractions]{Couleurs=false,Negatif=false}%
+\setKVdefault[CalculsFractions]{Couleurs=false,Negatif=false,Seul=false}%
\defKV[CalculsFractions]{Couleur=\setKV[CalculsFractions]{Couleurs}\setKV[ClesSimplification]{Couleur=#1}}%
\NewDocumentCommand\tofrac{m}{%
@@ -50,7 +50,7 @@
\xdef\PfCNumD{1}%
}{%
\StrCut{#5}{/}\PfCNumC\PfCNumD%
- }
+ }%
\xdef\PfCAddFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListeFractions{\PfCAddFoo}%
@@ -69,6 +69,7 @@
\xdef\PfCAddDenoSimp{\fpeval{\PfCAddDenoFin/\PfCAddPgcd}}%
\xdef\PfCAddSumSimp{\PfCAddNumSimp/\PfCAddDenoSimp}%
\IfValueT{#6}{\xdef#6{\PfCAddSumSimp}}%
+ \ifboolKV[CalculsFractions]{Seul}{}{%
% Partie affichage
\ensuremath{%
\IfValueTF{#3}{%
@@ -103,6 +104,7 @@
}{\tofrac{#4}\PfCFractionOp\tofrac{#5}
}%
}%
+ }%
}%
\NewDocumentCommand\SousFraction{oommo}{%
@@ -127,17 +129,18 @@
\xdef\PfCMulFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListeFractions{\PfCMulFoo}%
- \reademptyitems
+ \reademptyitems%
\setsepchar{,}%
% Calculs
- \xdef\PfCMulNumFin{\fpeval{(\ListeFractions[1,1])*(\ListeFractions[2,1])}}
- \xdef\PfCMulDenoFin{\fpeval{\ListeFractions[1,2]*\ListeFractions[2,2]}}
+ \xdef\PfCMulNumFin{\fpeval{(\ListeFractions[1,1])*(\ListeFractions[2,1])}}%
+ \xdef\PfCMulDenoFin{\fpeval{\ListeFractions[1,2]*\ListeFractions[2,2]}}%
\PGCD{\fpeval{abs(\PfCMulNumFin)}}{\fpeval{abs(\PfCMulDenoFin)}}\xdef\PfCMulPgcd{\pgcd}%
\xdef\PfCMulNumSimp{\fpeval{\PfCMulNumFin/\PfCMulPgcd}}%
\xdef\PfCMulDenoSimp{\fpeval{\PfCMulDenoFin/\PfCMulPgcd}}%
\xdef\PfCMulPdtSimp{\PfCMulNumSimp/\PfCMulDenoSimp}%
\IfValueT{#5}{\xdef#5{\PfCMulPdtSimp}}%
- \ensuremath{%
+ \ifboolKV[CalculsFractions]{Seul}{}{%
+ \ensuremath{%
\IfValueTF{#2}{%
\ifnum#2=3\relax
\ifboolKV[CalculsFractions]{Negatif}{%
@@ -154,8 +157,9 @@
\fi
\fi
}{\tofrac{#3}\times\tofrac{#4}
- }
+ }%
}%
+ }%
}%
\NewDocumentCommand\DivFraction{oommo}{%
@@ -186,6 +190,7 @@
\xdef\PfCDivDenoSimp{\fpeval{\PfCDivDenoFin/\PfCDivPgcd}}%
\xdef\PfCDivPdtSimp{\PfCDivNumSimp/\PfCDivDenoSimp}%
\IfValueT{#5}{\xdef#5{\PfCDivPdtSimp}}%
+ \ifboolKV[CalculsFractions]{Seul}{}{%
\ensuremath{%
\IfValueTF{#2}{%
\ifnum#2=4\relax
@@ -207,4 +212,5 @@
}{\tofrac{#3}\div\tofrac{#4}
}
}%
+ }%
}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartographie.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartographie.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartographie.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -1,7 +1,7 @@
%%%
% Cartographie
%%%
-\setKVdefault[Cartographie]{Echelle=1,Carte=false,All=false,Europe=false,Asie=false,Amsud=false,Amnord=false,Amcentre=false,Caraibes=false,Afrique=false,AfficheEchelle=false,PaysSeul=false,VillesSup=false,VillesSupI=false,Capitales=false,Impression=false,Fleuves=false,CouleurFond=ciel,Largeur=12,Hauteur=12,Arborescence="/usr/local/texlive/2023/texmf-dist/metapost/profcollege/",Projection=false,TypeProjection="mercator",CouleurPays=Cornsilk,Pasl=2,PasL=2,Codes=false,Epaisseur=2,ModeleCouleur=5,Boussole=false,Allegee=1}
+\setKVdefault[Cartographie]{Echelle=1,Carte=false,All=false,Europe=false,Asie=false,Amsud=false,Amnord=false,Amcentre=false,Caraibes=false,Afrique=false,AfficheEchelle=false,PaysSeul=false,VillesSup=false,VillesSupI=false,Capitales=false,Impression=false,Fleuves=false,CouleurFond=ciel,Largeur=12,Hauteur=12,Arborescence="/usr/local/texlive/2023/texmf-dist/metapost/profcollege/",Projection=false,TypeProjection="mercator",CouleurPays=Cornsilk,Pasl=2,PasL=2,Codes=false,Epaisseur=2,ModeleCouleur=5,Boussole=false,Allegee=1,Maillage=false}
\defKV[Cartographie]{EchelleCarte=\setKV[Cartographie]{Carte}}
\defKV[Cartographie]{Pays=\setKV[Cartographie]{PaysSeul}}
\defKV[Cartographie]{Villes=\setKV[Cartographie]{VillesSup}}
@@ -13,8 +13,8 @@
\useKVdefault[Cartographie]%
\setKV[Cartographie]{#1}%
\mplibforcehmode%
+ \mplibnumbersystem{double}%
\ifboolKV[Cartographie]{Projection}{%
- \mplibnumbersystem{double}%
\begin{mplibcode}
input PfCMonde;
string arborescence;
@@ -217,9 +217,8 @@
Villes(\useKV[Cartographie]{VillesI});
fi;
\end{mplibcode}
- \mplibnumbersystem{scaled}%
}{%
-% \mplibforcehmode
+ % \mplibforcehmode
\begin{mplibcode}
input PfCMonde;
@@ -253,9 +252,11 @@
fi;
else:
couleurfond:=\useKV[Cartographie]{CouleurFond};
+ color couleurimpression;
+ couleurimpression:=Cornsilk;
if Impression:
noncolore:=true;
- payscolor:=0.85white;
+ payscolor:=couleurimpression;%0.85white
couleurfond:=white;
couleurfleuve:=couleurfond;
fi;
@@ -314,8 +315,7 @@
elseif t=8:lrt
fi
enddef;
-
-
+
if Carte:
Echelle:=\useKV[Cartographie]{AfficheEchelle};
figure(-0.5u*LargeurCadre,-0.5u*HauteurCadre,0.5u*LargeurCadre,0.5u*HauteurCadre);
@@ -365,11 +365,53 @@
fi;
else:
- draw(0,0)--(50,50);
- mappemonde(#2,#3);
+ boolean maillagecoord;
+ maillagecoord=\useKV[Cartographie]{Maillage};
+ if VillesSupI:
+ lacs:=false;
fi;
+
+ mappemonde(#2,#3);
+
+ vardef Villes(text t)=
+ pair CoordVille;
+ string NomVille;
+ n:=0;
+ for p_:=t:
+ n:=n+1;
+ if n=1:
+ %nblec:=p;
+ else:
+ if pair p_:
+ CoordVille:=Projgeo(rayon*(cosd(ypart(p_))*cosd(xpart(p_)),cosd(ypart(p_))*sind(xpart(p_)),sind(ypart(p_))));
+ elseif string p_:
+ NomVille:=p_;
+ else:
+ marque_p:="croix";
+ pointe(CoordVille);
+ label.position(p_)(TEX(""&NomVille&""),CoordVille);
+ fi;
+ fi;
+ endfor;
+ drawoptions();
+ enddef;
+
+
+ if Codes:
+ \useKV[Cartographie]{Traces};
+ fi;
+ if VillesSupI:
+ Villes(\useKV[Cartographie]{VillesI});
+ label.ulft(TEX("\tiny\ang{0}"),Projgeo(rayon*(1,0,0)));
+ label.ulft(TEX("\tiny\ang{10}"),Projgeo(rayon*(cosd(10),0,sind(10))));
+ fill (fullcircle scaled 0.75mm) shifted Projgeo(rayon*(cosd(10),0,sind(10)));
+ label.llft(TEX("\tiny\ang{10}"),Projgeo(rayon*(cosd(10),sind(10),0)));
+ fill (fullcircle scaled 0.75mm) shifted Projgeo(rayon*(cosd(10),sind(10),0));
+ fi;
+ fi;
\end{mplibcode}
}
+ \mplibnumbersystem{scaled}%
\else
\PackageWarning{ProfCollege}{"La commande Cartographie n'est compatible qu'avec LuaLaTeX."}
\fi
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -1,7 +1,7 @@
%%%
% QCM
%%%
-\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=60pt,Couleur=gray!15,Titre=false,Nom=R\'eponse,NomV=Vrai,NomF=Faux,Alph=false,AlphT=false,VF=false,Depart=1,Alterne=false,Noms={A/B/C},Multiple=false,Parties={Yeux,Nez,Bouche},CouleurAlt=gray!15,Seul=false}%
+\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=60pt,Couleur=gray!15,Titre=false,Nom=R\'eponse,NomV=Vrai,NomF=Faux,Alph=false,AlphT=false,VF=false,Depart=1,Alterne=false,Noms={A/B/C},Multiple=false,Parties={Yeux,Nez,Bouche},CouleurAlt=gray!15,Seul=false,ACompleter=false}%
\newlength{\LargeurQCM}%
\newlength{\PfCLargeurQCM}%
\newcounter{QuestionQCM}%
@@ -12,6 +12,8 @@
\setcounter{TotalQCMSeul}{0}%
\setcounter{TotalQCMSeulSol}{0}%
%
+\def\PfCTexteReponseEleve{Ma réponse}%
+%
\setKVdefault[QCMSeul]{Melange=false,Solution=false,EnColonne=false,LabelLettre=false}%
\defKV[QCMSeul]{Colonnes=\setKV[QCMSeul]{EnColonne}}%
%
@@ -90,150 +92,162 @@
%
\ifdef{\QCM}{%
\PackageWarning{ProfCollege}{La commande \noexpand\QCM étant définie par la classe du document, ProfCollege modifie sa commande \noexpand\QCM en \noexpand\QCMPfC.}%
- \newcommand\QCMPfC[2][]{%
- \useKVdefault[ClesQCM]%
- \setKV[ClesQCM]{#1}%
- \ifboolKV[ClesQCM]{Seul}{%
- \QCMSeul[#1]{#2}%
+\newcommand\QCMPfC[2][]{%
+ \useKVdefault[ClesQCM]%
+ \setKV[ClesQCM]{#1}%
+ \ifboolKV[ClesQCM]{Seul}{%
+ \QCMSeul[#1]{#2}%
+ }{%
+ \colorlet{PfCCouleurAlterneQCM}{\useKV[ClesQCM]{CouleurAlt}}%
+ \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
+ \setcounter{TitreQCM}{0}
+ \setsepchar[*]{,*&}\ignoreemptyitems%
+ \readlist*\ListeQCM{#2}%
+ \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
+ \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
+ \ifboolKV[ClesQCM]{Multiple}{%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\ListeNom{\useKV[ClesQCM]{Noms}}%
+ \setsepchar[*]{/}%
+ \readlist*\ListeNomsMul{\ListeNom}%
+ \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
+ \cline{2-\NBcases}%
+ \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ListeNomsMul[##2]}%
+ \\
+ \hline%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
+ }\\
+ }%
+ \hline%
+ \end{tabular}%
+ \renewcommand{\arraystretch}{1}%
}{%
- \colorlet{PfCCouleurAlterneQCM}{\useKV[ClesQCM]{CouleurAlt}}%
- \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
- \setcounter{TitreQCM}{0}
- \setsepchar[*]{,*&}\ignoreemptyitems%
- \readlist*\ListeQCM{#2}%
- \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
- \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
- \ifboolKV[ClesQCM]{Multiple}{%
- \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
- \xdef\ListeNom{\useKV[ClesQCM]{Noms}}%
- \setsepchar[*]{/}%
- \readlist*\ListeNomsMul{\ListeNom}%
+ \ifboolKV[ClesQCM]{VF}{%
+ \setKV[ClesQCM]{Reponses=2}%
+ \setlength{\PfCLargeurQCM}{\useKV[ClesQCM]{Largeur}}%
+ \setlength{\LargeurQCM}{\linewidth-6\tabcolsep-2\PfCLargeurQCM-4\arrayrulewidth}%
+ \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
\begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
\cline{2-\NBcases}%
+ \multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\
+ \hline%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
+ }\\
+ }%
+ \hline%
+ \end{tabular}
+ }{%
+ \ifboolKV[ClesQCM]{ACompleter}{%
+ \xdef\PfCTotalCases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
+ }{%
+ \xdef\PfCTotalCases{\useKV[ClesQCM]{Reponses}}%
+ }%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-2*\tabcolsep-\PfCTotalCases*(2*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}%
+ \begin{tabular}{|p{\LargeurQCM}|*{\PfCTotalCases}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
+ % \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}%
+ \ifboolKV[ClesQCM]{Titre}{\cline{2-\fpeval{\PfCTotalCases+1}}%
\multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ListeNomsMul[##2]}%
+ &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}\ifnum\fpeval{\PfCTotalCases-\useKV[ClesQCM]{Reponses}}>0\relax\uppercase{&}\PfCTexteReponseEleve\fi%
\\
+ }{}%
\hline%
\xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
\stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
- }\\
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,\fpeval{##2+1}]
+ }\ifnum\fpeval{\PfCTotalCases-\useKV[ClesQCM]{Reponses}}>0\relax\uppercase{&}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\fi\\
}%
\hline%
\end{tabular}%
- \renewcommand{\arraystretch}{1}%
- }{%
- \ifboolKV[ClesQCM]{VF}{%
- \setKV[ClesQCM]{Reponses=2}%
- % \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
- \setlength{\PfCLargeurQCM}{\useKV[ClesQCM]{Largeur}}%
- \setlength{\LargeurQCM}{\linewidth-6\tabcolsep-2\PfCLargeurQCM-4\arrayrulewidth}%
- \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
- \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
- \cline{2-\NBcases}%
- \multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\
- \hline%
- \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
- \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
- }\\
- }%
- \hline%
- \end{tabular}
- }{%
- \setlength{\LargeurQCM}{\fpeval{(\linewidth-2*\tabcolsep-\useKV[ClesQCM]{Reponses}*(2*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
- \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
- \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}%
- \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}%
- \\
- }{}
- \hline%
- \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
- \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,##2+1]%
- }\\
- }%
- \hline%
- \end{tabular}%
- }%
}%
- \renewcommand{\arraystretch}{1}%
}%
+ \renewcommand{\arraystretch}{1}%
}%
+}%
}{%
- \newcommand\QCM[2][]{%
- \useKVdefault[ClesQCM]%
- \setKV[ClesQCM]{#1}%
- \ifboolKV[ClesQCM]{Seul}{%
- \QCMSeul[#1]{#2}%
+\newcommand\QCM[2][]{%
+ \useKVdefault[ClesQCM]%
+ \setKV[ClesQCM]{#1}%
+ \ifboolKV[ClesQCM]{Seul}{%
+ \QCMSeul[#1]{#2}%
+ }{%
+ \colorlet{PfCCouleurAlterneQCM}{\useKV[ClesQCM]{CouleurAlt}}%
+ \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
+ \setcounter{TitreQCM}{0}
+ \setsepchar[*]{,*&}\ignoreemptyitems%
+ \readlist*\ListeQCM{#2}%
+ \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
+ \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
+ \ifboolKV[ClesQCM]{Multiple}{%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\ListeNom{\useKV[ClesQCM]{Noms}}%
+ \setsepchar[*]{/}%
+ \readlist*\ListeNomsMul{\ListeNom}%
+ \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
+ \cline{2-\NBcases}%
+ \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ListeNomsMul[##2]}%
+ \\
+ \hline%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
+ }\\
+ }%
+ \hline%
+ \end{tabular}%
+ \renewcommand{\arraystretch}{1}%
}{%
- \colorlet{PfCCouleurAlterneQCM}{\useKV[ClesQCM]{CouleurAlt}}%
- \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
- \setcounter{TitreQCM}{0}
- \setsepchar[*]{,*&}\ignoreemptyitems%
- \readlist*\ListeQCM{#2}%
- \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
- \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
- \ifboolKV[ClesQCM]{Multiple}{%
- \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
- \xdef\ListeNom{\useKV[ClesQCM]{Noms}}%
- \setsepchar[*]{/}%
- \readlist*\ListeNomsMul{\ListeNom}%
+ \ifboolKV[ClesQCM]{VF}{%
+ \setKV[ClesQCM]{Reponses=2}%
+ \setlength{\PfCLargeurQCM}{\useKV[ClesQCM]{Largeur}}%
+ \setlength{\LargeurQCM}{\linewidth-6\tabcolsep-2\PfCLargeurQCM-4\arrayrulewidth}%
+ \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
\begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
\cline{2-\NBcases}%
+ \multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\
+ \hline%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
+ }\\
+ }%
+ \hline%
+ \end{tabular}
+ }{%
+ \ifboolKV[ClesQCM]{ACompleter}{%
+ \xdef\PfCTotalCases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
+ }{%
+ \xdef\PfCTotalCases{\useKV[ClesQCM]{Reponses}}%
+ }%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-2*\tabcolsep-\PfCTotalCases*(2*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}%
+ \begin{tabular}{|p{\LargeurQCM}|*{\PfCTotalCases}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
+ % \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}%
+ \ifboolKV[ClesQCM]{Titre}{\cline{2-\fpeval{\PfCTotalCases+1}}%
\multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ListeNomsMul[##2]}%
+ &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}\ifnum\fpeval{\PfCTotalCases-\useKV[ClesQCM]{Reponses}}>0\relax\uppercase{&}\PfCTexteReponseEleve\fi%
\\
+ }{}%
\hline%
\xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
\stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
- }\\
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,\fpeval{##2+1}]
+ }\ifnum\fpeval{\PfCTotalCases-\useKV[ClesQCM]{Reponses}}>0\relax\uppercase{&}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\fi\\
}%
\hline%
\end{tabular}%
- \renewcommand{\arraystretch}{1}%
- }{%
- \ifboolKV[ClesQCM]{VF}{%
- \setKV[ClesQCM]{Reponses=2}%
- \setlength{\PfCLargeurQCM}{\useKV[ClesQCM]{Largeur}}%
- \setlength{\LargeurQCM}{\linewidth-6\tabcolsep-2\PfCLargeurQCM-4\arrayrulewidth}%
- \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
- \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
- \cline{2-\NBcases}%
- \multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\
- \hline%
- \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
- \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
- }\\
- }%
- \hline%
- \end{tabular}
- }{%
- \setlength{\LargeurQCM}{\fpeval{(\linewidth-2*\tabcolsep-\useKV[ClesQCM]{Reponses}*(2*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
- \xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}%
- \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
- \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}%
- \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}%
- \\
- }{}%
- \hline%
- \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
- \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,\fpeval{##2+1}]%
- }\\
- }%
- \hline%
- \end{tabular}%
- }%
}%
- \renewcommand{\arraystretch}{1}%
}%
+ \renewcommand{\arraystretch}{1}%
}%
}%
+}%
\NewDocumentCommand\PfCSolCellColor{mm}{%
\xdef\PfCFooSolColor{\ListeQCM[#1,\NumeroReponse]}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -4,19 +4,20 @@
\newtoks\tokPfCEngrenages%
\def\UpdatetoksEngrenages#1/#2\nil{\addtotok\tokPfCEngrenages{#1,#2,}}%
-\setKVdefault[Engrenages]{Couleur=LightSteelBlue,Unite=3mm,ListeCouleurs={LightSteelBlue}}
+\setKVdefault[Engrenages]{Couleur=LightSteelBlue,Unite=3mm,ListeCouleurs={?}}%
+%\defKV[Engrenages]{Couleur=\setKV[Engrenages]{ListeCouleurs=#1}}%
\NewDocumentCommand\Engrenages{o m}{%
\newtoks\toklistecouleur%
\toklistecouleur{}%
- \tokPfCEngrenages{}
+ \tokPfCEngrenages{}%
\useKVdefault[Engrenages]%
\setKV[Engrenages]{#1}%
\setsepchar[*]{,*/}%
\ignoreemptyitems
\readlist*\ListePfCEngrenages{#2}%
- \setsepchar{,}
- \xdef\PfCFooEngrenages{}
+ \setsepchar{,}%
+ \xdef\PfCFooEngrenages{}%
\foreachitem\compteur\in\ListePfCEngrenages{%
\xdef\PfCFooEngrenages{\PfCFooEngrenages \ListePfCEngrenages[\compteurcnt,1],\ListePfCEngrenages[\compteurcnt,2],}%
}%
@@ -23,6 +24,7 @@
\xdef\ListeAvantCouleurs{\useKV[Engrenages]{ListeCouleurs}}%
\readlist*\ListeCouleur{\ListeAvantCouleurs}%
\foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}%
+ %\setKV[Engrenages]{Couleurs=\ListeCouleur[1]}%
\BuildEngrenages{\PfCFooEngrenages}{\the\toklistecouleur}%
}%
@@ -102,19 +104,19 @@
fi;
endfor;
);
-}
+}%
\NewDocumentCommand\BuildEngrenages{mm}{%
- \ifluatex
- \mplibforcehmode
- \begin{mplibcode}
+ \ifluatex%
+ \mplibforcehmode%
+ \begin{mplibcode}%
input PfCEngrenages;
\BuildEngrenagesCode{#1}{#2}
trace EngrenageFinal;
- \end{mplibcode}
- \else
+ \end{mplibcode}%
+ \else%
\begin{mpost}[mpsettings={input PfCEngrenages;\BuildEngrenagesCode{#1}{#2}}]
trace EngrenageFinal;
- \end{mpost}
- \fi
+ \end{mpost}%
+ \fi%
}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCFonctionAffine.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCFonctionAffine.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCFonctionAffine.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -58,8 +58,13 @@
}%
}{%
\ifboolKV[ClesAffine]{Retrouve}{%
- On sait que $\useKV[ClesAffine]{Nom}$ est une fonction affine. Donc elle s'\'ecrit sous la forme : \[\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\useKV[ClesAffine]{CoefDir}\useKV[ClesAffine]{Variable}+\useKV[ClesAffine]{OrdoOrig}\]
- Or, $\useKV[ClesAffine]{Nom}(\num{#2})=\num{#3}$ et $\useKV[ClesAffine]{Nom}(\num{#4})=\num{#5}$. Par cons\'equent, d'apr\`es la propri\'et\'e des accroissements :
+ \xdef\OrdOrigine{\fpeval{#3-(#3-#5)*#2/(#2-#4)}}%%
+ On sait que $\useKV[ClesAffine]{Nom}$ est une fonction affine. Donc elle s'\'ecrit sous la forme : \[\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\useKV[ClesAffine]{CoefDir}\useKV[ClesAffine]{Variable}+\useKV[ClesAffine]{OrdoOrig}.\]
+ Or, $\useKV[ClesAffine]{Nom}(\num{#2})=\num{#3}$ et $\useKV[ClesAffine]{Nom}(\num{#4})=\num{#5}$. \ifnum\fpeval{#3-#5}=0
+ Les images de \num{#2} et \num{#4} sont égales à \num{#3}. La fonction affine cherchée est donc constante et s'écrit :
+ \[\useKV[ClesAffine]{Nom}:\useKV[ClesAffine]{Variable}\mapsto\num{\OrdOrigine}.\]
+ \else
+ Par cons\'equent, d'apr\`es la propri\'et\'e des accroissements :
\begin{align*}
\useKV[ClesAffine]{CoefDir}&=\frac{\useKV[ClesAffine]{Nom}(\num{#2})-\useKV[ClesAffine]{Nom}(\num{#4})}{\num{#2}-\xintifboolexpr{#4<0}{(\num{#4})}{\num{#4}}}\\
\useKV[ClesAffine]{CoefDir}&=\frac{\num{#3}-\xintifboolexpr{#5<0}{(\num{#5})}{\num{#5}}}{\num{\fpeval{#2-#4}}}\\
@@ -66,16 +71,17 @@
\useKV[ClesAffine]{CoefDir}&=\frac{\num{\fpeval{#3-#5}}}{\num{\fpeval{#2-#4}}}%\\
\SSimpliTest{\fpeval{#3-#5}}{\fpeval{#2-#4}}\ifthenelse{\boolean{Simplification}}{\\\useKV[ClesAffine]{CoefDir}&=\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}}{}%
\end{align*}
- La fonction $\useKV[ClesAffine]{Nom}$ s'\'ecrit alors sous la forme $\displaystyle\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\useKV[ClesAffine]{Variable}+\useKV[ClesAffine]{OrdoOrig}$.
+ \def\PfCQuotientAffine{\fpeval{(#3-#5)/(#2-#4)}}%
+ La fonction $\useKV[ClesAffine]{Nom}$ s'\'ecrit alors sous la forme $\displaystyle\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\ifnum\fpeval{abs(\PfCQuotientAffine)}=1\relax\Affichage[Lettre={\useKV[ClesAffine]{Variable}}]{0}{\PfCQuotientAffine}{0}\else\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\useKV[ClesAffine]{Variable}\fi+\useKV[ClesAffine]{OrdoOrig}$.
\\De plus, comme $\useKV[ClesAffine]{Nom}(\num{#2})=\num{#3}$, alors :
\begin{align*}
- \SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\times\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}+\useKV[ClesAffine]{OrdoOrig}&=\num{#3}\\
+ \ifnum\PfCQuotientAffine=1\relax\else\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\times\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}+\useKV[ClesAffine]{OrdoOrig}\uppercase{&}=\num{#3}\\\fi
\SSimplifie{\fpeval{(#3-#5)*#2}}{\fpeval{#2-#4}}+\useKV[ClesAffine]{OrdoOrig}&=\num{#3}\\
\useKV[ClesAffine]{OrdoOrig}&=\num{\fpeval{#3-(#3-#5)*#2/(#2-#4)}}
\end{align*}
- \xdef\OrdOrigine{\fpeval{#3-(#3-#5)*#2/(#2-#4)}}
La fonction affine $\useKV[ClesAffine]{Nom}$ cherch\'ee est :
- \[\useKV[ClesAffine]{Nom}:\useKV[ClesAffine]{Variable}\mapsto\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\useKV[ClesAffine]{Variable}\xintifboolexpr{\OrdOrigine==0}{}{\xintifboolexpr{\OrdOrigine>0}{+\num{\OrdOrigine}}{-\num{\fpeval{0-\OrdOrigine}}}}\]
+ \[\useKV[ClesAffine]{Nom}:\useKV[ClesAffine]{Variable}\mapsto\ifnum\fpeval{abs(\PfCQuotientAffine)}=1\relax\Affichage[Lettre={\useKV[ClesAffine]{Variable}}]{0}{\PfCQuotientAffine}{\OrdOrigine}\else\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\useKV[ClesAffine]{Variable}\xintifboolexpr{\OrdOrigine==0}{}{\xintifboolexpr{\OrdOrigine>0}{+\num{\OrdOrigine}}{-\num{\fpeval{0-\OrdOrigine}}}}\fi.\]
+ \fi
}{%
%
}%
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCInfixRPN.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCInfixRPN.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCInfixRPN.sty 2024-07-04 20:28:16 UTC (rev 71706)
@@ -0,0 +1,538 @@
+%%
+%% This is file `infix-RPN.tex',
+%%
+%% IMPORTANT NOTICE:
+%%
+%% Package `infix-RPN.tex'
+%%
+%% Main code:
+%% Jean-Côme Charpentier <jean-come.charpentier at wanadoo.fr>
+%%
+%% Contributions by
+%% Christophe Jorssen <christophe.jorssen at libre.fr.invalid>
+%% `libre' is the french word for `free' :-)
+%%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN archives
+%% in directory CTAN:/macros/latex/base/lppl.txt.
+%%
+%% DESCRIPTION:
+%% `infix-RPN' is a package to convert infix expressions to
+%% Reverse Polish Notation
+%%
+%%
+\def\RCS$#1: #2 ${\expandafter\def\csname RCS#1\endcsname{#2}}
+\RCS$Revision: 1.7 $
+\RCS$Date: 2004-07-06 23:41:52+02 $
+
+\def\fileversion{0.11}
+\csname infixRPNLoaded\endcsname
+\let\infixRPNLoaded\endinput
+\message{`infix-RPN' v\fileversion\space (Rev \RCSRevision, \RCSDate), J.-C.Charpentier/C.Jorssen}
+
+\edef\PfCopAtCode{\the\catcode`\@}
+\edef\PfCopHatCode{\the\catcode`\^}
+\edef\PfCopUnderscoreCode{\the\catcode`\_}
+\catcode`\@=11\relax
+\catcode`\^=12\relax
+\catcode`\_=11\relax
+
+\def\s at pow{exp}
+\def\s at lpar{(}
+\def\s at rpar{)}
+\def\s at comma{,}
+
+\def\DeclareNewPSOperator{%
+ \bgroup
+ \catcode`\_=11\relax
+ \DeclareNewPSOperator at i
+}
+
+\def\DeclareNewPSOperator at i#1{%
+ \expandafter\ifx\csname PS at operator@list\endcsname\relax
+ \gdef\PS at operator@list{#1}%
+ \else
+ \xdef\PS at operator@list{#1,\PS at operator@list}%
+ \fi
+ \expandafter\gdef\csname s@#1\endcsname{#1}%
+ \egroup
+}
+
+\DeclareNewPSOperator{add}
+\DeclareNewPSOperator{sub}
+\DeclareNewPSOperator{mul}
+\DeclareNewPSOperator{div}
+\DeclareNewPSOperator{exp}
+\DeclareNewPSOperator{abs}
+\DeclareNewPSOperator{sin}
+\DeclareNewPSOperator{cos}
+\DeclareNewPSOperator{atan}
+\DeclareNewPSOperator{neg}
+\DeclareNewPSOperator{ceiling}
+\DeclareNewPSOperator{floor}
+\DeclareNewPSOperator{truncate}
+\DeclareNewPSOperator{sqrt}
+\DeclareNewPSOperator{ln}
+\DeclareNewPSOperator{log}
+
+
+\newcount\@parenthesis
+\newcount\token at cpt
+\newif\if at begin@token
+\newif\if at in@number
+\newif\if at in@decimal
+\newif\if at in@name
+\newif\if at sign
+\def\@tokencreate#1{%
+ \expandafter\xdef\csname PfCop at token\the\token at cpt\endcsname{#1}%
+ \global\advance\token at cpt\@ne
+ \expandafter\global
+ \expandafter\let\csname PfCop at token\the\token at cpt\endcsname\relax
+ \global\advance\token at cpt\m at ne
+}
+\def\@tokenappend#1{%
+ \expandafter\xdef\csname PfCop at token\the\token at cpt\endcsname
+ {\csname PfCop at token\the\token at cpt\endcsname#1}%
+}
+\def\@tokensingle#1{%
+ \edef\@arg{#1}%
+ \if at in@name
+ \global\advance\token at cpt\@ne
+ \@in at namefalse
+ \fi
+ \if at in@number
+ \global\advance\token at cpt\@ne
+ \@in at numberfalse
+ \@in at decimalfalse
+ \fi
+ \ifx\@arg\s at add
+ \if at sign
+ % ignore + sign
+ \global\advance\token at cpt\m at ne
+ \else
+ \@tokencreate{#1}%
+ \fi
+ \else\ifx\@arg\s at sub
+ \if at sign
+ \@tokencreate{\s at neg}%
+ \else
+ \@tokencreate{#1}%
+ \fi
+ \else
+ \@tokencreate{#1}%
+ \fi\fi
+ \global\advance\token at cpt\@ne
+}
+\def\@tokenuse#1{%
+ \expandafter\ifx\csname PfCop at token#1\endcsname\s at comma%
+ \else
+ \xdef\RPN{\RPN\space\csname PfCop at token#1\endcsname}%
+ \fi
+}
+
+\let\endscanline\relax
+\def\scan at line{%
+ \begingroup
+ \catcode`\ =12
+ \@parenthesis=\z@
+ \@in at numberfalse
+ \@in at decimalfalse
+ \@in at namefalse
+ \global\token at cpt=\@ne
+ \global\@signtrue
+ \scan@@line
+}
+\def\scan@@line#1{\scan@@@line#1\endscanline\endgroup}
+\def\scan@@@line#1#2\endscanline{%
+ \PfCop at testchar{#1}%
+ \ifPfCop at isdigit
+ \global\@signfalse
+ \if at in@number
+ \@tokenappend{#1}%
+ \else \if at in@name
+ \@in at namefalse
+ \@in at numbertrue
+ \@tokenappend{#1}%
+ \else
+ \@in at numbertrue
+ \@tokencreate{#1}%
+ \fi\fi
+ \fi
+ \ifPfCop at isplus
+ \@tokensingle{\s at add}%
+ \global\@signtrue
+ \fi
+ \ifPfCop at isminus
+ \@tokensingle{\s at sub}%
+ \global\@signtrue
+ \fi
+ \ifPfCop at ismultiply
+ \@tokensingle{\s at mul}%
+ \global\@signtrue
+ \fi
+ \ifPfCop at isdivide
+ \@tokensingle{\s at div}%
+ \global\@signtrue
+ \fi
+ \ifPfCop at ispower
+ \@tokensingle{\s at pow}%
+ \global\@signtrue
+ \fi
+ \ifPfCop at isdecimalsep
+ \global\@signfalse
+ \if at in@decimal
+ \errmessage{Syntax error: number with multiple separators!}%
+ \else \if at in@number
+ \@in at decimaltrue
+ \@tokenappend{.}%
+ \else
+ \@tokencreate{.}%
+ \@in at numbertrue
+ \@in at decimaltrue
+ \fi\fi
+ \fi
+ \ifPfCop at iscomma
+ \@tokensingle{,}%
+ \global\@signtrue
+ \fi
+ \ifPfCop at islparenthesis
+ \@tokensingle{(}%
+ \global\@signtrue
+ \fi
+ \ifPfCop at isrparenthesis
+ \global\@signfalse
+ \@tokensingle{)}%
+ \fi
+ \ifPfCop at isspace
+ \if at in@number
+ \@in at numberfalse
+ \@in at decimalfalse
+ \global\advance\token at cpt\@ne
+ \else \if at in@name
+ \@in at namefalse
+ \global\advance\token at cpt\@ne
+ \fi\fi
+ \fi
+ \ifPfCop at isother
+ \global\@signfalse
+ \if at in@name
+ \@tokenappend{#1}%
+ \else \if at in@number
+ \@in at numberfalse
+ \@in at decimalfalse
+ \@in at nametrue
+ \@tokenappend{#1}%
+ \else
+ \@in at nametrue
+ \@tokencreate{#1}%
+ \fi\fi
+ \fi
+ \def\arg{#2}%
+ \ifx\empty\arg
+ \let\next\relax
+ \else
+ \let\next\scan@@@line
+ \fi
+ \expandafter\next\arg\endscanline
+}
+\count255=`\0 \edef\PfCop at numbegin{\the\count255}
+\count255=`\9 \edef\PfCop at numend{\the\count255}
+\count255=`\+ \edef\PfCop at plus{\the\count255}
+\count255=`\- \edef\PfCop at minus{\the\count255}
+\count255=`\* \edef\PfCop at multiply{\the\count255}
+\count255=`\/ \edef\PfCop at divide{\the\count255}
+\count255=`\^ \edef\PfCop at power{\the\count255}
+\count255=`\. \edef\PfCop at dot{\the\count255}
+\count255=`\, \edef\PfCop at comma{\the\count255}
+\count255=`\( \edef\PfCop at lparenthesis{\the\count255}
+\count255=`\) \edef\PfCop at rparenthesis{\the\count255}
+\edef\PfCop at space{32}
+\newif\ifPfCop at isdigit
+\newif\ifPfCop at isplus
+\newif\ifPfCop at isminus
+\newif\ifPfCop at ismultiply
+\newif\ifPfCop at isdivide
+\newif\ifPfCop at ispower
+\newif\ifPfCop at isdecimalsep
+\newif\ifPfCop at iscomma
+\newif\ifPfCop at islparenthesis
+\newif\ifPfCop at isrparenthesis
+\newif\ifPfCop at isspace
+\newif\ifPfCop at isother
+\def\PfCop at testchar#1{%
+ \PfCop at isdigitfalse
+ \PfCop at isplusfalse
+ \PfCop at isminusfalse
+ \PfCop at ismultiplyfalse
+ \PfCop at isdividefalse
+ \PfCop at ispowerfalse
+ \PfCop at isdecimalsepfalse
+ \PfCop at iscommafalse
+ \PfCop at islparenthesisfalse
+ \PfCop at isrparenthesisfalse
+ \PfCop at isspacefalse
+ \PfCop at isotherfalse
+ \count255=`#1\relax
+ \ifnum\count255=\PfCop at plus \relax
+ \PfCop at isplustrue
+ \else \ifnum\count255=\PfCop at minus \relax
+ \PfCop at isminustrue
+ \else \ifnum\count255=\PfCop at multiply \relax
+ \PfCop at ismultiplytrue
+ \else \ifnum\count255=\PfCop at divide \relax
+ \PfCop at isdividetrue
+ \else \ifnum\count255=\PfCop at power \relax
+ \PfCop at ispowertrue
+ \else \ifnum\count255=\PfCop at dot \relax
+ \PfCop at isdecimalseptrue
+ \else \ifnum\count255=\PfCop at comma \relax
+ \PfCop at iscommatrue
+ \else \ifnum\count255=\PfCop at lparenthesis \relax
+ \PfCop at islparenthesistrue
+ \else \ifnum\count255=\PfCop at rparenthesis \relax
+ \PfCop at isrparenthesistrue
+ \else \ifnum\count255=\PfCop at space \relax
+ \PfCop at isspacetrue
+ \else \ifnum\count255<\PfCop at numbegin \relax
+ \PfCop at isothertrue
+ \else \ifnum\count255>\PfCop at numend \relax
+ \PfCop at isothertrue
+ \else \PfCop at isdigittrue
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+
+\def\search at term#1#2{%
+ \begingroup
+ \count1=#1\relax
+ \count255=#2\relax
+ \ifnum\count1=\count255
+ \@tokenuse{#1}%
+ \else
+ \count5=\count255
+ \count7=\count1
+ \advance\count7\m at ne
+ \count3=\z@
+ \loop
+ \ifnum\count5>\count7
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at rpar\relax
+ \advance\@parenthesis\@ne
+ \fi
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at lpar\relax
+ \advance\@parenthesis\m at ne
+ \fi
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at add\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at sub\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at comma\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \advance\count5\m at ne
+ \repeat
+ \ifnum\count3=\z@
+ \ifnum\@parenthesis=\z@
+ \search at factor{\the\count1}{\the\count255}%
+ \else
+ \errmessage{Syntax error: unbalanced parenthesis!}%
+ \fi
+ \else
+ \advance\count3\m at ne
+ \search at term{\the\count1}{\the\count3}%
+ \advance\count3\tw@
+ \search at term{\the\count3}{\the\count255}%
+ \advance\count3\m at ne
+ \@tokenuse{\the\count3}%
+ \fi
+ \fi
+ \endgroup
+}
+\def\search at factor#1#2{%
+ \begingroup
+ \count1=#1\relax
+ \count255=#2\relax
+ \ifnum\count1=\count255
+ \@tokenuse{\the\count1}%
+ \else
+ \count5=\count255
+ \count7=\count1
+ \advance\count7\m at ne
+ \count3=\z@
+ \loop
+ \ifnum\count5>\count7
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at rpar\relax
+ \advance\@parenthesis\@ne
+ \fi
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at lpar\relax
+ \advance\@parenthesis\m at ne
+ \fi
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at mul\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at div\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \advance\count5\m at ne
+ \repeat
+ \ifnum\count3=\z@
+ \ifnum\@parenthesis=\z@
+ \search at power{\the\count1}{\the\count255}%
+ \else
+ \errmessage{! Syntax error: unbalanced parenthesis}%
+ \fi
+ \else
+ \advance\count3\m at ne
+ \search at factor{\the\count1}{\the\count3}%
+ \advance\count3\tw@
+ \search at factor{\the\count3}{\the\count255}%
+ \advance\count3\m at ne
+ \@tokenuse{\the\count3}%
+ \fi
+ \fi
+ \endgroup
+}
+\def\search at power#1#2{%
+ \begingroup
+ \count1=#1\relax
+ \count255=#2\relax
+ \ifnum\count1=\count255
+ \@tokenuse{#1}%
+ \else
+ \count5=\count255
+ \count7=\count1
+ \advance\count7\m at ne
+ \count3=\z@
+ \loop
+ \ifnum\count5>\count7
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at rpar\relax
+ \advance\@parenthesis\@ne
+ \fi
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at lpar\relax
+ \advance\@parenthesis\m at ne
+ \fi
+ \expandafter\ifx\csname PfCop at token\the\count5\endcsname\s at pow\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \advance\count5\m at ne
+ \repeat
+ \ifnum\count3=\z@
+ \ifnum\@parenthesis=\z@
+ \search at primary{\the\count1}{\the\count255}%
+ \else
+ \errmessage{Syntax error: unbalanced parenthesis}%
+ \fi
+ \else
+ \advance\count3\m at ne
+ \search at power{\the\count1}{\the\count3}%
+ \advance\count3\tw@
+ \search at power{\the\count3}{\the\count255}%
+ \advance\count3\m at ne
+ \@tokenuse{\the\count3}%
+ \fi
+ \fi
+ \endgroup
+}
+\def\search at primary#1#2{%
+ \begingroup
+ \count1=#1\relax
+ \count255=#2\relax
+ \ifnum\count1=\count255
+ \@tokenuse{#1}%
+ \else
+ \edef\current at cnt{#1}%
+ \expandafter\compare at PS@operator\PS at operator@list,\@nil
+ \expandafter\ifx\csname PfCop at token#1\endcsname\s at lpar\relax
+ \expandafter\ifx\csname PfCop at token#2\endcsname\s at rpar\relax
+ \advance\count1\@ne
+ \advance\count255\m at ne
+ \search at term{\the\count1}{\the\count255}%
+ \else
+ \errmessage{Syntax error: Garbage after parenthesis
+ (tokens '#1' to '#2')}%
+ \fi
+ \fi
+ \fi
+ \endgroup
+}
+
+%\let\@nil\relax
+%\let\@nil\@empty
+
+%\def\compare at PS@operator#1,#2\@nil{%
+% \def\@tempa{#1}%
+% \def\@tempb{#2}%
+% \expandafter\ifx\csname PfCop at token\current at cnt\endcsname\@tempa%
+% \advance\count1\@ne
+% \search at primary{\the\count1}{\the\count255}%
+% \advance\count1\m at ne
+% \@tokenuse{\the\count1}%
+% \fi
+% \ifx\@tempb\empty
+% \let\next\relax
+% \let\@tempb\relax
+% \else
+% \let\next\compare at PS@operator
+% \fi
+% \expandafter\next\@tempb\@nil
+%}
+
+\let\@nil\undefined
+
+\def\compare at PS@operator#1,#2\@nil{%
+ \def\@tempa{#1}%
+ \def\@tempb{#2}%
+ \expandafter\ifx\csname PfCop at token\current at cnt\endcsname\@tempa%
+ \advance\count1\@ne
+ \search at primary{\the\count1}{\the\count255}%
+ \advance\count1\m at ne
+ \@tokenuse{\the\count1}%
+ \fi
+ \ifx\@tempb\empty
+ \let\next\@gobble
+ \else
+ \let\next\compare at PS@operator
+ \fi
+ \expandafter\next\@tempb\@nil
+}
+
+
+\def\infixtoRPN{%
+ \begingroup
+ \catcode`\ =12
+ \catcode`\^=12
+ \infixt at RPN
+}
+\def\infixt at RPN#1{%
+ \xdef\@expression{#1}%
+ \endgroup
+ \def\RPN{}%
+ \expandafter\scan at line\expandafter{\@expression}%
+ \expandafter\ifx\csname PfCop at token\the\token at cpt\endcsname\relax
+ \advance\token at cpt\m at ne
+ \fi
+ \search at term{1}{\the\token at cpt}%
+}
+
+\catcode`\@=\PfCopAtCode\relax
+\catcode`\^=\PfCopHatCode\relax
+\catcode`\_=\PfCopUnderscoreCode\relax
+\endinput
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCInfixRPN.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulJap.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulJap.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulJap.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -229,5 +229,6 @@
endfor;
fi;
\end{mplibcode}
+ \mplibnumbersystem{scaled}
\fi
}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulPiecesPuzzle.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulPiecesPuzzle.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulPiecesPuzzle.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -6,7 +6,7 @@
\def\UpdatetoksPuzzleA#1\nil{\addtotok\toklistepuzzlea{"#1",}}%
-\setKVdefault[ClesPuzzleMul]{Solution=false,Unite=1cm,Couleur=LightSteelBlue}
+\setKVdefault[ClesPuzzleMul]{Solution=false,Unite=1cm,Couleur=LightSteelBlue,Cube=false}
\NewDocumentCommand\PuzzleMul{om}{%
\useKVdefault[ClesPuzzleMul]%
@@ -17,8 +17,12 @@
\xdef\HauteurPuzzle{\PfCListePuzzlelen}%
\toklistepuzzlea{}%
\foreachitem\compteur\in\PfCListePuzzle{\expandafter\UpdatetoksPuzzleA\compteur\nil}%
- \BuildPuzzle{\the\toklistepuzzlea}%
-}
+ \ifboolKV[ClesPuzzleMul]{Cube}{%
+ \BuildPuzzleEspace{\the\toklistepuzzlea}%
+ }{%
+ \BuildPuzzle{\the\toklistepuzzlea}%
+ }%
+}%
\def\BuildPuzzleCode{%
def PreDrawPuzzle ( expr ww, hh, uu ) =
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -22,18 +22,20 @@
\setKV[TraceG]{#1}%
\tokPfCListeDesFonctions{}%
\tokPfCListeDesNomsFonctions{}%
- \xdef\PfCFooFn{\useKV[ClesFonction]{Calcul}}
- \xdef\PfCFooNomFn{\useKV[TraceG]{NomCourbe}}
+ \xdef\PfCFooFn{\useKV[ClesFonction]{Calcul}}%
+ \xdef\PfCFooNomFn{\useKV[TraceG]{NomCourbe}}%
\ifx\bla\PfCFooFn\bla%
- \else
- \readlist*\ListeDesFonctions{\PfCFooFn}
+ \else%
+ \setsepchar{,}\ignoreemptyitems
+ \readlist*\ListeDesFonctions{\PfCFooFn}%
+ \reademptyitems
\foreachitem\compteur\in\ListeDesFonctions{\expandafter\UpdatePfCListeDesFonctions\compteur\nil}%
- \fi
- \ifx\bla\PfCFooNomFn\bla
- \else
- \readlist*\ListeDesNomsFonctions{\PfCFooNomFn}
+ \fi%
+ \ifx\bla\PfCFooNomFn\bla%
+ \else%
+ \readlist*\ListeDesNomsFonctions{\PfCFooNomFn}%
\foreachitem\compteur\in\ListeDesNomsFonctions{\expandafter\UpdatePfCListeDesNomsFonctions\compteur\nil}%
- \fi
+ \fi%
\tokPfCLabelX{}%
\tokPfCLabelY{}%
\addtotok\tokPfCLabelX{"\useKV[TraceG]{LabelX}"}%
@@ -79,7 +81,7 @@
\MPCourbeNew{\PfCFooListePoints}%
}%
}%
- }
+ }%
}{%
\setsepchar{,}\ignoreemptyitems%
\readlist*\ListeFonction{#2}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPatronPaves.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCPatronPaves.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCPatronPaves.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -1,7 +1,9 @@
%%%
% Patrons de pavés droits et cubes
%%%
-\setKVdefault[ClesPatron]{Cube,Arete=1cm,ListeCouleurs={white},Pave=false,Largeur=2cm,Hauteur=1.5cm,Profondeur=1cm,Codes=false}%
+\setKVdefault[ClesPatron]{Cube,Arete=1cm,ListeCouleurs={white},Pave=false,Largeur=2cm,Hauteur=1.5cm,Profondeur=1cm,Codes=false,AColorier=false}%
+%EcartColorier est en nombre de parts pour le cube, en mm pour le pavé.
+\defKV[ClesPatron]{EcartColorier=\setKV[ClesPatron]{AColorier}}%
\defKV[ClesPatron]{Traces=\setKV[ClesPatron]{Codes}}%
\newtoks\toklistepatron%
@@ -30,7 +32,7 @@
}%
}%
-\setsepchar{,}\ignoreemptyitems
+\setsepchar{,}\ignoreemptyitems%
\readlist*\ListePatronsCube{%
{ooxo,xxxx,ooxo},%
{oxoo,xxxx,xooo},%
@@ -78,7 +80,7 @@
{poho,lpho,poho,lohp},%
{poho,loho,plhl,loho},%
{poho,loho,plho,lohp},%
- {poho,loho,poho,lphp},%
+ {poho,loho,poho,lphp},%20
{phlh,holo,polo,holo},%
{phlo,holp,polo,holo},%
{phlo,holo,polh,holo},%
@@ -88,17 +90,17 @@
{polo,hplo,polo,holp},%
{polo,holo,phlh,holo},%
{polo,holo,phlo,holp},%
- {polo,holo,polo,hplp},%
+ {polo,holo,polo,hplp},%30
{hlpo,lopo,hopl,pool},%
{hopo,lhpo,hopl,pool},%
{hopo,lopo,hlph,pool},%
{lhpo,hopo,loph,pooh},%
{lopo,hlpo,loph,pooh},%
- {lopo,hopo,lhoh,pooh},%
+ {lopo,hopo,lhph,pooh},%
{plho,loho,pohl,hool},%
{poho,lpho,pohl,hool},%
{poho,loho,plhl,hool},%
- {lpho,poho,lohp,hoop},%
+ {lpho,poho,lohp,hoop},%40
{loho,plho,lohp,hoop},%
{loho,poho,lphp,hoop},%
{phlo,holo,polh,looh},%
@@ -108,23 +110,23 @@
{holo,phlo,holp,loop},%
{holo,polo,hplp,loop},%
{hpo,lpo,hpl,pol,hol},%
- {lpo,hpo,lph,poh,loh},%
- {pho,plo,phl,hol,pol},%
+ {lpo,hpo,lph,poh,loh},%50
+ {pho,lho,phl,hol,pol},%
{hpoo,lpho,pohl,hool},%
{lpoo,hplo,polh,looh},%
- {phoo,lhpo,hopl,pool}
-}
+ {phoo,lhpo,hopl,pool}%
+}%
\readlist*\ListePatronsPaveCouleurs{%
- {Orange,Crimson,Orange,LightGreen,Crimson,LightGreen},
- {Orange,Crimson,LightGreen,Orange,Crimson,LightGreen},
- {Orange,Crimson,LightGreen,Crimson,Orange,LightGreen},
- {Orange,Crimson,LightGreen,Crimson,LightGreen,Orange},
- {Crimson,Orange,LightGreen,Orange,Crimson,LightGreen},
- {Crimson,Orange,LightGreen,Crimson,Orange,LightGreen},
- {Crimson,Orange,LightGreen,Crimson,LightGreen,Orange},
- {Crimson,LightGreen,Orange,Crimson,Orange,LightGreen},
- {Crimson,LightGreen,Orange,Crimson,LightGreen,Orange},
+ {Orange,Crimson,Orange,LightGreen,Crimson,LightGreen},%
+ {Orange,Crimson,LightGreen,Orange,Crimson,LightGreen},%
+ {Orange,Crimson,LightGreen,Crimson,Orange,LightGreen},%
+ {Orange,Crimson,LightGreen,Crimson,LightGreen,Orange},%
+ {Crimson,Orange,LightGreen,Orange,Crimson,LightGreen},%
+ {Crimson,Orange,LightGreen,Crimson,Orange,LightGreen},%
+ {Crimson,Orange,LightGreen,Crimson,LightGreen,Orange},%
+ {Crimson,LightGreen,Orange,Crimson,Orange,LightGreen},%
+ {Crimson,LightGreen,Orange,Crimson,LightGreen,Orange},%
{Crimson,LightGreen,Crimson,Orange,LightGreen,Orange},%10
{LightGreen,Crimson,LightGreen,Orange,Crimson,Orange},%
{LightGreen,Crimson,Orange,LightGreen,Crimson,Orange},%
@@ -169,10 +171,278 @@
{Crimson,Orange,Crimson,LightGreen,Orange,LightGreen},%
{Crimson,LightGreen,Orange,Crimson,LightGreen,Orange},%
{LightGreen,Crimson,Orange,LightGreen,Crimson,Orange},%
- {Crimson,Orange,LightGreen,Crimson,Orange,LightGreen}%
+ {Crimson,Orange,LightGreen,Crimson,Orange,LightGreen}%
}%
-\reademptyitems
+\reademptyitems%
+\def\MPPatronPaveCode{%
+ Largeur=\useKV[ClesPatron]{Largeur};
+ Hauteur=\useKV[ClesPatron]{Hauteur};
+ Profondeur=\useKV[ClesPatron]{Profondeur};
+ %
+ pair C[],M[],N[],O[],P[];
+ %
+ color Col[],CoulDefaut;
+ CoulDefaut=white;
+ %
+ boolean Codes,Allume[][],AColorier;
+ Codes=\useKV[ClesPatron]{Codes};
+ AColorier=\useKV[ClesPatron]{AColorier};
+ if AColorier:
+ EcartColorier=\useKV[ClesPatron]{EcartColorier}*1mm;
+ fi;
+ %
+ numeric DecalCol[];
+ %
+ vardef Allumage(text t)=
+ nblignes:=0;
+ for p_=t:
+ Long:=length p_;
+ nblignes:=nblignes+1;
+ for k=0 upto Long-1:
+ Allume[nblignes][k]=false;
+ endfor;
+ endfor;
+ enddef;
+ %
+ vardef LectureLargeur(text t)=
+ for p_=t:
+ Long:=length p_;
+ endfor;
+ for k=1 upto Long-1:
+ for p_=t:
+ if substring(k,k+1) of p_="o":
+ if k=1:
+ if (substring(0,1) of p_="h") and (substring(1,2) of p_="p"):
+ DecalCol[k]:=Largeur;
+ fi;
+ if (substring(0,1) of p_="h") and (substring(1,2) of p_="l"):
+ DecalCol[k]:=Profondeur;
+ fi;
+ if (substring(0,1) of p_="p") and (substring(1,2) of p_="h"):
+ DecalCol[k]:=Largeur;
+ fi;
+ if (substring(0,1) of p_="p") and (substring(1,2) of p_="l"):
+ DecalCol[k]:=Hauteur;
+ fi;
+ if (substring(0,1) of p_="l") and (substring(1,2) of p_="h"):
+ DecalCol[k]:=Profondeur;
+ fi;
+ if (substring(0,1) of p_="l") and (substring(1,2) of p_="p"):
+ DecalCol[k]:=Hauteur;
+ fi;
+ fi;
+ elseif substring(k,k+1) of p_="l":
+ DecalCol[k]:=Largeur;
+ elseif substring(k,k+1) of p_="h":
+ DecalCol[k]:=Hauteur;
+ elseif substring(k,k+1) of p_="p":
+ DecalCol[k]:=Profondeur;
+ fi;
+ endfor;
+ endfor;
+ enddef;
+ %
+ vardef Patron(text t)=
+ path PathPave;
+ nblignes:=-1;
+ NBLignes:=0;
+ nbcol:=0;
+ nbfaces:=0;
+ for p_=t:
+ Long:=length p_;
+ nbcolonnes:=0;
+ NBColonnes:=0;
+ if substring(0,1) of p_="h":
+ YEchelle:=Hauteur;
+ elseif substring(0,1) of p_="l":
+ YEchelle:=Largeur;
+ elseif substring(0,1) of p_="p":
+ YEchelle:=Profondeur;
+ fi;
+ nblignes:=nblignes-YEchelle;
+ NBLignes:=NBLignes+1;
+ for k=1 upto Long-1:
+ if substring(k,k+1) of p_="o":
+ if k=1:
+ PathPave:=(unitsquare scaled 0) shifted ((0,-1));
+ fi;
+ elseif substring(k,k+1) of p_="l":
+ nbcol:=nbcol+1;
+ PathPave:=(unitsquare xscaled Largeur yscaled YEchelle) shifted ((nbcolonnes,nblignes));
+ Allume[NBLignes][NBColonnes]:=true;
+ nbfaces:=nbfaces+1;
+ C[nbfaces]=center PathPave;
+ M[nbfaces]=point(0) of PathPave;
+ N[nbfaces]=point(1) of PathPave;
+ O[nbfaces]=point(2) of PathPave;
+ P[nbfaces]=point(3) of PathPave;
+ elseif substring(k,k+1) of p_="h":
+ nbcol:=nbcol+1;
+ PathPave:=(unitsquare xscaled Hauteur yscaled YEchelle) shifted ((nbcolonnes,nblignes));
+ Allume[NBLignes][NBColonnes]:=true;
+ nbfaces:=nbfaces+1;
+ C[nbfaces]=center PathPave;
+ M[nbfaces]=point(0) of PathPave;
+ N[nbfaces]=point(1) of PathPave;
+ O[nbfaces]=point(2) of PathPave;
+ P[nbfaces]=point(3) of PathPave;
+ elseif substring(k,k+1) of p_="p":
+ nbcol:=nbcol+1;
+ PathPave:=(unitsquare xscaled Profondeur yscaled YEchelle) shifted ((nbcolonnes,nblignes));
+ Allume[NBLignes][NBColonnes]:=true;
+ nbfaces:=nbfaces+1;
+ C[nbfaces]=center PathPave;
+ M[nbfaces]=point(0) of PathPave;
+ N[nbfaces]=point(1) of PathPave;
+ O[nbfaces]=point(2) of PathPave;
+ P[nbfaces]=point(3) of PathPave;
+ fi;
+ if (unknown Col[nbcol]):
+ else:
+ if Col[nbcol]=white:
+ else:
+ if AColorier=false:
+ fill PathPave withcolor Col[nbcol];
+ fi;
+ fi;
+ fi;
+ if nbfaces>0:
+ trace M[nbfaces]--P[nbfaces];
+ trace N[nbfaces]--O[nbfaces];
+ trace P[nbfaces]--O[nbfaces];
+ trace M[nbfaces]--N[nbfaces];
+ fi;
+ nbcolonnes:=nbcolonnes+DecalCol[k];
+ NBColonnes:=NBColonnes+1;
+ endfor;
+ endfor;
+ enddef;
+ %
+ vardef EffectuerTraces=
+ if Codes:
+ \useKV[ClesPatron]{Traces};
+ fi;
+ enddef;
+}%
+
+\def\MPPatronPave#1#2{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ \MPPatronPaveCode
+ n:=0;
+ for p_=#2:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ Col[n]=CoulDefaut;
+ fi;
+ endfor;
+ %
+ LectureLargeur(#1);
+ Allumage(#1);
+ if AColorier:
+ drawoptions(dashed evenly);
+ fi;
+ Patron(#1);
+ if AColorier:
+ drawoptions();
+ toto:=0;
+ for l=1 upto NBLignes:
+ for k=0 upto NBColonnes-1:
+ if Allume[l][k]:
+ toto:=toto+1;
+ % trait vertical gauche
+ if k=0:
+% trace M[toto]--P[toto];
+ tpoints:=floor(abs(M[toto]-P[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[M[toto],P[toto]])--((t/tpoints)[M[toto],P[toto]]+(2*unitvector(P[toto]-M[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l][k-1]=false:
+ % trace M[toto]--P[toto] dashed evenly;
+ tpoints:=floor(abs(M[toto]-P[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[M[toto],P[toto]])--((t/tpoints)[M[toto],P[toto]]+(2*unitvector(P[toto]-M[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+% % trait vertical droit
+ if k=Long-1:
+ % trace N[toto]--O[toto] dashed evenly;
+ tpoints:=floor(abs(N[toto]-O[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[N[toto],O[toto]])--((t/tpoints)[N[toto],O[toto]]+(2*unitvector(O[toto]-N[toto])) rotated 90);
+ endfor;
+ else:
+ if Allume[l][k+1]=false:
+ %% trace N[toto]--O[toto] dashed evenly;
+ tpoints:=floor(abs(N[toto]-O[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[N[toto],O[toto]])--((t/tpoints)[N[toto],O[toto]]+(2*unitvector(O[toto]-N[toto])) rotated 90);
+ endfor;
+ fi;
+ fi;
+% % trait horizontal haut
+ if l=1:
+ % trace P[toto]--O[toto] dashed evenly;
+ tpoints:=floor(abs(P[toto]-O[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[P[toto],O[toto]])--((t/tpoints)[P[toto],O[toto]]+(2*unitvector(O[toto]-P[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l-1][k]=false:
+ % trace P[toto]--O[toto] dashed evenly;
+ tpoints:=floor(abs(P[toto]-O[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[P[toto],O[toto]])--((t/tpoints)[P[toto],O[toto]]+(2*unitvector(O[toto]-P[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+% % trait horizontal bas
+ if l=NBLignes:
+ %% trace M[toto]--N[toto] dashed evenly;
+ tpoints:=floor(abs(M[toto]-N[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[M[toto],N[toto]])--((t/tpoints)[M[toto],N[toto]]+(2*unitvector(M[toto]-N[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l+1][k]=false:
+ %% trace M[toto]--N[toto] dashed evenly;
+ tpoints:=floor(abs(M[toto]-N[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[M[toto],N[toto]])--((t/tpoints)[M[toto],N[toto]]+(2*unitvector(M[toto]-N[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+ fi;
+ endfor;
+ endfor;
+ fi;
+ EffectuerTraces;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={\MPPatronPaveCode;}]
+ n:=0;
+ for p_=#2:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ Col[n]=CoulDefaut;
+ fi;
+ endfor;
+ %
+ LectureLargeur(#1);
+ Patron(#1);
+ EffectuerTraces;
+ \end{mpost}
+ \fi
+}%
+
\def\MPPatronCubeCode{%
Arete=\useKV[ClesPatron]{Arete};
%
@@ -181,6 +451,185 @@
color Col[],CoulDefaut;
CoulDefaut=white;
%
+ boolean Codes,Allume[][],AColorier;
+ Codes=\useKV[ClesPatron]{Codes};
+ AColorier=\useKV[ClesPatron]{AColorier};
+ if AColorier:
+ EcartColorier=\useKV[ClesPatron]{EcartColorier};
+ fi;
+ %
+ vardef Allumage(text t)=
+ nblignes:=-1;
+ for p_=t:
+ Long:=length p_;
+ nblignes:=nblignes+1;
+ for k=0 upto Long-1:
+ Allume[nblignes][k]=false;
+ endfor;
+ endfor;
+ enddef;
+ %
+ vardef Patron(text t)=
+ nblignes:=-1;
+ nbcol:=0;
+ nbfaces:=0;
+ for p_=t:
+ Long:=length p_;
+ nblignes:=nblignes+1;
+ nbcolonnes:=0;
+ for k=0 upto Long-1:
+ nbcolonnes:=nbcolonnes+1;
+ if substring(k,k+1) of p_="x":
+ Allume[nblignes][k]:=true;
+ nbfaces:=nbfaces+1;
+ nbcol:=nbcol+1;
+ if (unknown Col[nbcol]):
+ else:
+ if Col[nbcol]=white:
+ else:
+ if AColorier=false:
+ fill ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes))) withcolor Col[nbcol];
+ fi;
+ fi;
+ fi;
+ C[nbfaces]=(center unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes));
+ M[nbfaces]=point(0) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+ N[nbfaces]=point(1) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+ O[nbfaces]=point(2) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+ P[nbfaces]=point(3) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+ trace M[nbfaces]--P[nbfaces];
+ trace N[nbfaces]--O[nbfaces];
+ trace P[nbfaces]--O[nbfaces];
+ trace M[nbfaces]--N[nbfaces];
+ fi;
+ endfor;
+ endfor;
+ enddef;
+ %
+ vardef EffectuerTraces=
+ if Codes:
+ \useKV[ClesPatron]{Traces};
+ fi;
+ enddef;
+}%
+
+\def\MPPatronCube#1#2{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ \MPPatronCubeCode
+ %
+ n:=0;
+ for p_=#2:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ Col[n]=CoulDefaut;
+ fi;
+ endfor;
+ %
+ Allumage(#1);
+ if AColorier:
+ drawoptions(dashed withdots scaled 0.5);
+ fi;
+ Patron(#1);
+ if AColorier:
+ drawoptions();
+ toto:=0;
+ for l=0 upto nblignes:
+ for k=0 upto Long-1:
+ if Allume[l][k]:
+ toto:=toto+1;
+ % trait vertical gauche
+ if k=0:
+% trace M[toto]--P[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[M[toto],P[toto]])--((t/EcartColorier)[M[toto],P[toto]]+(2*unitvector(P[toto]-M[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l][k-1]=false:
+% trace M[toto]--P[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[M[toto],P[toto]])--((t/EcartColorier)[M[toto],P[toto]]+(2*unitvector(P[toto]-M[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+ % trait vertical droit
+ if k=Long-1:
+ % trace N[toto]--O[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[N[toto],O[toto]])--((t/EcartColorier)[N[toto],O[toto]]+(2*unitvector(O[toto]-N[toto])) rotated 90);
+ endfor;
+ else:
+ if Allume[l][k+1]=false:
+% trace N[toto]--O[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[N[toto],O[toto]])--((t/EcartColorier)[N[toto],O[toto]]+(2*unitvector(O[toto]-N[toto])) rotated 90);
+ endfor;
+ fi;
+ fi;
+ % trait horizontal haut
+ if l=0:
+% trace P[toto]--O[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[P[toto],O[toto]])--((t/EcartColorier)[P[toto],O[toto]]+(2*unitvector(O[toto]-P[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l-1][k]=false:
+% trace P[toto]--O[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[P[toto],O[toto]])--((t/EcartColorier)[P[toto],O[toto]]+(2*unitvector(O[toto]-P[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+ % trait horizontal bas
+ if l=nblignes:
+% trace M[toto]--N[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[M[toto],N[toto]])--((t/EcartColorier)[M[toto],N[toto]]+(2*unitvector(M[toto]-N[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l+1][k]=false:
+% trace M[toto]--N[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[M[toto],N[toto]])--((t/EcartColorier)[M[toto],N[toto]]+(2*unitvector(M[toto]-N[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+ fi;
+ endfor;
+ endfor;
+ fi;
+ EffectuerTraces;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={\MPPatronCubeCode;}]
+ %
+ n:=0;
+ for p_=#2:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ Col[n]=CoulDefaut;
+ fi;
+ endfor;
+ %
+ Patron(#1);
+ EffectuerTraces;
+ \end{mpost}
+ \fi
+}
+
+\def\MPPatronCubeCodeold{%
+ Arete=\useKV[ClesPatron]{Arete};
+ %
+ pair C[],M[],N[],O[],P[];
+ %
+ color Col[],CoulDefaut;
+ CoulDefaut=white;
+ %
boolean Codes;
Codes=\useKV[ClesPatron]{Codes};
vardef Patron(text t)=
@@ -221,7 +670,7 @@
enddef;
}%
-\def\MPPatronCube#1#2{%
+\def\MPPatronCubeold#1#2{%
\ifluatex
\mplibforcehmode
\begin{mplibcode}
@@ -259,7 +708,7 @@
\fi
}
-\def\MPPatronPaveCode{%
+\def\MPPatronPaveCodeold{%
Largeur=\useKV[ClesPatron]{Largeur};
Hauteur=\useKV[ClesPatron]{Hauteur};
Profondeur=\useKV[ClesPatron]{Profondeur};
@@ -330,7 +779,7 @@
for k=1 upto Long-1:
if substring(k,k+1) of p_="o":
if k=1:
- PathPave:=(unitsquare scaled 0);
+ PathPave:=(unitsquare scaled 0) shifted ((0,-1));
fi;
elseif substring(k,k+1) of p_="l":
nbcol:=nbcol+1;
@@ -380,7 +829,7 @@
enddef;
}%
-\def\MPPatronPave#1#2{%
+\def\MPPatronPaveold#1#2{%
\ifluatex
\mplibforcehmode
\begin{mplibcode}
@@ -397,7 +846,7 @@
%
LectureLargeur(#1);
Patron(#1);
- EffectuerTraces;
+ %EffectuerTraces;
\end{mplibcode}
\else
\begin{mpost}[mpsettings={\MPPatronPaveCode;}]
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPixelArt.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCPixelArt.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCPixelArt.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -26,9 +26,11 @@
}%
}%
}{%
- \quotient{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Hauteur}/\useKV[ClesPixelArt]{HauteurD}}}%
- \modulo{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Hauteur}/\useKV[ClesPixelArt]{HauteurD}}}%
-% quotient = \the\intquotient -- remainder = \the\remainder :
+% \quotient{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Hauteur}/\useKV[ClesPixelArt]{HauteurD}}}%
+% \modulo{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Hauteur}/\useKV[ClesPixelArt]{HauteurD}}}%
+ \quotient{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Largeur}/\useKV[ClesPixelArt]{LargeurD}}}%
+ \modulo{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Largeur}/\useKV[ClesPixelArt]{LargeurD}}}%
+% quotient = \the\intquotient -- remainder = \the\remainder :\\
\BuildPixelArtGeant{#2}{\useKV[ClesPixelArt]{Lettres}}{\ListeAvantCouleurs}{\the\toklistePANombre}{\the\intquotient}{\the\remainder}%
}%
}{%
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCProbaFrequence.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCProbaFrequence.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCProbaFrequence.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -0,0 +1,185 @@
+%%%
+% Probabilité et fréquence
+%%%
+\setKVdefault[PfCFrequence]{Couleur=false,Lancers=1,Legende=false}%
+\defKV[PfCFrequence]{ListeCouleurs=\setKV[PfCFrequence]{Couleur}}%
+\defKV[PfCFrequence]{Legendes=\setKV[PfCFrequence]{Legende}\setsepchar{,}\reademptyitems\readlist*\PfMListeLegendes{#1}\reademptyitems}%
+
+\newtoks\tokPfMListeObjets%
+\newtoks\tokPfMListeLegendes%
+\def\UpdatetoksObj#1\nil{\addtotok\tokPfMListeObjets{#1,}}%
+\def\UpdatetoksLegendes#1\nil{\addtotok\tokPfMListeLegendes{"#1",}}%
+
+\NewDocumentCommand\ProbaFrequence{om}{%
+ % #1 options
+ % #2 répartition
+ \tokPfMListeObjets{}%
+ \tokPfMListeLegendes{}%
+ \useKVdefault[PfCFrequence]%
+ \setKV[PfCFrequence]{#1}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\PfMListeObjets{#2}%
+ \reademptyitems%
+ \foreachitem\compteur\in\PfMListeObjets{\expandafter\UpdatetoksObj\compteur\nil}%
+ \ifboolKV[PfCFrequence]{Legende}{%
+ \foreachitem\compteur\in\PfMListeLegendes{\expandafter\UpdatetoksLegendes\compteur\nil}%
+ }{}%
+ \BuildFrequence{\the\tokPfMListeObjets}{\the\tokPfMListeLegendes}%
+}%
+
+\NewDocumentCommand\BuildFrequence{mm}{%
+ \ifluatex
+ \mplibnumbersystem{decimal}%
+ \begin{Geometrie}[CoinBG={u*(-5,0)},CoinHD={u*(7.5,7.5)}]%6 en ordonnee
+ Lancers = \useKV[PfCFrequence]{Lancers};
+ LegendeVide=0;
+ %
+ color Col[];
+ if \useKV[PfCFrequence]{Couleur}:
+ n:=0;
+ for p_=\useKV[PfCFrequence]{ListeCouleurs}:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ LegendeVide:=n;
+ fi;
+ endfor;
+ fi;
+ %
+ string Legende[];
+ vardef EcrireLegendes(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ if p_="":
+ LegendeVide:=n;
+ else:
+ Legende[n]=p_;
+ fi;
+ endfor;
+ n:=0;
+ enddef;
+ %
+ vardef LectureDonnees(text t)=
+ numeric A[];
+ numeric SommeTotale;
+ SommeTotale=0;
+ n:=0;
+ for p_=t:
+ n:=incr(n);
+ A[n]=p_;
+ SommeTotale:=SommeTotale+p_;
+ endfor;
+ total:=n;
+ enddef;
+ %
+ LectureDonnees(#1);
+ if \useKV[PfCFrequence]{Legende}:
+ EcrireLegendes(#2);
+ fi;
+ %
+ numeric borne[];
+ borne0=0;
+ for k=1 upto total:
+ borne[k]=borne[k-1]+A[k];
+ endfor;
+ %
+ x.u:=5mm;
+ y.u:=5mm;
+ quad.u:=5mm;
+ unites(1/(170*Lancers),5);
+ origine((1,4));
+ % grille
+ for k=1 upto 11:
+ draw (pp(0,0)--pp(0,1.1)) shifted(pp(k*Lancers*100,0)-pp(0,0)) withcolor gris;
+ draw (pp(0,0)--pp(Lancers*(1000+100),0)) shifted(pp(0,k/10)-pp(0,0)) withcolor gris;
+ endfor;
+ % axe
+ drawarrow pp(0,0)--pp(0,1.1);
+ drawarrow pp(0,0)--pp(Lancers*(1000+100),0);
+ % tiret
+ for k=1 upto 10:
+ draw (pp(k*Lancers*100,0)+u*(0,-0.05))--(pp(k*Lancers*100,0)+u*(0,0.05));
+ endfor;
+ numeric nb[],freq[];
+ pair Freq[][];
+ for k=1 upto total:
+ nb[k]:=0;
+ freq[k]=0;
+ endfor;
+ %
+ for k=1 upto (Lancers*1000):
+ nn:=floor(uniformdeviate(SommeTotale))+1;
+ if nn=0:
+ message("il est nul...");
+ fi;
+ for l=1 upto total:
+ if (nn>borne[l-1]) and (nn<borne[l]+1):
+ nb[l]:=nb[l]+1;
+ fi;
+ freq[l]:=nb[l]/k;
+ Freq[l][k]=pp(k,freq[l]);
+ endfor;
+ endfor;
+ %
+ def Style=enddef;
+ def Stylea=dashed evenly enddef;
+ def Styleb=dashed withdots scaled 1/2 enddef;
+ def Stylec=dashed dashpattern(on 1 off 1) enddef;
+ def Styled=dashed withdots scaled 1/4 enddef;
+ def Stylee=dashed dashpattern(on 6 off2) enddef;
+ parc:=0;
+ for l=1 upto total:
+ if \useKV[PfCFrequence]{Couleur}=false:
+ if (l mod 6)=1:
+ elseif (l mod 6)=2:
+ drawoptions(Stylea);
+ elseif (l mod 6)=3:
+ drawoptions(Styleb);
+ elseif (l mod 6)=4:
+ drawoptions(Stylec);
+ elseif (l mod 6)=5:
+ drawoptions(Styled);
+ else:
+ drawoptions(Stylee);
+ fi;
+ if \useKV[PfCFrequence]{Legende}:
+ parc:=incr(parc);
+ if l<>LegendeVide:
+ draw pp(Lancers*400*((parc-1) mod 3),-0.25-0.1*((parc-1) div 3))--pp(Lancers*400*((parc-1) mod 3)+125,-0.25-0.1*((parc-1) div 3));
+ label.rt(TEX(Legende[l]),pp(Lancers*400*((parc-1) mod 3)+125,-0.25-0.1*((parc-1) div 3)));
+ else:
+ parc:=parc-1;
+ fi;
+ fi;
+ fi;
+ %
+ if l<>LegendeVide:
+ if Lancers<1:
+ trace Freq[l][1]
+ for k=2 upto (1000*Lancers):
+ --Freq[l][k]
+ endfor withcolor if unknown Col[l]:black else:Col[l] fi;
+ else:
+ trace Freq[l][1]
+ for k=5 step 4 until (1000*Lancers):
+ --Freq[l][k]
+ endfor withcolor if unknown Col[l]:black else:Col[l] fi;
+ fi;
+ fi;
+ endfor;
+ drawoptions();
+ for k=1 upto 10 :
+ label.bot(TEX("\scriptsize\num{"&decimal((100*k)*Lancers)&"}"),pp(Lancers*100k,0));
+ endfor;
+ for k=2 step 2 until 10:
+ label.lft(TEX("\scriptsize\num{"&decimal(k/10)&"}"),pp(0,k/10));
+ endfor;
+ label.llft(TEX("\scriptsize 0"),pp(0,0));
+ label.urt(TEX("Fréquence"),pp(0,1));
+ label.bot(TEX("Nombre de lancers"),pp(0.5*Lancers*(1000+200),-0.075));
+ \end{Geometrie}
+ \mplibnumbersystem{scaled}
+ \fi
+}%
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCProbaFrequence.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCQuestionsRelier.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCQuestionsRelier.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCQuestionsRelier.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -4,6 +4,9 @@
\setKVdefault[ClesRelie]{Solution=false,LargeurG=5cm,LargeurD=2cm,Stretch=1.5,Ecart=2cm,Couleur=black}%
\defKV[ClesRelie]{Graine=\PfCGraineAlea{#1}}%
+\newcounter{NbRelie}%
+\newcounter{NbRelieD}
+
\NewDocumentCommand\Relie{som}{%
\useKVdefault[ClesRelie]%
\setKV[ClesRelie]{#2}%
@@ -33,7 +36,13 @@
\itemtomacro\ListeRelie[##1,1]\untest%
\ifx\bla\untest\bla%
\else%
- \tikz[remember picture,overlay]{\draw[PfCRelieCouleurTrace] (RelieG-##1) -- (RelieD-\ListeRelie[##1,3]);}%
+ \itemtomacro\ListeRelie[##1,3]\Foo
+ \setsepchar{-}\ignoreemptyitems%
+ \readlist*\ListeRelieReponses{\Foo}%
+ \reademptyitems
+ \foreachitem\compteur\in\ListeRelieReponses{%
+ \tikz[remember picture,overlay]{\draw[PfCRelieCouleurTrace] (RelieG-##1) -- (RelieD-\ListeRelieReponses[\compteurcnt]);}%
+ }
\fi
}%
}{%
@@ -41,36 +50,14 @@
}%
}%
-\newcommand\Relieold[2][]{%
- \useKVdefault[ClesRelie]%
- \setKV[ClesRelie]{#1}%
- \setsepchar[*]{,*/}\reademptyitems%
- \readlist*\ListeRelie{#2}%
- \ignoreemptyitems
- \buildtabrelie%
- \ifboolKV[ClesRelie]{Solution}{%
- \colorlet{PfCRelieCouleurTrace}{\useKV[ClesRelie]{Couleur}}%
- \xintFor* ##1 in {\xintSeq {1}{\ListeRelielen}}\do{%
- \itemtomacro\ListeRelie[##1,1]\untest
- \ifx\bla\untest\bla%
- \else
- \tikz[remember picture,overlay]{\draw[PfCRelieCouleurTrace] (RelieG-##1) -- (RelieD-\ListeRelie[##1,3]);}%
- \fi
- }%
- }{%
- }%
-}%
-
-\newcounter{NbRelie}%
-
\def\buildtabrelie{%
\setcounter{NbRelie}{0}%
+ \setcounter{NbRelieD}{0}%
\renewcommand{\arraystretch}{\useKV[ClesRelie]{Stretch}}%
- \begin{tabular}{p{\useKV[ClesRelie]{LargeurG}}cp{\useKV[ClesRelie]{Ecart}}>{\tikz[remember
- picture]{\node[name=RelieD-\theNbRelie,inner
- sep=0pt]{};\fill[] (RelieD-\theNbRelie) circle[radius=1.5pt]}}cp{\useKV[ClesRelie]{LargeurD}}}%
- \xintFor* ##1 in {\xintSeq {1}{\ListeRelielen}}\do{\ListeRelie[##1,1]\itemtomacro\ListeRelie[##1,1]\untest%
-\ifx\bla\untest\bla%
+ \begin{tabular}{p{\useKV[ClesRelie]{LargeurG}}cp{\useKV[ClesRelie]{Ecart}}cp{\useKV[ClesRelie]{LargeurD}}}%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeRelielen}}\do{%
+ \ListeRelie[##1,1]\itemtomacro\ListeRelie[##1,1]\untest%
+ \ifx\bla\untest\bla%
\uppercase{&}\stepcounter{NbRelie}%
\else
\uppercase{&}\stepcounter{NbRelie}\tikz[remember
@@ -77,13 +64,25 @@
picture,overlay]{\node[name=RelieG-\theNbRelie,inner
sep=0pt]{};\fill[]
(RelieG-\theNbRelie) circle[radius=1.5pt];}
-\fi&&&\ListeRelie[##1,2]\\}%
+ \fi&&
+ \itemtomacro\ListeRelie[##1,2]\untest
+ \ifx\bla\untest\bla\else\stepcounter{NbRelieD}\tikz[remember
+ picture]{\node[name=RelieD-\theNbRelieD,inner
+ sep=0pt]{};\fill[] (RelieD-\theNbRelieD) circle[radius=1.5pt]}
+ \fi
+ &\itemtomacro\ListeRelie[##1,2]\untest%
+ \ifx\bla\untest\bla
+ \else
+ \ListeRelie[##1,2]
+ \fi\\}%
\end{tabular}%
- \setcounter{NbRelie}{0}%
+ %\setcounter{NbRelie}{0}%
+ %\setcounter{NbRelieD}{0}%
}%
\def\buildtabrelieauto{%
\setcounter{NbRelie}{0}%
+ \setcounter{NbRelieD}{0}%
\xdef\PfCFooListeNbQ{1}%
\xintFor* ##1 in{\xintSeq{2}{\ListeRelielen}}\do{%
\xdef\PfCFooListeNbQ{\PfCFooListeNbQ,##1}%
@@ -110,4 +109,5 @@
\fi&&&\itemtomacro\PfCListeReponsesMelangees[##1]\PfCNumReponses\ListeRelie[\PfCNumReponses,2]\\}%
\end{tabular}%
\setcounter{NbRelie}{0}%
-}%
\ No newline at end of file
+}%
+
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCSolides.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCSolides.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCSolides.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -1,11 +1,118 @@
%%%
% Solide et sections
%%%
-\setKVdefault[ClesSolides]{Nom=cube,Aretes,Sommets,Pointilles,Largeur=1.5,Hauteur=1,Profondeur=0.75,ListeSommets={A,B,C,D,E,F,G,H},Rho=1500,Phi=30,Theta=20,Distance=50,Code=false,Couleur=white,Anglex=0,RayonCone=1,HauteurCone=2,HauteurPyramide=2,SommetsPyramide=5,Reguliere=false,DecalageSommet={(0,0,0)},RayonCylindre=1,HauteurCylindre=2,RayonSphere=1,AutoLabel=true,Sections=false,CoefSection=0.3,Axes=false,PointsSection={M,N,O,P},RemplisSection=false,ObjetSection={0.5,E,H,0.25,F,G,G,B}}%
+\setKVdefault[ClesSolides]{Nom=cube,Aretes,Sommets,Pointilles,Largeur=1.5,Hauteur=1,Profondeur=0.75,ListeSommets={A,B,C,D,E,F,G,H},Rho=1500,Phi=30,Theta=20,Distance=50,Code=false,Couleur=white,Anglex=0,Arete=1,RayonCone=1,HauteurCone=2,HauteurPrisme=2,SommetsPrisme=6,HauteurPyramide=2,SommetsPyramide=5,Reguliere=false,DecalageSommet={(0,0,0)},RayonCylindre=1,HauteurCylindre=2,RayonSphere=1,AutoLabel=true,Sections=false,CoefSection=0.3,Axes=false,PointsSection={M,N,O,P},RemplisSection=false,ObjetSection={0.5,E,H,0.25,F,G,G,B}}%
\defKV[ClesSolides]{Traces=\setKV[ClesSolides]{Code}}%
\defKV[ClesSolides]{Section=\setKV[ClesSolides]{Sections}}%
\defKV[ClesSolides]{CouleurSection=\setKV[ClesSolides]{RemplisSection}}%
+\newcommand\MPSolidePrisme[4]{%
+ \ifluatex
+ \mplibnumbersystem{double}
+ \mplibforcehmode
+ \begin{mplibcode}
+ input PfCSolid;
+
+ boolean Pointilles,TraceArete,NommeSommets,Code,AutoLabel,Sections,RemplisSection;
+ AutoLabel:=\useKV[ClesSolides]{AutoLabel};
+ Pointilles=\useKV[ClesSolides]{Pointilles};
+ TraceArete=\useKV[ClesSolides]{Aretes};
+ NommeSommets=\useKV[ClesSolides]{Sommets};
+ Code=\useKV[ClesSolides]{Code};
+ Sections:=\useKV[ClesSolides]{Sections};
+ RemplisSection=\useKV[ClesSolides]{RemplisSection};
+ if RemplisSection:color CouleurSection;CouleurSection=\useKV[ClesSolides]{CouleurSection};fi;
+
+ color PfCOutColor;
+ PfCOutColor=Cornsilk;%\useKV[ClesSolides]{Couleur};
+
+ string Section;
+ if Sections:Section=\useKV[ClesSolides]{Section};fi;
+
+ %Initialisation
+ PfCRho=\useKV[ClesSolides]{Rho};
+ PfCPhi=\useKV[ClesSolides]{Phi};
+ PfCTheta=\useKV[ClesSolides]{Theta};
+ PfCDistance=\useKV[ClesSolides]{Distance};
+ anglerotationx=\useKV[ClesSolides]{Anglex};
+ hauteurprisme=\useKV[ClesSolides]{HauteurPrisme};
+ nombresommets=\useKV[ClesSolides]{SommetsPrisme};
+ Initialisation(PfCRho,PfCPhi,PfCTheta,PfCDistance);
+ typetrace:="3D";
+ typerepre:="persp";
+ eclairage:=false;
+ incolor:=white;
+ outcolor:=white;
+ if Pointilles=false:
+ pointilles:="non";
+ fi;
+
+ Ferme1:=true;
+
+ color A,B,C,D,E,F,G,H;
+ color Sommet[];
+
+ NbS:=nombresommets;
+
+ color TS[];
+
+ ecartangle=360/(NbS/2);
+ for k=1 upto (NbS/2):
+ repereangle:=(k-2)*ecartangle+(ecartangle*0.25+uniformdeviate(floor(ecartangle/2)));
+ TS[k]:=(cosd(repereangle),-sind(repereangle),0);
+ endfor;
+ TS[NbS/2+1]:=TS[1];
+
+ for k=1 upto (NbS/2):
+ TS[NbS/2+1+k]:=TS[k]+(0,0,hauteurprisme);
+ endfor;
+ TS[NbS+2]:=TS[NbS/2+2];
+
+ angx:=anglerotationx;
+ for k=1 upto (NbS+2):
+ TS[k]:=RotXYZ(TS[k]);
+ endfor;
+ angx:=0;
+
+ ObjetNew1(%
+ TS1, for k=2 upto (NbS+1):TS[k], endfor TS[NbS+2]
+ )(%
+ NbS/2, for p_=1 upto NbS/2:p_, endfor
+ NbS/2, for p_=NbS/2+1 downto NbS+2:p_, endfor
+ for p=1 upto NbS/2:
+ 4,p,p+1,NbS/2+1+p+1,NbS/2+1+p,%
+ endfor
+ );
+ %AffichageObjet1;
+
+ NF:=(NbS/2+2);
+ Fc[100*(NbS/2+1)]:=NbS/2;
+ for k=1 upto NbS/2:
+ Fc[100*(NbS/2+1)+k]:=k;
+ endfor;
+ Fc[100*(NbS/2+2)]:=NbS/2;
+ for k=1 upto NbS/2:
+ Fc[100*(NbS/2+2)+k]:=NbS+2-k;
+ endfor;
+ for l=1 upto NbS/2:
+ Fc[l*100]:=4;
+ %for k=1 upto 4:
+ Fc[l*100+1]:=l;Fc[l*100+4]:=l+1;Fc[l*100+3]:=NbS/2+1+l+1;Fc[l*100+2]:=NbS/2+1+l;
+ %Fc[101]:=1;Fc[102]:=2;Fc[103]:=6;Fc[104]:=5;
+ %endfor;
+ endfor;
+ DessineObjet;
+% picture Depart;
+% Depart=currentpicture;
+% currentpicture:=nullpicture;
+% for k=1 upto 8:
+% dotlabel.top(decimal(k),Projette(TS[k]));
+% endfor;
+ \end{mplibcode}
+ \mplibnumbersystem{scaled}
+ \fi
+}
+
\newcommand\MPSolideCylindre[3]{%
\ifluatex
\mplibnumbersystem{double}
@@ -927,7 +1034,7 @@
\foreachitem\compteur\in\ListeNomSommet{\expandafter\UpdatetoksSolide\compteur\nil}%\the\toksolidelistesommets%
\IfStrEqCase{\useKV[ClesSolides]{Nom}}{%
{cube}{%
- \MPSolidePave{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{1,1,1}{\useKV[ClesSolides]{PointsSection}}{\useKV[ClesSolides]{ObjetSection}}%
+ \MPSolidePave{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{\useKV[ClesSolides]{Arete},\useKV[ClesSolides]{Arete},\useKV[ClesSolides]{Arete}}{\useKV[ClesSolides]{PointsSection}}{\useKV[ClesSolides]{ObjetSection}}%
}%
{pave}{%
\MPSolidePave{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{\useKV[ClesSolides]{Profondeur},\useKV[ClesSolides]{Largeur},\useKV[ClesSolides]{Hauteur}}{\useKV[ClesSolides]{PointsSection}}{\useKV[ClesSolides]{ObjetSection}}%
@@ -935,6 +1042,9 @@
{cone}{%
\MPSolideCone{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{\useKV[ClesSolides]{PointsSection}}%
}%
+ {prisme}{%
+ \MPSolidePrisme{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{}{\useKV[ClesSolides]{PointsSection}}%
+ }%
{pyramide}{%
\MPSolidePyramide{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{\useKV[ClesSolides]{DecalageSommet}}{\useKV[ClesSolides]{PointsSection}}%
}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCTortueBase.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCTortueBase.tex 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCTortueBase.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -18,9 +18,10 @@
Axes=false,%Affichage des axes ou pas
Origine={(0,0)},%Origine des axes
Cases=false,%Se déplace-t-on sur des cases ?
+ Trace=false%
}
\defKV[Tortue]{Etape=\setKV[Tortue]{Etapes}}%choix de l'étape d'arrêt
-
+\defKV[Tortue]{Traces=\setKV[Tortue]{Trace}}%
\newcounter{PfCTortue}
\setcounter{PfCTortue}{0}
@@ -178,6 +179,9 @@
\ifboolKV[Tortue]{Etapes}{%
\immediate\write\turtle at out{drawoptions(withcolor DarkGreen);label(btex \noexpand\Large\noexpand\ding{40} etex rotated RetiensAngle[Total] scaled 1.5,A[Total]);}%
}{\ifboolKV[Tortue]{TortueF}{\immediate\write\turtle at out{drawoptions(withcolor DarkGreen);label(btex \noexpand\Large\noexpand\ding{40} etex rotated RetiensAngle[k] scaled 1.5,A[k]);}}{}}%
+ \ifboolKV[Tortue]{Trace}{%
+ \immediate\write\turtle at out{\useKV[Tortue]{Traces}}%
+ }{}%
\immediate\closeout\turtle at out%
\restorecomparemode%
}%
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCUrneProba.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCUrneProba.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCUrneProba.tex 2024-07-04 20:28:16 UTC (rev 71706)
@@ -0,0 +1,928 @@
+%%%
+% Urne et probabilités
+%%%
+\newtoks\tokUrneListeCouleurs%
+\newtoks\tokUrneListeColonnes%
+\newtoks\tokUrneListeNombres%
+
+\def\UpdatetoksUrneCouleurs#1\nil{\addtotok\tokUrneListeCouleurs{#1,}}%
+\def\UpdatetoksUrneNombres#1\nil{\addtotok\tokUrneListeNombres{"#1",}}%
+\def\UpdatetoksUrneColonnes#1\nil{\addtotok\tokUrneListeColonnes{"#1",}}%
+
+\setKVdefault[PfCUrne]{Couleurs=false,Nombres=false,Pas=4,Echelle=1,Repartition={1,2,3},Double=false,RepartitionC={1,2,3},RepartitionN={1,2,3},Roue=false,Rayon=3,Tableau=false,SansRemise=false,Solution=false,Codes=false,CouleurLigne=0.85white,CouleurColonne=0.85white,Different=false,RepartitionLigne={1,2,3},RepartitionColonne={1,2,3},Impression,Casino=false}%
+\defKV[PfCUrne]{Traces=\setKV[PfCUrne]{Codes}}%
+\defKV[PfCUrne]{ListeCouleurs=\setKV[PfCUrne]{Couleurs}\setsepchar{,}\ignoreemptyitems\readlist*\ListeCouleursAv{#1}\reademptyitems}%
+\defKV[PfCUrne]{ListeNombres=\setKV[PfCUrne]{Nombres}\setsepchar{,}\ignoreemptyitems\readlist*\ListeNombresAv{#1}\reademptyitems}%
+\defKV[PfCUrne]{ListeColonne=\setsepchar{,}\ignoreemptyitems\readlist*\ListeCouleursAv{#1}\reademptyitems}%
+\defKV[PfCUrne]{ListeLigne=\setsepchar{,}\ignoreemptyitems\readlist*\ListeNombresAv{#1}\reademptyitems}%
+
+\NewDocumentCommand\BuildRoulette{}{%
+ \ifluatex
+ \begin{Geometrie}[Cadre="aucun"]
+ u:=\useKV[PfCUrne]{Echelle}*1cm;
+
+ color colzero,colrouge,coltoura,coltourb,colbarre;
+
+ boolean Impression;
+ Impression=\useKV[PfCUrne]{Impression};
+
+ if Impression=false:
+ colzero=green;
+ colrouge=red;
+ coltoura=(179,103,0)/256;
+ coltourb=(179,111,48)/256;%(184,114,50)/256;
+ colbarre=0.7529white;
+ else:
+ colzero=white;
+ colrouge=white;
+ coltoura=black;
+ coltourb=black;
+ colbarre=black;
+ fi;
+ pair O,A[],B[],C[],D[];
+ path cc[];
+ O=(0,0);
+ cc1=cercles(O,2u);
+ cc2=cercles(O,2.75u);
+ cc3=cercles(O,3.5u);
+ cc4=cercles(O,3.7u);
+ cc5=cercles(O,4u);
+ cc6=cercles(O,3.125u);
+ cc7=cercles(O,2.375u);
+ if Impression=false:
+ fill cc5 withcolor coltoura;
+ fill cc4 withcolor coltourb;
+ fill cc1 withcolor coltoura;
+ trace cc1 withpen pencircle scaled 1.05;
+ trace cc5 withpen pencircle scaled 1.05;
+ trace cc4 withpen pencircle scaled 1.05;
+ trace cc3 withpen pencircle scaled 1.05;
+ else:
+ fill cc5;
+ fill cc4 withcolor white;
+ trace cc1;
+ trace cc3;
+ fi;
+ for k=0 upto 38:
+ A[k]=pointarc(cc3,90-k*(360/37));
+ B[k]=pointarc(cc1,90-k*(360/37));
+ endfor;
+ na:=1;
+ for p_=32,15,19,4,21,2,25,17,34,6,27,13,36,11,30,8,23,10,5,24,16,33,1,20,14,31,9,22,18,29,7,28,12,35,3,26,0:
+ if (na mod 2)=0:
+ fill arccercle(A[na],A[na-1],O)--B[na-1]--reverse(arccercle(B[na],B[na-1],O))--cycle;
+ drawoptions(withcolor white);
+ label(TEX("\textbf{"&decimal(p_)&"}") rotated (-na*(360/37)),pointarc(cc6,90+0.5*(360/37)-na*(360/37)));
+ drawoptions();
+ else:
+ if p_=0:
+ fill arccercle(A[na],A[na-1],O)--B[na-1]--reverse(arccercle(B[na],B[na-1],O))--cycle withcolor colzero;
+ else:
+ fill arccercle(A[na],A[na-1],O)--B[na-1]--reverse(arccercle(B[na],B[na-1],O))--cycle withcolor colrouge;
+ fi;
+ if Impression=false:
+ drawoptions(withcolor white);
+ fi;
+ label(TEX("\textbf{"&decimal(p_)&"}") rotated (-na*(360/37)),pointarc(cc6,90+0.5*(360/37)-na*(360/37)));
+ if Impression=false:
+ drawoptions();
+ fi;
+ fi;
+ trace arccercle(A[na],A[na-1],O)--B[na-1]--reverse(arccercle(B[na],B[na-1],O))--cycle;
+ na:=na+1;
+ endfor;
+ trace cc2;
+ fill cercles(pointarc(cc7,90+0.5*(360/37)),0.125u);%dotlabel("",);
+ % barre
+ cc8=cercles(O,1.5u);
+ cc9=cercles(O,0.25u);
+ fill cc9 withcolor colbarre;
+ pair E[];
+ anglebase=floor(uniformdeviate(360));
+ E1=pointarc(cc8,anglebase);
+ E4=pointarc(cc8,anglebase+6);
+ E3=symetrie(E1,O);
+ E2=symetrie(E4,O);
+ E5=pointarc(cc8,anglebase+90);
+ E8=pointarc(cc8,anglebase+6+90);
+ E7=symetrie(E5,O);
+ E6=symetrie(E8,O);
+ fill polygone(E1,E2,E3,E4) withcolor colbarre;
+ fill polygone(E5,E6,E7,E8) withcolor colbarre;
+ pair F[];
+ F1=(E1--iso(E1,E2)) intersectionpoint cc9;
+ F2=(E4--iso(E3,E4)) intersectionpoint cc9;
+ F3=(E5--iso(E6,E5)) intersectionpoint cc9;
+ F4=(E8--iso(E7,E8)) intersectionpoint cc9;
+ F5=(E3--iso(E4,E3)) intersectionpoint cc9;
+ F6=(E2--iso(E2,E1)) intersectionpoint cc9;
+ F7=(E7--iso(E8,E7)) intersectionpoint cc9;
+ F8=(E6--iso(E6,E5)) intersectionpoint cc9;
+ trace E1--E4--F2--arccercle(F2,F3,O)--E5--E8--F4--arccercle(F4,F5,O)--E3--E2--F6--arccercle(F6,F7,O)--E7--E6--F8--arccercle(F8,F1,O)--cycle;
+ \end{Geometrie}
+ \fi
+}%
+
+\NewDocumentCommand\BuildTableauDoubleEntreeDifferent{mmmm}{%
+ % #1 : les labels en colonne
+ % #2 : les labels en ligne
+ % #3 : la répartition en colonne
+ % #4 : la répartition en ligne
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ u:=\useKV[PfCUrne]{Echelle}*1cm;
+ numeric RetiensNumC[],RetiensNumL[];
+ %
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNumL[n]=p_;
+ n:=n+1;
+ endfor;
+ totallignes=n;
+ enddef;
+ %
+ vardef RecupRepartitionC(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNumC[n]=p_;
+ n:=n+1;
+ endfor;
+ totalcolonnes=n;
+ enddef;
+ %
+ string Colonnes[];
+ vardef RecuperationColonnes(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Colonnes[n]=p_;
+ endfor;
+ enddef;
+ %
+ string Lignes[];
+ vardef RecuperationLignes(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Lignes[n]=p_;
+ endfor;
+ enddef;
+ %
+ boolean Solution, Codes;
+ Solution=\useKV[PfCUrne]{Solution};
+ Codes=\useKV[PfCUrne]{Codes};
+ %
+ color ColLigne,ColColonne;
+ ColLigne=\useKV[PfCUrne]{CouleurLigne};
+ ColColonne=\useKV[PfCUrne]{CouleurColonne};
+ %
+ RecupRepartitionC(#3);
+ RecupRepartition(#4);
+ RecuperationColonnes(#1);
+ RecuperationLignes(#2);
+
+ pair A[][],C[][];
+ for k=0 upto totallignes+1:
+ for l=0 upto totalcolonnes+1:
+ A[k][l]=(0,0) shifted(u*(l,-k));
+ C[k][l]=A[k][l] shifted(u*(0.5,-0.5));
+ endfor;
+ endfor;
+
+ fill polygone(A[0][1],A[0][totalcolonnes+1],A[1][totalcolonnes+1],A[1][1]) withcolor ColLigne;
+ fill polygone(A[1][0],A[totallignes+1][0],A[totallignes+1][1],A[1][1]) withcolor ColColonne;
+ for k=1 upto totalcolonnes:
+ label(TEX(Colonnes[RetiensNumC[k-1]]),iso(A[1][k],A[0][k+1]));
+ endfor;
+ for k=1 upto totallignes:
+ label(TEX(Lignes[RetiensNumL[k-1]]),iso(A[k][0],A[k+1][1]));
+ endfor;
+ %
+ for k=1 upto totallignes:
+ trace segment(A[k][0],A[k][totalcolonnes+1]);
+ endfor;
+ for k=1 upto totalcolonnes:
+ trace segment(A[0][k],A[totallignes+1][k]);
+ endfor;
+ trace A[1][0]--A[totallignes+1][0]--A[totallignes+1][totalcolonnes+1]--A[0][totalcolonnes+1]--A[0][1];
+ labeloffset:=labeloffset*4;
+ label.top(TEX("Tirage 1"),iso(A[0][1],A[0][totalcolonnes+1]));
+ label.lft(TEX("Tirage 2") rotated 90,iso(A[totallignes+1][0],A[1][0]));
+ labeloffset:=labeloffset/4;
+
+ path ccsol[][];
+
+ if Solution:
+ for k=1 upto totallignes:
+ for l=1 upto totalcolonnes:
+ label(TEX(Colonnes[RetiensNumC[l-1]]&"--"&Lignes[RetiensNumL[k-1]]),iso(A[k][l],A[k+1][l+1]));
+ endfor;
+ endfor;
+ fi;
+
+ if Codes:
+ \useKV[PfCUrne]{Traces};
+ fi;
+ \end{mplibcode}
+ \fi
+}%
+
+\NewDocumentCommand\BuildTableauDoubleEntree{mmm}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ u:=\useKV[PfCUrne]{Echelle}*1cm;
+ numeric RetiensNum[];
+ %
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNum[n]=p_;
+ n:=n+1;
+ endfor;
+ totalboules=n;
+ enddef;
+ %
+ color Col[];
+ vardef RecuperationCouleurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+ %
+ string Nombres[];
+ vardef RecuperationNombres(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Nombres[n]=p_;
+ endfor;
+ enddef;
+ %
+ numeric Pas,Rayon;
+ Pas=\useKV[PfCUrne]{Pas};
+ Rayon=\useKV[PfCUrne]{Rayon};
+ %
+ boolean Couleurs, Nombres, Roue, Solution, SansRemise, Codes;
+ Couleurs=\useKV[PfCUrne]{Couleurs};
+ Nombres=\useKV[PfCUrne]{Nombres};
+ Roue=\useKV[PfCUrne]{Roue};
+ Solution=\useKV[PfCUrne]{Solution};
+ SansRemise=\useKV[PfCUrne]{SansRemise};
+ Codes=\useKV[PfCUrne]{Codes};
+
+ color ColLigne,ColColonne;
+ ColLigne=\useKV[PfCUrne]{CouleurLigne};
+ ColColonne=\useKV[PfCUrne]{CouleurColonne};
+
+ RecupRepartition(#3);
+ if Couleurs:
+ RecuperationCouleurs(#1);
+ fi;
+ if Nombres:
+ RecuperationNombres(#2);
+ fi;
+
+ pair O;
+ pair A[][],C[][];
+ for k=0 upto totalboules+1:
+ for l=0 upto totalboules+1:
+ A[k][l]:=(0,0) shifted(u*(l,-k));
+ endfor;
+ endfor;
+
+ for k=0 upto totalboules:
+ for l=0 upto totalboules:
+ C[k][l]=A[k][l] shifted(u*(0.5,-0.5));
+ endfor;
+ endfor;
+
+ if Couleurs:
+ drawoptions(withpen pencircle scaled 0.75);
+ for k=1 upto totalboules:
+ fill cercles(iso(A[1][k],A[0][k+1]),0.35u) withcolor Col[RetiensNum[k-1]];
+ fill cercles(iso(A[k][0],A[k+1][1]),0.35u) withcolor Col[RetiensNum[k-1]];
+ trace cercles(iso(A[1][k],A[0][k+1]),0.35u);
+ trace cercles(iso(A[k][0],A[k+1][1]),0.35u);
+ endfor;
+ drawoptions();
+ else:
+ fill polygone(A[0][1],A[0][totalboules+1],A[1][totalboules+1],A[1][1]) withcolor ColLigne;
+ fill polygone(A[1][0],A[totalboules+1][0],A[totalboules+1][1],A[1][1]) withcolor ColColonne;
+ for k=1 upto totalboules:
+ label(TEX(Nombres[RetiensNum[k-1]]),iso(A[1][k],A[0][k+1]));
+ label(TEX(Nombres[RetiensNum[k-1]]),iso(A[k][0],A[k+1][1]));
+ endfor;
+ fi;
+ if SansRemise:
+ for k=1 upto totalboules:
+ draw 1/8[A[k][k],A[k+1][k+1]]--7/8[A[k][k],A[k+1][k+1]];
+ draw 1/8[A[k+1][k],A[k][k+1]]--7/8[A[k+1][k],A[k][k+1]];
+ endfor;
+ fi;
+ for k=1 upto totalboules:
+ trace segment(A[k][0],A[k][totalboules+1]);
+ trace segment(A[0][k],A[totalboules+1][k]);
+ endfor;
+ trace A[1][0]--A[totalboules+1][0]--A[totalboules+1][totalboules+1]--A[0][totalboules+1]--A[0][1];
+ labeloffset:=labeloffset*4;
+ label.top(TEX("Tirage 1"),iso(A[0][1],A[0][totalboules+1]));
+ label.lft(TEX("Tirage 2") rotated 90,iso(A[totalboules+1][0],A[1][0]));
+ labeloffset:=labeloffset/4;
+
+ path ccsol[][];
+
+ if Solution:
+ if Couleurs:
+ drawoptions(withpen pencircle scaled 0.75);
+ for k=1 upto totalboules:
+ for l=1 upto totalboules:
+ ccsol[k][l]=cercles(iso(A[k][l],A[k+1][l+1]),0.25u);
+ if SansRemise:
+ if k<>l:
+ fill arccercle(pointarc(ccsol[k][l],315),pointarc(ccsol[k][l],135),iso(A[k][l],A[k+1][l+1]))--iso(A[k][l],A[k+1][l+1])--cycle withcolor Col[RetiensNum[l-1]];
+ fill arccercle(pointarc(ccsol[k][l],135),pointarc(ccsol[k][l],315),iso(A[k][l],A[k+1][l+1]))--iso(A[k][l],A[k+1][l+1])--cycle withcolor Col[RetiensNum[k-1]];
+ trace segment(pointarc(ccsol[k][l],135),pointarc(ccsol[k][l],315));
+ trace ccsol[k][l];
+ fi;
+ else:
+ fill arccercle(pointarc(ccsol[k][l],315),pointarc(ccsol[k][l],135),iso(A[k][l],A[k+1][l+1]))--iso(A[k][l],A[k+1][l+1])--cycle withcolor Col[RetiensNum[l-1]];
+ fill arccercle(pointarc(ccsol[k][l],135),pointarc(ccsol[k][l],315),iso(A[k][l],A[k+1][l+1]))--iso(A[k][l],A[k+1][l+1])--cycle withcolor Col[RetiensNum[k-1]];
+ trace segment(pointarc(ccsol[k][l],135),pointarc(ccsol[k][l],315));
+ trace ccsol[k][l];
+ fi;
+ endfor;
+ endfor;
+ drawoptions();
+ else:
+ for k=1 upto totalboules:
+ for l=1 upto totalboules:
+ if SansRemise:
+ if k<>l:
+ label(TEX(Nombres[RetiensNum[l-1]]&"--"&Nombres[RetiensNum[k-1]]),iso(A[k][l],A[k+1][l+1]));
+ fi;
+ else:
+ label(TEX(Nombres[RetiensNum[l-1]]&"--"&Nombres[RetiensNum[k-1]]),iso(A[k][l],A[k+1][l+1]));
+ fi;
+ endfor;
+ endfor;
+ fi;
+ fi;
+
+ if Codes:
+ \useKV[PfCUrne]{Traces};
+ fi;
+ \end{mplibcode}
+ \fi
+}%
+
+\NewDocumentCommand\BuildUrne{mmm}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ u:=\useKV[PfCUrne]{Echelle}*1cm;
+ numeric RetiensNum[];
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNum[n]=p_;
+ n:=n+1;
+ endfor;
+ totalboules=n;
+ enddef;
+
+ color Col[];
+ vardef RecuperationCouleurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+
+ string Nombres[];
+ vardef RecuperationNombres(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Nombres[n]=p_;
+ endfor;
+ enddef;
+
+ numeric Pas,Rayon;
+ Pas=\useKV[PfCUrne]{Pas};
+ Rayon=\useKV[PfCUrne]{Rayon};
+
+ boolean Couleurs, Nombres, Roue;
+ Couleurs=\useKV[PfCUrne]{Couleurs};
+ Nombres=\useKV[PfCUrne]{Nombres};
+ Roue=\useKV[PfCUrne]{Roue};
+
+ RecupRepartition(#3);
+ if Couleurs:
+ RecuperationCouleurs(#1);
+ fi;
+ if Nombres:
+ RecuperationNombres(#2);
+ fi;
+
+ pair O;
+ pair A[],B[];
+
+ if Roue:
+ O=(0,0);
+ path cc;
+ cc=cercles(O,Rayon*u);
+ angd=180/totalboules;
+ angr=360/totalboules;
+ for k=1 upto totalboules:
+ A[k]=17/20[O,pointarc(cc,angd+(k-1)*angr)];
+ endfor;
+ drawarrow rotation((O+u*(0,1.35*Rayon))--(O+u*(0,1.1*Rayon)),O,angd);
+ % trace cc;
+ B[0]=pointarc(cc,0);
+ for k=1 upto totalboules:
+ B[k]=pointarc(cc,k*angr);
+ if Couleurs:
+ fill O--arccercle(B[k-1],B[k],O)--cycle withcolor if unknown Col[RetiensNum[k-1]]:white else: Col[RetiensNum[k-1]] fi;
+ else:
+ label(TEX(Nombres[RetiensNum[k-1]]),A[k]);
+ fi;
+ endfor;
+ trace cc;
+ for k=1 upto totalboules:
+ trace O--B[k];
+ endfor;
+ else:
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ A[rang]=u*(0.5,0.5)+u*(l,k);
+ if Couleurs:
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensNum[rang]]:white else: Col[RetiensNum[rang]] fi;
+ else:
+ label(TEX(Nombres[RetiensNum[rang]]),A[rang]);
+ fi;
+ %trace cercles(A[k*Pas+l],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ A[rang]=u*(0.5,0.5)+u*(k+0.5,totalboules div Pas-1+cosd(30));
+ if Couleurs:
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensNum[rang]]:white else: Col[RetiensNum[rang]] fi;
+ else:
+ label(TEX(Nombres[RetiensNum[rang]]),A[rang]);
+ fi;
+ %trace cercles(A[(totalboules div Pas)*Pas+k],0.5u);
+ endfor;
+ %
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ %
+ drawoptions(withpen pencircle scaled 1.2);
+ if totalboules<Pas:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0-(1-cosd(30)))--u*(Pas,0-(1-cosd(30)))--u*(Pas,(totalboules div Pas)+1.15);
+ else:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0)--u*(Pas,0)--u*(Pas,(totalboules div Pas)+1.15);
+ fi;
+ fi;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={u:=\useKV[PfCUrne]{Echelle}*1cm;numeric Pas;Pas=\useKV[PfCUrne]{Pas}; boolean Couleurs, Nombres; Couleurs=\useKV[PfCUrne]{Couleurs}; Nombres=\useKV[PfCUrne]{Nombres};}]
+ numeric RetiensNum[];
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNum[n]=p_;
+ n:=n+1;
+ endfor;
+ totalboules=n;
+ enddef;
+
+ color Col[];
+ vardef RecuperationCouleurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+
+ string Nombres[];
+ vardef RecuperationNombres(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Nombres[n]=p_;
+ endfor;
+ enddef;
+
+ RecupRepartition(#3);
+ if Couleurs:
+ RecuperationCouleurs(#1);
+ fi;
+ if Nombres:
+ RecuperationNombres(#2);
+ fi;
+
+ pair A[];
+
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ A[rang]=u*(0.5,0.5)+u*(l,k);
+ if Couleurs:
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensNum[rang]]:white else: Col[RetiensNum[rang]] fi;
+ else:
+ label(LATEX(Nombres[RetiensNum[rang]]),A[rang]);
+ fi;
+ %trace cercles(A[k*Pas+l],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ A[rang]=u*(0.5,0.5)+u*(k+0.5,totalboules div Pas-1+cosd(30));
+ if Couleurs:
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensNum[rang]]:white else: Col[RetiensNum[rang]] fi;
+ else:
+ label(LATEX(Nombres[RetiensNum[rang]]),A[rang]);
+ fi;
+ %trace cercles(A[(totalboules div Pas)*Pas+k],0.5u);
+ endfor;
+ %
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ %
+ drawoptions(withpen pencircle scaled 1.2);
+ if totalboules<Pas:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0-(1-cosd(30)))--u*(Pas,0-(1-cosd(30)))--u*(Pas,(totalboules div Pas)+1.15);
+ else:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0)--u*(Pas,0)--u*(Pas,(totalboules div Pas)+1.15);
+ fi;
+ \end{mpost}
+ \fi
+}%
+
+\NewDocumentCommand\BuildUrneDouble{mmmm}{%
+ % #1 Liste Couleurs
+ % #2 Liste Nombres
+ % #3 Repartition des couleurs
+ % #4 Repartition des nombres
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ u:=\useKV[PfCUrne]{Echelle}*1cm;
+ numeric RetiensC[],RetiensNum[];
+ vardef RecupRepartitionC(text t)=
+ n:=0;
+ for p_=t:
+ RetiensC[n]=p_;
+ n:=n+1;
+ endfor;
+ totalboules=n;
+ enddef;
+
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNum[n]=p_;
+ n:=n+1;
+ endfor;
+ enddef;
+
+ color Col[];
+ vardef RecuperationCouleurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+
+ string Nombres[];
+ vardef RecuperationNombres(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Nombres[n]=p_;
+ endfor;
+ enddef;
+
+ numeric Pas,Rayon;
+ Pas=\useKV[PfCUrne]{Pas};
+ Rayon=\useKV[PfCUrne]{Rayon};
+
+ boolean Roue;
+ Roue=\useKV[PfCUrne]{Roue};
+
+ RecupRepartitionC(#3);
+ RecupRepartition(#4);
+ RecuperationCouleurs(#1);
+ RecuperationNombres(#2);
+
+ pair O;
+ pair A[],B[];
+
+ if Roue:
+ O=(0,0);
+ path cc;
+ cc=cercles(O,Rayon*u);
+ angd=180/totalboules;
+ angr=360/totalboules;
+ for k=1 upto totalboules:
+ A[k]=17/20[O,pointarc(cc,angd+(k-1)*angr)];
+ endfor;
+ B[0]=pointarc(cc,0);
+ for k=1 upto totalboules:
+ B[k]=pointarc(cc,k*angr);
+ fill O--arccercle(B[k-1],B[k],O)--cycle withcolor if unknown Col[RetiensC[k-1]]:white else: Col[RetiensC[k-1]] fi;
+ label(TEX(Nombres[RetiensNum[k-1]]),A[k]);
+ endfor;
+ trace cc;
+ for k=1 upto totalboules:
+ trace O--B[k];
+ endfor;
+ drawarrow rotation((O+u*(0,1.35*Rayon))--(O+u*(0,1.1*Rayon)),O,angd);
+ else:
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ A[rang]=u*(0.5,0.5)+u*(l,k);
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensC[rang]]:white else: Col[RetiensC[rang]] fi;
+ label(TEX(Nombres[RetiensNum[rang]]),A[rang]);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ A[rang]=u*(0.5,0.5)+u*(k+0.5,totalboules div Pas-1+cosd(30));
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensC[rang]]:white else: Col[RetiensC[rang]] fi;
+ label(TEX(Nombres[RetiensNum[rang]]),A[rang]);
+ endfor;
+ %
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ %
+ drawoptions(withpen pencircle scaled 1.2);
+ if totalboules<Pas:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0-(1-cosd(30)))--u*(Pas,0-(1-cosd(30)))--u*(Pas,(totalboules div Pas)+1.15);
+ else:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0)--u*(Pas,0)--u*(Pas,(totalboules div Pas)+1.15);
+ fi;
+ fi;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={u:=\useKV[PfCUrne]{Echelle}*1cm;numeric RetiensC[],RetiensNum[];numeric Pas,Rayon;Pas=\useKV[PfCUrne]{Pas};Rayon=\useKV[PfCUrne]{Rayon};boolean Roue;Roue=\useKV[PfCUrne]{Roue};}]
+ vardef RecupRepartitionC(text t)=
+ n:=0;
+ for p_=t:
+ RetiensC[n]=p_;
+ n:=n+1;
+ endfor;
+ totalboules=n;
+ enddef;
+
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNum[n]=p_;
+ n:=n+1;
+ endfor;
+ enddef;
+
+ color Col[];
+ vardef RecuperationCouleurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+
+ string Nombres[];
+ vardef RecuperationNombres(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Nombres[n]=p_;
+ endfor;
+ enddef;
+
+ RecupRepartitionC(#3);
+ RecupRepartition(#4);
+ RecuperationCouleurs(#1);
+ RecuperationNombres(#2);
+
+ pair O;
+ pair A[],B[];
+
+ if Roue:
+ O=(0,0);
+ path cc;
+ cc=cercles(O,Rayon*1cm);
+ angd=180/totalboules;
+ angr=360/totalboules;
+ for k=1 upto totalboules:
+ A[k]=17/20[O,pointarc(cc,angd+(k-1)*angr)];
+ endfor;
+ B[0]=pointarc(cc,0);
+ for k=1 upto totalboules:
+ B[k]=pointarc(cc,k*angr);
+ fill O--arccercle(B[k-1],B[k],O)--cycle withcolor if unknown Col[RetiensC[k-1]]:white else: Col[RetiensC[k-1]] fi;
+ label(LATEX(Nombres[RetiensNum[k-1]]),A[k]);
+ endfor;
+ trace cc;
+ for k=1 upto totalboules:
+ trace O--B[k];
+ endfor;
+ else:
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ A[rang]=u*(0.5,0.5)+u*(l,k);
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensC[rang]]:white else: Col[RetiensC[rang]] fi;
+ label(LATEX(Nombres[RetiensNum[rang]]),A[rang]);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ A[rang]=u*(0.5,0.5)+u*(k+0.5,totalboules div Pas-1+cosd(30));
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensC[rang]]:white else: Col[RetiensC[rang]] fi;
+ label(LATEX(Nombres[RetiensNum[rang]]),A[rang]);
+ endfor;
+ %
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ %
+ drawoptions(withpen pencircle scaled 1.2);
+ if totalboules<Pas:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0-(1-cosd(30)))--u*(Pas,0-(1-cosd(30)))--u*(Pas,(totalboules div Pas)+1.15);
+ else:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0)--u*(Pas,0)--u*(Pas,(totalboules div Pas)+1.15);
+ fi;
+ fi;
+ \end{mpost}
+ \fi
+}%
+
+\NewDocumentCommand\SchemaProba{o}{%
+ \useKVdefault[PfCUrne]%
+ \setKV[PfCUrne]{#1}%
+ \tokUrneListeCouleurs{}%
+ \tokUrneListeNombres{}%
+ \tokUrneListeColonnes{}%
+ \ifboolKV[PfCUrne]{Casino}{%
+ \BuildRoulette%
+ }{%
+ \ifboolKV[PfCUrne]{Tableau}{%
+ \ifboolKV[PfCUrne]{Different}{%
+ \xdef\PfCFooRepartitionC{\useKV[PfCUrne]{RepartitionColonne}}%
+ \xdef\PfCFooRepartitionL{\useKV[PfCUrne]{RepartitionLigne}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeRepartitionCAv{\PfCFooRepartitionC}%
+ \readlist*\ListeRepartitionLAv{\PfCFooRepartitionL}%
+ % Repartition : \showitems\ListeRepartitionAv[]%
+ \xdef\PfCFooListeRepartitionC{}%
+ \xdef\PfCFooListeRepartitionL{}%
+ \xdef\PfCTotalC{0}%
+ \xdef\PfCTotalL{0}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionCAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionCAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartitionC{\PfCFooListeRepartitionC,##1}%
+ \xdef\PfCTotalC{\fpeval{\PfCTotalC+1}}%
+ }%
+ }%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionLAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionLAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartitionL{\PfCFooListeRepartitionL,##1}%
+ \xdef\PfCTotalL{\fpeval{\PfCTotalL+1}}%
+ }%
+ }%
+ \foreachitem\compteur\in\ListeCouleursAv{\expandafter\UpdatetoksUrneColonnes\compteur\nil}%
+ \foreachitem\compteur\in\ListeNombresAv{\expandafter\UpdatetoksUrneNombres\compteur\nil}%
+ \BuildTableauDoubleEntreeDifferent{\the\tokUrneListeColonnes}{\the\tokUrneListeNombres}{\PfCFooListeRepartitionC}{\PfCFooListeRepartitionL}%
+ }{%
+ \xdef\PfCFooRepartition{\useKV[PfCUrne]{Repartition}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeRepartitionAv{\PfCFooRepartition}%
+ \xdef\PfCFooListeRepartition{}%
+ \xdef\PfCTotal{0}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartition{\PfCFooListeRepartition,##1}%
+ \xdef\PfCTotal{\fpeval{\PfCTotal+1}}%
+ }%
+ }%
+ \ifboolKV[PfCUrne]{Couleurs}{%
+ \foreachitem\compteur\in\ListeCouleursAv{\expandafter\UpdatetoksUrneCouleurs\compteur\nil}%
+ \BuildTableauDoubleEntree{\the\tokUrneListeCouleurs}{}{\PfCFooListeRepartition}%
+ }{%
+ \ifboolKV[PfCUrne]{Nombres}{%
+ \foreachitem\compteur\in\ListeNombresAv{\expandafter\UpdatetoksUrneNombres\compteur\nil}%
+ \BuildTableauDoubleEntree{}{\the\tokUrneListeNombres}{\PfCFooListeRepartition}%
+ }{}%
+ }%
+ }%
+ }{%
+ \ifboolKV[PfCUrne]{Double}{%
+ \xdef\PfCFooRepartitionC{\useKV[PfCUrne]{RepartitionC}}%
+ \xdef\PfCFooRepartitionN{\useKV[PfCUrne]{RepartitionN}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeRepartitionCAv{\PfCFooRepartitionC}%
+ \readlist*\ListeRepartitionNAv{\PfCFooRepartitionN}%
+ % Repartition : \showitems\ListeRepartitionAv[]%
+ \xdef\PfCFooListeRepartitionC{}%
+ \xdef\PfCFooListeRepartitionN{}%
+ \xdef\PfCTotalC{0}%
+ \xdef\PfCTotalN{0}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionCAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionCAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartitionC{\PfCFooListeRepartitionC,##1}%
+ \xdef\PfCTotalC{\fpeval{\PfCTotalC+1}}%
+ }%
+ }%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionNAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionNAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartitionN{\PfCFooListeRepartitionN,##1}%
+ \xdef\PfCTotalN{\fpeval{\PfCTotalN+1}}%
+ }%
+ }%
+ \MelangeListe{\PfCFooListeRepartitionC}{\PfCTotalC}%
+ \xdef\ListeRepartitionCouleurs{\faa}%
+ \foreachitem\compteur\in\ListeCouleursAv{\expandafter\UpdatetoksUrneCouleurs\compteur\nil}%
+ \MelangeListe{\PfCFooListeRepartitionN}{\PfCTotalN}%
+ \xdef\ListeRepartitionNombres{\faa}%
+ \foreachitem\compteur\in\ListeNombresAv{\expandafter\UpdatetoksUrneNombres\compteur\nil}%
+ \BuildUrneDouble{\the\tokUrneListeCouleurs}{\the\tokUrneListeNombres}{\ListeRepartitionCouleurs}{\ListeRepartitionNombres}%
+ }{%
+ \xdef\PfCFooRepartition{\useKV[PfCUrne]{Repartition}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeRepartitionAv{\PfCFooRepartition}%
+ % Repartition : \showitems\ListeRepartitionAv[]%
+ \xdef\PfCFooListeRepartition{}%
+ \xdef\PfCTotal{0}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartition{\PfCFooListeRepartition,##1}%
+ \xdef\PfCTotal{\fpeval{\PfCTotal+1}}%
+ }%
+ }%
+ \ifboolKV[PfCUrne]{Couleurs}{%
+ \MelangeListe{\PfCFooListeRepartition}{\PfCTotal}%
+ \xdef\ListeRepartitionCouleurs{\faa}%
+ \foreachitem\compteur\in\ListeCouleursAv{\expandafter\UpdatetoksUrneCouleurs\compteur\nil}%
+ % Couleurs :\\
+ % La répartition est : \ListeRepartitionCouleurs\\
+ % Les couleurs sont : \the\tokUrneListeCouleurs.\\
+ \BuildUrne{\the\tokUrneListeCouleurs}{}{\ListeRepartitionCouleurs}%
+ }{%
+ \ifboolKV[PfCUrne]{Nombres}{%
+ \MelangeListe{\PfCFooListeRepartition}{\PfCTotal}%
+ \xdef\ListeRepartitionNombres{\faa}%
+ \foreachitem\compteur\in\ListeNombresAv{\expandafter\UpdatetoksUrneNombres\compteur\nil}%
+ % Nombres :\\
+ % La répartition est : \ListeRepartitionNombres\\
+ % Les nombres sont : \the\tokUrneListeNombres.\\
+ \BuildUrne{}{\the\tokUrneListeNombres}{\ListeRepartitionNombres}%
+ }{}%
+ }%
+ }%
+}%
+}%
+}%
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCUrneProba.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty 2024-07-04 20:27:51 UTC (rev 71705)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty 2024-07-04 20:28:16 UTC (rev 71706)
@@ -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{2024/05/18}%
+\def\filedate{2024/07/03}%
\let\PfCfiledate\filedate%
-\def\fileversion{0.99-A-f}%
+\def\fileversion{0.99-A-g}%
\let\PfCfileversion\fileversion%
\ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]%
@@ -124,7 +124,6 @@
\RequirePackage{listofitems}%
\RequirePackage{datatool}%
\RequirePackage{multido}%
-
\RequirePackage{xlop}%
\RequirePackage{tcolorbox}%
@@ -637,18 +636,18 @@
\tikzset{face/.style={shape=circle,minimum size=4ex,shading=radial,outer sep=0pt, inner color=white!50!yellow,outer color= yellow!70!orange}}
\newcommand\emoticon[2][]{%
-\scalebox{.5}{\begin{tikzpicture}
-\node[face,#1,draw,thick] (emoticon) {};
+\scalebox{.5}{\begin{tikzpicture}%
+\node[face,#1,draw,thick] (emoticon) {};%
%% The eyes are fixed.
\draw[fill=white] (-1ex,0ex) ..controls (-0.5ex,0.2ex)and(0.5ex,0.2ex)..(1ex,0.0ex) ..controls ( 1.5ex,1.5ex)and( 0.2ex,1.7ex)..(0ex,0.4ex) ..controls (-0.2ex,1.7ex)and(-1.5ex,1.5ex)..(-1ex,0ex)--cycle;
#2%
\end{tikzpicture}}%
-}
+}%
-\newcommand\pupils{
+\newcommand\pupils{%
%% standard pupils
-\fill[shift={(0.5ex,0.5ex)},rotate=80] (0,0) ellipse (0.3ex and 0.15ex);
-\fill[shift={(-0.5ex,0.5ex)},rotate=100] (0,0) ellipse (0.3ex and 0.15ex);}
+\fill[shift={(0.5ex,0.5ex)},rotate=80] (0,0) ellipse (0.3ex and 0.15ex);%
+\fill[shift={(-0.5ex,0.5ex)},rotate=100] (0,0) ellipse (0.3ex and 0.15ex);}%
\def\RKsmallsmile{%
\emoticon{%
@@ -656,7 +655,7 @@
%% mouth
\draw[thick] (-0.5ex,-1ex)..controls (-0.25ex,-1.25ex)and(0.25ex,-1.25ex)..(0.5ex,-1ex);
}%\emoticon
-}
+}%
\def\RKsmile{%
\emoticon{%
@@ -663,7 +662,7 @@
\pupils
\draw[thick] (-1ex,-1ex)..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex);
}%\emoticon
-}
+}%
\def\RKbigsmile{%
\emoticon{%
@@ -671,7 +670,7 @@
%% mouth
\draw[thick] (-1.5ex,-0.5ex)..controls (-0.7ex,-1.7ex)and(0.7ex,-1.7ex)..(1.5ex,-0.5ex);
}%\emoticon
-}
+}%
\def\RKsad{%
\emoticon{%
@@ -681,7 +680,7 @@
%% mouth
\draw[thick] (-1ex,-1ex)..controls(-0.5ex,-0.5ex)and(0.5ex,-0.5ex)..(1ex,-1ex);
}%\emoticon
-}
+}%
\def\RKneutral{%
\emoticon{%
@@ -691,7 +690,7 @@
%% mouth
\draw[thick] (-0.5ex,-1ex)--(0.5ex,-1ex);
}%\emoticon
-}
+}%
\def\RKconfused{%
\emoticon{%
@@ -716,19 +715,19 @@
(-1.00ex,1.00ex)--(-1.20ex,1.10ex)
(-0.35ex,1.15ex)--(-0.25ex,1.35ex);
}%\emoticon
-}
+}%
\def\RKangry{%
\emoticon{%
%% pupils
-\fill[shift={( 0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex);
-\fill[shift={(-0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex);
+\fill[shift={( 0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex);%
+\fill[shift={(-0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex);%
%% mouth
-\draw[thick] (-1ex,-1ex)..controls(-0.5ex,-0.5ex)and(0.5ex,-0.5ex)..(1ex,-1ex);
+\draw[thick] (-1ex,-1ex)..controls(-0.5ex,-0.5ex)and(0.5ex,-0.5ex)..(1ex,-1ex);%
%% eyebrows
-\draw[thick] (0.2ex,1.15ex)--(0.5ex,1.6ex)(-0.2ex,1.15ex)--(-0.5ex,1.6ex);
+\draw[thick] (0.2ex,1.15ex)--(0.5ex,1.6ex)(-0.2ex,1.15ex)--(-0.5ex,1.6ex);%
}%\emoticon
-}
+}%
\def\RKlookup{%
\emoticon{%
@@ -826,6 +825,8 @@
\def\PfCSymbolTimes{\times}%
\def\PfCSymbolDiv{\div}%
+\input{PfCUrneProba}
+\input{PfCProbaFrequence}
\input{PfCVisualisationMulDeci}
\input{PfCArbreChiffre}
\input{PfCAssemblagesSolides}
@@ -971,4 +972,11 @@
\input{PfCDomino}
\input{PfCProgrammeCalcul}
\input{PfCPapiers}
-\input{PfCScratch}
\ No newline at end of file
+\input{PfCScratch}
+
+\RequirePackage{PfCInfixRPN}
+%\makeatletter
+%\let\@nil\@empty
+%\makeatother
+
+\input{PfCArbreCalcul}
\ No newline at end of file
More information about the tex-live-commits
mailing list.