texlive[70746] Master/texmf-dist: profcollege (24mar24)
commits+karl at tug.org
commits+karl at tug.org
Sun Mar 24 21:05:42 CET 2024
Revision: 70746
https://tug.org/svn/texlive?view=revision&revision=70746
Author: karl
Date: 2024-03-24 21:05:42 +0100 (Sun, 24 Mar 2024)
Log Message:
-----------
profcollege (24mar24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
trunk/Master/texmf-dist/metapost/profcollege/PfCCalculatrice.mp
trunk/Master/texmf-dist/metapost/profcollege/PfCMonde.mp
trunk/Master/texmf-dist/metapost/profcollege/PfCObjets.mp
trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp
trunk/Master/texmf-dist/metapost/profcollege/PfCSolid.mp
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCAN.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculatrice.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesMentales.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartographie.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecomposerNombrePremier.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCDistributivite.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCDomino.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureLettres.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCEratosthene.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCFactorisation.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCFonctionAffine.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCLego.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCProgrammeCalcul.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterTableur.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCReseauxSociaux.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCSimplifierFraction.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCTablesOperations.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCThales.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCTrio.tex
trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
Added Paths:
-----------
trunk/Master/texmf-dist/tex/latex/profcollege/PfCDontCountDots.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCRecyclage.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCTicketCaisse.tex
Removed Paths:
-------------
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractionsoldv1.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCRondeInfernaleold.tex
Modified: trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCCalculatrice.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCCalculatrice.mp 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCCalculatrice.mp 2024-03-24 20:05:42 UTC (rev 70746)
@@ -145,10 +145,10 @@
elseif substring(cptk,cptk+1) of cptnt=")":draw Affichage("01000001000001000010000100010001000") shifted(Decalage);
elseif substring(cptk,cptk+1) of cptnt="*":draw Affichage("00000001001010101110101010010000000") shifted(Decalage);
elseif substring(cptk,cptk+1) of cptnt="+":draw Affichage("00000001000010011111001000010000000") shifted(Decalage);
- elseif substring(cptk,cptk+1) of cptnt=",":draw Affichage("00000000000000000000011000010001000") shifted(Decalage);
+% elseif substring(cptk,cptk+1) of cptnt=",":draw Affichage("00000000000000000000011000010001000") shifted(Decalage);
elseif substring(cptk,cptk+1) of cptnt="-":draw Affichage("00000000000000011111000000000000000") shifted(Decalage);
elseif substring(cptk,cptk+1) of cptnt=".":draw Affichage("00000000000000000000000000110001100") shifted(Decalage);
- elseif substring(cptk,cptk+1) of cptnt="/":draw Affichage("00000000010001000100010001000000000") shifted(Decalage);
+% elseif substring(cptk,cptk+1) of cptnt="/":draw Affichage("00000000010001000100010001000000000") shifted(Decalage);
elseif substring(cptk,cptk+1) of cptnt=":":if Math=true:
draw Affichage("00000000000000000000000000000000000") shifted(Decalage);
else:
@@ -172,6 +172,7 @@
elseif substring(cptk,cptk+1) of cptnt="$":draw Affichage("00000000000000100001000010000111111") shifted(Decalage);
elseif substring(cptk,cptk+1) of cptnt="^":draw Affichage("00100010101000100000000000000000000") shifted(Decalage);
elseif substring(cptk,cptk+1) of cptnt="_":draw Affichage("11111111111111111111111111111111111") shifted(Decalage);
+ elseif substring(cptk,cptk+1) of cptnt="~":draw Affichage("01000010000111001000010000100001000") shifted(Decalage);
fi;
enddef;
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCMonde.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCMonde.mp 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCMonde.mp 2024-03-24 20:05:42 UTC (rev 70746)
@@ -32,6 +32,9 @@
vardef flamme=reverse(2mm*(0.5,1){dir90}..2mm*(0.75,1.5)..{dir90}2mm*(1,2))--2mm*(0.5,1){dir=-90}..2mm*(1,0.5)..{dir=90}2mm*(1.5,1)--((2mm*(0.5,1){dir90}..2mm*(0.75,1.5)..{dir90}2mm*(1,2)) reflectedabout (2mm*(1,0),2mm*(1,0)+2mm*(0,1)))--cycle
enddef;
+%
+pair poubelle;
+
%Les marques
string marque_p;
@@ -629,13 +632,23 @@
nbpts:=scantokens readfrom nomfichier;
numeric ll;
ll=0;
- for k=1 upto nbpts:
+ if nbpts<Allegee:
+ Alleg:=4;
+ else:
+ Alleg:=Allegee;
+ fi;
+% for k=1 upto nbpts:
+ for k=1 upto (nbpts div Alleg):
pair latlon;
- latlon=scantokens readfrom nomfichier;
+% latlon=scantokens readfrom nomfichier;
+% 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;
if projection="mercator":
- Coord[k]=mercatorc(xpart(latlon/60),ypart(latlon/60))
+ Coord[k]=mercatorc(xpart(latlon/60),ypart(latlon/60));
elseif projection="winkel":
- Coord[k]=winkelc(xpart(latlon/60),ypart(latlon/60))
+ Coord[k]=winkelc(xpart(latlon/60),ypart(latlon/60));
elseif projection="cylindrique":
Coord[k]=cylindriquec(xpart(latlon/60),ypart(latlon/60));
elseif projection="simple":
@@ -661,11 +674,14 @@
fi;
if ll>0:
pays=Coord[1]
- for l=4 step 3 until ll:%upto ll:
+% for l=4 step 3 until ll:%upto ll:4-3
+ for l=2 upto (nbpts div Alleg):
--Coord[l]
endfor;
if noncolore=true:
- fill pays--cycle withcolor payscolor;
+ if Impression=false:
+ fill pays--cycle withcolor payscolor;
+ fi;
else:
fill pays--cycle withcolor fond;
fi;
@@ -689,9 +705,20 @@
fond=scantokens readfrom nomfichiermul;
numeric ll;
ll=0;
- for k=1 upto nbpts:
+%%%%%%%%%%%%
+ if nbpts<Allegee:
+ Alleg:=1;
+ else:
+ Alleg:=Allegee;
+ fi;
+ %%%%%%%%
+% for k=1 upto nbpts:
+ for k=1 upto (nbpts div Alleg):
pair latlon;
- latlon=scantokens readfrom nomfichiermul;
+% latlon=scantokens readfrom nomfichiermul;
+ latlon=((scantokens readfrom nomfichiermul) for l=2 upto Alleg:
+ +(scantokens readfrom nomfichiermul)
+ endfor)/Alleg;
if projection="mercator":
Coord[k]=mercatorc(xpart(latlon/60),ypart(latlon/60));
elseif projection="winkel":
@@ -716,13 +743,14 @@
endfor;
path pays;
if (projection="mercator") or (projection="winkel") or (projection="cylindrique") or (projection="simple") or (projection="bonne"):
- ll:=nbpts
+ ll:=(nbpts div Alleg)
fi;
if ll>0:
pays=Coord[1]
- for l=2 upto ll:
+% for l=2 upto ll:
+ for l=2 upto (nbpts div Alleg):
--Coord[l]
- endfor;
+ endfor;
if noncolore=true:
fill pays--cycle withcolor payscolor;
else:
@@ -730,6 +758,12 @@
fi;
draw pays;
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;
if (projection="mercator") or (projection="winkel") or (projection="cylindrique") or (projection="simple"):
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCObjets.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCObjets.mp 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCObjets.mp 2024-03-24 20:05:42 UTC (rev 70746)
@@ -751,6 +751,37 @@
apj.@:=apj-1;
enddef;
+vardef Objetdemispherebasse[](expr Rn)=
+ Outcolor.@:=outcolor;
+ Incolor.@:=incolor;
+ if creux:Ferme.@:=false else: Ferme.@:=true fi;
+ scantokens("numeric "&substring(0,1) of Rn&"; "&Rn&";");
+ vardef Famille(expr u,v)=(R*(cos(u)*cos(v),cos(u)*sin(v),sin(u))) enddef;
+ umin:=-pi/2; umax:=0; upas:=0.5*pi/nb;
+ vmin:=-pi; vpas:=2*pi/subh; vmax:=0;
+ apj:=0;
+ %On cr\xE9e les facettes et on calcule la profondeur en Z.
+ for k=0 upto (nb-1):
+ for l=0 upto (subh-1):
+ tcpt.@[apj]:=apj;
+ OTFc.@[apj].nb:=4;
+ OTFc.@[apj][1]:=Image(Famille(umin+(k+1)*upas,vmin+l*vpas));
+ OTFc.@[apj][2]:=Image(Famille(umin+k*upas,vmin+l*vpas));
+ OTFc.@[apj][3]:=Image(Famille(umin+k*upas,vmin+(l+1)*vpas));
+ OTFc.@[apj][4]:=Image(Famille(umin+(k+1)*upas,vmin+(l+1)*vpas));
+ OTFc.@[apj].iso:=(OTFc.@[apj][1]+OTFc.@[apj][2]+OTFc.@[apj][3]+OTFc.@[apj][4])/4;
+ ALT.@[apj]:=-Zpart(GCoord(OTFc.@[apj].iso));
+ if ProduitScalaire(Oeil-OTFc.@[apj].iso,Normal(OTFc.@[apj].iso,OTFc.@[apj][1],OTFc.@[apj][2]))>=0:
+ Vue.@[apj]:=true;coul.@[apj]:=outcolor;
+ else:
+ Vue.@[apj]:=false;coul.@[apj]:=incolor;
+ fi;
+ apj:=apj+1;
+ endfor;
+ endfor;
+ apj.@:=apj-1;
+enddef;
+
vardef ObjetSphereNew[](expr Rn)=
Outcolor.@:=outcolor;
Incolor.@:=incolor;
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp 2024-03-24 20:05:42 UTC (rev 70746)
@@ -66,6 +66,8 @@
numeric coefprint;
coefprint:=0.95;
+color White;
+White:=white;
%texte ou symbole droite gauche
boolean symbole;
symbole=true;
@@ -130,7 +132,7 @@
TAvar=OvalBox(TTv);
Ovar=image(
fill TAvar if print=false : withcolor OrangeTrois else : withcolor white fi;
- draw TAvar if print=false : withcolor coefprint*white fi;
+ draw TAvar if print=false : withcolor coefprint*White fi;
label(TEX("\barre\bfseries "&ar),(0,0)) if print=false : withcolor white fi;
);
Ovar:=Ovar shifted(-center Ovar);
@@ -145,7 +147,7 @@
CList=image(
fill TAlist if print=false : withcolor OrangeListTrois else : withcolor white fi;
draw LOCMt;
- draw TAlist if print=false : withcolor coefprint*white fi;
+ draw TAlist if print=false : withcolor coefprint*White fi;
);
CList:=CList shifted(-center CList);
CList
@@ -189,7 +191,7 @@
tanb=OvalBox(ar);
Onb=image(
fill tanb withcolor white;
- draw tanb if print=false : withcolor coefprint*white fi;
+ draw tanb if print=false : withcolor coefprint*White fi;
label(TEX("\barre "&ar),(0,0));
);
Onb
@@ -202,7 +204,7 @@
TA=OvalBox(ar);
$=image(%
fill TA withcolor white;
- draw TA if print=false : withcolor coefprint*white fi;
+ draw TA if print=false : withcolor coefprint*White fi;
label(TEX("\barre "&ar),(0,0));
);
$:=$ shifted(-center $);
@@ -216,9 +218,9 @@
LOPop=ColleBoxNew(listeop);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -232,7 +234,7 @@
ta=OvalBox(TTap);
$=image(
fill ta if print=false : withcolor VioletAppTrois else: withcolor white fi;
- draw ta if print=false : withcolor coefprint*white fi;
+ draw ta if print=false : withcolor coefprint*White fi;
draw TTap;
);
$:=$ shifted(-center $);
@@ -247,7 +249,7 @@
ta=OvalBox(TTap);
$=image(
fill ta if print=false : withcolor SonTrois else: withcolor white fi;
- draw ta if print=false : withcolor coefprint*white fi;
+ draw ta if print=false : withcolor coefprint*White fi;
draw TTap;
);
$:=$ shifted(-center $);
@@ -264,7 +266,7 @@
TA=OvalBox(TT);
$=image(
fill TA if print : withcolor white else : withcolor StyloTrois fi;
- draw TT if print=true : withcolor coefprint*white fi;
+ draw TT if print=true : withcolor coefprint*White fi;
);
else:
message("La commande --OvalStylo-- n'accepte qu'un argument de type string.");
@@ -280,7 +282,7 @@
ta=OvalBox(TTm);
$=image(
fill ta if print=false : withcolor BleuMouvTrois else: withcolor white fi;
- draw ta if print=false : withcolor coefprint*white fi;
+ draw ta if print=false : withcolor coefprint*White fi;
label(TEX("\longbarre "&ar),center ta) if print=false : withcolor blanc fi;
);
$
@@ -297,7 +299,7 @@
TAMC=OvalBox(TTm);
$=image(
fill TAMC if print : withcolor white else : withcolor CapFonceTrois fi;
- draw TAMC if print=false : withcolor coefprint*white fi;
+ draw TAMC if print=false : withcolor coefprint*White fi;
label(TEX(TTm),center TAMC);
);
$
@@ -312,7 +314,7 @@
Cap=image(
fill TAcap if print=false : withcolor CapteurTrois else : withcolor white fi;
draw LOCMcap;
- draw TAcap if print=false : withcolor coefprint*white fi;
+ draw TAcap if print=false : withcolor coefprint*White fi;
);
Cap:=Cap shifted(-center Cap);
Cap
@@ -327,7 +329,7 @@
ta=OvalBox(TTm);
$=image(
fill ta if print=false : withcolor dBleuMouvTrois else: withcolor white fi;
- draw ta if print=false : withcolor coefprint*white fi;
+ draw ta if print=false : withcolor coefprint*White fi;
label(TEX(TTm),center ta);
);
$
@@ -341,7 +343,7 @@
ta=OvalBox(TTm);
$=image(
fill ta if print=false : withcolor FondOvalAppMenu else: withcolor white fi;
- draw ta if print=false : withcolor coefprint*white fi;
+ draw ta if print=false : withcolor coefprint*White fi;
label(TEX(TTm),center ta);
);
$
@@ -359,7 +361,7 @@
TA=OvalBox(TTm);
$=image(%
fill TA if print : withcolor white else : withcolor DSonTrois fi;
- draw TA if print=false : withcolor coefprint*white fi;
+ draw TA if print=false : withcolor coefprint*White fi;
label(TEX(TTm),center TA);
);
$
@@ -375,7 +377,7 @@
TA=OvalBox(TTm);
$=image(
fill TA if print : withcolor white else : withcolor CloneTrois fi;
- draw TA if print=false : withcolor coefprint*white fi;
+ draw TA if print=false : withcolor coefprint*White fi;
label(TEX(TTm), center TA);
);
$
@@ -396,7 +398,7 @@
TA=OvalBox(TT);
$=image(
fill TA if print : withcolor white else : withcolor OvalStyloTrois fi;
- draw TA if print=false : withcolor coefprint*white fi;
+ draw TA if print=false : withcolor coefprint*White fi;
label(TEX(TT),(0,0)) if print=false : withcolor white fi;
);
else:
@@ -430,7 +432,7 @@
TA=OvalBox(TTm);
$=image(
fill TA if print : withcolor white else : withcolor MessageTrois fi;
- draw TA if print=false : withcolor coefprint*white fi;
+ draw TA if print=false : withcolor coefprint*White fi;
label(TEX(TTm), center TA);
);
$
@@ -445,7 +447,7 @@
ta=RecBox(TTm);
$=image(
fill ta if print=false : withcolor BleuMouvTrois else: withcolor white fi;
- draw ta if print=false : withcolor coefprint*white fi;
+ draw ta if print=false : withcolor coefprint*White fi;
label(TEX(TTm),center ta);
);
$
@@ -459,7 +461,7 @@
ta=RecBox(TTm);
$=image(
fill ta if print=false : withcolor VioletAppTrois else: withcolor white fi;
- draw ta if print=false : withcolor coefprint*white fi;
+ draw ta if print=false : withcolor coefprint*White fi;
label(TEX(TTm),center ta);
);
$
@@ -474,7 +476,7 @@
TA=RecBox(TTm);
$=image(
fill TA if print : withcolor white else : withcolor FondOvalOp fi;
- draw TA if print=false : withcolor coefprint*white fi;
+ draw TA if print=false : withcolor coefprint*White fi;
label(TEX(TTm), center TA);
);
$
@@ -488,7 +490,7 @@
TA=RecBox(TTm);
$=image(
fill TA if print : withcolor white else : withcolor SonTrois fi;
- draw TA if print=false : withcolor coefprint*white fi;
+ draw TA if print=false : withcolor coefprint*White fi;
label(TEX(TTm), center TA);
);
$
@@ -502,7 +504,7 @@
ta=RecBox(TTm);
$=image(
fill ta if print=false : withcolor EvenementTrois else: withcolor white fi;
- draw ta if print=false : withcolor coefprint*white fi;
+ draw ta if print=false : withcolor coefprint*White fi;
label(TEX(TTm),center ta);
);
$
@@ -516,7 +518,7 @@
ta=RecBox(TTm);
$=image(
fill ta if print=false : withcolor CapteurTrois else: withcolor white fi;
- draw ta if print=false : withcolor coefprint*white fi;
+ draw ta if print=false : withcolor coefprint*White fi;
label(TEX(TTm),center ta);
);
$
@@ -531,7 +533,7 @@
TA=RecBox(TTm);
$=image(
fill TA if print : withcolor white else : withcolor OrangeTrois fi;
- draw TA if print=false : withcolor coefprint*white fi;
+ draw TA if print=false : withcolor coefprint*White fi;
label(TEX(TTm), center TA);
);
$
@@ -546,7 +548,7 @@
TA=RecBox(TTm);
$=image(
fill TA if print : withcolor white else : withcolor OrangeListTrois fi;
- draw TA if print=false : withcolor coefprint*white fi;
+ draw TA if print=false : withcolor coefprint*White fi;
label(TEX(TTm), center TA);
);
$
@@ -599,7 +601,8 @@
if string p_:
NBCOLLE:=Box(p_);
HOLD:=image(
- label(TEX("\sffamily\bfseries\longbarre "&p_),(0,0)) if print=false : withcolor white fi;%->ok
+% label(TEX("\sffamily\bfseries\longbarre "&p_),(0,0)) if print=false : withcolor white fi;%->ok
+ label(TEX("\sffamily\barre\bfseries "&p_),(0,0)) if print=false : withcolor white fi;%->ok
);
HOLD:=(HOLD shifted ((xpart((center HOLD)-(llcorner HOLD))+LONG,0)));
else:
@@ -637,7 +640,7 @@
cadre=CADRE(texta);
picture TEXT;
TEXT=image(%
- fill cadre withcolor if print=true :coefprint*white else: if unknown ColBloc : white else : ColBloc fi; fi;
+ fill cadre withcolor if print=true :coefprint*White else: if unknown ColBloc : white else : ColBloc fi; fi;
draw texta;
draw cadre withcolor CoulLignes;
);
@@ -693,7 +696,7 @@
cadre=CADRECONTROLE(texta);
picture TEXT;
TEXT=image(
- fill cadre withcolor if print=true :coefprint*white else: if unknown ColBloc : white else : ColBloc fi; fi;
+ fill cadre withcolor if print=true :coefprint*White else: if unknown ColBloc : white else : ColBloc fi; fi;
draw texta;
draw tracecadre withcolor CoulLignes;
);
@@ -734,7 +737,7 @@
cadre=CADREED(texta);
picture TEXT;
TEXT=image(
- fill cadre withcolor if print=true :coefprint*white else: if unknown ColBloc : white else : ColBloc fi; fi;
+ fill cadre withcolor if print=true :coefprint*White else: if unknown ColBloc : white else : ColBloc fi; fi;
draw texta;
draw cadre withcolor CoulLignes;
);
@@ -1384,10 +1387,10 @@
save $;
picture $;
$=image(
- draw (((0,0)--(0,18pt)) shifted(-12,-9pt)) withpen pencircle scaled 1bp withcolor if print: coefprint*white else: StyloTrois fi;
+ draw (((0,0)--(0,18pt)) shifted(-12,-9pt)) withpen pencircle scaled 1bp withcolor if print: coefprint*White else: StyloTrois fi;
draw NoteImage shifted((-5,-2));
draw NoteImage shifted((3.5,2));
- draw (((0,0)--(0,18pt)) shifted(12,-9pt)) withpen pencircle scaled 1bp withcolor if print: 0.5*coefprint*white else: (69/255,168/255,140/255) fi;%Trop clair->(14/255,187/255,139/255);
+ draw (((0,0)--(0,18pt)) shifted(12,-9pt)) withpen pencircle scaled 1bp withcolor if print: 0.5*coefprint*White else: (69/255,168/255,140/255) fi;%Trop clair->(14/255,187/255,139/255);
);
$:=$ shifted(-3,0);
$
@@ -1435,7 +1438,7 @@
picture titi;
titi=image(%
draw CrayonImage shifted(-12,0);
- draw (((0,0)--(0,18pt)) shifted(9,-9)) withpen pencircle scaled 1bp withcolor if print: 0.5*coefprint*white else: (69/255,168/255,140/255) fi;%Trop clair->(14/255,187/255,139/255);
+ draw (((0,0)--(0,18pt)) shifted(9,-9)) withpen pencircle scaled 1bp withcolor if print: 0.5*coefprint*White else: (69/255,168/255,140/255) fi;%Trop clair->(14/255,187/255,139/255);
);
titi
enddef;
@@ -1574,7 +1577,7 @@
draw (6.496090,12.082000);
drawoptions();
pickup pencircle scaled 0bp;
- draw (-3,0)--(-3,18) withcolor if print : coefprint*white else: StyloTrois fi;
+ draw (-3,0)--(-3,18) withcolor if print : coefprint*White else: StyloTrois fi;
pickup pencircle scaled eppen;
);
cray:=cray shifted((0,-9pt));
@@ -1598,7 +1601,7 @@
(ulcorner texto+(0,eb)){dir180}..{dir-90}(ulcorner texto+(-eb,0))--cycle;
picture TEXT;
TEXT=image(
- fill cadre withcolor if print : coefprint*white else : if unknown colControle : LightOrange else : colControle fi fi;
+ fill cadre withcolor if print : coefprint*White else : if unknown colControle : LightOrange else : colControle fi fi;
draw texto;
draw cadre withcolor CoulLignes;
);
@@ -1683,8 +1686,8 @@
{dir90}(llcorner texto+(0.125,0)+(0,eb))--
cycle;
$=image(
- fill cadre withcolor if print : coefprint*white else : if unknown colControle : LightOrange else : colControle fi fi;
- draw cadre withcolor if print : coefprint*white else : if unknown colControle : LightOrange else : colControle fi fi;
+ fill cadre withcolor if print : coefprint*White else : if unknown colControle : LightOrange else : colControle fi fi;
+ draw cadre withcolor if print : coefprint*White else : if unknown colControle : LightOrange else : colControle fi fi;
AA:=ahangle;
ahangle:=90;
drawarrow (lrcorner texto+(-0.625cm,0.15cm)){dir-15}..{dir90}(urcorner texto+(-0.25cm,-0.1cm)) withpen pencircle scaled2bp if print=false : withcolor white fi;
@@ -1798,8 +1801,8 @@
cycle;
fi;
$=image(
- fill cadre withcolor if print : coefprint*white else : if unknown colControle : LightOrange else : colControle fi fi;
- draw cadre withcolor if print : coefprint*white else : if unknown colControle : LightOrange else : colControle fi fi;
+ fill cadre withcolor if print : coefprint*White else : if unknown colControle : LightOrange else : colControle fi fi;
+ draw cadre withcolor if print : coefprint*White else : if unknown colControle : LightOrange else : colControle fi fi;
draw texto;
if BlocStopAvant=false:
draw (coindebutbloc[numblocrep]+(0.0625+0.5cm,0)+(eb,0)){dir180}..
@@ -1908,8 +1911,8 @@
cycle;
fi;
$=image(
- fill cadre withcolor if print=true : coefprint*white else : if unknown colControle : LightOrange else : colControle fi fi;
- draw cadre withcolor if print=true : coefprint*white else : if unknown colControle : LightOrange else : colControle fi fi;
+ fill cadre withcolor if print=true : coefprint*White else : if unknown colControle : LightOrange else : colControle fi fi;
+ draw cadre withcolor if print=true : coefprint*White else : if unknown colControle : LightOrange else : colControle fi fi;
if print:
label.rt(TEX("\longbarre\sffamily\bfseries sinon"),(xpart(llcorner texto),ypart(center texto)));
else:
@@ -2303,7 +2306,7 @@
cycle;
picture TEXT;
TEXT=image(
- fill cadre withcolor if print : coefprint*white else : BlocTrois fi;%if unknown colBloc : DarkPurple else: colBloc fi fi;
+ fill cadre withcolor if print : coefprint*White else : BlocTrois fi;%if unknown colBloc : DarkPurple else: colBloc fi fi;
draw texto;
draw cadre withcolor CoulLignes;
);
@@ -2662,7 +2665,7 @@
fill (cc shifted(B+(10,3*k))) withcolor coul[k];
draw (cc shifted(B+(10,3*k))) withcolor 0.95*coul[k];
endfor;
- draw ((-3,0)--(-3,18)) withcolor if print : coefprint*white else: StyloTrois fi;
+ draw ((-3,0)--(-3,18)) withcolor if print : coefprint*White else: StyloTrois fi;
pickup pencircle scaled eppen;
);
$:=$ scaled 0.8;
@@ -2674,7 +2677,7 @@
picture titi;
titi=image(
draw CameraImage shifted(-12,-5);
- draw (((0,0)--(0,18pt)) shifted(9,-9)) withpen pencircle scaled 1bp withcolor if print: 0.5*coefprint*white else: (69/255,168/255,140/255) fi;
+ draw (((0,0)--(0,18pt)) shifted(9,-9)) withpen pencircle scaled 1bp withcolor if print: 0.5*coefprint*White else: (69/255,168/255,140/255) fi;
);
titi
enddef;
@@ -2734,7 +2737,7 @@
path ta;
ta=OvalBox(texto);
$=image(
- fill ta withcolor if print: coefprint*white else: StyloTrois fi;
+ fill ta withcolor if print: coefprint*White else: StyloTrois fi;
draw ta withcolor CoulLignes;
%label(TEX(TTm),center ta) if print=false : withcolor blanc fi;
draw texto;
@@ -2924,9 +2927,9 @@
LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$+$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -2939,9 +2942,9 @@
LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$-$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -2954,9 +2957,9 @@
LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$\times$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -2969,9 +2972,9 @@
LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$*$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -2984,9 +2987,9 @@
LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$\div$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -2999,9 +3002,9 @@
LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$/$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -3014,9 +3017,9 @@
LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"modulo",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -3029,9 +3032,9 @@
LOPop=ColleBoxNew("nombre aléatoire entre",if string pasun : OvalNb(pasun) else: pasun fi,"et",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -3044,9 +3047,9 @@
LOPop=ColleBoxNew("regrouper",if string pasun : OvalNb(pasun) else: pasun fi,"et",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -3059,9 +3062,9 @@
LOPop=ColleBoxNew("lettre",if string pasun : OvalNb(pasun) else: pasun fi,"de",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -3074,9 +3077,9 @@
LOPop=ColleBoxNew("longueur de",if string pasun : OvalNb(pasun) else: pasun fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -3089,9 +3092,9 @@
LOPop=ColleBoxNew("arrondi de",if string pasun : OvalNb(pasun) else: pasun fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -3104,9 +3107,9 @@
LOPop=ColleBoxNew(RecMenuOp(pasun),"de",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAao=OvalBox(LOPop);
Oop=image(
- fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LOPop;
- draw TAao if print=false : withcolor coefprint*white fi;
+ draw TAao if print=false : withcolor coefprint*White fi;
);
Oop:=Oop shifted(-center Oop);
Oop
@@ -3119,9 +3122,9 @@
LTa=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$>$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3134,9 +3137,9 @@
LTa=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$<$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3149,9 +3152,9 @@
LTa=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$=$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3164,9 +3167,9 @@
LTa=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"et",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3179,9 +3182,9 @@
LTa=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"ou",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3194,9 +3197,9 @@
LTa=ColleBoxNew("non",if string pasun : OvalNb(pasun) else: pasun fi);
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3209,9 +3212,9 @@
LTa=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"contient",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi,"?");
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor FondOvalOp else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3224,9 +3227,9 @@
LTa=ColleBoxNew(RecMenuApp(pasun),"du costume");
TAa=OvalBox(LTa);
$=image(
- fill TAa if print=false : withcolor VioletAppTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor VioletAppTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3239,9 +3242,9 @@
LTa=ColleBoxNew(RecMenuApp(pasun),"de l'arrière-plan");
TAa=OvalBox(LTa);
$=image(
- fill TAa if print=false : withcolor VioletAppTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor VioletAppTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3254,9 +3257,9 @@
LTa=ColleBoxNew("distance de",OvalCapMenu(pasun));
TAa=OvalBox(LTa);
$=image(
- fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3269,9 +3272,9 @@
LTa=ColleBoxNew(RecMenuCap(pasun),"actuelle");
TAa=OvalBox(LTa);
$=image(
- fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3284,9 +3287,9 @@
LTa=ColleBoxNew(RecMenuCap(pasun),"de",OvalCapMenu(pasdeux));
TAa=OvalBox(LTa);
$=image(
- fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3299,9 +3302,9 @@
LTa=ColleBoxNew("touche le",OvalCapMenu(pasun),"?");
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3314,9 +3317,9 @@
LTa=ColleBoxNew("couleur",OvalCouleur(redpart(pasun),greenpart(pasun),bluepart(pasun)),"touchée ?");
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3329,9 +3332,9 @@
LTa=ColleBoxNew("couleur",OvalCouleur(redpart(pasun),greenpart(pasun),bluepart(pasun)),"touche",OvalCouleur(redpart(pasdeux),greenpart(pasdeux),bluepart(pasdeux)),"?");
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3344,9 +3347,9 @@
LTa=ColleBoxNew("touche",OvalMenuCap(pasun),"pressée ?");
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3359,9 +3362,9 @@
LTa=ColleBoxNew("souris pressée ?");
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor CapteurTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3374,9 +3377,9 @@
LTa=ColleBoxNew(RecMenuList(nbpas),"contient",if string nbbas:OvalNb(nbbas) else: nbbas fi);
TAa=DiamondBox(LTa);
$=image(
- fill TAa if print=false : withcolor OrangeListTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor OrangeListTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3389,9 +3392,9 @@
LTa=ColleBoxNew("élément",if string nbpas:OvalNb(nbpas) else: nbpas fi,"de",RecMenuList(nbbas));
TAa=OvalBox(LTa);
$=image(
- fill TAa if print=false : withcolor OrangeListTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor OrangeListTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3404,9 +3407,9 @@
LTa=ColleBoxNew("position de",if string nbpas:OvalNb(nbpas) else: nbpas fi,"de",RecMenuList(nbbas));
TAa=OvalBox(LTa);
$=image(
- fill TAa if print=false : withcolor OrangeListTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor OrangeListTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
@@ -3419,9 +3422,9 @@
LTa=ColleBoxNew("longueur de",RecMenuList(nbpas));
TAa=OvalBox(LTa);
$=image(
- fill TAa if print=false : withcolor OrangeListTrois else : withcolor coefprint*white fi;
+ fill TAa if print=false : withcolor OrangeListTrois else : withcolor coefprint*White fi;
draw LTa;
- draw TAa if print=false : withcolor coefprint*white fi;
+ draw TAa if print=false : withcolor coefprint*White fi;
);
$:=$ shifted(-center $);
$
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCSolid.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCSolid.mp 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCSolid.mp 2024-03-24 20:05:42 UTC (rev 70746)
@@ -125,7 +125,8 @@
% (Ypart(M)+0.5*cosd(30)*Xpart(M),Zpart(M)+0.5*sind(30)*Xpart(M))*20%Good avec Theta=-20/Phi=-10
%(Ypart(GCoord(M))+0.5*cosd(-30)*Xpart(GCoord(M)),Zpart(GCoord(M))+0.5*sind(-30)*Xpart(GCoord(M)))*20%Good avec Theta=-20/Phi=-10
% (Xpart(GCoord(M))*cosd(90-30),Ypart(GCoord(M))*sind(90-30)*0.5)*DE%\xE0 garder peut-\xEAtre ?
- (Xpart(GCoordcabinet(M)),Ypart(GCoordcabinet(M)))*DE%
+% (Xpart(GCoordcabinet(M)),Ypart(GCoordcabinet(M)))*DE%<-last good :)
+ ((Xpart(GCoordcabinet(M)),Ypart(GCoordcabinet(M)))/Zpart(GCoordcabinet(M)))*DE
%(Zpart(GCoord(M))+0.5*cosd(-30)*Ypart(GCoord(M)),Xpart(GCoord(M))+0.5*sind(-30)*Ypart(GCoord(M)))*20
% (0.5*cosd(45)*Xpart(GCoord(M)),0.5*sind(45)*Ypart(GCoord(M)))*unit*DE
% (Xpart(GCoord(M)),Ypart(GCoord(M)))*unit*DE
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCAN.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCAN.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCAN.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -308,7 +308,8 @@
\hline%
\endhead%
\xintFor* ##1 in {\xintSeq{1}{\ListeFichierslen}}\do{%
- \ttfamily{\theCNNumQ}\stepcounter{CNNumQ}&\xdef\CNReponse{}\input{\ListeFichiers[##1]}\ifboolKV[ClesCN]{Nom}{\par\hfill\footnotesize\ttfamily\ListeFichiers[##1]}{}&\ifboolKV[ClesCN]{CAN}{\ifboolKV[ClesCN]{Nom}{\multirow{2}{*}{\CNReponse}}{\multirow{1}{*}{\CNReponse}}}{}&\\%
+ \ttfamily{\theCNNumQ}\stepcounter{CNNumQ}&\xdef\CNReponse{}\input{\ListeFichiers[##1]}\ifboolKV[ClesCN]{Nom}{\par\hfill\footnotesize\ttfamily\ListeFichiers[##1]}{}&\CNReponse%\ifboolKV[ClesCN]{CAN}{\ifboolKV[ClesCN]{Nom}{\multirow{2}{*}{\CNReponse}}{\multirow{1}{*}{\CNReponse}}}{}
+ &\\%
\hline%
}%
\end{longtable}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculatrice.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculatrice.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculatrice.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -5,7 +5,7 @@
\definecolor{lightorange}{rgb}{0.9,0.4,0}%
\definecolor{lightestorange}{rgb}{1,0.8,0.5}%
\definecolor{darkorange}{rgb}{0.2,0.1,0}%
-
+%
\colorlet{blackened}{black!90!white}%
\colorlet{blackish}{black!70!white}%
\colorlet{greyish}{black!60!white}%
@@ -13,100 +13,100 @@
\colorlet{orangeish}{yellow!90!red}%
\colorlet{greenish}{green!16!gray}%
\colorlet{redish}{red!80!black}%
-
+%
\tcbset{calbackground/.style={%
- enhanced,
- leftright skip=0.25cm,beforeafter skip=0pt,
- toptitle=0mm,bottomtitle=0mm,
- right=2mm,left=2mm,
- top=1pt,
- bottom=0.25cm,
- boxsep=0pt,
- boxrule=0mm,
- sharp corners,
- sidebyside,
- sidebyside gap=2mm,
- lefthand ratio=0.6,
- bicolor,
- colback=black!10!white,
- colbacklower=greenish,
- colframe=white,
- autoparskip,
+ enhanced,%
+ leftright skip=0.25cm,beforeafter skip=0pt,%
+ toptitle=0mm,bottomtitle=0mm,%
+ right=2mm,left=2mm,%
+ top=1pt,%
+ bottom=0.25cm,%
+ boxsep=0pt,%
+ boxrule=0mm,%
+ sharp corners,%
+ sidebyside,%
+ sidebyside gap=2mm,%
+ lefthand ratio=0.6,%
+ bicolor,%
+ colback=black!10!white,%
+ colbacklower=greenish,%
+ colframe=white,%
+ autoparskip,%
}}%
-
+%
\newtcbox{\KY}[1][]{%
- enhanced,
- on line,
- arc=2pt,outer arc=2pt,
- boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,
- boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,
- interior style={top color=blackish,bottom color=blackened},
- colframe=greyish,
- width=2.5em,
- tcbox width=forced center,
- equal height group=K,
- valign=center,
- fontupper=\footnotesize\sffamily,
- coltext=orangeish,
- before upper=\vrule width 0pt height 2ex depth 1ex\relax,
+ enhanced,%
+ on line,%
+ arc=2pt,outer arc=2pt,%
+ boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,%
+ boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,%
+ interior style={top color=blackish,bottom color=blackened},%
+ colframe=greyish,%
+ width=2.5em,%
+ tcbox width=forced center,%
+ equal height group=K,%
+ valign=center,%
+ fontupper=\footnotesize\sffamily,%
+ coltext=orangeish,%
+ before upper=\vrule width 0pt height 2ex depth 1ex\relax,%
}%
-
+%
\newtcbox{\KYm}[1][]{%
- enhanced,
- on line,
- arc=2pt,outer arc=2pt,
- boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,
- boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,
- interior style={top color=blackish,bottom color=blackened},
- colframe=greyish,
- width=2.5em,
- tcbox width=forced center,
- equal height group=K,
- valign=center,
- fontupper=\footnotesize\sffamily,
- coltext=orangeish,
- before upper=\vrule width 0pt height 2ex depth 1ex\relax$,
- after upper=$,
+ enhanced,%
+ on line,%
+ arc=2pt,outer arc=2pt,%
+ boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,%
+ boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,%
+ interior style={top color=blackish,bottom color=blackened},%
+ colframe=greyish,%
+ width=2.5em,%
+ tcbox width=forced center,%
+ equal height group=K,%
+ valign=center,%
+ fontupper=\footnotesize\sffamily,%
+ coltext=orangeish,%
+ before upper=\vrule width 0pt height 2ex depth 1ex\relax$,%
+ after upper=$,%
}%
-
+%
\newtcbox{\KN}{%
- enhanced,
- on line,
- arc=2pt,outer arc=2pt,
- boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,
- boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,
- interior style={top color=blackish,bottom color=blackened},
- colframe=greyish,
- width=1.5em,
- tcbox width=forced center,
- equal height group=K,
- valign=center,
- fontupper=\footnotesize\sffamily,
- coltext=whiteish,
- before upper=\vrule width 0pt height 2ex depth 1ex\relax,
+ enhanced,%
+ on line,%
+ arc=2pt,outer arc=2pt,%
+ boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,%
+ boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,%
+ interior style={top color=blackish,bottom color=blackened},%
+ colframe=greyish,%
+ width=1.5em,%
+ tcbox width=forced center,%
+ equal height group=K,%
+ valign=center,%
+ fontupper=\footnotesize\sffamily,%
+ coltext=whiteish,%
+ before upper=\vrule width 0pt height 2ex depth 1ex\relax,%
}%
-
+%
\newtcolorbox{calc}[1][]{%
- enhanced,bicolor,
- boxsep=0pt,
- boxrule=0pt,
- top=6pt,bottom=0pt,left=6pt,right=0pt,
- sharp corners,
- frame empty,
- colback=black!10,
- colbacklower=greenish,
- sidebyside,
- sidebyside align=top seam,
- sidebyside gap=0pt,
- righthand width=50.7mm,
- before lower=\begin{tabular}{@{}l@{}},
- after lower=\end{tabular},
+ enhanced,bicolor,%
+ boxsep=0pt,%
+ boxrule=0pt,%
+ top=6pt,bottom=0pt,left=6pt,right=0pt,%
+ sharp corners,%
+ frame empty,%
+ colback=black!10,%
+ colbacklower=greenish,%
+ sidebyside,%
+ sidebyside align=top seam,%
+ sidebyside gap=0pt,%
+ righthand width=50.7mm,%
+ before lower=\begin{tabular}{@{}l@{}},%
+ after lower=\end{tabular},%
overlay={\node[inner sep=0pt, outer sep=0pt, text height=5pt, text
depth=1pt, text width=50.7mm, fill=greenish, anchor=north
east, font=\sffamily\tiny\bfseries, align=flush right]
- at (frame.north east) {#1};}
-}
-
+ at (frame.north east) {#1};}%
+}%
+%
\def\MPCalculatrice#1#2#3{%
% #1 Calcul %2 r\'eponse
\ifluatex%
@@ -122,20 +122,28 @@
LargeurEcran:=\useKV[ClesCalculatrice]{Largeur};
boolean Calcul;
Calcul=\useKV[ClesCalculatrice]{Calcul};
- print:=\useKV[ClesCalculatrice]{Impression};
+ print:=\useKV[ClesCalculatrice]{Impression};
+ Math:=\useKV[ClesCalculatrice]{Math};
LCD(#1)(#2)(#3);
\end{mplibcode}%
\mplibnumbersystem{scaled}%
\else%
- \begin{mpost}[mpsettings={input PfCCalculatrice;LargeurEcran:=\useKV[ClesCalculatrice]{Largeur};}]
- LCD(#1)(#2)(#3);
- \end{mpost}
+ \begin{mpost}[mpsettings={input PfCCalculatrice;LargeurEcran:=\useKV[ClesCalculatrice]{Largeur};}]%
+ LCD(#1)(#2)(#3);%
+ \end{mpost}%
\fi%
}%
+%
+\setKVdefault[ClesCalculatrice]{ModeleCouleur=5,Ecran=false,NbLignes=0,BL=0.775,Largeur=120,Calcul=false,Impression=false,Math}%
+%
+\NewDocumentCommand\Calculatrice{}{%On désactive le ~ qui pose souci avec babel
+ \begingroup
+ \catcode`\~12
+ \Calculatriceaux
+}%
-\setKVdefault[ClesCalculatrice]{ModeleCouleur=5,Ecran=false,NbLignes=0,BL=0.775,Largeur=120,Calcul=false,Impression=false}%
-
-\newcommand\Calculatrice[2][]{%
+\NewDocumentCommand\Calculatriceaux{om}{%
+ \endgroup
\setstackgap{L}{\useKV[ClesCalculatrice]{BL}\baselineskip}%
\useKVdefault[ClesCalculatrice]%
\setKV[ClesCalculatrice]{#1}%
@@ -147,12 +155,12 @@
\setsepchar[*]{,*/}\reademptyitems%
\readlist\ListeCalc{#2}%
}%
- \ignoreemptyitems
+ \ignoreemptyitems%
\MPCalculatrice{\ListeCalc[1,1]}{\ListeCalc[1,2]}{\useKV[ClesCalculatrice]{NbLignes}}%
}{%
\setsepchar[*]{,*/}\reademptyitems%
\readlist\ListeCalc{#2}%
- \ignoreemptyitems
+ \ignoreemptyitems%
\foreachitem\compteur\in\ListeCalc{\xintifboolexpr{\listlen\ListeCalc[\compteurcnt]==2}{\Longstack{{\tiny\ListeCalc[\compteurcnt,1]} \KN{\ListeCalc[\compteurcnt,2]}}}{\Longstack{{\tiny\ListeCalc[\compteurcnt,2]} \KY{\ListeCalc[\compteurcnt,3]}}}%
}%
}%
Deleted: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractionsoldv1.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractionsoldv1.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractionsoldv1.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,192 +0,0 @@
-\setKVdefault[CalculsFractions]{Couleurs=false,Negatif=false}%
-\defKV[CalculsFractions]{Couleur=\setKV[CalculsFractions]{Couleurs}}%
-
-\NewDocumentCommand\tofrac{m}{%
- \IfDecimal{#1}{#1}{%
- \StrBefore{#1}{/}[\PfCnum]%
- \StrBehind{#1}{/}[\PfCden]%
- \ifnum\PfCden=1\relax%
- \num{\PfCnum}%
- \else%
- \frac{\num{\PfCnum}}{\num{\PfCden}}%
- \fi%
- }%
-}%
-
-\NewDocumentCommand\AddFraction{soommo}{%
- \useKVdefault[CalculsFractions]%
- \setKV[CalculsFractions]{#2}%
- \ifboolKV[CalculsFractions]{Couleurs}{\colorlet{CouleurDenoCom}{\useKV[CalculsFractions]{Couleur}}}{\colorlet{CouleurDenoCom}{black}}%
- \IfBooleanTF{#1}{%
- \xdef\PfCFractionOp{-}%
- }{%
- \xdef\PfCFractionOp{+}%
- }%
- \IfDecimal{#4}{%
- \xdef\PfCNumA{#4}%
- \xdef\PfCNumB{1}%
- }{%
- \StrCut{#4}{/}\PfCNumA\PfCNumB%
- }%
- \IfDecimal{#5}{%
- \xdef\PfCNumC{#5}%
- \xdef\PfCNumD{1}%
- }{%
- \StrCut{#5}{/}\PfCNumC\PfCNumD%
- }
- \xdef\PfCAddFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
- \setsepchar[*]{,*/}\ignoreemptyitems%
- \readlist*\ListeFractions{\PfCAddFoo}%
- \reademptyitems%
- \setsepchar{,}%
- % Partie calculs
- \PGCD{\fpeval{abs(\ListeFractions[1,2])}}{\fpeval{abs(\ListeFractions[2,2])}}%
-% pgcd=\the\pgcd%
- \xdef\PfCPremierMul{\fpeval{\ListeFractions[2,2]/\the\pgcd}}%
-% PfCPremierMul=\PfCPremierMul
- \xdef\PfCDeuxiemeMul{\fpeval{\ListeFractions[1,2]/\the\pgcd}}%
- \xdef\PfCAddNumFin{\fpeval{(\ListeFractions[1,1])*(\PfCPremierMul)\PfCFractionOp(\ListeFractions[2,1])*(\PfCDeuxiemeMul)}}%
- \xdef\PfCAddDenoFin{\fpeval{(\ListeFractions[1,2])*(\PfCPremierMul)}}%
- \PGCD{\fpeval{abs(\PfCAddNumFin)}}{\fpeval{abs(\PfCAddDenoFin)}}\xdef\PfCAddPgcd{\the\pgcd}%
- \xdef\PfCAddNumSimp{\fpeval{\PfCAddNumFin/\PfCAddPgcd}}%
- \xdef\PfCAddDenoSimp{\fpeval{\PfCAddDenoFin/\PfCAddPgcd}}%
- \xdef\PfCAddSumSimp{\PfCAddNumSimp/\PfCAddDenoSimp}%
- \IfValueT{#6}{\xdef#6{\PfCAddSumSimp}}%
- % Partie affichage
- \ensuremath{%
- \IfValueTF{#3}{%
- \ifnum#3=4\relax%
- %test
- \ifboolKV[CalculsFractions]{Negatif}{%
- \xintifboolexpr{\fpeval{\PfCAddNumSimp/\PfCAddDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCAddNumSimp)}/\fpeval{abs(\PfCAddDenoSimp)}}}{\tofrac{\PfCAddSumSimp}}%
- }{\tofrac{\PfCAddSumSimp}}%
- \else%
- \ifnum#3=3\relax%
- \SSimpliTest{\fpeval{abs(\PfCAddNumFin)}}{\fpeval{abs(\PfCAddDenoFin)}}\ifthenelse{\boolean{Simplification}}{\tofrac{\PfCAddNumFin/\PfCAddDenoFin}}{\tofrac{\PfCAddSumSimp}}%
- \else%
- \ifnum#3=1\relax%
- \ifnum\fpeval{abs(\PfCPremierMul)}>1\relax%
- \frac{\ListeFractions[1,1]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCPremierMul}}}}{\ListeFractions[1,2]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCPremierMul}}}}
- \else%
- \tofrac{#4}%
- \fi%
- \PfCFractionOp%
- \ifnum\fpeval{abs(\PfCDeuxiemeMul)}>1\relax%
- \frac{\ListeFractions[2,1]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCDeuxiemeMul}}}}{\ListeFractions[2,2]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCDeuxiemeMul}}}}%
- \else%
- \tofrac{#5}%
- \fi%
- \else%
- \ifnum#3=2\relax%
- \frac{\num{\fpeval{\ListeFractions[1,1]*\PfCPremierMul}}}{\num{\fpeval{\ListeFractions[1,2]*\PfCPremierMul}}}\PfCFractionOp\frac{\num{\fpeval{\ListeFractions[2,1]*\PfCDeuxiemeMul}}}{\num{\fpeval{\ListeFractions[2,2]*\PfCDeuxiemeMul}}}%
- \fi%
- \fi%
- \fi%
- \fi%
- }{\tofrac{#4}\PfCFractionOp\tofrac{#5}
- }%
- }%
-}%
-
-\NewDocumentCommand\SousFraction{oommo}{%
- \AddFraction*[#1][#2]{#3}{#4}[#5]%
-}%
-
-\NewDocumentCommand\MulFraction{oommo}{%
- \useKVdefault[CalculsFractions]%
- \setKV[CalculsFractions]{#1}%
- \IfDecimal{#3}{%
- \xdef\PfCNumA{#3}%
- \xdef\PfCNumB{1}%
- }{%
- \StrCut{#3}{/}{\PfCNumA}{\PfCNumB}%
- }%
- \IfDecimal{#4}{%
- \xdef\PfCNumC{#4}%
- \xdef\PfCNumD{1}%
- }{%
- \StrCut{#4}{/}{\PfCNumC}{\PfCNumD}%
- }%
- \xdef\PfCMulFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
- \setsepchar[*]{,*/}\ignoreemptyitems%
- \readlist*\ListeFractions{\PfCMulFoo}%
- \reademptyitems
- \setsepchar{,}%
- % Calculs
- \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{%
- \IfValueTF{#2}{%
- \ifnum#2=3\relax
- \ifboolKV[CalculsFractions]{Negatif}{%
- \xintifboolexpr{\fpeval{\PfCMulNumSimp/\PfCMulDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCMulNumSimp)}/\fpeval{abs(\PfCMulDenoSimp)}}}{\tofrac{\PfCMulPdtSimp}}%
- }{\tofrac{\PfCMulPdtSimp}}%
- \else
- \ifnum#2=2\relax%
- \SSimpliTest{\PfCMulNumFin}{\PfCMulDenoFin}\ifthenelse{\boolean{Simplification}}{\frac{\ifnum\PfCMulNumFin<0\relax-\fi\Decomposition[Longue]{\fpeval{abs(\PfCMulNumFin)}}}{\ifnum\PfCMulDenoFin<0\relax-\fi\Decomposition[Longue]{\fpeval{abs(\PfCMulDenoFin)}}}}{\tofrac{\PfCMulPdtSimp}}%
- \else%
- \ifnum#2=1\relax%
- \frac{\ListeFractions[1,1]\times\ifnum\ListeFractions[2,1]<0\relax(\fi\ListeFractions[2,1]\ifnum\ListeFractions[2,1]<0\relax)\fi}{\ListeFractions[1,2]\times\ifnum\ListeFractions[2,2]<0\relax(\fi\ListeFractions[2,2]\ifnum\ListeFractions[2,2]<0\relax)\fi}
- \fi
- \fi
- \fi
- }{\tofrac{#3}\times\tofrac{#4}
- }
- }%
-}%
-
-\NewDocumentCommand\DivFraction{oommo}{%
- \useKVdefault[CalculsFractions]%
- \setKV[CalculsFractions]{#1}%
- \IfDecimal{#3}{%
- \xdef\PfCNumA{#3}%
- \xdef\PfCNumB{1}%
- }{%
- \StrCut{#3}{/}{\PfCNumA}{\PfCNumB}%
- }%
- \IfDecimal{#4}{%
- \xdef\PfCNumC{#4}%
- \xdef\PfCNumD{1}%
- }{%
- \StrCut{#4}{/}{\PfCNumC}{\PfCNumD}%
- }%
- \xdef\PfCDivFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
- \setsepchar[*]{,*/}\ignoreemptyitems%
- \readlist*\ListeFractions{\PfCDivFoo}%
- \reademptyitems%
- \setsepchar{,}%
- % Calculs
- \xdef\PfCDivNumFin{\fpeval{(\ListeFractions[1,1])*(\ListeFractions[2,2])}}%
- \xdef\PfCDivDenoFin{\fpeval{\ListeFractions[1,2]*\ListeFractions[2,1]}}%
- \PGCD{\fpeval{abs(\PfCDivNumFin)}}{\fpeval{abs(\PfCDivDenoFin)}}\xdef\PfCDivPgcd{\pgcd}%
- \xdef\PfCDivNumSimp{\fpeval{\PfCDivNumFin/\PfCDivPgcd}}%
- \xdef\PfCDivDenoSimp{\fpeval{\PfCDivDenoFin/\PfCDivPgcd}}%
- \xdef\PfCDivPdtSimp{\PfCDivNumSimp/\PfCDivDenoSimp}%
- \IfValueT{#5}{\xdef#5{\PfCDivPdtSimp}}%
- \ensuremath{%
- \IfValueTF{#2}{%
- \ifnum#2=4\relax
- \ifboolKV[CalculsFractions]{Negatif}{%
- \xintifboolexpr{\fpeval{\PfCDivNumSimp/\PfCDivDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCDivNumSimp)}/\fpeval{abs(\PfCDivDenoSimp)}}}{\tofrac{\PfCDivPdtSimp}}%
- }{\tofrac{\PfCDivPdtSimp}}%
- \else\ifnum#2=3\relax
- \MulFraction[][\fpeval{#2-1}]{\ListeFractions[1,1]/\ListeFractions[1,2]}{\ListeFractions[2,2]/\ListeFractions[2,1]}%
- \else
- \ifnum#2=2\relax%
- \MulFraction[][\fpeval{#2-1}]{\ListeFractions[1,1]/\ListeFractions[1,2]}{\ListeFractions[2,2]/\ListeFractions[2,1]}%
- \else%
- \ifnum#2=1\relax%
- \tofrac{\ListeFractions[1,1]/\ListeFractions[1,2]}\times\tofrac{\ListeFractions[2,2]/\ListeFractions[2,1]}
- \fi
- \fi
- \fi
- \fi
- }{\tofrac{#3}\div\tofrac{#4}
- }
- }%
-}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -336,6 +336,10 @@
\end{tikzpicture}%
}{}%
+% Pour construire la liste des cartes lors d'un ajout automatiques
+\newtoks\TokListeAjout{}
+\def\UpdatetoksCartes#1/#2\nil{\addtotok\TokListeAjout{§#1/#2}}%
+
\NewDocumentCommand\CartesPerso{o +m}{%
% 0/ La largeur est \useKV[Cards]{Largeur} - La hauteur est \useKV[Cards]{Hauteur}.\par
\useKVdefault[Cards]%
@@ -383,11 +387,33 @@
% Dimensions intérieures des cartes
\setlength{\hauteurcarte}{\fpeval{\hauteurcards-\margecards}pt}%
\setlength{\largeurcarte}{\fpeval{\largeurcards-\margecards}pt}%
- % nombre de cartes sur la largeur
+ % nombre de cartes sur la largeur et sur la hauteur
\xdef\PfCNbCartesLarg{\fpeval{floor(\paperwidth/\largeurcards)}}%
\xdef\PfCNbCartesHaut{\fpeval{floor(\paperheight/\hauteurcards)}}%
\xdef\PfCNbCartesPerso{\fpeval{\PfCNbCartesLarg*\PfCNbCartesHaut}}%
- % Jointes
+ % On vérifie si le nombres de déclarations de cartes est compatible avec le nombre total de cartes calculé automatiquement. Mais pas dans le mode Trivial et surtout pas dans le cas où la trame n'est pas utilisée !
+ \ifboolKV[Cards]{Trame}{%
+ \ifboolKV[Cards]{Trivial}{}{%
+ \xintifboolexpr{\PfCNbCartesPerso==\ListeCardslen}{%
+ % Je ne dois pas ajouter de cartes
+ }{%
+ % Je passe ici et j'ajoute des cartes\\
+ % Je dois en ajouter \fpeval{\PfCNbCartesPerso-\ListeCardslen}%
+ \ifnum\fpeval{\PfCNbCartesPerso-\ListeCardslen}>0
+ \foreachitem\compteur\in\ListeCards{\expandafter\UpdatetoksCartes\compteur\nil}%
+ \def\PfCFooAjout{Non connue/Non connue}
+ \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNbCartesPerso-\ListeCardslen}}}\do{%
+ \expandafter\UpdatetoksCartes\PfCFooAjout\nil
+ }%
+ \xdef\PfCFooAjoutBis{\the\TokListeAjout}%
+ \setsepchar[*]{§*/}%
+ \readlist*\ListeCards{\PfCFooAjoutBis}%
+ \setsepchar{,}%
+ \fi
+ }%
+ }}{}%
+ % fin Ajout automatique
+ % Jointes
\ifboolKV[Cards]{Jointes}{\setlength{\largeurcards}{\largeurcarte}}{}%
\ifboolKV[Cards]{Jointes}{\setlength{\hauteurcards}{\hauteurcarte}}{}%
% décalage entre les cartes ou pas
@@ -424,10 +450,11 @@
\clearpage%
\thispagestyle{empty}%
\begin{Trame}
- \multido{\i=1+1}{\PfCNbCartesPerso}{%
- \node[] at (Carte\i) {%
+ %\multido{\i=1+1}{\PfCNbCartesPerso}{%
+\xintFor* ##1 in{\xintSeq{1}{\PfCNbCartesPerso}}\do{
+ \node[] at (Carte##1) {%
\begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
- \ListeCards[\i,1]%
+ \ListeCards[##1,1]%
\end{MyboxSimpleAv}%
};%
}%
@@ -469,10 +496,11 @@
\clearpage%
\thispagestyle{empty}%
\begin{Trame}
- \multido{\i=1+1}{\PfCNbCartesPerso}{%
- \node[] at (Carte\i) {%
- \begin{Mybox}{\ListeCards[\i,1]}{\useKV[Cards]{Theme}}{\ListeCards[\i,2]}%
- \ListeCards[\i,3]%
+% \multido{\i=1+1}{\PfCNbCartesPerso}{%
+\xintFor* ##1 in{\xintSeq{1}{\PfCNbCartesPerso}}\do{
+ \node[] at (Carte##1) {%
+ \begin{Mybox}{\ListeCards[##1,1]}{\useKV[Cards]{Theme}}{\ListeCards[##1,2]}%
+ \ListeCards[##1,3]%
\end{Mybox}%
};%
}%
@@ -513,9 +541,10 @@
\clearpage%
\thispagestyle{empty}%
\begin{Trame}
- \multido{\i=1+1}{\PfCNbCartesPerso}{%
- \node[] at (Carte\i) {%
- \begin{MyboxJQ}{\ListeCards[\i,1]}{\ListeCards[\i,2]}%
+% \multido{\i=1+1}{\PfCNbCartesPerso}{%
+\xintFor* ##1 in{\xintSeq{1}{\PfCNbCartesPerso}}\do{
+ \node[] at (Carte##1) {%
+ \begin{MyboxJQ}{\ListeCards[##1,1]}{\ListeCards[##1,2]}%
%%
\end{MyboxJQ}%
};%
@@ -562,13 +591,14 @@
\clearpage%
\thispagestyle{empty}%
\begin{Trame}
- \multido{\i=1+1}{\PfCNbCartesPerso}{%
- \node[] at (Carte\i) {%
+% \multido{\i=1+1}{\PfCNbCartesPerso}{%
+\xintFor* ##2 in{\xintSeq{1}{\PfCNbCartesPerso}}\do{
+ \node[] at (Carte##2) {%
\begin{MyboxTrivial}%
\begin{center}
\begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[9,m]}[hvlines]%
\xintFor* ##1 in{\xintSeq{1}{6}}\do{%
- \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\i,\fpeval{1+2*(##1-1)}]\\
+ \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[##2,\fpeval{1+2*(##1-1)}]\\
}%
\end{NiceTabular}%
\end{center}%
@@ -634,13 +664,14 @@
\clearpage%
\thispagestyle{empty}%
\begin{Trame}
- \multido{\i=1+1}{\PfCNbCartesPerso}{%
- \node[] at (Carte\i) {%
+% \multido{\i=1+1}{\PfCNbCartesPerso}{%
+\xintFor* ##2 in{\xintSeq{1}{\PfCNbCartesPerso}}\do{
+ \node[] at (Carte##2) {%
\begin{MyboxTrivial}%
\begin{center}
\begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[9,m]}[hvlines]%
\xintFor* ##1 in{\xintSeq{1}{6}}\do{%
- \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\i,\fpeval{1+2*(##1-1)}]\\
+ \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[##2,\fpeval{1+2*(##1-1)}]\\
}%
\end{NiceTabular}%
\end{center}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesMentales.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesMentales.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesMentales.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -6,7 +6,7 @@
\newlength{\RoundedBoxWidth}%
-\NewEnviron{Bulle}[1][]{%
+\NewDocumentEnvironment{Bulle}{o+b}{%
\setKV[ClesMentales]{#1}%
\setlength{\RoundedBoxWidth}{\useKV[ClesMentales]{Largeur}}%
\xdef\Pointilles{\ifboolKV[ClesMentales]{Pointilles}{dashed}{}}%
@@ -14,12 +14,13 @@
\xdef\CouleurFond{\useKV[ClesMentales]{CFond}}%
\xdef\EpaisseurLigne{\useKV[ClesMentales]{Epaisseur}}%
\xdef\RayonCoin{\useKV[ClesMentales]{Rayon}}%
- \node(\useKV[ClesMentales]{Nom}) [align=justify,draw=\CouleurTrace,line width=\EpaisseurLigne,\Pointilles,fill=\CouleurFond,rounded corners=\RayonCoin,text width=\RoundedBoxWidth] at (\useKV[ClesMentales]{Ancre}) {\begin{minipage}{\RoundedBoxWidth}\BODY\end{minipage}};%
- \multido{\i=1+1}{9}{%
- \xdef\x{\fpeval{\i/10}}
- \coordinate (\useKV[ClesMentales]{Nom}-H-\i) at ($(\useKV[ClesMentales]{Nom}.north west)!\x!(\useKV[ClesMentales]{Nom}.north east)$);
- \coordinate (\useKV[ClesMentales]{Nom}-D-\i) at ($(\useKV[ClesMentales]{Nom}.north east)!\x!(\useKV[ClesMentales]{Nom}.south east)$);
- \coordinate (\useKV[ClesMentales]{Nom}-B-\i) at ($(\useKV[ClesMentales]{Nom}.south east)!\x!(\useKV[ClesMentales]{Nom}.south west)$);
- \coordinate (\useKV[ClesMentales]{Nom}-G-\i) at ($(\useKV[ClesMentales]{Nom}.south west)!\x!(\useKV[ClesMentales]{Nom}.north west)$);
+ \node(\useKV[ClesMentales]{Nom}) [align=justify,draw=\CouleurTrace,line width=\EpaisseurLigne,\Pointilles,fill=\CouleurFond,rounded corners=\RayonCoin,text width=\RoundedBoxWidth] at (\useKV[ClesMentales]{Ancre}) {\begin{minipage}{\RoundedBoxWidth}#2\end{minipage}};%
+ % \multido{\i=1+1}{9}{%
+ \xintFor* ##1 in{\xintSeq{1}{9}}\do{%
+ \xdef\x{\fpeval{##1/10}}
+ \coordinate (\useKV[ClesMentales]{Nom}-H-##1) at ($(\useKV[ClesMentales]{Nom}.north west)!\x!(\useKV[ClesMentales]{Nom}.north east)$);
+ \coordinate (\useKV[ClesMentales]{Nom}-D-##1) at ($(\useKV[ClesMentales]{Nom}.north east)!\x!(\useKV[ClesMentales]{Nom}.south east)$);
+ \coordinate (\useKV[ClesMentales]{Nom}-B-##1) at ($(\useKV[ClesMentales]{Nom}.south east)!\x!(\useKV[ClesMentales]{Nom}.south west)$);
+ \coordinate (\useKV[ClesMentales]{Nom}-G-##1) at ($(\useKV[ClesMentales]{Nom}.south west)!\x!(\useKV[ClesMentales]{Nom}.north west)$);
}%
-}%
\ No newline at end of file
+}{}%
\ 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-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartographie.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,10 +1,11 @@
%%%
% 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,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}
+\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,Boussole=false,Allegee=1}
\defKV[Cartographie]{EchelleCarte=\setKV[Cartographie]{Carte}}
\defKV[Cartographie]{Pays=\setKV[Cartographie]{PaysSeul}}
\defKV[Cartographie]{Villes=\setKV[Cartographie]{VillesSup}}
+\defKV[Cartographie]{VillesI=\setKV[Cartographie]{VillesSupI}}
\defKV[Cartographie]{Traces=\setKV[Cartographie]{Codes}}
\newcommand\Cartographie[3][]{%
@@ -13,13 +14,18 @@
\setKV[Cartographie]{#1}%
\mplibforcehmode%
\ifboolKV[Cartographie]{Projection}{%
+ \mplibnumbersystem{double}%
\begin{mplibcode}
input PfCMonde;
string arborescence;
arborescence:=\useKV[Cartographie]{Arborescence};
- boolean Impression,VillesSup;
+ boolean Impression,VillesSup,VillesSupI,Boussole;
VillesSup=\useKV[Cartographie]{VillesSup};
+ VillesSupI=\useKV[Cartographie]{VillesSupI};
Impression=\useKV[Cartographie]{Impression};
+ Boussole=\useKV[Cartographie]{Boussole};
+
+ Allegee:=\useKV[Cartographie]{Allegee};
maillage:=true;
fleuves:=false;
@@ -44,6 +50,14 @@
clip currentpicture to (mercatorc(-85,-180)--mercatorc(-85,180)--mercatorc(85,180)--mercatorc(85,-180)--cycle);
draw mercatorc(0,-180)--mercatorc(0,180);
draw mercatorc(-85,0)--mercatorc(85,0);
+ %
+ if Boussole:
+ label.top(TEX("\scriptsize Nord"),mercatorc(85,0));
+ label.bot(TEX("\scriptsize Sud"),mercatorc(-85,0));
+ label.urt(TEX("\scriptsize Est"),mercatorc(0,180));
+ label.ulft(TEX("\scriptsize Ouest"),mercatorc(0,-180));
+ fi;
+ %
label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),mercatorc(0,0));
for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8:
label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),mercatorc(-k*10,0));
@@ -57,6 +71,14 @@
clip currentpicture to (cylindriquec(-85,-180)--cylindriquec(-85,180)--cylindriquec(85,180)--cylindriquec(85,-180)--cycle);
draw cylindriquec(0,-180)--cylindriquec(0,180);
draw cylindriquec(-85,0)--cylindriquec(85,0);
+ %
+ if Boussole:
+ label.top(TEX("\scriptsize Nord"),cylindriquec(85,0));
+ label.bot(TEX("\scriptsize Sud"),cylindriquec(-85,0));
+ label.urt(TEX("\scriptsize Est"),cylindriquec(0,180));
+ label.ulft(TEX("\scriptsize Ouest"),cylindriquec(0,-180));
+ fi;
+ %
label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),cylindriquec(0,0));
for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8:
label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(-k*10,0));
@@ -70,6 +92,14 @@
clip currentpicture to (winkelc(-85,-180)--winkelc(-85,180) for k=-80 step 5 until 85:--winkelc(k,180) endfor --winkelc(85,-180) for k=80 step -5 until -85:--winkelc(k,-180) endfor --cycle);
draw winkelc(0,-180)--winkelc(0,180);
draw winkelc(-85,0)--winkelc(85,0);
+ %
+ if Boussole:
+ label.top(TEX("\scriptsize Nord"),winkelc(85,0));
+ label.bot(TEX("\scriptsize Sud"),winkelc(-85,0));
+ label.urt(TEX("\scriptsize Est"),winkelc(0,180));
+ label.ulft(TEX("\scriptsize Ouest"),winkelc(0,-180));
+ fi;
+ %
label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),winkelc(0,0));
for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8:
label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),winkelc(-k*10,0));
@@ -79,23 +109,31 @@
label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),winkelc(0,-k*10));
label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),winkelc(0,k*10));
endfor;
- elseif projection="cylindrique":
- clip currentpicture to (cylindriquec(-85,-180)--cylindriquec(-85,180)--cylindriquec(85,180)--cylindriquec(85,-180)--cycle);
- draw cylindriquec(0,-180)--cylindriquec(0,180);
- draw cylindriquec(-85,0)--cylindriquec(85,0);
- label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),cylindriquec(0,0));
- for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8:
- label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(-k*10,0));
- label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(k*10,0));
- endfor;
- for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 18:
- label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(0,-k*10));
- label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(0,k*10));
- endfor;
+% elseif projection="cylindrique":
+% clip currentpicture to (cylindriquec(-85,-180)--cylindriquec(-85,180)--cylindriquec(85,180)--cylindriquec(85,-180)--cycle);
+% draw cylindriquec(0,-180)--cylindriquec(0,180);
+% draw cylindriquec(-85,0)--cylindriquec(85,0);
+% label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),cylindriquec(0,0));
+% for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8:
+% label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(-k*10,0));
+% label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(k*10,0));
+% endfor;
+% for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 18:
+% label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(0,-k*10));
+% label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(0,k*10));
+% endfor;
elseif projection="simple":
clip currentpicture to (simplec(-85,-180)--simplec(-85,180)--simplec(85,180)--simplec(85,-180)--cycle);
draw simplec(0,-180)--simplec(0,180);
draw simplec(-85,0)--simplec(85,0);
+ %
+ if Boussole:
+ label.top(TEX("\scriptsize Nord"),simplec(85,0));
+ label.bot(TEX("\scriptsize Sud"),simplec(-85,0));
+ label.urt(TEX("\scriptsize Est"),simplec(0,180));
+ label.ulft(TEX("\scriptsize Ouest"),simplec(0,-180));
+ fi;
+ %
label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),simplec(0,0));
for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8:
label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),simplec(-k*10,0));
@@ -106,6 +144,50 @@
label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),simplec(0,k*10));
endfor;
fi;
+
+ 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_:
+ if projection="mercator":
+ CoordVille:=mercatorc(ypart(p_),xpart(p_));
+ elseif projection="winkel":
+ CoordVille:=winkelc(ypart(p_),xpart(p_));
+ elseif projection="cylindrique":
+ CoordVille:=cylindriquec(ypart(p_),xpart(p_));
+ elseif projection="simple":
+ CoordVille:=simplec(ypart(p_),xpart(p_));
+ fi;
+ elseif string p_:
+ NomVille:=p_;
+ else:
+ marque_p:="croix";
+ pointe(CoordVille);
+ label.position(p_)(TEX(""&NomVille&""),CoordVille);
+ fi;
+ fi;
+ endfor;
+ drawoptions();
+ enddef;
+
+ def position(expr t)=
+ if t=1:rt
+ elseif t=2:urt
+ elseif t=3:top
+ elseif t=4:ulft
+ elseif t=5:lft
+ elseif t=6:llft
+ elseif t=7:bot
+ elseif t=8:lrt
+ fi
+ enddef;
+
if VillesSup:
nomfichiermul:=\useKV[Cartographie]{Villes};
nblec:=scantokens readfrom nomfichiermul;
@@ -130,7 +212,12 @@
drawoptions();
closefrom nomfichiermul;
fi;
+
+ if VillesSupI:
+ Villes(\useKV[Cartographie]{VillesI});
+ fi;
\end{mplibcode}
+ \mplibnumbersystem{scaled}%
}{%
% \mplibforcehmode
\begin{mplibcode}
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecomposerNombrePremier.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecomposerNombrePremier.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecomposerNombrePremier.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -700,9 +700,9 @@
\bnpl=\numexpr\bnpl+1\relax%
\pilebl=\bnpl\relax%
\fi%
- }
- }
-}
+ }%
+ }%
+}%
\NewDocumentCommand\PfCSommeChiffres{m}{%
\xdef\PfCSMSomme{0}%
@@ -791,16 +791,20 @@
\newcount\anp\newcount\bnp%
\anp=#1%
\bnp=2\relax%
- 1 %
- \whiledo{\bnp<\anp}{%
- \modulo{\the\anp}{\the\bnp}{}%
- \ifnum\remainder=0%
- ; $\num{\the\bnp}$ %
- \fi%
- \bnp=\numexpr\bnp+1%
- }%
- et \num{\the\anp}%
-}
+ \ifnum\anp=1
+ 1%
+ \else
+ 1 %
+ \whiledo{\bnp<\anp}{%
+ \modulo{\the\anp}{\the\bnp}{}%
+ \ifnum\remainder=0%
+ ; $\num{\the\bnp}$ %
+ \fi%
+ \bnp=\numexpr\bnp+1%
+ }%
+ et \num{\the\anp}%
+ \fi%
+}%
\newcount\anpT\newcount\bnpT\newcount\cnpT\newcount\dnpT%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCDistributivite.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCDistributivite.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCDistributivite.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -430,7 +430,9 @@
\fi
}
-\newcommand\Affichage[4][]{%
+% \newcommand\Affichage[4][]{%
+
+\NewDocumentCommand\Affichage{ommm}{%
\setKV[ClesDistributivite]{#1}%On lit les arguments optionnels
\def\LETTRE{\useKV[ClesDistributivite]{Lettre}}%
\ensuremath{%
@@ -594,10 +596,12 @@
}{%
\ifboolKV[ClesDistributivite]{Numerique}{%
\xintifboolexpr{\useKV[ClesDistributivite]{Etape}==0}{%
- \num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}\multido{\i=2+1}{4}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}%
+ % \num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}\multido{\i=2+1}{4}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}%
+ \num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}\xintFor* ##1 in{\xintSeq{2}{4}}\do{=\Distri[Numerique,Etape=##1]{#2}{#3}{#4}{#5}}%
}{%
\xintifboolexpr{\useKV[ClesDistributivite]{Etape}==-1}{%
- \Distri[Numerique,Etape=3]{#2}{#3}{#4}{#5}\multido{\i=2+-1}{2}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}=\num{\fpeval{(#2+#3)*(#4+#5)}}%
+ % \Distri[Numerique,Etape=3]{#2}{#3}{#4}{#5}\multido{\i=2+-1}{2}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}=\num{\fpeval{(#2+#3)*(#4+#5)}}%
+ \Distri[Numerique,Etape=3]{#2}{#3}{#4}{#5}\xintFor* ##1 in{\xintSeq{2}{0}}\do{=\Distri[Numerique,Etape=##1]{#2}{#3}{#4}{#5}}=\num{\fpeval{(#2+#3)*(#4+#5)}}%
}{%
\xintifboolexpr{\useKV[ClesDistributivite]{Etape}==1}{\num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}}{}%
\xintifboolexpr{\useKV[ClesDistributivite]{Etape}==2}{\num{\fpeval{#2+#3}}\times(\num{#4}\xintifboolexpr{#5>0}{+}{-}\num{\fpeval{abs(#5)}})}{}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCDomino.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCDomino.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCDomino.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -17,7 +17,7 @@
valign lower=center,
arc=2pt,
#1
-}
+}%
\newtcolorbox{MyDominoLogo}[1][]{%
enhanced,
@@ -32,12 +32,12 @@
arc=2pt,
colback=white,
#1
-}
+}%
-\NewEnviron{TrameDomino}{%
- \setlength{\margev}{1cm}
- \setlength{\margeh}{1cm}
- \begin{tikzpicture}[remember picture,overlay]
+\NewDocumentEnvironment{TrameDomino}{+b}{%
+ \setlength{\margev}{1cm}%
+ \setlength{\margeh}{1cm}%
+ \begin{tikzpicture}[remember picture,overlay]%
% quadrillages horizontal et vertical
\coordinate[yshift=-\margev] (A0) at (current page.north west);
\coordinate[yshift=-\margev] (B0) at (current page.north east);
@@ -44,40 +44,40 @@
\foreach \i in {1,...,\useKV[Domino]{Lignes}}{%
\coordinate[yshift=-\i*\textheight/\LigneDomino] (A\i) at (A0);
\coordinate[yshift=-\i*\textheight/\LigneDomino] (B\i) at (B0);
- }
+ }%
\coordinate[xshift=\margeh] (C0) at (current page.north west);
\coordinate[xshift=\margeh] (D0) at (current page.south west);
\foreach \i in {1,...,\useKV[Domino]{Colonnes}}{
\coordinate[xshift=\i*\textwidth/\ColonneDomino] (C\i) at (C0);
\coordinate[xshift=\i*\textwidth/\ColonneDomino] (D\i) at (D0);
- }
+ }%
\foreach \i in {0,...,\LigneDomino}{%
\draw (A\i) -- (B\i);
- }
+ }%
\foreach \i in {0,...,\ColonneDomino}{%
\draw (C\i) -- (D\i);
- }
- \draw[blue, line width=3pt] (A0)--(B0);
- \draw[blue, line width=3pt] (A\LigneDomino)--(B\LigneDomino);
- \draw[blue, line width=3pt] (C0)--(D0);
- \draw[blue, line width=3pt] (C\ColonneDomino)--(D\ColonneDomino);
+ }%
+ \draw[blue, line width=3pt] (A0)--(B0);%
+ \draw[blue, line width=3pt] (A\LigneDomino)--(B\LigneDomino);%
+ \draw[blue, line width=3pt] (C0)--(D0);%
+ \draw[blue, line width=3pt] (C\ColonneDomino)--(D\ColonneDomino);%
% point pour placer les cartes
\foreach \i in {0,...,\fpeval{\ColonneDomino-1}}{%
\foreach \j in {0,...,\fpeval{\LigneDomino-1}}{%
- \coordinate[xshift=\margeh+(0.5\textwidth/\ColonneDomino)+\i*\textwidth/\ColonneDomino,yshift=-0.5\textheight/\LigneDomino-\j*\textheight/\LigneDomino]
- (Domino\fpeval{\i+\ColonneDomino*\j+1}) at (A0);
- }
- }
- \BODY
+ \coordinate[xshift=\margeh+(0.5\textwidth/\ColonneDomino)+\i*\textwidth/\ColonneDomino,yshift=-0.5\textheight/\LigneDomino-\j*\textheight/\LigneDomino]%
+ (Domino\fpeval{\i+\ColonneDomino*\j+1}) at (A0);%
+ }%
+ }%
+ #1
\end{tikzpicture}
-}
+}{}%
-\setKVdefault[Domino]{Couleur=white,Trame,Ratio=0.5,Lignes=7,Colonnes=5,Superieur=false,Logo=false,Image=tiger.pdf}
+\setKVdefault[Domino]{Couleur=white,Trame,Ratio=0.5,Lignes=7,Colonnes=5,Superieur=false,Logo=false,Image=tiger.pdf}%
\newcommand\Dominos[2][]{%
\useKVdefault[Domino]%
\setKV[Domino]{#1}%
- \setsepchar[*]{§*/}%
+ \setsepchar[*]{§*/}\reademptyitems%
\readlist*\ListeDominos{#2}%
\xdef\CouleurDomino{\useKV[Domino]{Couleur}}%
\xdef\ratiodomino{\useKV[Domino]{Ratio}}%
@@ -85,7 +85,7 @@
\xdef\ColonneDomino{\useKV[Domino]{Colonnes}}%
\ifboolKV[Domino]{Trame}{%
\clearpage
- \begin{TrameDomino}
+ \begin{TrameDomino}%
\foreach\i in {1,...,\fpeval{\LigneDomino*\ColonneDomino}}{%
\node[] at (Domino\i){%
\ifboolKV[Domino]{Superieur}{%
@@ -97,18 +97,18 @@
\ListeDominos[\i,1]\tcblower\ListeDominos[\i,2]%
\end{MyDominoMini}%
}%
- };
+ };%
}%
\end{TrameDomino}%
\ifboolKV[Domino]{Logo}{%
\clearpage
- \begin{TrameDomino}
+ \begin{TrameDomino}%
\foreach\i in {1,...,\fpeval{\LigneDomino*\ColonneDomino}}{%
\node at (Domino\i){%
\begin{MyDominoLogo}%
\includegraphics[height=\tcbtextheight]{\useKV[Domino]{Image}}
\end{MyDominoLogo}%
- };
+ };%
}%
\end{TrameDomino}%
}{}%
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCDontCountDots.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCDontCountDots.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCDontCountDots.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -0,0 +1,197 @@
+% D'après twitter : https://twitter.com/DavidKButlerUoA/status/1700612346258002030/photo/1
+\setKVdefault[NCPP]{Largeur=5,Longueur=7,Unite=5mm,Rayon=1mm,Multiple=3,Couleur=black,Solution=false,Graines=false}%
+\defKV[NCPP]{Graine=\setKV[NCPP]{Graines}\PfCGraineAlea{#1}}%
+
+\newtoks\tokcentre%
+\def\updatetokscentre#1\nil{\addtotok\tokcentre{#1,}}%
+
+\NewDocumentCommand\NeComptePasPoints{o}{%
+ \tokcentre{}%
+ \useKVdefault[NCPP]%
+ \setKV[NCPP]{#1}%
+ % on crée la liste de tous les numéros des points.
+ \def\NCPPLongueur{\useKV[NCPP]{Longueur}}%
+ \def\NCPPLargeur{\useKV[NCPP]{Largeur}}%
+ \xdef\PfCFooListeCentres{1}%
+ \xintFor* ##1 in{\xintSeq{2}{\fpeval{\NCPPLargeur*\NCPPLongueur}}}\do{%
+ \xdef\PfCFooListeCentres{\PfCFooListeCentres,##1}%
+ }%
+ \ChoixAlea{\fpeval{ceil(0.6*\NCPPLargeur*\NCPPLongueur)}}{\fpeval{floor(0.8*\NCPPLargeur*\NCPPLongueur)}}{\Titi}%
+ \MelangeListe{\PfCFooListeCentres}{\Titi}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeCentres{\faa}%
+ \ignoreemptyitems%
+ \foreachitem\compteur\in\ListeCentres{\expandafter\updatetokscentre\compteur\nil}%
+ \modulo{\Titi}{\useKV[NCPP]{Multiple}}%
+ \ifboolKV[NCPP]{Solution}{%
+ Il faut faire des paquets de \useKV[NCPP]{Multiple} points. Il existe plusieurs schémas expliquant la réponse. En voici un qui regroupe tous les points.
+ }{%
+ \textbf{Ne Compte pas les points !}\\
+ Montre que le nombre de points \ifnum\remainder=0\relax%
+ est
+ \else
+ n'est pas\fi{} un multiple de \num{\useKV[NCPP]{Multiple}}.
+ }%
+ \begin{center}
+ \BuildNCPP{\the\tokcentre}%
+ \end{center}
+ \ifboolKV[NCPP]{Solution}{%
+ En faisant des paquets de \useKV[NCPP]{Multiple} points, on montre que le nombre de points \ifnum\remainder=0\relax%
+ est
+ \else
+ n'est pas\fi{} un multiple de \num{\useKV[NCPP]{Multiple}}.
+ }{}%
+}%
+
+\NewDocumentCommand\BuildNCPP{m}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ Unite=\useKV[NCPP]{Unite};
+ Rayon=\useKV[NCPP]{Rayon};
+ Longueur=\useKV[NCPP]{Longueur};
+ Largeur=\useKV[NCPP]{Largeur};
+ Multiple=\useKV[NCPP]{Multiple};
+
+ boolean Choisi,Graines,Solution;
+ Solution=\useKV[NCPP]{Solution};
+
+ color CouleurCercle;
+ CouleurCercle=\useKV[NCPP]{Couleur};
+
+ TotalPoints=Longueur*Largeur;
+
+ nbnoir:=0;%compte les noirs
+ nbblanc:=0;%compte les blancs
+ zr:=0;%pour compter les centres des points
+
+ vardef Allumage(text t)=
+ nbnoirs:=0;
+ for p_=t:
+ nbnoirs:=nbnoirs+1;
+ Allume[p_]:=true;
+ fill cercles(A[p_],Rayon) withcolor CouleurCercle;
+ endfor;
+ enddef;
+
+ pair A[];
+
+ boolean Allume[];
+ for k=0 upto Largeur-1:
+ for l=1 upto Longueur:
+ Allume[k*Longueur+l]=false;
+ A[k*Longueur+l]=Unite*(l,-k);
+ endfor;
+ endfor;
+
+ Allumage(#1);
+
+ if Solution:
+ nbdeplaces:=0;
+ zmontant=0;
+ zdescendant=TotalPoints;
+ for k=0 upto Largeur-1:
+ for l=1 upto Longueur:
+ zmontant:=zmontant+1;
+ if zmontant<zdescendant:
+ if Allume[zmontant]:
+ forever: exitif Allume[zdescendant]=false;
+ zdescendant:=zdescendant-1;
+ endfor;
+ nbdeplaces:=nbdeplaces+1;
+ if (zdescendant>zmontant) and (nbdeplaces<nbnoirs):
+ Allume[zmontant]:=false;
+ Allume[zdescendant]:=true;
+ fill cercles(A[zmontant],Rayon) withcolor white;
+ fill cercles(A[zdescendant],Rayon) withcolor LightSteelBlue;
+% label.top(TEX("?"),A[zdescendant]);
+ zdescendant:=zdescendant-1;
+ fi;
+ fi;
+ fi;
+ endfor;
+ endfor;
+ %
+ %nbcases:=0;
+ %for k=0 upto Largeur-1:
+ %for l=1 upto Longueur:
+ %nbcases:=nbcases+1;
+ %if Allume[nbcases]:
+ %fill cercles(A[nbcases],Rayon) withcolor Gold;
+ %fi;
+ %endfor;
+ %endfor;
+ etape=1;
+ forever: exitif Allume[etape]=true;
+ etape:=etape+1;
+ endfor;
+% label.top(TEX("!"),A[etape]);
+ for k=0 upto (TotalPoints-etape):
+ if ((k+1) mod Multiple)=0:
+ draw (A[etape+k]+Unite*(-0.25,-0.25))--(A[etape+k]+Unite*(0.25,0.25));
+ fi;
+ endfor;
+ for k=1 upto ((TotalPoints-etape-Multiple+1) mod Multiple):
+ fill cercles(A[TotalPoints-k+1],Rayon) withcolor red;
+ endfor;
+ fi;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={Unite=\useKV[NCPP]{Unite};Rayon=\useKV[NCPP]{Rayon};Longueur=\useKV[NCPP]{Longueur};Largeur=\useKV[NCPP]{Largeur};Multiple=\useKV[NCPP]{Multiple};boolean Solution;Solution=\useKV[NCPP]{Solution};color CouleurCercle;CouleurCercle=\useKV[NCPP]{Couleur};}]
+ TotalPoints=Longueur*Largeur;
+ %
+ nbnoir:=0;%compte les noirs
+ nbblanc:=0;%compte les blancs
+ zr:=0;%pour compter les centres des points
+ %
+ vardef Allumage(text t)=
+ for p_=t:
+ Allume[p_]:=true;
+ fill cercles(A[p_],Rayon) withcolor CouleurCercle;
+ endfor;
+ enddef;
+ %
+ pair A[];
+ %
+ boolean Allume[];
+ for k=0 upto Largeur-1:
+ for l=1 upto Longueur:
+ Allume[k*Longueur+l]=false;
+ A[k*Longueur+l]=Unite*(l,-k);
+ endfor;
+ endfor;
+ %
+ Allumage(#1);
+ %
+ if Solution:
+ zmontant=0;
+ zdescendant=TotalPoints;
+ for k=0 upto Largeur-1:
+ for l=1 upto Longueur:
+ zmontant:=zmontant+1;
+ if zmontant<zdescendant:
+ if Allume[zmontant]:
+ forever: exitif Allume[zdescendant]=false;
+ zdescendant:=zdescendant-1;
+ endfor;
+ if zdescendant>zmontant:
+ fill cercles(A[zmontant],Rayon) withcolor white;
+ fill cercles(A[zdescendant],Rayon) withcolor LightSteelBlue;
+ zdescendant:=zdescendant-1;
+ fi;
+ fi;
+ fi;
+ endfor;
+ endfor;
+ for k=0 upto (TotalPoints-zdescendant):
+ if ((k+1) mod Multiple)=0:
+ drawarrow A[zdescendant+k+1]--(A[zdescendant+k+1]+Unite*(0.5,0));
+ fi;
+ endfor;
+ for k=1 upto ((TotalPoints-zdescendant) mod Multiple):
+ fill cercles(A[TotalPoints-k+1],Rayon) withcolor red;
+ endfor;
+ fi;
+ \end{mpost}
+ \fi
+}%
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCDontCountDots.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,148 +1,233 @@
%%%
% 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}%
+\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}%
\newlength{\LargeurQCM}%
\newlength{\PfCLargeurQCM}%
\newcounter{QuestionQCM}%
\newcounter{TitreQCM}%
%
+\newcounter{TotalQCMSeul}%
+\newcounter{TotalQCMSeulSol}%
+\setcounter{TotalQCMSeul}{0}%
+\setcounter{TotalQCMSeulSol}{0}%
+%
+\setKVdefault[QCMSeul]{Melange=false,Solution=false,EnColonne=false}%
+\defKV[QCMSeul]{Colonnes=\setKV[QCMSeul]{EnColonne}}%
+%
+\NewDocumentCommand\PfCQCMSChoixLabelSol{m}{%
+ \xdef\PfCFooChoixLabel{\ListeQCM[\ListeQCMlen]}%
+ \setsepchar{-}%
+ \readlist*\PfCSolListeReponses{\PfCFooChoixLabel}%
+ \xdef\RetiensSiSol{0}%
+ \xintFor* ##3 in{\xintSeq{1}{\PfCSolListeReponseslen}}\do{%
+ \ifnum#1=\PfCSolListeReponses[##3]\relax%
+ \xdef\RetiensSiSol{\fpeval{\RetiensSiSol+1}}%
+ \fi%
+ }%
+ \ifnum\RetiensSiSol>0\relax%
+ $\blacksquare$%
+ \else%
+ $\square$%
+ \fi%
+}%
+
+\NewDocumentCommand\QCMSeul{om}{%
+ \useKVdefault[QCMSeul]%
+ \setKV[QCMSeul]{#1}%
+ \setsepchar{&}\ignoreemptyitems%
+ \readlist*\ListeQCM{#2}%
+ % on définit une liste ordonnées des numéros d'items. Elle est utilisée par défaut.
+ \xdef\PfCFooListePermute{1}%
+ \xintFor* ##1 in{\xintSeq{2}{\fpeval{\ListeQCMlen-2}}}\do{%
+ \xdef\PfCFooListePermute{\PfCFooListePermute,##1}%
+ }%
+ %
+ \ifboolKV[QCMSeul]{Melange}{%
+ \ifboolKV[QCMSeul]{Solution}{%
+ \stepcounter{TotalQCMSeulSol}%
+ \expandafter\xdef\csname PfCQCMSListeAv\endcsname{\csname PfCQCMSListe\Roman{TotalQCMSeulSol}\endcsname}%
+ % La liste restaurée est \PfCQCMSListeAv
+ }{%
+ \stepcounter{TotalQCMSeul}%
+ \MelangeListe{\PfCFooListePermute}{\fpeval{\ListeQCMlen-2}}%
+ \expandafter\xdef\csname PfCQCMSListe\Roman{TotalQCMSeul}\endcsname{\faa}%
+ % La liste exportée est \faa
+ \expandafter\xdef\csname PfCQCMSListe\endcsname{\faa}%
+ }%
+ }{%
+ \ifboolKV[QCMSeul]{Solution}{%
+ \expandafter\xdef\csname PfCQCMSListeAv\endcsname{\csname PfCFooListePermute\endcsname}%
+ }{%
+ \expandafter\xdef\csname PfCQCMSListe\endcsname{\PfCFooListePermute}%
+ }%
+ }%
+ \setsepchar{,}\ignoreemptyitems%
+ \ifboolKV[QCMSeul]{Solution}{%
+ \readlist*\ListeEnumerate{\PfCQCMSListeAv}%
+ }{%
+ \readlist*\ListeEnumerate{\PfCQCMSListe}%
+ }%
+ % On écrit
+ \ListeQCM[1]%
+ \ifboolKV[QCMSeul]{EnColonne}{\begin{multicols}{\useKV[QCMSeul]{Colonnes}}}{}%
+ \begin{itemize}[label=$\square$]
+ \xintFor* ##1 in{\xintSeq{2}{\fpeval{\ListeQCMlen-1}}}\do{%
+ \xdef\Titi{\ListeEnumerate[\fpeval{##1-1}]}
+ \ifboolKV[QCMSeul]{Solution}{%
+ \item[\PfCQCMSChoixLabelSol{\Titi}] \ListeQCM[\fpeval{\Titi+1}]
+ }{%
+ \item \ListeQCM[\fpeval{\Titi+1}]
+ }%
+ }%
+ \end{itemize}
+ \ifboolKV[QCMSeul]{EnColonne}{\end{multicols}}{}%
+}%
+%
\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}%
- \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}%
+ \ifboolKV[ClesQCM]{Seul}{%
+ \QCMSeul[#1]{#2}%
}{%
- \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}}%
+ \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|}{}&\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}}%
+ &\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}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,##2+1]%
+ &\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}%
+ }{%
+ \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}%
- \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}%
+ \ifboolKV[ClesQCM]{Seul}{%
+ \QCMSeul[#1]{#2}%
}{%
- \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}}%
+ \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|}{}&\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}}%
+ &\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}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,\fpeval{##2+1}]%
+ &\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}%
+ }{%
+ \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}%
}%
}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureLettres.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureLettres.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureLettres.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,11 +1,11 @@
%%%
% Ecriture des nombres en lettres
%%%
-\setKVdefault[ClesEcriture]{Math=false,Majuscule=false,E=false,Tradition=false,Zero=false}
+\setKVdefault[ClesEcriture]{Math=false,Majuscule=false,E=false,Tradition=false,Zero=false}%
\newcommand\EcriturePluriel[1]{%
\xintifboolexpr{#1 > 1}{s}{}%
-}
+}%
\newcommand\EcritureDecimale{%
\StrLen{\ListeEcriture[2]}[\LongueurDecimale]%
@@ -12,15 +12,15 @@
\xintifboolexpr{\LongueurDecimale == 6}{%
~millionième\EcriturePluriel{\ListeEcriture[2]}%
}{\xintifboolexpr{\LongueurDecimale == 5}{%
- ~cent-millième\EcriturePluriel{\ListeEcriture[2]}
+ ~cent-millième\EcriturePluriel{\ListeEcriture[2]}%
}{\xintifboolexpr{\LongueurDecimale == 4}{%
- ~dix-millième\EcriturePluriel{\ListeEcriture[2]}
+ ~dix-millième\EcriturePluriel{\ListeEcriture[2]}%
}{\xintifboolexpr{\LongueurDecimale == 3}{%
- ~millième\EcriturePluriel{\ListeEcriture[2]}
+ ~millième\EcriturePluriel{\ListeEcriture[2]}%
}{\xintifboolexpr{\LongueurDecimale == 2}{%
- ~centième\EcriturePluriel{\ListeEcriture[2]}
+ ~centième\EcriturePluriel{\ListeEcriture[2]}%
}{\xintifboolexpr{\LongueurDecimale == 1}{%
- ~dixième\EcriturePluriel{\ListeEcriture[2]}
+ ~dixième\EcriturePluriel{\ListeEcriture[2]}%
}{}%
}%
}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,7 +1,7 @@
%%%
% Ecritures d'unit\'es
%%%
-\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,mmin=false,kmh=true,kms=false,ms=false,mh=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false,Nombre,US=false,UK=false,Precision=2}%
+\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,mmin=false,kmh=true,kms=false,ms=false,mh=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false,Nombre,US=false,UK=false,CFA=false,CFP=false,CHF=false,Euro=false,Precision=2}%
\defKV[Unites]{Dots=\setKV[Unites]{Nombre=false}}%
\newlength{\PfCLgUnites}
@@ -170,37 +170,45 @@
}%
}%
-%Pour mémoire au cas où...
-%\newcommand\Prixo[2][2]{%
-% \SI[round-mode=places,round-precision=#1]{#2}{\EuRo}%
-%}
-
-%\NewDocumentCommand\Prix{o O{2} m}{%
-% \useKVdefault[Unites]%
-% \setKV[Unites]{#1}%
-% \ifboolKV[Unites]{Nombre}{%
-% \SI[round-mode=places,round-precision=#2]{#3}{\EuRo}%
-% }{%
-% \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}
-% \pointilles[\PfCLgUnites]~\si{\EuRo}%
-% }%
-%}%
-
+\makeatletter
\NewDocumentCommand\Prix{o m}{%
\useKVdefault[Unites]%
\setKV[Unites]{#1}%
- \ifboolKV[Unites]{US}{%
- \DeclareSIUnit{\Tempo}{\Dollar}%
+ \ifboolKV[Unites]{CHF}{%
+ \DeclareSIUnit{\Tempo}{\PfCCHF}%
}{%
- \ifboolKV[Unites]{UK}{%
- \DeclareSIUnit{\Tempo}{\LivreSterling}%
+ \ifboolKV[Unites]{CFA}{%
+ \DeclareSIUnit{\Tempo}{\PfCCFA}%
}{%
- \DeclareSIUnit{\Tempo}{\EuRo}%
+ \ifboolKV[Unites]{CFP}{%
+ \DeclareSIUnit{\Tempo}{\PfCCFP}%
+ }{%
+ \ifboolKV[Unites]{US}{%
+ \DeclareSIUnit{\Tempo}{\Dollar}%
+ }{%
+ \ifboolKV[Unites]{UK}{%
+ \DeclareSIUnit{\Tempo}{\LivreSterling}%
+ }{%
+ \ifboolKV[Unites]{Euro}{%
+ \DeclareSIUnit{\Tempo}{\EuRo}%
+ }{%
+ \if at CHF%
+ \setKV[Unites]{CHF}%
+ \fi%
+ \DeclareSIUnit{\Tempo}{\DeviseDefaut}%
+ }%
+ }%
+ }%
+ }%
}%
}%
\ifboolKV[Unites]{Nombre}{%
\IfInteger{#2}{%
- \SI{#2}{\Tempo}%
+ \ifboolKV[Unites]{CHF}{%
+ \si{\PfCCHF}~\num{#2}.-%
+ }{%
+ \SI{#2}{\Tempo}%
+ }%
}{%
\SI[round-mode=places,round-precision=\useKV[Unites]{Precision}]{#2}{\Tempo}%
}%
@@ -209,7 +217,32 @@
\pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
+\makeatother
+%\NewDocumentCommand\Prixold{o m}{%
+% \useKVdefault[Unites]%
+% \setKV[Unites]{#1}%
+% \ifboolKV[Unites]{US}{%
+% \DeclareSIUnit{\Tempo}{\Dollar}%
+% }{%
+% \ifboolKV[Unites]{UK}{%
+% \DeclareSIUnit{\Tempo}{\LivreSterling}%
+% }{%
+% \DeclareSIUnit{\Tempo}{\EuRo}%
+% }%
+% }%
+% \ifboolKV[Unites]{Nombre}{%
+% \IfInteger{#2}{%
+% \SI{#2}{\Tempo}%
+% }{%
+% \SI[round-mode=places,round-precision=\useKV[Unites]{Precision}]{#2}{\Tempo}%
+% }%
+% }{%
+% \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
+% \pointilles[\PfCLgUnites]~\si{\Tempo}%
+% }%
+%}%
+
\NewDocumentCommand\Octet{o m}{%
\useKVdefault[Unites]%
\setKV[Unites]{#1}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEngrenagesBase.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -4,9 +4,11 @@
\newtoks\tokPfCEngrenages%
\def\UpdatetoksEngrenages#1/#2\nil{\addtotok\tokPfCEngrenages{#1,#2,}}%
-\setKVdefault[Engrenages]{Couleur=LightSteelBlue,Unite=3mm}
+\setKVdefault[Engrenages]{Couleur=LightSteelBlue,Unite=3mm,ListeCouleurs={LightSteelBlue}}
\NewDocumentCommand\Engrenages{o m}{%
+ \newtoks\toklistecouleur%
+ \toklistecouleur{}%
\tokPfCEngrenages{}
\useKVdefault[Engrenages]%
\setKV[Engrenages]{#1}%
@@ -18,12 +20,28 @@
\foreachitem\compteur\in\ListePfCEngrenages{%
\xdef\PfCFooEngrenages{\PfCFooEngrenages \ListePfCEngrenages[\compteurcnt,1],\ListePfCEngrenages[\compteurcnt,2],}%
}%
- \BuildEngrenages{\PfCFooEngrenages}%
+ \xdef\ListeAvantCouleurs{\useKV[Engrenages]{ListeCouleurs}}%
+ \readlist*\ListeCouleur{\ListeAvantCouleurs}%
+ \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}%
+ \BuildEngrenages{\PfCFooEngrenages}{\the\toklistecouleur}%
}%
-\def\BuildEngrenagesCode#1{%
+\def\BuildEngrenagesCode#1#2{%
u:=\useKV[Engrenages]{Unite};
CouleurEngrenage=\useKV[Engrenages]{Couleur};
+%
+ vardef RecuperationCouleurs(text t)=
+ color Col[];
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ Col[n]=CouleurEngrenage;
+ fi;
+ endfor;
+ enddef;
%
vardef LectureDonnees(text t)=
n:=0;k=0;l=0;
@@ -39,6 +57,7 @@
endfor;
enddef;
%
+ RecuperationCouleurs(#2);
LectureDonnees(#1);
%
pair K;
@@ -45,11 +64,19 @@
K=(0,0);
picture EngrenageFinal;
EngrenageFinal=image(
+ if unknown Col[1]:
+ else:
+ CouleurEngrenage:=Col[1];
+ fi;
trace Engrenage(Mm[1],Zz[1],(0,0));
%
Signe=1;
%
for w=2 upto (n div 2):
+ if unknown Col[w]:
+ else:
+ CouleurEngrenage:=Col[w];
+ fi;
K:=K+pointarc(cercles((0,0),u*Mm[w]*(Zz[w-1]+Zz[w])*0.5+0.04*u),0);
AngleRot[w]:=360/(2*Zz[w]);
if w=2:
@@ -77,16 +104,16 @@
);
}
-\NewDocumentCommand\BuildEngrenages{m}{%
+\NewDocumentCommand\BuildEngrenages{mm}{%
\ifluatex
\mplibforcehmode
\begin{mplibcode}
input PfCEngrenages;
- \BuildEngrenagesCode{#1}
+ \BuildEngrenagesCode{#1}{#2}
trace EngrenageFinal;
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCEngrenages;\BuildEngrenagesCode{#1}}]
+ \begin{mpost}[mpsettings={input PfCEngrenages;\BuildEngrenagesCode{#1}{#2}}]
trace EngrenageFinal;
\end{mpost}
\fi
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEratosthene.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEratosthene.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEratosthene.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,18 +1,18 @@
-\setKVdefault[ClesEra]{Premier=false,Nombre=1,CouleurP=Cornsilk!50,CouleurNP=Crimson!15,Colonnes=10,Lignes=10,Hauteur=24pt}
+\setKVdefault[ClesEra]{Premier=false,Nombre=1,CouleurP=Cornsilk!50,CouleurNP=Crimson!15,Colonnes=10,Lignes=10,Hauteur=24pt}%
\NewDocumentCommand\TestPremier{m}{%
% #1 le nombre premier \`a tester
\newcount\anp\newcount\bnp\newcount\cnp%
- \anp=#1\relax
- \bnp=2\relax
- \premier=-1\relax
+ \anp=#1\relax%
+ \bnp=2\relax%
+ \premier=-1\relax%
% Pour d\'eterminer le nombre d'\'etapes
\whiledo{\anp > 1}{%
- \modulo{\the\anp}{\the\bnp}
- \ifnum\remainder=0\relax
- \global\premier=\numexpr\premier+1\relax
- \cnp=\numexpr\anp/\bnp\relax
- \anp=\cnp\relax
+ \modulo{\the\anp}{\the\bnp}%
+ \ifnum\remainder=0\relax%
+ \global\premier=\numexpr\premier+1\relax%
+ \cnp=\numexpr\anp/\bnp\relax%
+ \anp=\cnp\relax%
\else%
\bnp=\numexpr\bnp+1\relax%
\fi%
@@ -19,7 +19,7 @@
}%
\ifnum\premier=0%
\setKV[ClesEra]{Premier=true}%
- \else
+ \else%
\setKV[ClesEra]{Premier=false}%
\fi%
}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCFactorisation.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCFactorisation.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCFactorisation.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,4 +1,4 @@
-\setKVdefault[Facto]{Aide=false,AideMul=false,Couleur=Crimson,NomExpression=A,Lettre=x,Details,Formel=false,VariableSup=false,ParenthesesFin=false,Finale=false}
+\setKVdefault[Facto]{Aide=false,AideMul=false,Couleur=Crimson,NomExpression=A,Lettre=x,Details,Formel=false,VariableSup=false,ParenthesesFin=false,Finale=false,Type=0}
\defKV[Facto]{Litteral=\setKV[Facto]{Details=false}}
\defKV[Facto]{AutreVariable=\setKV[Facto]{VariableSup}}
\defKV[Facto]{Resultat=\setKV[Facto]{Finale}}
@@ -86,7 +86,7 @@
\end{align*}
}
\else%k*a+-k*b=k(a+-b)
- \#3 #3 -- \#4 #4 -- \#5 #5
+% \#3 #3 -- \#4 #4 -- \#5 #5
\begin{CAS}
% La variable
vars('\useKV[Facto]{Lettre}'\ifboolKV[Facto]{VariableSup}{%
@@ -121,16 +121,55 @@
}{%Avec au moins un des facteurs polynomes
\StrCompare{\PfCFactoSymbole}{-}[\PfCRetiensSigneFacteurDeux]%
\StrChar{#5}{1}[\RetiensPremierCaractere]%en cas de deuxième terme écrit b-ax
- \begin{align*}
- \ifboolKV[Facto]{Aide}{\PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#5}{Kb}\\\setKV[Facto]{Aide}}{}%
- \PfCFactoNE&=\ifboolKV[Facto]{Aide}{\underbrace{\Fdash{\PfCEcrireFacteur{#3}{Kk}}}_{k}\times\underbrace{\Fdash{\PfCEcrireFacteur{#4}{Ka}}}_{a}\PfCFactoSymbole\underbrace{\Fdash{\PfCEcrireFacteur{#3}{Kk}}}_{k}\times\underbrace{\Fdash{\PfCEcrireFacteur{#5}{Kb}}}_{b}}{\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#5}{Kb}}\setKV[Facto]{Aide=false}\\
- \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\left[\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#5}{Kb}\right]\\
- \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ka}\xintifboolexpr{\PfCRetiensSigneFacteurDeux==1}{\xintifboolexpr{\TestCASB<0}{\IfDecimal{\RetiensPremierCaractere}{+}{}}{+}\print{Kb}}{\xintifboolexpr{\TestCASB<0}{+}{}\print{Ko}}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}\\
- \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ke:expand():topolynomial()}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}%
- \ifboolKV[Facto]{Finale}{\\\PfCFactoNE&=\useKV[Facto]{Resultat}}{\ifboolKV[Facto]{Formel}{\\\PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ke:expand():topolynomial()}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}}{}}%
- \end{align*}
- }
- \fi
+ \ifnum\fpeval{\useKV[Facto]{Type}}=1\relax
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \begin{align*}
+ \ifboolKV[Facto]{Aide}{\PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#4}{Ka}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#3}{Kk}\PfCFactoSymbole\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#5}{Kb}\\\setKV[Facto]{Aide}}{}%
+ \PfCFactoNE&=\ifboolKV[Facto]{Aide}{\underbrace{\Fdash{\PfCEcrireFacteur{#4}{Ka}}}_{a}\times\underbrace{\Fdash{\PfCEcrireFacteur{#3}{Kk}}}_{k}\PfCFactoSymbole\underbrace{\Fdash{\PfCEcrireFacteur{#3}{Kk}}}_{k}\times\underbrace{\Fdash{\PfCEcrireFacteur{#5}{Kb}}}_{b}}{\PfCEcrireFacteur{#4}{Ka}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#3}{Kk}\PfCFactoSymbole\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#5}{Kb}}\setKV[Facto]{Aide=false}\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\left[\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#5}{Kb}\right]\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ka}\xintifboolexpr{\PfCRetiensSigneFacteurDeux==1}{\xintifboolexpr{\TestCASB<0}{\IfDecimal{\RetiensPremierCaractere}{+}{}}{+}\print{Kb}}{\xintifboolexpr{\TestCASB<0}{+}{}\print{Ko}}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ke:expand():topolynomial()}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}%
+ \ifboolKV[Facto]{Finale}{\\\PfCFactoNE&=\useKV[Facto]{Resultat}}{\ifboolKV[Facto]{Formel}{\\\PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ke:expand():topolynomial()}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}}{}}%
+ \end{align*}
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \else
+ \ifnum\fpeval{\useKV[Facto]{Type}}=3\relax
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \begin{align*}
+ \ifboolKV[Facto]{Aide}{\PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#4}{Ka}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#3}{Kk}\PfCFactoSymbole\PfCEcrireFacteur{#5}{Kb}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#3}{Kk}\\\setKV[Facto]{Aide}}{}%
+ \PfCFactoNE&=\ifboolKV[Facto]{Aide}{\underbrace{\Fdash{\PfCEcrireFacteur{#4}{Ka}}}_{a}\times\underbrace{\Fdash{\PfCEcrireFacteur{#3}{Kk}}}_{k}\PfCFactoSymbole\underbrace{\Fdash{\PfCEcrireFacteur{#5}{Kb}}}_{b}\times\underbrace{\Fdash{\PfCEcrireFacteur{#3}{Kk}}}_{k}}{\PfCEcrireFacteur{#4}{Ka}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#3}{Kk}\PfCFactoSymbole\PfCEcrireFacteur{#5}{Kb}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#3}{Kk}}\setKV[Facto]{Aide=false}\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\left[\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#5}{Kb}\right]\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ka}\xintifboolexpr{\PfCRetiensSigneFacteurDeux==1}{\xintifboolexpr{\TestCASB<0}{\IfDecimal{\RetiensPremierCaractere}{+}{}}{+}\print{Kb}}{\xintifboolexpr{\TestCASB<0}{+}{}\print{Ko}}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ke:expand():topolynomial()}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}%
+ \ifboolKV[Facto]{Finale}{\\\PfCFactoNE&=\useKV[Facto]{Resultat}}{\ifboolKV[Facto]{Formel}{\\\PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ke:expand():topolynomial()}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}}{}}%
+ \end{align*}
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \else
+ \ifnum\fpeval{\useKV[Facto]{Type}}=2\relax
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \begin{align*}
+ \ifboolKV[Facto]{Aide}{\PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#5}{Kb}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#3}{Kk}\\\setKV[Facto]{Aide}}{}%
+ \PfCFactoNE&=\ifboolKV[Facto]{Aide}{\underbrace{\Fdash{\PfCEcrireFacteur{#3}{Kk}}}_{k}\times\underbrace{\Fdash{\PfCEcrireFacteur{#4}{Ka}}}_{a}\PfCFactoSymbole\underbrace{\Fdash{\PfCEcrireFacteur{#5}{Kb}}}_{b}\times\underbrace{\Fdash{\PfCEcrireFacteur{#3}{Kk}}}_{k}}{\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#5}{Kb}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#3}{Kk}}\setKV[Facto]{Aide=false}\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\left[\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#5}{Kb}\right]\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ka}\xintifboolexpr{\PfCRetiensSigneFacteurDeux==1}{\xintifboolexpr{\TestCASB<0}{\IfDecimal{\RetiensPremierCaractere}{+}{}}{+}\print{Kb}}{\xintifboolexpr{\TestCASB<0}{+}{}\print{Ko}}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ke:expand():topolynomial()}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}%
+ \ifboolKV[Facto]{Finale}{\\\PfCFactoNE&=\useKV[Facto]{Resultat}}{\ifboolKV[Facto]{Formel}{\\\PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ke:expand():topolynomial()}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}}{}}%
+ \end{align*}
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \else
+ \begin{align*}
+ \ifboolKV[Facto]{Aide}{\PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#5}{Kb}\\\setKV[Facto]{Aide}}{}%
+ \PfCFactoNE&=\ifboolKV[Facto]{Aide}{\underbrace{\Fdash{\PfCEcrireFacteur{#3}{Kk}}}_{k}\times\underbrace{\Fdash{\PfCEcrireFacteur{#4}{Ka}}}_{a}\PfCFactoSymbole\underbrace{\Fdash{\PfCEcrireFacteur{#3}{Kk}}}_{k}\times\underbrace{\Fdash{\PfCEcrireFacteur{#5}{Kb}}}_{b}}{\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{AideMul}{\times}{}\PfCEcrireFacteur{#5}{Kb}}\setKV[Facto]{Aide=false}\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\left[\PfCEcrireFacteur{#4}{Ka}\PfCFactoSymbole\PfCEcrireFacteur{#5}{Kb}\right]\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ka}\xintifboolexpr{\PfCRetiensSigneFacteurDeux==1}{\xintifboolexpr{\TestCASB<0}{\IfDecimal{\RetiensPremierCaractere}{+}{}}{+}\print{Kb}}{\xintifboolexpr{\TestCASB<0}{+}{}\print{Ko}}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}\\
+ \PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\times\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ke:expand():topolynomial()}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}%
+ \ifboolKV[Facto]{Finale}{\\\PfCFactoNE&=\useKV[Facto]{Resultat}}{\ifboolKV[Facto]{Formel}{\\\PfCFactoNE&=\setKV[Facto]{Aide=false}\PfCEcrireFacteur{#3}{Kk}\ifboolKV[Facto]{ParenthesesFin}{\left(}{\left[}\print{Ke:expand():topolynomial()}\ifboolKV[Facto]{ParenthesesFin}{\right)}{\right]}}{}}%
+ \end{align*}
+ \fi%
+ \fi%
+ \fi%
+ }%
+ \fi%
}%
\NewDocumentCommand\Factorisationold{sommm}{%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCFonctionAffine.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCFonctionAffine.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCFonctionAffine.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,7 +1,7 @@
%%%
% Fonction Affine
%%%
-\setKVdefault[ClesAffine]{Nom=f,Variable=x,CoefDir=a,OrdoOrig=b,Ligne=false,Image=false,Antecedent=false,Graphique=false,Retrouve=false,ProgCalcul=false,Unitex=1,Unitey=1,VoirCoef=false,ACoef=0,Redaction=false,Ecriture=false,Definition=false}%ACoefficient=false%: inutile ?
+\setKVdefault[ClesAffine]{Nom=f,Variable=x,CoefDir=a,OrdoOrig=b,Ligne=false,Image=false,Antecedent=false,Graphique=false,Retrouve=false,ProgCalcul=false,Unitex=1,Unitey=1,VoirCoef=false,ACoef=0,Redaction=false,Ecriture=false,Definition=false,Centre=false}%ACoefficient=false%: inutile ?
\newcommand\FonctionAffine[5][]{%
% #1 nombre ou abscisse premier point
@@ -33,7 +33,7 @@
\ifboolKV[ClesAffine]{ProgCalcul}{%
La fonction affine $\useKV[ClesAffine]{Nom}$ est d\'efinie par :
\begin{align*}
- \useKV[ClesAffine]{Nom}&:\useKV[ClesAffine]{Variable}\stackrel{\times\xintifboolexpr{#3<0}{(\num{#3})}{\num{#3}}}{\longrightarrow}\num{#3}\useKV[ClesAffine]{Variable}\xintifboolexpr{#4==0}{}{\xintifboolexpr{#4>0}{\stackrel{+\num{#4}}{\longrightarrow}}{\stackrel{\num{#4}}{\longrightarrow}}\num{#3}\useKV[ClesAffine]{Variable}\xintifboolexpr{#4==0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{\num{#4}}}}
+ \useKV[ClesAffine]{Nom}&:\useKV[ClesAffine]{Variable}\stackrel{\times\xintifboolexpr{#3<0}{(\num{#3})}{\num{#3}}}{\longrightarrow}\num{#3}\useKV[ClesAffine]{Variable}\xintifboolexpr{#4==0}{}{\xintifboolexpr{#4>0}{\stackrel{+\num{#4}}{\longrightarrow}}{\stackrel{\num{#4}}{\longrightarrow}}\num{#3}\useKV[ClesAffine]{Variable}\xintifboolexpr{#4==0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{\num{#4}}}}.
\end{align*}
Nous cherchons le nombre $\useKV[ClesAffine]{Variable}$ tel que son image par la fonction $\useKV[ClesAffine]{Nom}$ soit $\num{#2}$. Donc on obtient :
\begin{align*}
@@ -45,7 +45,7 @@
$\useKV[ClesAffine]{Variable}$ tel que
$\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\num{#2}$. Or,
la fonction $\useKV[ClesAffine]{Nom}$ est d\'efinie par : \[%
- \useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\xintifboolexpr{#3==0}{}{\num{#3}\useKV[ClesAffine]{Variable}}\xintifboolexpr{#3==0}{\num{#4}}{\xintifboolexpr{#4==0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{-\num{\fpeval{0-#4}}}}}
+ \useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\xintifboolexpr{#3==0}{}{\num{#3}\useKV[ClesAffine]{Variable}}\xintifboolexpr{#3==0}{\num{#4}}{\xintifboolexpr{#4==0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{-\num{\fpeval{0-#4}}}}}.
\]
Par cons\'equent, on a :
\begin{align*}
@@ -90,9 +90,22 @@
\ifboolKV[ClesAffine]{Redaction}{%
\xintifboolexpr{#2==0}{Comme la fonction $\useKV[ClesAffine]{Nom}$
est une fonction constante, alors sa repr\'esentation graphique est une droite parall\`ele \`a l'axe des abscisses passant par le point de coordonn\'ees $(0;\num{#3})$.}%
- {\xintifboolexpr{#3==0}{Comme la fonction $\useKV[ClesAffine]{Nom}$ est une fonction lin\'eaire, alors sa repr\'esentation graphique est une droite passant par l'origine du rep\`ere.\\Je choisis $\useKV[ClesAffine]{Variable}=\num{#4}$. Son image est \xdef\NomFonctionA{\useKV[ClesAffine]{Nom}}\FonctionAffine[Nom=\NomFonctionA,Image,Ligne]{#4}{#2}{#3}{#5}. On place le point de coordonn\'ees $(\num{#4};\num{\fpeval{#2*#4+#3}})$.
+ {\xintifboolexpr{#3==0}{Comme la fonction $\useKV[ClesAffine]{Nom}$ est une fonction lin\'eaire, alors sa repr\'esentation graphique est une droite passant par l'origine du rep\`ere.\\Je choisis $\useKV[ClesAffine]{Variable}=\num{#4}$. Son image est \xdef\NomFonctionA{\useKV[ClesAffine]{Nom}}\FonctionAffine[Nom=\NomFonctionA,Image,Ligne]{#4}{#2}{#3}{#5}. On place le point de coordonn\'ees $(\num{#4}\,;\,\num{\fpeval{#2*#4+#3}})$.
}{%
- Comme $\useKV[ClesAffine]{Nom}$ est une fonction affine, alors sa repr\'esentation graphique est une droite.\\Je choisis $\useKV[ClesAffine]{Variable}=\num{#4}$. Son image est \xdef\NomVariable{\useKV[ClesAffine]{Variable}}\xdef\NomFonction{\useKV[ClesAffine]{Nom}}\FonctionAffine[Nom=\NomFonction,Image,Ligne]{#4}{#2}{#3}{#5}. On place le point de coordonn\'ees $(\num{#4};\num{\fpeval{#2*#4+#3}})$.\\Je choisis \setKV[ClesAffine]{Variable=\NomVariable}$\useKV[ClesAffine]{Variable}=\num{#5}$. Son image est \FonctionAffine[Nom=\NomFonction,Image,Ligne]{#5}{#2}{#3}{#4}. On place le point de coordonn\'ees $(\num{#5};\num{\fpeval{#2*#5+#3}})$.%
+ Comme $\useKV[ClesAffine]{Nom}$ est une fonction affine, alors sa repr\'esentation graphique est une droite.\\Je choisis $\useKV[ClesAffine]{Variable}=\num{#4}$. Son image est %
+ \xdef\NomVariable{\useKV[ClesAffine]{Variable}}\xdef\NomFonction{\useKV[ClesAffine]{Nom}}%
+ \ifboolKV[ClesAffine]{Centre}{: \[
+ \FonctionAffine[Nom=\NomFonction,Image,Ligne]{#4}{#2}{#3}{#5}.
+ \]}{%
+ \FonctionAffine[Nom=\NomFonction,Image,Ligne]{#4}{#2}{#3}{#5}. %
+ }%
+ On place le point de coordonn\'ees $(\num{#4}\,;\,\num{\fpeval{#2*#4+#3}})$.\\Je choisis \setKV[ClesAffine]{Variable=\NomVariable}$\useKV[ClesAffine]{Variable}=\num{#5}$. Son image est %
+ \ifboolKV[ClesAffine]{Centre}{: \[
+ \FonctionAffine[Nom=\NomFonction,Image,Ligne]{#5}{#2}{#3}{#5}.
+ \]}{%
+ \FonctionAffine[Nom=\NomFonction,Image,Ligne]{#5}{#2}{#3}{#5}. %
+ }%
+ On place le point de coordonn\'ees $(\num{#5}\,;\,\num{\fpeval{#2*#5+#3}})$.%
}%
}%
}%
@@ -103,9 +116,10 @@
\def\MPFonctionAffine#1#2#3#4#5#6#7{%
% #1 Unitex #2 Unitey
- % #2 a pour f1 - #4 b pour f1
- % #5 abscisse du premier point
- % #6 abscisse du deuxi\`eme point
+ % #3 a pour f1 - #4 b pour f1
+ % #5 abscisse du premier point
+ % #6 abscisse du deuxi\`eme point
+ % #7 on affiche ou pas la lecture du coef directeur
\ifluatex
\mplibforcehmode
\begin{mplibcode}
@@ -155,14 +169,14 @@
%On trace les axes
drawarrow (XMin*unitex,0)--(XMax*unitex,0);
drawarrow (0,YMin*unitey)--(0,YMax*unitey);
- label.llft(btex O etex,(0,0));
- dotlabel.bot(btex 1 etex,(unitex,0));
- dotlabel.lft(btex 1 etex,(0,unitey));
+ label.llft(TEX("\footnotesize O"),(0,0));
+ dotlabel.lrt(TEX("1"),(unitex,0));
+ dotlabel.ulft(TEX("1"),(0,unitey));
% On trace la droite
pair A[];
A1=(#5*unitex,(#5*#3+(#4))*unitey);
A2=(#6*unitex,(#6*#3+(#4))*unitey);
- draw 2[A1,A2]--2[A2,A1];
+ draw 10[A1,A2]--10[A2,A1];
clip currentpicture to ((XMin*unitex,YMin*unitey)--(XMax*unitex,YMin*unitey)--(XMax*unitex,YMax*unitey)--(XMin*unitex,YMax*unitey)--cycle);
%On labellise les points
fill (fullcircle scaled 1mm) shifted A1;
@@ -171,6 +185,7 @@
draw (xpart(A2),0)--A2--(0,ypart(A2)) dashed evenly;
if (#5*#3+(#4))=0:
else:
+ if #5<>1:
if (#5*#3+(#4))<0:
label.top(TEX("\num{"&decimal(#5)&"}"),(xpart(A1),0));
else:
@@ -177,14 +192,19 @@
label.bot(TEX("\num{"&decimal(#5)&"}"),(xpart(A1),0));
fi;
fi;
+ fi;
if (#6*#3+(#4))=0:
else:
if (#6*#3+(#4))<0:
+ if #6<>1:
label.top(TEX("\num{"&decimal(#6)&"}"),(xpart(A2),0));
+ fi;
else:
+ if #6<>1:
label.bot(TEX("\num{"&decimal(#6)&"}"),(xpart(A2),0));
fi;
fi;
+ fi;
if #3=0:
label.urt(TEX("\num{"&decimal(#5*#3+(#4))&"}"),(0,ypart(A1)));
else:
@@ -192,19 +212,23 @@
if (#5*#3+(#4))=0:
else:
if (#5*#3+(#4))<0:
+ if #5<0:
label.rt(TEX("\num{"&decimal(#5*#3+(#4))&"}"),(0,ypart(A1)));
else:
label.lft(TEX("\num{"&decimal(#5*#3+(#4))&"}"),(0,ypart(A1)));
fi;
fi;
+ fi;
if (#6*#3+(#4))=0:
else:
if (#6*#3+(#4))<0:
+ if #6<0:
label.rt(TEX("\num{"&decimal(#6*#3+(#4))&"}"),(0,ypart(A2)));
else:
label.lft(TEX("\num{"&decimal(#6*#3+(#4))&"}"),(0,ypart(A2)));
fi;
fi;
+ fi;
else:
if (#5*#3+(#4))=0:
else:
@@ -287,7 +311,7 @@
pair A[];
A1=(#5*unitex,(#5*#3+(#4))*unitey);
A2=(#6*unitex,(#6*#3+(#4))*unitey);
- draw 2[A1,A2]--2[A2,A1];
+ draw 10[A1,A2]--10[A2,A1];
clip currentpicture to ((XMin*unitex,YMin*unitey)--(XMax*unitex,YMin*unitey)--(XMax*unitex,YMax*unitey)--(XMin*unitex,YMax*unitey)--cycle);
%On labellise les points
fill (fullcircle scaled 1mm) shifted A1;
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCLego.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCLego.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCLego.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -22,7 +22,7 @@
\NewDocumentCommand\Lego{o}{%
\useKVdefault[Lego]%
\setKV[Lego]{#1}%
- \xintifboolexpr{\useKV[Lego]{Unite}==1}{%
+ \xintifboolexpr{\useKV[Lego]{Unite}==1 || \useKV[Lego]{Unique}}{%
\xdef\PfCNbCouleurs{1}%
}{%
\xdef\PfCNbCouleurs{\fpeval{floor(\useKV[Lego]{Unite}/\useKV[Lego]{Diviseur})}}%
@@ -38,7 +38,7 @@
\NewDocumentCommand\BuildBarreLego{mm}{%
\ifluatex%
\mplibforcehmode%
- \begin{mplibcode}
+ \begin{mplibcode}%
boolean Plaque,Unique;
Plaque=\useKV[Lego]{Plaque};
Unique=\useKV[Lego]{Unique};
@@ -105,9 +105,9 @@
RetiensLego=currentpicture;
currentpicture:=nullpicture;
draw RetiensLego scaled Echelle;
- \end{mplibcode}
- \else
- \begin{mpost}
+ \end{mplibcode}%
+ \else%
+ \begin{mpost}%
input PfCLego;
%
vardef ChoixCouleur(text t)=
@@ -153,6 +153,6 @@
Lego_box(Diviseur,2,Brique[k]);
endfor;
fi;
- \end{mpost}
+ \end{mpost}%
\fi%
}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -463,6 +463,30 @@
else:
draw courbe1(MinX,MaxX,25,Lagrange(x)(#1)) withpen pencircle scaled Epaisseur withcolor CoulTrace;
fi;
+ % Détermination des MinY et MaxY
+% MinY:=Lagrange(MinX)(#1);
+ for k=0 upto 100:
+ if Lagrange(MinX+(k/100)*(MaxX-MinX))(#1)<MinY:
+ MinY:=Lagrange(MinX+(k/100)*(MaxX-MinX))(#1);
+ fi;
+ endfor;
+ %for k=0 upto 100:
+ %if Lagrange(MinX+(k/100)*(MaxX-MinX))(#2)<MinY:
+ %MinY:=Lagrange(MinX+(k/100)*(MaxX-MinX))(#2);
+ %fi;
+ %endfor;
+% MaxY:=Lagrange(MinX)(#1);
+ for k=0 upto 100:
+ if Lagrange(MinX+(k/100)*(MaxX-MinX))(#1)>MaxY:
+ MaxY:=Lagrange(MinX+(k/100)*(MaxX-MinX))(#1);
+ fi;
+ endfor;
+ %for k=0 upto 100:
+ %if Lagrange(MinX+(k/100)*(MaxX-MinX))(#2)>MaxY:
+ %MaxY:=Lagrange(MinX+(k/100)*(MaxX-MinX))(#2);
+ %fi;
+ %endfor;
+ %%%
path cadreexterieur;
cadreexterieur=(((MinX-1)*X.u*cm,(floor(MinY)-1)*Y.u*cm)--((MaxX+1)*X.u*cm,(floor(MinY)-1)*Y.u*cm)--((MaxX+1)*X.u*cm,(floor(MaxY)+1)*Y.u*cm)--((MinX-1)*X.u*cm,(floor(MaxY)+1)*Y.u*cm)--cycle);
clip currentpicture to cadreexterieur;
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCProgrammeCalcul.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCProgrammeCalcul.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCProgrammeCalcul.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -28,30 +28,80 @@
\newlength{\PointillesClesProg}%
-\newcommand\ProgCalcul[2][]{%
- % #1 : cl\'es
- % #2 : \'etapes
+\NewDocumentCommand\ProgCalcul{som}{%
+ % #1 : pour l'écriture rapide, linéaire du programme de calcul
+ % #2 : cl\'es
+ % #3 : \'etapes
\useKVdefault[ClesProg]%
- \setKV[ClesProg]{#1}%
- \ifboolKV[ClesProg]{ThemePerso}{}{%
- \tcbset{ProgCalcul/.style={%
- boxsep=1mm,
- bottom=.75mm,
- middle=2mm,
- boxrule={\useKV[ClesProg]{Epaisseur}},
- text width={\useKV[ClesProg]{Largeur}},
- colframe={\useKV[ClesProg]{CouleurCadre}},
- colback={\useKV[ClesProg]{CouleurFond}},
- halign upper=center
+ \setKV[ClesProg]{#2}%
+ \IfBooleanTF{#1}{%
+ \setsepchar[*]{,* }\ignoreemptyitems%
+ \readlist*\ListeProg{#3}%
+ \ensuremath{%
+ \xdef\NbDepart{\ListeProg[1]}%
+ \ifboolKV[ClesProg]{SansCalcul}{%
+ \NbDepart\foreachitem\compteur\in\ListeProg[2]{%
+ \edef\Test{\ListeProg[2,\compteurcnt]}%
+ \expandarg%
+ \StrSubstitute{\Test}{^}{\empty\dots{}^}[\tempa]%
+ \StrSubstitute{\tempa}{**}{^}[\tempab]%
+ \StrSubstitute{\tempab}{*}{\times}[\tempac]%
+ \StrSubstitute{\tempac}{/}{\div}[\tempad]%
+ % \hspace{0.2em}
+ \xrightarrow{\tempad}
+ % \hspace{0.2em}
+ \ListeProg[3,\compteurcnt]%
+ }%
+ }{%
+ \num{\NbDepart}~\foreachitem\compteur\in\ListeProg[2]{%
+ \ifboolKV[ClesProg]{Direct}{%
+ \edef\Test{\ListeProg[2,\compteurcnt]}%
+ \expandarg%
+ \StrSubstitute{\Test}{^}{\empty\dots{}^}[\tempa]%
+ \StrSubstitute{\tempa}{**}{^}[\tempab]%
+ \StrSubstitute{\tempab}{*}{\times}[\tempac]%
+ \StrSubstitute{\tempac}{/}{\div}[\tempad]%
+ % \hspace{0.2em}
+ \xdef\NbDepart{\fpeval{(\NbDepart)\ListeProg[2,\compteurcnt]}}
+ % \hspace{0.2em}
+ \xrightarrow{\tempad}~\num{\NbDepart}%
+ }{%
+ \edef\Test{\ListeProg[2,\compteurcnt]}
+ \expandarg%
+ \StrSubstitute{\Test}{^2}{\empty\sqrt{\dots{}}}[\tempa]%
+ \StrSubstitute{\tempa}{**}{^}[\tempab]%
+ \StrSubstitute{\tempab}{*}{\div}[\tempac]%
+ \StrSubstitute{\tempac}{/}{\times}[\tempad]%
+ \StrSubstitute{\tempad}{-}{+}[\tempae]%
+ \StrSubstitute{\tempae}{++}{-}[\tempaf]%
+ %\hspace{0.2em}
+ \xdef\NbDepart{\fpeval{(\NbDepart)\ListeProg[2,\compteurcnt]}}
+ % \hspace{0.2em}
+ \xleftarrow{\tempaf}~\num{\NbDepart}%
+ }%
+ }%
+ }
+ }
+ }{%
+ \ifboolKV[ClesProg]{ThemePerso}{}{%
+ \tcbset{ProgCalcul/.style={%
+ boxsep=1mm,
+ bottom=.75mm,
+ middle=2mm,
+ boxrule={\useKV[ClesProg]{Epaisseur}},
+ text width={\useKV[ClesProg]{Largeur}},
+ colframe={\useKV[ClesProg]{CouleurCadre}},
+ colback={\useKV[ClesProg]{CouleurFond}},
+ halign upper=center
+ }%
}%
}%
- }%
\ifboolKV[ClesProg]{Application}{%
- % % by Thomas Dehon and cp
- \setsepchar[*]{§*,}
+ % % by Thomas Dehon and cp
+ \setsepchar[*]{§*,}%
% \setsepchar[*]{,* }%
\ignoreemptyitems%
- \readlist*\ListeTotale{#2}%
+ \readlist*\ListeTotale{#3}%
\xdef\PfCPCfoo{\ListeTotale[1]}%
\xdef\PfCPCfaa{\ListeTotale[2]}%
%%
@@ -94,7 +144,7 @@
% by Thomas Dehon
\setsepchar[*]{,* }%
\ignoreemptyitems%
- \readlist*\ListeEtapes{#2}%
+ \readlist*\ListeEtapes{#3}%
\begin{tcolorbox}[%
ProgCalcul,%
]
@@ -118,7 +168,7 @@
\end{tcolorbox}
}{%
\setsepchar[*]{,* }\ignoreemptyitems%
- \readlist*\ListeProg{#2}%
+ \readlist*\ListeProg{#3}%
\stepcounter{NBprog}%
\ifboolKV[ClesProg]{Vide}{%
\xdef\PfCNbDepart{\ListeProg[1]}%
@@ -181,8 +231,8 @@
}%
\end{tikzpicture}%
}{}%
- }{%
- \xdef\NbDepart{\ListeProg[1]}%
+ }{%
+ \xdef\NbDepart{\ListeProg[1]}%
\ifboolKV[ClesProg]{SansCalcul}{%
$\NbDepart$\foreachitem\compteur\in\ListeProg[2]{%
\hspace{0.2em}\tikzmark{A-\theNBprog-\compteurcnt}\hspace{\useKV[ClesProg]{Ecart}}\tikzmark{B-\theNBprog-\compteurcnt}\hspace{0.2em}$\ListeProg[3,\compteurcnt]$%
@@ -236,4 +286,5 @@
}%
}%
}%
+ }
}%
\ No newline at end of file
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRecyclage.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCRecyclage.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCRecyclage.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -0,0 +1,360 @@
+%%%
+% Logos Recyclage
+%%%
+\setKVdefault[Recyclage]{Ticket,Papier=false,Verre=false,Bouteille=false,Carton=false,Couleurs}%
+\defKV[Recyclage]{Couleur=\setKV[Recyclage]{Couleurs=false}}%
+
+\NewDocumentCommand\LogoRecyclage{o}{%
+ \useKVdefault[Recyclage]%
+ \setKV[Recyclage]{#1}%
+ \ifboolKV[Recyclage]{Papier}{%
+ \PfCLogoTriPapier%
+ }{%
+ \ifboolKV[Recyclage]{Carton}{%
+ \PfCLogoTriCarton%
+ }{%
+ \ifboolKV[Recyclage]{Verre}{%
+ \PfCLogoTriVerre%
+ }{%
+ \ifboolKV[Recyclage]{Bouteille}{%
+ \PfCLogoTriBouteille%
+ }{%
+ \PfCLogoTriTicket%
+ }%
+ }%
+ }%
+ }%
+}%
+
+\def\PfCLogoTriCodeBase{%
+ largeur=3;
+ rayon=0.5;
+ pair A,B,C,D,Mab,Mbc,Mcd,Mda,O,N[],T[];
+ A=(0,0);
+ B-A=u*(largeur,0);
+ C-B=u*(0,0.5*largeur);
+ D-C=A-B;
+ O=iso(A,B,C,D)+u*(rayon/2,0);
+ Mab-A=u*(rayon,0);
+ Mbc-C=u*(0,-rayon);
+ Mcd-C=u*(-rayon,0);
+ Mda-A=u*(0,rayon);
+ N1=2/5[D,C]+u*(rayon/2,-0.1);
+ N2-D=u*(0.1,-0.1);
+ N3-Mda=u*(0.1,0);
+ N4-Mab=u*(0,0.1);
+ N5=2/5[A,B]+u*(rayon/2,0.1);
+ path contourtri;
+ contourtri=D--Mda{dir-90}..{dir0}Mab--B--Mbc{dir90}..{dir180}Mcd--cycle;
+ path partieg;
+ partieg=O--N1--N2--N3{dir-90}..{dir0}N4--N5--cycle;
+ fill contourtri withcolor CouleurFond;
+ fill partieg withcolor white;
+ picture poubelle;
+ poubelle=image(
+ pair Q[],R[];
+ Q1=C+u*(-0.75rayon,-.75rayon);
+ Q2-Q1=u*(-0.25rayon,-1.75rayon);
+ Q3-Q2=u*(-0.85rayon,0);
+ Q4-Q3=u*(-0.25rayon,1.75rayon);
+ R1-Q1=u*(0.125rayon,0.1rayon);
+ R2-R1=u*(0.05rayon,0.2rayon);
+ R3-R2=u*(-0.15rayon,0);
+ R4-R3=u*(-0.15rayon,0.15rayon);
+ R8-Q4=u*(-0.125rayon,0.1rayon);
+ R7-R8=u*(-0.05rayon,0.2rayon);
+ R6-R7=u*(0.15rayon,0);
+ R5-R6=u*(0.15rayon,0.15rayon);
+ drawoptions(withpen pencircle scaled 1.25 withcolor black);
+ trace Q1--Q2--Q3--Q4;
+ trace R1--R2--R3--R4--R5--R6--R7--R8--cycle;
+ trace 1/5[R3,R6]--4/5[R3,R6];
+ drawoptions(withpen pencircle scaled 2.5 withcolor black);
+ trace (Q2+u*(0.1rayon,-0.1rayon))--(Q2+u*(0.1rayon,0.1rayon));
+ trace (Q3+u*(-0.1rayon,-0.1rayon))--(Q3+u*(-0.1rayon,0.1rayon));
+ drawoptions();
+ );
+ picture bacverre;
+ bacverre=image(%
+ pair S[];
+ S1=C+u*(-0.5rayon,-.35rayon);
+ S2-S1=u*(0,-0.45rayon);
+ S3-S2=u*(0,-1.25rayon);
+ S4-S3=u*(-0.45rayon,-0.45rayon);
+ S5-S4=u*(-0.875rayon,0);
+ S6-S5=u*(-0.45rayon,0.45rayon);
+ S7-S6=u*(0,1.25rayon);
+ S8-S7=u*(0.45rayon,0.45rayon);
+ S9-S8=u*(0.875rayon,0);
+ trace S2--S3{dir-90}..{dir180}S4--S5{dir180}..{dir90}S6--S7{dir90}..{dir0}S8--S9{dir0}..cycle;
+ trace (S4+u*(0.15rayon,-0.05rayon))--(S5+u*(-0.15rayon,-0.05rayon));
+ trace fullcircle scaled 1mm shifted (iso(S2,S7));
+ );
+}%
+
+\NewDocumentCommand\PfCLogoTriTicket{}{%
+ \ifluatex
+ \begin{Geometrie}[Cadre="aucun"]
+ boolean Colore;
+ color CouleurFond;
+ Colore=\useKV[Recyclage]{Couleurs};
+ if Colore:
+ CouleurFond=(253/256,197/256,47/256);
+ else:
+ CouleurFond=\useKV[Recyclage]{Couleur};
+ fi;
+ \PfCLogoTriCodeBase;
+ picture journal;
+ journal=image(%
+% typetrace:="mainlevee";
+ label.top(TEX("\ttfamily\footnotesize TICKET"),iso(A,iso(A,B)+u*(rayon/2,0))+u*(0,rayon/4));
+ T1=A+u*(rayon,1.5rayon);
+ T2-T1=u*(rayon,-rayon/4);
+ T3-T2=u*(0.5rayon,1rayon);
+ T4-T3=T1-T2;
+ path ticket,lignesprix[];
+ ticket=T1--T2{dir60}..{dir90}T3--T4{dir-90}..{dir-150}T1--cycle;
+ draw ticket;
+ for k=2 upto 7:
+ lignesprix[k]=(point(3+k/10) of ticket)--((point(3+k/10) of ticket)+T2-T1);
+ if k<7:
+ draw subpath(0.1,0.5) of lignesprix[k];
+ fi;
+ draw subpath(0.6,0.8) of lignesprix[k];
+ endfor;
+ );
+ trace journal;
+ if Colore:
+ drawoptions(withcolor black);
+ else:
+ drawoptions(withcolor white);
+ fi;
+ trace poubelle;
+ label(TEX("\bfseries\scriptsize\begin{tabular}{c}BAC\\DE\\TRI\end{tabular}"),iso(Q1,Q2,Q3,Q4));
+ drawoptions();
+ \end{Geometrie}
+ \fi
+}%
+
+\NewDocumentCommand\PfCLogoTriBouteille{}{%
+ \ifluatex
+ \begin{Geometrie}[Cadre="aucun"]
+ boolean Colore;
+ color CouleurFond;
+ Colore=\useKV[Recyclage]{Couleurs};
+ if Colore:
+ CouleurFond=(253/256,197/256,47/256);
+ else:
+ CouleurFond=\useKV[Recyclage]{Couleur};
+ fi;
+ \PfCLogoTriCodeBase;
+ picture bouteille;
+ bouteille=image(%
+ %typetrace:="mainlevee";
+ label.top(TEX("\ttfamily\footnotesize PLASTIQUE"),iso(A,iso(A,B)+u*(rayon/2,0))+u*(0,rayon/4));
+ T1=A+u*(1.25rayon,1.125rayon);
+ T2-T1=u*(0.75rayon,0);
+ T3-T2=u*(0,0.5rayon);
+ T4-T3=u*(0,0.5rayon);
+ T5-T4=u*(0,0.125rayon);
+ T6-T5=u*(-0.25rayon,0.25rayon);
+ T7-T6=u*(-0.125rayon,0);
+ T8-T7=u*(-0.25rayon,-0.25rayon);
+ T9-T8=u*(0,-0.125rayon);
+ T10-T9=u*(0,-0.5rayon);
+ T11-T10=u*(0,-0.5rayon);
+ path corps,bouchon,corpsg,lignesgrad[];
+ corps=T3{dir100}..{dir70}T4--T5{dir95}..{dir90}T6--T7{dir-90}..{dir-95}T8--T9{dir-70}..{dir-100}T10..{dir-50}T11{dir-10}..{dir10}T2{dir50}..cycle;
+ corpsg=T8--T9{dir-70}..{dir-100}T10..{dir-50}T11{dir-10};
+ bouchon=T6--(T6+u*(0.05rayon,0))--(T6+u*(0.05rayon,0.05rayon))--(T7+u*(-0.05rayon,0.05rayon))--(T7+u*(-0.05rayon,0))--cycle;
+ draw corps;
+ draw bouchon;
+ for k=1 upto 7:
+ lignesgrad[k]=(point(k*length corpsg/8) of corpsg){dir-10}..((point(k*length corpsg/8) of corpsg)+u*(0.125rayon,0));
+ if k<>6:
+ draw lignesgrad[k];
+ fi;
+ endfor;
+ );
+ trace bouteille;
+ if Colore:
+ drawoptions(withcolor black);
+ else:
+ drawoptions(withcolor white);
+ fi;
+ trace poubelle;
+ label(TEX("\bfseries\scriptsize\begin{tabular}{c}BAC\\DE\\TRI\end{tabular}"),iso(Q1,Q2,Q3,Q4));
+ drawoptions();
+ \end{Geometrie}
+ \fi
+}%
+
+\NewDocumentCommand\PfCLogoTriVerre{}{%
+ \ifluatex
+ \begin{Geometrie}[Cadre="aucun"]
+ boolean Colore;
+ color CouleurFond;
+ Colore=\useKV[Recyclage]{Couleurs};
+ if Colore:
+ CouleurFond=(0,139/256,50/256);
+ else:
+ CouleurFond=\useKV[Recyclage]{Couleur};
+ fi;
+ \PfCLogoTriCodeBase;
+ picture bouteille;
+ bouteille=image(%
+ %typetrace:="mainlevee";
+ label.top(TEX("\ttfamily\footnotesize VERRE"),iso(A,iso(A,B)+u*(rayon/2,0))+u*(0,rayon/4));
+ T1=A+u*(1.25rayon,1.125rayon);
+ T2-T1=u*(0.75rayon,0);
+ T3-T2=u*(0,0.5rayon);
+ T4-T3=u*(0,0.5rayon);
+ T5-T4=u*(0,0.125rayon);
+ T6-T5=u*(-0.25rayon,0.25rayon);
+ T7-T6=u*(-0.125rayon,0);
+ T8-T7=u*(-0.25rayon,-0.25rayon);
+ T9-T8=u*(0,-0.125rayon);
+ T10-T9=u*(0,-0.5rayon);
+ T11-T10=u*(0,-0.5rayon);
+ path corps,bouchon,corpsg,lignesgrad[];
+ corps=T3{dir100}..{dir70}T4--T5{dir95}..{dir90}T6--T7{dir-90}..{dir-95}T8--T9{dir-70}..{dir-100}T10..{dir-50}T11{dir-10}..{dir10}T2{dir50}..cycle;
+ corpsg=T8--T9{dir-70}..{dir-100}T10..{dir-50}T11{dir-10};
+ bouchon=T6--(T6+u*(0.05rayon,0))--(T6+u*(0.05rayon,0.05rayon))--(T7+u*(-0.05rayon,0.05rayon))--(T7+u*(-0.05rayon,0))--cycle;
+ draw corps;
+ draw bouchon;
+ for k=1 upto 7:
+ lignesgrad[k]=(point(k*length corpsg/8) of corpsg){dir-10}..((point(k*length corpsg/8) of corpsg)+u*(0.125rayon,0));
+ if k<>6:
+ draw lignesgrad[k];
+ fi;
+ endfor;
+ );
+ trace bouteille;
+% if Colore:
+% drawoptions(withcolor black);
+% else:
+ drawoptions(withpen pencircle scaled 1.25 withcolor white);
+% fi;
+ trace bacverre;
+ label(TEX("\bfseries\scriptsize\begin{tabular}{c}TRI\\VERRE\end{tabular}"),iso(S3,S6)+u*(0,0.245rayon));
+ drawoptions();
+ \end{Geometrie}
+ \fi
+}%
+
+\NewDocumentCommand\PfCLogoTriCarton{}{%
+ \ifluatex
+ \begin{Geometrie}[Cadre="aucun"]
+ boolean Colore;
+ color CouleurFond;
+ Colore=\useKV[Recyclage]{Couleurs};
+ if Colore:
+ CouleurFond=(253/256,197/256,47/256);
+ else:
+ CouleurFond=\useKV[Recyclage]{Couleur};
+ fi;
+ \PfCLogoTriCodeBase;
+ picture etui;
+ etui=image(%
+ %typetrace:="mainlevee";
+ label.top(TEX("\ttfamily\footnotesize CARTON"),iso(A,iso(A,B)+u*(rayon/2,0))+u*(0,rayon/4));
+ pair Tcarton[];
+ Tcarton1=A+u*(0.75rayon,1.75rayon);
+ Tcarton2-Tcarton1=u*(0,0.5rayon);
+ Tcarton3-Tcarton2=u*(0.5rayon,0.25rayon);
+ Tcarton4-Tcarton3=u*(1.25rayon,-0.5rayon);
+ Tcarton5-Tcarton4=Tcarton1-Tcarton2;
+ Tcarton6-Tcarton5=Tcarton2-Tcarton3;
+ Tcarton7-Tcarton6=Tcarton4-Tcarton5;
+ Tcarton8-Tcarton3=Tcarton5-Tcarton4;
+ path cotehaut,cotegauche,cotedroit,cotebas;
+ cotehaut=polygone(Tcarton4,Tcarton7,Tcarton7+u*(0.05rayon,0.35rayon),Tcarton4+u*(0.05rayon,0.35rayon));
+ cotebas=polygone(Tcarton5,Tcarton6,Tcarton6+u*(0.15rayon,-0.35rayon),Tcarton5+u*(0.15rayon,-0.35rayon));
+ cotegauche=polygone(Tcarton6,Tcarton7,Tcarton7+u*(-0.15rayon,-0.35rayon),Tcarton6+u*(-0.15rayon,-0.35rayon));
+ cotedroit=polygone(Tcarton4,Tcarton5,Tcarton5+u*(0.35rayon,-0.15rayon),Tcarton4+u*(0.35rayon,-0.15rayon));
+ trace polygone(Tcarton4,Tcarton5,Tcarton6,Tcarton7);
+ trace chemin(Tcarton7,Tcarton2,Tcarton3);
+ trace segment(Tcarton2,Tcarton1);
+ trace cotehaut; trace cotebas; trace cotegauche; trace cotedroit;
+ trace segment(Tcarton3,Tcarton4) cutafter segment(Tcarton7+u*(0.05rayon,0.35rayon),Tcarton4+u*(0.05rayon,0.35rayon));
+ trace segment(Tcarton1,Tcarton6) cutafter segment(Tcarton7+u*(-0.15rayon,-0.35rayon),Tcarton6+u*(-0.15rayon,-0.35rayon));
+ trace segment(Tcarton5,Tcarton8) cutafter segment(Tcarton7,Tcarton6);
+ );
+ trace etui;
+ if Colore:
+ drawoptions(withcolor black);
+ else:
+ drawoptions(withcolor white);
+ fi;
+ trace poubelle;
+ label(TEX("\bfseries\scriptsize\begin{tabular}{c}BAC\\DE\\TRI\end{tabular}"),iso(Q1,Q2,Q3,Q4));
+ drawoptions();
+ \end{Geometrie}
+ \fi
+}%
+
+\NewDocumentCommand\PfCLogoTriPapier{}{%
+ \ifluatex
+ \begin{Geometrie}[Cadre="aucun"]
+ boolean Colore;
+ color CouleurFond;
+ Colore=\useKV[Recyclage]{Couleurs};
+ if Colore:
+ CouleurFond=(253/256,197/256,47/256);
+ else:
+ CouleurFond=\useKV[Recyclage]{Couleur};
+ fi;
+ \PfCLogoTriCodeBase;
+ picture journal;
+ journal=image(%
+% typetrace:="mainlevee";
+ label.top(TEX("\ttfamily\footnotesize PAPIER"),iso(A,iso(A,B)+u*(rayon/2,0))+u*(0,rayon/4));
+ T1=A+u*(1.25rayon,rayon);
+ T2-T1=u*(0.5rayon,0.125rayon);
+ T3-T2=u*(0.5rayon,0);
+ T4-T3=u*(-0.125rayon,1.5rayon);
+ T5-T2=0.85*(T4-T3);
+ T6-T1=0.95*(T4-T3);
+ path ticket,lignesprix[];
+ ticket=T1--T2--T3--T4--T5--T6--cycle;
+ draw ticket;
+ trace T2--T5;
+ % lignes côté gauche
+ for k=1 upto 3:
+ lignesprix[k]=(point(5+k/12) of ticket)--((point(5+k/12) of ticket)+T5-T6);
+ draw subpath(0.1,0.5) of lignesprix[k];
+ endfor;
+ for k=5 upto 6:
+ lignesprix[k]=(point(5+k/12) of ticket)--((point(5.065+k/12) of ticket)+T2-T1);
+ draw subpath(0.1,0.9) of lignesprix[k];
+ endfor;
+ for k=9 upto 11:
+ lignesprix[k]=(point(5+k/12) of ticket)--((point(5+k/12) of ticket)+T2-T1);
+ draw subpath(0.5,0.9) of lignesprix[k];
+ endfor;
+ % lignes côté droit
+ for k=1 upto 3:
+ lignesprix[k]:=(point(2+k/12) of ticket)--((point(2+k/12) of ticket)+T2-T3);
+ draw subpath(0.1,0.5) of lignesprix[k];
+ endfor;
+ for k=5 upto 7:
+ lignesprix[k]:=(point(2+k/12) of ticket)--((point(1.935+k/12) of ticket)+T2-T3);
+ draw subpath(0.1,0.4) of lignesprix[k];
+ endfor;
+ for k=9 upto 11:
+ lignesprix[k]:=(point(2+k/12) of ticket)--((point(2+k/12) of ticket)+T5-T4);
+ draw subpath(0.2,0.8) of lignesprix[k];
+ endfor;
+ );
+ trace journal;
+ if Colore:
+ drawoptions(withcolor black);
+ else:
+ drawoptions(withcolor white);
+ fi;
+ trace poubelle;
+ label(TEX("\bfseries\scriptsize\begin{tabular}{c}BAC\\DE\\TRI\end{tabular}"),iso(Q1,Q2,Q3,Q4));
+ drawoptions();
+ \end{Geometrie}
+ \fi
+}%
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRecyclage.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -737,6 +737,7 @@
% #4 : la liste courte des noms des points.
% #5 : liste des points pour les string
\ifluatex
+ \mplibforcehmode
\begin{mplibcode}
defaultcolormodel := \useKV[ClesReperage]{ModeleCouleur};
boolean Tiret,Code,AffichageGrad,Cadre;
@@ -1305,9 +1306,6 @@
if minx>(-pasx-1):
minx:=-2*pasx-1;
fi;
- if DemiDroite:
- minx:=0;
- fi;
if minx<\useKV[ClesReperage]{ValeurMin}:
minx:=\useKV[ClesReperage]{ValeurMin};
fi;
@@ -1314,6 +1312,17 @@
if maxx>\useKV[ClesReperage]{ValeurMax}:
maxx:=\useKV[ClesReperage]{ValeurMax};
fi;
+ % Pour gérer les cas des droites où toutes les valeurs sont soit positives soit négatives
+ if maxx<pasx:
+ maxx:=pasx+1;
+ fi;
+ if minx>-pasx:
+ minx:=-pasx-1;
+ fi;
+ %
+ if DemiDroite:
+ minx:=0;
+ fi;
% -----
pair A,B,C;
A=(0,0);
@@ -1424,7 +1433,15 @@
pointe(unitp*(valeur[n],0));
drawoptions();
elseif ACoord=1:
+ %
+ if Decale:
+ drawarrow (unitp*valeur[n],-7mm if (n mod 2)=0:-5mm fi)--(unitp*valeur[n],-3mm);
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],-7mm if (n mod 2)=0:-5mm fi));
+ else:
+ %drawarrow (unitp*valeur[n],-7mm)--(unitp*valeur[n],-3mm);
+ %label.bot(TEX("\pointilles[1cm]"),(unitp*valeur[n],-7mm));
label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
+ fi;
drawoptions(withcolor CouleurCroix);
pointe(unitp*(valeur[n],0));
drawoptions();
@@ -1464,19 +1481,32 @@
else:
label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
fi;
- drawoptions(withcolor CouleurCroix);
- pointe(unitp*(valeur[n],0));
- drawoptions();
+ drawoptions(withcolor CouleurCroix);
+ pointe(unitp*(valeur[n],0));
+ drawoptions();
fi;
elseif AffichageCoord=1:
if p_<>"":
+ if Decale:
+ Labeloffset:=labeloffset;
+ labeloffset:=2pt;
+ if (valeur[n]<>0) and (valeur[n]<>pasx):
+ drawarrow (unitp*valeur[n],-7mm if (n mod 2)=0:-5mm fi)--(unitp*valeur[n],-3mm);
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),(unitp*valeur[n],-7mm if (n mod 2)=0:-5mm fi));
+ fi;
+ labeloffset:=Labeloffset;
+ else:
+ %drawarrow (unitp*valeur[n],-7mm)--(unitp*valeur[n],-3mm);
+ %label.bot(TEX("\pointilles[1cm]"),(unitp*valeur[n],-7mm));
label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
- drawoptions(withcolor CouleurCroix);
- pointe(unitp*(valeur[n],0));
- drawoptions();
fi;
+ %label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
+ drawoptions(withcolor CouleurCroix);
+ pointe(unitp*(valeur[n],0));
+ drawoptions();
fi;
fi;
+ fi;
endfor;
fi;
enddef;
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterTableur.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterTableur.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterTableur.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -12,6 +12,7 @@
\newcount\Affichecntcol%
\newcount\Affichecntlin%
\makeatletter%
+% Pour la version nicematrix
\newtoks\t at b%
\long\def\ifremain at lines#1\\#2\@nil{%
\csname @\ifx\@empty#2\@empty second\else first\fi oftwo\endcsname}%
@@ -24,14 +25,26 @@
\newcommand\addtot at b[1]{\t at b\expandafter{\the\t at b#1}}%
\newcommand\edftot at b[1]{\edef\temp@{#1}\expandafter\addtot at b\expandafter{\temp@}}%
+%%%%%%%%%%
+% Pour la version tabular
+\newtoks\t at bs%
+\long\def\ifremain at liness#1\\#2\@nil{%
+ \csname @\ifx\@empty#2\@empty second\else first\fi oftwo\endcsname}%
+\long\def\subst at eols#1\\#2\@nil{\addtot at bs{#1\\\hline}%
+ \ifremain at lines#2\\\@nil{\addtot at bs&\subst at eols#2\@nil}{\addtot at bs{#2\end{tabular}}}}%
+\long\def\collectcp at bodys#1\end{\subst at eols#1\@nil\end}%
+\newcommand\addtot at bs[1]{\t at bs\expandafter{\the\t at bs#1}}%
+\newcommand\edftot at bs[1]{\edef\temp@{#1}\expandafter\addtot at bs\expandafter{\temp@}}%
+%%%%%%%%%%%%%%%
+
\newlength\PfCLongInter%
\newlength\PfCTableurLargeurUn%
\newlength\PfCTableurLargeur%
-\newenvironment{Tableur}[1][]{%
+\NewDocumentEnvironment{Tableur}{so}{%
\useKVdefault[Tableur]%
- \setKV[Tableur]{#1}%
+ \setKV[Tableur]{#2}%
\setlength{\PfCTableurLargeurUn}{\fpeval{\useKV[Tableur]{LargeurUn}}pt}%
\setlength{\PfCTableurLargeur}{\fpeval{\useKV[Tableur]{Largeur}}pt}%
\ifnum\useKV[Tableur]{DebutColonnes}=0\relax
@@ -47,6 +60,42 @@
\ttfamily%
\newcolumntype{A}{>{\centering\arraybackslash}m{\PfCTableurLargeurUn}}%
\newcolumntype{B}{>{\centering\arraybackslash}m{\PfCTableurLargeur}}%
+ \IfBooleanTF{#1}{%
+ \setlength{\PfCLongInter}{-40pt+\fpeval{\useKV[Tableur]{LargeurUn}}pt+\fpeval{(\useKV[Tableur]{Colonnes}-2)*\useKV[Tableur]{Largeur}}pt+\fpeval{2*\useKV[Tableur]{Colonnes}-6}\tabcolsep+\fpeval{\useKV[Tableur]{Colonnes}-3}\arrayrulewidth}%
+ \ifboolKV[Tableur]{Bandeau}{%
+ \begin{tabular}{|p{\PfCTableurLargeur}|p{10pt}|p{50pt}|p{\PfCLongInter}|}%
+ \hhline{--~-}%
+ \useKV[Tableur]{Cellule}&\scriptsize$\blacktriangledown$&$f_x$\hfill$\sum$~\scriptsize$\blacktriangledown$\hfill$=$&\useKV[Tableur]{Formule}\hfill\scriptsize$\blacktriangledown$\\%
+ \hhline{--~-}%
+ \end{tabular}%
+ \nopagebreak%
+ \\%
+ }{}%
+ \cntlin\z@%
+ \t at bs{%
+ \begin{tabular}{%
+ |>{%
+ \cellcolor{gray!15}%
+ \global\cntcol\z@
+ \global\advance\cntlin\@ne%
+ \centering\arraybackslash%
+ \ifnum\cntlin>\@ne%
+ \fpeval{\cntlin+\Affichecntlin-1}\fi}%
+ wc{20pt}|A|*{\fpeval{\useKV[Tableur]{Colonnes}-1}}{B|}}%
+ \hline%
+ \rowcolor{gray!15}%
+ }%
+ \loop%
+ \ifnum\cntcol<\useKV[Tableur]{Colonnes}%
+ \advance\cntcol\@ne%
+ \advance\Affichecntcol\@ne%
+ \addtot at bs{&}%
+ % \edftot at bs{\@Alph{\the\cntcol}}%
+ \edftot at bs{\@Alph{\the\Affichecntcol}}%
+ \repeat%
+ \addtot at bs{\\\hline&}%
+ \collectcp at bodys
+ }{%
\setlength{\PfCLongInter}{-40pt+\fpeval{\useKV[Tableur]{LargeurUn}}pt+\fpeval{(\useKV[Tableur]{Colonnes}-2)*\useKV[Tableur]{Largeur}}pt+\fpeval{2*\useKV[Tableur]{Colonnes}-6}\tabcolsep+\fpeval{\useKV[Tableur]{Colonnes}+2}\arrayrulewidth}%
\ifboolKV[Tableur]{Bandeau}{%
\begin{NiceTabular}{p{\PfCTableurLargeur}p{10pt}p{50pt}p{\PfCLongInter}}%
@@ -111,5 +160,5 @@
% fin de modif
\repeat%
\addtot at b{\\&}%
- \collectcp at body}{\the\t at b}%
+ \collectcp at body}}{\IfBooleanTF{#1}{\the\t at bs}{\the\t at b}}%
\makeatother
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCReseauxSociaux.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCReseauxSociaux.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCReseauxSociaux.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,9 +1,9 @@
%%%
% Twitter
%%%
-\setKVdefault[Twitter]{Largeur=0.95\linewidth,Auteur=Christophe,Date=\today,Url=ViveLaTeX,EchelleLogo=0.035,Logo=DrStrange,Publie=false}
+\setKVdefault[Twitter]{Largeur=0.95\linewidth,Auteur=Christophe,Date=\today,Url=ViveLaTeX,EchelleLogo=0.035,Logo=DrStrange,Publie=false}%
-\NewEnviron{Twitter}[1][]{%
+\NewDocumentEnvironment{Twitter}{o+b}{%
\useKVdefault[Twitter]%
\setKV[Twitter]{#1}%
\xdef\EchelleLogo{\useKV[Twitter]{EchelleLogo}}%
@@ -26,16 +26,16 @@
left=3em,
bottom=2em]
\vspace*{0.5em}\par
- \BODY%
+ #2
\end{tcolorbox}
-}
+}{}%
%%%
% Facebook
%%%
-\setKVdefault[Facebook]{Largeur=0.95\linewidth,Auteur=Christophe,Date=\today,Heure=3:14,EchelleLogo=0.035,Logo=DrStrange,Publie=false}
+\setKVdefault[Facebook]{Largeur=0.95\linewidth,Auteur=Christophe,Date=\today,Heure=3:14,EchelleLogo=0.035,Logo=DrStrange,Publie=false}%
-\NewEnviron{Facebook}[1][]{%
+\NewDocumentEnvironment{Facebook}{o+b}{%
\useKVdefault[Facebook]%
\setKV[Facebook]{#1}%
\xdef\EchelleLogo{\useKV[Facebook]{EchelleLogo}}%
@@ -68,18 +68,17 @@
colframe=gray!15,
top=2em,
left=3em,
- bottom=4em]
- %\vspace*{0.5em}\par
- \BODY%
+ bottom={\ifboolKV[Facebook]{Publie}{4em}{2em}}]
+ #2
\end{tcolorbox}
-}
+}{}%
%%%
% Instagram
%%%
-\setKVdefault[Instagram]{Largeur=0.95\linewidth,Auteur=Christophe,Expediteur=Pierre,Date=\today,Temps=34,Publie=false,Logo=DrStrange,LogoEx=tiger,EchelleLogo=0.035,Texte={}}
+\setKVdefault[Instagram]{Largeur=0.95\linewidth,Auteur=Christophe,Expediteur=Pierre,Date=\today,Temps=34,Publie=false,Logo=DrStrange,LogoEx=tiger,EchelleLogo=0.035,Texte={}}%
-\NewEnviron{Instagram}[1][]{%
+\NewDocumentEnvironment{Instagram}{o+b}{%
\useKVdefault[Instagram]%
\setKV[Instagram]{#1}%
\xdef\EchelleLogo{\useKV[Instagram]{EchelleLogo}}%
@@ -113,16 +112,16 @@
top=3em,
left=3em,
bottom=7em]
- \BODY%
+ #2
\end{tcolorbox}
-}
+}{}%
%%%
% Snapchat
%%%
-\setKVdefault[Snapchat]{Largeur=0.95\linewidth,Auteur=Christophe,Date=\today,Temps=34,Logo=DrStrange,EchelleLogo=0.035,Texte=Envoyer un Chat}
+\setKVdefault[Snapchat]{Largeur=0.95\linewidth,Auteur=Christophe,Date=\today,Temps=34,Logo=DrStrange,EchelleLogo=0.035,Texte=Envoyer un Chat}%
-\NewEnviron{Snapchat}[1][]{%
+\NewDocumentEnvironment{Snapchat}{o+b}{%
\useKVdefault[Snapchat]%
\setKV[Snapchat]{#1}%
\xdef\EchelleLogo{\useKV[Snapchat]{EchelleLogo}}%
@@ -154,6 +153,43 @@
top=3em,
left=3em,
bottom=3em]
- \BODY%
+ #2
\end{tcolorbox}
-}
\ No newline at end of file
+}{}%
+
+%%%
+% Mastodon
+%%%
+\setKVdefault[Mastodon]{Largeur=0.95\linewidth,Auteur=Christophe,Date=2~j,Url=ViveLaTeX,EchelleLogo=0.035,Logo=DrStrange,Publie=false}%
+
+\NewDocumentEnvironment{Mastodon}{o+b}{%
+ \useKVdefault[Mastodon]%
+ \setKV[Mastodon]{#1}%
+ \xdef\EchelleLogo{\useKV[Mastodon]{EchelleLogo}}%
+ \begin{tcolorbox}[%
+ enhanced,%
+ overlay unbroken and first={%
+ \node[anchor=west,xshift=3em,yshift=-2em] at (frame.north west) {%
+ \begin{tabular}{l}
+ \textbf{\useKV[Mastodon]{Auteur}}\\
+ {\color{gray}@\ttfamily \useKV[Mastodon]{Url}}
+ \end{tabular}};
+ \node[anchor=center,xshift=1em+2mm,yshift=-2em] at (frame.north west) {\LogoTW{\useKV[Mastodon]{Logo}}{\EchelleLogo}};
+ \node[anchor=center,yshift=-2em,xshift=-2em] at (frame.north east) {\faGlobeAmericas~\useKV[Mastodon]{Date}};
+ \coordinate[yshift=1em] (A) at (frame.south west);
+ \coordinate[yshift=1em] (B) at (frame.south east);
+ \node[] (C1) at ($(A)!0.1!(B)$) {\faReply\ifboolKV[Mastodon]{Publie}{~\fpeval{randint(1,10)}}{}};
+ \node[] (C2) at ($(A)!0.29!(B)$) {\faRetweet};%\ifboolKV[Mastodon]{Publie}{~\fpeval{randint(1,10)}}{}};
+ \node[] (C3) at ($(A)!0.48!(B)$) {\faStar[regular]};%\ifboolKV[Mastodon]{Publie}{~\fpeval{randint(1,10)}}{}};
+ \node[] (C4) at ($(A)!0.67!(B)$) {\faBookmark[regular]};
+ \node[] (C5) at ($(A)!0.85!(B)$) {...};
+ },
+ colback=white,
+ colframe=gray!15,
+ top=2em,
+ left=3em,
+ bottom=2em]
+ \vspace*{1em}\par
+ #2
+ \end{tcolorbox}
+}{}%
\ No newline at end of file
Deleted: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRondeInfernaleold.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCRondeInfernaleold.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCRondeInfernaleold.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,474 +0,0 @@
-%%%
-% Ronde infernale
-%%%
-\newcommand\TestNombrePremier[1]{%
- % #1 le nombre \`a tester
- \newcount\anp\newcount\bnp\newcount\cnp%
- \anp=#1\relax
- \bnp=2\relax
- \premier=-1\relax
- \whiledo{\anp > 1}{%
- \modulo{\the\anp}{\the\bnp}
- \ifnum\remainder=0\relax%
- \global\premier=\numexpr\premier+1\relax%
- \cnp=\numexpr\anp/\bnp\relax%
- \anp=\cnp\relax%
- \else%
- \bnp=\numexpr\bnp+1\relax%
- \fi%
- }%
-}%
-
-\newcommand\PfCRIListeDiviseur[1]{%#1 : nombre entier
- \newcount\anp\newcount\bnp%
- \anp=\fpeval{abs(#1)}%
- \bnp=2\relax%
- \xdef\PfCRIRetiensListeDiviseurs{}%
- \ifnum#1=0%
- \xdef\PfCRIRetiensListeDiviseurs{\fpeval{randint(2,5)},\fpeval{randint(6,9)}}%
- \else
- \whiledo{\bnp<\anp}{%
- \modulo{\the\anp}{\the\bnp}{}%
- \ifnum\remainder=0%
- \ifnum#1>0
- \xdef\PfCRIRetiensListeDiviseurs{\PfCRIRetiensListeDiviseurs \the\bnp,}%
- \else
- \xdef\PfCRIRetiensListeDiviseurs{\PfCRIRetiensListeDiviseurs \the\bnp,-\the\bnp,}%
- \fi
- \fi%
- \bnp=\numexpr\bnp+1%
- }%
- \ifnum#1>0
- \xdef\PfCRIRetiensListeDiviseurs{\PfCRIRetiensListeDiviseurs \the\anp,1}
- \else
- \xdef\PfCRIRetiensListeDiviseurs{\PfCRIRetiensListeDiviseurs \the\anp,-\the\anp}
- \fi
- \fi
-}%
-
-\setKVdefault[RondeInfernale]{Solution=false,Relatifs=false,Etapes=4,Perso=false,Cles=false,Vide,Rayon=2.5cm,Rectangle=false,Div=false,Cdot=false}%
-\defKV[RondeInfernale]{Graine=\PfCGraineAlea{#1}}
-\defKV[RondeInfernale]{Cle=\setKV[RondeInfernale]{Cles}\setKV[RondeInfernale]{Vide=false}}%
-\defKV[RondeInfernale]{ListeOperations=\setKV[RondeInfernale]{Perso}}%
-\defKV[RondeInfernale]{ListeNombres=\setKV[RondeInfernale]{Perso}}%
-%
-
-\NewDocumentCommand\RondeInfernale{ }{%Mise en place pour les germanistes : le " est actif :(
- \begingroup
- \catcode`\"12
- \RondeInfernaleaux
-}%
-
-\NewDocumentCommand\RondeInfernaleaux{o}{%
- \endgroup
- \useKVdefault[RondeInfernale]%
- \setKV[RondeInfernale]{#1}%
- % Graine
-% \ifboolKV[RondeInfernale]{Graines}{\PfCGraineAlea{\useKV[RondeInfernale]{Graine}}}{}%
- % Nombre clé
- \ifboolKV[RondeInfernale]{Cles}{%
- \xdef\PfCRINombreCle{\useKV[RondeInfernale]{Cle}}%
- }{%
- \ifboolKV[RondeInfernale]{Relatifs}{%
- \xdef\PfCRIListeNegatifs{-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8,9,10}
- \MelangeListe{\PfCRIListeNegatifs}{1}
- \readlist*\PfCRIListeCle{\faa}
- \xdef\PfCRINombreCle{\PfCRIListeCle[1]}%
- }{%
- \xdef\PfCRINombreCle{\fpeval{randint(2,9)}}%
- }%
- }%
- \ifboolKV[RondeInfernale]{Perso}{%
- \xdef\PfCRIRecupOperations{\useKV[RondeInfernale]{ListeOperations}}%
- \xdef\PfCRIRecupNombres{\useKV[RondeInfernale]{ListeNombres}}%
- }{%
- % On définit les éléments nécessaires
- \xdef\PfCRIListeToutesOperations{+,-,*,/}%
- \xdef\PfCRIListeOperationsSansDiv{+,-,*}%
- \xdef\PfCRIListeOperationsSansMul{+,-,/}%
- \xdef\PfCRIListeOperationsSimple{+,-}%
- \xdef\PfCRIRecupOperations{}%
- \xdef\PfCRIRecupNombres{}%
- \xdef\PfCRIRecupResultats{}%
- \xdef\PfCRINombreATester{\PfCRINombreCle}%
- \xdef\PfCRIRetiensNbEtapes{\useKV[RondeInfernale]{Etapes}}%
- \setsepchar{,}\ignoreemptyitems%
- % Liste des opérations jusqu'à l'étape n-1
- \xintFor* ##1 in{\xintSeq{1}{\fpeval{\useKV[RondeInfernale]{Etapes}-1}}}\do{%
- \TestNombrePremier{\PfCRINombreATester}\relax%
- \xintifboolexpr{\premier==0}{%
- % Définition des opérations
- \MelangeListe{\PfCRIListeOperationsSansDiv}{1}%
- \readlist*\PfCRIRetiensLoperation{\faa}%
- \xdef\PfCRIRecupOperations{\PfCRIRecupOperations \faa}%
- \xdef\PfCRIOperateur{\fpeval{randint(2,9)}}%
- \xdef\PfCRIRecupNombres{\PfCRIRecupNombres \PfCRIOperateur,}%
- \xdef\PfCRIResultat{\fpeval{\PfCRINombreATester\PfCRIRetiensLoperation[1]\PfCRIOperateur}}%
- \xdef\PfCRIRecupResultats{\PfCRIRecupResultats \PfCRIResultat,}%
- \xdef\PfCRINombreATester{\PfCRIResultat}%
- }{%
- \MelangeListe{\PfCRIListeToutesOperations}{1}%
- \readlist*\PfCRIRetiensLoperation{\faa}%
- \xdef\PfCRIRecupOperations{\PfCRIRecupOperations \faa}%
- \IfStrEq{\PfCRIRetiensLoperation[1]}{/}{%
- \PfCRIListeDiviseur{\PfCRINombreATester}%
- \MelangeListe{\PfCRIRetiensListeDiviseurs}{1}%
- \readlist*\PfCRIRetiensLeDiviseur{\faa}%
- \xdef\PfCRIOperateur{\PfCRIRetiensLeDiviseur[1]}%
- }{%
- \xdef\PfCRIOperateur{\fpeval{randint(2,9)}}%
- }%
- \xdef\PfCRIRecupNombres{\PfCRIRecupNombres \PfCRIOperateur,}%
- \xdef\PfCRIResultat{\fpeval{\PfCRINombreATester\PfCRIRetiensLoperation[1]\PfCRIOperateur}}%
- \xdef\PfCRIRecupResultats{\PfCRIRecupResultats \PfCRIResultat,}%
- \xdef\PfCRINombreATester{\PfCRIResultat}%
- }%
- }%
- % Dernière opération
- \xintifboolexpr{\fpeval{abs(\PfCRINombreATester)-abs(\PfCRINombreCle)}>0}{%
- \modulo{\PfCRINombreATester}{\PfCRINombreCle}{}%
- \xintifboolexpr{\remainder==0}{%
- \MelangeListe{\PfCRIListeOperationsSansMul}{1}%
- \xdef\PfCRIRecupOperations{\PfCRIRecupOperations \faa}%
- \ignoreemptyitems%
- \readlist*\PfCRIRetiensLoperation{\faa}%
- \IfStrEq{\PfCRIRetiensLoperation[1]}{/}{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreATester/\PfCRINombreCle}}%
- }{%
- \IfStrEq{\PfCRIRetiensLoperation[1]}{-}{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreATester-\PfCRINombreCle}}%
- }{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreCle-\PfCRINombreATester}}%
- }%
- }%
- \xdef\PfCRIRecupNombres{\PfCRIRecupNombres \PfCRINombreATester}%
- }{%
- \MelangeListe{\PfCRIListeOperationsSimple}{1}%
- \xdef\PfCRIRecupOperations{\PfCRIRecupOperations \faa}%
- \ignoreemptyitems%
- \readlist*\PfCRIRetiensLoperation{\faa}%
- \IfStrEq{\PfCRIRetiensLoperation[1]}{-}{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreATester-\PfCRINombreCle}}%
- }{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreCle-\PfCRINombreATester}}%
- }%
- \xdef\PfCRIRecupNombres{\PfCRIRecupNombres \PfCRINombreATester}%
- }%
- }{%
- \xintifboolexpr{\fpeval{abs(\PfCRINombreATester)-abs(\PfCRINombreCle)}==0}{%
- \xdef\PfCRIRecupOperations{\PfCRIRecupOperations *}%
- \ignoreemptyitems%
- \readlist*\PfCRIRIListeOperations{\PfCRIRecupOperations}%
- \xdef\PfCRIRecupNombres{\PfCRIRecupNombres 1}%
- }{%
- \xintifboolexpr{\PfCRINombreATester==0}{%
- \MelangeListe{\PfCRIListeOperationsSimple}{1}%
- \xdef\PfCRIRecupOperations{\PfCRIRecupOperations \faa}%
- \ignoreemptyitems%
- \readlist*\PfCRIRetiensLoperation{\faa}%
- \IfStrEq{\PfCRIRetiensLoperation[1]}{-}{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreATester-\PfCRINombreCle}}%
- }{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreCle-\PfCRINombreATester}}%
- }%
- \xdef\PfCRIRecupNombres{\PfCRIRecupNombres \PfCRINombreATester}%
- }{%
- \modulo{\PfCRINombreCle}{\PfCRINombreATester}{}%
- \xintifboolexpr{\remainder==0}{%-1
- \MelangeListe{\PfCRIListeToutesOperations}{1}%
- \xdef\PfCRIRecupOperations{\PfCRIRecupOperations \faa}%
- \readlist*\PfCRIRetiensLoperation{\faa}%
- \ignoreemptyitems%
- \readlist*\PfCRIRIListeOperations{\PfCRIRecupOperations}%
- \IfStrEq{\PfCRIRetiensLoperation[1]}{*}{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreCle/\PfCRINombreATester}}%
- \xdef\PfCRIRecupNombres{\PfCRIRecupNombres \PfCRINombreATester}%
- }{
- \IfStrEq{\PfCRIRetiensLoperation[1]}{-}{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreATester-\PfCRINombreCle}}%
- }{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreCle-\PfCRINombreATester}}%
- }%
- \xdef\PfCRIRecupNombres{\PfCRIRecupNombres \PfCRINombreATester}%
- }%
- }{%
- \MelangeListe{\PfCRIListeOperationsSimple}{1}%
- \xdef\PfCRIRecupOperations{\PfCRIRecupOperations \faa}%
- \ignoreemptyitems%
- \readlist*\PfCRIRIListeOperations{\PfCRIRecupOperations}%
- \IfStrEq{\PfCRIRIListeOperations[\PfCRIRetiensNbEtapes]}{-}{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreATester-\PfCRINombreCle}}%
- }{%
- \xdef\PfCRINombreATester{\fpeval{\PfCRINombreCle-\PfCRINombreATester}}%
- }%
- \xdef\PfCRIRecupNombres{\PfCRIRecupNombres \PfCRINombreATester}%
- }%
- }%
- }%
- }%
- }%
- \ignoreemptyitems%
- \readlist*\PfCRIRIOperations{\PfCRIRecupOperations}%
- \readlist*\PfCRIRINombres{\PfCRIRecupNombres}%
- \reademptyitems%
- % On prépare le dessin
- \xdef\PfCRINombresDessin{}%
- \xdef\PfCRIOperationsDessin{}%
- \foreachitem\compteur\in\PfCRIRINombres{%
- \xintifboolexpr{\PfCRIRINombres[\compteurcnt]<0}{%
- \xdef\PfCRINombresDessin{\PfCRINombresDessin "(\num{\PfCRIRINombres[\compteurcnt]})",}%
- }{%
- \xdef\PfCRINombresDessin{\PfCRINombresDessin "\num{\PfCRIRINombres[\compteurcnt]}",}%
- }%
- }%
- \foreachitem\compteur\in\PfCRIRIOperations{%
- \xdef\PfCRIOperationsDessin{\PfCRIOperationsDessin "\PfCRIRIOperations[\compteurcnt]",}%
- }%
- % On dessine
- \BuildRondeInfernale{\PfCRINombresDessin}{\PfCRIOperationsDessin}%
-}%
-
-\NewDocumentCommand\BuildRondeInfernale{m m}{%
- \ifluatex
- \mplibforcehmode
- \begin{mplibcode}
- boolean Vide,Rectangle,Perso;
- Vide=\useKV[RondeInfernale]{Vide};
- Rectangle=\useKV[RondeInfernale]{Rectangle};
- Perso=\useKV[RondeInfernale]{Perso};
- if Perso:
- string Depart;
- Depart=\useKV[RondeInfernale]{Cle};
- else:
- numeric Depart;
- Depart=\PfCRINombreCle;
- fi;
-
- numeric Rayon;
- Rayon=\useKV[RondeInfernale]{Rayon};
-
- string Nombre[];
-
- vardef Compte(text t)=%On compte le nb d'étapes et on retient les nombres
- nbcase:=0;
- for p_=t:
- nbcase:=nbcase+1;
- Nombre[nbcase]=p_;
- endfor;
- enddef;
-
- vardef AfficheRonde(text t)=%On fait l'affichage des opérations
- n:=0;
- for k=1 upto nbcase:
- fill cercles(rotation(A[k],O,0.5*(360/nbcase)),5mm) withcolor white;
- endfor;
- for p_=t:
- n:=n+1;
- if p_="*":
- label(TEX("$\times"&Nombre[n]&"$"),rotation(A[nbcase-n],O,0.5*(360/nbcase)));
- elseif p_="/":
- label(TEX("$\div"&Nombre[n]&"$"),rotation(A[nbcase-n],O,0.5*(360/nbcase)));
- else:
- label(TEX("$"&p_&Nombre[n]&"$"),rotation(A[nbcase-n],O,0.5*(360/nbcase)));
- fi;
- endfor;
- enddef;
-
- vardef AfficheRectangle(text t)=%On fait l'affichage des opérations
- n:=0;
- for p_=t:
- n:=n+1;
- if n=nbcase:
- if p_="*":
- label.bot(TEX("$\times"&Nombre[n]&"$"),1/2[A[n-1],A[0]]+u*(0,-1));
- elseif p_="/":
- label.bot(TEX("$\div"&Nombre[n]&"$"),1/2[A[n-1],A[0]]+u*(0,-1));
- else:
- label.bot(TEX("$"&p_&Nombre[n]&"$"),1/2[A[n-1],A[0]]+u*(0,-1));
- fi;
- else:
- if p_="*":
- label.top(TEX("$\times"&Nombre[n]&"$"),1/2[A[n-1],A[n]]);
- elseif p_="/":
- label.top(TEX("$\div"&Nombre[n]&"$"),1/2[A[n-1],A[n]]);
- else:
- label.top(TEX("$"&p_&Nombre[n]&"$"),1/2[A[n-1],A[n]]);
- fi;
- fi;
- endfor;
- enddef;
-
- vardef BaseRonde=
- pair O,A[];
- O=(0,0);
- path cc;
- cc=cercles(O,Rayon);
- A[0]=pointarc(cc,0);
- A[nbcase+1]=A[0];
- for k=1 upto nbcase:
- A[k]=rotation(A[0],O,k*(360/nbcase));
- endfor;
- for k=0 upto nbcase:
- drawarrow reverse(arccercle(A[k],A[k+1],O) cutbefore cercles(A[k],5mm) cutafter cercles(A[k+1],5mm)) withpen pencircle scaled 1.5;
- endfor;
- for k=0 upto nbcase:
- fill cercles(A[k],5mm) withcolor white;
- trace cercles(A[k],5mm) withpen pencircle scaled 1.5;
- endfor;
- enddef;
-
- vardef BoiteRectangle=
- save $;
- path $;
- $=u*(0.9,-0.5){dir 0}..{dir 90}(u*(1,-0.4))--(u*(1,0.4)){dir 90}..{dir180}(u*(0.9,0.5))--u*(-0.9,0.5){dir 180}..{dir-90}(u*(-1,0.4))--(u*(-1,-0.4)){dir-90}..{dir0}(u*(-0.9,-0.5))--cycle;
- $
- enddef;
-
- vardef BaseRectangle=
- pair O,A[];
- O=(0,0);
- A[0]=O;
- for k=1 upto nbcase:
- A[k]-A[k-1]=(Rayon+2cm,0);
- endfor;
- for k=0 upto nbcase-2:
- drawarrow (A[k]--A[k+1]) cutbefore (BoiteRectangle shifted A[k]) cutafter (BoiteRectangle shifted A[k+1]) withpen pencircle scaled 1.5;
- endfor;
- drawarrow (A[nbcase-1]--(A[nbcase-1]+u*(0,-1))--(A[0]+u*(0,-1))--A[0]) cutbefore (BoiteRectangle shifted A[nbcase-1]) cutafter (BoiteRectangle shifted A[0]) withpen pencircle scaled 1.5;
- for k=0 upto nbcase-1:
- trace (BoiteRectangle shifted A[k]) withpen pencircle scaled 1.5;
- endfor;
- enddef;
-
- Compte(#1);
-
- if Rectangle:
- BaseRectangle;
- AfficheRectangle(#2);
- else:
- BaseRonde;
- AfficheRonde(#2);
- fi;
- if Vide=false:
- if Perso:
- label(TEX("$"&Depart&"$"),A[0]);
- else:
- label(TEX("$"&decimal(Depart)&"$"),A[0]);
- fi;
- fi;
- \end{mplibcode}
- \else
- \begin{mpost}[mpsettings={%
- boolean Vide,Rectangle,Perso;Vide=\useKV[RondeInfernale]{Vide};Rectangle=\useKV[RondeInfernale]{Rectangle};Perso=\useKV[RondeInfernale]{Perso};if Perso:string Depart;Depart=\useKV[RondeInfernale]{Cle};else:numeric Depart;Depart=\PfCRINombreCle;fi;numeric Rayon;Rayon=\useKV[RondeInfernale]{Rayon};}]
- string Nombre[];
-
- vardef Compte(text t)=%On compte le nb d'étapes et on retient les nombres
- nbcase:=0;
- for p_=t:
- nbcase:=nbcase+1;
- Nombre[nbcase]=p_;
- endfor;
- enddef;
-
- vardef AfficheRonde(text t)=%On fait l'affichage des opérations
- n:=0;
- for k=1 upto nbcase:
- fill cercles(rotation(A[k],O,0.5*(360/nbcase)),5mm) withcolor white;
- endfor;
- for p_=t:
- n:=n+1;
- if p_="*":
- label(LATEX("$\times"&Nombre[n]&"$"),rotation(A[nbcase-n],O,0.5*(360/nbcase)));
- elseif p_="/":
- label(LATEX("$\div"&Nombre[n]&"$"),rotation(A[nbcase-n],O,0.5*(360/nbcase)));
- else:
- label(LATEX("$"&p_&Nombre[n]&"$"),rotation(A[nbcase-n],O,0.5*(360/nbcase)));
- fi;
- endfor;
- enddef;
-
- vardef AfficheRectangle(text t)=%On fait l'affichage des opérations
- n:=0;
- for p_=t:
- n:=n+1;
- if n=nbcase:
- if p_="*":
- label.bot(LATEX("$\times"&Nombre[n]&"$"),1/2[A[n-1],A[0]]+u*(0,-1));
- elseif p_="/":
- label.bot(LATEX("$\div"&Nombre[n]&"$"),1/2[A[n-1],A[0]]+u*(0,-1));
- else:
- label.bot(LATEX("$"&p_&Nombre[n]&"$"),1/2[A[n-1],A[0]]+u*(0,-1));
- fi;
- else:
- if p_="*":
- label.top(LATEX("$\times"&Nombre[n]&"$"),1/2[A[n-1],A[n]]);
- elseif p_="/":
- label.top(LATEX("$\div"&Nombre[n]&"$"),1/2[A[n-1],A[n]]);
- else:
- label.top(LATEX("$"&p_&Nombre[n]&"$"),1/2[A[n-1],A[n]]);
- fi;
- fi;
- endfor;
- enddef;
-
- vardef BaseRonde=
- pair O,A[];
- O=(0,0);
- path cc;
- cc=cercles(O,Rayon);
- A[0]=pointarc(cc,0);
- A[nbcase+1]=A[0];
- for k=1 upto nbcase:
- A[k]=rotation(A[0],O,k*(360/nbcase));
- endfor;
- for k=0 upto nbcase:
- drawarrow reverse(arccercle(A[k],A[k+1],O) cutbefore cercles(A[k],5mm) cutafter cercles(A[k+1],5mm)) withpen pencircle scaled 1.5;
- endfor;
- for k=0 upto nbcase:
- fill cercles(A[k],5mm) withcolor white;
- trace cercles(A[k],5mm) withpen pencircle scaled 1.5;
- endfor;
- enddef;
-
- vardef BoiteRectangle=
- save $;
- path $;
- $=u*(0.9,-0.5){dir 0}..{dir 90}(u*(1,-0.4))--(u*(1,0.4)){dir 90}..{dir180}(u*(0.9,0.5))--u*(-0.9,0.5){dir 180}..{dir-90}(u*(-1,0.4))--(u*(-1,-0.4)){dir-90}..{dir0}(u*(-0.9,-0.5))--cycle;
- $
- enddef;
-
- vardef BaseRectangle=
- pair O,A[];
- O=(0,0);
- A[0]=O;
- for k=1 upto nbcase:
- A[k]-A[k-1]=(Rayon+2cm,0);
- endfor;
- for k=0 upto nbcase-2:
- drawarrow (A[k]--A[k+1]) cutbefore (BoiteRectangle shifted A[k]) cutafter (BoiteRectangle shifted A[k+1]) withpen pencircle scaled 1.5;
- endfor;
- drawarrow (A[nbcase-1]--(A[nbcase-1]+u*(0,-1))--(A[0]+u*(0,-1))--A[0]) cutbefore (BoiteRectangle shifted A[nbcase-1]) cutafter (BoiteRectangle shifted A[0]) withpen pencircle scaled 1.5;
- for k=0 upto nbcase-1:
- trace (BoiteRectangle shifted A[k]) withpen pencircle scaled 1.5;
- endfor;
- enddef;
-
- Compte(#1);
-
- if Rectangle:
- BaseRectangle;
- AfficheRectangle(#2);
- else:
- BaseRonde;
- AfficheRonde(#2);
- fi;
- if Vide=false:
- if Perso:
- label(LATEX("$"&Depart&"$"),A[0]);
- else:
- label(LATEX("$"&decimal(Depart)&"$"),A[0]);
- fi;
- fi;
- \end{mpost}
- \fi
-}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCSimplifierFraction.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCSimplifierFraction.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCSimplifierFraction.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -180,8 +180,8 @@
}%
}%
-\setKVdefault[ClesSimplification]{Details=false,All=false,Longue=false,Fleches=false,Contraire=0,Couleur=black,Debut=false,Impose=false,Decomposition=false}
-\defKV[ClesSimplification]{Nombre=\setKV[ClesSimplification]{Impose}}
+\setKVdefault[ClesSimplification]{Details=false,All=false,Longue=false,Fleches=false,Contraire=0,Couleur=black,Debut=false,Impose=false,Decomposition=false,DecompositionSeule=false}%
+\defKV[ClesSimplification]{Nombre=\setKV[ClesSimplification]{Impose}}%
\newcounter{NbFrac}%
\setcounter{NbFrac}{0}%
@@ -194,12 +194,8 @@
\setsepchar[*]{,*/}%\ignoreemptyitems
\readlist*\Listea{#2}%
\readlist*\Listeb{#3}%
- \setbox1=\hbox{\Listea[1,1]{}}%
- \setbox2=\hbox{\Listeb[1,1]}%
- \setbox3=\hbox{\Listea[1,3]}%
- \setbox4=\hbox{\Listeb[1,3]}%
\ensuremath{%
- \frac{\tikzmarknode[anchor=north]{A-\theNbFrac}{\Listea[1,1]}{}}{\tikzmarknode[anchor=south]{B-\theNbFrac}{\Listeb[1,1]}{}}=\frac{\tikzmarknode[anchor=north]{C-\theNbFrac}{\Listea[1,3]}{}}{\tikzmarknode[anchor=south]{D-\theNbFrac}{\Listeb[1,3]}{}}%
+ \frac{\tikzmarknode[anchor=north]{A-\theNbFrac}{\num{\Listea[1,1]}}{}}{\tikzmarknode[anchor=south]{B-\theNbFrac}{\num{\Listeb[1,1]}}{}}=\frac{\tikzmarknode[anchor=north]{C-\theNbFrac}{\Listea[1,3]}{}}{\tikzmarknode[anchor=south]{D-\theNbFrac}{\Listeb[1,3]}{}}%
}%
\begin{tikzpicture}[remember picture,overlay]%
\draw[out=45,in=135,-stealth,transform canvas={yshift=0.25em}]
@@ -215,16 +211,20 @@
\frac{\num{#2}}{\num{#3}}=\frac{\num{#2}\times\num{\useKV[ClesSimplification]{Contraire}}}{\num{#3}\times\num{\useKV[ClesSimplification]{Contraire}}}=\frac{\num{\fpeval{\useKV[ClesSimplification]{Contraire}*#2}}}{\num{\fpeval{\useKV[ClesSimplification]{Contraire}*#3}}}%
}%
}{%
- \ifboolKV[ClesSimplification]{Decomposition}{%
+ \ifboolKV[ClesSimplification]{DecompositionSeule}{%
+ \DecompositionSimplificationSeule{#2}{#3}%
+ }{%
+ \ifboolKV[ClesSimplification]{Decomposition}{%
\DecompositionSimplification{#2}{#3}%
}{%
- \ifboolKV[ClesSimplification]{Longue}{%
- \colorlet{PfCSimpliCol}{\useKV[ClesSimplification]{Couleur}}%
- \LongueSimplification{#2}{#3}%
- }{%
- \ifboolKV[ClesSimplification]{Details}{\SSimpli{#2}{#3}}{\ifboolKV[ClesSimplification]{All}{\ensuremath{\SSimpli{#2}{#3}=\SSimplifie{#2}{#3}}}{\SSimplifie{#2}{#3}}}%
+ \ifboolKV[ClesSimplification]{Longue}{%
+ \colorlet{PfCSimpliCol}{\useKV[ClesSimplification]{Couleur}}%
+ \LongueSimplification{#2}{#3}%
+ }{%
+ \ifboolKV[ClesSimplification]{Details}{\SSimpli{#2}{#3}}{\ifboolKV[ClesSimplification]{All}{\ensuremath{\SSimpli{#2}{#3}=\SSimplifie{#2}{#3}}}{\SSimplifie{#2}{#3}}}%
}%
}%
+ }%
}%
}%
}%
@@ -246,10 +246,10 @@
\xintFor* ##2 in{\xintSeq{1}{\LongueurH}}\do{%
\DiviseurCommun{\DiviseurHaut[##2]}{\PfCDeuxiemeFacteur}
\ifnum\PfCDivCom>1%
- \mathcolor{\useKV[ClesSimplification]{Couleur}}{\DiviseurHaut[##2]}
+ \mathcolor{\useKV[ClesSimplification]{Couleur}}{\num{\DiviseurHaut[##2]}}
\xdef\PfCDeuxiemeFacteur{\fpeval{\PfCDeuxiemeFacteur/\DiviseurHaut[##2]}}
\else
- \DiviseurHaut[##2]
+ \num{\DiviseurHaut[##2]}
\fi
\xintifForLast{}{\times}
}
@@ -257,14 +257,14 @@
\xintFor* ##2 in{\xintSeq{1}{\LongueurB}}\do{%
\DiviseurCommun{\DiviseurBas[##2]}{\PfCPremierFacteur}
\ifnum\PfCDivCom>1%
- \mathcolor{\useKV[ClesSimplification]{Couleur}}{\DiviseurBas[##2]}
+ \mathcolor{\useKV[ClesSimplification]{Couleur}}{\num{\DiviseurBas[##2]}}
\xdef\PfCPremierFacteur{\fpeval{\PfCPremierFacteur/\DiviseurBas[##2]}}
\else
- \DiviseurBas[##2]
+ \num{\DiviseurBas[##2]}
\fi
\xintifForLast{}{\times}
}
- }=\frac{\PfCPremierFacteur}{\PfCDeuxiemeFacteur}
+ }=\frac{\num{\PfCPremierFacteur}}{\num{\PfCDeuxiemeFacteur}}
\else
\tofrac{#1/#2}
\fi
@@ -293,10 +293,10 @@
\xintifboolexpr{\fpeval{#1*#2}<0}{\xintifboolexpr{#1<0}{-}{}}{}\xintFor* ##2 in{\xintSeq{1}{\LongueurH}}\do{%
\DiviseurCommun{\DiviseurHaut[##2]}{\PfCDeuxiemeFacteur}
\ifnum\PfCDivCom>1%
- \mathcolor{\useKV[ClesSimplification]{Couleur}}{\DiviseurHaut[##2]}
+ \mathcolor{\useKV[ClesSimplification]{Couleur}}{\num{\DiviseurHaut[##2]}}
\xdef\PfCDeuxiemeFacteur{\fpeval{\PfCDeuxiemeFacteur/\DiviseurHaut[##2]}}
\else
- \DiviseurHaut[##2]
+ \num{\DiviseurHaut[##2]}
\fi
\xintifForLast{}{\times}
}
@@ -304,10 +304,10 @@
\xintifboolexpr{\fpeval{#1*#2}<0}{\xintifboolexpr{#1<0}{}{-}}{}\xintFor* ##2 in{\xintSeq{1}{\LongueurB}}\do{%
\DiviseurCommun{\DiviseurBas[##2]}{\PfCPremierFacteur}
\ifnum\PfCDivCom>1%
- \mathcolor{\useKV[ClesSimplification]{Couleur}}{\DiviseurBas[##2]}
+ \mathcolor{\useKV[ClesSimplification]{Couleur}}{\num{\DiviseurBas[##2]}}
\xdef\PfCPremierFacteur{\fpeval{\PfCPremierFacteur/\DiviseurBas[##2]}}
\else
- \DiviseurBas[##2]
+ \num{\DiviseurBas[##2]}
\fi
\xintifForLast{}{\times}
}
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -657,11 +657,12 @@
if Qualitatif: tutu(#1); else: toto(#1); fi;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if Grille:
+ %%%%%%%%%%%%%%%% -< Ici
drawoptions(withcolor 0.75white);
for k=0 step PasGrillex until ((maxx+1)):
- trace (k*unitex,0)--(k*unitex,unitey*((floor(maxAxey/Pasy)+1)*Pasy));
+ trace (k*unitex,0)--(k*unitex,unitey*((ceiling(maxAxey/Pasy)+1)*Pasy));
endfor;
- for k=0 step PasGrilley until (floor(maxAxey/Pasy)+1)*Pasy:%((maxy+2*Pasy)):
+ for k=0 step PasGrilley until (ceiling(maxAxey/Pasy)+1)*Pasy:%((maxy+2*Pasy)):
trace (0,k*unitey)--(unitex*(maxx+1),k*unitey);
endfor;
drawoptions();
@@ -711,9 +712,9 @@
endfor;
fi;
drawarrow (0,0)--unitex*(maxx+1,0);
- drawarrow (0,0)--unitey*(0,(floor(maxAxey/Pasy)+1)*Pasy);
+ drawarrow (0,0)--unitey*(0,(ceiling(maxAxey/Pasy)+1)*Pasy);
label.lrt(TEX("\useKV[ClesStat]{Donnee}"),unitex*(maxx+1,0));
- label.urt(TEX("\useKV[ClesStat]{Effectif}"),unitey*(0,(floor(maxAxey/Pasy)+1)*Pasy));
+ label.urt(TEX("\useKV[ClesStat]{Effectif}"),unitey*(0,(ceiling(maxAxey/Pasy)+1)*Pasy));
if Qualitatif: titi(#1); else:tata(#1); fi;
\end{mplibcode}
\else
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCTablesOperations.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCTablesOperations.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCTablesOperations.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,7 +1,7 @@
%%%
% Tables Addition-Multiplication
%%%
-\setKVdefault[Tables]{Addition=false,Soustraction=false,Multiplication,Seul=false,Debut=0,Fin=10,Couleur=white}
+\setKVdefault[Tables]{Addition=false,Soustraction=false,Multiplication,Seul=false,Debut=0,Fin=10,Couleur=white,Inverse=false}
% pour m\'emoire
\newcommand\TableMultiplicationComplete{%
@@ -95,17 +95,68 @@
}%
}%
+\NewDocumentCommand\PfCTableInverse{om}{%
+ % #1 paramètres
+ % #2 dizaine concernée
+ \useKVdefault[Tables]%
+ \setKV[Tables]{#1}%
+ \ifnum#2=0\relax%
+ \xdef\TIDepart{2}%
+ \else%
+ \xdef\TIDepart{\fpeval{#2*10}}%
+ \fi%
+ \xdef\TIFin{\fpeval{#2*10+9}}%
+ % On sauvegarde les nombres non premiers de la dizaine
+ \xdef\PfCRetiensNonPremiersInv{}%
+ \xintFor* ##1 in{\xintSeq{\TIDepart}{\TIFin}}\do{%
+ \TestPremier{##1}%
+ \ifboolKV[ClesEra]{Premier}{}{%
+ \xdef\PfCRetiensNonPremiersInv{\PfCRetiensNonPremiersInv##1,}%
+ }%
+ }%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeNombresRetenus{\PfCRetiensNonPremiersInv}%
+ \reademptyitems%
+ \xdef\PfCRetiensIntermediaire{}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeNombresRetenuslen}}\do{%
+ \xdef\PfCRetiensIntermediaire{\PfCRetiensIntermediaire,\ListeNombresRetenus[##1]}%
+ \xintFor* ##2 in{\xintSeq{2}{\fpeval{floor(sqrt(\ListeNombresRetenus[##1]))}}}\do{%
+ \modulo{\ListeNombresRetenus[##1]}{##2}%
+ \ifnum\remainder=0\relax%
+ \xdef\PfCRetiensIntermediaire{\PfCRetiensIntermediaire/##2}%
+ \fi%
+ }%
+ }%
+ \setsepchar[*]{,*/}\ignoreemptyitems%
+ \readlist*\ListeNombresRetenusInd{\PfCRetiensIntermediaire}%
+ \reademptyitems%
+ \ensuremath{%
+ \begin{array}[t]{ccrcl}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeNombresRetenusIndlen}}\do{%
+ \xintifForFirst{}{\\}%
+ \xintFor* ##2 in{\xintSeq{2}{\listlen\ListeNombresRetenusInd[##1]}}\do{%
+ \num{\ListeNombresRetenusInd[##1,1]}\uppercase{&}=\uppercase{&}\num{\ListeNombresRetenusInd[##1,##2]}\uppercase{&}\times\uppercase{&}\quotient{\ListeNombresRetenusInd[##1,1]}{\ListeNombresRetenusInd[##1,##2]}\num{\the\intquotient}\\%
+ }
+ }
+ \end{array}%
+ }%
+}%
+
\newcommand\Tables[2][]{%
\useKVdefault[Tables]%
\setKV[Tables]{#1}%
\ifboolKV[Tables]{Seul}{%
- \ifboolKV[Tables]{Soustraction}{%
- \TableSoustractionSeule{#2}%
+ \ifboolKV[Tables]{Inverse}{%
+ \PfCTableInverse[#1]{#2}%
}{%
- \ifboolKV[Tables]{Addition}{%
- \TableAdditionSeule{#2}%
+ \ifboolKV[Tables]{Soustraction}{%
+ \TableSoustractionSeule{#2}%
}{%
- \TableMultiplicationSeule{#2}%
+ \ifboolKV[Tables]{Addition}{%
+ \TableAdditionSeule{#2}%
+ }{%
+ \TableMultiplicationSeule{#2}%
+ }%
}%
}%
}{%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCThales.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCThales.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCThales.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1214,9 +1214,9 @@
\end{array}
\right\}\ifnum\NumA=\NumB \dfrac{\NomA\NomM}{\NomA\NomB}=\dfrac{\NomA\NomN}{\NomA\NomC}\else\dfrac{\NomA\NomM}{\NomA\NomB}\not=\dfrac{\NomA\NomN}{\NomA\NomC}\fi
\]
- }
+ }%
\ifboolKV[ClesThales]{Propor}{%
- \ifnum\NumA=\NumB Donc le tableau $\begin{array}{c|c}
+ \xintifboolexpr{\NumA==\NumB}{Donc le tableau $\begin{array}{c|c}
\NomA\NomM&\NomA\NomN\\
\hline
\NomA\NomB&\NomA\NomC\\
@@ -1225,8 +1225,8 @@
$\NomA$, $\NomM$, $\NomB$ sont align\'es dans le m\^eme ordre que les
points $\NomA$, $\NomN$, $\NomC$. Donc les droites $(\NomM\NomN)$
et $(\NomB\NomC)$ sont parall\`eles d'apr\`es la r\'eciproque du
- th\'eor\`eme de Thal\`es.\else%
- Donc les droites $(\NomM\NomN)$ et $(\NomB\NomC)$ ne sont pas parall\`eles.\fi
+ th\'eor\`eme de Thal\`es.}{%
+ Donc les droites $(\NomM\NomN)$ et $(\NomB\NomC)$ ne sont pas parall\`eles.}%
}{%
\xintifboolexpr{\NumA==\NumB}{%
De plus, les points $\NomA$, $\NomM$, $\NomB$ sont align\'es dans
@@ -1234,9 +1234,9 @@
droites $(\NomM\NomN)$ et $(\NomB\NomC)$ sont parall\`eles d'apr\`es
la r\'eciproque du th\'eor\`eme de Thal\`es.}{%
Donc les droites $(\NomM\NomN)$ et $(\NomB\NomC)$ ne sont pas
- parall\`eles.}
- }
-}
+ parall\`eles.}%
+ }%
+}%
\newcommand\ReciproqueThales[8][]{%
% #1 Cl\'es
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCTicketCaisse.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCTicketCaisse.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCTicketCaisse.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -0,0 +1,210 @@
+%%%
+% Ticket de caisse
+%%%
+\newcounter{PfCNbInsulte}%
+\setcounter{PfCNbInsulte}{0}%
+
+\NewDocumentCommand\PfCPrixInsulte{sm}{%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\PfCListeInsulte{\%,!,§,\#,*,@,-}%
+ \reademptyitems%
+ \IfBooleanTF{#1}{%
+ \MelangeListe{1,2,3,4,5,6,7}{5}%
+ }{%
+ \stepcounter{PfCNbInsulte}%
+ \MelangeListe{1,2,3,4,5,6,7}{3}%
+ }%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeInsulteMelange{\faa}%
+ \reademptyitems%
+ \ifboolKV[TicketCaisse]{Solution}{\textcolor{PfCTicketCouleurSolution}{#2}}{%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeInsulteMelangelen}}\do{%
+ \xdef\Titi{\ListeInsulteMelange[##1]}%
+ \PfCListeInsulte[\Titi]%
+ }%
+ }%
+}%
+
+\makeatletter
+\NewDocumentCommand\PrixTicket{om}{%
+ \ifboolKV[TicketCaisse]{CHF}{%
+ \DeclareSIUnit{\Tempo}{\PfCCHF}%
+ }{%
+ \ifboolKV[TicketCaisse]{CFA}{%
+ \DeclareSIUnit{\Tempo}{\PfCCFA}%
+ }{%
+ \ifboolKV[TicketCaisse]{CFP}{%
+ \DeclareSIUnit{\Tempo}{\PfCCFP}%
+ }{%
+ \ifboolKV[TicketCaisse]{US}{%
+ \DeclareSIUnit{\Tempo}{\Dollar}%
+ }{%
+ \ifboolKV[TicketCaisse]{UK}{%
+ \DeclareSIUnit{\Tempo}{\LivreSterling}%
+ }{%
+ \ifboolKV[TicketCaisse]{Euro}{%
+ \DeclareSIUnit{\Tempo}{\EuRo}%
+ }{%
+ \if at CHF%
+ \setKV[TicketCaisse]{CHF}%
+ \fi%
+ \DeclareSIUnit{\Tempo}{\DeviseDefaut}%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ \IfInteger{#2}{%
+ \ifboolKV[TicketCaisse]{CHF}{%
+ \si{\PfCCHF}~\num{#2}.-%
+ }{%
+ \SI[round-mode=places,round-precision=2]{#2}{\Tempo}%
+ }%
+ }{%
+ \SI[round-mode=places,round-precision=2]{#2}{\Tempo}%
+ }%
+}%
+\makeatother
+
+\setKVdefault[TicketCaisse]{Largeur=222,Especes=50,Enseigne=Au comptoir des maths,DateAchat=\today,HeureAchat=15:13:34,Taches=false,Rendu,Total,UK=false,US=false,CFA=false,CFP=false,CHF=false,Euro=false,Solution=false}
+\defKV[TicketCaisse]{Couleur=\colorlet{PfCTicketCouleurSolution}{#1}\setKV[TicketCaisse]{Solution}}
+
+\NewDocumentCommand\TicketCaisse{om}{%
+ \setcounter{PfCNbInsulte}{0}%
+ \useKVdefault[TicketCaisse]%
+ \setKV[TicketCaisse]{#1}%
+ \setsepchar[*]{,*/}%
+ \readlist*\ListeAchats{#2}%
+ % On fait trois listes pour les retenir
+ % Liste Quantités
+ \xdef\PfCFooQuantites{}%
+ \foreachitem\compteur\in\ListeAchats{%
+ \StrChar{\ListeAchats[\compteurcnt,1]}{1}[\MyLetter]%
+ \IfStrEq{\MyLetter}{!}{%
+ \StrBehind{\ListeAchats[\compteurcnt,1]}{!}[\Titi]%
+ \xdef\PfCFooQuantites{\PfCFooQuantites,\Titi}%
+ }{%
+ \xdef\PfCFooQuantites{\PfCFooQuantites,\ListeAchats[\compteurcnt,1]}%
+ }%
+ }%
+ % Liste Elements
+ \xdef\PfCFooElements{}%
+ \foreachitem\compteur\in\ListeAchats{%
+ \xdef\PfCFooElements{\PfCFooElements,\ListeAchats[\compteurcnt,2]}%
+ }%
+ % Liste Prix Unitaire
+ \xdef\PfCFooPUnitaires{}%
+ \foreachitem\compteur\in\ListeAchats{%
+ \StrChar{\ListeAchats[\compteurcnt,3]}{1}[\MyLetter]%
+ \IfStrEqCase{\MyLetter}{%
+ {!}{%
+ \StrBehind{\ListeAchats[\compteurcnt,3]}{!}[\Titi]%
+ \StrChar{\Titi}{1}[\Toto]%
+ \IfStrEq{\Toto}{*}{%
+ \StrBehind{\ListeAchats[\compteurcnt,3]}{!*}[\Tata]%
+ \xdef\PfCFooPUnitaires{\PfCFooPUnitaires,\Tata}%
+ }{%
+ \xdef\PfCFooPUnitaires{\PfCFooPUnitaires,\Titi}%
+ }%
+ }%
+ {*}{\StrBehind{\ListeAchats[\compteurcnt,3]}{*}[\Titi]%
+ \xdef\PfCFooPUnitaires{\PfCFooPUnitaires,\Titi}}%
+ }[\xdef\PfCFooPUnitaires{\PfCFooPUnitaires,\ListeAchats[\compteurcnt,3]}]%
+ }%
+ % On les lit
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeQuantites{\PfCFooQuantites}%
+ \readlist*\ListeElements{\PfCFooElements}%
+ \readlist*\ListePUnitaires{\PfCFooPUnitaires}%
+ % On calcul le coût total
+ \xdef\PfCTCTotal{0}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeAchatslen}}\do{%
+ \xdef\PfCTCTotal{\fpeval{\PfCTCTotal+\ListeQuantites[##1]*\ListePUnitaires[##1]}}%
+ }%
+% Le coût total est \PfCTCTotal\\
+ {\ttfamily%
+ \begin{NiceTabular}{m{107pt}m{29pt}m{36pt}m{50pt}}%
+ \CodeBefore
+ \tikz\node[opacity=0.2,yshift=-1.5cm] at ($(1-|1)!0.5!(1-|last)$) {\Large\bfseries\reflectbox{
+ \begin{tabular}{c}
+ Papier garanti\\
+ sans Phénol
+ \end{tabular}
+ }
+ };
+ \tikz\node[opacity=0.2,anchor=center,yshift=1cm] at ($(last-|1)!0.5!(last-|last)$) {\Large\bfseries\reflectbox{%
+ \faRecycle~Pensez à trier.%
+ }%
+ };%
+ \tikz\node[opacity=0.5,anchor=center,yshift=2cm] at ($(last-|1)!0.5!(last-|last)$) {\Large\bfseries\reflectbox{
+ \LogoRecyclage[Couleur=0.8white]%
+ }%
+ };%
+ \tikz\draw[fill=Ivory,opacity=0.5] (1-|1) rectangle (last-|last);%
+ \Body
+ &&&\\%
+ \Block{1-4}{\Large\bfseries\useKV[TicketCaisse]{Enseigne}}&&&\\%
+ \\%
+ \Cdots\\%
+ \\%
+ \Block[l]{}{\footnotesize\sc Description}&\Block{}{\footnotesize\sc Qte.}&\Block{}{\footnotesize\sc P.u.}&\Block[r]{}{\footnotesize\sc Prix Net}\\%
+ \\%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeAchatslen}}\do{%
+ \ListeElements[##1]&%
+ \Block{}{%
+ \footnotesize%
+ \StrChar{\ListeAchats[##1,1]}{1}[\MyLetter]%
+ \IfStrEq{\MyLetter}{!}{\PfCPrixInsulte*{\ListeQuantites[##1]}}{\xintifboolexpr{\fpeval{\ListeQuantites[##1]}==1}{}{\num{\ListeQuantites[##1]}}}%
+ }&
+ \Block[r]{}{%
+ \footnotesize
+ %Savoir si le nombre d'articles est affiché
+ \StrChar{\ListeAchats[##1,1]}{1}[\MyLetter]%
+ % Si le nombre d'articles n'est pas affiché, il faut impérativement afficher le prix unitaire
+ \IfStrEq{\MyLetter}{!}{%
+ \PrixTicket{\ListePUnitaires[##1]}%
+ }{%
+ % On regarde si on affiche le prix unitaire
+ \StrChar{\ListeAchats[##1,3]}{1}[\MyLettera]%
+ % Si c'est un !, on affiche pas
+ % Sinon, on affiche
+ \IfStrEq{\MyLettera}{!}{%
+ \PfCPrixInsulte*{\PrixTicket{\ListePUnitaires[##1]}}%
+ }{%
+ \xintifboolexpr{\fpeval{\ListeQuantites[##1]}==1}{}{%
+ \PrixTicket{\ListePUnitaires[##1]}%
+ }%
+ }%
+ }%
+ }%
+ &\Block[r]{}{%
+ \StrChar{\ListeAchats[##1,3]}{1}[\MyLetter]%
+ % Si le premier caractère est !, il faut regarder si le deuxième caractère est une étoile
+ \IfStrEq{\MyLetter}{!}{%
+ \StrChar{\ListeAchats[##1,3]}{2}[\MyLettera]%
+ \IfStrEq{\MyLettera}{*}{%
+ \PfCPrixInsulte*{\PrixTicket{\fpeval{\ListeQuantites[##1]*\ListePUnitaires[##1]}}}%
+ }{%
+ \PrixTicket{\fpeval{\ListeQuantites[##1]*\ListePUnitaires[##1]}}%
+ }%
+ }{%il faut regarder si c'est une étoile
+ \StrChar{\ListeAchats[##1,3]}{1}[\MyLettera]%
+ \IfStrEq{\MyLettera}{*}{%
+ \PfCPrixInsulte{\PrixTicket{\fpeval{\ListeQuantites[##1]*\ListePUnitaires[##1]}}}%
+ }{%
+ \PrixTicket{\fpeval{\ListeQuantites[##1]*\ListePUnitaires[##1]}}%
+ }%
+ }%
+ }\\
+ }%
+ \\%
+ \Cdots\\%
+ Total&&&\Block[r]{}{\ifboolKV[TicketCaisse]{Total}{\ifnum\thePfCNbInsulte=0\relax\PrixTicket{\PfCTCTotal}\else\PfCPrixInsulte*{\PrixTicket{\PfCTCTotal}}\fi}{\PfCPrixInsulte*{\PrixTicket{\PfCTCTotal}}}}\\%
+ Espèces&&&\Block[r]{}{\PrixTicket{\useKV[TicketCaisse]{Especes}}}\\%
+ Rendu&&&\Block[r]{}{\ifboolKV[TicketCaisse]{Rendu}{\PrixTicket{\fpeval{\useKV[TicketCaisse]{Especes}-\PfCTCTotal}}}{\PfCPrixInsulte*{\PrixTicket{\fpeval{\useKV[TicketCaisse]{Especes}-\PfCTCTotal}}}}}\\%
+ \\%
+ \Block{1-4}{\footnotesize\useKV[TicketCaisse]{DateAchat}\qquad\useKV[TicketCaisse]{HeureAchat}}&&&\\%
+ \end{NiceTabular}
+ }%
+}%
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCTicketCaisse.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCTrio.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCTrio.tex 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCTrio.tex 2024-03-24 20:05:42 UTC (rev 70746)
@@ -1,9 +1,11 @@
\newlength\PfCTrioHauteur%
\newcounter{PfCTrioLettre}%
-\setKVdefault[Trio]{Largeur=15pt,Graines=false,Repere=false,Cibles=false,Ligne=1,Colonne=1,Vide=false,VideRepere=false,Relatifs=false,Ecole=false}%
+\setKVdefault[Trio]{Largeur=15pt,Graines=false,Repere=false,Cibles=false,Ligne=1,Colonne=1,Vide=false,VideRepere=false,Relatifs=false,Ecole=false,Horizontal=false,Vertical=false,DiagonaleM=false,DiagonaleD=false,NonAlea=false,NbSolutions=false}%
\defKV[Trio]{Graine=\setKV[Trio]{Graines}}%
\defKV[Trio]{Cible=\setKV[Trio]{Cibles}}%
+\defKV[Trio]{Liste=\setKV[Trio]{NonAlea}}%
+\defKV[Trio]{NbSolution=\setKV[Trio]{NbSolutions}}%
\NewDocumentCommand\TrioCalculs{mmm}{%
Les combinaisons Trio de #1, #2 et #3 sont :%
@@ -17,129 +19,142 @@
\end{enumerate}%
}%
+\NewDocumentCommand\TrioTestCible{O{\useKV[Trio]{Cible}}mmm}{%
+ \xintifboolexpr{%
+ \fpeval{#2*#3+#4}==#1%
+ || \fpeval{#2*#3-#4}==#1%
+ || \fpeval{#3*#4+#2}==#1%
+ || \fpeval{#3*#4-#2}==#1%
+ || \fpeval{#4*#2+#3}==#1%
+ || \fpeval{#4*#2-#3}==#1%
+ % ajout pour une cible négative
+ || \fpeval{#3-#4*#2}==#1%
+ || \fpeval{#4-#2*#3}==#1%
+ || \fpeval{#2-#3*#4}==#1%
+ }{\xdef\PfCRetourTestCible{1}}{\xdef\PfCRetourTestCible{0}}%
+}%
+
\NewDocumentCommand\Trio{o}{%
- \setcounter{PfCTrioLettre}{0}
+ \setcounter{PfCTrioLettre}{0}%
\useKVdefault[Trio]%
\setKV[Trio]{#1}%
+ \xdef\PfCTitiH{0}%
+ \xdef\PfCTitiV{0}%
+ \xdef\PfCTitiDM{0}%
+ \xdef\PfCTitiDD{0}%
+ \ifboolKV[Trio]{Horizontal}{\xdef\PfCTitiV{1}\xdef\PfCTitiDM{1}\xdef\PfCTitiDD{1}}{}%
+ \ifboolKV[Trio]{Vertical}{\xdef\PfCTitiH{1}\xdef\PfCTitiDM{1}\xdef\PfCTitiDD{1}}{}%
+ \ifboolKV[Trio]{DiagonaleM}{\xdef\PfCTitiH{1}\xdef\PfCTitiV{1}\xdef\PfCTitiDD{1}}{}%
+ \ifboolKV[Trio]{DiagonaleD}{\xdef\PfCTitiH{1}\xdef\PfCTitiV{1}\xdef\PfCTitiDM{1}}{}%
\ifboolKV[Trio]{Graines}{\PfCGraineAlea{\useKV[Trio]{Graine}}}{}%
- \ifboolKV[Trio]{Ecole}{\xdef\PfCTrioMaxA{5}\xdef\PfCTrioMaxB{3}}{\xdef\PfCTrioMaxA{7}\xdef\PfCTrioMaxB{5}}
+ \ifboolKV[Trio]{Ecole}{\xdef\PfCTrioMaxA{5}\xdef\PfCTrioMaxB{3}}{\xdef\PfCTrioMaxA{7}\xdef\PfCTrioMaxB{5}}%
\ifboolKV[Trio]{Repere}{\xdef\PfCTrioNbCases{\fpeval{\PfCTrioMaxA+1}}}{\xdef\PfCTrioNbCases{\PfCTrioMaxA}}%
% On définit la liste de nombres
- \ifboolKV[Trio]{Relatifs}{%
- \xdef\PfCTrioFoo{-4,-4,-4,-4,-4,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4}%
+ \ifboolKV[Trio]{NonAlea}{%
+ \xdef\faa{\useKV[Trio]{Liste}}%
}{%
- \ifboolKV[Trio]{Ecole}{%
- \xdef\PfCTrioFoo{1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5}%
+ \ifboolKV[Trio]{Relatifs}{%
+ \xdef\PfCTrioFoo{-4,-4,-4,-4,-4,-3,-3,-3,-3,-3,-3,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4}%
}{%
- \xdef\PfCTrioFoo{1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,8,8,8,8,8,9,9,9,9}%
- }%
+ \ifboolKV[Trio]{Ecole}{%
+ \xdef\PfCTrioFoo{1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5}%
+ }{%
+ \xdef\PfCTrioFoo{1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,8,8,8,8,8,9,9,9,9}%
+ }%
+ }%
+ \ifboolKV[Trio]{Ecole}{\MelangeListe{\PfCTrioFoo}{25}}{\MelangeListe{\PfCTrioFoo}{49}}%
}%
- \ifboolKV[Trio]{Ecole}{\MelangeListe{\PfCTrioFoo}{25}}{\MelangeListe{\PfCTrioFoo}{49}}%
\setsepchar{,}\ignoreemptyitems%
- \readlist*\PfCTrioMelange{\faa}%
+ \greadlist*\PfCTrioMelange{\faa}%
\reademptyitems%
+ %%%%
+ \ifboolKV[Trio]{Repere}{%
+ \xdef\PfCTrioAjout{1}%
+ }{%
+ \xdef\PfCTrioAjout{0}%
+ }%
\setlength{\PfCTrioHauteur}{\useKV[Trio]{Largeur}+\tabcolsep}%
- \begin{NiceTabular}{*{\PfCTrioNbCases}{m{\useKV[Trio]{Largeur}}}}[hvlines]%
+ \begin{NiceTabular}{*{\PfCTrioNbCases}{m{\useKV[Trio]{Largeur}}}}[hvlines,name=TS]%
\CodeBefore%
\ifboolKV[Trio]{Cibles}{%
\ifboolKV[Trio]{Repere}{%
\xdef\PfCTrioAjout{1}%
}{%
- \xdef\PfCTrioAjout{0}
+ \xdef\PfCTrioAjout{0}%
}%
- % Calculs des horizontaux
+ % Calculs des horizontaux
+ \ifnum\fpeval{\PfCTitiH}=0\relax
\xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxA}}\do{%
\xintFor* ##1 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
\xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1}]}%
\xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1+1}]}%
\xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1+2}]}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{\tikz\draw[fill=Cornsilk,line width=2pt] (\fpeval{##2+\PfCTrioAjout}-|\fpeval{##1+\PfCTrioAjout}) rectangle (\fpeval{##2+1+\PfCTrioAjout}-|\fpeval{##1+3+\PfCTrioAjout});\xintBreakFor}{}%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{\tikz\draw[fill=Cornsilk,line width=2pt] (\fpeval{##2+\PfCTrioAjout}-|\fpeval{##1+\PfCTrioAjout}) rectangle (\fpeval{##2+1+\PfCTrioAjout}-|\fpeval{##1+3+\PfCTrioAjout});\xintBreakFor}{}%
}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \xintBreakFor}{}%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xintBreakFor
+ }{}%
}%
+ \fi
% Calculs des verticaux
- \xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxA}}\do{%
- \xintFor* ##1 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
- \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-1)+##2}]}%
- \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1)+##2}]}%
- \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1+1)+##2}]}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{\tikz\draw[fill=LightSteelBlue,line width=2pt] (\fpeval{##1+\PfCTrioAjout}-|\fpeval{##2+\PfCTrioAjout}) rectangle (\fpeval{##1+3+\PfCTrioAjout}-|\fpeval{##2+1+\PfCTrioAjout});\xintBreakFor}{}%
+ \ifnum\fpeval{\PfCTitiV}=0\relax
+ \xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxA}}\do{%
+ \xintFor* ##1 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-1)+##2}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1)+##2}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1+1)+##2}]}%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{\tikz\draw[fill=LightSteelBlue,line width=2pt] (\fpeval{##1+\PfCTrioAjout}-|\fpeval{##2+\PfCTrioAjout}) rectangle (\fpeval{##1+3+\PfCTrioAjout}-|\fpeval{##2+1+\PfCTrioAjout});\xintBreakFor}{}%
+ }%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xintBreakFor
+ }{}%
}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \xintBreakFor}{}%
- }%
+ \fi
% Calculs des diag positives (descendantes)
- \xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
- \xintFor* ##1 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
- \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1}]}%
- \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2)+##1+1}]}%
- \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2+1)+##1+2}]}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+\PfCTrioAjout}-|\fpeval{##1+\PfCTrioAjout}) rectangle (\fpeval{##2+1+\PfCTrioAjout}-|\fpeval{##1+1+\PfCTrioAjout});%
- \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+1+\PfCTrioAjout}-|\fpeval{##1+1+\PfCTrioAjout}) rectangle (\fpeval{##2+2+\PfCTrioAjout}-|\fpeval{##1+2+\PfCTrioAjout});%
- \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+2+\PfCTrioAjout}-|\fpeval{##1+2+\PfCTrioAjout}) rectangle (\fpeval{##2+3+\PfCTrioAjout}-|\fpeval{##1+3+\PfCTrioAjout});%
- \xintBreakFor}{}%
+ \ifnum\fpeval{\PfCTitiDD}=0\relax
+ \xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
+ \xintFor* ##1 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2)+##1+1}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2+1)+##1+2}]}%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+\PfCTrioAjout}-|\fpeval{##1+\PfCTrioAjout}) rectangle (\fpeval{##2+1+\PfCTrioAjout}-|\fpeval{##1+1+\PfCTrioAjout});%
+ \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+1+\PfCTrioAjout}-|\fpeval{##1+1+\PfCTrioAjout}) rectangle (\fpeval{##2+2+\PfCTrioAjout}-|\fpeval{##1+2+\PfCTrioAjout});%
+ \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+2+\PfCTrioAjout}-|\fpeval{##1+2+\PfCTrioAjout}) rectangle (\fpeval{##2+3+\PfCTrioAjout}-|\fpeval{##1+3+\PfCTrioAjout});%
+ \xintBreakFor}{}%
+ }%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xintBreakFor
+ }{}%
}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \xintBreakFor}{}%
- }%
- % Calculs des diagonale négatives (montantes)
- \xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
- \xintFor* ##1 in{\xintSeq{2}{\fpeval{\PfCTrioMaxB+1}}}\do{%
- \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1)+##2}]}%
- \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-1)+##2+1}]}%
- \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-2)+##2+2}]}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1+\PfCTrioAjout+1}-|\fpeval{##2+\PfCTrioAjout}) rectangle (\fpeval{##1+2+\PfCTrioAjout}-|\fpeval{##2+1+\PfCTrioAjout});%
- \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1+\PfCTrioAjout}-|\fpeval{##2+1+\PfCTrioAjout}) rectangle (\fpeval{##1+1+\PfCTrioAjout}-|\fpeval{##2+2+\PfCTrioAjout});%
- \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1-1+\PfCTrioAjout}-|\fpeval{##2+2+\PfCTrioAjout}) rectangle (\fpeval{##1+\PfCTrioAjout}-|\fpeval{##2+3+\PfCTrioAjout});%
- \xintBreakFor%
+ \fi
+ % Calculs des diagonales négatives (montantes)
+ \ifnum\fpeval{\PfCTitiDM}=0\relax
+ \xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
+ \xintFor* ##1 in{\xintSeq{2}{\fpeval{\PfCTrioMaxB+1}}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1)+##2}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-1)+##2+1}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-2)+##2+2}]}%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1+\PfCTrioAjout+1}-|\fpeval{##2+\PfCTrioAjout}) rectangle (\fpeval{##1+2+\PfCTrioAjout}-|\fpeval{##2+1+\PfCTrioAjout});%
+ \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1+\PfCTrioAjout}-|\fpeval{##2+1+\PfCTrioAjout}) rectangle (\fpeval{##1+1+\PfCTrioAjout}-|\fpeval{##2+2+\PfCTrioAjout});%
+ \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1-1+\PfCTrioAjout}-|\fpeval{##2+2+\PfCTrioAjout}) rectangle (\fpeval{##1+\PfCTrioAjout}-|\fpeval{##2+3+\PfCTrioAjout});%
+ \xintBreakFor%
+ }{}%
+ }%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xintBreakFor
}{}%
}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \xintBreakFor}{}%
- }%
+ \fi
}{}%
\Body
\ifboolKV[Trio]{Repere}{%
@@ -155,11 +170,100 @@
}\\
}%
\end{NiceTabular}%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \ifboolKV[Trio]{NbSolutions}{%
+ \xdef\PfCNbSolutionH{0}%
+ \xdef\PfCNbSolutionV{0}%
+ \xdef\PfCNbSolutionDD{0}%
+ \xdef\PfCNbSolutionDM{0}%
+ \xdef\NbCibleSolution{\useKV[Trio]{NbSolution}}%
+ % Calculs des horizontaux
+ \xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxA}}\do{%
+ \xintFor* ##1 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1+1}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1+2}]}%
+ \TrioTestCible[\NbCibleSolution]{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xdef\PfCNbSolutionH{\fpeval{\PfCNbSolutionH+1}}%
+ \modulo{\PfCNbSolutionH}{2}%
+ \ifnum\remainder=0\relax%
+ \tikz[remember picture,overlay,transform canvas={yshift=0.25\PfCTrioHauteur}]\draw[Crimson,line width=2pt] (TS-\fpeval{##2+\PfCTrioAjout}-\fpeval{##1+\PfCTrioAjout}.center) -- (TS-\fpeval{##2+\PfCTrioAjout}-\fpeval{##1+3+\PfCTrioAjout-1}.center);%
+ \else%
+ \tikz[remember picture,overlay,transform canvas={yshift=-0.25\PfCTrioHauteur}]\draw[Crimson,line width=2pt] (TS-\fpeval{##2+\PfCTrioAjout}-\fpeval{##1+\PfCTrioAjout}.center) -- (TS-\fpeval{##2+\PfCTrioAjout}-\fpeval{##1+3+\PfCTrioAjout-1}.center);%
+ \fi%
+ }{}%
+ }%
+ }%
+ % Calculs des verticaux
+ \xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxA}}\do{%
+ \xintFor* ##1 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-1)+##2}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1)+##2}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1+1)+##2}]}%
+ \TrioTestCible[\NbCibleSolution]{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xdef\PfCNbSolutionV{\fpeval{\PfCNbSolutionV+1}}%
+ \modulo{\PfCNbSolutionV}{2}%
+ \ifnum\remainder=0\relax%
+ \tikz[remember picture,overlay,transform canvas={xshift=-0.25\PfCTrioHauteur}]\draw[NavyBlue,line width=2pt] (TS-\fpeval{##1+\PfCTrioAjout}-\fpeval{##2+\PfCTrioAjout}.center) -- (TS-\fpeval{##1+3+\PfCTrioAjout-1}-\fpeval{##2+\PfCTrioAjout}.center);%
+ \else%
+ \tikz[remember picture,overlay,transform canvas={xshift=0.25\PfCTrioHauteur}]\draw[NavyBlue,line width=2pt] (TS-\fpeval{##1+\PfCTrioAjout}-\fpeval{##2+\PfCTrioAjout}.center) -- (TS-\fpeval{##1+3+\PfCTrioAjout-1}-\fpeval{##2+\PfCTrioAjout}.center);%
+ \fi%
+ }{}%
+ }%
+ }%
+ % Calculs des diag positives (descendantes)
+ \xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
+ \xintFor* ##1 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2)+##1+1}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2+1)+##1+2}]}%
+ \TrioTestCible[\NbCibleSolution]{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xdef\PfCNbSolutionDD{\fpeval{\PfCNbSolutionDD+1}}%
+ \modulo{\PfCNbSolutionDD}{2}%
+ \ifnum\remainder=0\relax%
+ \tikz[remember picture,overlay]\draw[Orchid,line width=2pt,transform canvas={xshift=0.25\PfCTrioHauteur,yshift=0.25\PfCTrioHauteur}] (TS-\fpeval{##2+\PfCTrioAjout}-\fpeval{##1+\PfCTrioAjout}.center) to (TS-\fpeval{##2+3+\PfCTrioAjout-1}-\fpeval{##1+2+\PfCTrioAjout}.center);%
+ \else%
+ \tikz[remember picture,overlay]\draw[Orchid,line width=2pt,transform canvas={xshift=-0.25\PfCTrioHauteur,yshift=-0.25\PfCTrioHauteur}] (TS-\fpeval{##2+\PfCTrioAjout}-\fpeval{##1+\PfCTrioAjout}.center) to (TS-\fpeval{##2+3+\PfCTrioAjout-1}-\fpeval{##1+2+\PfCTrioAjout}.center);%
+ \fi%
+ }{}%
+ }%
+ }%
+ % Calculs des diag négatives (ascendantes)
+ \xintFor* ##2 in{\xintSeq{1}{\PfCTrioMaxB}}\do{%
+ \xintFor* ##1 in{\xintSeq{2}{\fpeval{\PfCTrioMaxB+1}}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1)+##2}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-1)+##2+1}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-2)+##2+2}]}%
+ \TrioTestCible[\NbCibleSolution]{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xdef\PfCNbSolutionDM{\fpeval{\PfCNbSolutionDM+1}}%
+ \modulo{\PfCNbSolutionDM}{2}%
+ \ifnum\remainder=0\relax%
+ \tikz[remember picture,overlay]\draw[Lavender,line width=2pt,transform canvas={xshift=-0.25\PfCTrioHauteur,yshift=0.25\PfCTrioHauteur}] (TS-\fpeval{##1+\PfCTrioAjout+1}-\fpeval{##2+\PfCTrioAjout}.center) to (TS-\fpeval{##1+\PfCTrioAjout-1}-\fpeval{##2+3+\PfCTrioAjout-1}.center);%
+ \else%
+ \tikz[remember picture,overlay]\draw[Lavender,line width=2pt,transform canvas={xshift=0.25\PfCTrioHauteur,yshift=-0.25\PfCTrioHauteur}] (TS-\fpeval{##1+\PfCTrioAjout+1}-\fpeval{##2+\PfCTrioAjout}.center) to (TS-\fpeval{##1+\PfCTrioAjout-1}-\fpeval{##2+3+\PfCTrioAjout-1}.center);%
+ \fi%
+ }{}%
+ }%
+ }%
+ }{}%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}%
\NewDocumentCommand\TrioCourt{o}{%
\useKVdefault[Trio]%
\setKV[Trio]{#1}%
+ \xdef\PfCTitiH{0}%
+ \xdef\PfCTitiV{0}%
+ \xdef\PfCTitiDM{0}%
+ \xdef\PfCTitiDD{0}%
+ \ifboolKV[Trio]{Horizontal}{\xdef\PfCTitiV{1}\xdef\PfCTitiDM{1}\xdef\PfCTitiDD{1}}{}%
+ \ifboolKV[Trio]{Vertical}{\xdef\PfCTitiH{1}\xdef\PfCTitiDM{1}\xdef\PfCTitiDD{1}}{}%
+ \ifboolKV[Trio]{DiagonaleM}{\xdef\PfCTitiH{1}\xdef\PfCTitiV{1}\xdef\PfCTitiDD{1}}{}%
+ \ifboolKV[Trio]{DiagonaleD}{\xdef\PfCTitiH{1}\xdef\PfCTitiV{1}\xdef\PfCTitiDM{1}}{}%
\setcounter{PfCTrioLettre}{\useKV[Trio]{Colonne}-1}%
\ifboolKV[Trio]{Repere}{\xdef\PfCTrioNbCases{4}}{\xdef\PfCTrioNbCases{3}}%
\setlength{\PfCTrioHauteur}{\useKV[Trio]{Largeur}+\tabcolsep}%
@@ -169,101 +273,81 @@
\ifboolKV[Trio]{Repere}{%
\xdef\PfCTrioAjout{1}%
}{%
- \xdef\PfCTrioAjout{0}
+ \xdef\PfCTrioAjout{0}%
}%
% Calculs des horizontaux
- \xintFor* ##2 in{\xintSeq{\fpeval{\useKV[Trio]{Ligne}}}{\fpeval{\useKV[Trio]{Ligne}+2}}}\do{%
- \xintFor* ##1 in{\xintSeq{\fpeval{\useKV[Trio]{Colonne}}}{\fpeval{\useKV[Trio]{Colonne}}}}\do{%
- \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1}]}%
- \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1+1}]}%
- \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1+2}]}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{\tikz\draw[fill=Cornsilk,line width=2pt] (\fpeval{##2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+3+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});\xintBreakFor}{}%
+ \ifnum\fpeval{\PfCTitiH}=0\relax
+ \xintFor* ##2 in{\xintSeq{\fpeval{\useKV[Trio]{Ligne}}}{\fpeval{\useKV[Trio]{Ligne}+2}}}\do{%
+ \xintFor* ##1 in{\xintSeq{\fpeval{\useKV[Trio]{Colonne}}}{\fpeval{\useKV[Trio]{Colonne}}}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1+1}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1+2}]}%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{\tikz\draw[fill=Cornsilk,line width=2pt] (\fpeval{##2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+3+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});\xintBreakFor}{}%
+ }%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xintBreakFor
+ }{}%
}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \xintBreakFor}{}%
- }%
+ \fi%
% Calculs des verticaux
- \xintFor* ##2 in{\xintSeq{\fpeval{\useKV[Trio]{Colonne}}}{\fpeval{\useKV[Trio]{Colonne}+2}}}\do{%
- \xintFor* ##1 in{\xintSeq{\useKV[Trio]{Ligne}}{\useKV[Trio]{Ligne}}}\do{%
- \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-1)+##2}]}%
- \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1)+##2}]}%
- \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1+1)+##2}]}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- || \fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{\tikz\draw[fill=LightSteelBlue,line width=2pt] (\fpeval{##1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##1+3+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});\xintBreakFor}{}%
+ \ifnum\fpeval{\PfCTitiV}=0\relax
+ \xintFor* ##2 in{\xintSeq{\fpeval{\useKV[Trio]{Colonne}}}{\fpeval{\useKV[Trio]{Colonne}+2}}}\do{%
+ \xintFor* ##1 in{\xintSeq{\useKV[Trio]{Ligne}}{\useKV[Trio]{Ligne}}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-1)+##2}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1)+##2}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1+1)+##2}]}%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{\tikz\draw[fill=LightSteelBlue,line width=2pt] (\fpeval{##1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##1+3+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});\xintBreakFor}{}%
+ }%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xintBreakFor
+ }{}%
}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \xintBreakFor}{}%
- }%
+ \fi
% Calculs des diag positives (descendantes)
- \xintFor* ##2 in{\xintSeq{\useKV[Trio]{Ligne}}{\useKV[Trio]{Ligne}}}\do{%
- \xintFor* ##1 in{\xintSeq{\useKV[Trio]{Colonne}}{\useKV[Trio]{Colonne}}}\do{%
- \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1}]}%
- \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2)+##1+1}]}%
- \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2+1)+##1+2}]}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
- \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##2+2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
- \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##2+3+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+3+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
- \xintBreakFor}{}%
+ \ifnum\fpeval{\PfCTitiDD}=0\relax
+ \xintFor* ##2 in{\xintSeq{\useKV[Trio]{Ligne}}{\useKV[Trio]{Ligne}}}\do{%
+ \xintFor* ##1 in{\xintSeq{\useKV[Trio]{Colonne}}{\useKV[Trio]{Colonne}}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2-1)+##1}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2)+##1+1}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##2+1)+##1+2}]}%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
+ \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##2+2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
+ \tikz\draw[fill=MistyRose,line width=2pt] (\fpeval{##2+2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##2+3+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##1+3+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
+ \xintBreakFor}{}%
+ }%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xintBreakFor
+ }{}%
}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \xintBreakFor}{}%
- }%
- % Calculs des diagonale négatives (montantes)
- \xintFor* ##2 in{\xintSeq{\useKV[Trio]{Colonne}}{\useKV[Trio]{Colonne}}}\do{%
- \xintFor* ##1 in{\xintSeq{\fpeval{\useKV[Trio]{Ligne}}}{\fpeval{\useKV[Trio]{Ligne}}}}\do{%
- \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1+1)+##2}]}%
- \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1)+##2+1}]}%
- \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-1)+##2+2}]}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1+2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##1+3+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
- \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1+1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##1+2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
- \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##1+1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+3+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
- \xintBreakFor%
+ \fi
+ % Calculs des diagonales négatives (montantes)
+ \ifnum\fpeval{\PfCTitiDM}=0\relax
+ \xintFor* ##2 in{\xintSeq{\useKV[Trio]{Colonne}}{\useKV[Trio]{Colonne}}}\do{%
+ \xintFor* ##1 in{\xintSeq{\fpeval{\useKV[Trio]{Ligne}}}{\fpeval{\useKV[Trio]{Ligne}}}}\do{%
+ \xdef\PfCTrioNombreA{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1+1)+##2}]}%
+ \xdef\PfCTrioNombreB{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1)+##2+1}]}%
+ \xdef\PfCTrioNombreC{\PfCTrioMelange[\fpeval{\PfCTrioMaxA*(##1-1)+##2+2}]}%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1+2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##1+3+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
+ \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1+1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+1+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##1+2+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
+ \tikz\draw[fill=LavenderBlush,line width=2pt] (\fpeval{##1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+2+\PfCTrioAjout-\useKV[Trio]{Colonne}+1}) rectangle (\fpeval{##1+1+\PfCTrioAjout-\useKV[Trio]{Ligne}+1}-|\fpeval{##2+3+\PfCTrioAjout-\useKV[Trio]{Colonne}+1});%
+ \xintBreakFor%
+ }{}%
+ }%
+ \TrioTestCible{\PfCTrioNombreA}{\PfCTrioNombreB}{\PfCTrioNombreC}%
+ \xintifboolexpr{\PfCRetourTestCible==1}{%
+ \xintBreakFor
}{}%
}%
- \xintifboolexpr{\fpeval{\PfCTrioNombreA*\PfCTrioNombreB+\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreA*\PfCTrioNombreB-\PfCTrioNombreC}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC+\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreB*\PfCTrioNombreC-\PfCTrioNombreA}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA+\PfCTrioNombreB}==\useKV[Trio]{Cible}%
- ||\fpeval{\PfCTrioNombreC*\PfCTrioNombreA-\PfCTrioNombreB}==\useKV[Trio]{Cible}}{%
- \xintBreakFor}{}%
- }%
+ \fi%
}{}%
\Body
\ifboolKV[Trio]{Repere}{%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty 2024-03-24 20:05:18 UTC (rev 70745)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty 2024-03-24 20:05:42 UTC (rev 70746)
@@ -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/01/22}%
+\def\filedate{2024/03/24}%
\let\PfCfiledate\filedate%
-\def\fileversion{0.99-z-z}%
+\def\fileversion{0.99-A-b}%
\let\PfCfileversion\fileversion%
\ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]%
@@ -14,6 +14,20 @@
\newif\if at shellescape \@shellescapetrue%
\newif\if at amssymb \@amssymbtrue%
+%
+\newif\if at Euro \@Eurotrue
+\newif\if at CFA \@CFAfalse
+\newif\if at CFP \@CFPfalse
+\newif\if at CHF \@CHFfalse
+\newif\if at US \@USfalse
+\newif\if at UK \@UKfalse
+
+\DeclareOption{CFA}{\@Eurofalse\@CFAtrue}%
+\DeclareOption{CFP}{\@Eurofalse\@CFPtrue}%
+\DeclareOption{CHF}{\@Eurofalse\@CHFtrue}%
+\DeclareOption{UK}{\@Eurofalse\@UKtrue}%
+\DeclareOption{US}{\@Eurofalse\@UStrue}%
+%
\DeclareOption{nonshellescape}{\@shellescapefalse}%
\DeclareOption{nonamssymb}{\@amssymbfalse}%
\ProcessOptions\relax%
@@ -25,8 +39,8 @@
% mathématiques
\RequirePackage{siunitx}%
\sisetup{%
- locale=FR,%
- mode = match, propagate-math-font = true,%
+ locale=FR,%mode = match,
+ propagate-math-font = true,%
reset-math-version = false, reset-text-family = false,%
reset-text-series = false, reset-text-shape = false,%
text-family-to-math = true, text-series-to-math = true,%
@@ -48,7 +62,31 @@
\DeclareSIUnit{\EuRo}{€}%
\DeclareSIUnit{\Dollar}{\$}%
\DeclareSIUnit{\LivreSterling}{£}%
+\DeclareSIUnit{\PfCCFA}{F.C.F.A.}%
+\DeclareSIUnit{\PfCCFP}{F.C.F.P.}%
+\DeclareSIUnit{\PfCCHF}{CHF}%
+%
+\if at CFA%
+ \DeclareSIUnit{\DeviseDefaut}{F.C.F.A.}%
+\fi%
+\if at CFP%
+ \DeclareSIUnit{\DeviseDefaut}{F.C.F.P.}%
+\fi%
+\if at CHF%
+ \DeclareSIUnit{\DeviseDefaut}{CHF}%
+\fi%
+\if at Euro%
+ \DeclareSIUnit{\DeviseDefaut}{€}%
+\fi%
+\if at US%
+ \DeclareSIUnit{\DeviseDefaut}{\Dollar}%
+\fi%
+\if at UK%
+ \DeclareSIUnit{\DeviseDefaut}{\LivreSterling}%
+\fi%
+
+
\RequirePackage[table,svgnames]{xcolor}%Gestion des couleurs
%\PassOptionsToPackage{table,svgnames}{xcolor}
\RequirePackage{xstring}%Gestion de chaines de caractères
@@ -88,7 +126,6 @@
\RequirePackage{multido}%
\RequirePackage{xlop}%
-\RequirePackage{xfp}%
\RequirePackage{tcolorbox}%
\tcbuselibrary{breakable,external,fitting,hooks,magazine,poster,raster,skins,theorems,listings,listingsutf8}
@@ -98,7 +135,7 @@
%https://tex.stackexchange.com/questions/58656/best-way-to-draw-a-chevron-diagram-using-tikz
\usetikzlibrary{calc,shapes,arrows,tikzmark,chains,positioning,shapes.symbols,babel,fit,backgrounds}%
-\RequirePackage{suffix}%pour la commande étoilée
+%\RequirePackage{suffix}%pour la commande étoilée
\RequirePackage{multicol}%
@@ -107,7 +144,7 @@
\RequirePackage{stackengine}%
\RequirePackage[thicklines]{cancel}%
-\RequirePackage{fontawesome5}%Pour l'environnement Twitter
+\RequirePackage{fontawesome5}%
\RequirePackage{pifont}%Pour la commande \Autonomie
\RequirePackage{nicematrix}%
\NiceMatrixOptions{allow-duplicate-names}%
@@ -115,7 +152,7 @@
\let\myoldmulticolumn\multicolumn%
\AtBeginEnvironment{tabular}{\let\multicolumn\myoldmulticolumn}%
-\RequirePackage{multirow}%
+%\RequirePackage{multirow}%
\RequirePackage{longtable}
\RequirePackage{fmtcount}%
@@ -122,7 +159,7 @@
\FCloadlang{french}%
% https://stackoverflow.com/questions/3391103/how-to-make-the-grayed-round-box-using-tiks
-\RequirePackage{environ}%
+%\RequirePackage{environ}%
%%%%% Quelques besoins particuliers
@@ -254,28 +291,6 @@
\newlength{\LongBoitePoint}
-\NewDocumentCommand\PointsSuspensionold{sm}{%
- \setbox2=\hbox{\ldotp}%
- \setlength{\LongBoitePoint}{\wd2}%
- \IfBooleanTF{#1}{%
- \Suspensionfill%
- }{%
- \setbox1=\hbox{#2}%
- \StrLen{#2}[\LongueurPoints]%
- \ifmmode%
- \mathinner{%
- \xintFor* ##1 in {\xintSeq{1}{\LongueurPoints}}\do{%
- \ldotp%
- }%
- }%
- \else%
- \xintFor* ##1 in {\xintSeq{1}{\fpeval{round(\wd1/\wd2)}}}\do{%
- \ldotp%
- }%
- \fi%
- }%
-}%
-
\NewDocumentCommand\PointsSuspension{m}{%
\setbox2=\hbox{\ldotp}%
\setlength{\LongBoitePoint}{\wd2}%
@@ -305,7 +320,6 @@
\kern\z@}%
\NewDocumentCommand\PfCdotover{}{\leavevmode\cleaders\hb at xt@ .22em{\hss $\cdot$\hss}\hfill\kern\z@}%
-
\makeatother%
\NewDocumentCommand\pointilles{o}{%
@@ -519,6 +533,37 @@
\reademptyitems%
}%
+\newcommand\MelangeListeNewTwo[2]{%
+ % #1 Liste à mélanger
+ % #2 Nombre d'éléments à conserver
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeInter{#1}%
+% \xdef\faa{}% Liste construite
+ \xdef\fii{}% Liste détruite
+ % on crée les #2 premieres solutions.
+ \xintFor* ##1 in {\xintSeq{1}{#2}}\do{%
+ \xintifboolexpr{\ListeInterlen>1}{%
+ \xdef\Alea{\fpeval{randint(\ListeInterlen)}}%
+ \ifnum\fpeval{##1}=1\relax
+ \xdef\faa{\ListeInter[\Alea]}%
+ \else
+ \xdef\faa{\faa,\ListeInter[\Alea]}%
+ \fi
+ \xdef\fii{}%
+ \xintFor* ##2 in {\xintSeq{1}{\ListeInterlen}}\do{%
+ \xintifboolexpr{##2 == \Alea}{%
+ }{%
+ \xdef\fii{\fii \ListeInter[##2],}%
+ }%
+ }%
+ }{%
+ \xdef\faa{\faa \ListeInter[1]}%
+ }%
+ \readlist*\ListeInter{\fii}%
+ }%
+ \reademptyitems%
+}%
+
%%%
% Smiley
%%% https://tex.stackexchange.com/questions/3695/smileys-in-latex/227226
@@ -708,12 +753,15 @@
\setsepchar[*]{,*/}\ignoreemptyitems
\readlist*\ListeMateriaux{aluminium/'/2.7,chêne/e~/0.69,bouleau/e~/0.65,sapin/e~/0.45,polystyrène/e~/1.04,porcelaine/la/2.5,acier/'/7.85,cuivre/e~/8.92,fer/e~/7.86,or/'/19.3,argent/'/10.5,bronze/e~/8.4,plomb/e~/11.35,marbre/e~/2.75,laiton/e~/7.3,titane/e~/4.5,PVC/e~/1.38}
-\setsepchar{,}
+\setsepchar{,}\reademptyitems
%Internationalisation
\def\PfCSymbolTimes{\times}%
\def\PfCSymbolDiv{\div}%
+\input{PfCTicketCaisse}
+\input{PfCRecyclage}
+\input{PfCDontCountDots}
\input{PfCConversion}
\input{PfCCritere}
\input{PfCLego}
@@ -842,7 +890,7 @@
%%%
\newcommand\Puissances[2]{%
\ensuremath{%
- \xintifboolexpr{#2==0}{1}{\xintifboolexpr{#2>0}{\xdef\TotalP{\fpeval{#2-1}}#1\multido{\i=1+1}{\TotalP}{\times#1}}{\xdef\TotalP{\fpeval{-#2-1}}\frac{1}{#1\multido{\i=1+1}{\TotalP}{\times#1}}}}%
+ \xintifboolexpr{#2==0}{1}{\xintifboolexpr{#2>0}{\xdef\TotalP{\fpeval{#2-1}}#1\xintFor* ##1 in{\xintSeq{1}{\TotalP}}\do{\times#1}}{\xdef\TotalP{\fpeval{-#2-1}}\frac{1}{#1\xintFor* ##1 in{\xintSeq{1}{\TotalP}}\do{\times#1}}}}%
}%
}%
More information about the tex-live-commits
mailing list.