summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/profcollege
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/profcollege')
-rw-r--r--macros/latex/contrib/profcollege/doc/profcollege-doc.pdf (renamed from macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf)bin10330568 -> 10841130 bytes
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCAllumettes.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCArbreCalcul.tex546
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCArbreChiffre.tex3
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCAssemblagesSolides.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCAutomatismes.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCAutonomie.tex8
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCBarreNiveaux.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCBarresCalculs.tex3
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCBillard.tex17
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCBonSortie.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCBonbon.tex6
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCAN.tex7
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCalculatrice.tex3
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCalculsCroises.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCalculsDetailles.tex147
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex27
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCalisson.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCartesMentales.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCartographie.tex64
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCheque.tex125
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCible.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex7
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCColorilude.tex8
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCompteBon.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCConversion.tex7
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCritere.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCryptarithme.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDecDeci.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDecompFracDeci.tex15
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex147
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDefiCalc.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDefiTables.tex5
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDessinAlgo.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDessinGradue.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDessinerRatio.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDiagrammeRadar.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDistributivite.tex3
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDobble.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDomino.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDontCountDots.tex6
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex296
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEcritureLettres.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEcritureUnites.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEngrenagesBase.tex28
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEnigmeAire.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEnquete.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEratosthene.tex7
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFactorisation.tex7
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFicheMemo.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFonctionAffine.tex22
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFractionAireCarre.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFractionNombre.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFrise.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFubuki.tex7
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFutoshiki.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCGaram.tex12
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCGeometrie.tex10
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCGrades.tex8
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCGrimuku.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCHiddenMessage.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCHorloge.tex31
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCInfixRPN.sty538
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCJeton.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCJeuRangement.tex7
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCKakurasu.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCKakuro.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCKenKen.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCLabyrintheJeu.tex8
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCLabyrintheNombre.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCLego.tex10
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMentalo.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMidpoint.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCModeleBarre.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMosaique.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMotsCodes.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMotsCroises.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMotsEmpiles.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMulArt.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMulJal.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMulJap.tex5
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMulPiecesPuzzle.tex14
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCNombreAstral.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCNonogramme.tex7
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex58
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCNumberHive.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCNumerationsAnciennes.tex7
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCOperationsTrou.tex8
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPapiers.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPatronPaves.tex505
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPattern.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPavage.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPixelArt.tex216
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPourcentage.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCProbaFrequence.tex189
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCProbabilites.tex14
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCProgrammeCalcul.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPropor.tex50
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCProprietesDroites.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPuissanceQuatre.tex82
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPuzzleSommePyramide.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPyraVoca.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPyramideCalculs.tex307
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPythagore.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCQuestionsFlash.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCQuestionsRelier.tex66
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCQuiSuisJe.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRLE.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRangementNombres.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRapido.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRappelsFormules.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRecyclage.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCReperage.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex19
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRepresenterEntier.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRepresenterFraction.tex575
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex15
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCReseauxSociaux.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCResoudreEquation.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRondeInfernale.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRose.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCScratch.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCSerpent.tex211
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCShikaku.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex10
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCSolides.tex126
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCSommeAngles.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCSquaro.tex76
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCStatistiques.tex12
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTableauDoubleEntree.tex62
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex11
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTablesOperations.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTectonic.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCThales.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTicketCaisse.tex163
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTortueBase.tex10
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTrigonometrie.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTrio.tex7
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTriominos.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCUrneProba.tex932
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCVisualisationMulDeci.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCVueCubes.tex15
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCYohaku.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/ProfCollege.sty81
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp20
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCMonde.mp75
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCObjets.mp53
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCScratch.mp7
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp7
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCSketch.mp195
151 files changed, 6252 insertions, 423 deletions
diff --git a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf b/macros/latex/contrib/profcollege/doc/profcollege-doc.pdf
index dcd5987717..2cc561202d 100644
--- a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
+++ b/macros/latex/contrib/profcollege/doc/profcollege-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/profcollege/latex/PfCAllumettes.tex b/macros/latex/contrib/profcollege/latex/PfCAllumettes.tex
index f603c71f96..dea7c68cb9 100644
--- a/macros/latex/contrib/profcollege/latex/PfCAllumettes.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCAllumettes.tex
@@ -1,6 +1,10 @@
%%%
% Allumettes
%%%
+\def\filedateAllu{2024/08/04}%
+\def\fileversionAllu{0.1}%
+\message{-- \filedateAllu\space v\fileversionAllu}
+%
\setKVdefault[Allumettes]{Impression=false,Echelles=false}%
\defKV[Allumettes]{Echelle=\setKV[Allumettes]{Echelles}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCArbreCalcul.tex b/macros/latex/contrib/profcollege/latex/PfCArbreCalcul.tex
new file mode 100644
index 0000000000..347c56f640
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCArbreCalcul.tex
@@ -0,0 +1,546 @@
+%%%
+% Arbre de calculs
+%%%
+\def\filedateArbreC{2024/08/04}%
+\def\fileversionArbreC{0.1}%
+\message{-- \filedateArbreC\space v\fileversionArbreC}%
+\newtoks\toklistearbre%
+\newtoks\toklistearbrefractions%
+\newtoks\toklistearbreexpressions%
+
+\def\UpdatetoksArbreCalcul#1\nil{\IfDecimal{#1}{\addtotok\toklistearbre{#1,}}{\addtotok\toklistearbre{"#1",}}}%
+\def\UpdatetoksArbreFractions#1\nil{\addtotok\toklistearbrefractions{"#1",}}%
+\def\UpdatetoksArbreExpressions#1\nil{\addtotok\toklistearbreexpressions{"#1",}}%
+
+\setKVdefault[ArbreCalcul]{Correction=false,Couleur=LightSteelBlue,Substitue=7,Litteral=false,Largeur=8mm,LargeurC=8mm,Ecart=1.5cm,Hauteur=10mm,Lettre="x",CouleurDepart=LightGreen,Fractions=false,Nombres={},Expressions={},Etape=infinity}%
+\defKV[ArbreCalcul]{Fraction=\setKV[ArbreCalcul]{Fractions}}%
+
+\NewDocumentCommand\ArbreCalcul{om}{%
+ \useKVdefault[ArbreCalcul]%
+ \setKV[ArbreCalcul]{#1}%
+ \toklistearbre{}%
+ \toklistearbrefractions{}%
+ \toklistearbreexpressions{}%
+ \infixtoRPN{#2}%
+ \setsepchar{ }\ignoreemptyitems%
+ \readlist*\ListeNombres{\RPN}%
+ \reademptyitems%
+ \foreachitem\compteur\in\ListeNombres{\expandafter\UpdatetoksArbreCalcul\compteur\nil}%
+ \ifboolKV[ArbreCalcul]{Fractions}{%
+ \xdef\Foo{\useKV[ArbreCalcul]{Nombres}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeFractions{\Foo}%
+ \reademptyitems
+ \foreachitem\compteur\in\ListeFractions{\expandafter\UpdatetoksArbreFractions\compteur\nil}%
+ \BuildArbreCalculFraction{\the\toklistearbre}{\the\toklistearbrefractions}%
+ }{%
+ \ifboolKV[ArbreCalcul]{Litteral}{
+ \xdef\Foo{\useKV[ArbreCalcul]{Nombres}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeFractions{\Foo}%
+ \reademptyitems
+ \foreachitem\compteur\in\ListeFractions{\expandafter\UpdatetoksArbreFractions\compteur\nil}%
+ \xdef\Foo{\useKV[ArbreCalcul]{Expressions}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeExpressions{\Foo}%
+ \reademptyitems
+ \foreachitem\compteur\in\ListeExpressions{\expandafter\UpdatetoksArbreExpressions\compteur\nil}%
+% listarbre : \the\toklistearbre%
+%
+% listfracions : \the\toklistearbrefractions
+%
+% listexpressions : \the\toklistearbreexpressions
+ \BuildArbreCalculLitteral{\the\toklistearbre}{\the\toklistearbrefractions}{\the\toklistearbreexpressions}%
+ }{%
+ \BuildArbreCalcul{\the\toklistearbre}%
+ }%
+ }%
+}%
+
+\NewDocumentCommand\BuildArbreCalcul{m}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ boolean Correction,Litteral,Allume[];
+ Correction=\useKV[ArbreCalcul]{Correction};
+ Litteral=\useKV[ArbreCalcul]{Litteral};
+
+ NombreSubstitue=\useKV[ArbreCalcul]{Substitue};
+
+ etape=0;
+ Etape=\useKV[ArbreCalcul]{Etape};
+
+ color Evidence,CoulDepart;
+ Evidence=\useKV[ArbreCalcul]{Couleur};
+ CoulDepart=\useKV[ArbreCalcul]{CouleurDepart};
+
+ pair pointprec;
+
+ path base[];
+ base1=unitsquare xscaled \useKV[ArbreCalcul]{Largeur} yscaled 5mm;
+ base2=fullcircle scaled 5mm;
+ base3=unitsquare xscaled \useKV[ArbreCalcul]{LargeurC} yscaled 5mm;
+
+ vardef BlocCalcul(expr Ba,Bb,op,cha,chb)=%
+ % Ba point gauche
+ % Bb point droite
+ % op opération à afficher
+ etape:=etape+1;
+ save $;
+ picture $;
+ path cc[];
+ pair Bc;
+ Bc=(0.5*(xpart(Ba)+xpart(Bb)),if ypart(Bb)<ypart(Ba):ypart(Bb) else:ypart(Ba) fi -0.75u);
+ pointprec:=Bc+u*(0,-0.75);
+ $=image(
+ if Allume[numeropoint-1]=true:
+ cc1=base3 shifted (Ba-center base3);
+ else:
+ cc1=base1 shifted (Ba-center base1);
+ fi;
+ if Allume[numeropoint]=true:
+ cc2=base3 shifted (Bb-center base3);
+ else:
+ cc2=base1 shifted (Bb-center base1);
+ fi;
+
+ cc3=(fullcircle scaled 5mm) shifted Bc;
+ cc4=base3 shifted (pointprec-center base3);
+ if op="mul":
+ label(TEX("$\times$"),Bc);
+ ValeurPile[numeropoint-1]:=cha*chb;
+ elseif op="add":
+ label(TEX("$+$"),Bc);
+ ValeurPile[numeropoint-1]:=cha+chb;
+ elseif op="sub":
+ label(TEX("$\_$"),Bc);
+ ValeurPile[numeropoint-1]:=cha-chb;
+ elseif op="div":
+ label(TEX("$\div$"),Bc);
+ ValeurPile[numeropoint-1]:=cha/chb;
+ fi;
+ if Correction:
+ if etape<Etape+1:
+ fill cc4 withcolor Evidence;
+ label(TEX("\num{"&decimal(ValeurPile[numeropoint-1])&"}"),pointprec);
+ fi;
+ fi;
+ for l=1 upto 4:
+ trace cc[l];
+ endfor;
+ draw (Ba--Bc) cutbefore cc1 cutafter cc3;
+ draw (Bb--Bc) cutbefore cc2 cutafter cc3;
+ draw (Bc--pointprec) cutbefore cc3 cutafter cc4;
+ );
+ $
+ enddef;
+
+ numeric Valeurs[];
+ numeric Valeursa[];
+
+ string Operations[];
+
+ numeric numeropoint;
+ numeropoint=0;
+
+ numeric ValeurPile[];
+
+ vardef RecupDonnees(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ if numeric p_:
+ Valeurs[n]=p_;
+ Operations[n]="";
+ else:
+ Valeurs[n]=infinity;
+ Operations[n]=p_;
+ fi;
+ endfor;
+ n:=n+1;
+ Operations[n]="stop";
+ nbtotal=n;
+ for k=1 upto nbtotal:
+ ValeurPile[k]=0;
+ endfor;
+ enddef;
+
+ pair A[];
+ ecart=\useKV[ArbreCalcul]{Ecart};
+
+ RecupDonnees(#1);
+
+ A[0]=(0,0);
+ k=0;
+ nbetape:=0;
+
+ for p_=#1:
+ k:=k+1;
+ if numeric p_:
+ numeropoint:=numeropoint+1;
+ if unknown A[numeropoint]:A[numeropoint]-A[numeropoint-1]=ecart*(1,0);Allume[numeropoint]=false; else:
+ A[numeropoint]:=A[numeropoint-1]+ecart*(1,0); Allume[numeropoint]:=false;
+ fi;
+ if Valeurs[k]=0:Valeursa[k]:=NombreSubstitue else: Valeursa[k]=Valeurs[k] fi;
+ if Operations[k+1]="neg":
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart; if Litteral:
+ label(TEX("$\useKV[ArbreCalcul]{Lettre}$"),A[numeropoint]);
+ else:
+ label(TEX("\num{"&decimal(-Valeursa[k])&"}"),A[numeropoint]);
+ fi;
+ else:
+ label(TEX("\num{"&decimal(-Valeursa[k])&"}"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=-Valeursa[k];
+ else:
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart;if Litteral:
+ label(TEX("$\useKV[ArbreCalcul]{Lettre}$"),A[numeropoint]);
+ else:
+ label(TEX("\num{"&decimal(Valeursa[k])&"}"),A[numeropoint]);
+ fi;
+ else:
+ label(TEX("\num{"&decimal(Valeursa[k])&"}"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=Valeursa[k];
+ fi;
+ elseif string p_:
+ if p_<>"neg":
+ trace BlocCalcul(A[numeropoint-1],A[numeropoint],Operations[k],ValeurPile[numeropoint-1],ValeurPile[numeropoint]);
+ A[numeropoint-1]:=pointprec;
+ Allume[numeropoint-1]:=true;
+ numeropoint:=numeropoint-1;
+ fi;
+ fi;
+ endfor;
+ \end{mplibcode}
+ \fi
+}%
+
+\NewDocumentCommand\BuildArbreCalculFraction{mm}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ boolean Correction,Allume[];
+ Correction=\useKV[ArbreCalcul]{Correction};
+
+ string Fraction;
+ Fraction=\useKV[ArbreCalcul]{Fraction};
+
+ color Evidence,CoulDepart;
+ Evidence=\useKV[ArbreCalcul]{Couleur};
+ CoulDepart=\useKV[ArbreCalcul]{CouleurDepart};
+
+ pair pointprec;
+
+ path base[];
+ base1=unitsquare xscaled \useKV[ArbreCalcul]{Largeur} yscaled \useKV[ArbreCalcul]{Hauteur};
+ base2=fullcircle scaled 5mm;
+ base3=unitsquare xscaled \useKV[ArbreCalcul]{LargeurC} yscaled \useKV[ArbreCalcul]{Hauteur};
+
+ vardef BlocCalcul(expr Ba,Bb,op,cha,chb)=%
+ % Ba point gauche
+ % Bb point droite
+ % op opération à afficher
+ etape:=etape+1;
+ save $;
+ picture $;
+ path cc[];
+ pair Bc;
+ Bc=(0.5*(xpart(Ba)+xpart(Bb)),if ypart(Bb)<ypart(Ba):ypart(Bb) else:ypart(Ba) fi -0.75u);
+ pointprec:=Bc+u*(0,-1.25);
+ $=image(
+ if Allume[numeropoint-1]=true:
+ cc1=base3 shifted (Ba-center base3);
+ else:
+ cc1=base1 shifted (Ba-center base1);
+ fi;
+ if Allume[numeropoint]=true:
+ cc2=base3 shifted (Bb-center base3);
+ else:
+ cc2=base1 shifted (Bb-center base1);
+ fi;
+ cc3=(fullcircle scaled 5mm) shifted Bc;
+ cc4=base3 shifted (pointprec-center base3);
+ if op="mul":
+ label(TEX("$\times$\MulFraction[Seul][3]{"&cha&"}{"&chb&"}[\ResultatMul]"),Bc);
+ ValeurPile[numeropoint-1]:="\ResultatMul";
+ elseif op="add":
+ label(TEX("$+$\AddFraction[Seul][3]{"&cha&"}{"&chb&"}[\ResultatAdd]"),Bc);
+ ValeurPile[numeropoint-1]:="\ResultatAdd";
+ elseif op="sub":
+ label(TEX("$\_$\SousFraction[Seul][3]{"&cha&"}{"&chb&"}[\ResultatSous]"),Bc);
+ ValeurPile[numeropoint-1]:="\ResultatSous";
+ elseif op="div":
+ label(TEX("$\div$\DivFraction[Seul][3]{"&cha&"}{"&chb&"}[\ResultatDiv]"),Bc);
+ ValeurPile[numeropoint-1]:="\ResultatDiv";
+ fi;
+ if Correction:
+ if etape<Etape+1:
+ fill cc4 withcolor Evidence;
+ label(TEX("$\displaystyle\tofrac{"&ValeurPile[numeropoint-1]&"}$"),pointprec);
+ fi;
+ fi;
+ for l=1 upto 4:
+ trace cc[l];
+ endfor;
+ draw (Ba--Bc) cutbefore cc1 cutafter cc3;
+ draw (Bb--Bc) cutbefore cc2 cutafter cc3;
+ draw (Bc--pointprec) cutbefore cc3 cutafter cc4;
+ );
+ $
+ enddef;
+
+ numeric Valeurs[];
+ string Valeursa[];
+
+ string Operations[];
+
+ numeric numeropoint;
+ numeropoint=0;
+
+ string ValeurPile[];
+
+ vardef RecupDonnees(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ if numeric p_:
+ Valeurs[n]=p_;
+ Operations[n]="";
+ else:
+ Valeurs[n]=infinity;
+ Operations[n]=p_;
+ fi;
+ endfor;
+ n:=n+1;
+ Operations[n]="stop";
+ nbtotal=n;
+ for k=1 upto nbtotal:
+ ValeurPile[k]="0";
+ endfor;
+ enddef;
+
+ vardef RecupFractions(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Valeursa[n]=p_;
+ endfor;
+ enddef;
+
+ pair A[];
+ ecart=\useKV[ArbreCalcul]{Ecart};
+
+ RecupDonnees(#1);
+ RecupFractions(#2);
+
+ etape=0;
+ Etape=\useKV[ArbreCalcul]{Etape};
+
+ A[0]=(0,0);
+ k=0;
+ nbetape:=0;
+
+ for p_=#1:
+ k:=k+1;
+ if numeric p_:
+ numeropoint:=numeropoint+1;
+ if unknown A[numeropoint]:A[numeropoint]-A[numeropoint-1]=ecart*(1,0);Allume[numeropoint]=false; else:
+ A[numeropoint]:=A[numeropoint-1]+ecart*(1,0); Allume[numeropoint]:=false;
+ fi;
+ if Valeurs[k]=0:Valeursa[Valeurs[k]]:=\useKV[ArbreCalcul]{Fraction} fi;
+ if Operations[k+1]="neg":
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart;
+ label(TEX("$\displaystyle\tofrac{"&-Valeursa[Valeurs[k]]&"}$"),A[numeropoint]);
+ else:
+ label(TEX("$\displaystyle\tofrac{"&-Valeursa[Valeurs[k]]&"}$"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=decimal(-Valeursa[Valeurs[k]]);
+ else:
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart;
+ label(TEX("$\displaystyle\tofrac{"&Valeursa[Valeurs[k]]&"}$"),A[numeropoint]);
+ else:
+ label(TEX("$\displaystyle\tofrac{"&Valeursa[Valeurs[k]]&"}$"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=Valeursa[Valeurs[k]];
+ fi;
+ elseif string p_:
+ if p_<>"neg":
+ trace BlocCalcul(A[numeropoint-1],A[numeropoint],Operations[k],ValeurPile[numeropoint-1],ValeurPile[numeropoint]);
+ A[numeropoint-1]:=pointprec;
+ Allume[numeropoint-1]:=true;
+ numeropoint:=numeropoint-1;
+ fi;
+ fi;
+ endfor;
+ \end{mplibcode}
+ \fi
+}%
+
+\NewDocumentCommand\BuildArbreCalculLitteral{mmm}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ boolean Correction,Allume[];
+ Correction=\useKV[ArbreCalcul]{Correction};
+
+ color Evidence,CoulDepart;
+ Evidence=\useKV[ArbreCalcul]{Couleur};
+ CoulDepart=\useKV[ArbreCalcul]{CouleurDepart};
+
+ pair pointprec;
+
+ path base[];
+ base1=unitsquare xscaled \useKV[ArbreCalcul]{Largeur} yscaled \useKV[ArbreCalcul]{Hauteur};
+ base2=fullcircle scaled 5mm;
+ base3=unitsquare xscaled \useKV[ArbreCalcul]{LargeurC} yscaled \useKV[ArbreCalcul]{Hauteur};
+
+ vardef BlocCalcul(expr Ba,Bb,op,cha,chb)=%
+ % Ba point gauche
+ % Bb point droite
+ % op opération à afficher
+ etape:=etape+1;
+ save $;
+ picture $;
+ path cc[];
+ pair Bc;
+ Bc=(0.5*(xpart(Ba)+xpart(Bb)),if ypart(Bb)<ypart(Ba):ypart(Bb) else:ypart(Ba) fi -0.75u);
+ pointprec:=Bc+u*(0,-1.25);
+ $=image(
+ if Allume[numeropoint-1]=true:
+ cc1=base3 shifted (Ba-center base3);
+ else:
+ cc1=base1 shifted (Ba-center base1);
+ fi;
+ if Allume[numeropoint]=true:
+ cc2=base3 shifted (Bb-center base3);
+ else:
+ cc2=base1 shifted (Bb-center base1);
+ fi;
+ cc3=(fullcircle scaled 5mm) shifted Bc;
+ cc4=base3 shifted (pointprec-center base3);
+ if op="mul":
+ label(TEX("$\times$"),Bc);
+ ValeurPile[numeropoint-1]:="";
+ elseif op="add":
+ label(TEX("$+$"),Bc);
+ ValeurPile[numeropoint-1]:="";
+ elseif op="sub":
+ label(TEX("$\_$"),Bc);
+ ValeurPile[numeropoint-1]:="";
+ elseif op="div":
+ label(TEX("$\div$"),Bc);
+ ValeurPile[numeropoint-1]:="";
+ fi;
+ if Correction:
+ if etape<Etape+1:
+ fill cc4 withcolor Evidence;
+ label(TEX("$"&Valeursc[etape]&"$"),pointprec);
+ fi;
+ fi;
+ for l=1 upto 4:
+ trace cc[l];
+ endfor;
+ draw (Ba--Bc) cutbefore cc1 cutafter cc3;
+ draw (Bb--Bc) cutbefore cc2 cutafter cc3;
+ draw (Bc--pointprec) cutbefore cc3 cutafter cc4;
+ );
+ $
+ enddef;
+
+ numeric Valeurs[];
+ string Valeursa[];
+ string Valeursc[];
+
+ string Operations[];
+
+ numeric numeropoint;
+ numeropoint=0;
+
+ string ValeurPile[];
+
+ vardef RecupDonnees(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ if numeric p_:
+ Valeurs[n]=p_;
+ Operations[n]="";
+ else:
+ Valeurs[n]=infinity;
+ Operations[n]=p_;
+ fi;
+ endfor;
+ n:=n+1;
+ Operations[n]="stop";
+ nbtotal=n;
+ for k=1 upto nbtotal:
+ ValeurPile[k]="0";
+ endfor;
+ enddef;
+
+ vardef RecupFractions(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Valeursa[n]=p_;
+ endfor;
+ enddef;
+
+ vardef RecupCorrections(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Valeursc[n]=p_;
+ endfor;
+ enddef;
+
+ pair A[];
+ ecart=\useKV[ArbreCalcul]{Ecart};
+
+ RecupDonnees(#1);
+ RecupFractions(#2);
+ RecupCorrections(#3);
+
+ etape=0;
+ Etape=\useKV[ArbreCalcul]{Etape};
+
+ A[0]=(0,0);
+ k=0;
+ nbetape:=0;
+
+ for p_=#1:
+ k:=k+1;
+ if numeric p_:
+ numeropoint:=numeropoint+1;
+ if unknown A[numeropoint]:A[numeropoint]-A[numeropoint-1]=ecart*(1,0);Allume[numeropoint]=false; else:
+ A[numeropoint]:=A[numeropoint-1]+ecart*(1,0); Allume[numeropoint]:=false;
+ fi;
+ if Valeurs[k]=0:Valeursa[Valeurs[k]]:=\useKV[ArbreCalcul]{Lettre} fi;
+ if Operations[k+1]="neg":
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart;
+ label(TEX("$"&-Valeursa[Valeurs[k]]&"$"),A[numeropoint]);
+ else:
+ label(TEX("$"&-Valeursa[Valeurs[k]]&"$"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=decimal(-Valeursa[Valeurs[k]]);
+ else:
+ if Valeurs[k]=0:fill (base1 shifted (A[numeropoint]-center base1)) withcolor CoulDepart;
+ label(TEX("$"&Valeursa[Valeurs[k]]&"$"),A[numeropoint]);
+ else:
+ label(TEX("$"&Valeursa[Valeurs[k]]&"$"),A[numeropoint]);
+ fi;
+ ValeurPile[numeropoint]:=Valeursa[Valeurs[k]];
+ fi;
+ elseif string p_:
+ if p_<>"neg":
+ trace BlocCalcul(A[numeropoint-1],A[numeropoint],Operations[k],ValeurPile[numeropoint-1],ValeurPile[numeropoint]);
+ A[numeropoint-1]:=pointprec;
+ Allume[numeropoint-1]:=true;
+ numeropoint:=numeropoint-1;
+ fi;
+ fi;
+ endfor;
+ \end{mplibcode}
+ \fi
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCArbreChiffre.tex b/macros/latex/contrib/profcollege/latex/PfCArbreChiffre.tex
index f724c16fda..26d5cb021a 100644
--- a/macros/latex/contrib/profcollege/latex/PfCArbreChiffre.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCArbreChiffre.tex
@@ -2,6 +2,9 @@
% ArbreChiffre
%%%
% https://tex.stackexchange.com/questions/112975/how-to-print-the-permutation-of-s-u-v-a-t-with-latex
+\def\filedateArbreCh{2024/08/04}%
+\def\fileversionArbreCh{0.1}%
+\message{-- \filedateArbreCh\space v\fileversionArbreCh}%
\def\recurse#1#2#3#4\endmarker{%
\dopermute{#1#3}#2#4\endmarker
diff --git a/macros/latex/contrib/profcollege/latex/PfCAssemblagesSolides.tex b/macros/latex/contrib/profcollege/latex/PfCAssemblagesSolides.tex
index 5521dbb419..7f04a08323 100644
--- a/macros/latex/contrib/profcollege/latex/PfCAssemblagesSolides.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCAssemblagesSolides.tex
@@ -1,6 +1,10 @@
%%%
% Assemblages solides
%%%
+\def\filedateAssemblageS{2024/08/04}%
+\def\fileversionAssemblageS{0.1}%
+\message{-- \filedateAssemblageS\space v\fileversionAssemblageS}%
+%
\setKVdefault[Assemblage]{Phi=30,Theta=20,Distance=50,Anglez=0,Anglex=0,Largeur=1.5,Profondeur=0.75,Hauteur=1,RayonBoule=1,RayonCone=1,RayonCylindre=1,HauteurPrisme=1,HauteurPyramideA=1,HauteurPyramideB=1,HauteurConeA=1,HauteurConeB=1,HauteurCylindre=1,Cotes=3,Trace=false,Type=Pyramides}%
\defKV[Assemblage]{Traces=\setKV[Assemblage]{Trace}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCAutomatismes.tex b/macros/latex/contrib/profcollege/latex/PfCAutomatismes.tex
index fbf80943d4..bb000dee6a 100644
--- a/macros/latex/contrib/profcollege/latex/PfCAutomatismes.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCAutomatismes.tex
@@ -1,6 +1,10 @@
%%%
% Automatismes
%%%
+\def\filedateAutomatismes{2024/08/04}%
+\def\fileversionAutomatismes{0.1}%
+\message{-- \filedateAutomatismes\space v\fileversionAutomatismes}%
+%
\NewDocumentCommand\ChoixAleaMixold{mmmm}{%
\ChoixAlea{1}{2}{\Autograine}%
\ifnum\Autograine=1\relax%
diff --git a/macros/latex/contrib/profcollege/latex/PfCAutonomie.tex b/macros/latex/contrib/profcollege/latex/PfCAutonomie.tex
index b75161ffcc..3e72a72575 100644
--- a/macros/latex/contrib/profcollege/latex/PfCAutonomie.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCAutonomie.tex
@@ -1,4 +1,10 @@
-%%% Autonomie %%%
+%%%
+%Autonomie
+%%%
+\def\filedateAutonomie{2024/08/04}%
+\def\fileversionAutonomie{0.1}%
+\message{-- \filedateAutonomie\space v\fileversionAutonomie}%
+%
\setKVdefault[Autonomie]{AfficheMarge=false,TitreEnigme=Enigme,TitreAtoi=\`A toi,Enigme=false,TexteCorrection=\bfseries Correction,ARemplir=false,Deux=false,Landscape=false}%
\newcommand\Autonomie[3][]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCBarreNiveaux.tex b/macros/latex/contrib/profcollege/latex/PfCBarreNiveaux.tex
index 8ee730bbfb..d56f096d7e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCBarreNiveaux.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCBarreNiveaux.tex
@@ -1,6 +1,10 @@
%%%
% Barres de niveaux
%%%
+\def\filedateBarreNiveaux{2024/08/04}%
+\def\fileversionBarreNiveaux{0.1}%
+\message{-- \filedateBarreNiveaux\space v\fileversionBarreNiveaux}%
+%
\setKVdefault[ClesBarre]{Niveau=false,LimiteI=25,LimiteF=50,LimiteS=75,TexteOrigine=0,TexteReference=100,CouleurGraduation=white,CouleurFond=gray!50,CouleurBarre=black,Graduation=false,Nom=D\'efaut,Pas=10,CouleurI=red,CouleurF=orange,CouleurS=yellow,CouleurM=green}
\newlength{\barrewidth}
diff --git a/macros/latex/contrib/profcollege/latex/PfCBarresCalculs.tex b/macros/latex/contrib/profcollege/latex/PfCBarresCalculs.tex
index 12b5077025..47537abe92 100644
--- a/macros/latex/contrib/profcollege/latex/PfCBarresCalculs.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCBarresCalculs.tex
@@ -1,6 +1,9 @@
%%%
% Barres de calculs
%%%
+\def\filedateBarresCalculs{2024/08/04}%
+\def\fileversionBarresCalculs{0.1}%
+\message{-- \filedateBarresCalculs\space v\fileversionBarresCalculs}%
\setKVdefault[SuiteBarre]{Litteral=false,Perso=false,Decimaux=false}
\NewDocumentCommand\BarresCalculs{o m m}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCBillard.tex b/macros/latex/contrib/profcollege/latex/PfCBillard.tex
index 6faf803803..dc0082cef8 100644
--- a/macros/latex/contrib/profcollege/latex/PfCBillard.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCBillard.tex
@@ -1,6 +1,10 @@
%%%
% Billard
%%%
+\def\filedateBillard{2024/08/28}%
+\def\fileversionBillard{0.1a}%
+\message{-- \filedateBillard\space v\fileversionBillard}%
+%
\newtoks\tokPfCMotBillard{}%
\def\UpdateTokBillard#1\nil{\addtotok\tokPfCMotBillard{"#1"}}%
@@ -227,11 +231,9 @@
}%
\def\MPBillardSolution#1#2#3{%
- % \mplibcodeinherit{enable}%
\mplibforcehmode
\xdef\PfCNomBillard{\useKV[ClesBillard]{Nom}}
\begin{mplibcode}[\PfCNomBillard]
-% Figure(0,0,\useKV[ClesBillard]{Longueur}+2cm,\useKV[ClesBillard]{Largeur}+3cm);
trace rec;
% Tracés
drawarrow Pt[1]--(Pt[1]+1.5cm*unitvector(Pt[2]-Pt[1])) withpen pencircle scaled 1.25;
@@ -253,14 +255,16 @@
else:
dotlabel.bot(TEX(substring(0,1) of #1),Pt[1]);
fi;
+ path segmenttest;
for k=2 upto BLong:
- if (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[1])<>(-1,-1):
+ segmenttest:=(9/10)[Pt[k-1],Pt[k]]--(11/10)[Pt[k-1],Pt[k]];
+ if segmenttest intersectiontimes cote[1]<>(-1,-1):
dotlabel.bot(TEX(substring(k-1,k) of #1),Pt[k]);
- elseif (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[2])<>(-1,-1):
+ elseif segmenttest intersectiontimes cote[2]<>(-1,-1):
dotlabel.rt(TEX(substring(k-1,k) of #1),Pt[k]);
- elseif (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[3])<>(-1,-1):
+ elseif segmenttest intersectiontimes cote[3]<>(-1,-1):
dotlabel.top(TEX(substring(k-1,k) of #1),Pt[k]);
- elseif (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[4])<>(-1,-1):
+ elseif segmenttest intersectiontimes cote[4]<>(-1,-1):
dotlabel.lft(TEX(substring(k-1,k) of #1),Pt[k]);
fi;
endfor;
@@ -270,5 +274,4 @@
label.top(TEX(substring(k-1,k) of #1),((xpart(Co),5mm)-center Reponse)+(k-1)*(7mm,0)+(2.5mm,0));
endfor;
\end{mplibcode}%
-% \mplibcodeinherit{disable}%
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCBonSortie.tex b/macros/latex/contrib/profcollege/latex/PfCBonSortie.tex
index 25408ad5fe..c783f90d8e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCBonSortie.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCBonSortie.tex
@@ -1,6 +1,10 @@
%%%
% Bon de sortie
%%%
+\def\filedateBonSortie{2024/08/04}%
+\def\fileversionBonSortie{0.1}%
+\message{-- \filedateBonSortie\space v\fileversionBonSortie}%
+%
\newcommand\BonSortieBandeau{%
Nom : \hfill Date : \hspace*{3cm}
}
diff --git a/macros/latex/contrib/profcollege/latex/PfCBonbon.tex b/macros/latex/contrib/profcollege/latex/PfCBonbon.tex
index 08be71cd4f..8c897fa4de 100644
--- a/macros/latex/contrib/profcollege/latex/PfCBonbon.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCBonbon.tex
@@ -1,9 +1,13 @@
%%%
% Bonbon
%%%
+\def\filedateBonbon{2024/08/04}%
+\def\fileversionBonbon{0.1}%
+\message{-- \filedateBonbon\space v\fileversionBonbon}%
+%
\setKVdefault[Bonbon]{CouleurUn=red,Bicolore=false,Echelle=1}%
\defKV[Bonbon]{CouleurDeux=\setKV[Bonbon]{Bicolore}}%
-
+%
\NewDocumentCommand\Bonbon{o}{%
\useKVdefault[Bonbon]%
\setKV[Bonbon]{#1}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCAN.tex b/macros/latex/contrib/profcollege/latex/PfCCAN.tex
index f77aea497a..cb8dd56fd2 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCAN.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCAN.tex
@@ -1,3 +1,10 @@
+%%%
+% CAN
+%
+\def\filedateCAN{2024/08/04}%
+\def\fileversionCAN{0.1}%
+\message{-- \filedateCAN\space v\fileversionCAN}%
+%
% Gestion de l'aléatoire (pour la CAN)
\newcommand\ChoixAlea[4][]{%
\ifx\bla#1\bla%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCalculatrice.tex b/macros/latex/contrib/profcollege/latex/PfCCalculatrice.tex
index d2a189e29b..c97b32472f 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCalculatrice.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCalculatrice.tex
@@ -1,6 +1,9 @@
%%%
% Calculatrice
%%%
+\def\filedateCalculatrice{2024/08/04}%
+\def\fileversionCalculatrice{0.1}%
+\message{-- \filedateCalculatrice\space v\fileversionCalculatrice}%
%https://tex.stackexchange.com/questions/290321/mimicking-a-calculator-inputs-and-screen
\definecolor{lightorange}{rgb}{0.9,0.4,0}%
\definecolor{lightestorange}{rgb}{1,0.8,0.5}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCalculsCroises.tex b/macros/latex/contrib/profcollege/latex/PfCCalculsCroises.tex
index d17a6c9f55..eb9b8b739d 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCalculsCroises.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCalculsCroises.tex
@@ -1,6 +1,10 @@
%%%
% Calculs Croises
%%%
+\def\filedateCalculsCroises{2024/08/04}%
+\def\fileversionCalculsCroises{0.1}%
+\message{-- \filedateCalculsCroises\space v\fileversionCalculsCroises}%
+%
\setKVdefault[CalculsCroises]{Largeur=20pt,Solution=false,Inverse=false,Creation=false,Graines=false,Vide=false,Couleur=LightGray,Negatifs=false,Aide=false,CouleurS=blue}
\defKV[CalculsCroises]{Graine=\setKV[CalculsCroises]{Graines}}%
\defKV[CalculsCroises]{ListeNombres=\setKV[CalculsCroises]{Aide}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCalculsDetailles.tex b/macros/latex/contrib/profcollege/latex/PfCCalculsDetailles.tex
new file mode 100644
index 0000000000..df321d523a
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCCalculsDetailles.tex
@@ -0,0 +1,147 @@
+%%%
+% Calculs détaillés
+%%%
+\def\filedateCDetailles{2024/08/24}%
+\def\fileversionCDetailles{0.1}%
+\message{-- \filedateCDetailles\space v\fileversionCDetailles}
+%
+\setKVdefault[CalculAuto]{Under=false,OverB=false,OverC=false,UnderB=false,UnderC=false,Cadre=false,Fluo=false,Evidence=false,Lettres={A,B,C,D,E},Couleur=Purple}
+
+\newcounter{PfCNbCalculs}
+\newcounter{PfCNbSousCalculs}
+\newcounter{PfCNbMarque}
+
+\NewDocumentCommand\PfCMarquePriorite{m}{%
+ \ifboolKV[CalculAuto]{OverB}{%
+ \Overbrace{#1}%
+ }{%
+ \ifboolKV[CalculAuto]{OverC}{%
+ \Overcrochet{#1}%
+ }{%
+ \ifboolKV[CalculAuto]{UnderC}{%
+ \Undercrochet{#1}%
+ }{%
+ \ifboolKV[CalculAuto]{UnderB}{%
+ \Underbrace{#1}%
+ }{%
+ \ifboolKV[CalculAuto]{Cadre}{%
+ \PfCFbox{CCalculAuto}{#1}
+ }{%
+ \ifboolKV[CalculAuto]{Fluo}{%
+ \Surligner[CCalculAuto]{#1}
+ }{%
+ \ifboolKV[CalculAuto]{Under}{%
+ \mathunderline{CCalculAuto}{#1}%
+ }{%
+ \ifboolKV[CalculAuto]{Evidence}{%
+ \mathcolor{CCalculAuto}{#1}%
+ }{%
+ #1%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+}%
+
+\NewDocumentCommand\CalculDetaille{om}{%
+ \useKVdefault[CalculAuto]%
+ \setKV[CalculAuto]{#1}%
+ \colorlet{CCalculAuto}{\useKV[CalculAuto]{Couleur}}%
+ \setcounter{PfCNbCalculs}{0}%
+ \setsepchar{§}\ignoreemptyitems%
+ \readlist*\ListeNombresCalculs{#2}%
+ \reademptyitems%
+ \xdef\PfCFooListeLettres{\useKV[CalculAuto]{Lettres}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeLettres{\PfCFooListeLettres}%
+ \reademptyitems%
+ \xdef\PfCNbMaxLignesCalculs{0}%
+ \foreachitem\compteur\in\ListeNombresCalculs{%
+ \stepcounter{PfCNbCalculs}%
+ \itemtomacro\ListeNombresCalculs[\compteurcnt]\Titi%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeNombresCalculsDetails{\Titi}%
+ \reademptyitems%
+ \expandafter\xdef\csname NbLignesCalculs\Alph{PfCNbCalculs}\endcsname{\ListeNombresCalculsDetailslen}%
+ \xdef\PfCNbMaxLignesCalculs{\fpeval{max(\PfCNbMaxLignesCalculs,\ListeNombresCalculsDetailslen)}}%
+ \setcounter{PfCNbSousCalculs}{0}%
+ \foreachitem\compteura\in\ListeNombresCalculsDetails{%
+ \stepcounter{PfCNbSousCalculs}%
+ \StrSubstitute{\compteura}{*}{\times}[\PfCCalculAutoUn]%
+ \StrSubstitute{\PfCCalculAutoUn}{:}{\div}[\PfCCalculAutoDeux]%
+ \StrCount{\PfCCalculAutoDeux}{<}[\NbInf]%
+ \ifnum\fpeval{\NbInf}=0\relax%
+ \expandafter\xdef\csname NbMarqueLigneCalcul\Alph{PfCNbCalculs}\Alph{PfCNbSousCalculs}\endcsname{1}%
+ \expandafter\xdef\csname LigneCalcul\Alph{PfCNbCalculs}\Alph{PfCNbSousCalculs}A\endcsname{\PfCCalculAutoDeux}%
+ \else%
+ \xdef\PfCExpressionDepart{\PfCCalculAutoDeux}%
+ \setcounter{PfCNbMarque}{0}%
+ \foreach\xx in{1,...,\NbInf}{%
+ \StrBefore{\PfCExpressionDepart}{<}[\PfCDevant]%
+ \StrBetween{\PfCExpressionDepart}{<}{>}[\PfCAEncadrer]%
+ \stepcounter{PfCNbMarque}%
+ \expandafter\xdef\csname LigneCalcul\Alph{PfCNbCalculs}\Alph{PfCNbSousCalculs}\Alph{PfCNbMarque}\endcsname{\PfCDevant}%
+ \stepcounter{PfCNbMarque}%
+ \expandafter\xdef\csname LigneCalcul\Alph{PfCNbCalculs}\Alph{PfCNbSousCalculs}\Alph{PfCNbMarque}\endcsname{<\PfCAEncadrer}%
+ \StrBehind{\PfCExpressionDepart}{>}[\PfCExpressionDepartA]%
+ \xdef\PfCExpressionDepart{\PfCExpressionDepartA}%
+ }%
+ \stepcounter{PfCNbMarque}%
+ \expandafter\xdef\csname LigneCalcul\Alph{PfCNbCalculs}\Alph{PfCNbSousCalculs}\Alph{PfCNbMarque}\endcsname{\PfCExpressionDepart}%
+ \expandafter\xdef\csname NbMarqueLigneCalcul\Alph{PfCNbCalculs}\Alph{PfCNbSousCalculs}\endcsname{\thePfCNbMarque}%
+ \fi
+ }%
+ }%
+ %%%%%%%%%
+ \setcounter{PfCNbSousCalculs}{0}%
+ \[%
+ \begin{aligned}
+ \xintFor* ##2 in{\xintSeq{1}{\PfCNbMaxLignesCalculs}}\do{%
+ \stepcounter{PfCNbSousCalculs}%
+ \setcounter{PfCNbCalculs}{0}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeNombresCalculslen}}\do{%
+ \stepcounter{PfCNbCalculs}%
+ \ifnum##2>\fpeval{\csname NbLignesCalculs\Alph{PfCNbCalculs}\endcsname}\relax%
+ \uppercase{&}
+ \else
+ \ListeLettres[\thePfCNbCalculs]\uppercase{&}=\xdef\Tata{\csname NbMarqueLigneCalcul\Alph{PfCNbCalculs}\Alph{PfCNbSousCalculs}\endcsname}\setcounter{PfCNbMarque}{0}\xintFor*##3 in{\xintSeq{1}{\Tata}}\do{%
+ \stepcounter{PfCNbMarque}
+ \xdef\Toto{\csname LigneCalcul\Alph{PfCNbCalculs}\Alph{PfCNbSousCalculs}\Alph{PfCNbMarque}\endcsname}\StrChar{\Toto}{1}[\PfCATester]
+ \IfStrEq{\PfCATester}{<}{\StrBehind{\Toto}{<}[\PfCAEncadrer]\PfCMarquePriorite{\PfCAEncadrer}}{\Toto}
+ }
+ \fi\xintifForLast{&}{}
+ }\\
+ }
+ \end{aligned}
+ \]
+}%
+
+\def\Underbrace#1{%
+ \ifx#1\bla\bla\else\color{CCalculAuto}\underbrace{{\color{black}#1}}\color{black}\fi%
+}%
+\def\Undercrochet#1{%
+ \ifx#1\bla\bla\else\color{CCalculAuto}\underbracket{{\color{black}#1}}\color{black}\fi%
+}%
+\def\Overbrace#1{%
+ \ifx#1\bla\bla\else\color{CCalculAuto}\overbrace{{\color{black}#1}}\color{black}\fi%
+}%
+\def\Overcrochet#1{%
+ \ifx#1\bla\bla\else\color{CCalculAuto}\overbracket{{\color{black}#1}}\color{black}\fi%
+}%
+\def\PfCFbox#1#2{%
+ \ifx#2\bla\bla\else\setlength{\fboxrule}{1pt}\fcolorbox{#1}{white}{$\displaystyle#2$}\fi%
+}%
+
+\NewDocumentCommand{\Surligner}{O{yellow}m}{%
+ \ifx#2\bla\bla\else
+ \ifmmode%
+ \colorbox{#1}{$\displaystyle#2$}%
+ \else%
+ \colorbox{#1}{#2}%
+ \fi%
+ \fi
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex b/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex
index fdf037ef81..cc19c93e54 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex
@@ -1,4 +1,11 @@
-\setKVdefault[CalculsFractions]{Couleurs=false,Negatif=false}%
+%%%
+% Calculs fractions
+%
+\def\filedateCalculsFractions{2024/08/04}%
+\def\fileversionCalculsFractions{0.1}%
+\message{-- \filedateCalculsFractions\space v\fileversionCalculsFractions}%
+%
+\setKVdefault[CalculsFractions]{Couleurs=false,Negatif=false,Seul=false}%
\defKV[CalculsFractions]{Couleur=\setKV[CalculsFractions]{Couleurs}\setKV[ClesSimplification]{Couleur=#1}}%
\NewDocumentCommand\tofrac{m}{%
@@ -50,7 +57,7 @@
\xdef\PfCNumD{1}%
}{%
\StrCut{#5}{/}\PfCNumC\PfCNumD%
- }
+ }%
\xdef\PfCAddFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListeFractions{\PfCAddFoo}%
@@ -69,6 +76,7 @@
\xdef\PfCAddDenoSimp{\fpeval{\PfCAddDenoFin/\PfCAddPgcd}}%
\xdef\PfCAddSumSimp{\PfCAddNumSimp/\PfCAddDenoSimp}%
\IfValueT{#6}{\xdef#6{\PfCAddSumSimp}}%
+ \ifboolKV[CalculsFractions]{Seul}{}{%
% Partie affichage
\ensuremath{%
\IfValueTF{#3}{%
@@ -103,6 +111,7 @@
}{\tofrac{#4}\PfCFractionOp\tofrac{#5}
}%
}%
+ }%
}%
\NewDocumentCommand\SousFraction{oommo}{%
@@ -127,17 +136,18 @@
\xdef\PfCMulFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListeFractions{\PfCMulFoo}%
- \reademptyitems
+ \reademptyitems%
\setsepchar{,}%
% Calculs
- \xdef\PfCMulNumFin{\fpeval{(\ListeFractions[1,1])*(\ListeFractions[2,1])}}
- \xdef\PfCMulDenoFin{\fpeval{\ListeFractions[1,2]*\ListeFractions[2,2]}}
+ \xdef\PfCMulNumFin{\fpeval{(\ListeFractions[1,1])*(\ListeFractions[2,1])}}%
+ \xdef\PfCMulDenoFin{\fpeval{\ListeFractions[1,2]*\ListeFractions[2,2]}}%
\PGCD{\fpeval{abs(\PfCMulNumFin)}}{\fpeval{abs(\PfCMulDenoFin)}}\xdef\PfCMulPgcd{\pgcd}%
\xdef\PfCMulNumSimp{\fpeval{\PfCMulNumFin/\PfCMulPgcd}}%
\xdef\PfCMulDenoSimp{\fpeval{\PfCMulDenoFin/\PfCMulPgcd}}%
\xdef\PfCMulPdtSimp{\PfCMulNumSimp/\PfCMulDenoSimp}%
\IfValueT{#5}{\xdef#5{\PfCMulPdtSimp}}%
- \ensuremath{%
+ \ifboolKV[CalculsFractions]{Seul}{}{%
+ \ensuremath{%
\IfValueTF{#2}{%
\ifnum#2=3\relax
\ifboolKV[CalculsFractions]{Negatif}{%
@@ -154,7 +164,8 @@
\fi
\fi
}{\tofrac{#3}\times\tofrac{#4}
- }
+ }%
+ }%
}%
}%
@@ -186,6 +197,7 @@
\xdef\PfCDivDenoSimp{\fpeval{\PfCDivDenoFin/\PfCDivPgcd}}%
\xdef\PfCDivPdtSimp{\PfCDivNumSimp/\PfCDivDenoSimp}%
\IfValueT{#5}{\xdef#5{\PfCDivPdtSimp}}%
+ \ifboolKV[CalculsFractions]{Seul}{}{%
\ensuremath{%
\IfValueTF{#2}{%
\ifnum#2=4\relax
@@ -207,4 +219,5 @@
}{\tofrac{#3}\div\tofrac{#4}
}
}%
+ }%
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCCalisson.tex b/macros/latex/contrib/profcollege/latex/PfCCalisson.tex
index 929b1fb28e..dd2fe56db3 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCalisson.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCalisson.tex
@@ -1,6 +1,10 @@
%%%
% Calisson
%%%
+\def\filedateCalisson{2024/08/04}%
+\def\fileversionCalisson{0.1}%
+\message{-- \filedateCalisson\space v\fileversionCalisson}%
+%
\setKVdefault[Calisson]{Taille=3,Solution=false,Rayon=5cm,Couleur=red,CouleurTrace=black}%
\def\UpdatetoksCalissong#1\nil{\addtotok\tokcalissonlistetracesg{,"#1"}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex b/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex
index 1e2075d91a..98bb4b8b3c 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex
@@ -1,6 +1,10 @@
%%%
% Cards
%%%
+\def\filedateCartesJeux{2024/08/04}%
+\def\fileversionCartesJeux{0.1}%
+\message{-- \filedateCartesJeux\space v\fileversionCartesJeux}%
+%
\setKVdefault[Cards]{Formats=false,Largeur=165,Hauteur=250,HauteurTheme=40,Marge=12,Landscape=false,Couleur=Cornsilk,CouleurAr=Cornsilk,Theme=Th\'eor\`eme\\de
Pythagore,ThemeSol=Solution,AfficheTheme=false,Trame=false,Jointes=false,TrameVisible=false,RayonArc=5pt,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,Eleve=false,BackgroundAv=false,BackgroundAr=false,%ImageAv=4813762.jpg,ImageAr=4813762.jpg,
AffichageSolution=true,SolutionSeule=false,%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCartesMentales.tex b/macros/latex/contrib/profcollege/latex/PfCCartesMentales.tex
index ea9b30af03..90812c7e9e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCartesMentales.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCartesMentales.tex
@@ -1,6 +1,10 @@
%%%
% Cartes Mentales
%%%
+\def\filedateCarteMentale{2024/08/04}%
+\def\fileversionCarteMentale{0.1}%
+\message{-- \filedateCarteMentale\space v\fileversionCarteMentale}%
+%
\setKVdefault[ClesMentales]{Nom={Bulle}, Largeur=5cm, Ancre={0,0},Pointilles=false,CTrace=black,CFond=white,Epaisseur=1pt,Rayon=1}%
\newenvironment{Mind}{\begin{tikzpicture}}{\end{tikzpicture}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCartographie.tex b/macros/latex/contrib/profcollege/latex/PfCCartographie.tex
index 2b5ef28fbc..4396dc6f87 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCartographie.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCartographie.tex
@@ -1,7 +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,VillesSupI=false,Capitales=false,Impression=false,Fleuves=false,CouleurFond=ciel,Largeur=12,Hauteur=12,Arborescence="/usr/local/texlive/2023/texmf-dist/metapost/profcollege/",Projection=false,TypeProjection="mercator",CouleurPays=Cornsilk,Pasl=2,PasL=2,Codes=false,Epaisseur=2,ModeleCouleur=5,Boussole=false,Allegee=1}
+\def\filedateCartographie{2024/08/04}%
+\def\fileversionCartographie{0.1}%
+\message{-- \filedateCartographie\space v\fileversionCartographie}%
+%
+\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/2024/texmf-dist/metapost/profcollege/",Projection=false,TypeProjection="mercator",CouleurPays=Cornsilk,Pasl=2,PasL=2,Codes=false,Epaisseur=2,ModeleCouleur=5,Boussole=false,Allegee=1,Maillage=false}
\defKV[Cartographie]{EchelleCarte=\setKV[Cartographie]{Carte}}
\defKV[Cartographie]{Pays=\setKV[Cartographie]{PaysSeul}}
\defKV[Cartographie]{Villes=\setKV[Cartographie]{VillesSup}}
@@ -13,8 +17,8 @@
\useKVdefault[Cartographie]%
\setKV[Cartographie]{#1}%
\mplibforcehmode%
+ \mplibnumbersystem{double}%
\ifboolKV[Cartographie]{Projection}{%
- \mplibnumbersystem{double}%
\begin{mplibcode}
input PfCMonde;
string arborescence;
@@ -217,9 +221,8 @@
Villes(\useKV[Cartographie]{VillesI});
fi;
\end{mplibcode}
- \mplibnumbersystem{scaled}%
}{%
-% \mplibforcehmode
+ % \mplibforcehmode
\begin{mplibcode}
input PfCMonde;
@@ -253,9 +256,11 @@
fi;
else:
couleurfond:=\useKV[Cartographie]{CouleurFond};
+ color couleurimpression;
+ couleurimpression:=Cornsilk;
if Impression:
noncolore:=true;
- payscolor:=0.85white;
+ payscolor:=couleurimpression;%0.85white
couleurfond:=white;
couleurfleuve:=couleurfond;
fi;
@@ -314,8 +319,7 @@
elseif t=8:lrt
fi
enddef;
-
-
+
if Carte:
Echelle:=\useKV[Cartographie]{AfficheEchelle};
figure(-0.5u*LargeurCadre,-0.5u*HauteurCadre,0.5u*LargeurCadre,0.5u*HauteurCadre);
@@ -365,11 +369,53 @@
fi;
else:
- draw(0,0)--(50,50);
- mappemonde(#2,#3);
+ boolean maillagecoord;
+ maillagecoord=\useKV[Cartographie]{Maillage};
+ if VillesSupI:
+ lacs:=false;
+ fi;
+
+ mappemonde(#2,#3);
+
+ vardef Villes(text t)=
+ pair CoordVille;
+ string NomVille;
+ n:=0;
+ for p_:=t:
+ n:=n+1;
+ if n=1:
+ %nblec:=p;
+ else:
+ if pair p_:
+ CoordVille:=Projgeo(rayon*(cosd(ypart(p_))*cosd(xpart(p_)),cosd(ypart(p_))*sind(xpart(p_)),sind(ypart(p_))));
+ elseif string p_:
+ NomVille:=p_;
+ else:
+ marque_p:="croix";
+ pointe(CoordVille);
+ label.position(p_)(TEX(""&NomVille&""),CoordVille);
+ fi;
+ fi;
+ endfor;
+ drawoptions();
+ enddef;
+
+
+ if Codes:
+ \useKV[Cartographie]{Traces};
+ fi;
+ if VillesSupI:
+ Villes(\useKV[Cartographie]{VillesI});
+ label.ulft(TEX("\tiny\ang{0}"),Projgeo(rayon*(1,0,0)));
+ label.ulft(TEX("\tiny\ang{10}"),Projgeo(rayon*(cosd(10),0,sind(10))));
+ fill (fullcircle scaled 0.75mm) shifted Projgeo(rayon*(cosd(10),0,sind(10)));
+ label.llft(TEX("\tiny\ang{10}"),Projgeo(rayon*(cosd(10),sind(10),0)));
+ fill (fullcircle scaled 0.75mm) shifted Projgeo(rayon*(cosd(10),sind(10),0));
+ fi;
fi;
\end{mplibcode}
}
+ \mplibnumbersystem{scaled}%
\else
\PackageWarning{ProfCollege}{"La commande Cartographie n'est compatible qu'avec LuaLaTeX."}
\fi
diff --git a/macros/latex/contrib/profcollege/latex/PfCCheque.tex b/macros/latex/contrib/profcollege/latex/PfCCheque.tex
new file mode 100644
index 0000000000..531af4efc1
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCCheque.tex
@@ -0,0 +1,125 @@
+%%%
+% PfCCheque
+%%%
+\def\filedateCheque{2024/09/03}%
+\def\fileversionCheque{0.1}%
+\message{-- \filedateCheque\space v\fileversionCheque}%
+\newlength{\oldbaseline}
+\newlength{\PfCTailleCursive}
+
+\setKVdefault[Cheque]{Sigle=CMF,Banque=Crédit Mathématique de France,Date=\today,Lieu={},Lire=false,Destinataire=Institut Curie,Solution=false,Longueur=15,Taille=\normalsize,Ajust=0pt}
+
+%https://tex.stackexchange.com/questions/406015/defining-macro-gsetlength-as-global-setlength-reliable
+\makeatletter
+\gdef\gsetlength#1#2{%
+ \begingroup
+ \setlength\skip@{#2}% Local assignment to a scratch register.
+ \global#1=\skip@ % Global assignement to #1;
+ % \relax is not necessary because of the following \endgroup.
+ \endgroup % \skip@ is restored by end of group.
+}
+\makeatother
+
+\NewDocumentCommand{\Cheque}{om}{%
+ \useKVdefault[Cheque]%
+ \setKV[Cheque]{#1}%
+ \setbox1=\hbox{\useKV[Cheque]{Taille}\myfontCursive abcdefghijklmnopqrstuvwxyz}%
+ {\useKV[Cheque]{Taille}\myfontCursive\gsetlength{\oldbaseline}{\baselineskip}\normalsize}%
+ \setlength{\PfCTailleCursive}{0.5\ht1+\useKV[Cheque]{Ajust}}%
+ \BuildCheque{#2}%
+}%
+
+\NewDocumentCommand{\BuildCheque}{m}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ boolean Solution,Lire;
+ Solution=\useKV[Cheque]{Solution};
+ Lire=\useKV[Cheque]{Lire};
+ Longueur=\useKV[Cheque]{Longueur};
+ baselinecp=\fpeval{\oldbaseline};
+ %
+ pair A,B,C,D,M[],N[];
+ A=(0,0);
+ B-A=u*(Longueur,0);
+ C-B=u*(0,5);
+ D-C=A-B;
+ %
+ M1=1/3[D,A];
+ %
+ picture Payez;
+ Payez=image(
+ label.rt(TEX("Payez contre ce chèque"),M1);
+ );
+ %
+ M20=(xpart(M1),ypart(llcorner Payez));
+ M2-M20=(0,-baselinecp);
+ M3-M2=u*(0,-0.5);
+ M4-M3=M2-M1;
+ M5-M4=u*(0.4*Longueur,-0.25);
+ M6-M4=u*(0,-0.25)+u*(0.5,0);
+ M7-M6=u*(2,0);
+ %
+ A:=(xpart(M4),ypart(M6)-1u);
+ B:=A+C-D;
+ %
+ N1=1/2[M1,M2]+0.8*(B-A);
+ N2-N1=M2-M1;
+ N3-N2=0.18*(B-A);
+ N4-N3=N1-N2;
+ drawoptions(withcolor NavyBlue);
+ picture BaseLettre;
+ %%%%%%%%%%%%%%%%
+ fill polygone(A,B,C,D) withcolor 0.8[LightSteelBlue,white];
+ trace polygone(A,B,C,D);
+ draw Payez;
+ label.rt(TEX("{\sffamily \Huge \useKV[Cheque]{Sigle}}"),D+u*(0,-0.5));
+ label.rt(TEX("{\sffamily \useKV[Cheque]{Banque}}"),D+u*(0,-1));
+ trace (lrcorner Payez)--(0.75[(xpart(M1),ypart(lrcorner Payez)),(xpart(M1+B-A),ypart(lrcorner Payez))]);
+ label.rt(TEX("\tiny non endossable sauf au profit d'une banque ou d'un établissement assimilé."),M1+u*(0,-0.300));
+ trace 1/90[M2,M2+B-A]--(0.75[M2,M2+B-A]);
+ label.rt(TEX("À \useKV[Cheque]{Destinataire}"),M3);
+ trace 1/45[M3+u*(0,-0.2),M3+u*(0,-0.2)+B-A]--(0.75[M3+u*(0,-0.2),M3+u*(0,-0.2)+B-A]);
+ fill polygone(N1,N2,N3,N4) withcolor white;
+ trace polygone(N1,N2,N3,N4) withpen pencircle scaled 1.2 withcolor NavyBlue;
+ if Lire=false:
+ label.rt(TEX("\si{\EuRo}~#1"),iso(N1,N2));
+ else:
+ if Solution:
+ label.rt(TEX("\si{\EuRo}~\num{#1}"),iso(N1,N2));
+ fi;
+ fi;
+ label.rt(TEX("À~\hbox to"&decimal(Longueur/5)&"cm{\hrulefill}\quad Le~\hbox to"&decimal(Longueur/5)&"cm{\hrulefill}"),M5);
+ label.top(TEX("\Huge \si{\EuRo}uro"),iso(N4,N1)+u*(0,1));
+ label(TEX("\tiny « à régler exclusivement en euros »"),iso(N4,N1)+u*(-0.5,1));
+ label(TEX("\ChoixAlea{100000}{999999}{\numcheque}\numcheque"),iso(M6,M7));
+ trace cotationmil(M6,M7,2.5mm,25,TEX("\scriptsize chèque \no"));
+ %%
+% drawoptions(withcolor red);
+% draw (llcorner Payez)--(llcorner Payez+B-A);
+% draw M2--(M2+B-A);
+% drawoptions();
+ picture Sous;
+ Sous=image(%
+ label(TEX("\begin{minipage}{\fpeval{0.75*"&decimal(Longueur)&"}cm}
+ \hspace{"&decimal(abs(lrcorner Payez-llcorner Payez))&"pt}\myfontCursive\useKV[Cheque]{Taille}\Ecriture{#1}~euros
+ \end{minipage}"),(0,0));
+ );
+ pair PointBase,PointTest,Decalage;
+ PointBase=1/2[M20,M2+(u*0.75Longueur,0)];
+ PointTest=(0,0);%
+ if abs(llcorner Sous-ulcorner Sous)>baselinecp:
+ Decalage=(8pt,\fpeval{\PfCTailleCursive});
+ else:
+ Decalage=(8pt,2*\fpeval{\PfCTailleCursive});
+ fi;
+ if Lire:
+ draw Sous shifted (PointBase-PointTest+Decalage);
+ else:
+ if Solution:
+ draw Sous shifted (PointBase-PointTest+Decalage);
+ fi;
+ fi;
+ \end{mplibcode}
+ \fi%
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCCible.tex b/macros/latex/contrib/profcollege/latex/PfCCible.tex
index d29fdccf9d..91e8f28e04 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCible.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCible.tex
@@ -1,6 +1,10 @@
%%%
% Cibles
%%%
+\def\filedateCible{2024/08/04}%
+\def\fileversionCible{0.1}%
+\message{-- \filedateCible\space v\fileversionCible}%
+%
\newtoks\toklisteciblea%
\def\UpdatetoksCibleA#1\nil{\addtotok\toklisteciblea{"#1",}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex b/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex
index 336b10651d..c33f5242b3 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex
@@ -1,3 +1,10 @@
+%%%
+% Cible 4 opérations
+%%%
+\def\filedateCibleQOp{2024/08/04}%
+\def\fileversionCibleQOp{0.1}%
+\message{-- \filedateCibleQOp\space v\fileversionCibleQOp}%
+
\newcount\anpcqo\newcount\bnpcqo\newcount\cnpcqo%
\NewDocumentCommand\PfCCQODiviseurs{m}{%#1 : le nombre entier \`a tester
diff --git a/macros/latex/contrib/profcollege/latex/PfCColorilude.tex b/macros/latex/contrib/profcollege/latex/PfCColorilude.tex
index 33a1ef2446..9c446f6b43 100644
--- a/macros/latex/contrib/profcollege/latex/PfCColorilude.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCColorilude.tex
@@ -1,4 +1,10 @@
-%%% Colorilude %%%
+%%%
+% Colorilude
+%%%
+\def\filedateColorilude{2024/08/04}%
+\def\fileversionColorilude{0.1}%
+\message{-- \filedateColorilude\space v\fileversionColorilude}%
+%
\setKVdefault[Colorilude]{Largeur=10,Lignes=10,Legende=false,Coef=0.6,Solution=false,CartonReponse=false,Resultats=false}
\newcommand\dispogpfc[3][]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCompteBon.tex b/macros/latex/contrib/profcollege/latex/PfCCompteBon.tex
index 1d5339b114..bbf219e431 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCompteBon.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCompteBon.tex
@@ -1,6 +1,10 @@
%%%
% Le compte est bon
%%%
+\def\filedateCompteBon{2024/08/04}%
+\def\fileversionCompteBon{0.1}%
+\message{-- \filedateCompteBon\space v\fileversionCompteBon}%
+%
\setKVdefault[CompteBon]{NombreCalculs=5,NombrePlaques=4,Solution=false,Relatifs=false,Original=false,Graines=false,Plaques=6,CDot=false}
\defKV[CompteBon]{Graine=\setKV[CompteBon]{Graines}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCConversion.tex b/macros/latex/contrib/profcollege/latex/PfCConversion.tex
index e6ed80f012..86da03a078 100644
--- a/macros/latex/contrib/profcollege/latex/PfCConversion.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCConversion.tex
@@ -1,3 +1,10 @@
+%%%
+% Conversion
+%%%
+\def\filedateConversion{2024/08/04}%
+\def\fileversionConversion{0.1}%
+\message{-- \filedateConversion\space v\fileversionConversion}%
+
\setKVdefault[ClesConversion]{Longueur,Aire=false,Vol=false,Masses=false,Capas=false,Sans=false,Completes=false}%
\defKV[ClesConversion]{Complete=\setKV[ClesConversion]{Completes}}%
\defKV[ClesConversion]{Masse=\setKV[ClesConversion]{Longueur=false}\setKV[ClesConversion]{Masses}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCritere.tex b/macros/latex/contrib/profcollege/latex/PfCCritere.tex
index 34c96a9b06..4818b941c7 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCritere.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCritere.tex
@@ -1,6 +1,10 @@
%%%
% Criteres de divisibilite
%%%
+\def\filedateCritere{2024/08/04}%
+\def\fileversionCritere{0.1}%
+\message{-- \filedateCritere\space v\fileversionCritere}%
+%
\setKVdefault[Critere]{Div=2,Remarque=false,All=false,RemarqueAll=false}
\NewDocumentCommand\Critere{om}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCryptarithme.tex b/macros/latex/contrib/profcollege/latex/PfCCryptarithme.tex
index bfa2e8c76a..1494c2adc6 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCryptarithme.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCryptarithme.tex
@@ -1,6 +1,10 @@
%%%
% Cryptarithmes
%%%
+\def\filedateCrypta{2024/08/04}%
+\def\fileversionCrypta{0.1}%
+\message{-- \filedateCrypta\space v\fileversionCrypta}%
+%
\setKVdefault[Crypta]{Solution=false,ListeLettres={A,B,C,D,E,F,G,H,I,J},Tableau=false}%
\defKV[Crypta]{Indices=\setKV[Crypta]{Tableau}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCDecDeci.tex b/macros/latex/contrib/profcollege/latex/PfCDecDeci.tex
index b2db7fd38b..861821ce82 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDecDeci.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDecDeci.tex
@@ -1,6 +1,10 @@
%%%
% Décomposition décimale
%%
+\def\filedateDecDeci{2024/08/04}%
+\def\fileversionDecDeci{0.1}%
+\message{-- \filedateDecDeci\space v\fileversionDecDeci}%
+%
\setKVdefault[DecompDeci]{Parentheses,Colore=false,CouleurU=Blue,CouleurD=Red,CouleurC=Green,Fleches=false,Details=false,ResultatSeul=false,SansMul=false}
\newcounter{PfCNbDecDeci}
diff --git a/macros/latex/contrib/profcollege/latex/PfCDecompFracDeci.tex b/macros/latex/contrib/profcollege/latex/PfCDecompFracDeci.tex
index b045c64f63..1e627c2e3f 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDecompFracDeci.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDecompFracDeci.tex
@@ -1,7 +1,12 @@
%%%
% D\'ecomposition de fractions d\'ecimales
%%%
-\setKVdefault[ClesFracDeci]{Complete=false,SansZero=false,Remediation=false,Longueur=1cm}
+\def\filedateDecompFracDeci{2024/08/13}%
+\def\fileversionDecompFracDeci{0.1a}%
+\message{-- \filedateDecompFracDeci\space v\fileversionDecompFracDeci}%
+%
+\setKVdefault[ClesFracDeci]{Complete=false,SansZero=false,Remediation=false,Longueur=1cm,Vides=false}%
+\defKV[ClesFracDeci]{Vide=\setKV[ClesFracDeci]{Remediation}\setKV[ClesFracDeci]{Vides}}%
\newlength{\PfCLongueurP}%
\newcommand\FractionDecimale[2][]{%
@@ -26,7 +31,7 @@
\xintifboolexpr{\PartieEntiereFractionDeci == 0}{}{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\PartieEntiereFractionDeci}}+}%
\xintFor* ##1 in {\xintSeq{1}{\LongueurPartieDecimale}}\do{%
\StrMid{\PartieDecimaleFractionDeci}{##1}{##1}[\ChiffrePartieDecimale]%
- \xintifForFirst{}{\xintifboolexpr{\ChiffrePartieDecimale == 0}{}{+}}\xintifboolexpr{\ChiffrePartieDecimale == 0}{}{\frac{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\ChiffrePartieDecimale}}}{\num{\fpeval{10**(\LongueurFracDeciDeno-1-\LongueurPartieDecimale+##1)}}}}%
+ \xintifForFirst{}{\xintifboolexpr{\ChiffrePartieDecimale == 0}{}{+}}\xintifboolexpr{\ChiffrePartieDecimale == 0}{}{\frac{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\ChiffrePartieDecimale}}}{\ifboolKV[ClesFracDeci]{Vides}{\pointilles[\PfCLongueurP]}{\num{\fpeval{10**(\LongueurFracDeciDeno-1-\LongueurPartieDecimale+##1)}}}}}%
}%
}%
}{%
@@ -38,20 +43,20 @@
\StrGobbleLeft{\FractionDeciNum}{\fpeval{\LongueurPartieEntiere}}[\DecompositionFracDeciComplete]%
% on affiche la partie décimale.
\xintFor* ##1 in {\xintSeq{1}{\fpeval{\LongueurFracDeciNum-\LongueurPartieEntiere}}}\do{%
- \xintifForFirst{}{+}\StrMid{\DecompositionFracDeciComplete}{##1}{##1}[\ChiffrePartieDecimale]\frac{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\ChiffrePartieDecimale}}}{\num{\fpeval{10**##1}}}%
+ \xintifForFirst{}{+}\StrMid{\DecompositionFracDeciComplete}{##1}{##1}[\ChiffrePartieDecimale]\frac{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\ChiffrePartieDecimale}}}{\ifboolKV[ClesFracDeci]{Vides}{\pointilles[\PfCLongueurP]}{\num{\fpeval{10**##1}}}}%
}%
}%
}{%
\ensuremath{%
\xintFor* ##1 in {\xintSeq{1}{\LongueurPartieDecimale}}\do{%
\StrMid{\PartieDecimaleFractionDeci}{##1}{##1}[\ChiffrePartieDecimale]%
- \xintifForFirst{}{+}\frac{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\ChiffrePartieDecimale}}}{\num{\fpeval{10**(\LongueurFracDeciDeno-1-\LongueurPartieDecimale+##1)}}}%
+ \xintifForFirst{}{+}\frac{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\ChiffrePartieDecimale}}}{\ifboolKV[ClesFracDeci]{Vides}{\pointilles[\PfCLongueurP]}{\num{\fpeval{10**(\LongueurFracDeciDeno-1-\LongueurPartieDecimale+##1)}}}}%
}%
}%
}%
}{%
\ensuremath{%
- \xintifboolexpr{\PartieEntiereFractionDeci == 0}{}{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\PartieEntiereFractionDeci}}+}\frac{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\PartieDecimaleFractionDeci}}}{\num{\FractionDeciDeno}}%
+ \xintifboolexpr{\PartieEntiereFractionDeci == 0}{}{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\PartieEntiereFractionDeci}}+}\frac{\ifboolKV[ClesFracDeci]{Remediation}{\pointilles[\PfCLongueurP]}{\num{\PartieDecimaleFractionDeci}}}{\ifboolKV[ClesFracDeci]{Vides}{\pointilles[\PfCLongueurP]}{\num{\FractionDeciDeno}}}%
}%
}%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex b/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex
index bf1a28e333..a741919482 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex
@@ -1,10 +1,19 @@
%%%
% Nombre Premier
%%%
-\setKVdefault[ClesNombrePremier]{Tableau=false,TableauVide=false,TableauVertical=false,TableauVerticalVide=false,Exposant=false,Longue=false,All=false,Arbre=false,ArbreVide=false,ArbreComplet=false,ArbreDessine=false,ArbreDessineVide=false,Entoure=false,Entourefin=false,Diviseurs=false,DiviseursT=false,Dot=\dotfill,Impose=false,ImposeAll=false,Potence=false,Decalage=10,Vide=false,CouleurFeuillage=ForestGreen,CouleurTronc=BurlyWood,CouleurFruits=Red,CouleurTexte=white}%
+\def\filedateDecompNbPremier{2024/09/01}%
+\def\fileversionDecompNbPremier{0.1a}%
+\message{-- \filedateDecompNbPremier\space v\fileversionDecompNbPremier}%
+%
+\setKVdefault[ClesNombrePremier]{Tableau=false,TableauVide=false,TableauVertical=false,TableauVerticalVide=false,Exposant=false,Longue=false,All=false,Arbre=false,ArbreVide=false,ArbreComplet=false,ArbreDessine=false,ArbreDessineVide=false,Entoure=false,Entourefin=false,Diviseurs=false,DiviseursT=false,Dot=\dotfill,Impose=false,ImposeAll=false,Potence=false,Decalage=10,Vide=false,CouleurFeuillage=ForestGreen,CouleurTronc=BurlyWood,CouleurFruits=Red,CouleurTexte=white,Poisson=false,Echelle=1cm,AngleArete=45,CouleurPoisson=white,Visible=false,Solution=false}%
\defKV[ClesNombrePremier]{Nombre=\ifboolKV[ClesNombrePremier]{ArbreDessine}{}{\ifboolKV[ClesNombrePremier]{ArbreDessineVide}{}{\setKV[ClesNombrePremier]{Impose}}}}%
\defKV[ClesNombrePremier]{AllNombre=\setKV[ClesNombrePremier]{ImposeAll}}%
-\defKV[ClesNombrePremier]{Impression=\setKV[ClesNombrePremier]{CouleurFeuillage=white,CouleurTronc=white,CouleurFruits=gris,CouleurTexte=black}}
+\defKV[ClesNombrePremier]{Impression=\setKV[ClesNombrePremier]{CouleurFeuillage=white,CouleurTronc=white,CouleurFruits=gris,CouleurTexte=black}}%
+\defKV[ClesNombrePremier]{ElementsVisibles=\setKV[ClesNombrePremier]{Visible}\setKV[ClesNombrePremier]{Vide}}%
+\defKV[ClesNombrePremier]{CouleurSolution=\setKV[ClesNombrePremier]{Solution}}%
+
+\newtoks\tokNPElementsVisibles%
+\def\UpdatetoksElementAfficher#1\nil{\addtotok\tokNPElementsVisibles{#1,}}%
\newcommand\Decomposition[2][]{%
\useKVdefault[ClesNombrePremier]%
@@ -26,6 +35,136 @@
\ifboolKV[ClesNombrePremier]{ArbreDessineVide}{\setKV[ClesNombrePremier]{Vide=true}\MPArbreDessine{#2}{\useKV[ClesNombrePremier]{Nombre}}}{}%
\ifboolKV[ClesNombrePremier]{Diviseurs}{\ListeDiviseur{#2}}{}%
\ifboolKV[ClesNombrePremier]{DiviseursT}{\ListeDiviseurT{#2}}{}%
+ \ifboolKV[ClesNombrePremier]{Poisson}{%
+ \tokNPElementsVisibles{}%
+ \PfCTousLesDiviseurs{#2}%
+ \ifboolKV[ClesNombrePremier]{Visible}{%
+ \xdef\foo{\useKV[ClesNombrePremier]{ElementsVisibles}}%
+ \readlist*\ListeElementsAAfficher{\foo}%
+ }{%
+ \xdef\foo{-1}\readlist*\ListeElementsAAfficher{\foo}%
+ }%
+ \foreachitem\compteur\in\ListeElementsAAfficher{\expandafter\UpdatetoksElementAfficher\compteur\nil}%
+ \MPFish{\PfCPileDiviseurs}{#2}{\the\tokNPElementsVisibles}%
+ }{}%
+}%
+
+\newcommand\PfCTousLesDiviseurs[1]{%
+ %#1 : le nombre entier \`a tester
+ \xdef\anpl{#1}%\relax%
+ \xdef\bnpl{2}%\relax%
+ \xdef\pilebl{2}%\relax%
+ \xdef\PfCPileDiviseurs{1}%
+ \loop
+ \ifnum\fpeval{\bnpl}<\fpeval{\anpl}\relax
+ \modulo{\fpeval{\anpl}}{\fpeval{\bnpl}}
+ \ifnum\remainder=0\relax
+ \xdef\PfCPileDiviseurs{\PfCPileDiviseurs,\fpeval{\bnpl}}%
+ \fi
+ \xdef\bnpl{\fpeval{\bnpl+1}}%
+ \repeat
+ \xdef\PfCPileDiviseurs{\PfCPileDiviseurs,#1}%
+}%%
+
+\def\MPFish#1#2#3{
+ \ifluatex
+ \mplibforcehmode%
+ \mplibnumbersystem{double}%
+ \begin{mplibcode}
+ Echelle=\useKV[ClesNombrePremier]{Echelle};
+ AngleArete=\useKV[ClesNombrePremier]{AngleArete};
+
+ boolean Vide,Visible,Solution;
+ Vide=\useKV[ClesNombrePremier]{Vide};
+ Visible=\useKV[ClesNombrePremier]{Visible};
+ Solution=\useKV[ClesNombrePremier]{Solution};
+
+ color CoulTete,CoulSol;
+ CoulTete=\useKV[ClesNombrePremier]{CouleurPoisson};
+ if Solution:
+ CoulSol=\useKV[ClesNombrePremier]{CouleurSolution};
+ fi;
+
+ numeric Diviseurs[];
+ vardef LectureDiviseurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Diviseurs[n]=p_;
+ endfor;
+ enddef;
+
+ LectureDiviseurs(#1);
+ TotalDiviseurs:=n;
+
+ boolean RETOUR;
+ RETOUR=false;
+
+ vardef TestVisible(expr nrt)=
+ RETOUR:=false;
+ for p_=#3:
+ if p_=nrt:
+ RETOUR:=true;
+ fi;
+ endfor;
+ enddef;
+
+
+ pair Ah[],Ab[],O[],Ac;
+ O0=(0,0);
+ O[-1]=O0+Echelle*(0,1);
+ O[-2]=O0+Echelle*(0,-1);
+ fill (arccercle(O[-1],O[-2],O0)--cycle) withcolor CoulTete;
+ trace arccercle(O[-1],O[-2],O0)--cycle;
+ label.lft(TEX("\num{"&decimal(#2)&"}"),O0);
+ %
+ for k=1 upto (TotalDiviseurs div 2):
+ if k=1:Echelle:=Echelle/2;fi;
+ O[k]-O[k-1]=Echelle*(1,0);
+ if k=1:Echelle:=Echelle*2;fi;
+ Ah[k]-O[k]=Echelle*(cosd(AngleArete),sind(AngleArete));
+ Ab[k]-O[k]=Echelle*(cosd(AngleArete),-sind(AngleArete));
+ draw O[k-1]--O[k];
+ draw Ah[k]--O[k]--Ab[k];
+ if Vide=false:
+ label.top(TEX("\num{"&decimal(Diviseurs[k])&"}"),Ah[k]);
+ label.bot(TEX("\num{"&decimal(Diviseurs[TotalDiviseurs+1-k])&"}"),Ab[k]);
+ else:
+ if Visible:
+ TestVisible(Diviseurs[k]);
+ if RETOUR:
+ label.top(TEX("\num{"&decimal(Diviseurs[k])&"}"),Ah[k]);
+ else:
+ if Solution:
+ drawoptions(withcolor CoulSol);
+ label.top(TEX("\num{"&decimal(Diviseurs[k])&"}"),Ah[k]);
+ drawoptions();
+ fi;
+ fi;
+ TestVisible(Diviseurs[TotalDiviseurs+1-k]);
+ if RETOUR:
+ label.bot(TEX("\num{"&decimal(Diviseurs[TotalDiviseurs+1-k])&"}"),Ab[k]);
+ else:
+ if Solution:
+ drawoptions(withcolor CoulSol);
+ label.bot(TEX("\num{"&decimal(Diviseurs[TotalDiviseurs+1-k])&"}"),Ab[k]);
+ drawoptions();
+ fi;
+ fi;
+ fi;
+ fi;
+ endfor;
+ if (TotalDiviseurs mod 2)<>0:
+ Ac-O[TotalDiviseurs div 2]=Echelle*(1,0);
+ draw Ac--O[TotalDiviseurs div 2];
+ if Vide=false:
+ label.rt(TEX("\num{"&decimal(Diviseurs[(TotalDiviseurs+1) div 2])&"}"),Ac);
+ fi;
+ fi;
+ \end{mplibcode}
+ \else
+ %
+ \fi
}%
\def\MPArbre#1{%
@@ -824,13 +963,13 @@
\begin{tabular}{c|c}%
1&\num{#1}\\
\xintFor* ##1 in {\xintSeq {1}{\fpeval{(\cnpT+1)/2}}}\do{%
- \DiviseurNumero{#1}{##1}\num{\fpeval{\dnpT}}\uppercase{&}\DiviseurNumero{#1}{##1}\xintifboolexpr{\dnpT=\fpeval{#1/\dnpT}}{}{\num{\fpeval{#1/\dnpT}}}\\
+ \DiviseurNumero{#1}{##1}\num{\fpeval{\dnpT}}\uppercase{&}\DiviseurNumero{#1}{##1}\xintifboolexpr{\dnpT==\fpeval{#1/\dnpT}}{\num{\fpeval{\dnpT}}}{\num{\fpeval{#1/\dnpT}}}\\
}
\end{tabular}%
\else%
\begin{tabular}{c|c}
1&\num{#1}
- \ifnum\cnpT>2\relax\\
+ \ifnum\cnpT>1\relax\\
\xintFor* ##1 in {\xintSeq {1}{\fpeval{\cnpT/2}}}\do{%
\DiviseurNumero{#1}{##1}\num{\fpeval{\dnpT}}\uppercase{&}\DiviseurNumero{#1}{##1}\num{\fpeval{#1/\dnpT}}\\
}
diff --git a/macros/latex/contrib/profcollege/latex/PfCDefiCalc.tex b/macros/latex/contrib/profcollege/latex/PfCDefiCalc.tex
index 6d850f8012..089b51658a 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDefiCalc.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDefiCalc.tex
@@ -1,6 +1,10 @@
%%%
% Defi Calculatrice
%%%
+\def\filedateDefiCalc{2024/08/04}%
+\def\fileversionDefiCalc{0.1}%
+\message{-- \filedateDefiCalc\space v\fileversionDefiCalc}%
+%
\setKVdefault[DefiCalculatrice]{NbCasesNoires=6,ListeTouches={!},Impression=false}%
\newtoks\toktexteecran{}
diff --git a/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex b/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex
index 340d598e2f..79ad1064eb 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex
@@ -1,7 +1,10 @@
%%%
% Defi Table
%%%
-
+\def\filedateDefiTables{2024/08/04}%
+\def\fileversionDefiTables{0.1}%
+\message{-- \filedateDefiTables\space v\fileversionDefiTables}%
+%
\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm,Graines=false,Creation=false,ValeurMin=1,ValeurMax=10,Restreint=false}
\defKV[DefiTable]{Graine=\setKV[DefiTable]{Graines}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCDessinAlgo.tex b/macros/latex/contrib/profcollege/latex/PfCDessinAlgo.tex
index 85274cac81..092aa5e825 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDessinAlgo.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDessinAlgo.tex
@@ -1,6 +1,10 @@
%%%
% Dessin Algo
%%%
+\def\filedateDessinAlgo{2024/08/04}%
+\def\fileversionDessinAlgo{0.1}%
+\message{-- \filedateDessinAlgo\space v\fileversionDessinAlgo}%
+%
\newtoks\tokDessinAlgo%
\def\UpdatetoksDA#1\nil{\addtotok\tokDessinAlgo{#1,}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCDessinGradue.tex b/macros/latex/contrib/profcollege/latex/PfCDessinGradue.tex
index 3bfacac68c..bd83bb6240 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDessinGradue.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDessinGradue.tex
@@ -1,6 +1,10 @@
%%%
% Dessin Gradue
%%%
+\def\filedateDessinGradue{2024/08/04}%
+\def\fileversionDessinGradue{0.1}%
+\message{-- \filedateDessinGradue\space v\fileversionDessinGradue}%
+%
\setKVdefault[DessinGradue]{Lignes=10,Debut=-5,Fin=5,Pas=10,Solution=false,EcartVertical=1.5,LignesIdentiques,Longueur=10,Echelle=1,Droites=false,DemiDroites=false,OrigineVariable=false,Code=false}
\defKV[DessinGradue]{Traces=\setKV[DessinGradue]{Code}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCDessinerRatio.tex b/macros/latex/contrib/profcollege/latex/PfCDessinerRatio.tex
index 27922bdd03..bbb24cb99c 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDessinerRatio.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDessinerRatio.tex
@@ -1,6 +1,10 @@
%%%
% Lien : ratio
%%%
+\def\filedateDessinRatio{2024/08/04}%
+\def\fileversionDessinRatio{0.1}%
+\message{-- \filedateDessinRatio\space v\fileversionDessinRatio}%
+%
\setKVdefault[ClesRatio]{FigureCours=false,Figure=false,Longueur=5cm,TexteTotal=quantit\'e,TextePart=part,Tableau=false,GrandeurA=Grandeur A,GrandeurB=Part(s),Largeur=1cm,Stretch=1,Nom=false,CouleurUn=gris,CouleurDeux=0.5gris+0.5blanc,CouleurTrois=white,CouleurTab=gray!15,ModeleCouleur=5}
\newcommand\MPTest[9][]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCDiagrammeRadar.tex b/macros/latex/contrib/profcollege/latex/PfCDiagrammeRadar.tex
index cbed30414d..70180f2a31 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDiagrammeRadar.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDiagrammeRadar.tex
@@ -1,6 +1,10 @@
%%%
% Radar
%%%
+\def\filedateRadar{2024/08/04}%
+\def\fileversionRadar{0.1}%
+\message{-- \filedateRadar\space v\fileversionRadar}%
+%
\setKVdefault[ClesRadar]{Rayon=3cm,Reference=20,MoyenneClasse=false,Disciplines=false,Pas=5}
\newtoks\toklisteradara%pour la moyenne de l'\'el\`eve
diff --git a/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex b/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex
index ad0dd8885d..b8a9dc57fc 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex
@@ -1,6 +1,9 @@
%%%
% Distributivit\'e
%%%
+\def\filedateDistributivite{2024/08/04}%
+\def\fileversionDistributivite{0.1}%
+\message{-- \filedateDistributivite\space v\fileversionDistributivite}%
% https://tex.stackexchange.com/questions/168972/draw-arrows-to-show-multiplication-pattern-distributive-property/169278?noredirect=1
\newcommand\Tikzmark[1]{%
\tikz[remember picture,baseline,inner sep=0pt]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCDobble.tex b/macros/latex/contrib/profcollege/latex/PfCDobble.tex
index 2767a20c50..c00592b393 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDobble.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDobble.tex
@@ -1,8 +1,10 @@
%%%
% dobble
%%%
+\def\filedateDobble{2024/08/04}%
+\def\fileversionDobble{0.1}%
+\message{-- \filedateDobble\space v\fileversionDobble}%
% by Maxime Chupin
-
\NewDocumentCommand\dobble{m}{%
\directlua{
require('PfCdobble.lua')
diff --git a/macros/latex/contrib/profcollege/latex/PfCDomino.tex b/macros/latex/contrib/profcollege/latex/PfCDomino.tex
index 49cf667c16..338dc07bb7 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDomino.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDomino.tex
@@ -1,6 +1,10 @@
%%%
% Domino
%%%
+\def\filedateDomino{2024/08/04}%
+\def\fileversionDomino{0.1}%
+\message{-- \filedateDomino\space v\fileversionDomino}%
+%
\newtcolorbox{MyDominoMini}[1][]{%
enhanced,
nobeforeafter,
diff --git a/macros/latex/contrib/profcollege/latex/PfCDontCountDots.tex b/macros/latex/contrib/profcollege/latex/PfCDontCountDots.tex
index e395500a3c..ea6761035e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDontCountDots.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDontCountDots.tex
@@ -1,3 +1,9 @@
+%%%
+% Ne compte pas
+%%%
+\def\filedateDontCount{2024/08/04}%
+\def\fileversionDontCount{0.1}%
+\message{-- \filedateDontCount\space v\fileversionDontCount}%
% 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}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex b/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex
index 6fc7a94593..372efa9784 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex
@@ -1,7 +1,11 @@
%%%
% QCM
%%%
-\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=60pt,Couleur=gray!15,Titre=false,Nom=R\'eponse,NomV=Vrai,NomF=Faux,Alph=false,AlphT=false,VF=false,Depart=1,Alterne=false,Noms={A/B/C},Multiple=false,Parties={Yeux,Nez,Bouche},CouleurAlt=gray!15,Seul=false}%
+\def\filedateQCM{2024/08/04}%
+\def\fileversionQCM{0.1}%
+\message{-- \filedateQCM\space v\fileversionQCM}%
+%
+\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=60pt,Couleur=gray!15,Titre=false,Nom=R\'eponse,NomV=Vrai,NomF=Faux,Alph=false,AlphT=false,VF=false,Depart=1,Alterne=false,Noms={A/B/C},Multiple=false,Parties={Yeux,Nez,Bouche},CouleurAlt=gray!15,Seul=false,ACompleter=false,AllSeul=false}%
\newlength{\LargeurQCM}%
\newlength{\PfCLargeurQCM}%
\newcounter{QuestionQCM}%
@@ -12,6 +16,8 @@
\setcounter{TotalQCMSeul}{0}%
\setcounter{TotalQCMSeulSol}{0}%
%
+\def\PfCTexteReponseEleve{Ma réponse}%
+%
\setKVdefault[QCMSeul]{Melange=false,Solution=false,EnColonne=false,LabelLettre=false}%
\defKV[QCMSeul]{Colonnes=\setKV[QCMSeul]{EnColonne}}%
%
@@ -32,6 +38,23 @@
\fi%
}%
+\NewDocumentCommand\PfCQCMSMultiChoixLabelSol{mm}{%
+ \xdef\PfCFooChoixLabel{\ListeQCM[#1,\fpeval{\NumeroReponse}]}%
+ \setsepchar{-}%
+ \readlist*\PfCSolListeReponses{\PfCFooChoixLabel}%
+ \xdef\RetiensSiSol{0}%
+ \xintFor* ##3 in{\xintSeq{1}{\PfCSolListeReponseslen}}\do{%
+ \ifnum#2=\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}%
@@ -90,150 +113,193 @@
%
\ifdef{\QCM}{%
\PackageWarning{ProfCollege}{La commande \noexpand\QCM étant définie par la classe du document, ProfCollege modifie sa commande \noexpand\QCM en \noexpand\QCMPfC.}%
- \newcommand\QCMPfC[2][]{%
- \useKVdefault[ClesQCM]%
- \setKV[ClesQCM]{#1}%
- \ifboolKV[ClesQCM]{Seul}{%
- \QCMSeul[#1]{#2}%
+\newcommand\QCMPfC[2][]{%
+ \useKVdefault[ClesQCM]%
+ \setKV[ClesQCM]{#1}%
+ \ifboolKV[ClesQCM]{Seul}{%
+ \QCMSeul[#1]{#2}%
+ }{%
+ \colorlet{PfCCouleurAlterneQCM}{\useKV[ClesQCM]{CouleurAlt}}%
+ \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
+ \setcounter{TitreQCM}{0}
+ \setsepchar[*]{,*&}\ignoreemptyitems%
+ \readlist*\ListeQCM{#2}%
+ \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
+ \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
+ \ifboolKV[ClesQCM]{Multiple}{%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\ListeNom{\useKV[ClesQCM]{Noms}}%
+ \setsepchar[*]{/}%
+ \readlist*\ListeNomsMul{\ListeNom}%
+ \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
+ \cline{2-\NBcases}%
+ \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ListeNomsMul[##2]}%
+ \\
+ \hline%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
+ }\\
+ }%
+ \hline%
+ \end{tabular}%
+ \renewcommand{\arraystretch}{1}%
}{%
- \colorlet{PfCCouleurAlterneQCM}{\useKV[ClesQCM]{CouleurAlt}}%
- \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
- \setcounter{TitreQCM}{0}
- \setsepchar[*]{,*&}\ignoreemptyitems%
- \readlist*\ListeQCM{#2}%
- \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
- \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
- \ifboolKV[ClesQCM]{Multiple}{%
- \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
- \xdef\ListeNom{\useKV[ClesQCM]{Noms}}%
- \setsepchar[*]{/}%
- \readlist*\ListeNomsMul{\ListeNom}%
+ \ifboolKV[ClesQCM]{VF}{%
+ \setKV[ClesQCM]{Reponses=2}%
+ \setlength{\PfCLargeurQCM}{\useKV[ClesQCM]{Largeur}}%
+ \setlength{\LargeurQCM}{\linewidth-6\tabcolsep-2\PfCLargeurQCM-4\arrayrulewidth}%
+ \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
\begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
\cline{2-\NBcases}%
- \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ListeNomsMul[##2]}%
- \\
+ \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{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
- }\\
+ &\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}%
- \renewcommand{\arraystretch}{1}%
+ \end{tabular}
}{%
- \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}
+ \ifboolKV[ClesQCM]{ACompleter}{%
+ \xdef\PfCTotalCases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
}{%
- \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}%
+ \xdef\PfCTotalCases{\useKV[ClesQCM]{Reponses}}%
}%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-2*\tabcolsep-\PfCTotalCases*(2*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}%
+ \begin{tabular}{|p{\LargeurQCM}|*{\PfCTotalCases}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
+ % \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}%
+ \ifboolKV[ClesQCM]{Titre}{\cline{2-\fpeval{\PfCTotalCases+1}}%
+ \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}\ifnum\fpeval{\PfCTotalCases-\useKV[ClesQCM]{Reponses}}>0\relax\uppercase{&}\PfCTexteReponseEleve\fi%
+ \\
+ }{}%
+ \hline%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,\fpeval{##2+1}]
+ }\ifnum\fpeval{\PfCTotalCases-\useKV[ClesQCM]{Reponses}}>0\relax\uppercase{&}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\fi\\
+ }%
+ \hline%
+ \end{tabular}%
}%
- \renewcommand{\arraystretch}{1}%
}%
+ \renewcommand{\arraystretch}{1}%
}%
+}%
}{%
- \newcommand\QCM[2][]{%
- \useKVdefault[ClesQCM]%
- \setKV[ClesQCM]{#1}%
- \ifboolKV[ClesQCM]{Seul}{%
- \QCMSeul[#1]{#2}%
+\newcommand\QCM[2][]{%
+ \useKVdefault[ClesQCM]%
+ \setKV[ClesQCM]{#1}%
+ \ifboolKV[ClesQCM]{AllSeul}{%
+ \setKV[QCMSeul]{#1}
+ \setsepchar[*]{,*&}\ignoreemptyitems%
+ \readlist*\ListeQCM{#2}%
+ \reademptyitems%
+ \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
+ \xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}%
+ \begin{enumerate}
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \item\ListeQCM[##1,1]%
+ \ifboolKV[QCMSeul]{EnColonne}{\begin{multicols}{\useKV[QCMSeul]{Colonnes}}}{}%
+ \ifboolKV[QCMSeul]{LabelLettre}{
+ \begin{enumerate}[label=\Alph{*}/]
+ }{%
+ \begin{enumerate}[label=$\square$]
+ }%
+ \xintFor* ##2 in{\xintSeq{1}{\fpeval{\NumeroReponse-2}}}\do{%
+ \xdef\Titi{##2}
+ \ifboolKV[QCMSeul]{Solution}{%
+ \item[\PfCQCMSMultiChoixLabelSol{##1}{##2}]%
+ }{%
+ \item%
+ }%
+ \ListeQCM[##1,\fpeval{##2+1}]
+ }%
+ \end{enumerate}
+ \ifboolKV[QCMSeul]{EnColonne}{\end{multicols}}{}%
+ }%
+ \end{enumerate}
+ }{%
+ \ifboolKV[ClesQCM]{Seul}{%
+ \QCMSeul[#1]{#2}%
+ }{%
+ \colorlet{PfCCouleurAlterneQCM}{\useKV[ClesQCM]{CouleurAlt}}%
+ \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
+ \setcounter{TitreQCM}{0}
+ \setsepchar[*]{,*&}\ignoreemptyitems%
+ \readlist*\ListeQCM{#2}%
+ \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
+ \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
+ \ifboolKV[ClesQCM]{Multiple}{%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\ListeNom{\useKV[ClesQCM]{Noms}}%
+ \setsepchar[*]{/}%
+ \readlist*\ListeNomsMul{\ListeNom}%
+ \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
+ \cline{2-\NBcases}%
+ \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ListeNomsMul[##2]}%
+ \\
+ \hline%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
+ }\\
+ }%
+ \hline%
+ \end{tabular}%
+ \renewcommand{\arraystretch}{1}%
}{%
- \colorlet{PfCCouleurAlterneQCM}{\useKV[ClesQCM]{CouleurAlt}}%
- \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
- \setcounter{TitreQCM}{0}
- \setsepchar[*]{,*&}\ignoreemptyitems%
- \readlist*\ListeQCM{#2}%
- \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
- \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
- \ifboolKV[ClesQCM]{Multiple}{%
- \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
- \xdef\ListeNom{\useKV[ClesQCM]{Noms}}%
- \setsepchar[*]{/}%
- \readlist*\ListeNomsMul{\ListeNom}%
+ \ifboolKV[ClesQCM]{VF}{%
+ \setKV[ClesQCM]{Reponses=2}%
+ \setlength{\PfCLargeurQCM}{\useKV[ClesQCM]{Largeur}}%
+ \setlength{\LargeurQCM}{\linewidth-6\tabcolsep-2\PfCLargeurQCM-4\arrayrulewidth}%
+ \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
\begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
\cline{2-\NBcases}%
- \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ListeNomsMul[##2]}%
- \\
+ \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{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
- }\\
+ &\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}%
- \renewcommand{\arraystretch}{1}%
+ \end{tabular}
}{%
- \ifboolKV[ClesQCM]{VF}{%
- \setKV[ClesQCM]{Reponses=2}%
- \setlength{\PfCLargeurQCM}{\useKV[ClesQCM]{Largeur}}%
- \setlength{\LargeurQCM}{\linewidth-6\tabcolsep-2\PfCLargeurQCM-4\arrayrulewidth}%
- \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
- \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
- \cline{2-\NBcases}%
- \multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\
- \hline%
- \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
- \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
- }\\
- }%
- \hline%
- \end{tabular}
+ \ifboolKV[ClesQCM]{ACompleter}{%
+ \xdef\PfCTotalCases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
}{%
- \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}%
+ \xdef\PfCTotalCases{\useKV[ClesQCM]{Reponses}}%
}%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-2*\tabcolsep-\PfCTotalCases*(2*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}%
+ \begin{tabular}{|p{\LargeurQCM}|*{\PfCTotalCases}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
+ % \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}%
+ \ifboolKV[ClesQCM]{Titre}{\cline{2-\fpeval{\PfCTotalCases+1}}%
+ \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}\ifnum\fpeval{\PfCTotalCases-\useKV[ClesQCM]{Reponses}}>0\relax\uppercase{&}\PfCTexteReponseEleve\fi%
+ \\
+ }{}%
+ \hline%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,\fpeval{##2+1}]
+ }\ifnum\fpeval{\PfCTotalCases-\useKV[ClesQCM]{Reponses}}>0\relax\uppercase{&}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\fi\\
+ }%
+ \hline%
+ \end{tabular}%
}%
- \renewcommand{\arraystretch}{1}%
}%
+ \renewcommand{\arraystretch}{1}%
}%
}%
+}%
+}%
\NewDocumentCommand\PfCSolCellColor{mm}{%
\xdef\PfCFooSolColor{\ListeQCM[#1,\NumeroReponse]}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCEcritureLettres.tex b/macros/latex/contrib/profcollege/latex/PfCEcritureLettres.tex
index 11ae58b5b7..f80bc93866 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEcritureLettres.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEcritureLettres.tex
@@ -1,6 +1,10 @@
%%%
% Ecriture des nombres en lettres
%%%
+\def\filedateEcrireLettres{2024/08/04}%
+\def\fileversionEcrireLettres{0.1}%
+\message{-- \filedateEcrireLettres\space v\fileversionEcrireLettres}%
+%
\setKVdefault[ClesEcriture]{Math=false,Majuscule=false,E=false,Tradition=false,Zero=false}%
\newcommand\EcriturePluriel[1]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCEcritureUnites.tex b/macros/latex/contrib/profcollege/latex/PfCEcritureUnites.tex
index c4503954b3..05e593623c 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEcritureUnites.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEcritureUnites.tex
@@ -1,6 +1,10 @@
%%%
% Ecritures d'unit\'es
%%%
+\def\filedateEcrireUnites{2024/08/04}%
+\def\fileversionEcrireUnites{0.1}%
+\message{-- \filedateEcrireUnites\space v\fileversionEcrireUnites}%
+%
\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}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCEngrenagesBase.tex b/macros/latex/contrib/profcollege/latex/PfCEngrenagesBase.tex
index df5743e439..58553f57f8 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEngrenagesBase.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEngrenagesBase.tex
@@ -1,22 +1,26 @@
%%%
% Engrenages
%%%
+\def\filedateEngrenages{2024/08/04}%
+\def\fileversionEngrenages{0.1}%
+\message{-- \filedateEngrenages\space v\fileversionEngrenages}%
+%
\newtoks\tokPfCEngrenages%
\def\UpdatetoksEngrenages#1/#2\nil{\addtotok\tokPfCEngrenages{#1,#2,}}%
-\setKVdefault[Engrenages]{Couleur=LightSteelBlue,Unite=3mm,ListeCouleurs={LightSteelBlue}}
+\setKVdefault[Engrenages]{Couleur=LightSteelBlue,Unite=3mm,ListeCouleurs={?}}%
\NewDocumentCommand\Engrenages{o m}{%
\newtoks\toklistecouleur%
\toklistecouleur{}%
- \tokPfCEngrenages{}
+ \tokPfCEngrenages{}%
\useKVdefault[Engrenages]%
\setKV[Engrenages]{#1}%
\setsepchar[*]{,*/}%
\ignoreemptyitems
\readlist*\ListePfCEngrenages{#2}%
- \setsepchar{,}
- \xdef\PfCFooEngrenages{}
+ \setsepchar{,}%
+ \xdef\PfCFooEngrenages{}%
\foreachitem\compteur\in\ListePfCEngrenages{%
\xdef\PfCFooEngrenages{\PfCFooEngrenages \ListePfCEngrenages[\compteurcnt,1],\ListePfCEngrenages[\compteurcnt,2],}%
}%
@@ -102,19 +106,19 @@
fi;
endfor;
);
-}
+}%
\NewDocumentCommand\BuildEngrenages{mm}{%
- \ifluatex
- \mplibforcehmode
- \begin{mplibcode}
+ \ifluatex%
+ \mplibforcehmode%
+ \begin{mplibcode}%
input PfCEngrenages;
\BuildEngrenagesCode{#1}{#2}
trace EngrenageFinal;
- \end{mplibcode}
- \else
+ \end{mplibcode}%
+ \else%
\begin{mpost}[mpsettings={input PfCEngrenages;\BuildEngrenagesCode{#1}{#2}}]
trace EngrenageFinal;
- \end{mpost}
- \fi
+ \end{mpost}%
+ \fi%
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCEnigmeAire.tex b/macros/latex/contrib/profcollege/latex/PfCEnigmeAire.tex
index 345f741656..1840d8b0e3 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEnigmeAire.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEnigmeAire.tex
@@ -1,6 +1,10 @@
%%%
% Enigme Aire
%%%
+\def\filedateEnigmeAire{2024/08/04}%
+\def\fileversionEnigmeAire{0.1}%
+\message{-- \filedateEnigmeAire\space v\fileversionEnigmeAire}%
+%
\setKVdefault[EnigmeAire]{Modele=A,Couleur=LightSteelBlue,Echelle=7mm,Etape=1,Solution=false,Graines=false}
\defKV[EnigmeAire]{Graine=\setKV[EnigmeAire]{Graines}}
diff --git a/macros/latex/contrib/profcollege/latex/PfCEnquete.tex b/macros/latex/contrib/profcollege/latex/PfCEnquete.tex
index 678b268c57..5dfc36587c 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEnquete.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEnquete.tex
@@ -1,6 +1,10 @@
%%%
% Enquête
%%%
+\def\filedateEnquete{2024/08/04}%
+\def\fileversionEnquete{0.1}%
+\message{-- \filedateEnquete\space v\fileversionEnquete}%
+%
\setKVdefault[ClesEnquete]{Perso=Qui ?,Objet=Quoi ?,Lieu=Où ?,Largeur=4.5cm}
\newcommand\Enquete[1][]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCEratosthene.tex b/macros/latex/contrib/profcollege/latex/PfCEratosthene.tex
index 192e470e66..5374c485d2 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEratosthene.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEratosthene.tex
@@ -1,3 +1,10 @@
+%%%
+% Crible Eratostene
+%%%
+\def\filedateEratos{2024/08/04}%
+\def\fileversionEratos{0.1}%
+\message{-- \filedateEratos\space v\fileversionEratos}%
+%
\setKVdefault[ClesEra]{Premier=false,Nombre=1,CouleurP=Cornsilk!50,CouleurNP=Crimson!15,Colonnes=10,Lignes=10,Hauteur=24pt}%
\NewDocumentCommand\TestPremier{m}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCFactorisation.tex b/macros/latex/contrib/profcollege/latex/PfCFactorisation.tex
index 823f203623..bdcea30d9d 100644
--- a/macros/latex/contrib/profcollege/latex/PfCFactorisation.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCFactorisation.tex
@@ -1,3 +1,10 @@
+%%%
+% Factorisation
+%%%
+\def\filedateFactorisation{2024/08/04}%
+\def\fileversionFactorisation{0.1}%
+\message{-- \filedateFactorisation\space v\fileversionFactorisation}%
+%
\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}}
diff --git a/macros/latex/contrib/profcollege/latex/PfCFicheMemo.tex b/macros/latex/contrib/profcollege/latex/PfCFicheMemo.tex
index 511e47da2f..e2dfc25f13 100644
--- a/macros/latex/contrib/profcollege/latex/PfCFicheMemo.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCFicheMemo.tex
@@ -1,6 +1,10 @@
%%%
% Fiche m\'emorisation active
%%%
+\def\filedateFicheMemo{2024/08/04}%
+\def\fileversionFicheMemo{0.1}%
+\message{-- \filedateFicheMemo\space v\fileversionFicheMemo}%
+%
\setKVdefault[ClesFicheMemo]{TexteReponses=Réponses,TexteQuestions=Questions,Solution=false,Largeur=\linewidth}
\newcommand\FicheMemo[3][]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCFonctionAffine.tex b/macros/latex/contrib/profcollege/latex/PfCFonctionAffine.tex
index 77c683b148..26777eaac0 100644
--- a/macros/latex/contrib/profcollege/latex/PfCFonctionAffine.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCFonctionAffine.tex
@@ -1,6 +1,10 @@
%%%
% Fonction Affine
%%%
+\def\filedateAffine{2024/08/04}%
+\def\fileversionAffine{0.1}%
+\message{-- \filedateAffine\space v\fileversionAffine}%
+%
\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][]{%
@@ -58,24 +62,30 @@
}%
}{%
\ifboolKV[ClesAffine]{Retrouve}{%
- On sait que $\useKV[ClesAffine]{Nom}$ est une fonction affine. Donc elle s'\'ecrit sous la forme : \[\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\useKV[ClesAffine]{CoefDir}\useKV[ClesAffine]{Variable}+\useKV[ClesAffine]{OrdoOrig}\]
- Or, $\useKV[ClesAffine]{Nom}(\num{#2})=\num{#3}$ et $\useKV[ClesAffine]{Nom}(\num{#4})=\num{#5}$. Par cons\'equent, d'apr\`es la propri\'et\'e des accroissements :
+ \xdef\OrdOrigine{\fpeval{#3-(#3-#5)*#2/(#2-#4)}}%%
+ On sait que $\useKV[ClesAffine]{Nom}$ est une fonction affine. Donc elle s'\'ecrit sous la forme : \[\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\useKV[ClesAffine]{CoefDir}\useKV[ClesAffine]{Variable}+\useKV[ClesAffine]{OrdoOrig}.\]
+ Or, $\useKV[ClesAffine]{Nom}(\num{#2})=\num{#3}$ et $\useKV[ClesAffine]{Nom}(\num{#4})=\num{#5}$. \ifnum\fpeval{#3-#5}=0
+ Les images de \num{#2} et \num{#4} sont égales à \num{#3}. La fonction affine cherchée est donc constante et s'écrit :
+ \[\useKV[ClesAffine]{Nom}:\useKV[ClesAffine]{Variable}\mapsto\num{\OrdOrigine}.\]
+ \else
+ Par cons\'equent, d'apr\`es la propri\'et\'e des accroissements :
\begin{align*}
\useKV[ClesAffine]{CoefDir}&=\frac{\useKV[ClesAffine]{Nom}(\num{#2})-\useKV[ClesAffine]{Nom}(\num{#4})}{\num{#2}-\xintifboolexpr{#4<0}{(\num{#4})}{\num{#4}}}\\
\useKV[ClesAffine]{CoefDir}&=\frac{\num{#3}-\xintifboolexpr{#5<0}{(\num{#5})}{\num{#5}}}{\num{\fpeval{#2-#4}}}\\
\useKV[ClesAffine]{CoefDir}&=\frac{\num{\fpeval{#3-#5}}}{\num{\fpeval{#2-#4}}}%\\
\SSimpliTest{\fpeval{#3-#5}}{\fpeval{#2-#4}}\ifthenelse{\boolean{Simplification}}{\\\useKV[ClesAffine]{CoefDir}&=\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}}{}%
\end{align*}
- La fonction $\useKV[ClesAffine]{Nom}$ s'\'ecrit alors sous la forme $\displaystyle\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\useKV[ClesAffine]{Variable}+\useKV[ClesAffine]{OrdoOrig}$.
+ \def\PfCQuotientAffine{\fpeval{(#3-#5)/(#2-#4)}}%
+ La fonction $\useKV[ClesAffine]{Nom}$ s'\'ecrit alors sous la forme $\displaystyle\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\ifnum\fpeval{abs(\PfCQuotientAffine)}=1\relax\Affichage[Lettre={\useKV[ClesAffine]{Variable}}]{0}{\PfCQuotientAffine}{0}\else\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\useKV[ClesAffine]{Variable}\fi+\useKV[ClesAffine]{OrdoOrig}$.
\\De plus, comme $\useKV[ClesAffine]{Nom}(\num{#2})=\num{#3}$, alors :
\begin{align*}
- \SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\times\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}+\useKV[ClesAffine]{OrdoOrig}&=\num{#3}\\
+ \ifnum\PfCQuotientAffine=1\relax\else\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\times\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}+\useKV[ClesAffine]{OrdoOrig}\uppercase{&}=\num{#3}\\\fi
\SSimplifie{\fpeval{(#3-#5)*#2}}{\fpeval{#2-#4}}+\useKV[ClesAffine]{OrdoOrig}&=\num{#3}\\
\useKV[ClesAffine]{OrdoOrig}&=\num{\fpeval{#3-(#3-#5)*#2/(#2-#4)}}
\end{align*}
- \xdef\OrdOrigine{\fpeval{#3-(#3-#5)*#2/(#2-#4)}}
La fonction affine $\useKV[ClesAffine]{Nom}$ cherch\'ee est :
- \[\useKV[ClesAffine]{Nom}:\useKV[ClesAffine]{Variable}\mapsto\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\useKV[ClesAffine]{Variable}\xintifboolexpr{\OrdOrigine==0}{}{\xintifboolexpr{\OrdOrigine>0}{+\num{\OrdOrigine}}{-\num{\fpeval{0-\OrdOrigine}}}}\]
+ \[\useKV[ClesAffine]{Nom}:\useKV[ClesAffine]{Variable}\mapsto\ifnum\fpeval{abs(\PfCQuotientAffine)}=1\relax\Affichage[Lettre={\useKV[ClesAffine]{Variable}}]{0}{\PfCQuotientAffine}{\OrdOrigine}\else\SSimplifie{\fpeval{#3-#5}}{\fpeval{#2-#4}}\useKV[ClesAffine]{Variable}\xintifboolexpr{\OrdOrigine==0}{}{\xintifboolexpr{\OrdOrigine>0}{+\num{\OrdOrigine}}{-\num{\fpeval{0-\OrdOrigine}}}}\fi.\]
+ \fi
}{%
%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCFractionAireCarre.tex b/macros/latex/contrib/profcollege/latex/PfCFractionAireCarre.tex
index dbfe8109d2..8fe1993016 100644
--- a/macros/latex/contrib/profcollege/latex/PfCFractionAireCarre.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCFractionAireCarre.tex
@@ -1,6 +1,10 @@
%%%
% Fraction d'aire d'un carré
%%%
+\def\filedateFractionCarre{2024/08/04}%
+\def\fileversionFractionCarre{0.1}%
+\message{-- \filedateFractionCarre\space v\fileversionFractionCarre}%
+%
\setKVdefault[JeuAireCarre]{Couleur=LightSteelBlue,CouleurFond=Cornsilk,Perso=false,Graines=false,Parts=3,Longueur=4,NbPoints=2,Angle=0}%
\defKV[JeuAireCarre]{Graine=\setKV[JeuAireCarre]{Graines}\PfCGraineAlea{#1}}%
\defKV[JeuAireCarre]{ListeParts=\setKV[JeuAireCarre]{Perso}\xdef\PfCFooJeuAireCarre{#1}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCFractionNombre.tex b/macros/latex/contrib/profcollege/latex/PfCFractionNombre.tex
index 52512fb83e..20d1d1e93a 100644
--- a/macros/latex/contrib/profcollege/latex/PfCFractionNombre.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCFractionNombre.tex
@@ -1,6 +1,10 @@
%%%
% Fraction Nombre
%%%
+\def\filedateFractionNombre{2024/08/04}%
+\def\fileversionFractionNombre{0.1}%
+\message{-- \filedateFractionNombre\space v\fileversionFractionNombre}%
+%
\newtoks\tokFractionNombrePerso%
\def\UpdatetoksFN#1\nil{\addtotok\tokFractionNombrePerso{"#1",}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCFrise.tex b/macros/latex/contrib/profcollege/latex/PfCFrise.tex
index a07d2a931b..c56b2c6f4f 100644
--- a/macros/latex/contrib/profcollege/latex/PfCFrise.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCFrise.tex
@@ -1,6 +1,10 @@
%%%
% Frise temporelle
%%%
+\def\filedateFrise{2024/08/04}%
+\def\fileversionFrise{0.1}%
+\message{-- \filedateFrise\space v\fileversionFrise}%
+%
\setKVdefault[ClesFrise]{Longueur=8cm,Fleches=false,Ecart=5mm,Sup=false}%
\newtoks\toklistefrise%
diff --git a/macros/latex/contrib/profcollege/latex/PfCFubuki.tex b/macros/latex/contrib/profcollege/latex/PfCFubuki.tex
index 0ce7af2ffa..fd1f973bfd 100644
--- a/macros/latex/contrib/profcollege/latex/PfCFubuki.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCFubuki.tex
@@ -1,3 +1,10 @@
+%%%
+% Fubuki
+%%%
+\def\filedateFubuki{2024/08/04}%
+\def\fileversionFubuki{0.1}%
+\message{-- \filedateFubuki\space v\fileversionFubuki}%
+%
\setKVdefault[Fubuki]{Largeur=20pt,Solution=false,Indice=false,Sommes=false,Couleur=LightSteelBlue,Perso=false,Vierge=false}%
\defKV[Fubuki]{Graine=\PfCGraineAlea{#1}}%
\defKV[Fubuki]{Indices=\setKV[Fubuki]{Indice}\xdef\PfCFooListeIndices{#1}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCFutoshiki.tex b/macros/latex/contrib/profcollege/latex/PfCFutoshiki.tex
index 4603265e0e..300bdd43d0 100644
--- a/macros/latex/contrib/profcollege/latex/PfCFutoshiki.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCFutoshiki.tex
@@ -1,6 +1,10 @@
%%%
% Futoshiki
%%%
+\def\filedateFutoshiki{2024/08/04}%
+\def\fileversionFutoshiki{0.1}%
+\message{-- \filedateFutoshiki\space v\fileversionFutoshiki}%
+%
\setKVdefault[Futo]{Largeur=15pt,Solution=false,CouleurSolution=Black,CouleurCase=Cornsilk,StyleTexte={}}
\newlength\PfCFutoHeight
diff --git a/macros/latex/contrib/profcollege/latex/PfCGaram.tex b/macros/latex/contrib/profcollege/latex/PfCGaram.tex
index 7e04378a93..fd5a97439c 100644
--- a/macros/latex/contrib/profcollege/latex/PfCGaram.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCGaram.tex
@@ -1,17 +1,21 @@
%%%
% Garam
%%%
-\setKVdefault[Garam]{Taille=7,Largeur=15pt,Solution=false,CouleurSolution=Black}
+\def\filedateGaram{2024/08/04}%
+\def\fileversionGaram{0.1}%
+\message{-- \filedateGaram\space v\fileversionGaram}%
+%
+\setKVdefault[Garam]{Taille=7,Largeur=15pt,Solution=false}%
+\defKV[Garam]{CouleurSolution=\setKV[Garam]{Solution}\colorlet{PfCGaramCoulSol}{#1}}%
\newlength\PfCGaramHeight
\NewDocumentCommand\Garam{o m}{%
- \useKVdefault[Garam]
+ \useKVdefault[Garam]%
\setKV[Garam]{#1}%
\setlength{\PfCGaramHeight}{\useKV[Garam]{Largeur}+\tabcolsep}%
\reademptyitems%
\setsepchar[*]{§*,*/}%
\readlist*\PfCListeGaram{#2}%
- \colorlet{PfCGaramCoulSol}{\useKV[Garam]{CouleurSolution}}%
\begin{NiceTabular}{*{\useKV[Garam]{Taille}}{m{\useKV[Garam]{Largeur}}}}
\CodeBefore
\xintFor* ##1 in{\xintSeq{2}{\fpeval{\useKV[Garam]{Taille}}}}\do{%
@@ -26,7 +30,7 @@
\rule{0pt}{\PfCGaramHeight}\xintFor* ##2 in {\xintSeq{1}{\useKV[Garam]{Taille}}}\do{%
\xintifForFirst{}{&}\StrChar{\PfCListeGaram[##1,##2,1]}{1}[\PfCCaracGaram]%
\IfStrEq{\PfCCaracGaram}{*}{\Block[draw,fill=black]{1-1}{}}{%
- \IfStrEq{\PfCCaracGaram}{!}{\Block{}{\ifboolKV[Garam]{Solution}{\StrGobbleLeft{\PfCListeGaram[##1,##2,1]}{1}}{}}}{\Block{}{\color{PfCGaramCoulSol}\PfCListeGaram[##1,##2,1]}}%
+ \IfStrEq{\PfCCaracGaram}{!}{\Block{}{\ifboolKV[Garam]{Solution}{\color{PfCGaramCoulSol}\StrGobbleLeft{\PfCListeGaram[##1,##2,1]}{1}}{}}}{\Block{}{\PfCListeGaram[##1,##2,1]}}%
}%
}\\
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex b/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex
index ad7e495f04..9bb83ad50d 100644
--- a/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex
@@ -1,6 +1,10 @@
%%%
% Geometrie
%%%
+\def\filedateGeometrie{2024/08/04}%
+\def\fileversionGeometrie{0.1}%
+\message{-- \filedateGeometrie\space v\fileversionGeometrie}%
+%
\setKVdefault[Geometrie]{CoinBG={(0,0)},CoinHD={(10u,10u)},TypeTrace="Instruments",Clip,Cadres=false,Epaisseur=1,Pointilles=false,Ombre=false,Couleur=black,Ecart=2,ModeleCouleur=5}%
\defKV[Geometrie]{Cadre=\setKV[Geometrie]{Cadres}\setKV[Geometrie]{Clip=false}}%
@@ -42,6 +46,9 @@
elseif \useKV[Geometrie]{TypeTrace}="Espace":
typetrace:="3D";
typerepre:="persp";
+ elseif \useKV[Geometrie]{TypeTrace}="Schema":
+ input PfCSketch;
+ sketchypaths;
fi;
xa:=xpart(Coinbg);
xb:=xpart(Coinhd);
@@ -120,6 +127,9 @@
elseif \useKV[Geometrie]{TypeTrace}="Espace":
typetrace:="3D";
typerepre:="persp";
+ elseif \useKV[Geometrie]{TypeTrace}="Schema":
+ input PfCSketch;
+ sketchypaths;
fi;}
]%
xa:=xpart(Coinbg);
diff --git a/macros/latex/contrib/profcollege/latex/PfCGrades.tex b/macros/latex/contrib/profcollege/latex/PfCGrades.tex
index 6155c43ca1..d86c6e4e42 100644
--- a/macros/latex/contrib/profcollege/latex/PfCGrades.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCGrades.tex
@@ -1,8 +1,12 @@
%%%
% Grades
%%%
-\setKVdefault[Grades]{Solution=false,Longueur=9,Largeur=9,Echelle=8mm,Graines=false}
-\defKV[Grades]{Graine=\setKV[Grades]{Graines}}
+\def\filedateGrades{2024/08/04}%
+\def\fileversionGrades{0.1}%
+\message{-- \filedateGrades\space v\fileversionGrades}%
+%
+\setKVdefault[Grades]{Solution=false,Longueur=9,Largeur=9,Echelle=8mm,Graines=false}%
+\defKV[Grades]{Graine=\setKV[Grades]{Graines}}%
\NewDocumentCommand\Grades{o}{%
\useKVdefault[Grades]%
diff --git a/macros/latex/contrib/profcollege/latex/PfCGrimuku.tex b/macros/latex/contrib/profcollege/latex/PfCGrimuku.tex
index 81e667533a..9185b76892 100644
--- a/macros/latex/contrib/profcollege/latex/PfCGrimuku.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCGrimuku.tex
@@ -1,6 +1,10 @@
%%%
% Grimuku
%%%
+\def\filedateGrimuku{2024/08/04}%
+\def\fileversionGrimuku{0.1}%
+\message{-- \filedateGrimuku\space v\fileversionGrimuku}%
+%
\setKVdefault[Grimuku]{TLargeur=7,Solution=false,Largeur=30pt,CouleurCase=0.7white}%
\defKV[Grimuku]{CouleurSolution=\setKV[Grimuku]{Solution}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCHiddenMessage.tex b/macros/latex/contrib/profcollege/latex/PfCHiddenMessage.tex
index f472e07844..65948f5949 100644
--- a/macros/latex/contrib/profcollege/latex/PfCHiddenMessage.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCHiddenMessage.tex
@@ -1,6 +1,10 @@
%%%
% Message caché
%%%
+\def\filedateHidden{2024/08/04}%
+\def\fileversionHidden{0.1}%
+\message{-- \filedateHidden\space v\fileversionHidden}%
+%
\setKVdefault[Hidden]{TLargeur=5,THauteur=3,Solution=false,Hauteur=70pt,Largeur=120pt,Jeu=false,Solution}
\defKV[Hidden]{Plateau=\setKV[Hidden]{Jeu}\setKV[Hidden]{Solution=false}}
diff --git a/macros/latex/contrib/profcollege/latex/PfCHorloge.tex b/macros/latex/contrib/profcollege/latex/PfCHorloge.tex
index 1133714ecd..01af381977 100644
--- a/macros/latex/contrib/profcollege/latex/PfCHorloge.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCHorloge.tex
@@ -1,7 +1,11 @@
%%%
% Horloges
%%%
-\setKVdefault[ClesHorloge]{Aiguilles,Numerique=false,Secondes,Cadre,Rayon=1,Impression=false}
+\def\filedateHorloge{2024/08/12}%
+\def\fileversionHorloge{0.1a}%
+\message{-- \filedateHorloge\space v\fileversionHorloge}%
+%
+\setKVdefault[ClesHorloge]{Aiguilles,Numerique=false,Secondes,Cadre,Rayon=1,Impression=false,Sombre=false}
\NewDocumentCommand\Horloge{ }{%On désactive les :
\begingroup
@@ -62,13 +66,19 @@
\ifluatex
\mplibforcehmode
\begin{mplibcode}
- boolean Secondes,Impression;
+ boolean Secondes,Impression,Sombre;
Secondes=\useKV[ClesHorloge]{Secondes};
Impression=\useKV[ClesHorloge]{Impression};
+ Sombre=\useKV[ClesHorloge]{Sombre};
if Impression:
+ if Sombre:
+ LightSteelBlue:=0.8*white;
+ Crimson:=black;
+ else:
LightSteelBlue:=0.9*white;
Crimson:=0.5*white;
fi;
+ fi;
u:=0.5u;
draw Afficheur(#1 div10,0);
draw Afficheur(#1 mod10,0) shifted(u*(1,0));
@@ -80,9 +90,21 @@
draw Afficheur(#3 div10,0) shifted(u*(6,0));
draw Afficheur(#3 mod10,0) shifted(u*(7,0));
fi;
+ if Sombre:
+ draw bbox currentpicture;
+ fi;
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={boolean Secondes;Secondes=\useKV[ClesHorloge]{Secondes};}]
+ \begin{mpost}[mpsettings={boolean Secondes,Impression,Sombre;Secondes=\useKV[ClesHorloge]{Secondes};Impression=\useKV[ClesHorloge]{Impression};Sombre=\useKV[ClesHorloge]{Sombre};}]
+ if Impression:
+ if Sombre:
+ LightSteelBlue:=0.8*white;
+ Crimson:=black;
+ else:
+ LightSteelBlue:=0.9*white;
+ Crimson:=0.5*white;
+ fi;
+ fi;
u:=0.5u;
draw Afficheur(#1 div10,0);
draw Afficheur(#1 mod10,0) shifted(u*(1,0));
@@ -94,6 +116,9 @@
draw Afficheur(#3 div10,0) shifted(u*(6,0));
draw Afficheur(#3 mod10,0) shifted(u*(7,0));
fi;
+ if Sombre:
+ draw bbox currentpicture;
+ fi;
\end{mpost}
\fi
}
diff --git a/macros/latex/contrib/profcollege/latex/PfCInfixRPN.sty b/macros/latex/contrib/profcollege/latex/PfCInfixRPN.sty
new file mode 100644
index 0000000000..a0851a5dd5
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCInfixRPN.sty
@@ -0,0 +1,538 @@
+%%
+%% This is file `infix-RPN.tex',
+%%
+%% IMPORTANT NOTICE:
+%%
+%% Package `infix-RPN.tex'
+%%
+%% Main code:
+%% Jean-Côme Charpentier <jean-come.charpentier@wanadoo.fr>
+%%
+%% Contributions by
+%% Christophe Jorssen <christophe.jorssen@libre.fr.invalid>
+%% `libre' is the french word for `free' :-)
+%%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN archives
+%% in directory CTAN:/macros/latex/base/lppl.txt.
+%%
+%% DESCRIPTION:
+%% `infix-RPN' is a package to convert infix expressions to
+%% Reverse Polish Notation
+%%
+%%
+\def\RCS$#1: #2 ${\expandafter\def\csname RCS#1\endcsname{#2}}
+\RCS$Revision: 1.7 $
+\RCS$Date: 2004-07-06 23:41:52+02 $
+
+\def\fileversion{0.11}
+\csname infixRPNLoaded\endcsname
+\let\infixRPNLoaded\endinput
+\message{`infix-RPN' v\fileversion\space (Rev \RCSRevision, \RCSDate), J.-C.Charpentier/C.Jorssen}
+
+\edef\PfCopAtCode{\the\catcode`\@}
+\edef\PfCopHatCode{\the\catcode`\^}
+\edef\PfCopUnderscoreCode{\the\catcode`\_}
+\catcode`\@=11\relax
+\catcode`\^=12\relax
+\catcode`\_=11\relax
+
+\def\s@pow{exp}
+\def\s@lpar{(}
+\def\s@rpar{)}
+\def\s@comma{,}
+
+\def\DeclareNewPSOperator{%
+ \bgroup
+ \catcode`\_=11\relax
+ \DeclareNewPSOperator@i
+}
+
+\def\DeclareNewPSOperator@i#1{%
+ \expandafter\ifx\csname PS@operator@list\endcsname\relax
+ \gdef\PS@operator@list{#1}%
+ \else
+ \xdef\PS@operator@list{#1,\PS@operator@list}%
+ \fi
+ \expandafter\gdef\csname s@#1\endcsname{#1}%
+ \egroup
+}
+
+\DeclareNewPSOperator{add}
+\DeclareNewPSOperator{sub}
+\DeclareNewPSOperator{mul}
+\DeclareNewPSOperator{div}
+\DeclareNewPSOperator{exp}
+\DeclareNewPSOperator{abs}
+\DeclareNewPSOperator{sin}
+\DeclareNewPSOperator{cos}
+\DeclareNewPSOperator{atan}
+\DeclareNewPSOperator{neg}
+\DeclareNewPSOperator{ceiling}
+\DeclareNewPSOperator{floor}
+\DeclareNewPSOperator{truncate}
+\DeclareNewPSOperator{sqrt}
+\DeclareNewPSOperator{ln}
+\DeclareNewPSOperator{log}
+
+
+\newcount\@parenthesis
+\newcount\token@cpt
+\newif\if@begin@token
+\newif\if@in@number
+\newif\if@in@decimal
+\newif\if@in@name
+\newif\if@sign
+\def\@tokencreate#1{%
+ \expandafter\xdef\csname PfCop@token\the\token@cpt\endcsname{#1}%
+ \global\advance\token@cpt\@ne
+ \expandafter\global
+ \expandafter\let\csname PfCop@token\the\token@cpt\endcsname\relax
+ \global\advance\token@cpt\m@ne
+}
+\def\@tokenappend#1{%
+ \expandafter\xdef\csname PfCop@token\the\token@cpt\endcsname
+ {\csname PfCop@token\the\token@cpt\endcsname#1}%
+}
+\def\@tokensingle#1{%
+ \edef\@arg{#1}%
+ \if@in@name
+ \global\advance\token@cpt\@ne
+ \@in@namefalse
+ \fi
+ \if@in@number
+ \global\advance\token@cpt\@ne
+ \@in@numberfalse
+ \@in@decimalfalse
+ \fi
+ \ifx\@arg\s@add
+ \if@sign
+ % ignore + sign
+ \global\advance\token@cpt\m@ne
+ \else
+ \@tokencreate{#1}%
+ \fi
+ \else\ifx\@arg\s@sub
+ \if@sign
+ \@tokencreate{\s@neg}%
+ \else
+ \@tokencreate{#1}%
+ \fi
+ \else
+ \@tokencreate{#1}%
+ \fi\fi
+ \global\advance\token@cpt\@ne
+}
+\def\@tokenuse#1{%
+ \expandafter\ifx\csname PfCop@token#1\endcsname\s@comma%
+ \else
+ \xdef\RPN{\RPN\space\csname PfCop@token#1\endcsname}%
+ \fi
+}
+
+\let\endscanline\relax
+\def\scan@line{%
+ \begingroup
+ \catcode`\ =12
+ \@parenthesis=\z@
+ \@in@numberfalse
+ \@in@decimalfalse
+ \@in@namefalse
+ \global\token@cpt=\@ne
+ \global\@signtrue
+ \scan@@line
+}
+\def\scan@@line#1{\scan@@@line#1\endscanline\endgroup}
+\def\scan@@@line#1#2\endscanline{%
+ \PfCop@testchar{#1}%
+ \ifPfCop@isdigit
+ \global\@signfalse
+ \if@in@number
+ \@tokenappend{#1}%
+ \else \if@in@name
+ \@in@namefalse
+ \@in@numbertrue
+ \@tokenappend{#1}%
+ \else
+ \@in@numbertrue
+ \@tokencreate{#1}%
+ \fi\fi
+ \fi
+ \ifPfCop@isplus
+ \@tokensingle{\s@add}%
+ \global\@signtrue
+ \fi
+ \ifPfCop@isminus
+ \@tokensingle{\s@sub}%
+ \global\@signtrue
+ \fi
+ \ifPfCop@ismultiply
+ \@tokensingle{\s@mul}%
+ \global\@signtrue
+ \fi
+ \ifPfCop@isdivide
+ \@tokensingle{\s@div}%
+ \global\@signtrue
+ \fi
+ \ifPfCop@ispower
+ \@tokensingle{\s@pow}%
+ \global\@signtrue
+ \fi
+ \ifPfCop@isdecimalsep
+ \global\@signfalse
+ \if@in@decimal
+ \errmessage{Syntax error: number with multiple separators!}%
+ \else \if@in@number
+ \@in@decimaltrue
+ \@tokenappend{.}%
+ \else
+ \@tokencreate{.}%
+ \@in@numbertrue
+ \@in@decimaltrue
+ \fi\fi
+ \fi
+ \ifPfCop@iscomma
+ \@tokensingle{,}%
+ \global\@signtrue
+ \fi
+ \ifPfCop@islparenthesis
+ \@tokensingle{(}%
+ \global\@signtrue
+ \fi
+ \ifPfCop@isrparenthesis
+ \global\@signfalse
+ \@tokensingle{)}%
+ \fi
+ \ifPfCop@isspace
+ \if@in@number
+ \@in@numberfalse
+ \@in@decimalfalse
+ \global\advance\token@cpt\@ne
+ \else \if@in@name
+ \@in@namefalse
+ \global\advance\token@cpt\@ne
+ \fi\fi
+ \fi
+ \ifPfCop@isother
+ \global\@signfalse
+ \if@in@name
+ \@tokenappend{#1}%
+ \else \if@in@number
+ \@in@numberfalse
+ \@in@decimalfalse
+ \@in@nametrue
+ \@tokenappend{#1}%
+ \else
+ \@in@nametrue
+ \@tokencreate{#1}%
+ \fi\fi
+ \fi
+ \def\arg{#2}%
+ \ifx\empty\arg
+ \let\next\relax
+ \else
+ \let\next\scan@@@line
+ \fi
+ \expandafter\next\arg\endscanline
+}
+\count255=`\0 \edef\PfCop@numbegin{\the\count255}
+\count255=`\9 \edef\PfCop@numend{\the\count255}
+\count255=`\+ \edef\PfCop@plus{\the\count255}
+\count255=`\- \edef\PfCop@minus{\the\count255}
+\count255=`\* \edef\PfCop@multiply{\the\count255}
+\count255=`\/ \edef\PfCop@divide{\the\count255}
+\count255=`\^ \edef\PfCop@power{\the\count255}
+\count255=`\. \edef\PfCop@dot{\the\count255}
+\count255=`\, \edef\PfCop@comma{\the\count255}
+\count255=`\( \edef\PfCop@lparenthesis{\the\count255}
+\count255=`\) \edef\PfCop@rparenthesis{\the\count255}
+\edef\PfCop@space{32}
+\newif\ifPfCop@isdigit
+\newif\ifPfCop@isplus
+\newif\ifPfCop@isminus
+\newif\ifPfCop@ismultiply
+\newif\ifPfCop@isdivide
+\newif\ifPfCop@ispower
+\newif\ifPfCop@isdecimalsep
+\newif\ifPfCop@iscomma
+\newif\ifPfCop@islparenthesis
+\newif\ifPfCop@isrparenthesis
+\newif\ifPfCop@isspace
+\newif\ifPfCop@isother
+\def\PfCop@testchar#1{%
+ \PfCop@isdigitfalse
+ \PfCop@isplusfalse
+ \PfCop@isminusfalse
+ \PfCop@ismultiplyfalse
+ \PfCop@isdividefalse
+ \PfCop@ispowerfalse
+ \PfCop@isdecimalsepfalse
+ \PfCop@iscommafalse
+ \PfCop@islparenthesisfalse
+ \PfCop@isrparenthesisfalse
+ \PfCop@isspacefalse
+ \PfCop@isotherfalse
+ \count255=`#1\relax
+ \ifnum\count255=\PfCop@plus \relax
+ \PfCop@isplustrue
+ \else \ifnum\count255=\PfCop@minus \relax
+ \PfCop@isminustrue
+ \else \ifnum\count255=\PfCop@multiply \relax
+ \PfCop@ismultiplytrue
+ \else \ifnum\count255=\PfCop@divide \relax
+ \PfCop@isdividetrue
+ \else \ifnum\count255=\PfCop@power \relax
+ \PfCop@ispowertrue
+ \else \ifnum\count255=\PfCop@dot \relax
+ \PfCop@isdecimalseptrue
+ \else \ifnum\count255=\PfCop@comma \relax
+ \PfCop@iscommatrue
+ \else \ifnum\count255=\PfCop@lparenthesis \relax
+ \PfCop@islparenthesistrue
+ \else \ifnum\count255=\PfCop@rparenthesis \relax
+ \PfCop@isrparenthesistrue
+ \else \ifnum\count255=\PfCop@space \relax
+ \PfCop@isspacetrue
+ \else \ifnum\count255<\PfCop@numbegin \relax
+ \PfCop@isothertrue
+ \else \ifnum\count255>\PfCop@numend \relax
+ \PfCop@isothertrue
+ \else \PfCop@isdigittrue
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+
+\def\search@term#1#2{%
+ \begingroup
+ \count1=#1\relax
+ \count255=#2\relax
+ \ifnum\count1=\count255
+ \@tokenuse{#1}%
+ \else
+ \count5=\count255
+ \count7=\count1
+ \advance\count7\m@ne
+ \count3=\z@
+ \loop
+ \ifnum\count5>\count7
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@rpar\relax
+ \advance\@parenthesis\@ne
+ \fi
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@lpar\relax
+ \advance\@parenthesis\m@ne
+ \fi
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@add\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@sub\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@comma\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \advance\count5\m@ne
+ \repeat
+ \ifnum\count3=\z@
+ \ifnum\@parenthesis=\z@
+ \search@factor{\the\count1}{\the\count255}%
+ \else
+ \errmessage{Syntax error: unbalanced parenthesis!}%
+ \fi
+ \else
+ \advance\count3\m@ne
+ \search@term{\the\count1}{\the\count3}%
+ \advance\count3\tw@
+ \search@term{\the\count3}{\the\count255}%
+ \advance\count3\m@ne
+ \@tokenuse{\the\count3}%
+ \fi
+ \fi
+ \endgroup
+}
+\def\search@factor#1#2{%
+ \begingroup
+ \count1=#1\relax
+ \count255=#2\relax
+ \ifnum\count1=\count255
+ \@tokenuse{\the\count1}%
+ \else
+ \count5=\count255
+ \count7=\count1
+ \advance\count7\m@ne
+ \count3=\z@
+ \loop
+ \ifnum\count5>\count7
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@rpar\relax
+ \advance\@parenthesis\@ne
+ \fi
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@lpar\relax
+ \advance\@parenthesis\m@ne
+ \fi
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@mul\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@div\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \advance\count5\m@ne
+ \repeat
+ \ifnum\count3=\z@
+ \ifnum\@parenthesis=\z@
+ \search@power{\the\count1}{\the\count255}%
+ \else
+ \errmessage{! Syntax error: unbalanced parenthesis}%
+ \fi
+ \else
+ \advance\count3\m@ne
+ \search@factor{\the\count1}{\the\count3}%
+ \advance\count3\tw@
+ \search@factor{\the\count3}{\the\count255}%
+ \advance\count3\m@ne
+ \@tokenuse{\the\count3}%
+ \fi
+ \fi
+ \endgroup
+}
+\def\search@power#1#2{%
+ \begingroup
+ \count1=#1\relax
+ \count255=#2\relax
+ \ifnum\count1=\count255
+ \@tokenuse{#1}%
+ \else
+ \count5=\count255
+ \count7=\count1
+ \advance\count7\m@ne
+ \count3=\z@
+ \loop
+ \ifnum\count5>\count7
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@rpar\relax
+ \advance\@parenthesis\@ne
+ \fi
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@lpar\relax
+ \advance\@parenthesis\m@ne
+ \fi
+ \expandafter\ifx\csname PfCop@token\the\count5\endcsname\s@pow\relax
+ \ifnum\@parenthesis=\z@
+ \count3=\count5
+ \count5=\z@
+ \fi
+ \fi
+ \advance\count5\m@ne
+ \repeat
+ \ifnum\count3=\z@
+ \ifnum\@parenthesis=\z@
+ \search@primary{\the\count1}{\the\count255}%
+ \else
+ \errmessage{Syntax error: unbalanced parenthesis}%
+ \fi
+ \else
+ \advance\count3\m@ne
+ \search@power{\the\count1}{\the\count3}%
+ \advance\count3\tw@
+ \search@power{\the\count3}{\the\count255}%
+ \advance\count3\m@ne
+ \@tokenuse{\the\count3}%
+ \fi
+ \fi
+ \endgroup
+}
+\def\search@primary#1#2{%
+ \begingroup
+ \count1=#1\relax
+ \count255=#2\relax
+ \ifnum\count1=\count255
+ \@tokenuse{#1}%
+ \else
+ \edef\current@cnt{#1}%
+ \expandafter\compare@PS@operator\PS@operator@list,\@nil
+ \expandafter\ifx\csname PfCop@token#1\endcsname\s@lpar\relax
+ \expandafter\ifx\csname PfCop@token#2\endcsname\s@rpar\relax
+ \advance\count1\@ne
+ \advance\count255\m@ne
+ \search@term{\the\count1}{\the\count255}%
+ \else
+ \errmessage{Syntax error: Garbage after parenthesis
+ (tokens '#1' to '#2')}%
+ \fi
+ \fi
+ \fi
+ \endgroup
+}
+
+%\let\@nil\relax
+%\let\@nil\@empty
+
+%\def\compare@PS@operator#1,#2\@nil{%
+% \def\@tempa{#1}%
+% \def\@tempb{#2}%
+% \expandafter\ifx\csname PfCop@token\current@cnt\endcsname\@tempa%
+% \advance\count1\@ne
+% \search@primary{\the\count1}{\the\count255}%
+% \advance\count1\m@ne
+% \@tokenuse{\the\count1}%
+% \fi
+% \ifx\@tempb\empty
+% \let\next\relax
+% \let\@tempb\relax
+% \else
+% \let\next\compare@PS@operator
+% \fi
+% \expandafter\next\@tempb\@nil
+%}
+
+\let\@nil\undefined
+
+\def\compare@PS@operator#1,#2\@nil{%
+ \def\@tempa{#1}%
+ \def\@tempb{#2}%
+ \expandafter\ifx\csname PfCop@token\current@cnt\endcsname\@tempa%
+ \advance\count1\@ne
+ \search@primary{\the\count1}{\the\count255}%
+ \advance\count1\m@ne
+ \@tokenuse{\the\count1}%
+ \fi
+ \ifx\@tempb\empty
+ \let\next\@gobble
+ \else
+ \let\next\compare@PS@operator
+ \fi
+ \expandafter\next\@tempb\@nil
+}
+
+
+\def\infixtoRPN{%
+ \begingroup
+ \catcode`\ =12
+ \catcode`\^=12
+ \infixt@RPN
+}
+\def\infixt@RPN#1{%
+ \xdef\@expression{#1}%
+ \endgroup
+ \def\RPN{}%
+ \expandafter\scan@line\expandafter{\@expression}%
+ \expandafter\ifx\csname PfCop@token\the\token@cpt\endcsname\relax
+ \advance\token@cpt\m@ne
+ \fi
+ \search@term{1}{\the\token@cpt}%
+}
+
+\catcode`\@=\PfCopAtCode\relax
+\catcode`\^=\PfCopHatCode\relax
+\catcode`\_=\PfCopUnderscoreCode\relax
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCJeton.tex b/macros/latex/contrib/profcollege/latex/PfCJeton.tex
index e3012070f2..68523efce5 100644
--- a/macros/latex/contrib/profcollege/latex/PfCJeton.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCJeton.tex
@@ -1,6 +1,10 @@
%%%
% Jeton
%%%
+\def\filedateJeton{2024/08/04}%
+\def\fileversionJeton{0.1}%
+\message{-- \filedateJeton\space v\fileversionJeton}%
+%
\setKVdefault[Jeton]{Diametre=5mm,Impression=false}%
\NewDocumentCommand\Jeton{om}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCJeuRangement.tex b/macros/latex/contrib/profcollege/latex/PfCJeuRangement.tex
index 6508e6cd1a..df2f709271 100644
--- a/macros/latex/contrib/profcollege/latex/PfCJeuRangement.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCJeuRangement.tex
@@ -1,3 +1,10 @@
+%%%
+% Jeu Rangement
+%%%
+\def\filedateJeuRangement{2024/08/04}%
+\def\fileversionJeuRangement{0.1}%
+\message{-- \filedateJeuRangement\space v\fileversionJeuRangement}%
+%
\setKVdefault[JeuRgt]{Creation=false,Deno=12,Graines=false,Largeur=15pt,Hauteur=20pt,Negatif=false,Decimaux=false,Solution=false,ValeurMin=2,ValeurMax=50,Exposants=false}
\defKV[JeuRgt]{Graine=\setKV[JeuRgt]{Graines}}%
\defKV[JeuRgt]{Exposant=\setKV[JeuRgt]{Exposants}\setKV[JeuRgt]{Deno=1}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCKakurasu.tex b/macros/latex/contrib/profcollege/latex/PfCKakurasu.tex
index 944d295e8f..d608320b3e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCKakurasu.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCKakurasu.tex
@@ -1,6 +1,10 @@
%%%
% Kakurasu
%%%
+\def\filedateKakurasu{2024/08/04}%
+\def\fileversionKakurasu{0.1}%
+\message{-- \filedateKakurasu\space v\fileversionKakurasu}%
+%
\setKVdefault[Kakurasu]{Solution=false,Longueur=6,Largeur=6,Echelle=8mm,Graines=false,Trace=false}
\defKV[Kakurasu]{Graine=\setKV[Kakurasu]{Graines}}
\defKV[Kakurasu]{Traces=\setKV[Kakurasu]{Trace}}
diff --git a/macros/latex/contrib/profcollege/latex/PfCKakuro.tex b/macros/latex/contrib/profcollege/latex/PfCKakuro.tex
index adf0aba7d2..b480f44275 100644
--- a/macros/latex/contrib/profcollege/latex/PfCKakuro.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCKakuro.tex
@@ -1,6 +1,10 @@
%%%
% Kakuro
%%%
+\def\filedateKakuro{2024/08/04}%
+\def\fileversionKakuro{0.1}%
+\message{-- \filedateKakuro\space v\fileversionKakuro}%
+%
\setKVdefault[Kakuro]{CouleurCase=LightGray,TLargeur=5,THauteur=5,Solution=false,Largeur=2em,Aide=false,CouleurSolution=Black,Tailles=false}%,Taille=5
\defKV[Kakuro]{ListeNombres=\setKV[Kakuro]{Aide}}%
\defKV[Kakuro]{Taille=\setKV[Kakuro]{Tailles}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCKenKen.tex b/macros/latex/contrib/profcollege/latex/PfCKenKen.tex
index e28efc379f..21a16dbc78 100644
--- a/macros/latex/contrib/profcollege/latex/PfCKenKen.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCKenKen.tex
@@ -1,6 +1,10 @@
%%%
% KenKen
%%%
+\def\filedateKenken{2024/08/04}%
+\def\fileversionKenken{0.1}%
+\message{-- \filedateKenken\space v\fileversionKenken}%
+%
\setKVdefault[ClesKK]{Solution=false,Taille=3,Largeur=2em,Aide=false}%
\defKV[ClesKK]{Nombre=\setKV[ClesKK]{Aide}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCLabyrintheJeu.tex b/macros/latex/contrib/profcollege/latex/PfCLabyrintheJeu.tex
index 5922748104..f60cbce35e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCLabyrintheJeu.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCLabyrintheJeu.tex
@@ -1,8 +1,12 @@
%%%
% Labyrinthe
%%%
-\setKVdefault[Labyrinthe]{Lignes=6,Colonnes=3,Longueur=4,Hauteur=2,Passages=false,EcartH=1,EcartV=1,CouleurF=gray!50,Texte=\color{black},SensImpose=false,Slop}
-
+\def\filedateLabyJeu{2024/08/04}%
+\def\fileversionLabyJeu{0.1}%
+\message{-- \filedateLabyJeu\space v\fileversionLabyJeu}%
+%
+\setKVdefault[Labyrinthe]{Lignes=6,Colonnes=3,Longueur=4,Hauteur=2,Passages=false,EcartH=1,EcartV=1,CouleurF=gray!50,Texte=\color{black},SensImpose=false,Slop}%
+%
\tikzset{FDirect/.style={-stealth}}
\tikzset{FIndirect/.style={stealth-}}
\tikzset{FBidirect/.style={stealth-stealth}}
diff --git a/macros/latex/contrib/profcollege/latex/PfCLabyrintheNombre.tex b/macros/latex/contrib/profcollege/latex/PfCLabyrintheNombre.tex
index b610849ea5..769617eb90 100644
--- a/macros/latex/contrib/profcollege/latex/PfCLabyrintheNombre.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCLabyrintheNombre.tex
@@ -1,6 +1,10 @@
%%%
% Labyrinthe Nombre
%%%
+\def\filedateLabyNombre{2024/08/04}%
+\def\fileversionLabyNombre{0.1}%
+\message{-- \filedateLabyNombre\space v\fileversionLabyNombre}%
+%
\setKVdefault[ClesLabyNb]{Multiple=5,XDepart=0,YDepart=0,Longueur=7,Largeur=4,Solution=false,Echelle=1,Angle=0,Couleur=red,Murs=false,Nom=Ex1,CouleurChemin=LightSteelBlue,DoubleOperation=false,Multiplication=false,Chemin=false,EntreeSortie=false,Entree="Nord",Sortie="Sud",SortieUnique=true,Graines=false,XArrivees=false,YArrivees=false,ArriveeX=5,ArriveeY=5}
\defKV[ClesLabyNb]{Graine=\setKV[ClesLabyNb]{Graines}}
\defKV[ClesLabyNb]{XArrivee=\setKV[ClesLabyNb]{XArrivees}\setKV[ClesLabyNb]{ArriveeX=#1}}
diff --git a/macros/latex/contrib/profcollege/latex/PfCLego.tex b/macros/latex/contrib/profcollege/latex/PfCLego.tex
index 901eb0a54b..80bc5ddc1a 100644
--- a/macros/latex/contrib/profcollege/latex/PfCLego.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCLego.tex
@@ -1,6 +1,10 @@
%%%
% Lego
%%%
+\def\filedateLego{2024/09/01}%
+\def\fileversionLego{0.1a}%
+\message{-- \filedateLego\space v\fileversionLego}%
+%
\setKVdefault[Lego]{Echelle=1,Couleur=LightSteelBlue,Unite=8,Diviseur=2,Perso=false,Plaque=false,Largeura=2,Largeurb=2,Unique=false}%
\defKV[Lego]{ListePerso=\setKV[Lego]{Perso}\xdef\PfCFooLegoListePerso{#1}}%
@@ -27,10 +31,14 @@
}{%
\xdef\PfCNbCouleurs{\fpeval{floor(\useKV[Lego]{Unite}/\useKV[Lego]{Diviseur})}}%
}%
- \ChoixCouleur{\PfCNbCouleurs}%
\ifboolKV[Lego]{Perso}{%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeAvantChoixCouleurs{\PfCFooLegoListePerso}%
+ \ChoixCouleur{\ListeAvantChoixCouleurslen}%
+ \reademptyitems%
\BuildBarreLego{\FooCouleur}{\PfCFooLegoListePerso}%
}{%
+ \ChoixCouleur{\PfCNbCouleurs}%
\BuildBarreLego{\FooCouleur}{}%
}%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCMentalo.tex b/macros/latex/contrib/profcollege/latex/PfCMentalo.tex
index 84176c0d1f..0c024facd2 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMentalo.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMentalo.tex
@@ -1,6 +1,10 @@
%%%
% Mentalo
%%%
+\def\filedateMentalo{2024/08/04}%
+\def\fileversionMentalo{0.1}%
+\message{-- \filedateMentalo\space v\fileversionMentalo}%
+%
\NewDocumentCommand\PfCNumold{m}{%
\xintifboolexpr{#1<0}{(\num{#1})}{\num{#1}}%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCMidpoint.tex b/macros/latex/contrib/profcollege/latex/PfCMidpoint.tex
index 0813f66c44..4fea05dcbb 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMidpoint.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMidpoint.tex
@@ -1,6 +1,10 @@
%%%
% Midpoint
%%%
+\def\filedateMidpoint{2024/08/04}%
+\def\fileversionMidpoint{0.1}%
+\message{-- \filedateMidpoint\space v\fileversionMidpoint}%
+%
\setKVdefault[MidPoint]{Solution=false,Graines=false,Hard=false}
\defKV[MidPoint]{Graine=\setKV[MidPoint]{Graines}}
diff --git a/macros/latex/contrib/profcollege/latex/PfCModeleBarre.tex b/macros/latex/contrib/profcollege/latex/PfCModeleBarre.tex
index a05ae0075b..e894a9ebc6 100644
--- a/macros/latex/contrib/profcollege/latex/PfCModeleBarre.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCModeleBarre.tex
@@ -1,6 +1,10 @@
%%%
% Modele en barre
%%%
+\def\filedateModeleBarre{2024/08/04}%
+\def\fileversionModeleBarre{0.1}%
+\message{-- \filedateModeleBarre\space v\fileversionModeleBarre}%
+%
\setKVdefault[ClesModeleBarre]{Hauteur=0.5cm,Largeur=1cm,Separation={0},Homogene=false,Multiplicatif=false,MultiplicatifH=false,MultiplicatifB=false}%Separation pour conserver le lien avec les équations.
\defKV[ClesModeleBarre]{Longueur=\setKV[ClesModeleBarre]{Homogene}}%
\defKV[ClesModeleBarre]{AccoladesH=\setKV[ClesModeleBarre]{MultiplicatifH}\setKV[ClesModeleBarre]{Multiplicatif}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCMosaique.tex b/macros/latex/contrib/profcollege/latex/PfCMosaique.tex
index 91936d597b..af964995ef 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMosaique.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMosaique.tex
@@ -1,6 +1,10 @@
%%%
% Mosaique
%%%
+\def\filedateMosaique{2024/08/04}%
+\def\fileversionMosaique{0.1}%
+\message{-- \filedateMosaique\space v\fileversionMosaique}%
+%
\setKVdefault[ClesMosaique]{Largeur=2,Hauteur=2,Solution=false,Type=1,Label,Echelle=1cm}
\newcommand\DessineMosaique[2][]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCMotsCodes.tex b/macros/latex/contrib/profcollege/latex/PfCMotsCodes.tex
index 0929b76197..088f417c35 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMotsCodes.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMotsCodes.tex
@@ -1,6 +1,10 @@
%%%
% Mots Cod\'es
%%%
+\def\filedateMotsCodes{2024/08/04}%
+\def\fileversionMotsCodes{0.1}%
+\message{-- \filedateMotsCodes\space v\fileversionMotsCodes}%
+%
\setKVdefault[MotsCodes]{LargeurT=1cm,Colonnes=5,Largeur=3cm,Solution=false,Math=false}%
\newcommand\MotsCodes[2][]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCMotsCroises.tex b/macros/latex/contrib/profcollege/latex/PfCMotsCroises.tex
index 4e6734dd7b..5310516799 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMotsCroises.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMotsCroises.tex
@@ -1,6 +1,10 @@
%%%
% Mots croisés
%%%
+\def\filedateMotsCroises{2024/08/04}%
+\def\fileversionMotsCroises{0.1}%
+\message{-- \filedateMotsCroises\space v\fileversionMotsCroises}%
+%
\setKVdefault[ClesCroises]{Lignes=6,Colonnes=8,Solution=false,Croises=false,Couleur=gray,Largeur=1em}
\newcounter{PfCLettreHorizontal}
diff --git a/macros/latex/contrib/profcollege/latex/PfCMotsEmpiles.tex b/macros/latex/contrib/profcollege/latex/PfCMotsEmpiles.tex
index 1c42d433a6..c8ec37bc5d 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMotsEmpiles.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMotsEmpiles.tex
@@ -1,6 +1,10 @@
%%%
% Mots empilés
%%%
+\def\filedateMotsEmpiles{2024/08/04}%
+\def\fileversionMotsEmpiles{0.1}%
+\message{-- \filedateMotsEmpiles\space v\fileversionMotsEmpiles}%
+%
\setKVdefault[ClesMotEmpile]{Colonne=4,Solution=false,Couleur=black}
\newcounter{CompteurMotEmpile}
diff --git a/macros/latex/contrib/profcollege/latex/PfCMulArt.tex b/macros/latex/contrib/profcollege/latex/PfCMulArt.tex
index 27156c00b7..9942541873 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMulArt.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMulArt.tex
@@ -1,6 +1,10 @@
%%%
% Mulart
%%%
+\def\filedateMulArt{2024/08/04}%
+\def\fileversionMulArt{0.1}%
+\message{-- \filedateMulArt\space v\fileversionMulArt}%
+%
\setKVdefault[TabMul]{Multiple=2,Cibles=false,Largeur=20pt,Couleurs=false,Graines=false,Operations=false,Enonce=false,SchemaEnonce=false}
\defKV[TabMul]{Couleur=\setKV[TabMul]{Couleurs}}
\defKV[TabMul]{Graine=\setKV[TabMul]{Graines}\PfCGraineAlea{#1}}
diff --git a/macros/latex/contrib/profcollege/latex/PfCMulJal.tex b/macros/latex/contrib/profcollege/latex/PfCMulJal.tex
index befce7a110..3f9ba37758 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMulJal.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMulJal.tex
@@ -1,6 +1,10 @@
%%%
% Multiplication par jalousie
%%%
+\def\filedateMulJal{2024/08/04}%
+\def\fileversionMulJal{0.1}%
+\message{-- \filedateMulJal\space v\fileversionMulJal}%
+%
\setKVdefault[MulJal]{Solution=false,CouleurTab=gray!15}%
\defKV[MulJal]{CouleurSolution=\setKV[MulJal]{Solution}}%
%
diff --git a/macros/latex/contrib/profcollege/latex/PfCMulJap.tex b/macros/latex/contrib/profcollege/latex/PfCMulJap.tex
index e0457471e1..8fdf37c5b3 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMulJap.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMulJap.tex
@@ -1,6 +1,10 @@
%%%
% Multiplication Japonaise
%%%
+\def\filedateMulJap{2024/08/04}%
+\def\fileversionMulJap{0.1}%
+\message{-- \filedateMulJap\space v\fileversionMulJap}%
+%
\setKVdefault[MulJap]{Couleur=Orange,Bloc=false,DessinSeul=false}
\defKV[MulJap]{CouleurBloc=\setKV[MulJap]{Bloc}}
@@ -229,5 +233,6 @@
endfor;
fi;
\end{mplibcode}
+ \mplibnumbersystem{scaled}
\fi
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCMulPiecesPuzzle.tex b/macros/latex/contrib/profcollege/latex/PfCMulPiecesPuzzle.tex
index 56a7ad6943..aaf98ffe6a 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMulPiecesPuzzle.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMulPiecesPuzzle.tex
@@ -1,12 +1,16 @@
%%%
% Pièces de puzzle pour multiplication
%%%
+\def\filedateMulPiecesPuzzle{2024/08/04}%
+\def\fileversionMulPiecesPuzzle{0.1}%
+\message{-- \filedateMulPiecesPuzzle\space v\fileversionMulPiecesPuzzle}%
+%
%https://mirror.gutenberg-asso.fr/tex.loria.fr/prod-graph/metafun.pdf
\newtoks\toklistepuzzlea%
\def\UpdatetoksPuzzleA#1\nil{\addtotok\toklistepuzzlea{"#1",}}%
-\setKVdefault[ClesPuzzleMul]{Solution=false,Unite=1cm,Couleur=LightSteelBlue}
+\setKVdefault[ClesPuzzleMul]{Solution=false,Unite=1cm,Couleur=LightSteelBlue,Cube=false}
\NewDocumentCommand\PuzzleMul{om}{%
\useKVdefault[ClesPuzzleMul]%
@@ -17,8 +21,12 @@
\xdef\HauteurPuzzle{\PfCListePuzzlelen}%
\toklistepuzzlea{}%
\foreachitem\compteur\in\PfCListePuzzle{\expandafter\UpdatetoksPuzzleA\compteur\nil}%
- \BuildPuzzle{\the\toklistepuzzlea}%
-}
+ \ifboolKV[ClesPuzzleMul]{Cube}{%
+ \BuildPuzzleEspace{\the\toklistepuzzlea}%
+ }{%
+ \BuildPuzzle{\the\toklistepuzzlea}%
+ }%
+}%
\def\BuildPuzzleCode{%
def PreDrawPuzzle ( expr ww, hh, uu ) =
diff --git a/macros/latex/contrib/profcollege/latex/PfCNombreAstral.tex b/macros/latex/contrib/profcollege/latex/PfCNombreAstral.tex
index 428cd8d37c..df1903bc0e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCNombreAstral.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCNombreAstral.tex
@@ -1,6 +1,10 @@
%%%
% Nombre Astral
%%%
+\def\filedateNombreAstral{2024/08/04}%
+\def\fileversionNombreAstral{0.1}%
+\message{-- \filedateNombreAstral\space v\fileversionNombreAstral}%
+%
\setKVdefault[NombreAstral]{Solution=false,Graines=false,Echelle=1,Couleur=LightSteelBlue,Horizontal=false}
\defKV[NombreAstral]{Graine=\setKV[NombreAstral]{Graines}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCNonogramme.tex b/macros/latex/contrib/profcollege/latex/PfCNonogramme.tex
index 8adfbd5654..d63fd9c70f 100644
--- a/macros/latex/contrib/profcollege/latex/PfCNonogramme.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCNonogramme.tex
@@ -1,3 +1,10 @@
+%%%
+% Nonogramme
+%%%
+\def\filedateNonogramme{2024/08/04}%
+\def\fileversionNonogramme{0.1}%
+\message{-- \filedateNonogramme\space v\fileversionNonogramme}%
+%
\setKVdefault[Nono]{Largeur=10pt,Taille=5,Unite=1cm,Solution=false,Enonce=true}
\newtoks\toklistenonoa%
diff --git a/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex b/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex
index 117c2a0905..265beb92f9 100644
--- a/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex
@@ -1,6 +1,10 @@
%%%
% Fonction
%%%
+\def\filedateFonction{2024/08/04}%
+\def\fileversionFonction{0.1}%
+\message{-- \filedateFonction\space v\fileversionFonction}%
+%
\setKVdefault[ClesFonction]{Nom=f,Variable=x,Calcul=x,Tableau=false,Largeur=5mm,Ecriture=false,Definition=false,Points=false,Tangentes=false,PasX=1,PasY=1,UniteX=1,UniteY=1,Prolonge=false,Trace=false,Catmull=false,Splines=false,Lagrange=false,Epaisseur=1,Couleur=black,CouleurTrace=black,PointsCourbe=true,Codes=false,Origine={(0,0)},Vide=false}
\defKV[ClesFonction]{Traces=\setKV[ClesFonction]{Codes}}%
@@ -22,18 +26,20 @@
\setKV[TraceG]{#1}%
\tokPfCListeDesFonctions{}%
\tokPfCListeDesNomsFonctions{}%
- \xdef\PfCFooFn{\useKV[ClesFonction]{Calcul}}
- \xdef\PfCFooNomFn{\useKV[TraceG]{NomCourbe}}
+ \xdef\PfCFooFn{\useKV[ClesFonction]{Calcul}}%
+ \xdef\PfCFooNomFn{\useKV[TraceG]{NomCourbe}}%
\ifx\bla\PfCFooFn\bla%
- \else
- \readlist*\ListeDesFonctions{\PfCFooFn}
+ \else%
+ \setsepchar{,}\ignoreemptyitems
+ \readlist*\ListeDesFonctions{\PfCFooFn}%
+ \reademptyitems
\foreachitem\compteur\in\ListeDesFonctions{\expandafter\UpdatePfCListeDesFonctions\compteur\nil}%
- \fi
- \ifx\bla\PfCFooNomFn\bla
- \else
- \readlist*\ListeDesNomsFonctions{\PfCFooNomFn}
+ \fi%
+ \ifx\bla\PfCFooNomFn\bla%
+ \else%
+ \readlist*\ListeDesNomsFonctions{\PfCFooNomFn}%
\foreachitem\compteur\in\ListeDesNomsFonctions{\expandafter\UpdatePfCListeDesNomsFonctions\compteur\nil}%
- \fi
+ \fi%
\tokPfCLabelX{}%
\tokPfCLabelY{}%
\addtotok\tokPfCLabelX{"\useKV[TraceG]{LabelX}"}%
@@ -79,7 +85,7 @@
\MPCourbeNew{\PfCFooListePoints}%
}%
}%
- }
+ }%
}{%
\setsepchar{,}\ignoreemptyitems%
\readlist*\ListeFonction{#2}%
@@ -1247,6 +1253,17 @@ vardef Lagrange(expr valeur)(text t)=
%
RetiensCouleur(\useKV[TraceG]{CouleurTrace});
%
+ numeric styletrace[];
+ vardef RetiensStyle(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ styletrace[n]=p_;
+ endfor;
+ enddef;
+ %
+ RetiensStyle(\useKV[TraceG]{StyleTrace});
+ %
pair Origine,DecalageOrigine;
Origine=(xmin,ymin)+\useKV[TraceG]{Origine};
DecalageOrigine=\useKV[TraceG]{Origine};
@@ -1303,6 +1320,19 @@ vardef Lagrange(expr valeur)(text t)=
n:=0;
for p_=texto:
n:=n+1;
+ if unknown styletrace[n]:
+ drawoptions();
+ else:
+ if styletrace[n]=1:
+ drawoptions(dashed evenly);
+ elseif styletrace[n]=2:
+ drawoptions(dashed withdots);
+ elseif styletrace[n]=3:
+ drawoptions(dashed dashpattern(on6 off3 on1.5 off3));
+ else:
+ drawoptions();
+ fi;
+ fi;
draw courbe[n](borneinf[n],bornesup[n],100)(scantokens p_) withpen (pencircle scaled Epaisseur) withcolor if unknown colortrace[n]:black else: colortrace[n] fi;
endfor;
enddef;
@@ -1417,6 +1447,9 @@ vardef Lagrange(expr valeur)(text t)=
trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
endfor;
drawoptions();
+ else:
+ grillex:=0;
+ grilley:=0;
fi;
if Graduations:
for k=gradx step gradx until (((xmax-xmin)-xpart(DecalageOrigine))*pasx):
@@ -1468,11 +1501,12 @@ vardef Lagrange(expr valeur)(text t)=
else:
DessineCourbes(#1);
NommeCourbes(#2);
- if Grille:
clip currentpicture to polygone(u*(xmin-grillex,ymin-grilley),u*(xmax+grillex,ymin-grilley),u*(xmax+grillex,ymax+grilley),u*(xmin-grillex,ymax+grilley));
+ if Grille:
+ %clip currentpicture to polygone(u*(xmin-grillex,ymin-grilley),u*(xmax+grillex,ymin-grilley),u*(xmax+grillex,ymax+grilley),u*(xmin-grillex,ymax+grilley));
draw polygone(u*(xmin-grillex,ymin-grilley),u*(xmax+grillex,ymin-grilley),u*(xmax+grillex,ymax+grilley),u*(xmin-grillex,ymax+grilley)) withcolor 0.75white;
else:
- clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax));
+ %clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax));
fi;
%
if Code:
diff --git a/macros/latex/contrib/profcollege/latex/PfCNumberHive.tex b/macros/latex/contrib/profcollege/latex/PfCNumberHive.tex
index ee37a5b2f1..96019b3d83 100644
--- a/macros/latex/contrib/profcollege/latex/PfCNumberHive.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCNumberHive.tex
@@ -1,6 +1,10 @@
%%%
% Number Hive
%%%
+\def\filedateNumberHive{2024/08/04}%
+\def\fileversionNumberHive{0.1}%
+\message{-- \filedateNumberHive\space v\fileversionNumberHive}%
+%
\setKVdefault[NumberHive]{Negatif=false,Produit=false,Niveau=8,Double=false,ListeCouleurs={Cornsilk,LightSteelBlue},CouleurCase=false,Jeton=false,Graines=false,Aide=false,UniteHexa=6mm}%
\defKV[NumberHive]{Cases=\setKV[NumberHive]{CouleurCase}}%
\defKV[NumberHive]{Jetons=\setKV[NumberHive]{Jeton}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCNumerationsAnciennes.tex b/macros/latex/contrib/profcollege/latex/PfCNumerationsAnciennes.tex
index a864165fba..b9560bb504 100644
--- a/macros/latex/contrib/profcollege/latex/PfCNumerationsAnciennes.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCNumerationsAnciennes.tex
@@ -1,3 +1,10 @@
+%%%
+% Numerations anciennes
+%%%
+\def\filedateNumAnciennes{2024/08/04}%
+\def\fileversionNumAnciennes{0.1}%
+\message{-- \filedateNumAnciennes\space v\fileversionNumAnciennes}%
+%
\setKVdefault[NumerationAncienne]{Couleur=black}%
\NewDocumentCommand\Chinoise{om}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCOperationsTrou.tex b/macros/latex/contrib/profcollege/latex/PfCOperationsTrou.tex
index 347ca499bc..ca9f72976e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCOperationsTrou.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCOperationsTrou.tex
@@ -1,11 +1,11 @@
%%%
% Op\'erations pos\'es à trou
%%%
-%% D'après https://tex.stackexchange.com/questions/277246/drawing-a-circle-around-the-numbers-in-xlop-package
-
-%\begin{document}%
+\def\filedateOpTrou{2024/08/04}%
+\def\fileversionOpTrou{0.1}%
+\message{-- \filedateOpTrou\space v\fileversionOpTrou}%
%
-%\end{document}
+%% D'après https://tex.stackexchange.com/questions/277246/drawing-a-circle-around-the-numbers-in-xlop-package
\newcommand\PfCchiffre[2]{\tikz[remember picture] \node[inner sep=0pt](#1){#2};}
diff --git a/macros/latex/contrib/profcollege/latex/PfCPapiers.tex b/macros/latex/contrib/profcollege/latex/PfCPapiers.tex
index 0bb41363ec..3929600a6e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPapiers.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPapiers.tex
@@ -1,6 +1,10 @@
%%%
% Papiers
%%%
+\def\filedatePapiers{2024/08/04}%
+\def\fileversionPapiers{0.1}%
+\message{-- \filedatePapiers\space v\fileversionPapiers}%
+%
\setKVdefault[Papiers]{Cinq=true,Seyes=false,Echelle=8,Isometrique=false,IsometriquePointe=false,Millimetre=false,Triangle=false,Largeur=5,Hauteur=4,Couleur=black,Grille=-1,GrillePointe=-1,PageEntiere=false,ZoneTexte=false,Baseline=false,CodeAfter=false}%
\defKV[Papiers]{Traces=\setKV[Papiers]{CodeAfter}}
diff --git a/macros/latex/contrib/profcollege/latex/PfCPatronPaves.tex b/macros/latex/contrib/profcollege/latex/PfCPatronPaves.tex
index dfbd3a5d23..904f272411 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPatronPaves.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPatronPaves.tex
@@ -1,7 +1,13 @@
%%%
% Patrons de pavés droits et cubes
%%%
-\setKVdefault[ClesPatron]{Cube,Arete=1cm,ListeCouleurs={white},Pave=false,Largeur=2cm,Hauteur=1.5cm,Profondeur=1cm,Codes=false}%
+\def\filedatePatronspaves{2024/08/04}%
+\def\fileversionPatronspaves{0.1}%
+\message{-- \filedatePatronspaves\space v\fileversionPatronspaves}%
+%
+\setKVdefault[ClesPatron]{Cube,Arete=1cm,ListeCouleurs={white},Pave=false,Largeur=2cm,Hauteur=1.5cm,Profondeur=1cm,Codes=false,AColorier=false}%
+%EcartColorier est en nombre de parts pour le cube, en mm pour le pavé.
+\defKV[ClesPatron]{EcartColorier=\setKV[ClesPatron]{AColorier}}%
\defKV[ClesPatron]{Traces=\setKV[ClesPatron]{Codes}}%
\newtoks\toklistepatron%
@@ -30,7 +36,7 @@
}%
}%
-\setsepchar{,}\ignoreemptyitems
+\setsepchar{,}\ignoreemptyitems%
\readlist*\ListePatronsCube{%
{ooxo,xxxx,ooxo},%
{oxoo,xxxx,xooo},%
@@ -78,7 +84,7 @@
{poho,lpho,poho,lohp},%
{poho,loho,plhl,loho},%
{poho,loho,plho,lohp},%
- {poho,loho,poho,lphp},%
+ {poho,loho,poho,lphp},%20
{phlh,holo,polo,holo},%
{phlo,holp,polo,holo},%
{phlo,holo,polh,holo},%
@@ -88,17 +94,17 @@
{polo,hplo,polo,holp},%
{polo,holo,phlh,holo},%
{polo,holo,phlo,holp},%
- {polo,holo,polo,hplp},%
+ {polo,holo,polo,hplp},%30
{hlpo,lopo,hopl,pool},%
{hopo,lhpo,hopl,pool},%
{hopo,lopo,hlph,pool},%
{lhpo,hopo,loph,pooh},%
{lopo,hlpo,loph,pooh},%
- {lopo,hopo,lhoh,pooh},%
+ {lopo,hopo,lhph,pooh},%
{plho,loho,pohl,hool},%
{poho,lpho,pohl,hool},%
{poho,loho,plhl,hool},%
- {lpho,poho,lohp,hoop},%
+ {lpho,poho,lohp,hoop},%40
{loho,plho,lohp,hoop},%
{loho,poho,lphp,hoop},%
{phlo,holo,polh,looh},%
@@ -108,23 +114,23 @@
{holo,phlo,holp,loop},%
{holo,polo,hplp,loop},%
{hpo,lpo,hpl,pol,hol},%
- {lpo,hpo,lph,poh,loh},%
- {pho,plo,phl,hol,pol},%
+ {lpo,hpo,lph,poh,loh},%50
+ {pho,lho,phl,hol,pol},%
{hpoo,lpho,pohl,hool},%
{lpoo,hplo,polh,looh},%
- {phoo,lhpo,hopl,pool}
-}
+ {phoo,lhpo,hopl,pool}%
+}%
\readlist*\ListePatronsPaveCouleurs{%
- {Orange,Crimson,Orange,LightGreen,Crimson,LightGreen},
- {Orange,Crimson,LightGreen,Orange,Crimson,LightGreen},
- {Orange,Crimson,LightGreen,Crimson,Orange,LightGreen},
- {Orange,Crimson,LightGreen,Crimson,LightGreen,Orange},
- {Crimson,Orange,LightGreen,Orange,Crimson,LightGreen},
- {Crimson,Orange,LightGreen,Crimson,Orange,LightGreen},
- {Crimson,Orange,LightGreen,Crimson,LightGreen,Orange},
- {Crimson,LightGreen,Orange,Crimson,Orange,LightGreen},
- {Crimson,LightGreen,Orange,Crimson,LightGreen,Orange},
+ {Orange,Crimson,Orange,LightGreen,Crimson,LightGreen},%
+ {Orange,Crimson,LightGreen,Orange,Crimson,LightGreen},%
+ {Orange,Crimson,LightGreen,Crimson,Orange,LightGreen},%
+ {Orange,Crimson,LightGreen,Crimson,LightGreen,Orange},%
+ {Crimson,Orange,LightGreen,Orange,Crimson,LightGreen},%
+ {Crimson,Orange,LightGreen,Crimson,Orange,LightGreen},%
+ {Crimson,Orange,LightGreen,Crimson,LightGreen,Orange},%
+ {Crimson,LightGreen,Orange,Crimson,Orange,LightGreen},%
+ {Crimson,LightGreen,Orange,Crimson,LightGreen,Orange},%
{Crimson,LightGreen,Crimson,Orange,LightGreen,Orange},%10
{LightGreen,Crimson,LightGreen,Orange,Crimson,Orange},%
{LightGreen,Crimson,Orange,LightGreen,Crimson,Orange},%
@@ -169,9 +175,277 @@
{Crimson,Orange,Crimson,LightGreen,Orange,LightGreen},%
{Crimson,LightGreen,Orange,Crimson,LightGreen,Orange},%
{LightGreen,Crimson,Orange,LightGreen,Crimson,Orange},%
- {Crimson,Orange,LightGreen,Crimson,Orange,LightGreen}%
+ {Crimson,Orange,LightGreen,Crimson,Orange,LightGreen}%
+}%
+\reademptyitems%
+
+\def\MPPatronPaveCode{%
+ Largeur=\useKV[ClesPatron]{Largeur};
+ Hauteur=\useKV[ClesPatron]{Hauteur};
+ Profondeur=\useKV[ClesPatron]{Profondeur};
+ %
+ pair C[],M[],N[],O[],P[];
+ %
+ color Col[],CoulDefaut;
+ CoulDefaut=white;
+ %
+ boolean Codes,Allume[][],AColorier;
+ Codes=\useKV[ClesPatron]{Codes};
+ AColorier=\useKV[ClesPatron]{AColorier};
+ if AColorier:
+ EcartColorier=\useKV[ClesPatron]{EcartColorier}*1mm;
+ fi;
+ %
+ numeric DecalCol[];
+ %
+ vardef Allumage(text t)=
+ nblignes:=0;
+ for p_=t:
+ Long:=length p_;
+ nblignes:=nblignes+1;
+ for k=0 upto Long-1:
+ Allume[nblignes][k]=false;
+ endfor;
+ endfor;
+ enddef;
+ %
+ vardef LectureLargeur(text t)=
+ for p_=t:
+ Long:=length p_;
+ endfor;
+ for k=1 upto Long-1:
+ for p_=t:
+ if substring(k,k+1) of p_="o":
+ if k=1:
+ if (substring(0,1) of p_="h") and (substring(1,2) of p_="p"):
+ DecalCol[k]:=Largeur;
+ fi;
+ if (substring(0,1) of p_="h") and (substring(1,2) of p_="l"):
+ DecalCol[k]:=Profondeur;
+ fi;
+ if (substring(0,1) of p_="p") and (substring(1,2) of p_="h"):
+ DecalCol[k]:=Largeur;
+ fi;
+ if (substring(0,1) of p_="p") and (substring(1,2) of p_="l"):
+ DecalCol[k]:=Hauteur;
+ fi;
+ if (substring(0,1) of p_="l") and (substring(1,2) of p_="h"):
+ DecalCol[k]:=Profondeur;
+ fi;
+ if (substring(0,1) of p_="l") and (substring(1,2) of p_="p"):
+ DecalCol[k]:=Hauteur;
+ fi;
+ fi;
+ elseif substring(k,k+1) of p_="l":
+ DecalCol[k]:=Largeur;
+ elseif substring(k,k+1) of p_="h":
+ DecalCol[k]:=Hauteur;
+ elseif substring(k,k+1) of p_="p":
+ DecalCol[k]:=Profondeur;
+ fi;
+ endfor;
+ endfor;
+ enddef;
+ %
+ vardef Patron(text t)=
+ path PathPave;
+ nblignes:=-1;
+ NBLignes:=0;
+ nbcol:=0;
+ nbfaces:=0;
+ for p_=t:
+ Long:=length p_;
+ nbcolonnes:=0;
+ NBColonnes:=0;
+ if substring(0,1) of p_="h":
+ YEchelle:=Hauteur;
+ elseif substring(0,1) of p_="l":
+ YEchelle:=Largeur;
+ elseif substring(0,1) of p_="p":
+ YEchelle:=Profondeur;
+ fi;
+ nblignes:=nblignes-YEchelle;
+ NBLignes:=NBLignes+1;
+ for k=1 upto Long-1:
+ if substring(k,k+1) of p_="o":
+ if k=1:
+ PathPave:=(unitsquare scaled 0) shifted ((0,-1));
+ fi;
+ elseif substring(k,k+1) of p_="l":
+ nbcol:=nbcol+1;
+ PathPave:=(unitsquare xscaled Largeur yscaled YEchelle) shifted ((nbcolonnes,nblignes));
+ Allume[NBLignes][NBColonnes]:=true;
+ nbfaces:=nbfaces+1;
+ C[nbfaces]=center PathPave;
+ M[nbfaces]=point(0) of PathPave;
+ N[nbfaces]=point(1) of PathPave;
+ O[nbfaces]=point(2) of PathPave;
+ P[nbfaces]=point(3) of PathPave;
+ elseif substring(k,k+1) of p_="h":
+ nbcol:=nbcol+1;
+ PathPave:=(unitsquare xscaled Hauteur yscaled YEchelle) shifted ((nbcolonnes,nblignes));
+ Allume[NBLignes][NBColonnes]:=true;
+ nbfaces:=nbfaces+1;
+ C[nbfaces]=center PathPave;
+ M[nbfaces]=point(0) of PathPave;
+ N[nbfaces]=point(1) of PathPave;
+ O[nbfaces]=point(2) of PathPave;
+ P[nbfaces]=point(3) of PathPave;
+ elseif substring(k,k+1) of p_="p":
+ nbcol:=nbcol+1;
+ PathPave:=(unitsquare xscaled Profondeur yscaled YEchelle) shifted ((nbcolonnes,nblignes));
+ Allume[NBLignes][NBColonnes]:=true;
+ nbfaces:=nbfaces+1;
+ C[nbfaces]=center PathPave;
+ M[nbfaces]=point(0) of PathPave;
+ N[nbfaces]=point(1) of PathPave;
+ O[nbfaces]=point(2) of PathPave;
+ P[nbfaces]=point(3) of PathPave;
+ fi;
+ if (unknown Col[nbcol]):
+ else:
+ if Col[nbcol]=white:
+ else:
+ if AColorier=false:
+ fill PathPave withcolor Col[nbcol];
+ fi;
+ fi;
+ fi;
+ if nbfaces>0:
+ trace M[nbfaces]--P[nbfaces];
+ trace N[nbfaces]--O[nbfaces];
+ trace P[nbfaces]--O[nbfaces];
+ trace M[nbfaces]--N[nbfaces];
+ fi;
+ nbcolonnes:=nbcolonnes+DecalCol[k];
+ NBColonnes:=NBColonnes+1;
+ endfor;
+ endfor;
+ enddef;
+ %
+ vardef EffectuerTraces=
+ if Codes:
+ \useKV[ClesPatron]{Traces};
+ fi;
+ enddef;
+}%
+
+\def\MPPatronPave#1#2{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ \MPPatronPaveCode
+ n:=0;
+ for p_=#2:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ Col[n]=CoulDefaut;
+ fi;
+ endfor;
+ %
+ LectureLargeur(#1);
+ Allumage(#1);
+ if AColorier:
+ drawoptions(dashed evenly);
+ fi;
+ Patron(#1);
+ if AColorier:
+ drawoptions();
+ toto:=0;
+ for l=1 upto NBLignes:
+ for k=0 upto NBColonnes-1:
+ if Allume[l][k]:
+ toto:=toto+1;
+ % trait vertical gauche
+ if k=0:
+% trace M[toto]--P[toto];
+ tpoints:=floor(abs(M[toto]-P[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[M[toto],P[toto]])--((t/tpoints)[M[toto],P[toto]]+(2*unitvector(P[toto]-M[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l][k-1]=false:
+ % trace M[toto]--P[toto] dashed evenly;
+ tpoints:=floor(abs(M[toto]-P[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[M[toto],P[toto]])--((t/tpoints)[M[toto],P[toto]]+(2*unitvector(P[toto]-M[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+% % trait vertical droit
+ if k=Long-1:
+ % trace N[toto]--O[toto] dashed evenly;
+ tpoints:=floor(abs(N[toto]-O[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[N[toto],O[toto]])--((t/tpoints)[N[toto],O[toto]]+(2*unitvector(O[toto]-N[toto])) rotated 90);
+ endfor;
+ else:
+ if Allume[l][k+1]=false:
+ %% trace N[toto]--O[toto] dashed evenly;
+ tpoints:=floor(abs(N[toto]-O[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[N[toto],O[toto]])--((t/tpoints)[N[toto],O[toto]]+(2*unitvector(O[toto]-N[toto])) rotated 90);
+ endfor;
+ fi;
+ fi;
+% % trait horizontal haut
+ if l=1:
+ % trace P[toto]--O[toto] dashed evenly;
+ tpoints:=floor(abs(P[toto]-O[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[P[toto],O[toto]])--((t/tpoints)[P[toto],O[toto]]+(2*unitvector(O[toto]-P[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l-1][k]=false:
+ % trace P[toto]--O[toto] dashed evenly;
+ tpoints:=floor(abs(P[toto]-O[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[P[toto],O[toto]])--((t/tpoints)[P[toto],O[toto]]+(2*unitvector(O[toto]-P[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+% % trait horizontal bas
+ if l=NBLignes:
+ %% trace M[toto]--N[toto] dashed evenly;
+ tpoints:=floor(abs(M[toto]-N[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[M[toto],N[toto]])--((t/tpoints)[M[toto],N[toto]]+(2*unitvector(M[toto]-N[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l+1][k]=false:
+ %% trace M[toto]--N[toto] dashed evenly;
+ tpoints:=floor(abs(M[toto]-N[toto])/EcartColorier);
+ for t=1 upto tpoints-1:
+ trace ((t/tpoints)[M[toto],N[toto]])--((t/tpoints)[M[toto],N[toto]]+(2*unitvector(M[toto]-N[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+ fi;
+ endfor;
+ endfor;
+ fi;
+ EffectuerTraces;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={\MPPatronPaveCode;}]
+ n:=0;
+ for p_=#2:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ Col[n]=CoulDefaut;
+ fi;
+ endfor;
+ %
+ LectureLargeur(#1);
+ Patron(#1);
+ EffectuerTraces;
+ \end{mpost}
+ \fi
}%
-\reademptyitems
\def\MPPatronCubeCode{%
Arete=\useKV[ClesPatron]{Arete};
@@ -181,6 +455,185 @@
color Col[],CoulDefaut;
CoulDefaut=white;
%
+ boolean Codes,Allume[][],AColorier;
+ Codes=\useKV[ClesPatron]{Codes};
+ AColorier=\useKV[ClesPatron]{AColorier};
+ if AColorier:
+ EcartColorier=\useKV[ClesPatron]{EcartColorier};
+ fi;
+ %
+ vardef Allumage(text t)=
+ nblignes:=-1;
+ for p_=t:
+ Long:=length p_;
+ nblignes:=nblignes+1;
+ for k=0 upto Long-1:
+ Allume[nblignes][k]=false;
+ endfor;
+ endfor;
+ enddef;
+ %
+ vardef Patron(text t)=
+ nblignes:=-1;
+ nbcol:=0;
+ nbfaces:=0;
+ for p_=t:
+ Long:=length p_;
+ nblignes:=nblignes+1;
+ nbcolonnes:=0;
+ for k=0 upto Long-1:
+ nbcolonnes:=nbcolonnes+1;
+ if substring(k,k+1) of p_="x":
+ Allume[nblignes][k]:=true;
+ nbfaces:=nbfaces+1;
+ nbcol:=nbcol+1;
+ if (unknown Col[nbcol]):
+ else:
+ if Col[nbcol]=white:
+ else:
+ if AColorier=false:
+ fill ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes))) withcolor Col[nbcol];
+ fi;
+ fi;
+ fi;
+ C[nbfaces]=(center unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes));
+ M[nbfaces]=point(0) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+ N[nbfaces]=point(1) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+ O[nbfaces]=point(2) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+ P[nbfaces]=point(3) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)));
+ trace M[nbfaces]--P[nbfaces];
+ trace N[nbfaces]--O[nbfaces];
+ trace P[nbfaces]--O[nbfaces];
+ trace M[nbfaces]--N[nbfaces];
+ fi;
+ endfor;
+ endfor;
+ enddef;
+ %
+ vardef EffectuerTraces=
+ if Codes:
+ \useKV[ClesPatron]{Traces};
+ fi;
+ enddef;
+}%
+
+\def\MPPatronCube#1#2{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ \MPPatronCubeCode
+ %
+ n:=0;
+ for p_=#2:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ Col[n]=CoulDefaut;
+ fi;
+ endfor;
+ %
+ Allumage(#1);
+ if AColorier:
+ drawoptions(dashed withdots scaled 0.5);
+ fi;
+ Patron(#1);
+ if AColorier:
+ drawoptions();
+ toto:=0;
+ for l=0 upto nblignes:
+ for k=0 upto Long-1:
+ if Allume[l][k]:
+ toto:=toto+1;
+ % trait vertical gauche
+ if k=0:
+% trace M[toto]--P[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[M[toto],P[toto]])--((t/EcartColorier)[M[toto],P[toto]]+(2*unitvector(P[toto]-M[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l][k-1]=false:
+% trace M[toto]--P[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[M[toto],P[toto]])--((t/EcartColorier)[M[toto],P[toto]]+(2*unitvector(P[toto]-M[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+ % trait vertical droit
+ if k=Long-1:
+ % trace N[toto]--O[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[N[toto],O[toto]])--((t/EcartColorier)[N[toto],O[toto]]+(2*unitvector(O[toto]-N[toto])) rotated 90);
+ endfor;
+ else:
+ if Allume[l][k+1]=false:
+% trace N[toto]--O[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[N[toto],O[toto]])--((t/EcartColorier)[N[toto],O[toto]]+(2*unitvector(O[toto]-N[toto])) rotated 90);
+ endfor;
+ fi;
+ fi;
+ % trait horizontal haut
+ if l=0:
+% trace P[toto]--O[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[P[toto],O[toto]])--((t/EcartColorier)[P[toto],O[toto]]+(2*unitvector(O[toto]-P[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l-1][k]=false:
+% trace P[toto]--O[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[P[toto],O[toto]])--((t/EcartColorier)[P[toto],O[toto]]+(2*unitvector(O[toto]-P[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+ % trait horizontal bas
+ if l=nblignes:
+% trace M[toto]--N[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[M[toto],N[toto]])--((t/EcartColorier)[M[toto],N[toto]]+(2*unitvector(M[toto]-N[toto])) rotated -90);
+ endfor;
+ else:
+ if Allume[l+1][k]=false:
+% trace M[toto]--N[toto] dashed evenly;
+ for t=1 upto EcartColorier-1:
+ trace ((t/EcartColorier)[M[toto],N[toto]])--((t/EcartColorier)[M[toto],N[toto]]+(2*unitvector(M[toto]-N[toto])) rotated -90);
+ endfor;
+ fi;
+ fi;
+ fi;
+ endfor;
+ endfor;
+ fi;
+ EffectuerTraces;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={\MPPatronCubeCode;}]
+ %
+ n:=0;
+ for p_=#2:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ Col[n]=CoulDefaut;
+ fi;
+ endfor;
+ %
+ Patron(#1);
+ EffectuerTraces;
+ \end{mpost}
+ \fi
+}
+
+\def\MPPatronCubeCodeold{%
+ Arete=\useKV[ClesPatron]{Arete};
+ %
+ pair C[],M[],N[],O[],P[];
+ %
+ color Col[],CoulDefaut;
+ CoulDefaut=white;
+ %
boolean Codes;
Codes=\useKV[ClesPatron]{Codes};
vardef Patron(text t)=
@@ -221,7 +674,7 @@
enddef;
}%
-\def\MPPatronCube#1#2{%
+\def\MPPatronCubeold#1#2{%
\ifluatex
\mplibforcehmode
\begin{mplibcode}
@@ -259,7 +712,7 @@
\fi
}
-\def\MPPatronPaveCode{%
+\def\MPPatronPaveCodeold{%
Largeur=\useKV[ClesPatron]{Largeur};
Hauteur=\useKV[ClesPatron]{Hauteur};
Profondeur=\useKV[ClesPatron]{Profondeur};
@@ -330,7 +783,7 @@
for k=1 upto Long-1:
if substring(k,k+1) of p_="o":
if k=1:
- PathPave:=(unitsquare scaled 0);
+ PathPave:=(unitsquare scaled 0) shifted ((0,-1));
fi;
elseif substring(k,k+1) of p_="l":
nbcol:=nbcol+1;
@@ -380,7 +833,7 @@
enddef;
}%
-\def\MPPatronPave#1#2{%
+\def\MPPatronPaveold#1#2{%
\ifluatex
\mplibforcehmode
\begin{mplibcode}
@@ -397,7 +850,7 @@
%
LectureLargeur(#1);
Patron(#1);
- EffectuerTraces;
+ %EffectuerTraces;
\end{mplibcode}
\else
\begin{mpost}[mpsettings={\MPPatronPaveCode;}]
diff --git a/macros/latex/contrib/profcollege/latex/PfCPattern.tex b/macros/latex/contrib/profcollege/latex/PfCPattern.tex
index 29fa45c08f..fb6f0bf9f3 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPattern.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPattern.tex
@@ -1,6 +1,10 @@
%%%
% Visual Pattern
%%%
+\def\filedatePattern{2024/08/04}%
+\def\fileversionPattern{0.1}%
+\message{-- \filedatePattern\space v\fileversionPattern}%
+%
\setKVdefault[Pattern]{Type=1,Etape=3}
\NewDocumentCommand\VisualPattern{o}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCPavage.tex b/macros/latex/contrib/profcollege/latex/PfCPavage.tex
index 2d25df1b99..4dabb04411 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPavage.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPavage.tex
@@ -1,6 +1,10 @@
%%%
% Pavage
%%%
+\def\filedatePavage{2024/08/04}%
+\def\fileversionPavage{0.1}%
+\message{-- \filedatePavage\space v\fileversionPavage}%
+%
\setKVdefault[Pavage]{%
Before=false,
Niveau=3,
diff --git a/macros/latex/contrib/profcollege/latex/PfCPixelArt.tex b/macros/latex/contrib/profcollege/latex/PfCPixelArt.tex
index 77eecfcb42..503e2e1182 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPixelArt.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPixelArt.tex
@@ -1,11 +1,16 @@
%%%
% PixelArt
%%%
+\def\filedatePixelArt{2024/08/04}%
+\def\fileversionPixelArt{0.1}%
+\message{-- \filedatePixelArt\space v\fileversionPixelArt}%
+%
\newtoks\toklistePANombre%
\def\UpdatetoksPANombre#1\nil{\addtotok\toklistePANombre{"#1",}}%
-\setKVdefault[ClesPixelArt]{Largeur=29,Hauteur=29,Solution=false,Lettres=ABCDEFGHIJK,Nombres=false,ListeCouleurs={Orange,Red,LightGray,Maroon,Purple,black,black,Plum,Orange,White,White},Unite=5mm,Geant=false,HauteurD=1,LargeurD=1,Complet=false,Numero=1,Separations=false}%
+\setKVdefault[ClesPixelArt]{Largeur=29,Hauteur=29,Solution=false,Lettres=ABCDEFGHIJK,Nombres=false,ListeCouleurs={Orange,Red,LightGray,Maroon,Purple,black,black,Plum,Orange,White,White},Unite=5mm,Geant=false,HauteurD=1,LargeurD=1,Complet=false,Numero=1,Separations=false,Deforme=false,Coefx=0.25,Coefy=0.25,Borne=false,Graines=false}%
\defKV[ClesPixelArt]{ListeNombres=\setKV[ClesPixelArt]{Nombres}}%
+\defKV[ClesPixelArt]{Graine=\setKV[ClesPixelArt]{Graines}}%
\NewDocumentCommand\PixelArt{o m}{%
\toklistePANombre{}%
@@ -26,17 +31,23 @@
}%
}%
}{%
- \quotient{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Hauteur}/\useKV[ClesPixelArt]{HauteurD}}}%
- \modulo{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Hauteur}/\useKV[ClesPixelArt]{HauteurD}}}%
-% quotient = \the\intquotient -- remainder = \the\remainder :
+% \quotient{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Hauteur}/\useKV[ClesPixelArt]{HauteurD}}}%
+% \modulo{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Hauteur}/\useKV[ClesPixelArt]{HauteurD}}}%
+ \quotient{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Largeur}/\useKV[ClesPixelArt]{LargeurD}}}%
+ \modulo{\fpeval{\useKV[ClesPixelArt]{Numero}-1}}{\fpeval{\useKV[ClesPixelArt]{Largeur}/\useKV[ClesPixelArt]{LargeurD}}}%
+% quotient = \the\intquotient -- remainder = \the\remainder :\\
\BuildPixelArtGeant{#2}{\useKV[ClesPixelArt]{Lettres}}{\ListeAvantCouleurs}{\the\toklistePANombre}{\the\intquotient}{\the\remainder}%
}%
}{%
- \BuildPixelArt{#2}{\useKV[ClesPixelArt]{Lettres}}{\ListeAvantCouleurs}{\the\toklistePANombre}%
+ \ifboolKV[ClesPixelArt]{Deforme}{%
+ \BuildPixelArtDeforme{#2}{\useKV[ClesPixelArt]{Lettres}}{\ListeAvantCouleurs}{\the\toklistePANombre}%
+ }{%
+ \BuildPixelArt{#2}{\useKV[ClesPixelArt]{Lettres}}{\ListeAvantCouleurs}{\the\toklistePANombre}%
+ }%
}%
}%
-\NewDocumentCommand\BuildPixelArt{m m m m}{%
+\NewDocumentCommand\BuildPixelArtDeforme{m m m m}{%
\ifluatex
\mplibforcehmode
\begin{mplibcode}
@@ -46,6 +57,39 @@
hauteurd:=\useKV[ClesPixelArt]{HauteurD};
Unite:=\useKV[ClesPixelArt]{Unite};
+ %Deformation
+ Coefx=\useKV[ClesPixelArt]{Coefx};
+ Coefy=\useKV[ClesPixelArt]{Coefy};
+ boolean Borne,Graines;
+ Borne=\useKV[ClesPixelArt]{Borne};
+ Graines=\useKV[ClesPixelArt]{Graines};
+ if Graines:
+ randomseed:=\useKV[ClesPixelArt]{Graine};
+ fi;
+ %
+ pair M[][];
+ for l=1 upto hauteur+1:
+ for c=1 upto largeur+1:
+ if Borne:
+ if (l=1) or (l=hauteur+1):
+ M[l][c]=Unite*(c,l)+Unite*(-Coefx+uniformdeviate(2*Coefx),0);
+ if (c=1) or (c=largeur+1):
+ M[l][c]:=Unite*(c,l);
+ fi;
+ else:
+ if (c=1) or (c=largeur+1):
+ M[l][c]=Unite*(c,l-1)+Unite*(0,uniformdeviate(Coefy));
+ else:
+ M[l][c]=Unite*(c,l)+Unite*(-Coefx+uniformdeviate(2*Coefx),-Coefy+uniformdeviate(2*Coefy));
+ fi;
+ fi;
+ else:
+ M[l][c]=Unite*(c,l)+Unite*(-Coefx+uniformdeviate(2*Coefx),-Coefy+uniformdeviate(2*Coefy));
+ fi;
+ %dotlabel("",M[l][c]);
+ endfor;
+ endfor;
+
boolean Solution,Nombres,Separations;
Solution:=\useKV[ClesPixelArt]{Solution};
Nombres:=\useKV[ClesPixelArt]{Nombres};
@@ -54,7 +98,7 @@
string BaseLettres;
BaseLettres=str #2;
numeric EchelleScale;
- EchelleScale=Unite/5mm;
+ EchelleScale=Unite/10mm;
color ColorEntier[],ColFond;
n:=0;
@@ -84,11 +128,107 @@
if Nombres:
for m=0 upto (length BaseLettres-1):
if (substring(p,p+1) of p_)=substring(m,m+1) of BaseLettres:
- label(TEX(RetiensNombres[m+1]) scaled EchelleScale,((l-1)*Unite,(h-1)*Unite));
+ label(TEX(RetiensNombres[m+1]) scaled EchelleScale,iso(M[h+1][l],M[h][l],M[h][l+1],M[h+1][l+1]));
fi;
endfor;
else:
- label(TEX(substring(p,p+1) of p_) scaled EchelleScale,((l-1)*Unite,(h-1)*Unite));
+ label(TEX(substring(p,p+1) of p_) scaled EchelleScale,iso(M[h+1][l],M[h][l],M[h][l+1],M[h+1][l+1]));
+ fi;
+ if Solution:
+ for m=0 upto (length BaseLettres-1):
+ if (substring(p,p+1) of p_)=substring(m,m+1) of BaseLettres:
+ ColFond:=ColorEntier[m+1];
+ fi;
+ endfor;
+ if unknown ColFond: else: fill polygone(M[h+1][l],M[h][l],M[h][l+1],M[h+1][l+1]) withcolor ColFond fi;
+ fi;
+ trace polygone(M[h+1][l],M[h][l],M[h][l+1],M[h+1][l+1]);
+ fi;
+ endfor;
+ endfor;
+ closefrom nomfichier;
+ enddef;
+
+ Lecturecsv("#1");
+% if Separations:
+% drawoptions(withcolor Purple);
+% for k=hauteur step -hauteurd until 0:
+% draw (Unite*(-1,k-0.5)--Unite*(largeur,k-0.5)) withpen pencircle scaled 1.25;
+% endfor;
+% for k=0 step largeurd until largeur:
+% draw (Unite*(k-0.5,hauteur+0.125)--Unite*(k-0.5,-0.875)) withpen pencircle scaled 1.25;
+% endfor;
+% drawoptions();
+% fi;
+ \end{mplibcode}
+\fi
+}%
+
+\NewDocumentCommand\BuildPixelArt{m m m m}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ largeur:=\useKV[ClesPixelArt]{Largeur};
+ hauteur:=\useKV[ClesPixelArt]{Hauteur};
+ largeurd:=\useKV[ClesPixelArt]{LargeurD};
+ hauteurd:=\useKV[ClesPixelArt]{HauteurD};
+ Unite:=\useKV[ClesPixelArt]{Unite};
+
+ boolean Solution,Nombres,Separations;
+ Solution:=\useKV[ClesPixelArt]{Solution};
+ Nombres:=\useKV[ClesPixelArt]{Nombres};
+ Separations:=\useKV[ClesPixelArt]{Separations};
+
+ string BaseLettres;
+ BaseLettres=str #2;
+ numeric EchelleScale;
+ EchelleScale=Unite/5mm;
+
+ color ColorEntier[],ColFond;
+ n:=0;
+ for p_=#3:
+ n:=n+1;
+ ColorEntier[n]:=p_;
+ endfor;
+
+ string RetiensNombres[];
+ if Nombres:
+ k:=0;
+ for p_=#4:
+ k:=k+1;
+ RetiensNombres[k]=p_;
+ endfor;
+ else:
+ m:=0;
+ for p_=0 upto n-1:
+ m:=m+1;
+ RetiensNombres[m]=substring(p_,p_+1) of BaseLettres;
+ endfor;
+ fi;
+
+ picture Etiquette[];
+ for k=1 upto n:
+ Etiquette[k]=image(
+ label(TEX(RetiensNombres[k]) scaled EchelleScale,(0,0));
+ );
+ endfor;
+
+ vardef Lecturecsv(expr nomfichier)=
+ for h=hauteur downto 1:
+ string p_;
+ p_=readfrom nomfichier;
+ l:=0;
+ for p=0 step 2 until 2*largeur-2:
+ l:=l+1;
+ if Solution=false:
+ if (substring(p,p+1) of p_)="-":
+ else:
+ for m=0 upto (length BaseLettres-1):
+ if (substring(p,p+1) of p_)=substring(m,m+1) of BaseLettres:
+ draw Etiquette[m+1] shifted((l-1)*Unite,(h-1)*Unite);
+ fi;
+ endfor;
+ fi;
fi;
if Solution:
for m=0 upto (length BaseLettres-1):
@@ -99,7 +239,6 @@
if unknown ColFond: else: fill (unitsquare scaled Unite) shifted ((l-1)*Unite-0.5*Unite,(h-1)*Unite-0.5*Unite) withcolor ColFond fi;
fi;
trace (unitsquare scaled Unite) shifted ((l-1)*Unite-0.5*Unite,(h-1)*Unite-0.5*Unite);
- fi;
endfor;
endfor;
closefrom nomfichier;
@@ -118,10 +257,12 @@
fi;
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={largeur:=\useKV[ClesPixelArt]{Largeur}; hauteur:=\useKV[ClesPixelArt]{Hauteur}; Unite:=\useKV[ClesPixelArt]{Unite}; boolean Solution,Nombres; Solution:=\useKV[ClesPixelArt]{Solution}; Nombres:=\useKV[ClesPixelArt]{Nombres};}]
+ \begin{mpost}[mpsettings={largeur:=\useKV[ClesPixelArt]{Largeur}; hauteur:=\useKV[ClesPixelArt]{Hauteur}; Unite:=\useKV[ClesPixelArt]{Unite}; boolean Solution,Nombres,Separations; Solution:=\useKV[ClesPixelArt]{Solution}; Nombres:=\useKV[ClesPixelArt]{Nombres}; Separations:=\useKV[ClesPixelArt]{Separations};}]
string BaseLettres;
BaseLettres=str #2;
-
+ numeric EchelleScale;
+ EchelleScale=Unite/5mm;
+
color ColorEntier[],ColFond;
n:=0;
for p_=#3:
@@ -131,13 +272,26 @@
string RetiensNombres[];
if Nombres:
- n:=0;
+ k:=0;
for p_=#4:
- n:=n+1;
- RetiensNombres[n]=p_;
+ k:=k+1;
+ RetiensNombres[k]=p_;
+ endfor;
+ else:
+ m:=0;
+ for p_=0 upto n-1:
+ m:=m+1;
+ RetiensNombres[m]=substring(p_,p_+1) of BaseLettres;
endfor;
fi;
-
+
+ picture Etiquette[];
+ for k=1 upto n:
+ Etiquette[k]=image(
+ label(LATEX(RetiensNombres[k]) scaled EchelleScale,(0,0));
+ );
+ endfor;
+
vardef Lecturecsv(expr nomfichier)=
for h=hauteur downto 1:
string p_;
@@ -145,16 +299,15 @@
l:=0;
for p=0 step 2 until 2*largeur-2:
l:=l+1;
+ if Solution=false:
if (substring(p,p+1) of p_)="-":
else:
- if Nombres:
for m=0 upto (length BaseLettres-1):
if (substring(p,p+1) of p_)=substring(m,m+1) of BaseLettres:
- label(LATEX(RetiensNombres[m+1]),((l-1)*Unite,(h-1)*Unite));
+ draw Etiquette[m+1] shifted((l-1)*Unite,(h-1)*Unite);
fi;
endfor;
- else:
- label(LATEX(substring(p,p+1) of p_),((l-1)*Unite,(h-1)*Unite));
+ fi;
fi;
if Solution:
for m=0 upto (length BaseLettres-1):
@@ -165,21 +318,30 @@
if unknown ColFond: else: fill (unitsquare scaled Unite) shifted ((l-1)*Unite-0.5*Unite,(h-1)*Unite-0.5*Unite) withcolor ColFond fi;
fi;
trace (unitsquare scaled Unite) shifted ((l-1)*Unite-0.5*Unite,(h-1)*Unite-0.5*Unite);
- fi;
endfor;
endfor;
closefrom nomfichier;
enddef;
Lecturecsv("#1");
+ if Separations:
+ drawoptions(withcolor Purple);
+ for k=hauteur step -hauteurd until 0:
+ draw (Unite*(-1,k-0.5)--Unite*(largeur,k-0.5)) withpen pencircle scaled 1.25;
+ endfor;
+ for k=0 step largeurd until largeur:
+ draw (Unite*(k-0.5,hauteur+0.125)--Unite*(k-0.5,-0.875)) withpen pencircle scaled 1.25;
+ endfor;
+ drawoptions();
+ fi;
\end{mpost}
\fi
-}
+}%
\NewDocumentCommand\BuildPixelArtGeant{m m m m m m}{%
- \ifluatex
- \mplibforcehmode
- \begin{mplibcode}
+ \ifluatex%
+ \mplibforcehmode%
+ \begin{mplibcode}%
largeur:=\useKV[ClesPixelArt]{Largeur};
hauteur:=\useKV[ClesPixelArt]{Hauteur};
largeurd:=\useKV[ClesPixelArt]{LargeurD};
@@ -251,5 +413,5 @@
Lecturecsv("#1");
\end{mplibcode}
- \fi
-} \ No newline at end of file
+ \fi%
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCPourcentage.tex b/macros/latex/contrib/profcollege/latex/PfCPourcentage.tex
index 1f6f18b19b..03177d14dc 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPourcentage.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPourcentage.tex
@@ -1,6 +1,10 @@
%%%
% Application : pourcentage
%%%
+\def\filedatePourcentage{2024/08/04}%
+\def\fileversionPourcentage{0.1}%
+\message{-- \filedatePourcentage\space v\fileversionPourcentage}%
+%
\setKVdefault[ClesPourcentage]{Appliquer,Calculer=false,Augmenter=false,Reduire=false,Fractionnaire=false,Decimal,Formule=false,Concret=false,GrandeurA=Grandeur A,GrandeurB=Total,Largeur=1cm,MotReduction=diminution,AideTableau=false,ColorFill=white,CouleurTab=gray!15}
\defKV[ClesPourcentage]{Unite=\setKV[ClesPourcentage]{Concret}}
\newcommand\Pourcentage[3][]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCProbaFrequence.tex b/macros/latex/contrib/profcollege/latex/PfCProbaFrequence.tex
new file mode 100644
index 0000000000..e3a5f04b62
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCProbaFrequence.tex
@@ -0,0 +1,189 @@
+%%%
+% Probabilité et fréquence
+%%%
+\def\filedateProbaFrequence{2024/08/04}%
+\def\fileversionProbaFrequence{0.1}%
+\message{-- \filedateProbaFrequence\space v\fileversionProbaFrequence}%
+%
+\setKVdefault[PfCFrequence]{Couleur=false,Lancers=1,Legende=false}%
+\defKV[PfCFrequence]{ListeCouleurs=\setKV[PfCFrequence]{Couleur}}%
+\defKV[PfCFrequence]{Legendes=\setKV[PfCFrequence]{Legende}\setsepchar{,}\reademptyitems\readlist*\PfMListeLegendes{#1}\reademptyitems}%
+
+\newtoks\tokPfMListeObjets%
+\newtoks\tokPfMListeLegendes%
+\def\UpdatetoksObj#1\nil{\addtotok\tokPfMListeObjets{#1,}}%
+\def\UpdatetoksLegendes#1\nil{\addtotok\tokPfMListeLegendes{"#1",}}%
+
+\NewDocumentCommand\ProbaFrequence{om}{%
+ % #1 options
+ % #2 répartition
+ \tokPfMListeObjets{}%
+ \tokPfMListeLegendes{}%
+ \useKVdefault[PfCFrequence]%
+ \setKV[PfCFrequence]{#1}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\PfMListeObjets{#2}%
+ \reademptyitems%
+ \foreachitem\compteur\in\PfMListeObjets{\expandafter\UpdatetoksObj\compteur\nil}%
+ \ifboolKV[PfCFrequence]{Legende}{%
+ \foreachitem\compteur\in\PfMListeLegendes{\expandafter\UpdatetoksLegendes\compteur\nil}%
+ }{}%
+ \BuildFrequence{\the\tokPfMListeObjets}{\the\tokPfMListeLegendes}%
+}%
+
+\NewDocumentCommand\BuildFrequence{mm}{%
+ \ifluatex
+ \mplibnumbersystem{decimal}%
+ \begin{Geometrie}[CoinBG={u*(-5,0)},CoinHD={u*(7.5,7.5)}]%6 en ordonnee
+ Lancers = \useKV[PfCFrequence]{Lancers};
+ LegendeVide=0;
+ %
+ color Col[];
+ if \useKV[PfCFrequence]{Couleur}:
+ n:=0;
+ for p_=\useKV[PfCFrequence]{ListeCouleurs}:
+ n:=n+1;
+ if color p_:
+ Col[n]=p_;
+ else:
+ LegendeVide:=n;
+ fi;
+ endfor;
+ fi;
+ %
+ string Legende[];
+ vardef EcrireLegendes(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ if p_="":
+ LegendeVide:=n;
+ else:
+ Legende[n]=p_;
+ fi;
+ endfor;
+ n:=0;
+ enddef;
+ %
+ vardef LectureDonnees(text t)=
+ numeric A[];
+ numeric SommeTotale;
+ SommeTotale=0;
+ n:=0;
+ for p_=t:
+ n:=incr(n);
+ A[n]=p_;
+ SommeTotale:=SommeTotale+p_;
+ endfor;
+ total:=n;
+ enddef;
+ %
+ LectureDonnees(#1);
+ if \useKV[PfCFrequence]{Legende}:
+ EcrireLegendes(#2);
+ fi;
+ %
+ numeric borne[];
+ borne0=0;
+ for k=1 upto total:
+ borne[k]=borne[k-1]+A[k];
+ endfor;
+ %
+ x.u:=5mm;
+ y.u:=5mm;
+ quad.u:=5mm;
+ unites(1/(170*Lancers),5);
+ origine((1,4));
+ % grille
+ for k=1 upto 11:
+ draw (pp(0,0)--pp(0,1.1)) shifted(pp(k*Lancers*100,0)-pp(0,0)) withcolor gris;
+ draw (pp(0,0)--pp(Lancers*(1000+100),0)) shifted(pp(0,k/10)-pp(0,0)) withcolor gris;
+ endfor;
+ % axe
+ drawarrow pp(0,0)--pp(0,1.1);
+ drawarrow pp(0,0)--pp(Lancers*(1000+100),0);
+ % tiret
+ for k=1 upto 10:
+ draw (pp(k*Lancers*100,0)+u*(0,-0.05))--(pp(k*Lancers*100,0)+u*(0,0.05));
+ endfor;
+ numeric nb[],freq[];
+ pair Freq[][];
+ for k=1 upto total:
+ nb[k]:=0;
+ freq[k]=0;
+ endfor;
+ %
+ for k=1 upto (Lancers*1000):
+ nn:=floor(uniformdeviate(SommeTotale))+1;
+ if nn=0:
+ message("il est nul...");
+ fi;
+ for l=1 upto total:
+ if (nn>borne[l-1]) and (nn<borne[l]+1):
+ nb[l]:=nb[l]+1;
+ fi;
+ freq[l]:=nb[l]/k;
+ Freq[l][k]=pp(k,freq[l]);
+ endfor;
+ endfor;
+ %
+ def Style=enddef;
+ def Stylea=dashed evenly enddef;
+ def Styleb=dashed withdots scaled 1/2 enddef;
+ def Stylec=dashed dashpattern(on 1 off 1) enddef;
+ def Styled=dashed withdots scaled 1/4 enddef;
+ def Stylee=dashed dashpattern(on 6 off2) enddef;
+ parc:=0;
+ for l=1 upto total:
+ if \useKV[PfCFrequence]{Couleur}=false:
+ if (l mod 6)=1:
+ elseif (l mod 6)=2:
+ drawoptions(Stylea);
+ elseif (l mod 6)=3:
+ drawoptions(Styleb);
+ elseif (l mod 6)=4:
+ drawoptions(Stylec);
+ elseif (l mod 6)=5:
+ drawoptions(Styled);
+ else:
+ drawoptions(Stylee);
+ fi;
+ if \useKV[PfCFrequence]{Legende}:
+ parc:=incr(parc);
+ if l<>LegendeVide:
+ draw pp(Lancers*400*((parc-1) mod 3),-0.25-0.1*((parc-1) div 3))--pp(Lancers*400*((parc-1) mod 3)+125,-0.25-0.1*((parc-1) div 3));
+ label.rt(TEX(Legende[l]),pp(Lancers*400*((parc-1) mod 3)+125,-0.25-0.1*((parc-1) div 3)));
+ else:
+ parc:=parc-1;
+ fi;
+ fi;
+ fi;
+ %
+ if l<>LegendeVide:
+ if Lancers<1:
+ trace Freq[l][1]
+ for k=2 upto (1000*Lancers):
+ --Freq[l][k]
+ endfor withcolor if unknown Col[l]:black else:Col[l] fi;
+ else:
+ trace Freq[l][1]
+ for k=5 step 4 until (1000*Lancers):
+ --Freq[l][k]
+ endfor withcolor if unknown Col[l]:black else:Col[l] fi;
+ fi;
+ fi;
+ endfor;
+ drawoptions();
+ for k=1 upto 10 :
+ label.bot(TEX("\scriptsize\num{"&decimal((100*k)*Lancers)&"}"),pp(Lancers*100k,0));
+ endfor;
+ for k=2 step 2 until 10:
+ label.lft(TEX("\scriptsize\num{"&decimal(k/10)&"}"),pp(0,k/10));
+ endfor;
+ label.llft(TEX("\scriptsize 0"),pp(0,0));
+ label.urt(TEX("Fréquence"),pp(0,1));
+ label.bot(TEX("Nombre de lancers"),pp(0.5*Lancers*(1000+200),-0.075));
+ \end{Geometrie}
+ \mplibnumbersystem{scaled}
+ \fi
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCProbabilites.tex b/macros/latex/contrib/profcollege/latex/PfCProbabilites.tex
index 7ed834a61e..73bafa9ba2 100644
--- a/macros/latex/contrib/profcollege/latex/PfCProbabilites.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCProbabilites.tex
@@ -1,7 +1,11 @@
%%%
% Proba
%%%
-\setKVdefault[ClesProba]{Echelle=false,Arbre=false,Branche=2,Angle=60,Rayon=0.25,LongueurEchelle=5,Affichage=0,Grille=1,Incline}
+\def\filedateProba{2024/08/15}%
+\def\fileversionProba{0.1a}%
+\message{-- \filedateProba\space v\fileversionProba}%
+%
+\setKVdefault[ClesProba]{Echelle=false,Arbre=false,Branche=2,Angle=60,Rayon=0.25,LongueurEchelle=5,Affichage=0,Grille=1,Incline,SansProba=false}
\def\Updatetoksproba#1/#2\nil{\addtotok\toklistepointproba{"#1","\footnotesize #2",}}
\def\Updatetoksprobapdf#1/#2\nil{\addtotok\toklistepointproba{"#1","\noexpand\footnotesize #2",}}
@@ -35,6 +39,8 @@
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+ boolean SansProba;
+ SansProba=\useKV[ClesProba]{SansProba};
pair A,B,C[],D[];%les noeuds de l'arbre
%Figure(-10u,-10u,10u,10u);
A=u*(1,1);
@@ -58,8 +64,10 @@
fi;
marque_s:=marque_s*2;
labeloffset:=labeloffset*3;
+ if SansProba=false:
label.bot(btex 0 etex,A);
label.bot(btex 1 etex,B);
+ fi;
labeloffset:=labeloffset/3;
n:=1;%compter les informations
k:=1;% compter les informations noeud pour les placer
@@ -93,7 +101,7 @@
toto(#2);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={input PfCGeometrie;boolean SansProba;SansProba=\useKV[ClesProba]{SansProba};}]
pair A,B,C[],D[];%les noeuds de l'arbre
Figure(-10u,-10u,10u,10u);
A=u*(1,1);
@@ -117,8 +125,10 @@
fi;
marque_s:=marque_s*2;
labeloffset:=labeloffset*3;
+ if SansProba=false:
label.bot(btex 0 etex,A);
label.bot(btex 1 etex,B);
+ fi;
labeloffset:=labeloffset/3;
n:=1;%compter les informations
k:=1;% compter les informations noeud pour les placer
diff --git a/macros/latex/contrib/profcollege/latex/PfCProgrammeCalcul.tex b/macros/latex/contrib/profcollege/latex/PfCProgrammeCalcul.tex
index f1bdc0307f..871f80d650 100644
--- a/macros/latex/contrib/profcollege/latex/PfCProgrammeCalcul.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCProgrammeCalcul.tex
@@ -1,6 +1,10 @@
%%%%
% Prog de calculs "simples"
%%%%
+\def\filedateProgCalcul{2024/08/04}%
+\def\fileversionProgCalcul{0.1}%
+\message{-- \filedateProgCalcul\space v\fileversionProgCalcul}%
+%
\setKVdefault[ClesProg]{%
Ecart=2em,%
Direct,%
diff --git a/macros/latex/contrib/profcollege/latex/PfCPropor.tex b/macros/latex/contrib/profcollege/latex/PfCPropor.tex
index 1e6526f41b..1c8aba3324 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPropor.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPropor.tex
@@ -1,6 +1,10 @@
%%%
% Proportionnalit\'e
%%%
+\def\filedatePropor{2024/09/04}%
+\def\fileversionPropor{0.1a}%
+\message{-- \filedatePropor\space v\fileversionPropor}%
+%
\setKVdefault[ClesPropor]{GrandeurA=Grandeur A,GrandeurB=Grandeur B,Largeur=1cm,Math=false,Stretch=1,ColorFill=white,CouleurTab=gray!15,Vertical=false,Simple=false,Condense=false}%
\tikzstyle{FlechePropor}=[-stealth]
@@ -201,49 +205,51 @@
\NewDocumentCommand\FlechePCG{mm}{%
\begin{tikzpicture}[remember picture,overlay,node distance=\getstrut\ht]%
- \node[inner sep=0pt] (MilieuH-#1) at ($(ProporG-#1)!0.25!(ProporD-#1)$) {};%
- \node[inner sep=0pt] (MilieuH-#2) at ($(ProporG-#2)!0.25!(ProporD-#2)$) {};%
- \node[inner sep=0pt] (MilieuB-#1) at ($(ProporG-#1)!0.75!(ProporD-#1)$) {};%
- \node[inner sep=0pt] (MilieuB-#2) at ($(ProporG-#2)!0.75!(ProporD-#2)$) {};%
+ \node[inner sep=0pt] (MilieuH-#1) at ($(ProporH-#1)!\PfCCoeffH!(ProporB-#1)$) {};%
+ \node[inner sep=0pt] (MilieuH-#2) at ($(ProporH-#2)!\PfCCoeffH!(ProporB-#2)$) {};%
+ \node[inner sep=0pt] (MilieuB-#1) at ($(ProporH-#1)!\PfCCoeffB!(ProporB-#1)$) {};%
+ \node[inner sep=0pt] (MilieuB-#2) at ($(ProporH-#2)!\PfCCoeffB!(ProporB-#2)$) {};%
\xintifboolexpr{#1<#2}{%
\coordinate[right of=MilieuH-#1] (aux1);%
- \coordinate[right of=MilieuH-#2] (aux2);%
- \coordinate[left of=MilieuB-#1] (aux3);%
+ \coordinate[left of=MilieuH-#2] (aux2);%
+ \coordinate[right of=MilieuB-#1] (aux3);%
\coordinate[left of=MilieuB-#2] (aux4);%
- \draw[out=30,in=-30,gray] (aux3) to (aux4);
+ \draw[FlechePropor,gray] (aux4) -- (aux1);
+ \draw[out=-30,in=30,gray] (aux2) to (aux4);
}{%
- \coordinate[right of=MilieuH-#1] (aux1);%
+ \coordinate[left of=MilieuH-#1] (aux1);%
\coordinate[right of=MilieuH-#2] (aux2);%
\coordinate[left of=MilieuB-#1] (aux3);%
- \coordinate[left of=MilieuB-#2] (aux4);%
- \draw[out=-30,in=30,gray] (aux3) to (aux4);
+ \coordinate[right of=MilieuB-#2] (aux4);%
+ \draw[FlechePropor,gray] (aux1) -- (aux4);
+ \draw[out=30,in=-30,gray] (aux3) to (aux1);
}%
\draw[gray] (aux2) -- (aux3);
- \draw[FlechePropor,gray] (aux4) -- (aux1);
\end{tikzpicture}%
}%
\NewDocumentCommand\FlechePCD{mm}{%
\begin{tikzpicture}[remember picture,overlay,node distance=\getstrut\ht]%
- \node[inner sep=0pt] (MilieuH-#1) at ($(ProporG-#1)!0.25!(ProporD-#1)$) {};%
- \node[inner sep=0pt] (MilieuH-#2) at ($(ProporG-#2)!0.25!(ProporD-#2)$) {};%
- \node[inner sep=0pt] (MilieuB-#1) at ($(ProporG-#1)!0.75!(ProporD-#1)$) {};%
- \node[inner sep=0pt] (MilieuB-#2) at ($(ProporG-#2)!0.75!(ProporD-#2)$) {};%
+ \node[inner sep=0pt] (MilieuH-#1) at ($(ProporH-#1)!\PfCCoeffH!(ProporB-#1)$) {};%
+ \node[inner sep=0pt] (MilieuH-#2) at ($(ProporH-#2)!\PfCCoeffH!(ProporB-#2)$) {};%
+ \node[inner sep=0pt] (MilieuB-#1) at ($(ProporH-#1)!\PfCCoeffB!(ProporB-#1)$) {};%
+ \node[inner sep=0pt] (MilieuB-#2) at ($(ProporH-#2)!\PfCCoeffB!(ProporB-#2)$) {};%
\xintifboolexpr{#1<#2}{%
\coordinate[right of=MilieuH-#1] (aux1);%
- \coordinate[right of=MilieuH-#2] (aux2);%
- \coordinate[left of=MilieuB-#1] (aux3);%
+ \coordinate[left of=MilieuH-#2] (aux2);%
+ \coordinate[right of=MilieuB-#1] (aux3);%
\coordinate[left of=MilieuB-#2] (aux4);%
- \draw[out=150,in=-150,gray] (aux1) to (aux2);
+ \draw[FlechePropor,gray] (aux3) -- (aux2);
+ \draw[out=-150,in=150,gray] (aux1) to (aux3);
}{%
- \coordinate[right of=MilieuH-#1] (aux1);%
+ \coordinate[left of=MilieuH-#1] (aux1);%
\coordinate[right of=MilieuH-#2] (aux2);%
\coordinate[left of=MilieuB-#1] (aux3);%
- \coordinate[left of=MilieuB-#2] (aux4);%
- \draw[out=-150,in=150,gray] (aux1) to (aux2);
+ \coordinate[right of=MilieuB-#2] (aux4);%
+ \draw[FlechePropor,gray] (aux2) -- (aux3);
+ \draw[out=-150,in=150,gray] (aux2) to (aux4);
}%
\draw[gray] (aux4) -- (aux1);
- \draw[FlechePropor,gray] (aux2) -- (aux3);
\end{tikzpicture}%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCProprietesDroites.tex b/macros/latex/contrib/profcollege/latex/PfCProprietesDroites.tex
index ad9f1b0edb..fc74fea9c5 100644
--- a/macros/latex/contrib/profcollege/latex/PfCProprietesDroites.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCProprietesDroites.tex
@@ -1,6 +1,10 @@
%%%
% Ppt\'es des droites (6eme)
%%%
+\def\filedatePptesDroites{2024/08/04}%
+\def\fileversionPptesDroites{0.1}%
+\message{-- \filedatePptesDroites\space v\fileversionPptesDroites}%
+%
\setKVdefault[ClesDroites]{Brouillon=false,CitePropriete=false,Num=1,Figure=false,Remediation=false,FigureSeule=false}
\newcommand\Redaction[4][]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCPuissanceQuatre.tex b/macros/latex/contrib/profcollege/latex/PfCPuissanceQuatre.tex
index 1d8a929939..d51387cd78 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPuissanceQuatre.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPuissanceQuatre.tex
@@ -1,30 +1,40 @@
%%%
% Puissances 4
%%%
-\setKVdefault[ClesPQuatre]{Couleur=Gray,Largeur=2cm,LargeurUn=2cm,Multiplication,Entier,Nombre,Exposant=false,Libre=false,Texte=false,Echelle=2}%
+\def\filedatePquatre{2024/08/04}%
+\def\fileversionPquatre{0.1}%
+\message{-- \filedatePquatre\space v\fileversionPquatre}%
+%
+\setKVdefault[ClesPQuatre]{Couleur=Gray,Largeur=2cm,LargeurUn=2cm,Multiplication,Entier,Nombre,Exposant=false,Libre=false,Texte=false,Echelle=2,Correction=false}%
\defKV[ClesPQuatre]{Addition=\setKV[ClesPQuatre]{Multiplication=false}}%
\defKV[ClesPQuatre]{Relatif=\setKV[ClesPQuatre]{Entier=false}}%
\defKV[ClesPQuatre]{Puissance=\setKV[ClesPQuatre]{Exposant}}%
\defKV[ClesPQuatre]{Autre=\setKV[ClesPQuatre]{Nombre=false}\setKV[ClesPQuatre]{Libre}}%
\defKV[ClesPQuatre]{Consignes=\setKV[ClesPQuatre]{Texte}}%
+\defKV[ClesPQuatre]{Solution=\setKV[ClesPQuatre]{Correction}\setsepchar{,}\ignoreemptyitems\readlist*\PQuatreListeS{#1}\reademptyitems}%
+\defKV[ClesPQuatre]{Graine=\PfCGraineAlea{#1}}%
\newtoks\toklistePQuatreh%
\newtoks\toklistePQuatrev%
+\newtoks\toklistePQuatres%
\def\UpdatetoksPQuatreh#1\nil{\addtotok\toklistePQuatreh{"#1",}}%
\def\UpdatetoksPQuatrev#1\nil{\addtotok\toklistePQuatrev{"#1",}}%
+\def\UpdatetoksPQuatres#1\nil{\addtotok\toklistePQuatres{"#1",}}%
\NewDocumentCommand\PQuatre{o +m}{%
\useKVdefault[ClesPQuatre]%
\toklistePQuatreh{}%
\toklistePQuatrev{}%
+ \toklistePQuatres{}%
\setKV[ClesPQuatre]{#1}%
\ifboolKV[ClesPQuatre]{Nombre}{%
\ifboolKV[ClesPQuatre]{Exposant}{%
- \def\PQuatreListe{$10^{-10}$,$10^{-9}$,$10^{-8}$,$10^{-7}$,$10^{-6}$,$10^{-5}$,$10^{-4}$,$10^{-3}$,$10^{-2}$,$10^{2}$,$10^{3}$,$10^{4}$,$10^{5}$,$10^{6}$,$10^{7}$,$10^{8}$,$10^{9}$,$10^{10}$}%
+ \def\PQuatreListe{-10,-9,-8,-7,-6,-5,-4,-3,-2,2,3,4,5,6,7,8,9,10}%
\MelangeListe{\PQuatreListe}{7}%
- \readlist*\PQuatreListeH{\faa}%
+ \ignoreemptyitems\readlist*\PQuatreListeH{\faa}%
\MelangeListe{\PQuatreListe}{7}%
- \readlist*\PQuatreListeV{\faa}%
+ \ignoreemptyitems\readlist*\PQuatreListeV{\faa}%
+ \reademptyitems
\foreachitem\compteur\in\PQuatreListeH{\expandafter\UpdatetoksPQuatreh\compteur\nil}%
\foreachitem\compteur\in\PQuatreListeV{\expandafter\UpdatetoksPQuatrev\compteur\nil}%
}{%
@@ -39,7 +49,7 @@
\foreachitem\compteur\in\PQuatreListeV{\expandafter\UpdatetoksPQuatrev\compteur\nil}%
}{%
% On choisit aléatoirement les listes de nombres de -10 à -2 union 2 à 10 en faisant deux listes : horizontale et verticale
- \def\PQuatreListe{$-10$,$-9$,$-8$,$-7$,$-6$,$-5$,$-4$,$-3$,$-2$,2,3,4,5,6,7,8,9,10}%
+ \def\PQuatreListe{-10,-9,-8,-7,-6,-5,-4,-3,-2,2,3,4,5,6,7,8,9,10}%
\MelangeListe{\PQuatreListe}{7}%
\readlist*\PQuatreListeH{\faa}%
\MelangeListe{\PQuatreListe}{7}%
@@ -55,6 +65,10 @@
\setsepchar{,}%
\foreachitem\compteur\in\PQuatreListes[1]{\expandafter\UpdatetoksPQuatrev\compteur\nil}%
\foreachitem\compteur\in\PQuatreListes[2]{\expandafter\UpdatetoksPQuatreh\compteur\nil}%
+ % On crée éventuellement la liste des solutions
+ \ifboolKV[ClesPQuatre]{Correction}{%
+ \foreachitem\compteur\in\PQuatreListeS{\expandafter\UpdatetoksPQuatres\compteur\nil}%
+ }{}%
}%
% Une fois les listes construites, on dessine et on place les listes.
\PQuatreGrille{\the\toklistePQuatrev}{\the\toklistePQuatreh}%
@@ -69,10 +83,12 @@
PQEchelle=\useKV[ClesPQuatre]{Echelle};
color PQfond;
PQfond=\useKV[ClesPQuatre]{Couleur};
- boolean PQLibre,PQMultiplication,PQTexte;
+ boolean PQLibre,PQMultiplication,PQTexte,Correction,Exposant;
PQLibre:=\useKV[ClesPQuatre]{Libre};
PQMultiplication=\useKV[ClesPQuatre]{Multiplication};
PQTexte:=\useKV[ClesPQuatre]{Texte};
+ Correction=\useKV[ClesPQuatre]{Correction};
+ Exposant=\useKV[ClesPQuatre]{Exposant};
if PQTexte:
string PQConsignes;
@@ -111,6 +127,12 @@
if PQLibre:
if PQTexte:
label.llft(TEX("\begin{minipage}{"&decimal(PQLargeurUn)&"pt}"&PQConsignes&"\end{minipage}") scaled PQEchelle,A);
+ else:
+ if PQMultiplication:
+ label.llft(TEX("$\times$") scaled PQEchelle,A);
+ else:
+ label.llft(TEX("$+$") scaled PQEchelle,A);
+ fi;
fi;
else:
if PQMultiplication:
@@ -119,24 +141,72 @@
label.llft(TEX("$+$") scaled PQEchelle,A);
fi;
fi;
+ %
+ string Textev[];
+ string Texteh[];
labeloffset:=labeloffset/2;
vardef Vertical(text t)=
n:=0;
for p_=t:
+ if PQLibre:
label.lft(TEX(p_) scaled PQEchelle,A+(0,n*PQLargeur+PQLargeur/2));
+ else:
+ if Exposant:
+ label.lft(TEX("$10^{"&p_&"}$") scaled PQEchelle,A+(0,n*PQLargeur+PQLargeur/2));
+ else:
+ label.lft(TEX("\num{"&p_&"}") scaled PQEchelle,A+(0,n*PQLargeur+PQLargeur/2));
+ fi;
+ Textev[n]=p_;
+ fi;
n:=n+1;
endfor;
enddef;
vardef Horizontal(text t)=
n:=0;
for p_=t:
+ if PQLibre:
label.bot(TEX(p_) scaled PQEchelle,A+(n*PQLargeur+PQLargeur/2,0));
+ else:
+ if Exposant:
+ label.bot(TEX("$10^{"&p_&"}$") scaled PQEchelle,A+(n*PQLargeur+PQLargeur/2,0));
+ else:
+ label.bot(TEX("\num{"&p_&"}") scaled PQEchelle,A+(n*PQLargeur+PQLargeur/2,0));
+ fi;
+ Texteh[n]=p_;
+ fi;
n:=n+1;
endfor;
enddef;
labeloffset:=labeloffset*4;
Vertical(#1);
Horizontal(#2);
+ % on affiche la solution
+ vardef AfficheSolution(text t)=
+ n:=0;
+ for p_=t:
+ label(TEX(p_),M[n mod nclargeur][n div nchauteur]);
+ n:=n+1;
+ endfor;
+ enddef;
+ if Correction:
+ if PQLibre=false:
+ for k=0 upto (nclargeur-1):
+ for l=0 upto (nchauteur-1):
+ if Exposant:
+ label(TEX("\Large$10^{\fpeval{"&Texteh[k]&"+"&Textev[l]&"}}$"),M[k][l]);
+ else:
+ if PQMultiplication:
+ label(TEX("\Huge\num{\fpeval{"&Texteh[k]&"*"&Textev[l]&"}}"),M[k][l]);
+ else:
+ label(TEX("\Huge\num{\fpeval{"&Texteh[k]&"+"&Textev[l]&"}}"),M[k][l]);
+ fi;
+ fi;
+ endfor;
+ endfor;
+ else:
+ AfficheSolution(\the\toklistePQuatres);
+ fi;
+ fi;
\end{mplibcode}
\else%
\begin{mpost}[mpsettings={Largeur=\useKV[ClesPQuatre]{Largeur};Largeur=\useKV[ClesPQuatre]{Largeur};LargeurUn=\useKV[ClesPQuatre]{LargeurUn};Echelle=\useKV[ClesPQuatre]{Echelle};color fond;fond=\useKV[ClesPQuatre]{Couleur};boolean Libre,Multiplication,Texte;Libre:=\useKV[ClesPQuatre]{Libre};Multiplication=\useKV[ClesPQuatre]{Multiplication};Texte:=\useKV[ClesPQuatre]{Texte};if Texte:string Consignes;Consignes=\useKV[ClesPQuatre]{Consignes};fi;}]
diff --git a/macros/latex/contrib/profcollege/latex/PfCPuzzleSommePyramide.tex b/macros/latex/contrib/profcollege/latex/PfCPuzzleSommePyramide.tex
index 7f00ac287e..865982ee35 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPuzzleSommePyramide.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPuzzleSommePyramide.tex
@@ -1,6 +1,10 @@
%%%
% Puzzle Somme Pyramide
%%%
+\def\filedatePuzzleSommePyramide{2024/08/04}%
+\def\fileversionPuzzleSommePyramide{0.1}%
+\message{-- \filedatePuzzleSommePyramide\space v\fileversionPuzzleSommePyramide}%
+%
\setKVdefault[ClesPuzzleP]{Largeur=40pt,Etages=4,Graines=false,Solutions=false,Jeu,EnonceQuestion=false,NbLignes=7}
\defKV[ClesPuzzleP]{Graine=\setKV[ClesPuzzleP]{Graines}}%
\defKV[ClesPuzzleP]{Solution=\setKV[ClesPuzzleP]{Solutions}\setKV[ClesPuzzleP]{Jeu=false}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCPyraVoca.tex b/macros/latex/contrib/profcollege/latex/PfCPyraVoca.tex
index bfda696300..983a8b1eb9 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPyraVoca.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPyraVoca.tex
@@ -1,6 +1,10 @@
%%%
% PyraVoca
%%%
+\def\filedatePyraVoca{2024/08/04}%
+\def\fileversionPyraVoca{0.1}%
+\message{-- \filedatePyraVoca\space v\fileversionPyraVoca}%
+%
\newlength{\PfCPyraVocaHauteur}
\setKVdefault[PyraVoca]{Solution=false,Largeur=15pt}
diff --git a/macros/latex/contrib/profcollege/latex/PfCPyramideCalculs.tex b/macros/latex/contrib/profcollege/latex/PfCPyramideCalculs.tex
index fdd5c7b685..0b00e0e4ac 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPyramideCalculs.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPyramideCalculs.tex
@@ -1,6 +1,10 @@
%%%
% Pyramide de calculs
%%%
+\def\filedatePyraCalc{2024/08/04}%
+\def\fileversionPyraCalc{0.1}%
+\message{-- \filedatePyraCalc\space v\fileversionPyraCalc}%
+%
\newcommand\DessinePyramideNombreMul[1]{%
\ifluatex
\mplibforcehmode
@@ -241,7 +245,7 @@
\fi
}%
-\setKVdefault[ClesPyramide]{Etages=5,Largeur=2cm,Hauteur=1cm,Vide=false,Inverse=false,Double=false,Couleur=Crimson,Multiplication=false,CouleurNombre=blue,Produit=false,Solution=false,Aide=false,Cote=4cm}%
+\setKVdefault[ClesPyramide]{ToutesOperations=false,Etages=5,Largeur=2cm,Hauteur=1cm,Vide=false,Inverse=false,Double=false,Couleur=Crimson,Multiplication=false,CouleurNombre=blue,Produit=false,Solution=false,Aide=false,Cote=4cm}%
\newtoks\toklistecaseP%
\def\UpdatetoksPyramide#1\nil{\addtotok\toklistecaseP{"#1",}}%
@@ -250,6 +254,9 @@
\NewDocumentCommand\PyramideNombre{o m}{%
\useKVdefault[ClesPyramide]%
\setKV[ClesPyramide]{#1}%
+ \ifboolKV[ClesPyramide]{ToutesOperations}{%
+ \PyramideOp[#1]{#2}%
+ }{%
\ifboolKV[ClesPyramide]{Multiplication}{%
\ifx\bla#2\bla%
\setKV[ClesPyramide]{Vide=true}%
@@ -278,4 +285,302 @@
}{Le nombre d'éléments dans la liste des propositions n'est pas compatible avec le nombre d'étages choisi.}%
\fi%
}%
+}%
+}%
+
+\setKVdefault[PyramideOp]{Rayon=5mm,Graines=false,Etages=5,Solution=false,Relatifs=false,Case=-1}
+\defKV[PyramideOp]{Graine=\setKV[PyramideOp]{Graines}}
+\defKV[PyramideOp]{CouleurSolution=\setKV[PyramideOp]{Solution}}
+
+\NewDocumentCommand\PyramideOp{om}{%
+ \useKVdefault[PyramideOp]%
+ \setKV[PyramideOp]{#1}%
+ \ifboolKV[PyramideOp]{Relatifs}{%
+ \BuildPyramideOpRelatifs{#2}%
+ }{%
+ \BuildPyramideOp{#2}%
+ }%
+}%
+
+\NewDocumentCommand\BuildPyramideOp{m}{%
+ \ifluatex
+ \mplibforcehmode
+ \mplibnumbersystem{double}
+ \begin{mplibcode}
+ Etages=\useKV[PyramideOp]{Etages};
+ Rayon=\useKV[PyramideOp]{Rayon};
+ Case=\useKV[PyramideOp]{Case};
+
+ boolean Graines,Solution,Allume[][];
+
+ Graines=\useKV[PyramideOp]{Graines};
+ if Graines:
+ randomseed:=\useKV[PyramideOp]{Graine};
+ fi;
+
+ Solution=\useKV[PyramideOp]{Solution};
+ if Solution:
+ color CouleurSolution;
+ CouleurSolution=\useKV[PyramideOp]{CouleurSolution};
+ fi;
+
+ vardef ChoixOperation(expr Nba,Nbb)=
+ if (Nba<Nbb) or (Nba=Nbb):
+ if Nba*Nbb>200:
+ ChoixOp:=ceiling(uniformdeviate(1));
+ else:
+ ChoixOp:=ceiling(uniformdeviate(2));
+ fi;
+ else:
+ if (Nba mod Nbb)<>0:
+ if Nba*Nbb>200:
+ ChoixAlea:=uniformdeviate(1);
+ if ChoixAlea<0.5:
+ ChoixOp:=1;
+ else:
+ ChoixOp:=3;
+ fi;
+ else:
+ ChoixOp:=ceiling(uniformdeviate(3));
+ fi;
+ else:
+ if Nba*Nbb>200:
+ ChoixAlea:=uniformdeviate(1);
+ if ChoixAlea<0.5:
+ ChoixOp:=1;
+ else:
+ ChoixOp:=ceiling(2+uniformdeviate(2));
+ fi;
+ else:
+ ChoixOp:=ceiling(uniformdeviate(4));
+ fi;
+ fi;
+ fi;
+ enddef;
+
+ numeric Nb[][],ChoixOp[][];
+
+ pair M[][],N[][];
+
+ for k=0 upto Etages-1:
+ for l=0 upto Etages-1-k:
+ M[k][l]=Rayon*(1,1)+2*Rayon*(l,k)+k*2*Rayon*(0.5,-1+cosd(30));
+ Allume[k][l]=false;
+ endfor;
+ endfor;
+ for k=0 upto Etages-2:
+ for l=0 upto Etages-2-k:
+ N[k][l]=Rayon*(1,1)+(Rayon,0)+2*Rayon*(l,k)+k*2*Rayon*(0.5,-1+cosd(30));
+ endfor;
+ endfor;
+
+ n:=0;
+
+ for p_=#1:
+ Nb[0][n]=p_;
+ if n=Case:
+ if n<Etages-1:
+ Allume[1][n]:=true;
+ else:
+ Allume[1][n-1]:=true;
+ fi;
+ else:
+ Allume[0][n]:=true;
+ fi;
+ n:=n+1;
+ endfor;
+
+ string Op[][];
+
+ % Détermination des opérations et des valeurs à indiquer.
+ for k=0 upto Etages-1:
+ for l=0 upto Etages-2-k:
+ ChoixOperation(Nb[k][l],Nb[k][l+1]);
+ if ChoixOp=1:
+ Op[k][l]="$+$";
+ Nb[k+1][l]=Nb[k][l]+Nb[k][l+1];
+ elseif ChoixOp=2:
+ Op[k][l]="$\times$";
+ Nb[k+1][l]=Nb[k][l]*Nb[k][l+1];
+ elseif ChoixOp=3:
+ Op[k][l]="$\_$";
+ Nb[k+1][l]=Nb[k][l]-Nb[k][l+1];
+ elseif ChoixOp=4:
+ Op[k][l]="$\div$";
+ Nb[k+1][l]=Nb[k][l]/Nb[k][l+1];
+ fi;
+ endfor;
+ endfor;
+ %Affichage
+ for k=0 upto Etages-1:
+ for l=0 upto Etages-1-k:
+ if Allume[k][l]=false:
+ if Solution:
+ fill cercles(M[k][l],Rayon) withcolor CouleurSolution;
+ label(decimal(Nb[k][l]),M[k][l]);
+ fi;
+ else:
+ label(decimal(Nb[k][l]),M[k][l]);
+ fi;
+ trace cercles(M[k][l],Rayon);
+ endfor;
+ endfor;
+ for k=0 upto Etages-2:
+ for l=0 upto Etages-2-k:
+ fill cercles(N[k][l],2mm) withcolor 0.8white;
+ trace cercles(N[k][l],2mm);
+ label(TEX(Op[k][l]),N[k][l]);
+ endfor;
+ endfor;
+ \end{mplibcode}
+ \mplibnumbersystem{scaled}
+ \fi
+}
+
+\NewDocumentCommand\BuildPyramideOpRelatifs{m}{%
+ \ifluatex
+ \mplibforcehmode
+ \mplibnumbersystem{double}
+ \begin{mplibcode}
+ Etages=\useKV[PyramideOp]{Etages};
+ Rayon=\useKV[PyramideOp]{Rayon};
+ Case=\useKV[PyramideOp]{Case};
+
+ boolean Graines,Solution,Allume[][];
+
+ Graines=\useKV[PyramideOp]{Graines};
+ if Graines:
+ randomseed:=\useKV[PyramideOp]{Graine};
+ fi;
+
+ Solution=\useKV[PyramideOp]{Solution};
+ if Solution:
+ color CouleurSolution;
+ CouleurSolution=\useKV[PyramideOp]{CouleurSolution};
+ fi;
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ vardef ChoixOperation(expr Nba,Nbb)=
+ if (Nba=Nbb):
+ if Nba*Nbb>200:
+ ChoixOp:=ceiling(uniformdeviate(1));
+ else:
+ ChoixOp:=ceiling(uniformdeviate(2));
+ fi;
+ elseif (Nba+Nbb=0):
+ if abs(Nba*Nbb)>200:
+ ChoixOp:=3;
+ else:
+ ChoixAlea:=uniformdeviate(1);
+ if ChoixAlea<0.5:
+ ChoixOp:=2;
+ else:
+ ChoixOp:=3;
+ fi;
+ fi;
+ else:
+ if (abs(Nba) mod abs(Nbb))<>0:
+ if abs(Nba*Nbb)>200:
+ ChoixAlea:=uniformdeviate(1);
+ if ChoixAlea<0.5:
+ ChoixOp:=1;
+ else:
+ ChoixOp:=3;
+ fi;
+ else:
+ ChoixOp:=ceiling(uniformdeviate(3));
+ fi;
+ else:
+ if abs(Nba*Nbb)>200:
+ ChoixAlea:=uniformdeviate(1);
+ if ChoixAlea<0.5:
+ ChoixOp:=1;
+ else:
+ ChoixOp:=ceiling(2+uniformdeviate(2));
+ fi;
+ else:
+ ChoixOp:=ceiling(uniformdeviate(4));
+ fi;
+ fi;
+ fi;
+ enddef;
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ numeric Nb[][],ChoixOp[][];
+
+ pair M[][],N[][];
+
+ for k=0 upto Etages-1:
+ for l=0 upto Etages-1-k:
+ M[k][l]=Rayon*(1,1)+2*Rayon*(l,k)+k*2*Rayon*(0.5,-1+cosd(30));
+ Allume[k][l]=false;
+ endfor;
+ endfor;
+ for k=0 upto Etages-2:
+ for l=0 upto Etages-2-k:
+ N[k][l]=Rayon*(1,1)+(Rayon,0)+2*Rayon*(l,k)+k*2*Rayon*(0.5,-1+cosd(30));
+ endfor;
+ endfor;
+
+ n:=0;
+
+ for p_=#1:
+ Nb[0][n]=p_;
+ if n=Case:
+ if n<Etages-1:
+ Allume[1][n]:=true;
+ else:
+ Allume[1][n-1]:=true;
+ fi;
+ else:
+ Allume[0][n]:=true;
+ fi;
+ n:=n+1;
+ endfor;
+
+ string Op[][];
+
+ % Détermination des opérations et des valeurs à indiquer.
+ for k=0 upto Etages-1:
+ for l=0 upto Etages-2-k:
+ ChoixOperation(Nb[k][l],Nb[k][l+1]);
+ if ChoixOp=1:
+ Op[k][l]="$+$";
+ Nb[k+1][l]=Nb[k][l]+Nb[k][l+1];
+ elseif ChoixOp=2:
+ Op[k][l]="$\times$";
+ Nb[k+1][l]=Nb[k][l]*Nb[k][l+1];
+ elseif ChoixOp=3:
+ Op[k][l]="$\_$";
+ Nb[k+1][l]=Nb[k][l]-Nb[k][l+1];
+ elseif ChoixOp=4:
+ Op[k][l]="$\div$";
+ Nb[k+1][l]=Nb[k][l]/Nb[k][l+1];
+ fi;
+ endfor;
+ endfor;
+ %Affichage
+ for k=0 upto Etages-1:
+ for l=0 upto Etages-1-k:
+ if Allume[k][l]=false:
+ if Solution:
+ fill cercles(M[k][l],Rayon) withcolor CouleurSolution;
+ label(TEX("\num{"&decimal(Nb[k][l])&"}"),M[k][l]);
+ fi;
+ else:
+ label(TEX("\num{"&decimal(Nb[k][l])&"}"),M[k][l]);
+ fi;
+ trace cercles(M[k][l],Rayon);
+ endfor;
+ endfor;
+ for k=0 upto Etages-2:
+ for l=0 upto Etages-2-k:
+ fill cercles(N[k][l],2mm) withcolor 0.8white;
+ trace cercles(N[k][l],2mm);
+ label(TEX(Op[k][l]),N[k][l]);
+ endfor;
+ endfor;
+ \end{mplibcode}
+ \mplibnumbersystem{scaled}
+ \fi
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCPythagore.tex b/macros/latex/contrib/profcollege/latex/PfCPythagore.tex
index 5c922d98b0..f5c95d91e4 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPythagore.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPythagore.tex
@@ -1,6 +1,10 @@
%%%
% Le th\'eor\`eme de Pythagore
%%%
+\def\filedatePythagore{2024/08/04}%
+\def\fileversionPythagore{0.1}%
+\message{-- \filedatePythagore\space v\fileversionPythagore}%
+%
\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,FigureSeule=false,Angle=0,Echelle=1cm,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,Perso=false,AllPerso=false,SansMots=false,Decalage=5mm,ModeleCouleur=5}%
\defKV[ClesPythagore]{ValeurA=\setKV[ClesPythagore]{EnchaineA}}%
\defKV[ClesPythagore]{ValeurB=\setKV[ClesPythagore]{EnchaineB}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCQuestionsFlash.tex b/macros/latex/contrib/profcollege/latex/PfCQuestionsFlash.tex
index 8edee39f16..5bcf626ddc 100644
--- a/macros/latex/contrib/profcollege/latex/PfCQuestionsFlash.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCQuestionsFlash.tex
@@ -1,6 +1,10 @@
%%%
% Questions Flash
%%%
+\def\filedateQFlash{2024/08/04}%
+\def\fileversionQFlash{0.1}%
+\message{-- \filedateQFlash\space v\fileversionQFlash}%
+%
\tcbset{Expression/.style={colback=white,valign=center,left=0mm,right=0mm,top=1mm,bottom=1mm,colframe=white}}%
\tcbset{ExpressionSerie1/.style={colback=\useKV[ClesFlash]{Couleur1},left=0mm,right=0mm,top=1mm,bottom=1mm}}%
\tcbset{ExpressionSerie2/.style={colback=\useKV[ClesFlash]{Couleur2},left=0mm,right=0mm,top=1mm,bottom=1mm}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCQuestionsRelier.tex b/macros/latex/contrib/profcollege/latex/PfCQuestionsRelier.tex
index 9745bb144c..8aee438e62 100644
--- a/macros/latex/contrib/profcollege/latex/PfCQuestionsRelier.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCQuestionsRelier.tex
@@ -1,9 +1,16 @@
%%%
% R\'eponses \`a relier
%%%
+\def\filedateQRelier{2024/08/04}%
+\def\fileversionQRelier{0.1}%
+\message{-- \filedateQRelier\space v\fileversionQRelier}%
+%
\setKVdefault[ClesRelie]{Solution=false,LargeurG=5cm,LargeurD=2cm,Stretch=1.5,Ecart=2cm,Couleur=black}%
\defKV[ClesRelie]{Graine=\PfCGraineAlea{#1}}%
+\newcounter{NbRelie}%
+\newcounter{NbRelieD}
+
\NewDocumentCommand\Relie{som}{%
\useKVdefault[ClesRelie]%
\setKV[ClesRelie]{#2}%
@@ -33,7 +40,13 @@
\itemtomacro\ListeRelie[##1,1]\untest%
\ifx\bla\untest\bla%
\else%
- \tikz[remember picture,overlay]{\draw[PfCRelieCouleurTrace] (RelieG-##1) -- (RelieD-\ListeRelie[##1,3]);}%
+ \itemtomacro\ListeRelie[##1,3]\Foo
+ \setsepchar{-}\ignoreemptyitems%
+ \readlist*\ListeRelieReponses{\Foo}%
+ \reademptyitems
+ \foreachitem\compteur\in\ListeRelieReponses{%
+ \tikz[remember picture,overlay]{\draw[PfCRelieCouleurTrace] (RelieG-##1) -- (RelieD-\ListeRelieReponses[\compteurcnt]);}%
+ }
\fi
}%
}{%
@@ -41,49 +54,39 @@
}%
}%
-\newcommand\Relieold[2][]{%
- \useKVdefault[ClesRelie]%
- \setKV[ClesRelie]{#1}%
- \setsepchar[*]{,*/}\reademptyitems%
- \readlist*\ListeRelie{#2}%
- \ignoreemptyitems
- \buildtabrelie%
- \ifboolKV[ClesRelie]{Solution}{%
- \colorlet{PfCRelieCouleurTrace}{\useKV[ClesRelie]{Couleur}}%
- \xintFor* ##1 in {\xintSeq {1}{\ListeRelielen}}\do{%
- \itemtomacro\ListeRelie[##1,1]\untest
- \ifx\bla\untest\bla%
- \else
- \tikz[remember picture,overlay]{\draw[PfCRelieCouleurTrace] (RelieG-##1) -- (RelieD-\ListeRelie[##1,3]);}%
- \fi
- }%
- }{%
- }%
-}%
-
-\newcounter{NbRelie}%
-
\def\buildtabrelie{%
\setcounter{NbRelie}{0}%
+ \setcounter{NbRelieD}{0}%
\renewcommand{\arraystretch}{\useKV[ClesRelie]{Stretch}}%
- \begin{tabular}{p{\useKV[ClesRelie]{LargeurG}}cp{\useKV[ClesRelie]{Ecart}}>{\tikz[remember
- picture]{\node[name=RelieD-\theNbRelie,inner
- sep=0pt]{};\fill[] (RelieD-\theNbRelie) circle[radius=1.5pt]}}cp{\useKV[ClesRelie]{LargeurD}}}%
- \xintFor* ##1 in {\xintSeq {1}{\ListeRelielen}}\do{\ListeRelie[##1,1]\itemtomacro\ListeRelie[##1,1]\untest%
-\ifx\bla\untest\bla%
+ \begin{tabular}{p{\useKV[ClesRelie]{LargeurG}}cp{\useKV[ClesRelie]{Ecart}}cp{\useKV[ClesRelie]{LargeurD}}}%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeRelielen}}\do{%
+ \ListeRelie[##1,1]\itemtomacro\ListeRelie[##1,1]\untest%
+ \ifx\bla\untest\bla%
\uppercase{&}\stepcounter{NbRelie}%
\else
\uppercase{&}\stepcounter{NbRelie}\tikz[remember
picture,overlay]{\node[name=RelieG-\theNbRelie,inner
sep=0pt]{};\fill[]
(RelieG-\theNbRelie) circle[radius=1.5pt];}
-\fi&&&\ListeRelie[##1,2]\\}%
+ \fi&&
+ \itemtomacro\ListeRelie[##1,2]\untest
+ \ifx\bla\untest\bla\else\stepcounter{NbRelieD}\tikz[remember
+ picture]{\node[name=RelieD-\theNbRelieD,inner
+ sep=0pt]{};\fill[] (RelieD-\theNbRelieD) circle[radius=1.5pt]}
+ \fi
+ &\itemtomacro\ListeRelie[##1,2]\untest%
+ \ifx\bla\untest\bla
+ \else
+ \ListeRelie[##1,2]
+ \fi\\}%
\end{tabular}%
- \setcounter{NbRelie}{0}%
+ %\setcounter{NbRelie}{0}%
+ %\setcounter{NbRelieD}{0}%
}%
\def\buildtabrelieauto{%
\setcounter{NbRelie}{0}%
+ \setcounter{NbRelieD}{0}%
\xdef\PfCFooListeNbQ{1}%
\xintFor* ##1 in{\xintSeq{2}{\ListeRelielen}}\do{%
\xdef\PfCFooListeNbQ{\PfCFooListeNbQ,##1}%
@@ -110,4 +113,5 @@
\fi&&&\itemtomacro\PfCListeReponsesMelangees[##1]\PfCNumReponses\ListeRelie[\PfCNumReponses,2]\\}%
\end{tabular}%
\setcounter{NbRelie}{0}%
-}% \ No newline at end of file
+}%
+
diff --git a/macros/latex/contrib/profcollege/latex/PfCQuiSuisJe.tex b/macros/latex/contrib/profcollege/latex/PfCQuiSuisJe.tex
index aa896d1185..119b5d0944 100644
--- a/macros/latex/contrib/profcollege/latex/PfCQuiSuisJe.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCQuiSuisJe.tex
@@ -1,6 +1,10 @@
%%%
% Qui suis-je
%%%
+\def\filedateQsuisuisje{2024/08/04}%
+\def\fileversionQsuisuisje{0.1}%
+\message{-- \filedateQsuisuisje\space v\fileversionQsuisuisje}%
+%
\setKVdefault[Quisuisje]{Solution=false,Largeur=5mm,Colonnes=5,CodePerso=false,TexteA=Lettre,TexteB=R\'esultat du calcul}%
\newcommand\QuisuisjeEnonce{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRLE.tex b/macros/latex/contrib/profcollege/latex/PfCRLE.tex
index a8f035a577..8fabde9116 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRLE.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRLE.tex
@@ -1,6 +1,10 @@
%%%
% Codage RLE
%%%
+\def\filedateRLE{2024/08/04}%
+\def\fileversionRLE{0.1}%
+\message{-- \filedateRLE\space v\fileversionRLE}%
+%
\setKVdefault[RLE]{Largeur=10pt,Taille=5,Unite=1cm,Solution=false,Enonce=true}
\newtoks\toklisterle
diff --git a/macros/latex/contrib/profcollege/latex/PfCRangementNombres.tex b/macros/latex/contrib/profcollege/latex/PfCRangementNombres.tex
index 1c48ab8efc..ca58c321fd 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRangementNombres.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRangementNombres.tex
@@ -1,6 +1,10 @@
%%%
% Rangement des nombres
%%%
+\def\filedateRgtNb{2024/08/04}%
+\def\fileversionRgtNb{0.1}%
+\message{-- \filedateRgtNb\space v\fileversionRgtNb}%
+%
\setKVdefault[ClesRgt]{Croissant,Decroissant=false,Strict,Fraction=false,Details=false,Seul=false}%
\dtlexpandnewvalue%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRapido.tex b/macros/latex/contrib/profcollege/latex/PfCRapido.tex
index fa3a16bf7e..cb24c2b404 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRapido.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRapido.tex
@@ -1,6 +1,10 @@
%%%
% Rapido
%%%
+\def\filedateRapido{2024/08/04}%
+\def\fileversionRapido{0.1}%
+\message{-- \filedateRapido\space v\fileversionRapido}%
+%
%% D'après https://www.facebook.com/groups/994675223903586/user/100017057226847
%% et une programmation de Laurent Lassale-Carrere
\newcounter{PfCnexo}
diff --git a/macros/latex/contrib/profcollege/latex/PfCRappelsFormules.tex b/macros/latex/contrib/profcollege/latex/PfCRappelsFormules.tex
index c2a4d95954..1d204baf90 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRappelsFormules.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRappelsFormules.tex
@@ -1,6 +1,10 @@
%%%
% Formules
%%%
+\def\filedateRapFormules{2024/08/04}%
+\def\fileversionRapFormules{0.1}%
+\message{-- \filedateRapFormules\space v\fileversionRapFormules}%
+%
\setKVdefault[ClesFormule]{Perimetre=false,Aire=false,Volume=false,Surface=carr\'e,Solide=pav\'e,Angle=0,Ancre={(0,0)},Largeur=5cm,Couleur=white,EchelleEspace=70,Echelle=1cm}
\def\MPFigureCarreCode{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRecyclage.tex b/macros/latex/contrib/profcollege/latex/PfCRecyclage.tex
index 371688f120..f99ced507f 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRecyclage.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRecyclage.tex
@@ -1,6 +1,10 @@
%%%
% Logos Recyclage
%%%
+\def\filedateRecyclage{2024/08/04}%
+\def\fileversionRecyclage{0.1}%
+\message{-- \filedateRecyclage\space v\fileversionRecyclage}%
+%
\setKVdefault[Recyclage]{Ticket,Papier=false,Verre=false,Bouteille=false,Carton=false,Couleurs}%
\defKV[Recyclage]{Couleur=\setKV[Recyclage]{Couleurs=false}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCReperage.tex b/macros/latex/contrib/profcollege/latex/PfCReperage.tex
index 23e7bd2775..d2dec50817 100644
--- a/macros/latex/contrib/profcollege/latex/PfCReperage.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCReperage.tex
@@ -1,6 +1,10 @@
%%%
% Reperage
%%%
+\def\filedateReperage{2024/08/04}%
+\def\fileversionReperage{0.1}%
+\message{-- \filedateReperage\space v\fileversionReperage}%
+%
\setKVdefault[ClesReperage]{Unitex=1,Pasx=1,Unitey=1,Pasy=1,Unitez=1,Pasz=1,DemiDroite=false,Droite=false,Plan=false,Trace=false,ListeSegment={},Espace=false,Sphere=false,AnglePhi=30,CouleurLa=white,CouleurLon=Tomato,AffichageUnites=true,MarquePrimaire=true,AffichageNom=false,AffichageGrad=false,AffichageAbs=0,AffichageCoord=false,LectureCoord=false,ValeurUnitex=1,ValeurUnitey=1,ValeurOrigine=0,NomOrigine=O,EchelleEspace=50,CouleurCoord=black,Thermometre=false,Mercure=false,CouleurMercure=black,Celsius,Kelvin=false,Farenheit=false,ValeurMin=-4000,ValeurMax=4000,ValeurMiny=-4000,ValeurMaxy=4000,Etages=4,Code=false,Globe=false,Rho=1500,Phi=22,Theta=10,CouleurE=orange,CouleurG=green,Axes=false,TypeProj="persp",Niveaux=false,Decale=false,Tiret=false,Cadre=false,ModeleCouleur=5,EchelleCroix=1,CouleurCroix=black}
\defKV[ClesReperage]{Traces=\setKV[ClesReperage]{Code}}%
\defKV[ClesReperage]{Niveau=\setKV[ClesReperage]{Etages=#1}\setKV[ClesReperage]{Niveaux}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex b/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex
index 390c1a9caa..47ed10c376 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex
@@ -1,7 +1,11 @@
%%%
% Diff\'erentes représentations graphiques
%%%
-\setKVdefault[TraceG]{Millimetre=false,Grille=false,Graduations=false,PasGradX=1,PasGradY=1,PasGrilleX=1,PasGrilleY=1,Xmin=-5.5,Xmax=5.5,Xstep=1,Ymin=-5.5,Ymax=5.5,Ystep=1,Bornea=-5.5,Borneb=5.5,LabelX={},LabelY={},LegendeX=false,LegendeY=false,LabelC=0.5,NomCourbe={},Origine={(5.5,5.5)},Fonction=false,Points=false,Invisible=false,CouleurPoint=red,CouleurTrace=black,Epaisseur=1,Relie=false,RelieSegment=false,Marque=dot,Code=false,Vide=false,NbPointsCourbe=100,Tiret=false}%
+\def\filedateRepGraph{2024/08/20}%
+\def\fileversionRepGraph{0.1a}%
+\message{-- \filedateRepGraph\space v\fileversionRepGraph}%
+%
+\setKVdefault[TraceG]{Millimetre=false,Grille=false,Graduations=false,PasGradX=1,PasGradY=1,PasGrilleX=1,PasGrilleY=1,Xmin=-5.5,Xmax=5.5,Xstep=1,Ymin=-5.5,Ymax=5.5,Ystep=1,Bornea=-5.5,Borneb=5.5,LabelX={},LabelY={},LegendeX=false,LegendeY=false,LabelC=0.5,NomCourbe={},Origine={(5.5,5.5)},Fonction=false,Points=false,Invisible=false,CouleurPoint=red,CouleurTrace=black,Epaisseur=1,Relie=false,RelieSegment=false,Marque=dot,Code=false,Vide=false,NbPointsCourbe=100,Tiret=false,StyleTrace=0,Date=false}%
\defKV[TraceG]{Traces=\setKV[TraceG]{Code}}%
\defKV[TraceG]{LabelX=\setKV[TraceG]{LegendeX}}%
\defKV[TraceG]{LabelY=\setKV[TraceG]{LegendeY}}%
@@ -35,6 +39,8 @@
y.u=1cm/\useKV[TraceG]{Ystep};
grillex=\useKV[TraceG]{PasGrilleX};
grilley=\useKV[TraceG]{PasGrilleY};
+ pasgradx=\useKV[TraceG]{PasGradX};
+ pasgrady=\useKV[TraceG]{PasGradY};
pos=\useKV[TraceG]{LabelC};
marque_p:=str \useKV[TraceG]{Marque};
@@ -49,6 +55,9 @@
LegendeX:=\useKV[TraceG]{LegendeX};
LegendeY:=\useKV[TraceG]{LegendeY};
+ boolean Date;
+ Date=\useKV[TraceG]{Date};
+
boolean Relie;
Relie=\useKV[TraceG]{Relie};
@@ -73,12 +82,16 @@
fi;
if Graduations:
- for k=0 step grillex until (xmax-xmin):
+ for k=0 step pasgradx until (xmax-xmin):
trace ((0,-0.5mm)--(0,0.5mm)) shifted ((k*x.u,0) shifted Origine) withpen pencircle scaled1.25;
+ if Date:
+ label.bot(TEX(decimal(xmin+k)),(k*x.u,0) shifted Origine);
+ else:
label.bot(TEX("\num{"&decimal(xmin+k)&"}"),(k*x.u,0) shifted Origine);
+ fi;
endfor;
label.ulft(TEX("\num{"&decimal(ymin)&"}"),(0,0) shifted Origine);
- for k=grilley step grilley until (ymax-ymin):
+ for k=pasgrady step pasgrady until (ymax-ymin):
trace ((-0.5mm,0)--(0.5mm,0)) shifted ((0,k*y.u) shifted Origine) withpen pencircle scaled1.25;
label.lft(TEX("\num{"&decimal(ymin+k)&"}"),(0,k*y.u) shifted Origine);
endfor;
diff --git a/macros/latex/contrib/profcollege/latex/PfCRepresenterEntier.tex b/macros/latex/contrib/profcollege/latex/PfCRepresenterEntier.tex
index 9ab7b24341..15f6919131 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRepresenterEntier.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRepresenterEntier.tex
@@ -1,6 +1,10 @@
%%%
% Représenter un entier dans une base
%%%
+\def\filedateRepEntier{2024/08/04}%
+\def\fileversionRepEntier{0.1}%
+\message{-- \filedateRepEntier\space v\fileversionRepEntier}%
+%
\setKVdefault[ClesRBase]{Base=10,Echelle=1,Unite=false,Compact=false,Impression=false,ListeCouleurs={Tomato,LightSteelBlue,LightGreen,Cornsilk}}%
\newcommand\RepresenterEntier[2][]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRepresenterFraction.tex b/macros/latex/contrib/profcollege/latex/PfCRepresenterFraction.tex
index 6660693348..2beb3ee5ed 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRepresenterFraction.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRepresenterFraction.tex
@@ -1,7 +1,11 @@
%%%
% Fractions
%%%
-\setKVdefault[ClesFraction]{Rayon=2cm,Disque,Regulier=false,Segment=false,Rectangle=false,Longueur=5cm,Largeur=2cm,Cotes=5,Triangle=false,Parts=3,Eprouvette=false,Couleur=green,Reponse=false,Multiple=1,Hachures=false,Epaisseur=1}
+\def\filedateRepFrac{2024/08/30}%
+\def\fileversionRepFrac{0.1a}%
+\message{-- \filedateRepFrac\space v\fileversionRepFrac}%
+%
+\setKVdefault[ClesFraction]{Rayon=2cm,Disque,Regulier=false,Segment=false,Rectangle=false,Longueur=5cm,Largeur=2cm,Cotes=5,Triangle=false,Parts=3,Eprouvette=false,Couleur=green,Reponse=false,Multiple=1,Hachures=false,Epaisseur=1,Aleatoire=false}
\def\MPFractionEprouvetteCode{%
Hauteur=\useKV[ClesFraction]{Longueur};
@@ -80,6 +84,7 @@
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+ % Pas d'aléa ici : l'eau ne peut pas être en lévitation :)
\MPFractionEprouvetteCode
trace eprouvette(#2,#1);
\end{mplibcode}
@@ -90,6 +95,107 @@
\fi
}
+\def\MPFractionRegulierCodeAlea{%
+ Rayon=\useKV[ClesFraction]{Rayon};
+ Cotes=\useKV[ClesFraction]{Cotes};
+ color ColPolyReg;
+ ColPolyReg=\useKV[ClesFraction]{Couleur};
+ boolean Hachures,Reponse;
+ Reponse=\useKV[ClesFraction]{Reponse};
+ Hachures=\useKV[ClesFraction]{Hachures};
+ Epaisseur=\useKV[ClesFraction]{Epaisseur};
+ pair O,A[],B[];
+ O=u*(0,0);
+ path cc,cd;
+ cc=cercles(O,Rayon);
+ for k=0 upto Cotes:
+ A[k]=pointarc(cc,k*(360/Cotes));
+ endfor;
+ cd=polygone(A0 for k=1 upto Cotes-1:,A[k] endfor);
+ path part[];
+ vardef FractionPolyReg(expr nume,deno)=
+ for k=0 upto deno:
+ B[k]=point(k*(Cotes/deno)) of cd;
+ dotlabel("",B[k]);
+ endfor;
+ for k=0 upto deno-1:
+ part[k]=O--B[k] for l=1 upto Cotes-1:if (B[k]--B[k+1]) intersectiontimes (O--A[l])<>(-1,-1):--A[l] fi endfor --B[k+1]--cycle;%O--arccercle(B[k],B[k+1],O)--cycle;
+ endfor;
+ m=(nume div deno);
+ if (nume mod deno)=0:m:=m-1; fi;
+ picture RetourFraction;
+ RetourFraction=image(%
+ Reste=((nume div deno)+1)*deno;
+ RetiensPart=0;
+ if Reponse:
+ if m>0:
+ for l=0 upto (m-1):
+ for k=0 upto deno-1:
+ if RetiensPart<nume:
+ if Reste>(nume-RetiensPart):
+ test:=uniformdeviate(1);
+ if test>0.5:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(l*(2*Rayon+0.5cm,0)),1.5*360/deno,0.25,0) withcolor ColPolyReg;
+ else:
+ fill part[k] shifted(l*(2*Rayon+0.5cm,0)) withcolor ColPolyReg;
+ fi;
+ fi;
+ else:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(l*(2*Rayon+0.5cm,0)),1.5*360/deno,0.25,0) withcolor ColPolyReg;
+ else:
+ fill part[k] shifted(l*(2*Rayon+0.5cm,0)) withcolor ColPolyReg;
+ fi;
+ fi;
+ fi;
+ Reste:=Reste-1;
+ endfor;
+ endfor;
+ fi;
+ for k=0 upto deno-1:
+ if RetiensPart<nume:
+ if Reste>(nume-RetiensPart):
+ test:=uniformdeviate(1);
+ if test>0.5:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(m*(2*Rayon+0.5cm,0)),1.5*360/deno,0.25,0) withcolor ColPolyReg;
+ else:
+ fill part[k] shifted(m*(2*Rayon+0.5cm,0)) withcolor ColPolyReg;
+ fi;
+ fi;
+ else:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(m*(2*Rayon+0.5cm,0)),1.5*360/deno,0.25,0) withcolor ColPolyReg;
+ else:
+ fill part[k] shifted(m*(2*Rayon+0.5cm,0)) withcolor ColPolyReg;
+ fi;
+ fi;
+ fi;
+ Reste:=Reste-1;
+ endfor;
+ fi;
+ drawoptions(withpen pencircle scaled Epaisseur);
+ for l=0 upto m:
+ draw cd shifted(l*(2*Rayon+0.5cm,0));
+ for k=0 upto (deno-1):
+ draw segment(O,B[k]) shifted(l*(2*Rayon+0.5cm,0));
+ endfor;
+ endfor;
+ drawoptions();
+ );
+ RetourFraction
+ enddef;
+}%
+
\def\MPFractionRegulierCode{%
Rayon=\useKV[ClesFraction]{Rayon};
Cotes=\useKV[ClesFraction]{Cotes};
@@ -168,7 +274,13 @@
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+ boolean Alea;
+ Alea=\useKV[ClesFraction]{Aleatoire};
+ if Alea:
+ \MPFractionRegulierCodeAlea;
+ else:
\MPFractionRegulierCode
+ fi;
trace FractionPolyReg(#1,#2);
\end{mplibcode}
\else
@@ -178,6 +290,122 @@
\fi
}%
+\def\MPFractionTriangleCodeAlea{%
+ Longueur:=\useKV[ClesFraction]{Longueur};
+ nbparts:=\useKV[ClesFraction]{Parts};
+ color ColTriangle;
+ ColTriangle=\useKV[ClesFraction]{Couleur};
+ boolean Hachures,Reponse;
+ Reponse=\useKV[ClesFraction]{Reponse};
+ Hachures=\useKV[ClesFraction]{Hachures};
+ Epaisseur=\useKV[ClesFraction]{Epaisseur};
+ nbtriangle=0;
+ %
+ vardef Ligne(expr longueur)=
+ for k=0 upto 2*(longueur-1):
+ nbtriangle:=nbtriangle+1;
+ if (k mod 2)=0:
+ M[nbtriangle]=(Tria shifted(0.5*k*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+ else:
+ M[nbtriangle]=(Trir shifted(0.5*(k-1)*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+ fi;
+ endfor;
+ enddef;
+ %
+ pair A,B,C;
+ A=u*(0.5,0.5);
+ B-A=(Longueur,0);
+ C=rotation(B,A,60);
+ %
+ path Tria,Trir,M[];
+ Tria=polygone(A,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+ Trir=symetrie(Tria,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+ %
+ for k=nbparts downto 1:
+ Ligne(k);
+ endfor;
+ %
+ picture FondTriangle;
+ FondTriangle=image(
+ for k=1 upto nbtriangle:
+ trace M[k];
+ endfor;
+ );
+ %
+ vardef FractionTriangle(expr nume,deno)=
+ m:=nume div deno;
+ if (nume mod deno)=0:
+ m:=m-1;
+ fi;
+ picture RetourFraction;
+ RetourFraction=image(
+ Reste=((nume div deno)+1)*deno;
+ RetiensPart=0;
+ if Reponse:
+ if m>0:
+ for l=0 upto (m-1):
+ for k=1 upto nbtriangle:
+ if RetiensPart<nume:
+ if Reste>(nume-RetiensPart):
+ test:=uniformdeviate(1);
+ if test>0.5:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(M[k] shifted(l*(Longueur+1cm,0)),90,0.2,0) withcolor ColTriangle;
+ else:
+ fill M[k] shifted(l*(Longueur+1cm,0)) withcolor ColTriangle;
+ fi;
+ fi;
+ else:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(M[k] shifted(l*(Longueur+1cm,0)),90,0.2,0) withcolor ColTriangle;
+ else:
+ fill M[k] shifted(l*(Longueur+1cm,0)) withcolor ColTriangle;
+ fi;
+ fi;
+ fi;
+ Reste:=Reste-1;
+ endfor;
+ endfor;
+ fi;
+ for k=1 upto nbtriangle:
+ if RetiensPart<nume:
+ if Reste>(nume-RetiensPart):
+ test:=uniformdeviate(1);
+ if test>0.5:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(M[k] shifted(m*(Longueur+1cm,0)),90,0.2,0) withcolor ColTriangle;
+ else:
+ fill M[k] shifted(m*(Longueur+1cm,0)) withcolor ColTriangle;
+ fi;
+ fi;
+ else:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(M[k] shifted(m*(Longueur+1cm,0)),90,0.2,0) withcolor ColTriangle;
+ else:
+ fill M[k] shifted(m*(Longueur+1cm,0)) withcolor ColTriangle;
+ fi;
+ fi;
+ fi;
+ Reste:=Reste-1;
+ endfor;
+ fi;
+ drawoptions(withpen pencircle scaled Epaisseur);
+ for l=0 upto m:
+ trace FondTriangle shifted(l*(Longueur+1cm,0));
+ endfor;
+ );
+ RetourFraction
+enddef;
+}%
+
\def\MPFractionTriangleCode{%
Longueur:=\useKV[ClesFraction]{Longueur};
nbparts:=\useKV[ClesFraction]{Parts};
@@ -241,7 +469,7 @@
trace hachurage(polygone(A,B,C) shifted(l*(Longueur+1cm,0)),90,0.2,0) withcolor ColTriangle;
drawoptions(withpen pencircle scaled Epaisseur);
else:
- remplis polygone(A,B,C) withcolor ColRectangle;
+ remplis polygone(A,B,C) withcolor ColTriangle;
fi;
fi;
for k=1 upto nbparts:
@@ -260,7 +488,13 @@
\ifluatex
\mplibforcehmode
\begin{mplibcode}
- \MPFractionTriangleCode
+ boolean Alea;
+ Alea=\useKV[ClesFraction]{Aleatoire};
+ if Alea:
+ \MPFractionTriangleCodeAlea;
+ else:
+ \MPFractionTriangleCode;
+ fi;
draw FractionTriangle(#1,#2);
\end{mplibcode}
\else
@@ -270,6 +504,117 @@
\fi
}%
+\def\MPFractionRectangleCodeAlea{%
+ Longueur=\useKV[ClesFraction]{Longueur};
+ Largeur=\useKV[ClesFraction]{Largeur};
+ color ColRectangle;
+ ColRectangle=\useKV[ClesFraction]{Couleur};
+ boolean Hachures,Reponse;
+ Reponse=\useKV[ClesFraction]{Reponse};
+ Hachures=\useKV[ClesFraction]{Hachures};
+ Epaisseur=\useKV[ClesFraction]{Epaisseur};
+ Multiple=\useKV[ClesFraction]{Multiple};
+ %
+ pair A,B,C,D,M[],N[],R[],S[];
+ A=(0,0);
+ B-A=(Longueur,0);
+ C-B=(0,Largeur);
+ D-C=A-B;
+ vardef FractionRectangle(expr nume,deno)=
+ m=nume div deno;
+ if (nume mod deno)=0:
+ m:=m-1;
+ fi;
+ numeric parts;
+ parts=(deno div Multiple);
+ for k=0 upto parts:
+ M[k]=(k/parts)[A,B];
+ N[k]=(k/parts)[D,C];
+ endfor;
+ if Multiple>1:
+ for k=0 upto Multiple:
+ R[k]=(k/Multiple)[A,D];
+ S[k]=(k/Multiple)[B,C];
+ endfor;
+ fi;
+ picture FondRectangle;
+ FondRectangle=image(%
+ path case[];
+ for k=0 upto Multiple-1:
+ for l=0 step Multiple until (deno-1):
+ case[k*(deno div Multiple)+(l div Multiple)]=(unitsquare xscaled (Multiple*abs(A-B)/deno) yscaled (abs(D-A)/Multiple)) shifted (((l/deno)[A,B]-A)+((k/Multiple)[A,D]-A));
+ trace case[k*(deno div Multiple)+(l div Multiple)];
+ endfor;
+ endfor;
+ );
+ picture RetourRectangle;
+ RetourRectangle=image(
+ Reste=((nume div deno)+1)*deno;
+ RetiensPart=0;
+ if Reponse:
+ if m>0:
+ for l=0 upto (m-1):
+ for k=0 upto deno-1:
+ if RetiensPart<nume:
+ if Reste>(nume-RetiensPart):
+ test:=uniformdeviate(1);
+ if test>0.5:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(case[k] shifted(l*(Longueur+1cm,0)),45,0.25,0) withcolor ColRectangle;
+ else:
+ fill case[k] shifted(l*(Longueur+1cm,0)) withcolor ColRectangle;
+ fi;
+ fi;
+ else:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(case[k] shifted(l*(Longueur+1cm,0)),45,0.25,0) withcolor ColRectangle;
+ else:
+ fill case[k] shifted(l*(Longueur+1cm,0)) withcolor ColRectangle;
+ fi;
+ fi;
+ fi;
+ Reste:=Reste-1;
+ endfor;
+ endfor;
+ fi;
+ for k=0 upto deno-1:
+ if RetiensPart<nume:
+ if Reste>(nume-RetiensPart):
+ test:=uniformdeviate(1);
+ if test>0.5:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(case[k] shifted(m*(Longueur+1cm,0)),45,0.25,0) withcolor ColRectangle;
+ else:
+ fill case[k] shifted(m*(Longueur+1cm,0)) withcolor ColRectangle;
+ fi;
+ fi;
+ else:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(case[k] shifted(m*(Longueur+1cm,0)),45,0.25,0) withcolor ColRectangle;
+ else:
+ fill case[k] shifted(m*(Longueur+1cm,0)) withcolor ColRectangle;
+ fi;
+ fi;
+ fi;
+ Reste:=Reste-1;
+ endfor;
+ fi;
+ for l=0 upto m:
+ trace FondRectangle shifted(l*(Longueur+1cm,0));
+ endfor;
+ );
+ RetourRectangle
+ enddef;
+}%
+
\def\MPFractionRectangleCode{%
Longueur=\useKV[ClesFraction]{Longueur};
Largeur=\useKV[ClesFraction]{Largeur};
@@ -378,7 +723,13 @@
\ifluatex%
\mplibforcehmode%
\begin{mplibcode}
- \MPFractionRectangleCode
+ boolean Alea;
+ Alea=\useKV[ClesFraction]{Aleatoire};
+ if Alea:
+ \MPFractionRectangleCodeAlea;
+ else:
+ \MPFractionRectangleCode;
+ fi;
trace FractionRectangle(#1,#2);
\end{mplibcode}
\else%
@@ -388,6 +739,101 @@
\fi%
}%
+\def\MPFractionDisqueCodeAlea{%
+ Rayon=\useKV[ClesFraction]{Rayon};
+ Epaisseur=\useKV[ClesFraction]{Epaisseur};
+ color ColDisque;
+ ColDisque=\useKV[ClesFraction]{Couleur};
+ boolean Hachures,Reponse;
+ Hachures=\useKV[ClesFraction]{Hachures};
+ Reponse:=\useKV[ClesFraction]{Reponse};
+ %
+ pair A,B[];
+ A=(0,0);
+ path cc,part[];
+ cc=cercles(A,Rayon);
+ vardef FractionDisque(expr nume,deno)=
+ for k=0 upto deno+1:
+ B[k]=pointarc(cc,(360/deno)*k);
+ endfor;
+ for k=0 upto deno-1:
+ part[k]=A--arccercle(B[k],B[k+1],A)--cycle;
+ endfor;
+ m=(nume div deno);
+ if (nume mod deno)=0:m:=m-1; fi;
+ picture RetourFraction;
+ RetourFraction=image(%
+ Reste=((nume div deno)+1)*deno;
+ RetiensPart=0;
+ if Reponse:
+ if m>0:
+ for l=0 upto (m-1):
+ for k=0 upto deno-1:
+ if RetiensPart<nume:
+ if Reste>(nume-RetiensPart):
+ test:=uniformdeviate(1);
+ if test>0.5:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(l*(2*Rayon+1cm,0)),1.5*360/deno,0.25,0) withcolor ColDisque;
+ else:
+ fill part[k] shifted(l*(2*Rayon+1cm,0)) withcolor ColDisque;
+ fi;
+ fi;
+ else:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(l*(2*Rayon+1cm,0)),1.5*360/deno,0.25,0) withcolor ColDisque;
+ else:
+ fill part[k] shifted(l*(2*Rayon+1cm,0)) withcolor ColDisque;
+ fi;
+ fi;
+ fi;
+ Reste:=Reste-1;
+ endfor;
+ endfor;
+ fi;
+ for k=0 upto deno-1:
+ if RetiensPart<nume:
+ if Reste>(nume-RetiensPart):
+ test:=uniformdeviate(1);
+ if test>0.5:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(m*(2*Rayon+1cm,0)),1.5*360/deno,0.25,0) withcolor ColDisque;
+ else:
+ fill part[k] shifted(m*(2*Rayon+1cm,0)) withcolor ColDisque;
+ fi;
+ fi;
+ else:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(m*(2*Rayon+1cm,0)),1.5*360/deno,0.25,0) withcolor ColDisque;
+ else:
+ fill part[k] shifted(m*(2*Rayon+1cm,0)) withcolor ColDisque;
+ fi;
+ fi;
+ fi;
+ Reste:=Reste-1;
+ endfor;
+ fi;
+ drawoptions(withpen pencircle scaled Epaisseur);
+ for l=0 upto m:
+ draw cc shifted(l*(2*Rayon+1cm,0));
+ for k=0 upto (deno-1):
+ draw segment(A,B[k]) shifted(l*(2*Rayon+1cm,0));
+ endfor;
+ endfor;
+ drawoptions();
+ );
+ RetourFraction
+ enddef;
+}%
+
\def\MPFractionDisqueCode{%
Rayon=\useKV[ClesFraction]{Rayon};
Epaisseur=\useKV[ClesFraction]{Epaisseur};
@@ -444,7 +890,13 @@
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+ boolean Alea;
+ Alea=\useKV[ClesFraction]{Aleatoire};
+ if Alea:
+ \MPFractionDisqueCodeAlea;
+ else:
\MPFractionDisqueCode
+ fi;
trace FractionDisque(#1,#2);
\end{mplibcode}
\else
@@ -454,6 +906,115 @@
\fi
}
+\def\MPFractionSegmentCodeAlea{%
+ Longueur=\useKV[ClesFraction]{Longueur};
+ color ColSegment;
+ ColSegment=\useKV[ClesFraction]{Couleur};
+ boolean Hachures,Reponse;
+ Reponse=\useKV[ClesFraction]{Reponse};
+ Hachures=\useKV[ClesFraction]{Hachures};
+ Epaisseur=\useKV[ClesFraction]{Epaisseur};
+ %
+ pair A,C,B[];
+ A=(0,0);
+ C-A=(Longueur,0);
+ %
+ path part[];
+ %
+ vardef FractionSegment(expr nume,deno)=
+ for k=0 upto deno:
+ B[k]=(k/deno)[A,C];
+ endfor;
+ for k=0 upto deno-1:
+ part[k]=polygone(B[k]+u*(0,-0.15),B[k+1]+u*(0,-0.15),B[k+1]+u*(0,0.15),B[k]+u*(0,0.15));
+ endfor;
+ m=nume div deno;
+ picture RetourFraction;
+ RetourFraction=image(
+ Reste=((nume div deno)+1)*deno;
+ RetiensPart=0;
+ % Reponse
+ if Reponse:
+ if m>0:
+ for l=0 upto (m-1):
+ for k=0 upto deno-1:
+ if RetiensPart<nume:
+ if Reste>(nume-RetiensPart):
+ test:=uniformdeviate(1);
+ if test>0.5:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(l*(Longueur+1cm,0)),120,0.2,0) withcolor ColSegment;
+ drawoptions();
+ else:
+ draw (segment(B[k],B[k+1]) shifted(l*(Longueur+1cm,0))) withpen pencircle scaled 2 withcolor ColSegment;
+ fi;
+ fi;
+ else:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(l*(Longueur+1cm,0)),120,0.2,0) withcolor ColSegment;
+ drawoptions();
+ else:
+ draw (segment(B[k],B[k+1]) shifted(l*(Longueur+1cm,0))) withpen pencircle scaled 2 withcolor ColSegment;
+ fi;
+ fi;
+ fi;
+ Reste:=Reste-1;
+ endfor;
+ endfor;
+ fi;
+ for k=0 upto deno-1:
+ if RetiensPart<nume:
+ if Reste>(nume-RetiensPart):
+ test:=uniformdeviate(1);
+ if test>0.5:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(m*(Longueur+1cm,0)),120,0.2,0) withcolor ColSegment;
+ drawoptions();
+ else:
+ draw (segment(B[k],B[k+1]) shifted(m*(Longueur+1cm,0))) withpen pencircle scaled 2 withcolor ColSegment;
+ fi;
+ fi;
+ else:
+ RetiensPart:=RetiensPart+1;
+ if Hachures:
+ drawoptions(withpen pencircle scaled Epaisseur);
+ draw hachurage(part[k] shifted(m*(Longueur+1cm,0)),120,0.2,0) withcolor ColSegment;
+ else:
+ draw (segment(B[k],B[k+1]) shifted(m*(Longueur+1cm,0))) withpen pencircle scaled 2 withcolor ColSegment;
+ fi;
+ fi;
+ fi;
+ Reste:=Reste-1;
+ endfor;
+ fi;
+ %fin Reponse
+ if Hachures:drawoptions(withpen pencircle scaled Epaisseur);fi;
+ % draw (segment(B[0],B[nume mod deno]) shifted(m*(Longueur+1cm,0)));
+ for l=0 upto m:
+ draw segment(A,C) shifted(l*(Longueur+1cm,0));
+ endfor;
+ marque_p:="tiretv";
+ for l=0 upto m-1:
+ for k=0 upto deno:
+ pointe(B[k] shifted(l*(Longueur+1cm,0)));
+ endfor;
+ endfor;
+ if (nume mod deno)<>0:
+ for k=0 upto deno:
+ pointe(B[k] shifted(m*(Longueur+1cm,0)));
+ endfor;
+ fi;
+ );
+ RetourFraction
+ enddef;
+}
+
\def\MPFractionSegmentCode{%
Longueur=\useKV[ClesFraction]{Longueur};
color ColSegment;
@@ -525,7 +1086,13 @@
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+ boolean Alea;
+ Alea=\useKV[ClesFraction]{Aleatoire};
+ if Alea:
+ \MPFractionSegmentCodeAlea;
+ else:
\MPFractionSegmentCode
+ fi;
trace FractionSegment(#1,#2);
\end{mplibcode}
\else
diff --git a/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex b/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex
index 0e6162aa76..9b1bcaa8b1 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex
@@ -1,9 +1,15 @@
%%%
% Tableur
%%%
-\setKVdefault[Tableur]{Colonnes=4,Largeur=30pt,LargeurUn=30pt,Bandeau=true,Formule={},Cellule=A1,Ligne=0,Colonne=0,PasL=1,PasC=1,Selection=false,DebutColonnes=0,DebutLignes=0,LargeurNombre=10pt}%
+\def\filedateRepTab{2024/08/21}%
+\def\fileversionRepTab{0.1a}%
+\message{-- \filedateRepTab\space v\fileversionRepTab}%
+%
+\setKVdefault[Tableur]{Colonnes=4,Largeur=30pt,LargeurUn=30pt,Bandeau=true,Formule={},Cellule=A1,Ligne=0,Colonne=0,PasL=1,PasC=1,Selection=false,DebutColonnes=0,DebutLignes=0,LargeurNombre=10pt,Apres=false,ApresBandeau=false}%
%Idee de P. Nuns
\defKV[Tableur]{Couleur=\setKV[Tableur]{Selection}}%
+\defKV[Tableur]{CodeAfter=\setKV[Tableur]{Apres}}%
+\defKV[Tableur]{CodeAfterBandeau=\setKV[Tableur]{ApresBandeau}}%
%
%Bas\'e sur un code de Christian T\'ell\'ech\'ea.
@@ -20,6 +26,9 @@
\ifremain@lines#2\\\@nil{\addtot@b&\subst@eol#2\@nil}{\addtot@b{#2\CodeAfter\xintifboolexpr{\useKV[Tableur]{Ligne}==0 || \useKV[Tableur]{Colonne}==0}{}{%
\tikz\node at (row-\fpeval{\useKV[Tableur]{Ligne}+1+\useKV[Tableur]{PasL}}-|col-\fpeval{\useKV[Tableur]{Colonne}+1+\useKV[Tableur]{PasC}}) {\tiny$\blacksquare$};%
}%
+ \ifboolKV[Tableur]{Apres}{%
+ \useKV[Tableur]{CodeAfter}%
+ }{}%
\end{NiceTabular}}}}%
\long\def\collectcp@body#1\end{\subst@eol#1\@nil\end}%
@@ -103,6 +112,10 @@
\ifboolKV[Tableur]{Bandeau}{%
\begin{NiceTabular}{p{\PfCTableurLargeur}p{10pt}p{50pt}p{\PfCLongInter}}%
\Block[draw,l]{}{\useKV[Tableur]{Cellule}}&\Block[draw]{}{\scriptsize$\blacktriangledown$}&\Block{}{$f_x$\hfill$\sum$~\scriptsize$\blacktriangledown$\hfill$=$}&\Block[draw]{}{\useKV[Tableur]{Formule}\hfill\scriptsize$\blacktriangledown$}\\
+ \CodeAfter
+ \ifboolKV[Tableur]{ApresBandeau}{%
+ \useKV[Tableur]{CodeAfterBandeau}%
+ }{}%
\end{NiceTabular}%
\nopagebreak%
\\%
diff --git a/macros/latex/contrib/profcollege/latex/PfCReseauxSociaux.tex b/macros/latex/contrib/profcollege/latex/PfCReseauxSociaux.tex
index 996e33c026..2ccc0748f6 100644
--- a/macros/latex/contrib/profcollege/latex/PfCReseauxSociaux.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCReseauxSociaux.tex
@@ -1,6 +1,10 @@
%%%
% Twitter
%%%
+\def\filedateReseaux{2024/08/04}%
+\def\fileversionReseaux{0.1}%
+\message{-- \filedateReseaux\space v\fileversionReseaux}%
+%
\setKVdefault[Twitter]{Largeur=0.95\linewidth,Auteur=Christophe,Date=\today,Url=ViveLaTeX,EchelleLogo=0.035,Logo=DrStrange,Publie=false}%
\NewDocumentEnvironment{Twitter}{o+b}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCResoudreEquation.tex b/macros/latex/contrib/profcollege/latex/PfCResoudreEquation.tex
index a5ce8ebf63..795a79e833 100644
--- a/macros/latex/contrib/profcollege/latex/PfCResoudreEquation.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCResoudreEquation.tex
@@ -1,6 +1,10 @@
%%%
% Equations
%%%
+\def\filedateEquation{2024/08/04}%
+\def\fileversionEquation{0.1}%
+\message{-- \filedateEquation\space v\fileversionEquation}%
+%
\setKVdefault[ClesEquation]{Ecart=0.5,Fleches=false,FlecheDiv=false,Laurent=false,Decomposition=false,Terme=false,Composition=false,Symbole=false,ModeleBarre=false,Decimal=false,Entier=false,Lettre=x,Solution=false,LettreSol=true,Bloc=false,Simplification=false,CouleurTerme=black,CouleurCompo=black,CouleurSous=red,CouleurSymbole=orange,Verification=false,Nombre=0,Egalite=false,Produit=false,Facteurs=false,Carre=false,Exact=false,Pose=false,Equivalence=false}
\newcommand\rightcomment[4]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRondeInfernale.tex b/macros/latex/contrib/profcollege/latex/PfCRondeInfernale.tex
index 9fc7f3446d..26a78fcc2f 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRondeInfernale.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRondeInfernale.tex
@@ -1,6 +1,10 @@
%%%
% Ronde infernale
%%%
+\def\filedateRondeI{2024/08/04}%
+\def\fileversionRondeI{0.1}%
+\message{-- \filedateRondeI\space v\fileversionRondeI}%
+%
\newcommand\TestNombrePremier[1]{%
% #1 le nombre \`a tester
\newcount\anp\newcount\bnp\newcount\cnp%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRose.tex b/macros/latex/contrib/profcollege/latex/PfCRose.tex
index d6059cdd7e..3798a26f74 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRose.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRose.tex
@@ -1,6 +1,10 @@
%%%
% Rose
%%%
+\def\filedateRose{2024/08/04}%
+\def\fileversionRose{0.1}%
+\message{-- \filedateRose\space v\fileversionRose}%
+%
\setKVdefault[ClesRose]{Vide=false,Couleur=white,Produits=false,Solution=false,Rayon=2cm,Petales=7,Aide=false,FacteurMin=2,FacteurMax=10,ProduitVide=false,CaseVide=false,Polygone=false,Nom=Rose1,Creation=false,Addition=false,Melange=false,CDot=false}%
\defKV[ClesRose]{LesNombres=\setKV[ClesRose]{Creation}}%
\defKV[ClesRose]{LesProduits=\setKV[ClesRose]{Creation}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCScratch.tex b/macros/latex/contrib/profcollege/latex/PfCScratch.tex
index 0315d8d3a8..778ee15174 100644
--- a/macros/latex/contrib/profcollege/latex/PfCScratch.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCScratch.tex
@@ -1,6 +1,10 @@
%%%%
% Scratch
%%%%
+\def\filedateScratch{2024/08/04}%
+\def\fileversionScratch{0.1}%
+\message{-- \filedateScratch\space v\fileversionScratch}%
+%
\newlength{\longbarreheight}
\setlength{\longbarreheight}{2.1ex+3pt}
diff --git a/macros/latex/contrib/profcollege/latex/PfCSerpent.tex b/macros/latex/contrib/profcollege/latex/PfCSerpent.tex
index cd38bd90a2..e4352613d7 100644
--- a/macros/latex/contrib/profcollege/latex/PfCSerpent.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCSerpent.tex
@@ -1,10 +1,14 @@
%%%
% Serpent
%%%
+\def\filedateSerpent{2024/08/04}%
+\def\fileversionSerpent{0.1}%
+\message{-- \filedateSerpent\space v\fileversionSerpent}%
+%
\newtoks\tokListeSerpentPerso{}%
\def\UpdatetoksSerpent#1\nil{\addtotok\tokListeSerpentPerso{"#1"}}%
-\setKVdefault[Serpent]{Cases=9,Case=1,Solution=false,PasQuad=7mm,ValeurMin=2,ValeurMax=10,Creation=false,Graines=false}
+\setKVdefault[Serpent]{Cases=9,Case=1,Solution=false,PasQuad=7mm,ValeurMin=2,ValeurMax=10,Creation=false,Graines=false,Direct=false,Disque=false,Spirale=false}
\defKV[Serpent]{CouleurSolution=\setKV[Serpent]{Solution}}%
\defKV[Serpent]{Perso=\setKV[Serpent]{Creation}\xdef\PfCFooCheminSerpent{#1}}%+Liste des déplacements
\defKV[Serpent]{Graine=\setKV[Serpent]{Graines}}%
@@ -19,7 +23,14 @@
\BuildSerpent{\the\tokListeSerpentPerso}%
\reademptyitems%
}{%
- \BuildSerpent{}%
+ \ifboolKV[Serpent]{Direct}{%
+ \BuildSerpentDirect{}%
+ }{\ifboolKV[Serpent]{Spirale}{%
+ %\BuildSerpentSpirale{}%
+ }{%
+ \BuildSerpent{}%
+ }%
+ }%
}%
}%
@@ -29,10 +40,11 @@
\mplibnumbersystem{double}%
\begin{mplibcode}
%
- boolean Solution,Perso,Graines;
+ boolean Solution,Perso,Graines,Disque;
Solution=\useKV[Serpent]{Solution};
Perso=\useKV[Serpent]{Creation};
Graines=\useKV[Serpent]{Graines};
+ Disque=\useKV[Serpent]{Disque};
%
if Graines:
randomseed:=\useKV[Serpent]{Graine};
@@ -210,7 +222,11 @@
fi;
fi;
for k=1 upto LongueurChemin:
+ if Disque:
+ trace (fullcircle scaled (2*PasQuad)) shifted (N[k]+PasQuad*(1,1));
+ else:
trace (unitsquare scaled (2*PasQuad)) shifted N[k];
+ fi;
endfor;
for k=1 upto LongueurChemin-1:
drawarrow (center (unitsquare scaled (2*PasQuad)) shifted N[k])--(center (unitsquare scaled (2*PasQuad)) shifted N[k+1]) cutbefore ((unitsquare scaled (2*PasQuad)) shifted N[k]) cutafter ((unitsquare scaled (2*PasQuad)) shifted N[k+1]);
@@ -363,4 +379,193 @@
\end{mplibcode}
\mplibnumbersystem{scaled}%
\fi
+}%
+
+\NewDocumentCommand\BuildSerpentDirect{m}{%
+ \ifluatex%
+ \mplibforcehmode%
+ \mplibnumbersystem{double}%
+ \begin{mplibcode}
+ %
+ boolean Solution,Graines,Disque;
+ Solution=\useKV[Serpent]{Solution};
+ Graines=\useKV[Serpent]{Graines};
+ Disque=\useKV[Serpent]{Disque};
+ %
+ if Graines:
+ randomseed:=\useKV[Serpent]{Graine};
+ fi;
+ %
+ color CoulSolution;
+ if Solution:
+ CoulSolution=\useKV[Serpent]{CouleurSolution};
+ fi;
+ %
+ numeric LongueurChemin,Depart;
+ LongueurChemin=\useKV[Serpent]{Cases};
+ ValeurMin=\useKV[Serpent]{ValeurMin};
+ ValeurMax=\useKV[Serpent]{ValeurMax};
+ CaseDepart=\useKV[Serpent]{Case};
+ Depart=ValeurMin+floor(uniformdeviate(ValeurMax-ValeurMin+1));
+ %
+ PasQuad=5mm;%\useKV[Serpent]{PasQuad};
+ %
+ pair N[];
+ N[1]:=4*PasQuad*(0,0);
+ for k=2 upto LongueurChemin:
+ N[k]=N[k-1]+4*PasQuad*(1,0);
+ endfor;
+ % Tracage
+ if CaseDepart=1:
+ label(TEX("\Large"&decimal(Depart)),N[1] shifted(PasQuad*(1,1)));
+ else:
+ if Solution:
+ label(TEX("\Large"&decimal(Depart)),N[1] shifted(PasQuad*(1,1))) withcolor CoulSolution;
+ fi;
+ fi;
+ for k=1 upto LongueurChemin:
+ if Disque:
+ trace (fullcircle scaled (2*PasQuad)) shifted (N[k]+PasQuad*(1,1));
+ else:
+ trace (unitsquare scaled (2*PasQuad)) shifted N[k];
+ fi;
+ endfor;
+ %
+ path cheminfleche[];
+ path CheminFlecheBase;
+ CheminFlecheBase=(0,2*PasQuad){dir45}..(4*PasQuad,2*PasQuad);
+ for k=1 upto LongueurChemin-1:
+ cheminfleche[k]=CheminFlecheBase shifted (N[k]+(PasQuad,0));
+ %cheminfleche[k]=(center (unitsquare scaled (2*PasQuad)) shifted N[k]){dir45}..(center (unitsquare scaled (2*PasQuad)) shifted N[k+1]) cutbefore ((unitsquare scaled (2*PasQuad)) shifted N[k]) cutafter ((unitsquare scaled (2*PasQuad)) shifted N[k+1]);
+ drawarrow cheminfleche[k];
+ endfor;
+ %%drawoptions();
+ boolean PremierChiffre;
+ PremierChiffre=true;
+ %% Test Premier
+ vardef TestPremier(expr nombre)=
+ nbdiviseur:=0;
+ nbdiv:=0;
+ for k=2 upto nombre:
+ if (nombre mod k)=0:
+ nbdiviseur:=nbdiviseur+1;
+ if k<11:
+ nbdiv:=nbdiv+1;
+ Diviseur[nbdiv]:=k;
+ fi;
+ fi;
+ endfor;
+ if nbdiviseur>1:
+ PremierChiffre:=false;
+ else:
+ PremierChiffre:=true;
+ fi;
+ enddef;
+ % Les opérations
+ numeric Chiffre[];
+ pair St[];
+ Chiffre[1]=Depart;
+ %
+ vardef EcrireSomme(expr tt)=
+ Somme:=5+ceiling(uniformdeviate(10));
+ Chiffre[tt]=Chiffre[tt-1]+Somme;
+ St[tt]=point(0.5*length cheminfleche[tt-1]) of cheminfleche[tt-1];
+ label.top(TEX("$+"&decimal(Somme)&"$"),St[tt]);
+ enddef;
+ %
+ vardef EcrireProduit(expr tt)=
+ Multiple:=1+ceiling(uniformdeviate(8));
+ Chiffre[tt]=Chiffre[tt-1]*Multiple;
+ St[tt]=point(0.5*length cheminfleche[tt-1]) of cheminfleche[tt-1];
+ label.top(TEX("$\PfCSymbolTimes"&decimal(Multiple)&"$"),St[tt]);
+ enddef;
+ %
+ vardef EcrireDifferenceCent(expr tt)=
+ Difference:=ceiling(Chiffre[tt-1]-15+uniformdeviate(10));
+ Chiffre[tt]=Chiffre[tt-1]-Difference;
+ St[tt]=point(0.5*length cheminfleche[tt-1]) of cheminfleche[tt-1];
+ label.top(TEX("$-"&decimal(Difference)&"$"),St[tt]);
+ enddef;
+ %
+ vardef EcrireDifference(expr tt)=
+ Difference:=if Chiffre[tt-1]<20:1+floor(uniformdeviate(Chiffre[tt-1]-1)) else: 5+ceiling(uniformdeviate(10)) fi;
+ Chiffre[tt]=Chiffre[tt-1]-Difference;
+ St[tt]=point(0.5*length cheminfleche[tt-1]) of cheminfleche[tt-1];
+ label.top(TEX("$-"&decimal(Difference)&"$"),St[tt]);
+ enddef;
+ %
+ vardef EcrireQuotient(expr tt)=
+ choixdiv:=ceiling(nbdiv);
+ Quotient:=Diviseur[choixdiv];
+ Chiffre[tt]=Chiffre[tt-1] div Quotient;
+ St[tt]=point(0.5*length cheminfleche[tt-1]) of cheminfleche[tt-1];
+ label.top(TEX("$\PfCSymbolDiv"&decimal(Quotient)&"$"),St[tt]);
+ enddef;
+ %
+ for k=2 upto LongueurChemin:
+ if (Chiffre[k-1]=1) or (Chiffre[k-1]=0):
+ % On additionne ou on multiplie si c'est un
+ if Chiffre[k-1]=1:
+ alea:=ceiling(uniformdeviate(2));
+ if alea=1:
+ EcrireSomme(k);
+ else:
+ EcrireProduit(k);
+ fi;
+ else:
+ EcrireSomme(k);
+ fi;
+ else:
+ TestPremier(Chiffre[k-1]);
+ if PremierChiffre:
+ if Chiffre[k-1]>100:
+ EcrireDifferenceCent(k);
+ else:
+ alea:=ceiling(uniformdeviate(3));
+ if alea=1:
+ EcrireSomme(k);
+ elseif alea=2:
+ EcrireDifference(k);
+ elseif alea=3:
+ EcrireProduit(k);
+ fi;
+ fi;
+ if k=CaseDepart:
+ label(TEX("\Large"&decimal(Chiffre[k])),N[k] shifted(PasQuad*(1,1)));
+ elseif Solution:
+ label(TEX("\Large"&decimal(Chiffre[k])),N[k] shifted(PasQuad*(1,1))) withcolor CoulSolution;
+ fi;
+ else:
+ if Chiffre[k-1]>100:
+ alea:=ceiling(uniformdeviate(2));
+ if alea=1:
+ EcrireDifferenceCent(k);
+ else:
+ EcrireQuotient(k);
+ fi;
+ else:
+ alea:=ceiling(uniformdeviate(4));
+ if alea=1:
+ EcrireSomme(k);
+ elseif alea=2:
+ EcrireDifference(k);
+ elseif alea=3:
+ EcrireProduit(k);
+ elseif alea=4:
+ EcrireQuotient(k);
+ fi;
+ fi;
+ fi;
+ fi;
+ if k=CaseDepart:
+ label(TEX("\Large"&decimal(Chiffre[k])),N[k] shifted(PasQuad*(1,1)));
+ else:
+ if Solution:
+ label(TEX("\Large"&decimal(Chiffre[k])),N[k] shifted(PasQuad*(1,1))) withcolor CoulSolution;
+ fi;
+ fi;
+ endfor;
+ \end{mplibcode}
+ \mplibnumbersystem{scaled}%
+ \fi
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCShikaku.tex b/macros/latex/contrib/profcollege/latex/PfCShikaku.tex
index 04084cadca..8f6616ff3e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCShikaku.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCShikaku.tex
@@ -1,6 +1,10 @@
%%%
% Shikaku
%%%
+\def\filedateShikaku{2024/08/04}%
+\def\fileversionShikaku{0.1}%
+\message{-- \filedateShikaku\space v\fileversionShikaku}%
+%
\newcounter{PfCShikakuNom}
\setcounter{PfCShikakuNom}{0}
diff --git a/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex b/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex
index 94429def36..9fb16f325d 100644
--- a/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex
@@ -1,6 +1,10 @@
%%%
% Simplification
%%%
+\def\filedateSimpFraction{2024/08/13}%
+\def\fileversionSimpFraction{0.1a}%
+\message{-- \filedateSimpFraction\space v\fileversionSimpFraction}%
+%
\makeatletter%by christian Tellechea
% Calcul du PGCD de #1 et #2
\newcount\cnt@a\newcount\cnt@b\newcount\pgcd
@@ -160,7 +164,7 @@
\ifboolKV[ClesSimplification]{Debut}{%
\ensuremath{%
\whiledo{\PfCDivCom>1}{%
- \frac{\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}\times\num{\fpeval{\PfCNumerateurDiv/\the\PfCDivCom}}}{\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}\times\num{\fpeval{\PfCDenominateurDiv/\the\PfCDivCom}}}=\frac{\num{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}}{\num{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}}%
+ \frac{\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}\times\ifboolKV[ClesSimplification]{ACompleter}{\pointilles[20pt]}{\num{\fpeval{\PfCNumerateurDiv/\the\PfCDivCom}}}}{\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}\times\ifboolKV[ClesSimplification]{ACompleter}{\pointilles[20pt]}{\num{\fpeval{\PfCDenominateurDiv/\the\PfCDivCom}}}}=\frac{\ifboolKV[ClesSimplification]{ACompleter}{\pointilles[20pt]}{\num{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}}}{\ifboolKV[ClesSimplification]{ACompleter}{\pointilles[20pt]}{\num{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}}}%
\xdef\PfCNumerateurDiv{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}%
\xdef\PfCDenominateurDiv{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}%
\DiviseurCommun{\PfCNumerateurDiv}{\PfCDenominateurDiv}%
@@ -170,7 +174,7 @@
}{%
\ensuremath{%
\whiledo{\PfCDivCom>1}{%
- \frac{\num{\fpeval{\PfCNumerateurDiv/\the\PfCDivCom}}\times\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}}{\num{\fpeval{\PfCDenominateurDiv/\the\PfCDivCom}}\times\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}}=\frac{\num{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}}{\num{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}}%
+ \frac{\ifboolKV[ClesSimplification]{ACompleter}{\pointilles[20pt]}{\num{\fpeval{\PfCNumerateurDiv/\the\PfCDivCom}}}\times\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}}{\ifboolKV[ClesSimplification]{ACompleter}{\pointilles[20pt]}{\num{\fpeval{\PfCDenominateurDiv/\the\PfCDivCom}}}\times\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}}=\frac{\ifboolKV[ClesSimplification]{ACompleter}{\pointilles[20pt]}{\num{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}}}{\ifboolKV[ClesSimplification]{ACompleter}{\pointilles[20pt]}{\num{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}}}%
\xdef\PfCNumerateurDiv{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}%
\xdef\PfCDenominateurDiv{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}%
\DiviseurCommun{\PfCNumerateurDiv}{\PfCDenominateurDiv}%
@@ -180,7 +184,7 @@
}%
}%
-\setKVdefault[ClesSimplification]{Details=false,All=false,Longue=false,Fleches=false,Contraire=0,Couleur=black,Debut=false,Impose=false,Decomposition=false,DecompositionSeule=false}%
+\setKVdefault[ClesSimplification]{Details=false,All=false,Longue=false,Fleches=false,Contraire=0,Couleur=black,Debut=false,Impose=false,Decomposition=false,DecompositionSeule=false,ACompleter=false}%
\defKV[ClesSimplification]{Nombre=\setKV[ClesSimplification]{Impose}}%
\newcounter{NbFrac}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCSolides.tex b/macros/latex/contrib/profcollege/latex/PfCSolides.tex
index 9da7bce259..8ed8899a37 100644
--- a/macros/latex/contrib/profcollege/latex/PfCSolides.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCSolides.tex
@@ -1,11 +1,127 @@
%%%
% Solide et sections
%%%
-\setKVdefault[ClesSolides]{Nom=cube,Aretes,Sommets,Pointilles,Largeur=1.5,Hauteur=1,Profondeur=0.75,ListeSommets={A,B,C,D,E,F,G,H},Rho=1500,Phi=30,Theta=20,Distance=50,Code=false,Couleur=white,Anglex=0,RayonCone=1,HauteurCone=2,HauteurPyramide=2,SommetsPyramide=5,Reguliere=false,DecalageSommet={(0,0,0)},RayonCylindre=1,HauteurCylindre=2,RayonSphere=1,AutoLabel=true,Sections=false,CoefSection=0.3,Axes=false,PointsSection={M,N,O,P},RemplisSection=false,ObjetSection={0.5,E,H,0.25,F,G,G,B}}%
+\def\filedateSolides{2024/08/20}%
+\def\fileversionSolides{0.1a}%
+\message{-- \filedateSolides\space v\fileversionSolides}%
+%
+\setKVdefault[ClesSolides]{Nom=cube,Aretes,Sommets,Pointilles,Largeur=1.5,Hauteur=1,Profondeur=0.75,ListeSommets={A,B,C,D,E,F,G,H},Rho=1500,Phi=30,Theta=20,Distance=50,Code=false,Couleur=white,Anglex=0,Arete=1,RayonCone=1,HauteurCone=2,HauteurPrisme=2,SommetsPrisme=6,HauteurPyramide=2,SommetsPyramide=5,Reguliere=false,DecalageSommet={(0,0,0)},RayonCylindre=1,HauteurCylindre=2,RayonSphere=1,AutoLabel=true,Sections=false,CoefSection=0.3,Axes=false,PointsSection={M,N,O,P},RemplisSection=false,ObjetSection={0.5,E,H,0.25,F,G,G,B}}%
\defKV[ClesSolides]{Traces=\setKV[ClesSolides]{Code}}%
\defKV[ClesSolides]{Section=\setKV[ClesSolides]{Sections}}%
\defKV[ClesSolides]{CouleurSection=\setKV[ClesSolides]{RemplisSection}}%
+\newcommand\MPSolidePrisme[4]{%
+ \ifluatex
+ \mplibnumbersystem{double}
+ \mplibforcehmode
+ \begin{mplibcode}
+ input PfCSolid;
+
+ boolean Pointilles,TraceArete,NommeSommets,Code,AutoLabel,Sections,RemplisSection;
+ AutoLabel:=\useKV[ClesSolides]{AutoLabel};
+ Pointilles=\useKV[ClesSolides]{Pointilles};
+ TraceArete=\useKV[ClesSolides]{Aretes};
+ NommeSommets=\useKV[ClesSolides]{Sommets};
+ Code=\useKV[ClesSolides]{Code};
+ Sections:=\useKV[ClesSolides]{Sections};
+ RemplisSection=\useKV[ClesSolides]{RemplisSection};
+ if RemplisSection:color CouleurSection;CouleurSection=\useKV[ClesSolides]{CouleurSection};fi;
+
+ color PfCOutColor;
+ PfCOutColor=Cornsilk;%\useKV[ClesSolides]{Couleur};
+
+ string Section;
+ if Sections:Section=\useKV[ClesSolides]{Section};fi;
+
+ %Initialisation
+ PfCRho=\useKV[ClesSolides]{Rho};
+ PfCPhi=\useKV[ClesSolides]{Phi};
+ PfCTheta=\useKV[ClesSolides]{Theta};
+ PfCDistance=\useKV[ClesSolides]{Distance};
+ anglerotationx=\useKV[ClesSolides]{Anglex};
+ hauteurprisme=\useKV[ClesSolides]{HauteurPrisme};
+ nombresommets=\useKV[ClesSolides]{SommetsPrisme};
+ Initialisation(PfCRho,PfCPhi,PfCTheta,PfCDistance);
+ typetrace:="3D";
+ typerepre:="persp";
+ eclairage:=false;
+ incolor:=white;
+ outcolor:=white;
+ if Pointilles=false:
+ pointilles:="non";
+ fi;
+
+ Ferme1:=true;
+
+ color A,B,C,D,E,F,G,H;
+ color Sommet[];
+
+ NbS:=nombresommets;
+
+ color TS[];
+
+ ecartangle=360/(NbS/2);
+ for k=1 upto (NbS/2):
+ repereangle:=(k-2)*ecartangle+(ecartangle*0.25+uniformdeviate(floor(ecartangle/2)));
+ TS[k]:=(cosd(repereangle),-sind(repereangle),0);
+ endfor;
+ TS[NbS/2+1]:=TS[1];
+
+ for k=1 upto (NbS/2):
+ TS[NbS/2+1+k]:=TS[k]+(0,0,hauteurprisme);
+ endfor;
+ TS[NbS+2]:=TS[NbS/2+2];
+
+ angx:=anglerotationx;
+ for k=1 upto (NbS+2):
+ TS[k]:=RotXYZ(TS[k]);
+ endfor;
+ angx:=0;
+
+ ObjetNew1(%
+ TS1, for k=2 upto (NbS+1):TS[k], endfor TS[NbS+2]
+ )(%
+ NbS/2, for p_=1 upto NbS/2:p_, endfor
+ NbS/2, for p_=NbS/2+1 downto NbS+2:p_, endfor
+ for p=1 upto NbS/2:
+ 4,p,p+1,NbS/2+1+p+1,NbS/2+1+p,%
+ endfor
+ );
+ %AffichageObjet1;
+
+ NF:=(NbS/2+2);
+ Fc[100*(NbS/2+1)]:=NbS/2;
+ for k=1 upto NbS/2:
+ Fc[100*(NbS/2+1)+k]:=k;
+ endfor;
+ Fc[100*(NbS/2+2)]:=NbS/2;
+ for k=1 upto NbS/2:
+ Fc[100*(NbS/2+2)+k]:=NbS+2-k;
+ endfor;
+ for l=1 upto NbS/2:
+ Fc[l*100]:=4;
+ %for k=1 upto 4:
+ Fc[l*100+1]:=l;Fc[l*100+4]:=l+1;Fc[l*100+3]:=NbS/2+1+l+1;Fc[l*100+2]:=NbS/2+1+l;
+ %Fc[101]:=1;Fc[102]:=2;Fc[103]:=6;Fc[104]:=5;
+ %endfor;
+ endfor;
+ DefinirSommets(#1);
+ DessineObjet;
+% picture Depart;
+% Depart=currentpicture;
+% currentpicture:=nullpicture;
+% for k=1 upto 8:
+% dotlabel.top(decimal(k),Projette(TS[k]));
+% endfor;
+ u:=1cm;
+ if Code:
+ \useKV[ClesSolides]{Traces};
+ fi;
+ \end{mplibcode}
+ \mplibnumbersystem{scaled}
+ \fi
+}
+
\newcommand\MPSolideCylindre[3]{%
\ifluatex
\mplibnumbersystem{double}
@@ -380,7 +496,6 @@
if Code:
\useKV[ClesSolides]{Traces};
fi;
-
\end{mplibcode}
\mplibnumbersystem{scaled}
\fi
@@ -622,7 +737,7 @@
% trace polygone(MSection1,MSection2,MSection3,MSection4);
color dcer,ccer;
% 1er cote -> ok
- DotLabel("",RetiensDefSection[4]);
+ %DotLabel("",RetiensDefSection[4]);
dcer:=Oeil-RetiensDefSection[4];
ccer:=Normal(RetiensDefSection[4],RetiensDefSection[2],RetiensDefSection[1]);
draw chemin(MSection1,MSection2) if (ProduitScalaire(dcer,ccer)<0):dashed evenly fi;
@@ -927,7 +1042,7 @@
\foreachitem\compteur\in\ListeNomSommet{\expandafter\UpdatetoksSolide\compteur\nil}%\the\toksolidelistesommets%
\IfStrEqCase{\useKV[ClesSolides]{Nom}}{%
{cube}{%
- \MPSolidePave{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{1,1,1}{\useKV[ClesSolides]{PointsSection}}{\useKV[ClesSolides]{ObjetSection}}%
+ \MPSolidePave{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{\useKV[ClesSolides]{Arete},\useKV[ClesSolides]{Arete},\useKV[ClesSolides]{Arete}}{\useKV[ClesSolides]{PointsSection}}{\useKV[ClesSolides]{ObjetSection}}%
}%
{pave}{%
\MPSolidePave{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{\useKV[ClesSolides]{Profondeur},\useKV[ClesSolides]{Largeur},\useKV[ClesSolides]{Hauteur}}{\useKV[ClesSolides]{PointsSection}}{\useKV[ClesSolides]{ObjetSection}}%
@@ -935,6 +1050,9 @@
{cone}{%
\MPSolideCone{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{\useKV[ClesSolides]{PointsSection}}%
}%
+ {prisme}{%
+ \MPSolidePrisme{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{}{\useKV[ClesSolides]{PointsSection}}%
+ }%
{pyramide}{%
\MPSolidePyramide{\useKV[ClesSolides]{ListeSommets}}{\the\toksolidelistesommets}{\useKV[ClesSolides]{DecalageSommet}}{\useKV[ClesSolides]{PointsSection}}%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCSommeAngles.tex b/macros/latex/contrib/profcollege/latex/PfCSommeAngles.tex
index df62edfbce..f0a1e12cc9 100644
--- a/macros/latex/contrib/profcollege/latex/PfCSommeAngles.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCSommeAngles.tex
@@ -1,6 +1,10 @@
%%%
% Somme des angles
%%%
+\def\filedateSommeAngles{2024/08/04}%
+\def\fileversionSommeAngles{0.1}%
+\message{-- \filedateSommeAngles\space v\fileversionSommeAngles}%
+%
\setKVdefault[ClesSommeAngle]{Detail=true,Isocele=false,Rectangle=false,Figure=false,FigureSeule=false,Angle=0,Perso=false,Echelle=1cm}%
\def\MPFigureSommeAngle#1#2#3#4#5{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCSquaro.tex b/macros/latex/contrib/profcollege/latex/PfCSquaro.tex
index 9de4a7afdf..7afe0e55fb 100644
--- a/macros/latex/contrib/profcollege/latex/PfCSquaro.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCSquaro.tex
@@ -1,10 +1,21 @@
%%%
% Squaro
%%%
-\setKVdefault[Squaro]{Solution=false,Longueur=8,Largeur=8,Echelle=8mm,Nom=Jeu1,Graines=false}
+\def\filedateSquarO{2024/08/04}%
+\def\fileversionSquarO{0.1}%
+\message{-- \filedateSquarO\space v\fileversionSquarO}%
+%
+\newtoks\tokPfCSquaro%
+\def\UpdatetoksSquaro#1\nil{\addtotok\tokPfCSquaro{#1,}}%
+
+\setKVdefault[Squaro]{Solution=false,Longueur=8,Largeur=8,Echelle=8mm,Nom=Jeu1,Graines=false,Persos=false}
\defKV[Squaro]{Graine=\setKV[Squaro]{Graines}}%
+\defKV[Squaro]{Perso=\setKV[Squaro]{Persos}\setsepchar{,}\ignoreemptyitems\readlist*\ListeSquaroPerso{#1}\reademptyitems%
+ \foreachitem\compteur\in\ListeSquaroPerso{\expandafter\UpdatetoksSquaro\compteur\nil}%
+}%
\NewDocumentCommand\SquarO{o}{%
+ \tokPfCSquaro{}%
\useKVdefault[Squaro]%
\setKV[Squaro]{#1}%
\BuildSquaro%
@@ -14,9 +25,10 @@
numeric Longueur,Largeur;
Longueur=\useKV[Squaro]{Longueur};
Largeur=\useKV[Squaro]{Largeur};
- boolean Solution,Graines;
+ boolean Solution,Graines,Persos;
Solution=\useKV[Squaro]{Solution};
Graines=\useKV[Squaro]{Graines};
+ Persos=\useKV[Squaro]{Persos};
if Graines:
randomseed:=\useKV[Squaro]{Graine};
fi;
@@ -26,13 +38,35 @@
p:=0;
pair A[];%centre des carrés.
boolean Allume[][];
-}
+ %
+ if Persos:
+ n:=0;
+ for p_=\the\tokPfCSquaro:
+ n:=n+1;
+ ligne:=(n-1) div (Largeur+2);
+ colonne:=(n-1) mod (Longueur+1);
+ Allume[ligne][colonne]=if p_=1:true else:false fi;
+ endfor;
+ else:
+ for k=0 upto Largeur:
+ for l=0 upto Longueur:
+ m:=uniformdeviate(1);
+ if m<0.5:
+ Allume[k][l]=true;
+ else:
+ Allume[k][l]=false;
+ fi;
+ endfor;
+ endfor;
+ fi;
+}%
\NewDocumentCommand\BuildSquaro{}{%
\ifluatex
\mplibforcehmode
\begin{mplibcode}
\BuildSquarobase
+ %
for k=0 upto Longueur-1:
for l=0 upto Largeur-1:
p:=p+1;
@@ -40,21 +74,18 @@
trace (unitsquare scaled u) shifted A[p];
endfor;
endfor;
-
+ %
for k=0 upto Largeur:
for l=0 upto Longueur:
- m:=uniformdeviate(1);
- if m<0.5:
- Allume[k][l]=true;
+ if Allume[k][l]:
fill cercles(u*(l,-k+1),1mm) if Solution=false:withcolor white fi;
else:
- Allume[k][l]=false;
fill cercles(u*(l,-k+1),1mm) withcolor white;
fi;
trace cercles(u*(l,-k+1),1mm);
endfor;
endfor;
-
+ %
for k=0 upto Largeur-1:
for l=0 upto Longueur-1:
Retiens:=0;
@@ -67,29 +98,28 @@
endfor;
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={\BuildSquarobase}]
- for k=0 upto Longueur-1:
+ \begin{mpost}[mpsettings={\BuildSquarobase}]
+ %
+ %
+ for k=0 upto Longueur-1:
for l=0 upto Largeur-1:
p:=p+1;
A[p]=u*(k,-l);
trace (unitsquare scaled u) shifted A[p];
- endfor;
- endfor;
-
- for k=0 upto Largeur:
- for l=0 upto Longueur:
- m:=uniformdeviate(1);
- if m<0.5:
- Allume[k][l]=true;
+ endfor;
+ endfor;
+ %
+ for k=0 upto Largeur:
+ for l=0 upto Longueur:
+ if Allume[k][l]:
fill cercles(u*(l,-k+1),1mm) if Solution=false:withcolor white fi;
else:
- Allume[k][l]=false;
fill cercles(u*(l,-k+1),1mm) withcolor white;
fi;
trace cercles(u*(l,-k+1),1mm);
- endfor;
- endfor;
-
+ endfor;
+ endfor;
+ %
for k=0 upto Largeur-1:
for l=0 upto Longueur-1:
Retiens:=0;
diff --git a/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex b/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex
index 98566be426..5d7b786d8e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex
@@ -1,6 +1,10 @@
%%%
% Statistiques
%%%
+\def\filedateStat{2024/08/04}%
+\def\fileversionStat{0.1}%
+\message{-- \filedateStat\space v\fileversionStat}%
+%
\newcommand\NbDonnees{}%
\newcommand\SommeDonnees{}%
\newcommand\EffectifTotal{}%
@@ -18,7 +22,7 @@ Tableau=false,Stretch=1,Frequence=false,EffectifTotal=false,%
Etendue=false,Moyenne=false,SET=false,ValeurExacte=false,MoyenneA,Somme,Mediane=false,DetailsMediane=false,UneMediane=false,QuartileUn=false,QuartileTrois=false,Total=false,Concret=false,%
Largeur=1cm,Precision=2,PrecisionF=0,Donnee=Valeurs,Effectif=Effectif,Grille=false,Origine=0,Angle=false,SemiAngle=false,Qualitatif=false,Classes=false,TableauVide=false,ECC=false,Coupure=10,CouleurTab=gray!15,Graphique=false,Batons=true,Centre=false,CentreVide=false,Crochets=false,%
% Pour les diags batons
-EpaisseurBatons=1,ListeCouleursB={a},Lecture=false,LectureFine=false,AideLecture=false,Reponses=false,DonneesSup=false,AbscisseRotation=false,Tiret=false,AngleRotationAbscisse=0,Pasx=1,Pasy=1,Unitex=0.5,Unitey=0.5,Depart=0,CouleurDefaut=black,Date=false,GrandNombrey=false,GrandNombrex=false,PasGrillex=1,PasGrilley=1,%
+EpaisseurBatons=1,ListeCouleursB={a},Lecture=false,LectureFine=false,AideLecture=false,Reponses=false,DonneesSup=false,AbscisseRotation=false,Tiret=false,Pasx=1,Pasy=1,Unitex=0.5,Unitey=0.5,Depart=0,CouleurDefaut=black,Date=false,GrandNombrey=false,GrandNombrex=false,PasGrillex=1,PasGrilley=1,%
% Pour les diags circulaires
Rayon=3cm,AffichageAngle=false,AffichageDonnee=false,ListeCouleurs={white},Hachures=false,ListeHachures={60},LectureInverse=false,EcartHachures=0.25,EpaisseurHachures=1,Legende,LegendeVide=false,ACompleter=false,DebutAngle=0,%on utilisera également la clé CouleurDefaut
%Pour les représentations
@@ -466,7 +470,6 @@ ModeleCouleur=5%
unitex:=\useKV[ClesStat]{Unitex}*cm;
unitey:=\useKV[ClesStat]{Unitey}*cm;
xpartorigine:=\useKV[ClesStat]{Origine};
- AngleRotation=\useKV[ClesStat]{AngleRotationAbscisse};
boolean Rotation,Lecture,LectureFine,AideLecture,DonneesSup,Reponses,Qualitatif,Tiret,LegendeVide,Retour,GrandNombrex,GrandNombrey,Date,Grille;
GrandNombrex=\useKV[ClesStat]{GrandNombrex};
GrandNombrey=\useKV[ClesStat]{GrandNombrey};
@@ -478,6 +481,11 @@ ModeleCouleur=5%
fi;
Date:=\useKV[ClesStat]{Date};
Rotation=\useKV[ClesStat]{AbscisseRotation};
+ if Rotation:
+ AngleRotation=\useKV[ClesStat]{AngleRotationAbscisse};
+ else:
+ AngleRotation=0;
+ fi;
Lecture:=\useKV[ClesStat]{Lecture};
LectureFine:=\useKV[ClesStat]{LectureFine};
AideLecture:=\useKV[ClesStat]{AideLecture};
diff --git a/macros/latex/contrib/profcollege/latex/PfCTableauDoubleEntree.tex b/macros/latex/contrib/profcollege/latex/PfCTableauDoubleEntree.tex
new file mode 100644
index 0000000000..f13fe2fad5
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCTableauDoubleEntree.tex
@@ -0,0 +1,62 @@
+%%%
+% Tableau Double Entree
+%%%
+\def\filedateTDE{2024/08/15}%
+\def\fileversionTDE{0.1a}%
+\message{-- \filedateTDE\space v\fileversionTDE}%
+
+\setKVdefault[TDE]{Colonnes=5,Lignes=4,Legende={},LegendesH={B,C,D,Total},LegendesV={1,2,Total},Couleur=Cornsilk,Vide=false,Totaux,Questions=false,Stretch=1}%
+
+\NewDocumentCommand\TableauDoubleEntree{om}{%
+ \useKVdefault[TDE]%
+ \setKV[TDE]{#1}%
+ \xdef\PfCFooH{\useKV[TDE]{LegendesH}}%
+ \xdef\PfCFooV{\useKV[TDE]{LegendesV}}%
+ \setsepchar{,}\reademptyitems%
+ \readlist*\ListeH{\PfCFooH}%
+ \readlist*\ListeV{\PfCFooV}%
+ \readlist*\ListeDonnees{#2}%
+ \ifboolKV[TDE]{Totaux}{}{%
+ % Vider les lignes du total
+ \xintFor* ##1 in{\xintSeq{1}{\fpeval{\ListeVlen-1}}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\fpeval{\ListeHlen-0}}}\do{%
+ \modulo{\fpeval{##2+(##1-1)*(\ListeHlen-0)}}{\fpeval{\ListeHlen-0}}%
+ \ifnum\remainder=0\relax%
+ \xdef\ListeDonneesSansTotauxAv{\ListeDonneesSansTotauxAv,}%
+ \else%
+ \ifnum\fpeval{##2+(##1-1)*(\ListeHlen-0)}=1\relax%
+ \xdef\ListeDonneesSansTotauxAv{\ListeDonnees[\fpeval{##2+(##1-1)*(\ListeHlen-0)}]}%
+ \else%
+ \xdef\ListeDonneesSansTotauxAv{\ListeDonneesSansTotauxAv,\ListeDonnees[\fpeval{##2+(##1-1)*(\ListeHlen-0)}]}%
+ \fi%
+ \fi%
+ }%
+ }%
+ % On ajoute la dernière ligne qui est vide
+ \xintFor* ##2 in{\xintSeq{1}{\fpeval{\ListeHlen-0}}}\do{%
+ \xdef\ListeDonneesSansTotauxAv{\ListeDonneesSansTotauxAv,}%
+ }%
+ % On relit la liste des données.
+ \setsepchar{,}\reademptyitems%
+ \readlist*\ListeDonnees{\ListeDonneesSansTotauxAv}%
+ \reademptyitems%
+ }%
+ %
+ % Pour vider le tableau, on utilise la clé <Vide>.
+ % On choisit quelques éléments ^^ à écrire
+ \ifboolKV[TDE]{Questions}{%
+ %en réflexion (voir v5)
+ }{}%
+ %
+ \colorlet{PfCColorTDE}{\useKV[TDE]{Couleur}}%
+ \renewcommand{\arraystretch}{\useKV[TDE]{Stretch}}%
+ \begin{tabular}{|*{\fpeval{\ListeHlen+1}}{c|}}
+ \hline
+ \cellcolor{PfCColorTDE}\useKV[TDE]{Legende}\xintFor*##1 in{\xintSeq{1}{\ListeHlen}}\do{\uppercase{&}\cellcolor{PfCColorTDE}\ListeH[##1]}\\
+ \hline
+ \xintFor* ##1 in{\xintSeq{1}{\ListeVlen}}\do{
+ \cellcolor{PfCColorTDE}\ListeV[##1]\xintFor*##2 in{\xintSeq{1}{\ListeHlen}}\do{\uppercase{&}\ifboolKV[TDE]{Vide}{}{\ListeDonnees[\fpeval{(##2-0)+(##1-1)*(\ListeHlen-0)}]}}\\
+ \hline
+ }
+ \end{tabular}
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex b/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
index 75270180d3..933fcb80a2 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
@@ -1,7 +1,11 @@
%%%
% Tableaux d'unit\'es
%%%
-\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,CarreA=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,CubeA=false,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1,Octet=false,CouleurGN=white,CadreGN=black,Tabcolsep=0.275\tabcolsep,Exterieur=false,Condense=false}%
+\def\filedateTableaux{2024/08/15}%
+\def\fileversionTableaux{0.1a}%
+\message{-- \filedateTableaux\space v\fileversionTableaux}%
+\message{`PfCTableauxUnites.tex' v\fileversionTableaux\space (\filedateTableaux)}
+\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,CarreA=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,CubeA=false,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1,Octet=false,CouleurGN=white,CadreGN=black,Tabcolsep=0.275\tabcolsep,Exterieur=false,Condense=false,DoubleEntree=false}%
\defKV[ClesTableaux]{ColonnesSup=\setKV[ClesTableaux]{Exterieur}}%
%
\newcommand\PfCTBstrut{\rule[-1.2ex]{0pt}{3.8ex}}% Top and Bottom strut
@@ -52,7 +56,10 @@
\xdef\PfCCoefConversion{10}%
}{}%
\PfCTableauIncline%
- }{%
+ }{%Fin Escalier
+ \ifboolKV[ClesTableaux]{DoubleEntree}{%
+ \TableauDoubleEntree[#1]{#2}%
+ }{}%
%
%%% Clé Octet
%
diff --git a/macros/latex/contrib/profcollege/latex/PfCTablesOperations.tex b/macros/latex/contrib/profcollege/latex/PfCTablesOperations.tex
index 3399cbecff..df109d964a 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTablesOperations.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTablesOperations.tex
@@ -1,6 +1,10 @@
%%%
% Tables Addition-Multiplication
%%%
+\def\filedateTableOp{2024/08/04}%
+\def\fileversionTableOp{0.1}%
+\message{-- \filedateTableOp\space v\fileversionTableOp}%
+%
\setKVdefault[Tables]{Addition=false,Soustraction=false,Multiplication,Seul=false,Debut=0,Fin=10,Couleur=white,Inverse=false}
% pour m\'emoire
diff --git a/macros/latex/contrib/profcollege/latex/PfCTectonic.tex b/macros/latex/contrib/profcollege/latex/PfCTectonic.tex
index df859b0453..3026bf9be0 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTectonic.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTectonic.tex
@@ -1,6 +1,10 @@
%%%
% Tectonic
%%%
+\def\filedateTectonic{2024/08/04}%
+\def\fileversionTectonic{0.1}%
+\message{-- \filedateTectonic\space v\fileversionTectonic}%
+%
\setKVdefault[ClesTectonic]{CouleurCase=LightGray,TLargeur=5,THauteur=5,Solution=false,Largeur=25pt,CouleurSolution=black,Tailles=false,Aide=false}%
\defKV[ClesTectonic]{Taille=\setKV[ClesTectonic]{Tailles}}%
\defKV[ClesTectonic]{ListeNombres=\setKV[ClesTectonic]{Aide}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCThales.tex b/macros/latex/contrib/profcollege/latex/PfCThales.tex
index d4adb5be01..140bde3f23 100644
--- a/macros/latex/contrib/profcollege/latex/PfCThales.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCThales.tex
@@ -1,6 +1,10 @@
%%%
% Thales
%%%
+\def\filedateThales{2024/08/04}%
+\def\fileversionThales{0.1}%
+\message{-- \filedateThales\space v\fileversionThales}%
+%
\newcount\ppcm%
\newcommand\PPCM[2]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCTicketCaisse.tex b/macros/latex/contrib/profcollege/latex/PfCTicketCaisse.tex
index 1c460e3693..2286b08332 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTicketCaisse.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTicketCaisse.tex
@@ -1,8 +1,16 @@
%%%
% Ticket de caisse
%%%
+\def\filedateTicketCaisse{2024/08/04}%
+\def\fileversionTicketCaisse{0.1}%
+\message{-- \filedateTicketCaisse\space v\fileversionTicketCaisse}%
+%
\newcounter{PfCNbInsulte}%
+\newcounter{PfCChoixService}%
\setcounter{PfCNbInsulte}{0}%
+\setcounter{PfCChoixService}{0}%
+%
+\newlength\PfCTicketLarg
\NewDocumentCommand\PfCPrixInsulte{sm}{%
\setsepchar{,}\ignoreemptyitems%
@@ -67,15 +75,17 @@
}%
\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}
+\setKVdefault[TicketCaisse]{Largeur=222pt,Especes=50,Simple=false,Taxes=false,SansRendu=false,Enseigne=Au comptoir des maths,DateAchat=\today,HeureAchat=15:13:34,Taches=false,Rendu,Total,SousTotal=false,UK=false,US=false,CFA=false,CFP=false,CHF=false,Euro=false,Solution=false}
\defKV[TicketCaisse]{Couleur=\colorlet{PfCTicketCouleurSolution}{#1}\setKV[TicketCaisse]{Solution}}
+\defKV[TicketCaisse]{Service=\setKV[TicketCaisse]{Taxes}}
-\NewDocumentCommand\TicketCaisse{om}{%
+\NewDocumentCommand\TicketCaisse{som}{%
\setcounter{PfCNbInsulte}{0}%
\useKVdefault[TicketCaisse]%
- \setKV[TicketCaisse]{#1}%
+ \setKV[TicketCaisse]{#2}%
+ \setlength{\PfCTicketLarg}{\useKV[TicketCaisse]{Largeur}}%
\setsepchar[*]{,*/}%
- \readlist*\ListeAchats{#2}%
+ \readlist*\ListeAchats{#3}%
% On fait trois listes pour les retenir
% Liste Quantités
\xdef\PfCFooQuantites{}%
@@ -122,9 +132,123 @@
\xintFor* ##1 in{\xintSeq{1}{\ListeAchatslen}}\do{%
\xdef\PfCTCTotal{\fpeval{\PfCTCTotal+\ListeQuantites[##1]*\ListePUnitaires[##1]}}%
}%
-% Le coût total est \PfCTCTotal\\
+ \ifboolKV[TicketCaisse]{Taxes}{%
+ % On décompose la clé
+ \StrChar{\useKV[TicketCaisse]{Service}}{1}[\MyLetter]%
+ % Si le premier caractère est !, il faut regarder si le deuxième caractère est une étoile
+ \IfStrEq{\MyLetter}{!}{%
+ \StrChar{\useKV[TicketCaisse]{Service}}{2}[\MyLettera]%
+ \IfStrEq{\MyLettera}{*}{%
+ \StrGobbleLeft{\useKV[TicketCaisse]{Service}}{2}[\PfCTCValeurService]
+ \setcounter{PfCChoixService}{3}%
+ }{%
+ \StrGobbleLeft{\useKV[TicketCaisse]{Service}}{1}[\PfCTCValeurService]
+ \setcounter{PfCChoixService}{1}%
+ }%
+ }{%il faut regarder si c'est une étoile
+ \StrChar{\useKV[TicketCaisse]{Service}}{1}[\MyLettera]%
+ \IfStrEq{\MyLettera}{*}{%
+ \StrGobbleLeft{\useKV[TicketCaisse]{Service}}{1}[\PfCTCValeurService]
+ \setcounter{PfCChoixService}{2}
+ }{%
+ \xdef\PfCTCValeurService{\useKV[TicketCaisse]{Service}}%
+ \setcounter{PfCChoixService}{0}
+ }%
+ }%
+ % On fait les calculs associés à la clé.
+ \xdef\PfCTCSousTotal{\PfCTCTotal}%
+ \xdef\PfCTCService{\fpeval{\PfCTCValeurService*\PfCTCSousTotal/100}}%
+ \xdef\PfCTCTotal{\fpeval{\PfCTCSousTotal+\PfCTCService}}%
+ }{}%
+ % Le coût total est \PfCTCTotal\\
+ \IfBooleanTF{#1}{%
+ \ttfamily
+ \begin{tabular}{|m{0.48\PfCTicketLarg}m{0.13\PfCTicketLarg}m{0.165\PfCTicketLarg}m{0.225\PfCTicketLarg}|}%
+ \hline
+ &&&\\%
+ \multicolumn{4}{|c|}{\Large\bfseries\useKV[TicketCaisse]{Enseigne}}\\%
+ &&&\\%
+ \hline%
+ &&&\\%
+ \footnotesize\sc Description&\centering \footnotesize\sc Qte.&\centering\footnotesize\sc P.u.&\hfill\footnotesize\sc Prix \ifboolKV[TicketCaisse]{Taxes}{H.T.}{Net}\\%
+ &&&\\%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeAchatslen}}\do{%
+ \ListeElements[##1]&%
+ \centering
+ \footnotesize%
+ \StrChar{\ListeAchats[##1,1]}{1}[\MyLetter]%
+ \IfStrEq{\MyLetter}{!}{\PfCPrixInsulte*{\ListeQuantites[##1]}}{\xintifboolexpr{\fpeval{\ListeQuantites[##1]}==1}{}{\num{\ListeQuantites[##1]}}}%
+ &
+ \hfill
+ \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]}%
+ }%
+ }%
+ }%
+ &\hfill
+ \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]}}%
+ }%
+ }%
+ \\
+ }%
+ &&&\\%
+ \hline%
+ &&&\\
+ % Partie Service
+ \ifboolKV[TicketCaisse]{Taxes}{%
+ Total H.T.\uppercase{&}\uppercase{&}\uppercase{&}\hfill\ifboolKV[TicketCaisse]{SousTotal}{\ifnum\thePfCNbInsulte=0\relax\PrixTicket{\PfCTCSousTotal}\else\PfCPrixInsulte*{\PrixTicket{\PfCTCSousTotal}}\fi}{\PfCPrixInsulte*{\PrixTicket{\PfCTCSousTotal}}}
+ \\%
+ Service %
+ \ifodd\thePfCChoixService\relax \PfCPrixInsulte{\num{\PfCTCValeurService}}\else\num{\PfCTCValeurService}\fi~\si{\percent}%
+ &&&\hfill
+ \ifnum\thePfCChoixService>1\relax \PfCPrixInsulte{\PrixTicket{\PfCTCService}}\else\PrixTicket{\PfCTCService}\fi%
+ \\
+ &&&\\
+ \hline
+ &&&\\
+ }{}%
+ \ifboolKV[TicketCaisse]{Simple}{}{%
+ Total\ifboolKV[TicketCaisse]{Taxes}{ T.T.C.}{}&&&\hfill\ifboolKV[TicketCaisse]{Total}{\ifnum\thePfCNbInsulte=0\relax\PrixTicket{\PfCTCTotal}\else\PfCPrixInsulte*{\PrixTicket{\PfCTCTotal}}\fi}{\PfCPrixInsulte*{\PrixTicket{\PfCTCTotal}}}\\%
+ \ifboolKV[TicketCaisse]{SansRendu}{}{%
+ Espèces&&&\hfill\PrixTicket{\useKV[TicketCaisse]{Especes}}\\%
+ Rendu&&&\hfill\ifboolKV[TicketCaisse]{Rendu}{\PrixTicket{\fpeval{\useKV[TicketCaisse]{Especes}-\PfCTCTotal}}}{\PfCPrixInsulte*{\PrixTicket{\fpeval{\useKV[TicketCaisse]{Especes}-\PfCTCTotal}}}}\\%
+ }
+ &&&\\%
+ }%
+ \multicolumn{4}{|c|}{\footnotesize\useKV[TicketCaisse]{DateAchat}\qquad\useKV[TicketCaisse]{HeureAchat}}\\%
+ \hline
+ \end{tabular}
+ }{%
{\ttfamily%
- \begin{NiceTabular}{m{107pt}m{29pt}m{36pt}m{50pt}}%
+ \begin{NiceTabular}{m{0.48\PfCTicketLarg}m{0.13\PfCTicketLarg}m{0.165\PfCTicketLarg}m{0.225\PfCTicketLarg}}%
\CodeBefore
\tikz\node[opacity=0.2,yshift=-1.5cm] at ($(1-|1)!0.5!(1-|last)$) {\Large\bfseries\reflectbox{
\begin{tabular}{c}
@@ -148,7 +272,7 @@
\\%
\Cdots\\%
\\%
- \Block[l]{}{\footnotesize\sc Description}&\Block{}{\footnotesize\sc Qte.}&\Block{}{\footnotesize\sc P.u.}&\Block[r]{}{\footnotesize\sc Prix Net}\\%
+ \Block[l]{}{\footnotesize\sc Description}&\Block{}{\footnotesize\sc Qte.}&\Block{}{\footnotesize\sc P.u.}&\Block[r]{}{\footnotesize\sc Prix \ifboolKV[TicketCaisse]{Taxes}{H.T.}{Net}}\\%
\\%
\xintFor* ##1 in{\xintSeq{1}{\ListeAchatslen}}\do{%
\ListeElements[##1]&%
@@ -200,11 +324,28 @@
}%
\\%
\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}}}}}\\%
+ % Partie Service
+ \ifboolKV[TicketCaisse]{Taxes}{%
+ Total H.T.&&&\Block[r]{}{\ifboolKV[TicketCaisse]{SousTotal}{\ifnum\thePfCNbInsulte=0\relax\PrixTicket{\PfCTCSousTotal}\else\PfCPrixInsulte*{\PrixTicket{\PfCTCSousTotal}}\fi}{\PfCPrixInsulte*{\PrixTicket{\PfCTCSousTotal}}}
+ }\\%
+ Service %
+ \ifodd\thePfCChoixService\relax \PfCPrixInsulte{\num{\PfCTCValeurService}}\else\num{\PfCTCValeurService}\fi~\si{\percent}%
+ &&&\Block[r]{}{%
+ \ifnum\thePfCChoixService>1\relax \PfCPrixInsulte{\PrixTicket{\PfCTCService}}\else\PrixTicket{\PfCTCService}\fi%
+ }\\
+ \Cdots\\
+ \\
+ }{}%
+ \ifboolKV[TicketCaisse]{Simple}{}{%
+ Total\ifboolKV[TicketCaisse]{Taxes}{ T.T.C.}{}&&&\Block[r]{}{\ifboolKV[TicketCaisse]{Total}{\ifnum\thePfCNbInsulte=0\relax\PrixTicket{\PfCTCTotal}\else\PfCPrixInsulte*{\PrixTicket{\PfCTCTotal}}\fi}{\PfCPrixInsulte*{\PrixTicket{\PfCTCTotal}}}}\\%
+ \ifboolKV[TicketCaisse]{SansRendu}{}{%
+ 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}}&&&\\%
+ }%
+ \Block{1-4}{\footnotesize\useKV[TicketCaisse]{DateAchat}\qquad\useKV[TicketCaisse]{HeureAchat}}&&&\\%
\end{NiceTabular}
}%
+ }
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCTortueBase.tex b/macros/latex/contrib/profcollege/latex/PfCTortueBase.tex
index 949c781ce7..05a6524e98 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTortueBase.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTortueBase.tex
@@ -1,6 +1,10 @@
%%%
% Tortue
%%%
+\def\filedateTortue{2024/08/04}%
+\def\fileversionTortue{0.1}%
+\message{-- \filedateTortue\space v\fileversionTortue}%
+%
\setKVdefault[Tortue]{%
Pas=0.2mm,%Déplacement,
Etapes=false,%Pour arrêter la construction à une étape particulière
@@ -18,9 +22,10 @@
Axes=false,%Affichage des axes ou pas
Origine={(0,0)},%Origine des axes
Cases=false,%Se déplace-t-on sur des cases ?
+ Trace=false%
}
\defKV[Tortue]{Etape=\setKV[Tortue]{Etapes}}%choix de l'étape d'arrêt
-
+\defKV[Tortue]{Traces=\setKV[Tortue]{Trace}}%
\newcounter{PfCTortue}
\setcounter{PfCTortue}{0}
@@ -178,6 +183,9 @@
\ifboolKV[Tortue]{Etapes}{%
\immediate\write\turtle@out{drawoptions(withcolor DarkGreen);label(btex \noexpand\Large\noexpand\ding{40} etex rotated RetiensAngle[Total] scaled 1.5,A[Total]);}%
}{\ifboolKV[Tortue]{TortueF}{\immediate\write\turtle@out{drawoptions(withcolor DarkGreen);label(btex \noexpand\Large\noexpand\ding{40} etex rotated RetiensAngle[k] scaled 1.5,A[k]);}}{}}%
+ \ifboolKV[Tortue]{Trace}{%
+ \immediate\write\turtle@out{\useKV[Tortue]{Traces}}%
+ }{}%
\immediate\closeout\turtle@out%
\restorecomparemode%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCTrigonometrie.tex b/macros/latex/contrib/profcollege/latex/PfCTrigonometrie.tex
index 38fe05ce60..0bd7a90da6 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTrigonometrie.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTrigonometrie.tex
@@ -1,6 +1,10 @@
%%%
% Trigonom\'etrie
%%%
+\def\filedateTrigo{2024/08/04}%
+\def\fileversionTrigo{0.1}%
+\message{-- \filedateTrigo\space v\fileversionTrigo}%
+%
\def\MPFigTrigo#1#2#3#4#5#6#7#8{%
\ifluatex
% \mplibcodeinherit{enable}
diff --git a/macros/latex/contrib/profcollege/latex/PfCTrio.tex b/macros/latex/contrib/profcollege/latex/PfCTrio.tex
index 560258ff59..06c0a77e3b 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTrio.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTrio.tex
@@ -1,3 +1,10 @@
+%%%
+%Trio
+%%%
+\def\filedateTrio{2024/08/04}%
+\def\fileversionTrio{0.1}%
+\message{-- \filedateTrio\space v\fileversionTrio}%
+%
\newlength\PfCTrioHauteur%
\newcounter{PfCTrioLettre}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCTriominos.tex b/macros/latex/contrib/profcollege/latex/PfCTriominos.tex
index efc6cd24b3..b2ece6c0d4 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTriominos.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTriominos.tex
@@ -1,6 +1,10 @@
%%%
% Triominos
%%%
+\def\filedateTriominos{2024/08/04}%
+\def\fileversionTriominos{0.1}%
+\message{-- \filedateTriominos\space v\fileversionTriominos}%
+%
\setKVdefault[ClesTriomino]{Longueur=5cm,Etages=3,Ecart=0.6,AffichagePiece=false,Hexagone=false,Recapitulatif=false,Colonnes=2}%
\defKV[ClesTriomino]{Piece=\setKV[ClesTriomino]{AffichagePiece=true}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCUrneProba.tex b/macros/latex/contrib/profcollege/latex/PfCUrneProba.tex
new file mode 100644
index 0000000000..0d00e039c4
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCUrneProba.tex
@@ -0,0 +1,932 @@
+%%%
+% Urne et probabilités
+%%%
+\def\filedateUrneProba{2024/08/04}%
+\def\fileversionUrneProba{0.1}%
+\message{-- \filedateUrneProba\space v\fileversionUrneProba}%
+%
+\newtoks\tokUrneListeCouleurs%
+\newtoks\tokUrneListeColonnes%
+\newtoks\tokUrneListeNombres%
+
+\def\UpdatetoksUrneCouleurs#1\nil{\addtotok\tokUrneListeCouleurs{#1,}}%
+\def\UpdatetoksUrneNombres#1\nil{\addtotok\tokUrneListeNombres{"#1",}}%
+\def\UpdatetoksUrneColonnes#1\nil{\addtotok\tokUrneListeColonnes{"#1",}}%
+
+\setKVdefault[PfCUrne]{Couleurs=false,Nombres=false,Pas=4,Echelle=1,Repartition={1,2,3},Double=false,RepartitionC={1,2,3},RepartitionN={1,2,3},Roue=false,Rayon=3,Tableau=false,SansRemise=false,Solution=false,Codes=false,CouleurLigne=0.85white,CouleurColonne=0.85white,Different=false,RepartitionLigne={1,2,3},RepartitionColonne={1,2,3},Impression,Casino=false}%
+\defKV[PfCUrne]{Traces=\setKV[PfCUrne]{Codes}}%
+\defKV[PfCUrne]{ListeCouleurs=\setKV[PfCUrne]{Couleurs}\setsepchar{,}\ignoreemptyitems\readlist*\ListeCouleursAv{#1}\reademptyitems}%
+\defKV[PfCUrne]{ListeNombres=\setKV[PfCUrne]{Nombres}\setsepchar{,}\ignoreemptyitems\readlist*\ListeNombresAv{#1}\reademptyitems}%
+\defKV[PfCUrne]{ListeColonne=\setsepchar{,}\ignoreemptyitems\readlist*\ListeCouleursAv{#1}\reademptyitems}%
+\defKV[PfCUrne]{ListeLigne=\setsepchar{,}\ignoreemptyitems\readlist*\ListeNombresAv{#1}\reademptyitems}%
+
+\NewDocumentCommand\BuildRoulette{}{%
+ \ifluatex
+ \begin{Geometrie}[Cadre="aucun"]
+ u:=\useKV[PfCUrne]{Echelle}*1cm;
+
+ color colzero,colrouge,coltoura,coltourb,colbarre;
+
+ boolean Impression;
+ Impression=\useKV[PfCUrne]{Impression};
+
+ if Impression=false:
+ colzero=green;
+ colrouge=red;
+ coltoura=(179,103,0)/256;
+ coltourb=(179,111,48)/256;%(184,114,50)/256;
+ colbarre=0.7529white;
+ else:
+ colzero=white;
+ colrouge=white;
+ coltoura=black;
+ coltourb=black;
+ colbarre=black;
+ fi;
+ pair O,A[],B[],C[],D[];
+ path cc[];
+ O=(0,0);
+ cc1=cercles(O,2u);
+ cc2=cercles(O,2.75u);
+ cc3=cercles(O,3.5u);
+ cc4=cercles(O,3.7u);
+ cc5=cercles(O,4u);
+ cc6=cercles(O,3.125u);
+ cc7=cercles(O,2.375u);
+ if Impression=false:
+ fill cc5 withcolor coltoura;
+ fill cc4 withcolor coltourb;
+ fill cc1 withcolor coltoura;
+ trace cc1 withpen pencircle scaled 1.05;
+ trace cc5 withpen pencircle scaled 1.05;
+ trace cc4 withpen pencircle scaled 1.05;
+ trace cc3 withpen pencircle scaled 1.05;
+ else:
+ fill cc5;
+ fill cc4 withcolor white;
+ trace cc1;
+ trace cc3;
+ fi;
+ for k=0 upto 38:
+ A[k]=pointarc(cc3,90-k*(360/37));
+ B[k]=pointarc(cc1,90-k*(360/37));
+ endfor;
+ na:=1;
+ for p_=32,15,19,4,21,2,25,17,34,6,27,13,36,11,30,8,23,10,5,24,16,33,1,20,14,31,9,22,18,29,7,28,12,35,3,26,0:
+ if (na mod 2)=0:
+ fill arccercle(A[na],A[na-1],O)--B[na-1]--reverse(arccercle(B[na],B[na-1],O))--cycle;
+ drawoptions(withcolor white);
+ label(TEX("\textbf{"&decimal(p_)&"}") rotated (-na*(360/37)),pointarc(cc6,90+0.5*(360/37)-na*(360/37)));
+ drawoptions();
+ else:
+ if p_=0:
+ fill arccercle(A[na],A[na-1],O)--B[na-1]--reverse(arccercle(B[na],B[na-1],O))--cycle withcolor colzero;
+ else:
+ fill arccercle(A[na],A[na-1],O)--B[na-1]--reverse(arccercle(B[na],B[na-1],O))--cycle withcolor colrouge;
+ fi;
+ if Impression=false:
+ drawoptions(withcolor white);
+ fi;
+ label(TEX("\textbf{"&decimal(p_)&"}") rotated (-na*(360/37)),pointarc(cc6,90+0.5*(360/37)-na*(360/37)));
+ if Impression=false:
+ drawoptions();
+ fi;
+ fi;
+ trace arccercle(A[na],A[na-1],O)--B[na-1]--reverse(arccercle(B[na],B[na-1],O))--cycle;
+ na:=na+1;
+ endfor;
+ trace cc2;
+ fill cercles(pointarc(cc7,90+0.5*(360/37)),0.125u);%dotlabel("",);
+ % barre
+ cc8=cercles(O,1.5u);
+ cc9=cercles(O,0.25u);
+ fill cc9 withcolor colbarre;
+ pair E[];
+ anglebase=floor(uniformdeviate(360));
+ E1=pointarc(cc8,anglebase);
+ E4=pointarc(cc8,anglebase+6);
+ E3=symetrie(E1,O);
+ E2=symetrie(E4,O);
+ E5=pointarc(cc8,anglebase+90);
+ E8=pointarc(cc8,anglebase+6+90);
+ E7=symetrie(E5,O);
+ E6=symetrie(E8,O);
+ fill polygone(E1,E2,E3,E4) withcolor colbarre;
+ fill polygone(E5,E6,E7,E8) withcolor colbarre;
+ pair F[];
+ F1=(E1--iso(E1,E2)) intersectionpoint cc9;
+ F2=(E4--iso(E3,E4)) intersectionpoint cc9;
+ F3=(E5--iso(E6,E5)) intersectionpoint cc9;
+ F4=(E8--iso(E7,E8)) intersectionpoint cc9;
+ F5=(E3--iso(E4,E3)) intersectionpoint cc9;
+ F6=(E2--iso(E2,E1)) intersectionpoint cc9;
+ F7=(E7--iso(E8,E7)) intersectionpoint cc9;
+ F8=(E6--iso(E6,E5)) intersectionpoint cc9;
+ trace E1--E4--F2--arccercle(F2,F3,O)--E5--E8--F4--arccercle(F4,F5,O)--E3--E2--F6--arccercle(F6,F7,O)--E7--E6--F8--arccercle(F8,F1,O)--cycle;
+ \end{Geometrie}
+ \fi
+}%
+
+\NewDocumentCommand\BuildTableauDoubleEntreeDifferent{mmmm}{%
+ % #1 : les labels en colonne
+ % #2 : les labels en ligne
+ % #3 : la répartition en colonne
+ % #4 : la répartition en ligne
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ u:=\useKV[PfCUrne]{Echelle}*1cm;
+ numeric RetiensNumC[],RetiensNumL[];
+ %
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNumL[n]=p_;
+ n:=n+1;
+ endfor;
+ totallignes=n;
+ enddef;
+ %
+ vardef RecupRepartitionC(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNumC[n]=p_;
+ n:=n+1;
+ endfor;
+ totalcolonnes=n;
+ enddef;
+ %
+ string Colonnes[];
+ vardef RecuperationColonnes(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Colonnes[n]=p_;
+ endfor;
+ enddef;
+ %
+ string Lignes[];
+ vardef RecuperationLignes(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Lignes[n]=p_;
+ endfor;
+ enddef;
+ %
+ boolean Solution, Codes;
+ Solution=\useKV[PfCUrne]{Solution};
+ Codes=\useKV[PfCUrne]{Codes};
+ %
+ color ColLigne,ColColonne;
+ ColLigne=\useKV[PfCUrne]{CouleurLigne};
+ ColColonne=\useKV[PfCUrne]{CouleurColonne};
+ %
+ RecupRepartitionC(#3);
+ RecupRepartition(#4);
+ RecuperationColonnes(#1);
+ RecuperationLignes(#2);
+
+ pair A[][],C[][];
+ for k=0 upto totallignes+1:
+ for l=0 upto totalcolonnes+1:
+ A[k][l]=(0,0) shifted(u*(l,-k));
+ C[k][l]=A[k][l] shifted(u*(0.5,-0.5));
+ endfor;
+ endfor;
+
+ fill polygone(A[0][1],A[0][totalcolonnes+1],A[1][totalcolonnes+1],A[1][1]) withcolor ColLigne;
+ fill polygone(A[1][0],A[totallignes+1][0],A[totallignes+1][1],A[1][1]) withcolor ColColonne;
+ for k=1 upto totalcolonnes:
+ label(TEX(Colonnes[RetiensNumC[k-1]]),iso(A[1][k],A[0][k+1]));
+ endfor;
+ for k=1 upto totallignes:
+ label(TEX(Lignes[RetiensNumL[k-1]]),iso(A[k][0],A[k+1][1]));
+ endfor;
+ %
+ for k=1 upto totallignes:
+ trace segment(A[k][0],A[k][totalcolonnes+1]);
+ endfor;
+ for k=1 upto totalcolonnes:
+ trace segment(A[0][k],A[totallignes+1][k]);
+ endfor;
+ trace A[1][0]--A[totallignes+1][0]--A[totallignes+1][totalcolonnes+1]--A[0][totalcolonnes+1]--A[0][1];
+ labeloffset:=labeloffset*4;
+ label.top(TEX("Tirage 1"),iso(A[0][1],A[0][totalcolonnes+1]));
+ label.lft(TEX("Tirage 2") rotated 90,iso(A[totallignes+1][0],A[1][0]));
+ labeloffset:=labeloffset/4;
+
+ path ccsol[][];
+
+ if Solution:
+ for k=1 upto totallignes:
+ for l=1 upto totalcolonnes:
+ label(TEX(Colonnes[RetiensNumC[l-1]]&"--"&Lignes[RetiensNumL[k-1]]),iso(A[k][l],A[k+1][l+1]));
+ endfor;
+ endfor;
+ fi;
+
+ if Codes:
+ \useKV[PfCUrne]{Traces};
+ fi;
+ \end{mplibcode}
+ \fi
+}%
+
+\NewDocumentCommand\BuildTableauDoubleEntree{mmm}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ u:=\useKV[PfCUrne]{Echelle}*1cm;
+ numeric RetiensNum[];
+ %
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNum[n]=p_;
+ n:=n+1;
+ endfor;
+ totalboules=n;
+ enddef;
+ %
+ color Col[];
+ vardef RecuperationCouleurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+ %
+ string Nombres[];
+ vardef RecuperationNombres(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Nombres[n]=p_;
+ endfor;
+ enddef;
+ %
+ numeric Pas,Rayon;
+ Pas=\useKV[PfCUrne]{Pas};
+ Rayon=\useKV[PfCUrne]{Rayon};
+ %
+ boolean Couleurs, Nombres, Roue, Solution, SansRemise, Codes;
+ Couleurs=\useKV[PfCUrne]{Couleurs};
+ Nombres=\useKV[PfCUrne]{Nombres};
+ Roue=\useKV[PfCUrne]{Roue};
+ Solution=\useKV[PfCUrne]{Solution};
+ SansRemise=\useKV[PfCUrne]{SansRemise};
+ Codes=\useKV[PfCUrne]{Codes};
+
+ color ColLigne,ColColonne;
+ ColLigne=\useKV[PfCUrne]{CouleurLigne};
+ ColColonne=\useKV[PfCUrne]{CouleurColonne};
+
+ RecupRepartition(#3);
+ if Couleurs:
+ RecuperationCouleurs(#1);
+ fi;
+ if Nombres:
+ RecuperationNombres(#2);
+ fi;
+
+ pair O;
+ pair A[][],C[][];
+ for k=0 upto totalboules+1:
+ for l=0 upto totalboules+1:
+ A[k][l]:=(0,0) shifted(u*(l,-k));
+ endfor;
+ endfor;
+
+ for k=0 upto totalboules:
+ for l=0 upto totalboules:
+ C[k][l]=A[k][l] shifted(u*(0.5,-0.5));
+ endfor;
+ endfor;
+
+ if Couleurs:
+ drawoptions(withpen pencircle scaled 0.75);
+ for k=1 upto totalboules:
+ fill cercles(iso(A[1][k],A[0][k+1]),0.35u) withcolor Col[RetiensNum[k-1]];
+ fill cercles(iso(A[k][0],A[k+1][1]),0.35u) withcolor Col[RetiensNum[k-1]];
+ trace cercles(iso(A[1][k],A[0][k+1]),0.35u);
+ trace cercles(iso(A[k][0],A[k+1][1]),0.35u);
+ endfor;
+ drawoptions();
+ else:
+ fill polygone(A[0][1],A[0][totalboules+1],A[1][totalboules+1],A[1][1]) withcolor ColLigne;
+ fill polygone(A[1][0],A[totalboules+1][0],A[totalboules+1][1],A[1][1]) withcolor ColColonne;
+ for k=1 upto totalboules:
+ label(TEX(Nombres[RetiensNum[k-1]]),iso(A[1][k],A[0][k+1]));
+ label(TEX(Nombres[RetiensNum[k-1]]),iso(A[k][0],A[k+1][1]));
+ endfor;
+ fi;
+ if SansRemise:
+ for k=1 upto totalboules:
+ draw 1/8[A[k][k],A[k+1][k+1]]--7/8[A[k][k],A[k+1][k+1]];
+ draw 1/8[A[k+1][k],A[k][k+1]]--7/8[A[k+1][k],A[k][k+1]];
+ endfor;
+ fi;
+ for k=1 upto totalboules:
+ trace segment(A[k][0],A[k][totalboules+1]);
+ trace segment(A[0][k],A[totalboules+1][k]);
+ endfor;
+ trace A[1][0]--A[totalboules+1][0]--A[totalboules+1][totalboules+1]--A[0][totalboules+1]--A[0][1];
+ labeloffset:=labeloffset*4;
+ label.top(TEX("Tirage 1"),iso(A[0][1],A[0][totalboules+1]));
+ label.lft(TEX("Tirage 2") rotated 90,iso(A[totalboules+1][0],A[1][0]));
+ labeloffset:=labeloffset/4;
+
+ path ccsol[][];
+
+ if Solution:
+ if Couleurs:
+ drawoptions(withpen pencircle scaled 0.75);
+ for k=1 upto totalboules:
+ for l=1 upto totalboules:
+ ccsol[k][l]=cercles(iso(A[k][l],A[k+1][l+1]),0.25u);
+ if SansRemise:
+ if k<>l:
+ fill arccercle(pointarc(ccsol[k][l],315),pointarc(ccsol[k][l],135),iso(A[k][l],A[k+1][l+1]))--iso(A[k][l],A[k+1][l+1])--cycle withcolor Col[RetiensNum[l-1]];
+ fill arccercle(pointarc(ccsol[k][l],135),pointarc(ccsol[k][l],315),iso(A[k][l],A[k+1][l+1]))--iso(A[k][l],A[k+1][l+1])--cycle withcolor Col[RetiensNum[k-1]];
+ trace segment(pointarc(ccsol[k][l],135),pointarc(ccsol[k][l],315));
+ trace ccsol[k][l];
+ fi;
+ else:
+ fill arccercle(pointarc(ccsol[k][l],315),pointarc(ccsol[k][l],135),iso(A[k][l],A[k+1][l+1]))--iso(A[k][l],A[k+1][l+1])--cycle withcolor Col[RetiensNum[l-1]];
+ fill arccercle(pointarc(ccsol[k][l],135),pointarc(ccsol[k][l],315),iso(A[k][l],A[k+1][l+1]))--iso(A[k][l],A[k+1][l+1])--cycle withcolor Col[RetiensNum[k-1]];
+ trace segment(pointarc(ccsol[k][l],135),pointarc(ccsol[k][l],315));
+ trace ccsol[k][l];
+ fi;
+ endfor;
+ endfor;
+ drawoptions();
+ else:
+ for k=1 upto totalboules:
+ for l=1 upto totalboules:
+ if SansRemise:
+ if k<>l:
+ label(TEX(Nombres[RetiensNum[l-1]]&"--"&Nombres[RetiensNum[k-1]]),iso(A[k][l],A[k+1][l+1]));
+ fi;
+ else:
+ label(TEX(Nombres[RetiensNum[l-1]]&"--"&Nombres[RetiensNum[k-1]]),iso(A[k][l],A[k+1][l+1]));
+ fi;
+ endfor;
+ endfor;
+ fi;
+ fi;
+
+ if Codes:
+ \useKV[PfCUrne]{Traces};
+ fi;
+ \end{mplibcode}
+ \fi
+}%
+
+\NewDocumentCommand\BuildUrne{mmm}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ u:=\useKV[PfCUrne]{Echelle}*1cm;
+ numeric RetiensNum[];
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNum[n]=p_;
+ n:=n+1;
+ endfor;
+ totalboules=n;
+ enddef;
+
+ color Col[];
+ vardef RecuperationCouleurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+
+ string Nombres[];
+ vardef RecuperationNombres(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Nombres[n]=p_;
+ endfor;
+ enddef;
+
+ numeric Pas,Rayon;
+ Pas=\useKV[PfCUrne]{Pas};
+ Rayon=\useKV[PfCUrne]{Rayon};
+
+ boolean Couleurs, Nombres, Roue;
+ Couleurs=\useKV[PfCUrne]{Couleurs};
+ Nombres=\useKV[PfCUrne]{Nombres};
+ Roue=\useKV[PfCUrne]{Roue};
+
+ RecupRepartition(#3);
+ if Couleurs:
+ RecuperationCouleurs(#1);
+ fi;
+ if Nombres:
+ RecuperationNombres(#2);
+ fi;
+
+ pair O;
+ pair A[],B[];
+
+ if Roue:
+ O=(0,0);
+ path cc;
+ cc=cercles(O,Rayon*u);
+ angd=180/totalboules;
+ angr=360/totalboules;
+ for k=1 upto totalboules:
+ A[k]=17/20[O,pointarc(cc,angd+(k-1)*angr)];
+ endfor;
+ drawarrow rotation((O+u*(0,1.35*Rayon))--(O+u*(0,1.1*Rayon)),O,angd);
+ % trace cc;
+ B[0]=pointarc(cc,0);
+ for k=1 upto totalboules:
+ B[k]=pointarc(cc,k*angr);
+ if Couleurs:
+ fill O--arccercle(B[k-1],B[k],O)--cycle withcolor if unknown Col[RetiensNum[k-1]]:white else: Col[RetiensNum[k-1]] fi;
+ else:
+ label(TEX(Nombres[RetiensNum[k-1]]),A[k]);
+ fi;
+ endfor;
+ trace cc;
+ for k=1 upto totalboules:
+ trace O--B[k];
+ endfor;
+ else:
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ A[rang]=u*(0.5,0.5)+u*(l,k);
+ if Couleurs:
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensNum[rang]]:white else: Col[RetiensNum[rang]] fi;
+ else:
+ label(TEX(Nombres[RetiensNum[rang]]),A[rang]);
+ fi;
+ %trace cercles(A[k*Pas+l],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ A[rang]=u*(0.5,0.5)+u*(k+0.5,totalboules div Pas-1+cosd(30));
+ if Couleurs:
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensNum[rang]]:white else: Col[RetiensNum[rang]] fi;
+ else:
+ label(TEX(Nombres[RetiensNum[rang]]),A[rang]);
+ fi;
+ %trace cercles(A[(totalboules div Pas)*Pas+k],0.5u);
+ endfor;
+ %
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ %
+ drawoptions(withpen pencircle scaled 1.2);
+ if totalboules<Pas:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0-(1-cosd(30)))--u*(Pas,0-(1-cosd(30)))--u*(Pas,(totalboules div Pas)+1.15);
+ else:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0)--u*(Pas,0)--u*(Pas,(totalboules div Pas)+1.15);
+ fi;
+ fi;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={u:=\useKV[PfCUrne]{Echelle}*1cm;numeric Pas;Pas=\useKV[PfCUrne]{Pas}; boolean Couleurs, Nombres; Couleurs=\useKV[PfCUrne]{Couleurs}; Nombres=\useKV[PfCUrne]{Nombres};}]
+ numeric RetiensNum[];
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNum[n]=p_;
+ n:=n+1;
+ endfor;
+ totalboules=n;
+ enddef;
+
+ color Col[];
+ vardef RecuperationCouleurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+
+ string Nombres[];
+ vardef RecuperationNombres(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Nombres[n]=p_;
+ endfor;
+ enddef;
+
+ RecupRepartition(#3);
+ if Couleurs:
+ RecuperationCouleurs(#1);
+ fi;
+ if Nombres:
+ RecuperationNombres(#2);
+ fi;
+
+ pair A[];
+
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ A[rang]=u*(0.5,0.5)+u*(l,k);
+ if Couleurs:
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensNum[rang]]:white else: Col[RetiensNum[rang]] fi;
+ else:
+ label(LATEX(Nombres[RetiensNum[rang]]),A[rang]);
+ fi;
+ %trace cercles(A[k*Pas+l],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ A[rang]=u*(0.5,0.5)+u*(k+0.5,totalboules div Pas-1+cosd(30));
+ if Couleurs:
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensNum[rang]]:white else: Col[RetiensNum[rang]] fi;
+ else:
+ label(LATEX(Nombres[RetiensNum[rang]]),A[rang]);
+ fi;
+ %trace cercles(A[(totalboules div Pas)*Pas+k],0.5u);
+ endfor;
+ %
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ %
+ drawoptions(withpen pencircle scaled 1.2);
+ if totalboules<Pas:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0-(1-cosd(30)))--u*(Pas,0-(1-cosd(30)))--u*(Pas,(totalboules div Pas)+1.15);
+ else:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0)--u*(Pas,0)--u*(Pas,(totalboules div Pas)+1.15);
+ fi;
+ \end{mpost}
+ \fi
+}%
+
+\NewDocumentCommand\BuildUrneDouble{mmmm}{%
+ % #1 Liste Couleurs
+ % #2 Liste Nombres
+ % #3 Repartition des couleurs
+ % #4 Repartition des nombres
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ u:=\useKV[PfCUrne]{Echelle}*1cm;
+ numeric RetiensC[],RetiensNum[];
+ vardef RecupRepartitionC(text t)=
+ n:=0;
+ for p_=t:
+ RetiensC[n]=p_;
+ n:=n+1;
+ endfor;
+ totalboules=n;
+ enddef;
+
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNum[n]=p_;
+ n:=n+1;
+ endfor;
+ enddef;
+
+ color Col[];
+ vardef RecuperationCouleurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+
+ string Nombres[];
+ vardef RecuperationNombres(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Nombres[n]=p_;
+ endfor;
+ enddef;
+
+ numeric Pas,Rayon;
+ Pas=\useKV[PfCUrne]{Pas};
+ Rayon=\useKV[PfCUrne]{Rayon};
+
+ boolean Roue;
+ Roue=\useKV[PfCUrne]{Roue};
+
+ RecupRepartitionC(#3);
+ RecupRepartition(#4);
+ RecuperationCouleurs(#1);
+ RecuperationNombres(#2);
+
+ pair O;
+ pair A[],B[];
+
+ if Roue:
+ O=(0,0);
+ path cc;
+ cc=cercles(O,Rayon*u);
+ angd=180/totalboules;
+ angr=360/totalboules;
+ for k=1 upto totalboules:
+ A[k]=17/20[O,pointarc(cc,angd+(k-1)*angr)];
+ endfor;
+ B[0]=pointarc(cc,0);
+ for k=1 upto totalboules:
+ B[k]=pointarc(cc,k*angr);
+ fill O--arccercle(B[k-1],B[k],O)--cycle withcolor if unknown Col[RetiensC[k-1]]:white else: Col[RetiensC[k-1]] fi;
+ label(TEX(Nombres[RetiensNum[k-1]]),A[k]);
+ endfor;
+ trace cc;
+ for k=1 upto totalboules:
+ trace O--B[k];
+ endfor;
+ drawarrow rotation((O+u*(0,1.35*Rayon))--(O+u*(0,1.1*Rayon)),O,angd);
+ else:
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ A[rang]=u*(0.5,0.5)+u*(l,k);
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensC[rang]]:white else: Col[RetiensC[rang]] fi;
+ label(TEX(Nombres[RetiensNum[rang]]),A[rang]);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ A[rang]=u*(0.5,0.5)+u*(k+0.5,totalboules div Pas-1+cosd(30));
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensC[rang]]:white else: Col[RetiensC[rang]] fi;
+ label(TEX(Nombres[RetiensNum[rang]]),A[rang]);
+ endfor;
+ %
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ %
+ drawoptions(withpen pencircle scaled 1.2);
+ if totalboules<Pas:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0-(1-cosd(30)))--u*(Pas,0-(1-cosd(30)))--u*(Pas,(totalboules div Pas)+1.15);
+ else:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0)--u*(Pas,0)--u*(Pas,(totalboules div Pas)+1.15);
+ fi;
+ fi;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={u:=\useKV[PfCUrne]{Echelle}*1cm;numeric RetiensC[],RetiensNum[];numeric Pas,Rayon;Pas=\useKV[PfCUrne]{Pas};Rayon=\useKV[PfCUrne]{Rayon};boolean Roue;Roue=\useKV[PfCUrne]{Roue};}]
+ vardef RecupRepartitionC(text t)=
+ n:=0;
+ for p_=t:
+ RetiensC[n]=p_;
+ n:=n+1;
+ endfor;
+ totalboules=n;
+ enddef;
+
+ vardef RecupRepartition(text t)=
+ n:=0;
+ for p_=t:
+ RetiensNum[n]=p_;
+ n:=n+1;
+ endfor;
+ enddef;
+
+ color Col[];
+ vardef RecuperationCouleurs(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+
+ string Nombres[];
+ vardef RecuperationNombres(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Nombres[n]=p_;
+ endfor;
+ enddef;
+
+ RecupRepartitionC(#3);
+ RecupRepartition(#4);
+ RecuperationCouleurs(#1);
+ RecuperationNombres(#2);
+
+ pair O;
+ pair A[],B[];
+
+ if Roue:
+ O=(0,0);
+ path cc;
+ cc=cercles(O,Rayon*1cm);
+ angd=180/totalboules;
+ angr=360/totalboules;
+ for k=1 upto totalboules:
+ A[k]=17/20[O,pointarc(cc,angd+(k-1)*angr)];
+ endfor;
+ B[0]=pointarc(cc,0);
+ for k=1 upto totalboules:
+ B[k]=pointarc(cc,k*angr);
+ fill O--arccercle(B[k-1],B[k],O)--cycle withcolor if unknown Col[RetiensC[k-1]]:white else: Col[RetiensC[k-1]] fi;
+ label(LATEX(Nombres[RetiensNum[k-1]]),A[k]);
+ endfor;
+ trace cc;
+ for k=1 upto totalboules:
+ trace O--B[k];
+ endfor;
+ else:
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ A[rang]=u*(0.5,0.5)+u*(l,k);
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensC[rang]]:white else: Col[RetiensC[rang]] fi;
+ label(LATEX(Nombres[RetiensNum[rang]]),A[rang]);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ A[rang]=u*(0.5,0.5)+u*(k+0.5,totalboules div Pas-1+cosd(30));
+ fill cercles(A[rang],0.5u) withcolor if unknown Col[RetiensC[rang]]:white else: Col[RetiensC[rang]] fi;
+ label(LATEX(Nombres[RetiensNum[rang]]),A[rang]);
+ endfor;
+ %
+ for k=0 upto (totalboules div Pas)-1:
+ for l=0 upto Pas-1:
+ rang:=k*Pas+l;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ endfor;
+ for k=0 upto (totalboules mod Pas)-1:
+ rang:=(totalboules div Pas)*Pas+k;
+ trace cercles(A[rang],0.5u);
+ endfor;
+ %
+ drawoptions(withpen pencircle scaled 1.2);
+ if totalboules<Pas:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0-(1-cosd(30)))--u*(Pas,0-(1-cosd(30)))--u*(Pas,(totalboules div Pas)+1.15);
+ else:
+ trace u*(0,(totalboules div Pas)+1.15)--u*(0,0)--u*(Pas,0)--u*(Pas,(totalboules div Pas)+1.15);
+ fi;
+ fi;
+ \end{mpost}
+ \fi
+}%
+
+\NewDocumentCommand\SchemaProba{o}{%
+ \useKVdefault[PfCUrne]%
+ \setKV[PfCUrne]{#1}%
+ \tokUrneListeCouleurs{}%
+ \tokUrneListeNombres{}%
+ \tokUrneListeColonnes{}%
+ \ifboolKV[PfCUrne]{Casino}{%
+ \BuildRoulette%
+ }{%
+ \ifboolKV[PfCUrne]{Tableau}{%
+ \ifboolKV[PfCUrne]{Different}{%
+ \xdef\PfCFooRepartitionC{\useKV[PfCUrne]{RepartitionColonne}}%
+ \xdef\PfCFooRepartitionL{\useKV[PfCUrne]{RepartitionLigne}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeRepartitionCAv{\PfCFooRepartitionC}%
+ \readlist*\ListeRepartitionLAv{\PfCFooRepartitionL}%
+ % Repartition : \showitems\ListeRepartitionAv[]%
+ \xdef\PfCFooListeRepartitionC{}%
+ \xdef\PfCFooListeRepartitionL{}%
+ \xdef\PfCTotalC{0}%
+ \xdef\PfCTotalL{0}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionCAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionCAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartitionC{\PfCFooListeRepartitionC,##1}%
+ \xdef\PfCTotalC{\fpeval{\PfCTotalC+1}}%
+ }%
+ }%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionLAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionLAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartitionL{\PfCFooListeRepartitionL,##1}%
+ \xdef\PfCTotalL{\fpeval{\PfCTotalL+1}}%
+ }%
+ }%
+ \foreachitem\compteur\in\ListeCouleursAv{\expandafter\UpdatetoksUrneColonnes\compteur\nil}%
+ \foreachitem\compteur\in\ListeNombresAv{\expandafter\UpdatetoksUrneNombres\compteur\nil}%
+ \BuildTableauDoubleEntreeDifferent{\the\tokUrneListeColonnes}{\the\tokUrneListeNombres}{\PfCFooListeRepartitionC}{\PfCFooListeRepartitionL}%
+ }{%
+ \xdef\PfCFooRepartition{\useKV[PfCUrne]{Repartition}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeRepartitionAv{\PfCFooRepartition}%
+ \xdef\PfCFooListeRepartition{}%
+ \xdef\PfCTotal{0}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartition{\PfCFooListeRepartition,##1}%
+ \xdef\PfCTotal{\fpeval{\PfCTotal+1}}%
+ }%
+ }%
+ \ifboolKV[PfCUrne]{Couleurs}{%
+ \foreachitem\compteur\in\ListeCouleursAv{\expandafter\UpdatetoksUrneCouleurs\compteur\nil}%
+ \BuildTableauDoubleEntree{\the\tokUrneListeCouleurs}{}{\PfCFooListeRepartition}%
+ }{%
+ \ifboolKV[PfCUrne]{Nombres}{%
+ \foreachitem\compteur\in\ListeNombresAv{\expandafter\UpdatetoksUrneNombres\compteur\nil}%
+ \BuildTableauDoubleEntree{}{\the\tokUrneListeNombres}{\PfCFooListeRepartition}%
+ }{}%
+ }%
+ }%
+ }{%
+ \ifboolKV[PfCUrne]{Double}{%
+ \xdef\PfCFooRepartitionC{\useKV[PfCUrne]{RepartitionC}}%
+ \xdef\PfCFooRepartitionN{\useKV[PfCUrne]{RepartitionN}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeRepartitionCAv{\PfCFooRepartitionC}%
+ \readlist*\ListeRepartitionNAv{\PfCFooRepartitionN}%
+ % Repartition : \showitems\ListeRepartitionAv[]%
+ \xdef\PfCFooListeRepartitionC{}%
+ \xdef\PfCFooListeRepartitionN{}%
+ \xdef\PfCTotalC{0}%
+ \xdef\PfCTotalN{0}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionCAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionCAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartitionC{\PfCFooListeRepartitionC,##1}%
+ \xdef\PfCTotalC{\fpeval{\PfCTotalC+1}}%
+ }%
+ }%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionNAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionNAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartitionN{\PfCFooListeRepartitionN,##1}%
+ \xdef\PfCTotalN{\fpeval{\PfCTotalN+1}}%
+ }%
+ }%
+ \MelangeListe{\PfCFooListeRepartitionC}{\PfCTotalC}%
+ \xdef\ListeRepartitionCouleurs{\faa}%
+ \foreachitem\compteur\in\ListeCouleursAv{\expandafter\UpdatetoksUrneCouleurs\compteur\nil}%
+ \MelangeListe{\PfCFooListeRepartitionN}{\PfCTotalN}%
+ \xdef\ListeRepartitionNombres{\faa}%
+ \foreachitem\compteur\in\ListeNombresAv{\expandafter\UpdatetoksUrneNombres\compteur\nil}%
+ \BuildUrneDouble{\the\tokUrneListeCouleurs}{\the\tokUrneListeNombres}{\ListeRepartitionCouleurs}{\ListeRepartitionNombres}%
+ }{%
+ \xdef\PfCFooRepartition{\useKV[PfCUrne]{Repartition}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeRepartitionAv{\PfCFooRepartition}%
+ % Repartition : \showitems\ListeRepartitionAv[]%
+ \xdef\PfCFooListeRepartition{}%
+ \xdef\PfCTotal{0}%
+ \xintFor* ##1 in{\xintSeq{1}{\ListeRepartitionAvlen}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\ListeRepartitionAv[##1]}}\do{%
+ \xdef\PfCFooListeRepartition{\PfCFooListeRepartition,##1}%
+ \xdef\PfCTotal{\fpeval{\PfCTotal+1}}%
+ }%
+ }%
+ \ifboolKV[PfCUrne]{Couleurs}{%
+ \MelangeListe{\PfCFooListeRepartition}{\PfCTotal}%
+ \xdef\ListeRepartitionCouleurs{\faa}%
+ \foreachitem\compteur\in\ListeCouleursAv{\expandafter\UpdatetoksUrneCouleurs\compteur\nil}%
+ % Couleurs :\\
+ % La répartition est : \ListeRepartitionCouleurs\\
+ % Les couleurs sont : \the\tokUrneListeCouleurs.\\
+ \BuildUrne{\the\tokUrneListeCouleurs}{}{\ListeRepartitionCouleurs}%
+ }{%
+ \ifboolKV[PfCUrne]{Nombres}{%
+ \MelangeListe{\PfCFooListeRepartition}{\PfCTotal}%
+ \xdef\ListeRepartitionNombres{\faa}%
+ \foreachitem\compteur\in\ListeNombresAv{\expandafter\UpdatetoksUrneNombres\compteur\nil}%
+ % Nombres :\\
+ % La répartition est : \ListeRepartitionNombres\\
+ % Les nombres sont : \the\tokUrneListeNombres.\\
+ \BuildUrne{}{\the\tokUrneListeNombres}{\ListeRepartitionNombres}%
+ }{}%
+ }%
+ }%
+}%
+}%
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCVisualisationMulDeci.tex b/macros/latex/contrib/profcollege/latex/PfCVisualisationMulDeci.tex
index 54a1a079cc..99024a4358 100644
--- a/macros/latex/contrib/profcollege/latex/PfCVisualisationMulDeci.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCVisualisationMulDeci.tex
@@ -1,6 +1,10 @@
%%%
% Visualisation Multiplication Décimaux
%%%
+\def\filedateVisuMulDeci{2024/08/04}%
+\def\fileversionVisuMulDeci{0.1}%
+\message{-- \filedateVisuMulDeci\space v\fileversionVisuMulDeci}%
+%
\setKVdefault[VisMulDec]{Couleur=Orange,CouleurUnite=DarkGreen,Dixiemes=false,Unite=2}%
\newtoks\toksvismuldec%
diff --git a/macros/latex/contrib/profcollege/latex/PfCVueCubes.tex b/macros/latex/contrib/profcollege/latex/PfCVueCubes.tex
index 9365b7e621..196358d9bf 100644
--- a/macros/latex/contrib/profcollege/latex/PfCVueCubes.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCVueCubes.tex
@@ -1,6 +1,10 @@
%%%
% Vue Cubes
%%%
+\def\filedateVueCubes{2024/08/26}%
+\def\fileversionVueCubes{0.1a}%
+\message{-- \filedateVueCubes\space v\fileversionVueCubes}%
+%
\setKVdefault[VueCubes]{Solution=false,Hauteur=5,Profondeur=4,Largeur=3,Angle=60,Nom=Ex1,Trou=false,Echelle=0.25,CouleurCube=LightSteelBlue,CouleurFleche=LightGray,Face=false,Creation=false,Grilles=false,Seul=false,Perso=false,EclateX=0,EclateZ=0,EclateY=0}
\newtoks\toklisteVueCube%
@@ -30,9 +34,9 @@
\readlist*\PfCListeHauteursCubes{#2}%
\reademptyitems%
\foreachitem\compteur\in\PfCListeHauteursCubes{\expandafter\UpdatetoksVueCube\compteur\nil}%
- \BuildVueCubes{\useKV[VueCubes]{Angle}}{\the\toklisteVueCube}%
+ \BuildVueCubes{\useKV[VueCubes]{Angle}}{\the\toklisteVueCube}{\useKV[VueCubes]{Nom}}%
}{%
- \BuildVueCubes{\useKV[VueCubes]{Angle}}{}%
+ \BuildVueCubes{\useKV[VueCubes]{Angle}}{}{\useKV[VueCubes]{Nom}}%
}%
}%
}%
@@ -100,11 +104,13 @@
\fi
}
-\NewDocumentCommand\BuildVueCubes{m m}{%
+\NewDocumentCommand\BuildVueCubes{m m m}{%
\ifluatex
\mplibforcehmode
\xdef\PfCVueCubeNom{\useKV[VueCubes]{Nom}}%
\begin{mplibcode}[\PfCVueCubeNom]
+ string NomRetenu;
+ NomRetenu=str #3;
input PfCSolid;
intensite:=1.5;
@@ -176,6 +182,9 @@
endfor;
fi;
+ write decimal(TotalObj) to "PfCNombreCubes"&NomRetenu&".tex";%
+ write EOF to "PfCNombreCubes"&NomRetenu&".tex";%
+
% Pour la fleche
path Fleche;
color A[];
diff --git a/macros/latex/contrib/profcollege/latex/PfCYohaku.tex b/macros/latex/contrib/profcollege/latex/PfCYohaku.tex
index c710834b93..942e66c111 100644
--- a/macros/latex/contrib/profcollege/latex/PfCYohaku.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCYohaku.tex
@@ -1,6 +1,10 @@
%%%
% Yohaku
%%%
+\def\filedateYohaku{2024/08/04}%
+\def\fileversionYohaku{0.1}%
+\message{-- \filedateYohaku\space v\fileversionYohaku}%
+%
\setKVdefault[Yohaku]{Taille=2,Largeur=1cm,Hauteur=1cm,Addition,Multiplication=false,Perso=false,Limite=50,Relatif=false,Negatif=false,Pair=false,Impair=false,Premier=false,Solution=false,Visible=false,Bordure=false,CouleurResultat=gray!15,Ligne=0,Colonne=0,PasL=0,PasC=0,CouleurZone=gray!25}%
\defKV[Yohaku]{Case=\setKV[Yohaku]{Visible}}%
diff --git a/macros/latex/contrib/profcollege/latex/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
index ca3b52ba9a..df794a8d86 100644
--- a/macros/latex/contrib/profcollege/latex/ProfCollege.sty
+++ b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
@@ -2,9 +2,9 @@
% licence : Released under the LaTeX Project Public License v1.3c
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}%
-\def\filedate{2024/05/18}%
+\def\filedate{2024/09/04}%
\let\PfCfiledate\filedate%
-\def\fileversion{0.99-A-f}%
+\def\fileversion{0.99-A-j}%
\let\PfCfileversion\fileversion%
\ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]%
@@ -124,7 +124,6 @@
\RequirePackage{listofitems}%
\RequirePackage{datatool}%
\RequirePackage{multido}%
-
\RequirePackage{xlop}%
\RequirePackage{tcolorbox}%
@@ -341,6 +340,37 @@
\fi
}%
+\newlength{\PfCLongueurBarreHor}
+\setKVdefault[PfCLigneCompleter]{Ecart=20pt,Couleurs=false}%
+\defKV[PfCLigneCompleter]{Couleur=\setKV[PfCLigneCompleter]{Couleurs}}%
+
+\NewDocumentCommand\ListeACompleter{som}{%
+ \useKVdefault[PfCLigneCompleter]%
+ \setKV[PfCLigneCompleter]{#2}%
+ \ifboolKV[PfCLigneCompleter]{Couleurs}{\colorlet{PfCLC}{\useKV[PfCLigneCompleter]{Couleur}}}{}%
+ \setlength{\PfCLongueurBarreHor}{\useKV[PfCLigneCompleter]{Ecart}}%
+ \setsepchar{,}\reademptyitems%
+ \readlist*\ListeTiti{#3}%
+ \foreachitem\compteur\in\ListeTiti{%
+ \itemtomacro\ListeTiti[\compteurcnt]\PfCCaractere%
+ \StrChar{\PfCCaractere}{1}[\RetiensElmt]%
+ \IfStrEq{\RetiensElmt}{!}{%
+ \IfBooleanTF{#1}{%
+ \ifboolKV[PfCLigneCompleter]{Couleurs}{\colorlet{saved}{.}\color{PfCLC}}{}\StrGobbleLeft{\PfCCaractere}{1}\ifboolKV[PfCLigneCompleter]{Couleurs}{\color{saved}}{}%
+ }{%
+ \hbox to \PfCLongueurBarreHor{\hrulefill}%
+ }
+ }{%
+ \ListeTiti[\compteurcnt]%
+ }%
+ \ifnum\compteurcnt=\ListeTitilen\relax%
+ .%
+ \else%
+ ,
+ \fi%
+ }%
+}%
+
%https://tex.stackexchange.com/questions/128991/frac-or-inference-rule-with-dotted-line
\newcommand\PfCfrac[2]{%
\ooalign{$\genfrac{}{}{0pt}{0}{#1}{#2}$\cr\PfCdotover\cr}%
@@ -637,18 +667,18 @@
\tikzset{face/.style={shape=circle,minimum size=4ex,shading=radial,outer sep=0pt, inner color=white!50!yellow,outer color= yellow!70!orange}}
\newcommand\emoticon[2][]{%
-\scalebox{.5}{\begin{tikzpicture}
-\node[face,#1,draw,thick] (emoticon) {};
+\scalebox{.5}{\begin{tikzpicture}%
+\node[face,#1,draw,thick] (emoticon) {};%
%% The eyes are fixed.
\draw[fill=white] (-1ex,0ex) ..controls (-0.5ex,0.2ex)and(0.5ex,0.2ex)..(1ex,0.0ex) ..controls ( 1.5ex,1.5ex)and( 0.2ex,1.7ex)..(0ex,0.4ex) ..controls (-0.2ex,1.7ex)and(-1.5ex,1.5ex)..(-1ex,0ex)--cycle;
#2%
\end{tikzpicture}}%
-}
+}%
-\newcommand\pupils{
+\newcommand\pupils{%
%% standard pupils
-\fill[shift={(0.5ex,0.5ex)},rotate=80] (0,0) ellipse (0.3ex and 0.15ex);
-\fill[shift={(-0.5ex,0.5ex)},rotate=100] (0,0) ellipse (0.3ex and 0.15ex);}
+\fill[shift={(0.5ex,0.5ex)},rotate=80] (0,0) ellipse (0.3ex and 0.15ex);%
+\fill[shift={(-0.5ex,0.5ex)},rotate=100] (0,0) ellipse (0.3ex and 0.15ex);}%
\def\RKsmallsmile{%
\emoticon{%
@@ -656,14 +686,14 @@
%% mouth
\draw[thick] (-0.5ex,-1ex)..controls (-0.25ex,-1.25ex)and(0.25ex,-1.25ex)..(0.5ex,-1ex);
}%\emoticon
-}
+}%
\def\RKsmile{%
\emoticon{%
\pupils
\draw[thick] (-1ex,-1ex)..controls (-0.5ex,-1.5ex)and(0.5ex,-1.5ex)..(1ex,-1ex);
}%\emoticon
-}
+}%
\def\RKbigsmile{%
\emoticon{%
@@ -671,7 +701,7 @@
%% mouth
\draw[thick] (-1.5ex,-0.5ex)..controls (-0.7ex,-1.7ex)and(0.7ex,-1.7ex)..(1.5ex,-0.5ex);
}%\emoticon
-}
+}%
\def\RKsad{%
\emoticon{%
@@ -681,7 +711,7 @@
%% mouth
\draw[thick] (-1ex,-1ex)..controls(-0.5ex,-0.5ex)and(0.5ex,-0.5ex)..(1ex,-1ex);
}%\emoticon
-}
+}%
\def\RKneutral{%
\emoticon{%
@@ -691,7 +721,7 @@
%% mouth
\draw[thick] (-0.5ex,-1ex)--(0.5ex,-1ex);
}%\emoticon
-}
+}%
\def\RKconfused{%
\emoticon{%
@@ -716,19 +746,19 @@
(-1.00ex,1.00ex)--(-1.20ex,1.10ex)
(-0.35ex,1.15ex)--(-0.25ex,1.35ex);
}%\emoticon
-}
+}%
\def\RKangry{%
\emoticon{%
%% pupils
-\fill[shift={( 0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex);
-\fill[shift={(-0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex);
+\fill[shift={( 0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex);%
+\fill[shift={(-0.5ex,0.5ex)},rotate=90] (0,0) ellipse (0.3ex and 0.15ex);%
%% mouth
-\draw[thick] (-1ex,-1ex)..controls(-0.5ex,-0.5ex)and(0.5ex,-0.5ex)..(1ex,-1ex);
+\draw[thick] (-1ex,-1ex)..controls(-0.5ex,-0.5ex)and(0.5ex,-0.5ex)..(1ex,-1ex);%
%% eyebrows
-\draw[thick] (0.2ex,1.15ex)--(0.5ex,1.6ex)(-0.2ex,1.15ex)--(-0.5ex,1.6ex);
+\draw[thick] (0.2ex,1.15ex)--(0.5ex,1.6ex)(-0.2ex,1.15ex)--(-0.5ex,1.6ex);%
}%\emoticon
-}
+}%
\def\RKlookup{%
\emoticon{%
@@ -826,6 +856,11 @@
\def\PfCSymbolTimes{\times}%
\def\PfCSymbolDiv{\div}%
+\input{PfCCheque}
+\input{PfCCalculsDetailles}
+\input{PfCTableauDoubleEntree}
+\input{PfCUrneProba}
+\input{PfCProbaFrequence}
\input{PfCVisualisationMulDeci}
\input{PfCArbreChiffre}
\input{PfCAssemblagesSolides}
@@ -971,4 +1006,8 @@
\input{PfCDomino}
\input{PfCProgrammeCalcul}
\input{PfCPapiers}
-\input{PfCScratch} \ No newline at end of file
+\input{PfCScratch}
+
+\RequirePackage{PfCInfixRPN}
+
+\input{PfCArbreCalcul} \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp b/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp
index 7ec73e648c..dc007c3643 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp
@@ -526,6 +526,8 @@ enddef;
vardef marque_para(expr dd,ee,pa)=
save im;
picture im;
+ string totem;
+ totem="//";
pair kk,ll,mn,mo;
kk=point(pa*length dd) of dd;
ll=projection(kk,point(0.25*length ee) of ee,point(0.5*length ee) of ee);
@@ -534,7 +536,8 @@ vardef marque_para(expr dd,ee,pa)=
im=image(
drawarrow mo--kk;
drawarrow symetrie(mo,mn)--ll;
- label(btex // etex,mn);
+% label(btex $//$ etex,mn);
+ label(totem,mn);
);
im
enddef;
@@ -551,13 +554,14 @@ vardef marque_Para(text totem)(expr dd,ee,pa)=
drawarrow (mn{dir(210+angle(mn-mo))}..{dir(150+angle(mn-mo))}kk) cutbefore cercles(mn,3mm);
drawarrow symetrie((mn{dir(210+angle(mn-mo))}..{dir(150+angle(mn-mo))}kk) cutbefore cercles(mn,3mm),mn);
trace cercles(mn,3mm);
- for p_=totem:
- if p_="":
- label(btex // etex ,mn);
- else:
- label(btex ? etex,mn);
- fi;
- endfor;
+% for p_=totem:
+% if p_="":
+% label(btex $//$ etex ,mn);
+% else:
+% label(btex ? etex,mn);
+ label(totem,mn);
+% fi;
+% endfor;
);
im
enddef;
diff --git a/macros/latex/contrib/profcollege/metapost/PfCMonde.mp b/macros/latex/contrib/profcollege/metapost/PfCMonde.mp
index fb3064cefd..6cc7f15e45 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCMonde.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCMonde.mp
@@ -151,6 +151,15 @@ enddef;
vardef FZ(expr t,v)=rayon*sind(c*t)
enddef;
+vardef FXx(expr t,v)=rayon*cosd(t)*cosd(v)
+enddef;
+
+vardef FYy(expr t,v)=rayon*cosd(t)*sind(v)
+enddef;
+
+vardef FZz(expr t,v)=rayon*sind(t)
+enddef;
+
%Paramètres et macros de représentation
vardef Initialisation(expr r,t,p,d)=
Rho:=r;
@@ -227,6 +236,25 @@ vardef MaillageSphere=
MaillageS;
enddef;
+vardef MaillageSphereCoord=
+% InitialiseMaillage(((phim div 10)+1)*pi/12,((phip div 10)-1)*pi/12,pi/12,-pi,pi,pi/12);
+ InitialiseMaillage(-pi/2,pi/2,pi/18,-pi,pi,pi/12);
+ %MaillageS;
+ path Maillage[];
+ nbmor:=0;
+ for k=-90 step 10 until 90:
+ for l=-180 step 10 until 180:
+ nbl:=nbl+1;
+ if ProduitScalaire(1/2[(FXx(k,l),FYy(k,l),FZz(k,l)),(FXx(k+10,l+10),FYy(k+10,l+10),FZz(k+10,l+10))]-pte3,Oeil-pte3)>0:
+ nbmor:=nbmor+1;
+ Maillage[nbmor]=Projgeo((FXx(k,l),FYy(k,l),FZz(k,l)))..Projgeo((FXx(k,l+10),FYy(k,l+10),FZz(k,l+10)));
+ draw Maillage[nbmor] if k=0: withpen pencircle scaled 1 withcolor Crimson fi;
+ draw Projgeo((FXx(k,l),FYy(k,l),FZz(k,l)))..Projgeo((FXx(k+10,l),FYy(k+10,l),FZz(k+10,l))) if l=0:withpen pencircle scaled 1 withcolor LightSteelBlue fi;
+ fi;
+ endfor;
+ endfor;
+enddef;
+
boolean maille;
maille=false;
@@ -276,9 +304,19 @@ vardef lecture(expr nomfichier,fond)=
numeric ll;
ll:=0;
nbpts:=scantokens readfrom nomfichier;
- for k=1 upto (nbpts div 3):
+% for k=1 upto (nbpts div 3):
+% pair latlon;
+% latlon=((scantokens readfrom nomfichier)+(scantokens readfrom nomfichier)+(scantokens readfrom nomfichier))/3;
+ if nbpts<Allegee:
+ Alleg:=1;
+ else:
+ Alleg:=Allegee;
+ fi;
+ for k=1 upto (nbpts div Alleg):
pair latlon;
- latlon=((scantokens readfrom nomfichier)+(scantokens readfrom nomfichier)+(scantokens readfrom nomfichier))/3;
+ latlon=((scantokens readfrom nomfichier) for l=2 upto Alleg:
+ +(scantokens readfrom nomfichier)
+ endfor)/Alleg;
Coord[k]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60)));
if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)):
if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0:
@@ -295,7 +333,7 @@ vardef lecture(expr nomfichier,fond)=
path pays;
if ll>0:
pays=Projgeo(Pays[1])
- for l=2 upto (nbpts div 3):
+ for l=2 upto (nbpts div Alleg):%(nbpts div 3):
--Projgeo(Pays[l])
endfor;
if noncolore=true:
@@ -303,7 +341,7 @@ vardef lecture(expr nomfichier,fond)=
else:
fill pays--cycle withcolor fond;
fi;
- draw pays;
+ draw pays withpen pencircle scaled 0.25;
clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4);
fi;
enddef;
@@ -319,9 +357,19 @@ vardef Lectureiles=
ll:=0;
nbpts:=scantokens readfrom nomfichiermul;
fond=scantokens readfrom nomfichiermul;
- for k=1 upto nbpts:
+ %if nbpts<Allegee:
+ Alleg:=1;
+ %else:
+ % Alleg:=2;%pas Allegee car sinon des artefacts apparaissent
+ %fi;
+ for k=1 upto (nbpts div Alleg):
pair latlon;
- latlon=scantokens readfrom nomfichiermul;
+ latlon=((scantokens readfrom nomfichiermul) for l=2 upto Alleg:
+ +(scantokens readfrom nomfichiermul)
+ endfor)/Alleg;
+% for k=1 upto nbpts:
+% pair latlon;
+% latlon=scantokens readfrom nomfichiermul;
Coord[k]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60)));
if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)):
if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0:
@@ -337,7 +385,7 @@ vardef Lectureiles=
path pays;
if ll>0:
pays=Projgeo(Pays[1])
- for l=2 upto nbpts:
+ for l=2 upto (nbpts div Alleg):%nbpts:
--Projgeo(Pays[l])
endfor;
if noncolore=true:
@@ -345,9 +393,15 @@ vardef Lectureiles=
else:
fill pays--cycle withcolor fond;
fi;
- draw pays;
+ draw pays withpen pencircle scaled 0.25;
clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4);
fi;
+ % rustine pour tout lire chaque partie de Ile.dat
+ if Alleg>1:
+ for po=1 upto (nbpts mod Alleg):
+ poubelle:=scantokens readfrom nomfichiermul;
+ endfor;
+ fi;
endfor;
closefrom nomfichiermul;
enddef;
@@ -1641,6 +1695,11 @@ vardef mappemonde(expr longobs,latobs)=
MaillageSphere;
drawoptions();
fi;
+ if maillagecoord=true:
+ drawoptions(withpen pencircle scaled 0.25 withcolor couleurmaillage);
+ MaillageSphereCoord;
+ drawoptions();
+ fi;
if maille=true:
Maille;
fi;
diff --git a/macros/latex/contrib/profcollege/metapost/PfCObjets.mp b/macros/latex/contrib/profcollege/metapost/PfCObjets.mp
index fd2fbe0f2d..5dac3c967d 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCObjets.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCObjets.mp
@@ -661,6 +661,55 @@ vardef DessineFusion=
endfor;
enddef;
+vardef DessineFusionCoul=
+ save _fusion;
+ picture _fusion;
+ tapj:=0;
+ color Fc[][];color cou[];
+ for l=1 upto nbobj:
+ for k=0 upto apj[l]:
+ cpt[tapj]:=tapj;
+ cou[tapj]:=Outcolor[l];
+ Fc[tapj].nb:=OTFc[l][k].nb;
+ for p=1 upto Fc[tapj].nb:
+ Fc[tapj][p]:=OTFc[l][k][p];
+ endfor;
+ Fc[tapj].iso:=OTFc[l][k].iso;
+ ALT[tapj]:=ALT[l][k];
+ Vue[tapj]:=Vue[l][k];
+ if Ferme[l]:
+ if Vue[tapj]=false:
+ tapj:=tapj-1;
+ fi;
+ fi;
+ tapj:=tapj+1;
+ endfor;
+ endfor;
+ tapj:=tapj-1;
+ QS(0,tapj);
+ for k=0 upto tapj:
+ fill for l=1 upto Fc[cpt[k]].nb:
+ Projette(Fc[cpt[k]][l])--
+ endfor
+ cycle withcolor if Vue[cpt[k]]:
+ abs(lumin(cpt[k]))*cou[cpt[k]] fi;
+ if traits:
+ draw for l=1 upto Fc[cpt[k]].nb:
+ Projette(Fc[cpt[k]][l])--
+ endfor
+ cycle withpen pencircle scaled0.25bp;
+ %add by cp 22/08/2011
+ else:
+ draw for l=1 upto Fc[cpt[k]].nb:
+ Projette(Fc[cpt[k]][l])--
+ endfor
+ cycle withcolor if Vue[cpt[k]]:
+ abs(lumin(cpt[k]))*cou[cpt[k]] fi;
+ %fin add
+ fi;
+ endfor;
+enddef;
+
vardef Objettore[](expr Rn,rn)=
Outcolor.@:=outcolor;
Incolor.@:=incolor;
@@ -1727,8 +1776,8 @@ vardef Objettetraedre[](expr ar)=
tcpt.@[0]:=0;
OTFc.@[0].nb:=3;
OTFc.@[0][1]:=Image(Sommet0);
- OTFc.@[0][2]:=Image(Sommet2);
- OTFc.@[0][3]:=Image(Sommet1);
+ OTFc.@[0][2]:=Image(Sommet1);
+ OTFc.@[0][3]:=Image(Sommet2);
OTFc.@[0].iso:=(OTFc.@[0][1]+OTFc.@[0][2]+OTFc.@[0][3])/3;
tcpt.@[1]:=1;
OTFc.@[1].nb:=3;
diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
index 6e2e7beb59..a2343b5312 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
@@ -2596,12 +2596,11 @@ vardef Demander(expr nbpas)=
picture Dem,texto;
if string nbpas:
texto=ColleBoxNew("demander",OvalNb(nbpas),"et attendre");
- ColBloc:=CapteurTrois;
- Dem=Affichage(texto);
else:
- message("La commande -- Demander -- admet un argument de type string.");
- Dem=nullpicture;
+ texto=ColleBoxNew("demander",nbpas,"et attendre");
fi;
+ ColBloc:=CapteurTrois;
+ Dem=Affichage(texto);
Dem
enddef;
diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp b/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp
index 9a3a650c38..c2311b1d33 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp
@@ -2595,12 +2595,11 @@ vardef Demander(expr nbpas)=
picture Dem,texto;
if string nbpas:
texto=ColleBoxNew("demander",OvalNb(nbpas),"et attendre");
- ColBloc:=CapteurTrois;
- Dem=Affichage(texto);
else:
- message("La commande -- Demander -- admet un argument de type string.");
- Dem=nullpicture;
+ texto=ColleBoxNew("demander",nbpas,"et attendre");
fi;
+ ColBloc:=CapteurTrois;
+ Dem=Affichage(texto);
Dem
enddef;
diff --git a/macros/latex/contrib/profcollege/metapost/PfCSketch.mp b/macros/latex/contrib/profcollege/metapost/PfCSketch.mp
new file mode 100644
index 0000000000..6a634cfc4d
--- /dev/null
+++ b/macros/latex/contrib/profcollege/metapost/PfCSketch.mp
@@ -0,0 +1,195 @@
+%D'après https://tex.stackexchange.com/questions/39296/simulating-hand-drawn-lines
+
+let normaldraw = draw ;
+let normalfill = fill ;
+let normaldrawarrow = drawarrow ;
+let normaldbldrawarrow = drawdblarrow ;
+let normalarrowhead = normalarrowhead;
+
+path fullsquare;
+fullsquare := unitsquare shifted - center unitsquare ;
+
+%D The variable \type{sketch_amount} determines the amount of randomness in the
+%D drawing
+numeric sketch_amount; sketch_amount := 3;
+numeric old_sketch_amount;
+%D The macro \type{sketchdraw} randomized the path before drawing it. The
+%D \type{expr} ... \type{text} trick is copied from the definition of
+%D \type{drawarrow}
+
+def sketchdraw expr p =
+ do_sketchdraw(p if (path p): randomized sketch_amount fi)
+enddef;
+
+def do_sketchdraw(expr p) text t =
+ normaldraw p t ;
+enddef;
+
+%cp
+%%%%%%%%%%%%%%%%%%
+vardef sketcharrowhead expr p =
+ save q,e; path q; pair e;
+ e = point length p of p;
+ q = gobble(p shifted -e cutafter makepath(pencircle scaled 2ahlength))
+ cuttings;
+ ((q rotated .5ahangle & reverse q rotated -.5ahangle -- cycle) shifted e) randomized (sketch_amount/3)
+enddef;
+
+path _apth;
+def sketchdrawarrow expr p = _apth:=p randomized sketch_amount; _sketchfinarr enddef;
+def sketchdrawdblarrow expr p = _apth:=p; _sketchfindarr enddef;
+
+def _sketchfinarr text t =
+ old_sketch_amount:=sketch_amount;
+ sketch_amount:=0;
+ draw _apth t;
+ sketch_amount:=old_sketch_amount;
+ filldraw sketcharrowhead _apth t
+enddef;
+
+def _sketchfindarr text t =
+ old_sketch_amount:=sketch_amount;
+ sketch_amount:=0;
+ draw _apth t;
+ sketch_amount:=old_sketch_amount;
+ filldraw sketcharrowhead _apth withpen currentpen t;
+ filldraw sketcharrowhead reverse _apth withpen currentpen t
+enddef;
+%%%%%%%%%%%%%%%%%%
+
+%D The macro \type{sketchfill} randomizes the path before filling it.
+path _sketch_path_;
+
+def sketchfill expr p =
+ _sketch_path_ := p randomized sketch_amount;
+ do_sketchfill
+enddef ;
+
+def do_sketchfill text t =
+ normalfill _sketch_path_ t ;
+enddef ;
+
+%D The macro \type{sketchypaths} is modeled after \type{visualizepaths} from
+%D \filename{mp-tool}.
+
+def sketchypaths =
+ let draw = sketchdraw ;
+ let fill = sketchfill ;
+ %cp
+ let drawarrow = sketchdrawarrow ;
+ let drawdblarrow = sketchdrawdblarrow ;
+ let arrowhead = sketcharrowhead ;
+ %fin cp
+enddef ;
+
+%cp
+def normalpaths =
+ let draw = normaldraw ;
+ let fill = normalfill ;
+ let drawarrow = normaldrawarrow ;
+ let drawdblarrow = normaldrawdblarrow ;
+ let arrowhead = normalarrowhead;
+enddef ;
+ %fincp
+
+%By metafun
+vardef mfun_randomized_picture(expr p,s)(text rnd) =
+ save currentpicture ;
+ picture currentpicture ;
+ currentpicture := nullpicture ;
+ for i within p :
+ addto currentpicture
+ if stroked i :
+ doublepath pathpart i rnd s
+ dashed dashpart i
+ withpen penpart i
+ withcolor colorpart i
+ withprescript prescriptpart i
+ withpostscript postscriptpart i
+ elseif filled i :
+ contour pathpart i rnd s
+ withpen penpart i
+ withcolor colorpart i
+ withprescript prescriptpart i
+ withpostscript postscriptpart i
+ else :
+ also i
+ fi
+ ;
+ endfor ;
+ currentpicture
+enddef ;
+
+primarydef p randomized s = (
+ if path p :
+ for i=0 upto length(p)-1 :
+ ((point i of p) randomshifted s) .. controls
+ ((postcontrol i of p) randomshifted s) and
+ ((precontrol (i+1) of p) randomshifted s) ..
+ endfor
+ if cycle p :
+ cycle
+ else :
+ ((point length(p) of p) randomshifted s)
+ fi
+ elseif pair p :
+ p randomshifted s
+ elseif cmykcolor p :
+ if cmykcolor s :
+ ((uniformdeviate cyanpart s) * cyanpart p,
+ (uniformdeviate magentapart s) * magentapart p,
+ (uniformdeviate yellowpart s) * yellowpart p,
+ (uniformdeviate blackpart s) * blackpart p)
+ elseif pair s :
+ ((xpart s + (uniformdeviate (ypart s - xpart s))) * p)
+ else :
+ ((uniformdeviate s) * p)
+ fi
+ elseif rgbcolor p :
+ if rgbcolor s :
+ ((uniformdeviate redpart s) * redpart p,
+ (uniformdeviate greenpart s) * greenpart p,
+ (uniformdeviate bluepart s) * bluepart p)
+ elseif pair s :
+ ((xpart s + (uniformdeviate (ypart s - xpart s))) * p)
+ else :
+ ((uniformdeviate s) * p)
+ fi
+ elseif color p :
+ if color s :
+ ((uniformdeviate greypart s) * greypart p)
+ elseif pair s :
+ ((xpart s + (uniformdeviate (ypart s - xpart s))) * p)
+ else :
+ ((uniformdeviate s) * p)
+ fi
+ elseif string p :
+ (resolvedcolor(p)) randomized s
+ elseif picture p :
+ mfun_randomized_picture(p,s)(randomized)
+ else :
+ % p - s/2 + uniformdeviate s % would have been better but we want to be positive
+ p + uniformdeviate s
+ fi
+ )
+enddef ;
+
+primarydef p randomshifted s =
+ begingroup ;
+ save ss ; pair ss ;
+ ss := paired(s) ;
+ p shifted (-.5xpart ss + uniformdeviate xpart ss,-.5ypart ss + uniformdeviate ypart ss)
+ endgroup
+enddef ;
+
+def resolvedcolor(expr s) =
+ .5white
+enddef ;
+
+vardef paired primary d =
+ if pair d : d else : (d,d) fi
+enddef ;
+
+ extra_endfig := "picture retiens; retiens=currentpicture; draw (retiens randomized 1) withpen pencircle scaled 0.5 withcolor 0.25white;" & extra_endfig;
+
+endinput