texlive[68199] Master/texmf-dist: profcollege (7sep23)
commits+karl at tug.org
commits+karl at tug.org
Thu Sep 7 22:15:03 CEST 2023
Revision: 68199
http://tug.org/svn/texlive?view=revision&revision=68199
Author: karl
Date: 2023-09-07 22:15:03 +0200 (Thu, 07 Sep 2023)
Log Message:
-----------
profcollege (7sep23)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
trunk/Master/texmf-dist/metapost/profcollege/PfCCalculatrice.mp
trunk/Master/texmf-dist/metapost/profcollege/PfCGeometrie.mp
trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp
trunk/Master/texmf-dist/metapost/profcollege/PfCScratchpdf.mp
trunk/Master/texmf-dist/tex/latex/profcollege/PfCBillard.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractions.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecDeci.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCDefiTables.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCFactorisation.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCGeometrie.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCJeuRangement.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCLabyrintheNombre.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCNombreAstral.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCOperationsTrou.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCPixelArt.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCPropor.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCPythagore.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresentationGraphique.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterEntier.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCRose.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCSimplifierFraction.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCTableauxUnites.tex
trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCibleQOp.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCCryptarithme.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCEratosthene.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCFubuki.tex
trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulJap.tex
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/profcollege/profcollege-doc.zip
Modified: trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
===================================================================
(Binary files differ)
Added: trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
===================================================================
--- trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip 2023-09-07 20:15:03 UTC (rev 68199)
Property changes on: trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/profcollege/profcollege-doc.zip
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCCalculatrice.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCCalculatrice.mp 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCCalculatrice.mp 2023-09-07 20:15:03 UTC (rev 68199)
@@ -40,7 +40,7 @@
vardef Test(expr cptk)(text cptnt)=
pair Decalage;
- if nblignes mod 2=0:
+ if nblignes>1:
Decalage:=u*((LargeurEcran,-8*(nblignes-1))-6*(length(cptnt)-cptk,0));
else:
Decalage:=u*(decahoriz,-8*(nblignes-1));
@@ -186,12 +186,11 @@
endfor;
fi;
for k=1 upto NB:
- nblignes:=nblignes+1;
- Ecran:=(u*(0,-1)--u*(LargeurEcran,-1)--u*(LargeurEcran,7)--u*(0,7)--cycle) shifted(u*(0,-8*(nblignes-1)));
+ Ecran:=(u*(0,-1)--u*(LargeurEcran,-1)--u*(LargeurEcran,7)--u*(0,7)--cycle) shifted(u*(0,-8*(k+nblignes-1)));
fill Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
draw Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
endfor;
- nblignes:=nblignes+1;
+ nblignes:=nblignes+NB+1;
Ecran:=(u*(0,-1)--u*(LargeurEcran,-1)--u*(LargeurEcran,7)--u*(0,7)--cycle) shifted(u*(0,-8*(nblignes-1)));
fill Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
draw Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCGeometrie.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCGeometrie.mp 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCGeometrie.mp 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1316,10 +1316,13 @@
%Outils
numeric echelleequerre;
echelleequerre=0.5;
-vardef equerreold(expr dte,drte,perpe,sens)=
- save picequerre;
- picture picequerre;
+vardef Equerre(expr dte,drte,perpe,sens)=
+ save $;
+ picture $,fig;
+ fig=currentpicture;
pair ww,t[];
+ picture grad[],gradu[];
+ numeric long;
path intermede;
pair perpen,ptt,pttt;
perpen:=projection(perpe,dte,drte);
@@ -1329,87 +1332,24 @@
ptt:=echelleequerre*(drte-dte) rotated (-90) shifted perpen;
fi;
ww=unitvector(drte-dte);
- intermede=ptt--(10[ptt,(perpen rotatedabout(ptt,if sens=1: 30 else:-30 fi))]);
+ intermede=ptt--(10[ptt,(perpen rotatedabout(ptt,30))]);
pttt=intermede intersectionpoint (10[dte,drte]--10[drte,dte]);
- picequerre=image(
+ long=floor(abs(perpen+7*unitvector(ptt-perpen)-ptt)*2.54/72);
+ pair CentreE;
+ CentreE=CentreCercleI(perpen,ptt,pttt);
+ $=image(
+ fill (perpen--ptt--pttt--cycle) withcolor 0.9*white;
draw perpen--ptt--pttt--cycle;
draw codeperp(ptt,perpen,pttt,5);
+ fill homothetie(polygone(perpen,ptt,pttt),CentreE,0.6) withcolor white;
+ draw homothetie(polygone(perpen,ptt,pttt),CentreE,0.6);
+ draw fig;
);
- picequerre
+ $
enddef;
-vardef equerre(text gradua)(expr ea,eb,ec)=
- save picequerre;
- picture picequerre;
- pair EA,EB,EC,ED,EE,EF,EI;
- EA:=ea;
- EB:=eb;
- EC:=ec;
- ED=projection(EC,EA,EB);
- EE-ED=EB-EA;
- EF-ED=echelleequerre*abs(EE-ED)*(unitvector(EE-ED) rotated 90);
- EI=CentreCercleI(EE,ED,EF);
- picequerre=image(
- fill (EE--ED--EF--cycle) withcolor 0.7white;
- draw codeperp(EE,ED,EF,5);
- draw EE--ED--EF--cycle;
- fill ((((EE--ED--EF--cycle) shifted ((0,0)-EI)) scaled 0.5) shifted EI) withcolor white;
- trace (((EE--ED--EF--cycle) shifted ((0,0)-EI)) scaled 0.5) shifted EI;
- % if abs(EE-ED)>abs(EF-ED):
-% for k=10 upto 50:%
-% trace (ED+k*1mm*unitvector(EE-ED))--(ED+k*1mm*unitvector(EE-ED)+1mm*unitvector(EF-ED));
-% endfor;
-% else:
-% for k=10 upto 50:%
-% trace (ED+k*1mm*unitvector(EF-ED))--(ED+k*1mm*unitvector(EF-ED)+1mm*unitvector(EE-ED));
-% endfor;
-% fi;
- );
- picequerre
-enddef;
+vardef equerre(expr dte,drte,perpe,sens)=Equerre(dte,drte,perpe,sens) enddef;
-
-% ww;
-% pair Intermede;
-% pair perpen,I,ptt;%,pttt
-% perpen:=projection(perpe,dte,drte);
-% Intermede:=echelleequerre[dte,drte];
-% ptt-perpen=abs(Intermede-perpen)*0.5*unitvector(perpe-perpen);
-% I:=CentreCercleI(perpen,ptt,Intermede);
-% ww=unitvector(drte-dte);
-% intermede=ptt--(10[ptt,(perpen rotatedabout(ptt,if sens=1: 30 else:-30 fi))]);
-% pttt=intermede intersectionpoint (10[dte,drte]--10[drte,dte]);
-% picequerre=image(
-%
-% draw codeperp(ptt,perpen,Intermede,5);
-% k=0;
-% pair Equa,Equb,Equc;
-% Equa:=perpen;
-% boolean Stop;
-% Stop=false;
-% forever:
-% label.top(TEX(decimal(angle(drte-perpen)-angle(perpe-perpen))),A);
-% for k=1 upto 100:
-% k:=k+1;
-% Equa:=perpen+k*1mm*unitvector(drte-perpen);
-% dotlabel("",Equa);
-% Equb:=Equa+1mm*unitvector(drte-perpen);
-% Equc:=rotation(Equb,Equa,-angle((drte-perpen)-(perpe-perpen)));
-% drawoptions(withcolor red);
-% dotlabel("",Equc);
-% drawoptions();
-% if abs(Equa-perpen)>9mm:%
-% trace Equa--Equc;
-% fi;
- % if abs(drte-Equa)<1cm:
-% Stop:=false;
-% fi;
-% exitif: Stop;
-% endfor;
-% );
-% picequerre
-%enddef;
-
vardef regle(expr depart,arrivee,rr)=
save picregle;
picture picregle,grad[],gradu[],final;
@@ -1519,7 +1459,8 @@
elseif p_="Tiret":
Tiret:=true;
fi;
- endfor;
+endfor;
+taillefonte=6;
% Le cercle
RA1=0.3[rapcentre,pointsupport];
RA2=0.375[rapcentre,pointsupport];
@@ -1550,7 +1491,7 @@
fincompteur:=36;
fi;
if (pasgrad=10) or (pasgrad=5) or (pasgrad=1):
- for i=0 upto (fincompteur-1)/2:
+ for i=0 upto (fincompteur)/2:
draw grada[10*i]--gradb[10*i] withpen pencircle scaled 1.15;
endfor;
fi;
@@ -1580,13 +1521,13 @@
if rr=1:
for j=0 upto 18:
nombre[10*j]=image(
- label.bot(TEX("\fontsize{4}{4}\selectfont"&decimal(10*j)&""),grada[10*j]);
+ label.bot(TEX("\fontsize{"&decimal(taillefonte)&"}{"&decimal(taillefonte)&"}\selectfont"&decimal(10*j)),grada[10*j]);
currentpicture:=currentpicture rotatedabout(grada[10*j],angle(grada[10*j]-rapcentre)-90);
);
endfor
for j=0 upto 18:
nombre[10*j+1]=image(
- label.top(TEX("\fontsize{4}{4}\selectfont"&decimal(180-10*j)&""),gradb[10*j]);
+ label.top(TEX("\fontsize{"&decimal(taillefonte)&"}{"&decimal(taillefonte)&"}\selectfont"&decimal(180-10*j)),gradb[10*j]);
currentpicture:=currentpicture rotatedabout(gradb[10*j],angle(gradb[10*j]-rapcentre)-90);
);
endfor
@@ -1593,13 +1534,13 @@
else:
for j=0 upto 18:
nombre[10*j]=image(
- label.bot(TEX("\fontsize{4}{4}\selectfont"&decimal(180-10*j)&""),grada[10*j]);
+ label.bot(TEX("\fontsize{"&decimal(taillefonte)&"}{"&decimal(taillefonte)&"}\selectfont"&decimal(180-10*j)),grada[10*j]);
currentpicture:=currentpicture rotatedabout(grada[10*j],angle(grada[10*j]-rapcentre)-90);
);
endfor
for j=18 downto 0:
nombre[10*j+1]=image(
- label.top(TEX("\fontsize{4}{4}\selectfont"&decimal(10*j)&""),gradb[10*j]);
+ label.top(TEX("\fontsize{"&decimal(taillefonte)&"}{"&decimal(taillefonte)&"}\selectfont"&decimal(10*j)),gradb[10*j]);
currentpicture:=currentpicture rotatedabout(gradb[10*j],angle(gradb[10*j]-rapcentre)-90);
);
endfor
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCScratch.mp 2023-09-07 20:15:03 UTC (rev 68199)
@@ -2958,6 +2958,21 @@
Oop
enddef;
+vardef OpMulS(expr pasun,pasdeux)=
+ save Oop; picture Oop;
+ save TAao; path TAao;
+ save LOPop; picture LOPop;
+ LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$*$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
+ TAao=OvalBox(LOPop);
+ Oop=image(
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ draw LOPop;
+ draw TAao if print=false : withcolor coefprint*white fi;
+ );
+ Oop:=Oop shifted(-center Oop);
+ Oop
+enddef;
+
vardef OpDiv(expr pasun,pasdeux)=
save Oop; picture Oop;
save TAao; path TAao;
@@ -2973,6 +2988,21 @@
Oop
enddef;
+vardef OpDivS(expr pasun,pasdeux)=
+ save Oop; picture Oop;
+ save TAao; path TAao;
+ save LOPop; picture LOPop;
+ LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$/$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
+ TAao=OvalBox(LOPop);
+ Oop=image(
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ draw LOPop;
+ draw TAao if print=false : withcolor coefprint*white fi;
+ );
+ Oop:=Oop shifted(-center Oop);
+ Oop
+enddef;
+
vardef OpModulo(expr pasun,pasdeux)=
save Oop; picture Oop;
save TAao; path TAao;
Modified: trunk/Master/texmf-dist/metapost/profcollege/PfCScratchpdf.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/profcollege/PfCScratchpdf.mp 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/metapost/profcollege/PfCScratchpdf.mp 2023-09-07 20:15:03 UTC (rev 68199)
@@ -2967,6 +2967,21 @@
Oop
enddef;
+vardef OpMulS(expr pasun,pasdeux)=
+ save Oop; picture Oop;
+ save TAao; path TAao;
+ save LOPop; picture LOPop;
+ LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$*$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
+ TAao=OvalBox(LOPop);
+ Oop=image(
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ draw LOPop;
+ draw TAao if print=false : withcolor coefprint*white fi;
+ );
+ Oop:=Oop shifted(-center Oop);
+ Oop
+enddef;
+
vardef OpDiv(expr pasun,pasdeux)=
save Oop; picture Oop;
save TAao; path TAao;
@@ -2982,6 +2997,21 @@
Oop
enddef;
+vardef OpDivS(expr pasun,pasdeux)=
+ save Oop; picture Oop;
+ save TAao; path TAao;
+ save LOPop; picture LOPop;
+ LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$/$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
+ TAao=OvalBox(LOPop);
+ Oop=image(
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ draw LOPop;
+ draw TAao if print=false : withcolor coefprint*white fi;
+ );
+ Oop:=Oop shifted(-center Oop);
+ Oop
+enddef;
+
vardef OpModulo(expr pasun,pasdeux)=
save Oop; picture Oop;
save TAao; path TAao;
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCBillard.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCBillard.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCBillard.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,21 +1,31 @@
%%%
% Billard
%%%
-\setKVdefault[ClesBillard]{Longueur=8cm,Largeur=5cm,Solution=false,Angle=70,Depart=0.5,Vrai=false}
+\newtoks\tokPfCMotBillard{}%
+\def\UpdateTokBillard#1\nil{\addtotok\tokPfCMotBillard{"#1"}}%
+
+\setKVdefault[ClesBillard]{Longueur=8cm,Largeur=5cm,Solution=false,Angle=70,Depart=0.5,Vrai=false,Nom=JeuA,Creation=false}
+
\NewDocumentCommand\Billard{o m}{%
\useKVdefault[ClesBillard]%
\setKV[ClesBillard]{#1}%
+ \tokPfCMotBillard{}%
+ \ifboolKV[ClesBillard]{Creation}{%
+ \expandafter\UpdateTokBillard#2\nil%
+ }{\tokPfCMotBillard{#2}}%
\ifboolKV[ClesBillard]{Solution}{%
- \MPBillardSolution{#2}{\useKV[ClesBillard]{Depart}}{\useKV[ClesBillard]{Angle}}%
- }{%
- \MPBillard{#2}{\useKV[ClesBillard]{Depart}}{\useKV[ClesBillard]{Angle}}%
- }%
+ \MPBillardSolution{\the\tokPfCMotBillard}{\useKV[ClesBillard]{Depart}}{\useKV[ClesBillard]{Angle}}%
+ }{%
+ \MPBillard{\the\tokPfCMotBillard}{\useKV[ClesBillard]{Depart}}{\useKV[ClesBillard]{Angle}}%
+ }%
}%
\def\MPBillard#1#2#3{%
- \mplibcodeinherit{disable}%
- \begin{Geometrie}[CoinHD={(\useKV[ClesBillard]{Longueur}+2cm,\useKV[ClesBillard]{Largeur}+3cm)}]
+ \xdef\PfCNomBillard{\useKV[ClesBillard]{Nom}}
+ \mplibforcehmode
+ \begin{mplibcode}[\PfCNomBillard]
+ _tfig:=20cm;
boolean Vrai;
Vrai:=\useKV[ClesBillard]{Vrai};
% On définit la liste des 25 lettres alphabétiques dans laquelle on choisit autant de lettres que la longueur du mot
@@ -113,6 +123,7 @@
cote4=segment(M4,M1);
trace rec;
pair Pt[],FauxPt[];
+ numeric nbfaux,l[],angleref,angledepart,tourne;
nbfaux=0;
l1=#2;
Pt[1]=point(l1) of rec;
@@ -123,11 +134,11 @@
dotlabel.lft(TEX(substring(0,1) of #1),Pt[1]);
elseif l1>2:
angledepart=180+angleref;
- Pt[2]=demidroite(Pt[1],rotation(M4,Pt1,angledepart)) intersectionpoint ((subpath(3,4) of rec)--(subpath(0,2) of rec));
+ Pt[2]=demidroite(Pt[1],rotation(M3,Pt1,angledepart)) intersectionpoint ((subpath(3,4) of rec)--(subpath(0,2) of rec));
dotlabel.top(TEX(substring(0,1) of #1),Pt[1]);
elseif l1>1:
angledepart=angleref-90;
- Pt[2]=demidroite(Pt[1],rotation(M3,Pt1,angledepart)) intersectionpoint ((subpath(2,4) of rec)--(subpath(0,1) of rec));
+ Pt[2]=demidroite(Pt[1],rotation(M2,Pt1,angledepart)) intersectionpoint ((subpath(2,4) of rec)--(subpath(0,1) of rec));
dotlabel.rt(TEX(substring(0,1) of #1),Pt[1]);
else:
angledepart=angleref;
@@ -134,10 +145,11 @@
Pt[2]=demidroite(Pt[1],rotation(M2,Pt1,angledepart)) intersectionpoint (subpath(1,4) of rec);
dotlabel.bot(TEX(substring(0,1) of #1),Pt[1]);
fi;
+ drawarrow Pt[1]--(Pt[1]+1.5cm*unitvector(Pt[2]-Pt[1])) withpen pencircle scaled 1.25;
tourne=90;
numeric Blong;
BLong:=length #1;
- % Détermination des points.
+ %% Détermination des points.
if Vrai:
for k=3 upto BLong:
Intermed:=symetrie(Pt[k-2],Pt[k-1],Pt[k-1]+M2-M3);
@@ -159,7 +171,7 @@
fi;
endfor;
fi;
- % Ajout des faux points
+ %% Ajout des faux points
path SPath[];
cpt[1]:=1;
cpt[BLong+1]:=BLong+1;
@@ -182,7 +194,7 @@
drawoptions();
% Tracés
drawarrow Pt[1]--(Pt[1]+1.5cm*unitvector(Pt[2]-Pt[1])) withpen pencircle scaled 1.25;
- % Labelisation
+ %% Labelisation
for k=2 upto BLong:
if (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[1])<>(-1,-1):
dotlabel.bot(TEX(substring(k-1,k) of #1),Pt[k]);
@@ -209,14 +221,17 @@
Reponse=image(
trace segment((0,0),(7*BLong*mm-2mm,0)) dashed dashpattern(on5mm off2mm);
);
- trace Reponse shifted((xpart(Co),5mm)-center Reponse);
- \end{Geometrie}%
+ trace Reponse shifted((xpart(Co),5mm)-center Reponse);
+ clip currentpicture to polygone((0,0),(\useKV[ClesBillard]{Longueur}+2cm,0),(\useKV[ClesBillard]{Longueur}+2cm,\useKV[ClesBillard]{Largeur}+3cm),(0,\useKV[ClesBillard]{Largeur}+3cm));
+ \end{mplibcode}%
}%
\def\MPBillardSolution#1#2#3{%
- \mplibcodeinherit{enable}%
- \begin{mplibcode}%
- Figure(0,0,\useKV[ClesBillard]{Longueur}+2cm,\useKV[ClesBillard]{Largeur}+3cm);
+ % \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;
@@ -255,5 +270,5 @@
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}%
+% \mplibcodeinherit{disable}%
}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractions.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractions.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCalculsFractions.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,5 +1,5 @@
-\setKVdefault[CalculsFractions]{Couleurs=false}
-\defKV[CalculsFractions]{Couleur=\setKV[CalculsFractions]{Couleurs}}
+\setKVdefault[CalculsFractions]{Couleurs=false,Negatif=false}%
+\defKV[CalculsFractions]{Couleur=\setKV[CalculsFractions]{Couleurs}}%
\NewDocumentCommand\tofrac{m}{%
\IfDecimal{#1}{#1}{%
@@ -33,7 +33,7 @@
\xdef\PfCAddFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListeFractions{\PfCAddFoo}%
- \reademptyitems
+ \reademptyitems%
\setsepchar{,}%
% Partie calculs
\PGCD{\ListeFractions[1,2]}{\ListeFractions[2,2]}%
@@ -50,7 +50,10 @@
\ensuremath{%
\IfValueTF{#3}{%
\ifnum#3=4\relax%
- \tofrac{\PfCAddSumSimp}%
+ %test
+ \ifboolKV[CalculsFractions]{Negatif}{%
+ \xintifboolexpr{\fpeval{\PfCAddNumSimp/\PfCAddDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCAddNumSimp)}/\fpeval{abs(\PfCAddDenoSimp)}}}{\tofrac{\PfCAddSumSimp}}%
+ }{\tofrac{\PfCAddSumSimp}}%
\else%
\ifnum#3=3\relax%
\SSimpliTest{\fpeval{abs(\PfCAddNumFin)}}{\fpeval{abs(\PfCAddDenoFin)}}\ifthenelse{\boolean{Simplification}}{\tofrac{\PfCAddNumFin/\PfCAddDenoFin}}{\tofrac{\PfCAddSumSimp}}%
@@ -79,8 +82,8 @@
}%
}%
-\NewDocumentCommand\SousFraction{oomm}{%
- \AddFraction*[#1][#2]{#3}{#4}%
+\NewDocumentCommand\SousFraction{oommo}{%
+ \AddFraction*[#1][#2]{#3}{#4}[#5]%
}%
\NewDocumentCommand\MulFraction{oommo}{%
@@ -114,7 +117,9 @@
\ensuremath{%
\IfValueTF{#2}{%
\ifnum#2=3\relax
- \tofrac{\PfCMulPdtSimp}%
+ \ifboolKV[CalculsFractions]{Negatif}{%
+ \xintifboolexpr{\fpeval{\PfCMulNumSimp/\PfCMulDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCMulNumSimp)}/\fpeval{abs(\PfCMulDenoSimp)}}}{\tofrac{\PfCMulPdtSimp}}%
+ }{\tofrac{\PfCMulPdtSimp}}%
\else
\ifnum#2=2\relax%
\SSimpliTest{\PfCMulNumFin}{\PfCMulDenoFin}\ifthenelse{\boolean{Simplification}}{\frac{\ifnum\PfCMulNumFin<0\relax-\fi\Decomposition[Longue]{\fpeval{abs(\PfCMulNumFin)}}}{\ifnum\PfCMulDenoFin<0\relax-\fi\Decomposition[Longue]{\fpeval{abs(\PfCMulDenoFin)}}}}{\tofrac{\PfCMulPdtSimp}}%
@@ -160,7 +165,9 @@
\ensuremath{%
\IfValueTF{#2}{%
\ifnum#2=4\relax
- \tofrac{\PfCDivPdtSimp}%
+ \ifboolKV[CalculsFractions]{Negatif}{%
+ \xintifboolexpr{\fpeval{\PfCDivNumSimp/\PfCDivDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCDivNumSimp)}/\fpeval{abs(\PfCDivDenoSimp)}}}{\tofrac{\PfCDivPdtSimp}}%
+ }{\tofrac{\PfCDivPdtSimp}}%
\else\ifnum#2=3\relax
\MulFraction[][\fpeval{#2-1}]{\ListeFractions[1,1]/\ListeFractions[1,2]}{\ListeFractions[2,2]/\ListeFractions[2,1]}%
\else
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,13 +1,17 @@
%%%
% Cards
%%%
-\setKVdefault[Cards]{Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,Landscape=false,Couleur=Cornsilk,Theme=Th\'eor\`eme\\de
- Pythagore,ThemeSol=Solution,AfficheTheme=false,Trame=false,Jointes=false,TrameVisible=false,RayonArc=5pt,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,Eleve=false,BackgroundAv=false,BackgroundAr=false,ImageAv=4813762.jpg,ImageAr=4813762.jpg,AffichageSolution=true,SolutionSeule=false,%
+\setKVdefault[Cards]{Formats=false,Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,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,%
% Pour la boite
ANbCartes=false,ATypeJeu=false,ANiveau=false,ANumero=false,AThemeJeu=false,CouleurTheme=black,CouleurNiveau=black,CouleurType=black,CouleurNb=black,
% Pour le trivial
Trivial=false,Symboles={\faInfinity,\faSignal,\faProjectDiagram,\faHiking,\faRuler,\faLockOpen}
}%
+% Pour le choix des images Av et Ar
+\defKV[Cards]{ImageAv=\setKV[Cards]{BackgroundAv}}%
+\defKV[Cards]{ImageAr=\setKV[Cards]{BackgroundAr}}%
% Pour moduler l'affichage de textes sur la boite.
\defKV[Cards]{NbCartes=\setKV[Cards]{ANbCartes}}%
\defKV[Cards]{TypeJeu=\setKV[Cards]{ATypeJeu}}%
@@ -17,6 +21,10 @@
%
\defKV[Cards]{ThemeJaiQuiA=\setKV[Cards]{AfficheTheme}}%
%
+% Gestion des formats
+%
+\defKV[Cards]{Format=\setKV[Cards]{Formats}}%
+%
\newtcolorbox{Mybox}[3]{%
enhanced,%
nobeforeafter,%
@@ -25,6 +33,18 @@
width=\largeurcarte,%
height=\hauteurcarte,%
arc=\PfCRayonArc,%
+ underlay={%
+ \ifboolKV[Cards]{BackgroundAv}{%
+ \begin{tcbclipinterior}
+ \node[anchor=center,opacity=1]
+ at (interior.center) {%
+ \includegraphics[%
+ height=\tcb at height,
+ width=\tcb at width,
+ ]{\useKV[Cards]{ImageAv}}};%
+ \end{tcbclipinterior}%
+ }{}%
+ },%
overlay unbroken and first={%
\coordinate[yshift=-0.5\hauteurtitre] (A1) at (frame.north west);%
\coordinate[yshift=-0.5\hauteurtitre] (B1) at (frame.north east);%
@@ -53,7 +73,28 @@
colback=white,%
colbacktitle=TrameCouleur,%
}%
-
+\newtcolorbox{MyboxAr}{%
+ enhanced,%
+ nobeforeafter,%
+ left=0pt,right=0pt,top=0pt,%
+ text fill,%
+ width=\largeurcarte,%
+ height=\hauteurcarte,%
+ arc=\PfCRayonArc,%
+ underlay={%
+ \ifboolKV[Cards]{BackgroundAr}{%
+ \begin{tcbclipinterior}
+ \node[anchor=center,opacity=1]
+ at (interior.center) {%
+ \includegraphics[%
+ height=\tcb at height,
+ width=\tcb at width,
+ ]{\useKV[Cards]{ImageAr}}};%
+ \end{tcbclipinterior}%
+ }{}%
+ },%
+ colback=white
+}%
\newcommand\PfCTexteJai{J'ai}%
\newcommand\PfCTexteJesuis{Je suis\dots}%
\newcommand\PfCTexteQuia{Qui a ?}%
@@ -210,7 +251,7 @@
},%
overlay unbroken and first={%
\coordinate[yshift=-0.5\hauteurtitre] (A) at (frame.north);%
- \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleur] (T1) at (A){\begin{minipage}{\largeurcarte-6mm}%
+ \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleurAr] (T1) at (A){\begin{minipage}{\largeurcarte-6mm}%
\begin{center}%
#1%
\end{center}%
@@ -302,42 +343,312 @@
\end{tikzpicture}%
}{}%
-\NewDocumentCommand\Cartes{o +m}{%
+%% Trame pour huit cartes format "A7"
+\NewDocumentEnvironment{TrameASept}{+b}{%
+ \ifodd\thepage%
+ \setlength{\PfCCardsH}{\largeurcards}%
+ \setlength{\PfCCardsV}{\hauteurcards}%
+ \else%
+ \setlength{\PfCCardsH}{\largeurcards+\PfCCardsEcartH}%
+ \setlength{\PfCCardsV}{\hauteurcards+\PfCCardsEcartV}%
+ \fi%
+ \begin{tikzpicture}[remember picture,overlay]
+ % quadrillages horizontal et vertical
+ \coordinate[yshift=-\margev] (A) at (current page.north west);%
+ \coordinate[yshift=-\margev] (B) at (current page.north east);%
+ \coordinate[yshift=-\hauteurcards] (A1) at (A);%
+ \coordinate[yshift=-\hauteurcards] (B1) at (B);%
+ \coordinate[yshift=-\hauteurcards] (A2) at (A1);%
+ \coordinate[yshift=-\hauteurcards] (B2) at (B1);%
+ \coordinate[xshift=\margeh] (C) at (current page.north west);%
+ \coordinate[xshift=\margeh] (D) at (current page.south west);%
+ \coordinate[xshift=\largeurcards] (C1) at (C);%
+ \coordinate[xshift=\largeurcards] (D1) at (D);%
+ \coordinate[xshift=\largeurcards] (C2) at (C1);%
+ \coordinate[xshift=\largeurcards] (D2) at (D1);%
+ \coordinate[xshift=\largeurcards] (C3) at (C2);%
+ \coordinate[xshift=\largeurcards] (D3) at (D2);%
+ \draw (A) -- (B);%
+ \draw (A1) -- (B1);%
+ \draw (A2) -- (B2);%
+ \draw (C)--(D);%
+ \draw (C1)--(D1);%
+ \draw (C2)--(D2);%
+ \draw (C3)--(D3);%
+ \coordinate[xshift=\margeh+0.5\largeurcards,yshift=-0.5\hauteurcards] (Carte1) at (A);%
+ \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);%
+ \coordinate[xshift=2\largeurcards,yshift=0mm] (Carte3) at (Carte1);%
+ \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte4) at (Carte1);%
+ \coordinate[xshift=\largeurcards,yshift=-\hauteurcards] (Carte5) at (Carte1);%
+ \coordinate[xshift=2\largeurcards,yshift=-\hauteurcards] (Carte6) at (Carte1);%
+ #1%
+ \end{tikzpicture}%
+}%
+
+\newcommand\CartesASept[2][]{%
\useKVdefault[Cards]%
\setKV[Cards]{#1}%
\setsepchar[*]{§*/}%
\readlist*\ListeCards{#2}%
\setsepchar{,}%
- \ifboolKV[Cards]{Landscape}{%
- \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
- \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
- \setlength{\largeurcards}{95mm}%
- \setlength{\hauteurcards}{65mm}%
- \setlength{\margeh}{(297mm-3\largeurcards)/2}%
- \setlength{\margev}{(210mm-3\hauteurcards)/2}%
- }{%
- \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
- \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
- \ifboolKV[Cards]{Jointes}{\setlength{\largeurcards}{\largeurcarte}}{\setlength{\largeurcards}{65mm}}%
- \ifboolKV[Cards]{Jointes}{\setlength{\hauteurcards}{\hauteurcarte}}{\setlength{\hauteurcards}{95mm}}%
- \setlength{\margeh}{(210mm-3\largeurcards)/2}%
- \setlength{\margev}{(297mm-3\hauteurcards)/2}
- }%
+ \setlength{\hauteurcarte}{\fpeval{100-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{95-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcards}{95mm}%
+ \setlength{\hauteurcards}{100mm}%
+ \setlength{\margeh}{(297mm-287mm)/2}%
+ \setlength{\margev}{(210mm-200mm)/2}%
\setlength{\hauteurtitre}{\fpeval{\useKV[Cards]{HauteurTheme}}mm}%
\setlength{\largeurtitre}{\fpeval{(\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}-9)/2}mm}%
\colorlet{TexteCouleur}{black}%
\colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}%
- \setlength{\PfCRayonArc}{\useKV[Cards]{RayonArc}}%
- \ifboolKV[Cards]{Trivial}{%
- \CartesTrivial%
+ \colorlet{TrameCouleurAr}{\useKV[Cards]{CouleurAr}}%
+ \begin{TrameASept}
+ %A
+ \multido{\i=1+1}{6}{%
+ \node[] at (Carte\i) {%
+ \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
+ \ListeCards[\i,1]%
+ \end{MyboxSimpleAv}%
+ };%
+ }%
+ \end{TrameASept}%
+ \ifboolKV[Cards]{AffichageSolution}{%
+ \clearpage%
+ \thispagestyle{empty}%
+ \begin{TrameASept}
+ \multido{\i=1+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{4-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \multido{\i=4+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{10-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \end{TrameASept}%
+ \clearpage%
+ }{}%
+% }%
+}%
+
+
+%% Trame pour quatre cartes format A6
+\NewDocumentEnvironment{TrameASix}{+b}{%
+ \ifodd\thepage%
+ \setlength{\PfCCardsH}{\largeurcards}%
+ \setlength{\PfCCardsV}{\hauteurcards}%
+ \else%
+ \setlength{\PfCCardsH}{\largeurcards+\PfCCardsEcartH}%
+ \setlength{\PfCCardsV}{\hauteurcards+\PfCCardsEcartV}%
+ \fi%
+ \begin{tikzpicture}[remember picture,overlay]
+ % quadrillages horizontal et vertical
+ \coordinate[yshift=-\margev] (A) at (current page.north west);%
+ \coordinate[yshift=-\margev] (B) at (current page.north east);%
+ \coordinate[yshift=-\hauteurcards] (A1) at (A);%
+ \coordinate[yshift=-\hauteurcards] (B1) at (B);%
+ \coordinate[yshift=-\hauteurcards] (A2) at (A1);%
+ \coordinate[yshift=-\hauteurcards] (B2) at (B1);%
+ \coordinate[xshift=\margeh] (C) at (current page.north west);%
+ \coordinate[xshift=\margeh] (D) at (current page.south west);%
+ \coordinate[xshift=\largeurcards] (C1) at (C);%
+ \coordinate[xshift=\largeurcards] (D1) at (D);%
+ \coordinate[xshift=\largeurcards] (C2) at (C1);%
+ \coordinate[xshift=\largeurcards] (D2) at (D1);%
+ \draw (A) -- (B);%
+ \draw (A1) -- (B1);%
+ \draw (A2) -- (B2);%
+ \draw (C)--(D);%
+ \draw (C1)--(D1);%
+ \draw (C2)--(D2);%
+ \coordinate[xshift=\margeh+0.5\largeurcards,yshift=-0.5\hauteurcards] (Carte1) at (A);%
+ \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);%
+ \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte3) at (Carte1);%
+ \coordinate[xshift=\largeurcards,yshift=-\hauteurcards] (Carte4) at (Carte1);%
+ #1%
+ \end{tikzpicture}%
+}%
+
+\newcommand\CartesASix[2][]{%
+ \useKVdefault[Cards]%
+ \setKV[Cards]{#1}%
+ \setsepchar[*]{§*/}%
+ \readlist*\ListeCards{#2}%
+ \setsepchar{,}%
+ \setlength{\hauteurcarte}{\fpeval{100-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{143.5-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcards}{143.5mm}%
+ \setlength{\hauteurcards}{100mm}%
+ \setlength{\margeh}{(297mm-287mm)/2}%
+ \setlength{\margev}{(210mm-200mm)/2}%
+ \setlength{\hauteurtitre}{\fpeval{\useKV[Cards]{HauteurTheme}}mm}%
+ \setlength{\largeurtitre}{\fpeval{(\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}-9)/2}mm}%
+ \colorlet{TexteCouleur}{black}%
+ \colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}%
+ \colorlet{TrameCouleurAr}{\useKV[Cards]{CouleurAr}}%
+ \begin{TrameASix}
+ %A
+ \multido{\i=1+1}{4}{%
+ \node[] at (Carte\i) {%
+ \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
+ \ListeCards[\i,1]%
+ \end{MyboxSimpleAv}%
+ };%
+ }%
+ \end{TrameASix}%
+ \ifboolKV[Cards]{AffichageSolution}{%
+ \clearpage%
+ \thispagestyle{empty}%
+ \begin{TrameASix}
+ \multido{\i=1+1}{2}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{3-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \multido{\i=3+1}{2}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{7-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \end{TrameASix}%
+ \clearpage%
+ }{}%
+% }%
+}%
+
+%% Trame pour deux cartes format A5
+\NewDocumentEnvironment{TrameACinq}{+b}{%
+ \ifodd\thepage%
+ \setlength{\PfCCardsH}{\largeurcards}%
+ \setlength{\PfCCardsV}{\hauteurcards}%
+ \else%
+ \setlength{\PfCCardsH}{\largeurcards+\PfCCardsEcartH}%
+ \setlength{\PfCCardsV}{\hauteurcards+\PfCCardsEcartV}%
+ \fi%
+ \begin{tikzpicture}[remember picture,overlay]
+ % quadrillages horizontal et vertical
+ \coordinate[yshift=-\margev] (A) at (current page.north west);%
+ \coordinate[yshift=-\margev] (B) at (current page.north east);%
+ \coordinate[yshift=-\hauteurcards] (A1) at (A);%
+ \coordinate[yshift=-\hauteurcards] (B1) at (B);%
+ \coordinate[xshift=\margeh] (C) at (current page.north west);%
+ \coordinate[xshift=\margeh] (D) at (current page.south west);%
+ \coordinate[xshift=\largeurcards] (C1) at (C);%
+ \coordinate[xshift=\largeurcards] (D1) at (D);%
+ \coordinate[xshift=\largeurcards] (C2) at (C1);%
+ \coordinate[xshift=\largeurcards] (D2) at (D1);%
+ \draw (A) -- (B);%
+ \draw (A1) -- (B1);%
+ \draw (C)--(D);%
+ \draw (C1)--(D1);%
+ \draw (C2)--(D2);%
+ \coordinate[xshift=\margeh+0.5\largeurcards,yshift=-0.5\hauteurcards] (Carte1) at (A);%
+ \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);%
+ #1%
+ \end{tikzpicture}%
+}%
+
+\newcommand\CartesACinq[2][]{%
+ \useKVdefault[Cards]%
+ \setKV[Cards]{#1}%
+ \setsepchar[*]{§*/}%
+ \readlist*\ListeCards{#2}%
+ \setlength{\hauteurcarte}{\fpeval{200-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{143.5-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcards}{143.5mm}%
+ \setlength{\hauteurcards}{200mm}%
+ \setlength{\margeh}{(297mm-287mm)/2}%
+ \setlength{\margev}{(210mm-190mm)/2}%
+ \setlength{\hauteurtitre}{\fpeval{\useKV[Cards]{HauteurTheme}}mm}%
+ \setlength{\largeurtitre}{\fpeval{(\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}-9)/2}mm}%
+ \colorlet{TexteCouleur}{black}%
+ \colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}%
+ \colorlet{TrameCouleurAr}{\useKV[Cards]{CouleurAr}}%
+ \begin{TrameACinq}
+ %A
+ \multido{\i=1+1}{2}{%
+ \node[] at (Carte\i) {%
+ \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
+ \ListeCards[\i,1]%
+ \end{MyboxSimpleAv}%
+ };%
+ }%
+ \end{TrameACinq}%
+ \ifboolKV[Cards]{AffichageSolution}{%
+ \clearpage%
+ \thispagestyle{empty}%
+ \begin{TrameACinq}
+ \multido{\i=1+1}{2}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{3-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \end{TrameACinq}%
+ \clearpage%
+ }{}%
+}%
+
+\NewDocumentCommand\Cartes{o +m}{%
+ \useKVdefault[Cards]%
+ \setKV[Cards]{#1}%
+ \setsepchar[*]{§*/}%
+ \readlist*\ListeCards{#2}%
+ \setsepchar{,}%
+ \ifboolKV[Cards]{Formats}{%
+ \comparestrict%
+ \IfEq{\useKV[Cards]{Format}}{A5p}{%
+ \CartesACinq[#1]{#2}%
+ }{}%
+ \IfEq{\useKV[Cards]{Format}}{A6p}{%
+ \CartesASix[#1]{#2}%
+ }{}%
+ \IfEq{\useKV[Cards]{Format}}{Huitp}{%
+ \CartesASept[#1]{#2}%
+ }{}%
}{%
- \ifboolKV[Cards]{JaiQuia}{%
- \CartesJaiQuia%
+ \ifboolKV[Cards]{Landscape}{%
+ \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcards}{95mm}%
+ \setlength{\hauteurcards}{65mm}%
+ \setlength{\margeh}{(297mm-3\largeurcards)/2}%
+ \setlength{\margev}{(210mm-3\hauteurcards)/2}%
}{%
- \ifboolKV[Cards]{Loop}{%
- \CartesLoop%
+ \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
+ \ifboolKV[Cards]{Jointes}{\setlength{\largeurcards}{\largeurcarte}}{\setlength{\largeurcards}{65mm}}%
+ \ifboolKV[Cards]{Jointes}{\setlength{\hauteurcards}{\hauteurcarte}}{\setlength{\hauteurcards}{95mm}}%
+ \setlength{\margeh}{(210mm-3\largeurcards)/2}%
+ \setlength{\margev}{(297mm-3\hauteurcards)/2}
+ }%
+ \setlength{\hauteurtitre}{\fpeval{\useKV[Cards]{HauteurTheme}}mm}%
+ \setlength{\largeurtitre}{\fpeval{(\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}-9)/2}mm}%
+ \colorlet{TexteCouleur}{black}%
+ \colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}%
+ \colorlet{TrameCouleurAr}{\useKV[Cards]{CouleurAr}}%
+ \setlength{\PfCRayonArc}{\useKV[Cards]{RayonArc}}%
+ \ifboolKV[Cards]{Trivial}{%
+ \CartesTrivial%
+ }{%
+ \ifboolKV[Cards]{JaiQuia}{%
+ \CartesJaiQuia%
}{%
- \CartesClassique%
+ \ifboolKV[Cards]{Loop}{%
+ \CartesLoop%
+ }{%
+ \CartesClassique%
+ }%
}%
}%
}%
@@ -412,10 +723,38 @@
}%
\end{Trame}%
\clearpage%
+ \ifboolKV[Cards]{AffichageSolution}{%
+ \thispagestyle{empty}%
+ \begin{Trame}
+ \multido{\i=1+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxAr}%
+ \end{MyboxAr}%
+ };%
+ }%
+ \multido{\i=4+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxAr}%
+ \end{MyboxAr}%
+ };%
+ }%
+ \multido{\i=7+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxAr}%
+ \end{MyboxAr}%
+ };%
+ }%
+ \end{Trame}%
+ \clearpage%
+ }{}%
}{%
\begin{Mybox}{\ListeCards[1,1]}{\useKV[Cards]{Theme}}{\ListeCards[1,2]}%
\ListeCards[1,3]%
\end{Mybox}%
+ \ifboolKV[Cards]{AffichageSolution}{%
+ \begin{MyboxAr}%
+ \end{MyboxAr}%
+ }{}%
}%
}%
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCibleQOp.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCibleQOp.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCibleQOp.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -0,0 +1,270 @@
+\newcount\anpcqo\newcount\bnpcqo\newcount\cnpcqo%
+
+\NewDocumentCommand\PfCCQODiviseurs{m}{%#1 : le nombre entier \`a tester
+ \xdef\RetiensDiviseurs{}%
+ \xdef\RetiensNonDiviseurs{}%
+ \anpcqo=#1%
+ \bnpcqo=2%
+ \cnpcqo=1%
+ \whiledo{\bnpcqo<\anpcqo}{%
+ \modulo{\the\anpcqo}{\the\bnpcqo}{}%
+ \ifnum\remainder=0\relax
+ \ifnum\cnpcqo=1
+ \xdef\RetiensDiviseurs{\the\bnpcqo}%
+ \else%
+ \xdef\RetiensDiviseurs{\RetiensDiviseurs,\the\bnpcqo}%
+ \fi%
+ \cnpcqo=\numexpr\cnpcqo+1%
+ \else
+ \ifnum\bnpcqo<10
+ \xdef\RetiensNonDiviseurs{\RetiensNonDiviseurs,\the\bnpcqo}%
+ \fi
+ \fi%
+ \bnpcqo=\numexpr\bnpcqo+1%
+ }%
+}%
+
+\newtoks\toklistecibleA%
+\newtoks\toklistecibleab%
+\newtoks\toklisteciblestyle%
+
+\def\UpdatetoksCibleQO#1\nil{\addtotok\toklistecibleA{"#1",}}%
+\def\UpdatetoksCibleQOO#1\nil{\addtotok\toklistecibleab{"#1",}}
+\def\UpdatetoksCibleStyle#1\nil{\addtotok\toklisteciblestyle{"#1"}}%%
+
+\setKVdefault[CibleQO]{Couleur=Crimson,Rayon=2cm,ValeurMin=4,ValeurMax=10,Graines=false,Solution=false,Cibles=false,DivE=false,Style="<->"}%
+\defKV[CibleQO]{Graine=\setKV[CibleQO]{Graines}\PfCGraineAlea{#1}}%
+\defKV[CibleQO]{Cible=\setKV[CibleQO]{Cibles}}%
+\NewDocumentCommand\CibleQuatreOperations{o}{%
+ \useKVdefault[CibleQO]%
+ \setKV[CibleQO]{#1}%
+ \toklistecibleA{}%
+ \toklistecibleab{}%
+ \toklisteciblestyle{}%
+ \expandafter\UpdatetoksCibleStyle\useKV[CibleQO]{Style}\nil
+ %Le style vaut :\the\toklisteciblestyle
+ \colorlet{CouleurCibleQO}{\useKV[CibleQO]{Couleur}}%
+ % On définit le nombre cible aléatoirement ou fixement.
+ \ifboolKV[CibleQO]{Cibles}{%
+ \xdef\PfCCibleQO{\useKV[CibleQO]{Cible}}%
+ }{%
+ \ChoixAlea{\useKV[CibleQO]{ValeurMin}}{\useKV[CibleQO]{ValeurMax}}{\PfCCiblePremierFacteur}%
+ \ChoixAlea{\useKV[CibleQO]{ValeurMin}}{\useKV[CibleQO]{ValeurMax}}{\PfCCibleDeuxiemeFacteur}%
+ \xdef\PfCCibleQO{\fpeval{\PfCCiblePremierFacteur*\PfCCibleDeuxiemeFacteur}}%
+ }%
+ % On définit les opérations : deux additions, deux soustractions, deux "divisions" inversées, deux "divisions" avec éventuellement une division euclidienne.
+ \PfCCQODiviseurs{\PfCCibleQO}%
+ \setsepchar{,}%
+ \readlist*\PfCRetiensDiviseurs{\RetiensDiviseurs}%
+ \ifnum\PfCRetiensDiviseurslen=1\relax%
+ \setKV[CibleQO]{DivE}%
+ \fi
+ \ifboolKV[CibleQO]{DivE}{%
+ \xdef\PfCCQOListeOperations{+,+,-,-,*,*,/,d}%
+ }{%
+ \xdef\PfCCQOListeOperations{+,+,-,-,*,*,/,/}%
+ }%
+ \xdef\PfCCQOListeAdditionUn{2,3,4,5,6,7,8,9}%
+ \xdef\PfCCQOListeAdditionDeux{10,11,12,13,14,15,16,17,18,19}%
+ \xdef\PfCCQOListeMultiplication{2,3,5,9,10}%
+ \xdef\PfCFooQO{\useKV[CibleQO]{ListeOperations}}%
+ \xdef\PfCFooNombres{}%
+ \MelangeListe{\PfCCQOListeAdditionUn}{1}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \MelangeListe{\PfCCQOListeAdditionDeux}{1}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \MelangeListe{\PfCCQOListeAdditionUn}{1}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \MelangeListe{\PfCCQOListeAdditionDeux}{1}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \MelangeListe{\PfCCQOListeMultiplication}{2}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \ifnum\PfCRetiensDiviseurslen=1\relax%carré parfait
+ \xdef\PfCFooNombres{\PfCFooNombres \RetiensDiviseurs,\PfCCibleQO}%
+ \else%
+ \ifnum\PfCRetiensDiviseurslen=2\relax%
+ \xdef\PfCFooNombres{\PfCFooNombres \RetiensDiviseurs}%
+ \else%
+ \MelangeListe{\RetiensDiviseurs}{2}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \fi%
+ \fi%
+ \MelangeListe{\RetiensNonDiviseurs}{1}%
+ \ifnum\PfCRetiensDiviseurslen=1\relax%
+ \xdef\PfCFooNombres{\PfCFooNombres,\faa}%
+ \else%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \fi%
+ %Les nombres choisis sont \PfCFooNombres\\
+ \setsepchar{,}\ignoreemptyitems%
+ \MelangeListe{1,2,3,4,5,6,7,8}{8}%
+ \readlist*\PfCOrdreOperations{\faa}%
+ \readlist*\PfCListeCibleNombres{\PfCFooNombres}%
+ \readlist*\PfCListeCibleOperations{\PfCCQOListeOperations}%
+ % On détermine les solutions
+ \xdef\PfCListeSolution{\fpeval{\PfCCibleQO-\PfCListeCibleNombres[1]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO-\PfCListeCibleNombres[2]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO+\PfCListeCibleNombres[3]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO+\PfCListeCibleNombres[4]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO*\PfCListeCibleNombres[5]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO*\PfCListeCibleNombres[6]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO/\PfCListeCibleNombres[7]}}%
+ \ifboolKV[CibleQO]{DivE}{%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{floor(\PfCCibleQO/\PfCListeCibleNombres[9])}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO-\PfCListeCibleNombres[9]*floor(\PfCCibleQO/\PfCListeCibleNombres[9])}}%
+ }{%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO/\PfCListeCibleNombres[8]}}%
+ }%
+ \readlist*\PfCListeCibleSolutions{\PfCListeSolution}%
+ \xdef\PfCFooRetiensTout{}%
+ \xdef\PfCFooRetiensToutAvecSol{}%
+ \xintFor* ##1 in{\xintSeq{1}{8}}\do{%
+ \xdef\PfCCibleRang{\PfCOrdreOperations[##1]}%
+ \xdef\PfCCibleRang{\PfCCibleRang}%
+ \StrCompare{\PfCListeCibleOperations[\PfCCibleRang]}{*}[\PfCTestEtoile]%
+ \StrCompare{\PfCListeCibleOperations[\PfCCibleRang]}{/}[\PfCTestSlash]%
+ \StrCompare{\PfCListeCibleOperations[\PfCCibleRang]}{d}[\PfCTestDE]%
+ \xintifboolexpr{\PfCTestDE==0}{%
+ \xdef\PfCFooRetiensTout{\PfCFooRetiensTout,$\pointilles[5mm]\times\num{\PfCListeCibleNombres[9]}+\num{\PfCListeCibleSolutions[9]}$}%
+ \xdef\PfCFooRetiensToutAvecSol{\PfCFooRetiensToutAvecSol,$\mathcolor{CouleurCibleQO}{\num{\PfCListeCibleSolutions[8]}}\times\num{\PfCListeCibleNombres[9]}+\num{\PfCListeCibleSolutions[9]}$}%
+ }{%
+ \xdef\PfCFooRetiensTout{\PfCFooRetiensTout,$\pointilles[5mm]\xintifboolexpr{\PfCTestEtoile==0}{\div}{\xintifboolexpr{\PfCTestSlash==0}{\times}{\PfCListeCibleOperations[\PfCCibleRang]}}\num{\PfCListeCibleNombres[\PfCCibleRang]}$}%
+ \xdef\PfCFooRetiensToutAvecSol{\PfCFooRetiensToutAvecSol,$\mathcolor{CouleurCibleQO}{\num{\PfCListeCibleSolutions[\PfCCibleRang]}}\xintifboolexpr{\PfCTestEtoile==0}{\div}{\xintifboolexpr{\PfCTestSlash==0}{\times}{\PfCListeCibleOperations[\PfCCibleRang]}}\num{\PfCListeCibleNombres[\PfCCibleRang]}$}%
+ }%
+ }%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\PfCCibleQOListeEnonce{\PfCFooRetiensTout}%
+ \readlist*\PfCCibleQOListeSolution{\PfCFooRetiensToutAvecSol}%
+ \foreachitem\compteur\in\PfCCibleQOListeEnonce{\expandafter\UpdatetoksCibleQO\compteur\nil}%
+ \foreachitem\compteur\in\PfCCibleQOListeSolution{\expandafter\UpdatetoksCibleQOO\compteur\nil}%
+ \BuildCibleQuatreOperations{\PfCCibleQO}{\the\toklistecibleA}{\the\toklistecibleab}{\useKV[CibleQO]{Style}}%
+}%
+
+\def\BuildCibleQOCode{%
+ vardef LectureOperations(text t)=
+ nbop:=0;
+ for p_=t:
+ Op[nbop]=image(
+ label(TEX(p_),(0,0));
+ );
+ nbop:=nbop+1;
+ endfor;
+ enddef;
+ %
+ vardef LectureOperationsPDF(text t)=
+ nbop:=0;
+ for p_=t:
+ Op[nbop]=image(
+ label(LATEX(p_),(0,0));
+ );
+ nbop:=nbop+1;
+ endfor;
+ enddef;
+ %
+ vardef MelangeListe=
+ for k=0 upto 7:
+ x[k]=k;
+ endfor;
+ nbtest=7;
+ for k=0 upto 7:
+ ll:=floor(uniformdeviate(8-k));
+ y[k]=x[ll];
+ nb:=0;
+ for l=0 upto (7-k):
+ if l<>ll:
+ x[nb]:=x[l];
+ nb:=nb+1;
+ fi;
+ endfor;
+ endfor;
+ enddef;
+}%
+
+\NewDocumentCommand\BuildCibleQuatreOperations{mmmm}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ \BuildCibleQOCode
+ string Style;
+ Style=#4;
+
+ Cible=#1;
+
+ picture Op[];
+
+ Rayon:=\useKV[CibleQO]{Rayon};
+ boolean Solution;
+ Solution=\useKV[CibleQO]{Solution};
+
+ if Solution:
+ LectureOperations(#3)
+ else:
+ LectureOperations(#2)
+ fi;
+
+ path cc;
+ pair O,A[];
+ O=(0,0);
+ picture CIBLE;
+ CIBLE=image(label(TEX("\Huge\bfseries"&decimal(Cible)),O));
+ draw CIBLE;
+ cc=cercles(O,Rayon);
+ path Fleche;
+ for k=0 upto 7:
+ A[k]=1.1[O,pointarc(cc,k*45)];
+ Fleche:=((0,0)--(center Op[k] shifted A[k])) cutbefore cercles(O,0.45*Rayon) cutafter (polygone(llcorner Op[k],lrcorner Op[k],urcorner Op[k],ulcorner Op[k]) shifted A[k]);
+ if Style="<->":
+ drawdblarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche);
+ elseif Style="<-":
+ drawarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche);
+ elseif Style="->":
+ drawarrow (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche);
+ elseif Style="-":
+ draw (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche);
+ elseif Style="--":
+ label(TEX("$=$") rotated (k*45) ,point(0.5*length Fleche) of Fleche);
+ fi;
+ trace Op[k] shifted A[k];
+ endfor;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={\BuildCibleQOCode;Rayon:=\useKV[CibleQO]{Rayon};boolean Solution;Solution=\useKV[CibleQO]{Solution};}]
+ string Style;
+ Style=#4;
+ Cible=#1;
+
+ picture Op[];
+
+ if Solution:
+ LectureOperationsPDF(#3)
+ else:
+ LectureOperationsPDF(#2)
+ fi;
+
+ path cc;
+ pair O,A[];
+ O=(0,0);
+ picture CIBLE;
+ CIBLE=image(label(LATEX("\Huge\bfseries"&decimal(Cible)),O));
+ draw CIBLE;
+ cc=cercles(O,Rayon);
+ path Fleche;
+ for k=0 upto 7:
+ A[k]=1.1[O,pointarc(cc,k*45)];
+ Fleche:=((0,0)--(center Op[k] shifted A[k])) cutbefore cercles(O,0.45*Rayon) cutafter (polygone(llcorner Op[k],lrcorner Op[k],urcorner Op[k],ulcorner Op[k]) shifted A[k]);
+ if Style="<->":
+ drawdblarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche);
+ elseif Style="<-":
+ drawarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche);
+ elseif Style="->":
+ drawarrow (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche);
+ elseif Style="-":
+ draw (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche);
+ elseif Style="--":
+ label(LATEX("$=$") rotated (k*45) ,point(0.5*length Fleche) of Fleche);
+ fi;
+ trace Op[k] shifted A[k];
+ endfor;
+ \end{mpost}
+ \fi%
+}%
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCibleQOp.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCryptarithme.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCCryptarithme.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCCryptarithme.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -0,0 +1,110 @@
+%%%
+% Cryptarithmes
+%%%
+\setKVdefault[Crypta]{Solution=false,ListeLettres={A,B,C,D,E,F,G,H,I,J},Tableau=false}%
+\defKV[Crypta]{Indices=\setKV[Crypta]{Tableau}}%
+
+\colorlet{PfCCouleurVirgule}{black}
+
+\NewDocumentCommand\PfCRemplaceLettre{m}{%
+ \IfStrEqCase{#1}{%
+ {0}{\PfCCryptaListe[1]}%
+ {1}{\PfCCryptaListe[2]}%
+ {2}{\PfCCryptaListe[3]}%
+ {3}{\PfCCryptaListe[4]}%
+ {4}{\PfCCryptaListe[5]}%
+ {5}{\PfCCryptaListe[6]}%
+ {6}{\PfCCryptaListe[7]}%
+ {7}{\PfCCryptaListe[8]}%
+ {8}{\PfCCryptaListe[9]}%
+ {9}{\PfCCryptaListe[10]}%
+ }%
+}%
+
+\NewDocumentCommand\PfCchiffrecrypta{m}{%
+ \ifboolKV[Crypta]{Solution}{#1}{\PfCRemplaceLettre{#1}}%
+}%
+
+\NewDocumentCommand\PfCCryptaTestIndice{m}{%
+ \xintFor* ##1 in{\xintSeq{1}{\PfCCryptaListeIndicelen}}\do{%
+ \xintifboolexpr{\PfCCryptaListeIndice[##1]==#1}{\PfCRemplaceLettre{#1}\xintBreakFor}{}%
+ }%
+}%
+
+\NewDocumentCommand\BuildCryptaTab{}{%
+ \xdef\PfCFooCryptaIndices{\useKV[Crypta]{Indices}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListeIndice{\PfCFooCryptaIndices}%
+ \begin{tabular}{|*{10}{c|}}
+ \hline
+ 0&1&2&3&4&5&6&7&8&9\\
+ \hline
+ \PfCCryptaTestIndice{0}&\PfCCryptaTestIndice{1}&\PfCCryptaTestIndice{2}&\PfCCryptaTestIndice{3}&\PfCCryptaTestIndice{4}&\PfCCryptaTestIndice{5}&\PfCCryptaTestIndice{6}&\PfCCryptaTestIndice{7}&\PfCCryptaTestIndice{8}&\PfCCryptaTestIndice{9}\\%
+ \hline
+ \end{tabular}
+}%
+
+\NewDocumentCommand\CryptarithmeAdd{omm}{%
+ \useKVdefault[Crypta]%
+ \setKV[Crypta]{#1}%
+ \xdef\PfCFooCryptaListe{\useKV[Crypta]{ListeLettres}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListe{\PfCFooCryptaListe}%
+ \ifboolKV[Crypta]{Solution}{\opset{carryadd}}{\opset{carryadd=false}}%
+ \begingroup
+ \setlength{\baselineskip}{1.75em}
+ \opset{lineheight=\baselineskip} % nécessaire
+ \opadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,operandstyle=\PfCchiffrecrypta,resultstyle=\PfCchiffrecrypta,operandstyle.1.d=\color{PfCCouleurVirgule},operandstyle.2.d=\color{PfCCouleurVirgule},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \endgroup
+ \ifboolKV[Crypta]{Tableau}{\\\BuildCryptaTab}{}%
+}%
+
+\NewDocumentCommand\CryptarithmeMAdd{om}{%
+ \useKVdefault[Crypta]%
+ \setKV[Crypta]{#1}%
+ \xdef\PfCFooCryptaListe{\useKV[Crypta]{ListeLettres}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListe{\PfCFooCryptaListe}%
+ \ifboolKV[Crypta]{Solution}{\opset{carryadd}}{\opset{carryadd=false}}%
+ \opmanyadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,vmanyoperator=bottom,operandstyle=\PfCchiffrecrypta,resultstyle=\PfCchiffrecrypta,resultstyle.d=\color{PfCCouleurVirgule}]#2%
+ \ifboolKV[Crypta]{Tableau}{\\\BuildCryptaTab}{}%
+}%
+
+\NewDocumentCommand\CryptarithmeSous{omm}{%
+ \useKVdefault[Crypta]%
+ \setKV[Crypta]{#1}%
+ \xdef\PfCFooCryptaListe{\useKV[Crypta]{ListeLettres}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListe{\PfCFooCryptaListe}%
+ \ifboolKV[Crypta]{Solution}{\opset{carrysub}}{\opset{carrysub=false}}%
+ \begingroup
+ \setlength{\baselineskip}{1.75em}
+ \opset{lineheight=\baselineskip} % nécessaire
+ \opsub[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,operandstyle=\PfCchiffrecrypta,resultstyle=\PfCchiffrecrypta,operandstyle.1.d=\color{PfCCouleurVirgule},operandstyle.2.d=\color{PfCCouleurVirgule},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \endgroup
+ \ifboolKV[Crypta]{Tableau}{\\\BuildCryptaTab}{}%
+}%
+
+\NewDocumentCommand\CryptarithmeMul{omm}{%
+ \useKVdefault[Crypta]%
+ \setKV[Crypta]{#1}%
+ \xdef\PfCFooCryptaListe{\useKV[Crypta]{ListeLettres}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListe{\PfCFooCryptaListe}%
+ \begingroup
+ \setlength{\baselineskip}{1.75em}
+ \opset{lineheight=\baselineskip} % nécessaire
+ \opmul[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,operandstyle=\PfCchiffrecrypta,intermediarystyle=\PfCchiffrecrypta,resultstyle=\PfCchiffrecrypta,operandstyle.1.d=\color{PfCCouleurVirgule},operandstyle.2.d=\color{PfCCouleurVirgule},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \endgroup
+ \ifboolKV[Crypta]{Tableau}{\\\BuildCryptaTab}{}%
+}%
+
+\NewDocumentCommand\CryptarithmeDiv{omm}{%
+ \useKVdefault[Crypta]%
+ \setKV[Crypta]{#1}%
+ \xdef\PfCFooCryptaListe{\useKV[Crypta]{ListeLettres}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListe{\PfCFooCryptaListe}%
+ \opidiv[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,displayintermediary=all,operandstyle=\PfCchiffrecrypta,intermediarystyle=\PfCchiffrecrypta,remainderstyle=\PfCchiffrecrypta,resultstyle=\PfCchiffrecrypta,operandstyle.1.d=\color{PfCCouleurVirgule},operandstyle.2.d=\color{PfCCouleurVirgule},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \ifboolKV[Crypta]{Tableau}{\\\BuildCryptaTab}{}%
+}%
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCCryptarithme.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecDeci.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecDeci.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCDecDeci.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -70,7 +70,7 @@
\xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
\StrChar{#2}{##1}[\PfCNombreChiffre]
\modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
- \colorlet{oldcolor}{.}
+ \colorlet{oldcolor}{black}
\xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}}{%
\xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurC}}}{%
\color{\useKV[DecompDeci]{CouleurD}}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCDefiTables.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCDefiTables.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCDefiTables.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -2,7 +2,7 @@
% Defi Table
%%%
-\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm,Graines=false,Creation=false,ValeurMin=1,ValeurMax=10}
+\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm,Graines=false,Creation=false,ValeurMin=1,ValeurMax=10,Restreint=false}
\defKV[DefiTable]{Graine=\setKV[DefiTable]{Graines}}%
\newcommand\MelangeListeNew[2]{%
@@ -130,8 +130,24 @@
\setKV[DefiTable]{#1}%
\ifboolKV[DefiTable]{Creation}{%
\ifboolKV[DefiTable]{Graines}{\PfCGraineAlea{\useKV[DefiTable]{Graine}}}{}%
- \DefiTableNombreLettreduCode{#2}%
- \begin{center}
+ \DefiTableNombreLettreduCode{#2}%
+ \ifboolKV[DefiTable]{Restreint}{%
+ \xdef\PfCNbColonnes{\fpeval{\useKV[DefiTable]{ValeurMax}-\useKV[DefiTable]{ValeurMin}+1}}%
+ \begin{tabular}{|>{\columncolor{gray!15}}c|*{\PfCNbColonnes}{c|}}
+ \hline
+ \rowcolor{gray!15}$\times$&\xintFor* ##1 in {\xintSeq {1}{\PfCNbColonnes}}\do{%
+ \xintifForFirst{}{&}\fpeval{\useKV[DefiTable]{ValeurMin}+##1-1}%
+ }\\\hline%
+ \xintFor* ##1 in{\xintSeq{1}{10}}\do{%
+ ##1\xintFor* ##2 in{\xintSeq{\useKV[DefiTable]{ValeurMin}}{\useKV[DefiTable]{ValeurMax}}}\do{%
+ &\xintFor* ##3 in{\xintSeq{1}{\NombreDeProduitATester}}\do{%
+ \xintifboolexpr{\fpeval{##1*##2}==\ListeDesProduits[##3] 'and' any(\useKV[DefiTable]{ValeurMin}<=##2<=\useKV[DefiTable]{ValeurMax},\useKV[DefiTable]{ValeurMin}<=##1<=\useKV[DefiTable]{ValeurMax})}{\ListeFinaleDesCaracteres[##3]}{}%
+ }%
+ }\\\hline%
+ }%
+ \end{tabular}%
+ }{%
+% \begin{center}
\begin{tabular}{|>{\columncolor{gray!15}}c|*{10}{c|}}
\hline
\rowcolor{gray!15}$\times$&\xintFor* ##1 in {\xintSeq {1}{10}}\do{%
@@ -145,7 +161,8 @@
}\\\hline%
}%
\end{tabular}%
- \end{center}
+% \end{center}
+ }
}{%
\setsepchar[*]{§* }%
\readlist*\ListeDefiTableCode{#2}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcrireunQCM.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,7 +1,7 @@
%%%
% QCM
%%%
-\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=2cm,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}}%
+\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}}%
\newlength{\LargeurQCM}%
\newlength{\PfCLargeurQCM}%
\newcounter{QuestionQCM}%
@@ -56,9 +56,7 @@
\hline%
\end{tabular}
}{%
- %\renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
- \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
- %\xdef\NBcases{\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{%
@@ -68,7 +66,7 @@
\hline%
\xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
\stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\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{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}\xintifboolexpr{##2==\ListeQCM[##1,\NumeroReponse]}{\cellcolor{\useKV[ClesQCM]{Couleur}}}{}}{}\ListeQCM[##1,##2+1]%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,##2+1]%
}\\
}%
\hline%
@@ -109,7 +107,6 @@
}{%
\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}}%
@@ -125,9 +122,8 @@
\hline%
\end{tabular}
}{%
- %\renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
- \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
- %\xdef\NBcases{\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{%
@@ -137,7 +133,7 @@
\hline%
\xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
\stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\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{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}\xintifboolexpr{##2==\ListeQCM[##1,\NumeroReponse]}{\cellcolor{\useKV[ClesQCM]{Couleur}}}{}}{}\ListeQCM[##1,##2+1]%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,\fpeval{##2+1}]%
}\\
}%
\hline%
@@ -146,4 +142,14 @@
}%
\renewcommand{\arraystretch}{1}%
}%
-}%
\ No newline at end of file
+}%
+
+\NewDocumentCommand\PfCSolCellColor{mm}{%
+ \xdef\PfCFooSolColor{\ListeQCM[#1,\NumeroReponse]}%
+ \setsepchar{-}%
+ \readlist*\PfCSolListeReponses{\PfCFooSolColor}%
+ \xintFor* ##3 in{\xintSeq{1}{\PfCSolListeReponseslen}}\do{%
+ \xintifboolexpr{#2==\PfCSolListeReponses[##3]}{\cellcolor{\useKV[ClesQCM]{Couleur}}}{}%
+ }%
+}%
+
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,7 +1,7 @@
%%%
% Ecritures d'unit\'es
%%%
-\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,mmin=false,kmh=true,kms=false,ms=false,mh=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false,Nombre,US=false,UK=false}%
+\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,mmin=false,kmh=true,kms=false,ms=false,mh=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false,Nombre,US=false,UK=false,Precision=2}%
\defKV[Unites]{Dots=\setKV[Unites]{Nombre=false}}%
\newlength{\PfCLgUnites}
@@ -28,8 +28,8 @@
\SI{#1}{\annee\xintifboolexpr{#1>1}{s}{}}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\annee(s)}}%
- \IfNoValueF {#2}{\,}%
+ \pointilles[\PfCLgUnites]~\si{\annee(s)}}%
+ \IfNoValueF {#2}{~}%
}%
}%
\IfNoValueF {#2}%
@@ -40,8 +40,8 @@
\SI{#2}{\mois}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\mois}}%
- \IfNoValueF{#3}{\,}%
+ \pointilles[\PfCLgUnites]~\si{\mois}}%
+ \IfNoValueF{#3}{~}%
}%
}%
\IfNoValueF {#3}%
@@ -52,8 +52,8 @@
\SI{#3}{\jour}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\jour}}%
- \IfNoValueF{#4}{\,}%
+ \pointilles[\PfCLgUnites]~\si{\jour}}%
+ \IfNoValueF{#4}{~}%
}%
}%
\IfNoValueF {#4}%
@@ -64,8 +64,8 @@
\SI{#4}{\hour}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\hour}}%
- \IfNoValueF{#5}{\,}%
+ \pointilles[\PfCLgUnites]~\si{\hour}}%
+ \IfNoValueF{#5}{~}%
}%
}%
\IfNoValueF {#5}%
@@ -73,11 +73,11 @@
\tl_if_blank:nF {#5}%
{%
\ifboolKV[Unites]{Nombre}{%
- \SI[minimum-integer-digits=2]{#5}{\minute}%
+ \SI{#5}{\minute}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\minute}}%
- \IfNoValueF{#6}{\,}%
+ \pointilles[\PfCLgUnites]~\si{\minute}}%
+ \IfNoValueF{#6}{~}%
}%
}%
\IfNoValueF {#6}%
@@ -86,10 +86,57 @@
\ifboolKV[Unites]{Nombre}{%
\SI{#6}{\second}}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\second}}%
+ \pointilles[\PfCLgUnites]~\si{\second}}%
}%
}%
}%
+
+\NewDocumentCommand \Horaire {o o > { \SplitArgument { 2 } { ; } } m }
+{%
+ \useKVdefault[Unites]%
+ \setKV[Unites]{#1}
+ \group_begin:%
+ \IfNoValueF{#2}
+ { \keys_set:nn { siunitx } {#2} }
+ \siunitx_horaire_output:nnn #3
+ \group_end:
+}
+\cs_new_protected:Npn \siunitx_horaire_output:nnn #1#2#3
+{%
+ \IfNoValueF {#1}%
+ {%
+ \tl_if_blank:nF {#1}%
+ {%
+ \ifboolKV[Unites]{Nombre}{%
+ \SI{#1}{\hour}%
+ }{%
+ \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
+ \pointilles[\PfCLgUnites]~\si{\hour}}%
+ \IfNoValueF{#2}{~}%
+ }%
+ }%
+ \IfNoValueF {#2}%
+ {%
+ \tl_if_blank:nF {#2}%
+ {%
+ \ifboolKV[Unites]{Nombre}{%
+ \SI[minimum-integer-digits=2]{#2}{\minute}%
+ }{%
+ \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
+ \pointilles[\PfCLgUnites]~\si{\minute}}%
+ \IfNoValueF{#3}{~}%
+ }%
+ }%
+ \IfNoValueF {#3}%
+ {%
+ \tl_if_blank:nF {#3} {%
+ \ifboolKV[Unites]{Nombre}{%
+ \SI{#3}{\second}}{%
+ \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
+ \pointilles[\PfCLgUnites]~\si{\second}}%
+ }%
+ }%
+}%
\ExplSyntaxOff
\NewDocumentCommand\Temp{o m}{%
@@ -108,7 +155,7 @@
\SI{#2}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
@@ -119,7 +166,7 @@
\SI{#2}{\kWh}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\kWh}%
+ \pointilles[\PfCLgUnites]~\si{\kWh}%
}%
}%
@@ -135,7 +182,7 @@
% \SI[round-mode=places,round-precision=#2]{#3}{\EuRo}%
% }{%
% \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}
-% \pointilles[\PfCLgUnites]\,\si{\EuRo}%
+% \pointilles[\PfCLgUnites]~\si{\EuRo}%
% }%
%}%
@@ -155,11 +202,11 @@
\IfInteger{#2}{%
\SI{#2}{\Tempo}%
}{%
- \SI[round-mode=places,round-precision=2]{#2}{\Tempo}%
+ \SI[round-mode=places,round-precision=\useKV[Unites]{Precision}]{#2}{\Tempo}%
}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
@@ -187,7 +234,7 @@
\SI{#2}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
@@ -232,7 +279,7 @@
\SI[parse-numbers=false]{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}{%
\ifboolKV[Unites]{Nombre}{%
@@ -239,7 +286,7 @@
\SI{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
}%
@@ -285,7 +332,7 @@
\SI[parse-numbers=false]{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}{%
\ifboolKV[Unites]{Nombre}{%
@@ -292,9 +339,9 @@
\SI{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
- }
+ }%
}%
\NewDocumentCommand\Capa{s o m}{%
@@ -325,7 +372,7 @@
\SI[parse-numbers=false]{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}{%
\ifboolKV[Unites]{Nombre}{%
@@ -332,7 +379,7 @@
\SI{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
}%
@@ -386,7 +433,7 @@
\SI[parse-numbers=false]{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}{%
\ifboolKV[Unites]{Nombre}{%
@@ -393,7 +440,7 @@
\SI{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
}%
@@ -439,7 +486,7 @@
\SI[parse-numbers=false]{#3}{\cubic\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\cubic\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\cubic\Tempo}%
}%
}{%
\ifboolKV[Unites]{Nombre}{%
@@ -446,7 +493,7 @@
\SI{#3}{\cubic\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\cubic\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\cubic\Tempo}%
}%
}%
}%
@@ -475,7 +522,7 @@
\SI[per-mode=symbol]{#2}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si[per-mode=symbol]{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si[per-mode=symbol]{\Tempo}%
}%
}%
@@ -491,6 +538,6 @@
\SI[per-mode=symbol]{#2}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si[per-mode=symbol]{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si[per-mode=symbol]{\Tempo}%
}%
}%
\ No newline at end of file
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEratosthene.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCEratosthene.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCEratosthene.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -0,0 +1,80 @@
+\setKVdefault[ClesEra]{Premier=false,Nombre=1,CouleurP=Cornsilk!50,CouleurNP=Crimson!15,Colonnes=10,Lignes=10,Hauteur=24pt}
+
+\NewDocumentCommand\TestPremier{m}{%
+ % #1 le nombre premier \`a tester
+ \newcount\anp\newcount\bnp\newcount\cnp%
+ \anp=#1\relax
+ \bnp=2\relax
+ \premier=-1\relax
+ % Pour d\'eterminer le nombre d'\'etapes
+ \whiledo{\anp > 1}{%
+ \modulo{\the\anp}{\the\bnp}
+ \ifnum\remainder=0\relax
+ \global\premier=\numexpr\premier+1\relax
+ \cnp=\numexpr\anp/\bnp\relax
+ \anp=\cnp\relax
+ \else%
+ \bnp=\numexpr\bnp+1\relax%
+ \fi%
+ }%
+ \ifnum\premier=0%
+ \setKV[ClesEra]{Premier=true}%
+ \else
+ \setKV[ClesEra]{Premier=false}%
+ \fi%
+}%
+
+\newlength{\PfCEraHauteur}
+
+\NewDocumentCommand\Eratosthene{o}{%
+ \useKVdefault[ClesEra]
+ \setKV[ClesEra]{#1}
+ \setlength{\PfCEraHauteur}{\useKV[ClesEra]{Hauteur}}%
+ \xdef\PfCEraMax{\fpeval{\useKV[ClesEra]{Lignes}*\useKV[ClesEra]{Colonnes}}}%
+ \colorlet{PfCCouleurPremier}{\useKV[ClesEra]{CouleurP}}
+ \colorlet{PfCCouleurPasPremier}{\useKV[ClesEra]{CouleurNP}}
+ \begin{NiceTabular}{*{\useKV[ClesEra]{Colonnes}}{m{\PfCEraHauteur-\tabcolsep}}}[hvlines]
+ \CodeBefore
+ \tikz\draw[fill,PfCCouleurPasPremier] (1-|1) rectangle (2-|2);
+ \xintifboolexpr{\useKV[ClesEra]{Nombre}>1}{%
+ \xintFor* ##3 in{\xintSeq{2}{\useKV[ClesEra]{Nombre}}}\do{%
+ \TestPremier{##3}
+ \ifboolKV[ClesEra]{Premier}{%
+ % on positionne le nombre premier
+ \xdef\PfCEraLigneA{\fpeval{floor(##3/\useKV[ClesEra]{Colonnes})+1}}%
+ \xdef\PfCEraLigneB{\fpeval{floor(##3/\useKV[ClesEra]{Colonnes})+2}}%
+ \xdef\PfCEraLigneC{\fpeval{floor(##3/\useKV[ClesEra]{Colonnes})}}%
+ \xdef\PfCEraColonneA{\fpeval{##3-\useKV[ClesEra]{Colonnes}*floor(##3/\useKV[ClesEra]{Colonnes})}}
+ \xdef\PfCEraColonneB{\fpeval{##3-\useKV[ClesEra]{Colonnes}*floor(##3/\useKV[ClesEra]{Colonnes})+1}}
+ \xintifboolexpr{\PfCEraColonneA==0}{%
+ \tikz\draw[fill,PfCCouleurPremier] (\PfCEraLigneC-|\useKV[ClesEra]{Colonnes}) rectangle (\PfCEraLigneA-|\fpeval{\useKV[ClesEra]{Colonnes}+1});
+ }{%
+ \tikz\draw[fill,PfCCouleurPremier] (\PfCEraLigneA-|\PfCEraColonneA) rectangle (\PfCEraLigneB-|\PfCEraColonneB);
+ }%
+ %On positionne ses multiples
+ \xintFor* ##4 in{\xintSeq{2}{\fpeval{floor(\PfCEraMax/##3)}}}\do{%
+ \xintifboolexpr{##3>\fpeval{floor(sqrt(\PfCEraMax))}}{\xintBreakFor}{%
+ \xdef\PfCEraLigneA{\fpeval{floor(##3*##4/\useKV[ClesEra]{Colonnes})+1}}%
+ \xdef\PfCEraLigneB{\fpeval{floor(##3*##4/\useKV[ClesEra]{Colonnes})+2}}%
+ \xdef\PfCEraLigneC{\fpeval{floor(##3*##4/\useKV[ClesEra]{Colonnes})}}%
+ \xdef\PfCEraColonneA{\fpeval{##3*##4-\useKV[ClesEra]{Colonnes}*floor(##3*##4/\useKV[ClesEra]{Colonnes})}}
+ \xdef\PfCEraColonneB{\fpeval{##3*##4-\useKV[ClesEra]{Colonnes}*floor(##3*##4/\useKV[ClesEra]{Colonnes})+1}}
+ \xintifboolexpr{\PfCEraColonneA==0}{%
+ \tikz\draw[fill,PfCCouleurPasPremier] (\PfCEraLigneC-|\useKV[ClesEra]{Colonnes}) rectangle (\PfCEraLigneA-|\fpeval{\useKV[ClesEra]{Colonnes}+1});
+ }{%
+ \tikz\draw[fill,PfCCouleurPasPremier] (\PfCEraLigneA-|\PfCEraColonneA) rectangle (\PfCEraLigneB-|\PfCEraColonneB);
+ }%
+ }%
+ }%
+ }{%Le nombre choisi n'est pas un nombre premier, ses multiples ont déjà étaient criblés.
+ }%
+ }%
+ }%
+ \Body
+ \xintFor* ##1 in{\xintSeq{0}{\fpeval{\useKV[ClesEra]{Lignes}-1}}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\useKV[ClesEra]{Colonnes}}}\do{%
+ \xintifForFirst{\rule{0pt}{\PfCEraHauteur}}{&}\Block{1-1}{\fpeval{##2+##1*\useKV[ClesEra]{Colonnes}}}
+ }\\
+ }%
+ \end{NiceTabular}
+}%
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCEratosthene.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCFactorisation.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCFactorisation.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCFactorisation.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -29,7 +29,7 @@
}%
\NewDocumentCommand\Factorisation{sommm}{%
- \directlua{dofile('poly_render_fix.lua')}
+% \directlua{dofile('poly_render_fix.lua')}
\useKVdefault[Facto]%
\setKV[Facto]{#2}%
\colorlet{Csymbole}{\useKV[Facto]{Couleur}}%
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCFubuki.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCFubuki.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCFubuki.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -0,0 +1,70 @@
+\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}}%
+\defKV[Fubuki]{CouleurSolution=\setKV[Fubuki]{Solution}\colorlet{PfCFubukiCouleurSolution}{#1}}%
+\newlength\PfCFubuki%
+
+\NewDocumentCommand\PfCFubukiTestIndice{m}{%
+ \ifboolKV[Fubuki]{Indice}{%
+ \xdef\PfCRetiensIndice{0}%
+ \xintFor* ##1 in {\xintSeq{1}{\PfCFubukiListeIndiceslen}}\do{%
+ \xintifboolexpr{#1==\PfCFubukiListeIndices[##1]}{\xdef\PfCRetiensIndice{\fpeval{\PfCRetiensIndice+1}}}{}%
+ }%
+ \xintifboolexpr{\PfCRetiensIndice>0}{#1}{\ifboolKV[Fubuki]{Solution}{\color{PfCFubukiCouleurSolution}#1}{}}%
+ }{%
+ \ifboolKV[Fubuki]{Solution}{\color{PfCFubukiCouleurSolution}#1}{}%
+ }%
+}%
+
+\NewDocumentCommand\PfCFubukiAffichageNombre{m}{%
+ \ifboolKV[Fubuki]{Vierge}{}{\ifboolKV[Fubuki]{Sommes}{\PfCFubukiNombre[#1]}{\PfCFubukiTestIndice{\PfCFubukiNombre[#1]}}}%
+}%
+
+\NewDocumentCommand\PfCFubukiAffichageSommeH{m}{%
+ \ifboolKV[Fubuki]{Vierge}{}{%
+ \ifboolKV[Fubuki]{Sommes}{%
+ \ifboolKV[Fubuki]{Solution}{%
+ \color{PfCFubukiCouleurSolution}\fpeval{\PfCFubukiNombre[#1]+\PfCFubukiNombre[\fpeval{#1+1}]+\PfCFubukiNombre[\fpeval{#1+2}]}%
+ }{}%
+ }{\fpeval{\PfCFubukiNombre[#1]+\PfCFubukiNombre[\fpeval{#1+1}]+\PfCFubukiNombre[\fpeval{#1+2}]}}%
+ }%
+}%
+
+\NewDocumentCommand\PfCFubukiAffichageSommeV{m}{%
+ \ifboolKV[Fubuki]{Vierge}{}{%
+ \ifboolKV[Fubuki]{Sommes}{%
+ \ifboolKV[Fubuki]{Solution}{%
+ \color{PfCFubukiCouleurSolution}\fpeval{\PfCFubukiNombre[#1]+\PfCFubukiNombre[\fpeval{#1+3}]+\PfCFubukiNombre[\fpeval{#1+6}]}%
+ }{}%
+ }{\fpeval{\PfCFubukiNombre[#1]+\PfCFubukiNombre[\fpeval{#1+3}]+\PfCFubukiNombre[\fpeval{#1+6}]}}%
+ }%
+}%
+
+\NewDocumentCommand\Fubuki{om}{%
+ \useKVdefault[Fubuki]%
+ \setKV[Fubuki]{#1}%
+ \colorlet{PfCFubukiCouleur}{\useKV[Fubuki]{Couleur}}%
+ \ifboolKV[Fubuki]{Indice}{%
+ \setsepchar{,}%
+ \readlist*\PfCFubukiListeIndices{\PfCFooListeIndices}%
+% \showitems\PfCFubukiListeIndices[]
+ }{}%
+ \ifboolKV[Fubuki]{Perso}{%
+ \xdef\PfCFooListeNombres{#2}%
+ \setsepchar{,}%
+ \readlist*\PfCFubukiNombre{\PfCFooListeNombres}%
+ }{%
+ \xdef\PfCFooListeNombres{1,2,3,4,5,6,7,8,9}%
+ \MelangeListe{\PfCFooListeNombres}{9}%
+ \setsepchar{,}%
+ \readlist*\PfCFubukiNombre{\faa}%
+ }%
+% \showitems\PfCFubukiNombre[]%
+ \setlength{\PfCFubuki}{\useKV[Fubuki]{Largeur}+\tabcolsep}%
+ \begin{NiceTabular}{*{4}{m{\useKV[Fubuki]{Largeur}}}}[corners=SE,hvlines]
+ \rule{0pt}{\PfCFubuki}\Block{}{\PfCFubukiAffichageNombre{1}}&\Block{}{\PfCFubukiAffichageNombre{2}}&\Block{}{\PfCFubukiAffichageNombre{3}}&\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeH{1}}\\
+ \rule{0pt}{\PfCFubuki}\Block{}{\PfCFubukiAffichageNombre{4}}&\Block{}{\PfCFubukiAffichageNombre{5}}&\Block{}{\PfCFubukiAffichageNombre{6}}&\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeH{4}}\\
+ \rule{0pt}{\PfCFubuki}\Block{}{\PfCFubukiAffichageNombre{7}}&\Block{}{\PfCFubukiAffichageNombre{8}}&\Block{}{\PfCFubukiAffichageNombre{9}}&\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeH{7}}\\
+ \rule{0pt}{\PfCFubuki}\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeV{1}}&\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeV{2}}&\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeV{3}}\\
+ \end{NiceTabular}
+}%
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCFubuki.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCGeometrie.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCGeometrie.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCGeometrie.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -7,7 +7,7 @@
\NewDocumentEnvironment{Geometrie}{o +b}{%
\useKVdefault[Geometrie]%
\setKV[Geometrie]{#1}%
- \mplibforcehmode
+ \mplibforcehmode%
\begin{mplibcode}
% input PfCMPFr;
pair Coinbg,Coinhd;
@@ -35,7 +35,7 @@
\NewDocumentEnvironment{Geometrie}{o +b}{%
\useKVdefault[Geometrie]%
\setKV[Geometrie]{#1}%
- \begin{mpost}[mpsettings={
+ \begin{mpost}[mpsettings={%
pair Coinbg,Coinhd;
Coinbg=\useKV[Geometrie]{CoinBG};
Coinhd=\useKV[Geometrie]{CoinHD};
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCJeuRangement.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCJeuRangement.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCJeuRangement.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,4 +1,4 @@
-\setKVdefault[JeuRgt]{Creation=false,Deno=12,Graines=false,Largeur=15pt,Hauteur=20pt,Negatif=false,Decimaux=false,Solution=false}
+\setKVdefault[JeuRgt]{Creation=false,Deno=12,Graines=false,Largeur=15pt,Hauteur=20pt,Negatif=false,Decimaux=false,Solution=false,ValeurMin=2,ValeurMax=50}
\defKV[JeuRgt]{Graine=\setKV[JeuRgt]{Graines}}%
\newlength{\PfCJeuRgtH}
@@ -23,14 +23,14 @@
\xdef\ListeDesChoix{}%
\ifboolKV[JeuRgt]{Negatif}{%
\xdef\ListeDesChoix{-1}%
- \xintFor* ##1 in{\xintSeq{2}{50}}\do{%
+ \xintFor* ##1 in{\xintSeq{\useKV[JeuRgt]{ValeurMin}}{\useKV[JeuRgt]{ValeurMax}}}\do{%
\xdef\ListeDesChoix{\ListeDesChoix,-##1}%
}%
- \xintFor* ##1 in{\xintSeq{2}{50}}\do{%
+ \xintFor* ##1 in{\xintSeq{\useKV[JeuRgt]{ValeurMin}}{\useKV[JeuRgt]{ValeurMax}}}\do{%
\xdef\ListeDesChoix{\ListeDesChoix,##1}%
}%
}{%
- \xintFor* ##1 in{\xintSeq{2}{100}}\do{%
+ \xintFor* ##1 in{\xintSeq{\useKV[JeuRgt]{ValeurMin}}{\useKV[JeuRgt]{ValeurMax}}}\do{%
\xdef\ListeDesChoix{\ListeDesChoix,##1}%
}%
}%
@@ -64,10 +64,10 @@
% \xdef\Compteur{\ListeCompteursMelanges[\Lettrecnt]}
% \ListeDesLettres[\Compteur] -- \ListeDesNombres[\Compteur]\\
% }%
- % \begin{center}
- \begin{NiceTabular}{*{\LongueurMot}{m{\useKV[JeuRgt]{Largeur}}}}[vlines]%
- \hline
- \rule{0pt}{\PfCJeuRgtH}\xintFor* ##1 in{\xintSeq{1}{\LongueurMot}}\do{%
+ \begin{center}
+ \begin{NiceTabular}{*{\LongueurMot}{m{\useKV[JeuRgt]{Largeur}}}}[vlines]%
+ \hline
+ \rule{0pt}{\PfCJeuRgtH}\xintFor* ##1 in{\xintSeq{1}{\LongueurMot}}\do{%
\xintifForFirst{}{&}\Block{}{\xdef\Compteur{\ListeCompteursMelanges[##1]}\ListeDesLettres[\Compteur]}%
}%
\\
@@ -101,5 +101,5 @@
}{}%
\hline
\end{NiceTabular}
- % \end{center}
+\end{center}
}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCLabyrintheNombre.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCLabyrintheNombre.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCLabyrintheNombre.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -6,7 +6,7 @@
\defKV[ClesLabyNb]{XArrivee=\setKV[ClesLabyNb]{XArrivees}\setKV[ClesLabyNb]{ArriveeX=#1}}
\defKV[ClesLabyNb]{YArrivee=\setKV[ClesLabyNb]{YArrivees}\setKV[ClesLabyNb]{ArriveeY=#1}}
-\newcommand\LabyNombre[1][]{%
+\NewDocumentCommand\LabyNombre{o}{%
\useKVdefault[ClesLabyNb]%
\setKV[ClesLabyNb]{#1}%
\ifboolKV[ClesLabyNb]{XArrivees}{}{\setKV[ClesLabyNb]{ArriveeX=\fpeval{\useKV[ClesLabyNb]{Longueur}-1}}}
Added: trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulJap.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulJap.tex (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulJap.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -0,0 +1,232 @@
+%%%
+% Multiplication Japonaise
+%%%
+\setKVdefault[MulJap]{Couleur=Orange,Bloc=false,DessinSeul=false}
+\defKV[MulJap]{CouleurBloc=\setKV[MulJap]{Bloc}}
+
+\newtoks\toksmuljap%
+\def\UpdatetoksMulJap#1\nil{\addtotok\toksmuljap{"#1",#1,}}%
+
+\NewDocumentCommand\MulJaponaise{om}{%
+ \useKVdefault[MulJap]%
+ \setKV[MulJap]{#1}%
+ \setsepchar{x}\ignoreemptyitems%
+ \readlist*\PfCMulJap{#2}%
+ \toksmuljap{}%
+ \foreachitem\compteur\in\PfCMulJap{\expandafter\UpdatetoksMulJap\compteur\nil}%
+ \BuildMulJap{\the\toksmuljap}%
+}%
+
+\NewDocumentCommand\BuildMulJap{m}{%
+ \ifluatex
+ \mplibforcehmode
+ \mplibnumbersystem{double}
+ \begin{mplibcode}
+ boolean Bloc,DessinSeul;
+ Bloc=\useKV[MulJap]{Bloc};
+ if Bloc:
+ color CouleurBloc;
+ CouleurBloc=\useKV[MulJap]{CouleurBloc};
+ fi;
+ DessinSeul=\useKV[MulJap]{DessinSeul};
+ color CoulTraits;
+ CoulTraits=\useKV[MulJap]{Couleur};
+ % On lit les string et les nombres
+ string Sfacteur[];
+ numeric facteur[];
+ vardef LectureDonnees(text t)=
+ n=1;
+ for p_=t:
+ if (n mod 2)=1:
+ Sfacteur[(n+1) div 2]=p_;
+ else:
+ facteur[n div 2]=p_;
+ fi;
+ n:=n+1;
+ endfor;
+ enddef;
+ numeric chiffrea[],chiffreb[];
+ vardef ExtraireChiffre=
+ Reste=facteur[1];
+ for k=length(Sfacteur[1]) downto 1:
+ Diviseur:=1;
+ for l=1 upto k-1:
+ Diviseur:=Diviseur*10;
+ endfor;
+ chiffrea[length(Sfacteur[1])+1-k]=Reste div Diviseur;
+ Reste:=Reste mod Diviseur;
+ endfor;
+ Reste:=facteur[2];
+ for k=length(Sfacteur[2]) downto 1:
+ Diviseur:=1;
+ for l=1 upto k-1:
+ Diviseur:=Diviseur*10;
+ endfor;
+ chiffreb[length(Sfacteur[2])+1-k]=Reste div Diviseur;
+ Reste:=Reste mod Diviseur;
+ endfor;
+ enddef;
+ LectureDonnees(#1);
+ ExtraireChiffre;
+ pair ta,basei,basej;
+ ta=u*(1,5);
+ basei=u*(1,1);
+ basej=u*(1,-1);
+ ecart=2.5;
+ vardef TraitsI(expr nb, lieu)=
+ label.ulft(TEX(decimal(nb)),lieu shifted(-1*basej));
+ if (nb mod 2)=1:%le nombre de traits est impair
+ p:=(nb-1) div 2;
+ for k=-p upto p:
+ trace ((lieu shifted(-1*basej))--(lieu shifted ((length(Sfacteur[2])-0.5)*ecart*basej))) shifted(k*0.1*basei) withcolor CoulTraits;
+ endfor;
+ else:%le nombre de traits est pair
+ p:=nb div 2;
+ if nb=0:
+ trace ((lieu shifted(-1*basej))--(lieu shifted ((length(Sfacteur[2])-0.5)*ecart*basej))) withcolor red;
+ else:
+ for k=-p upto -1:
+ trace ((lieu shifted(-1*basej))--(lieu shifted ((length(Sfacteur[2])-0.5)*ecart*basej))) shifted(k*0.1*basei+0.05*basei) withcolor CoulTraits;
+ endfor;
+ for k=1 upto p:
+ trace ((lieu shifted(-1*basej))--(lieu shifted ((length(Sfacteur[2])-0.5)*ecart*basej))) shifted(k*0.1*basei-0.05*basei) withcolor CoulTraits;
+ endfor;
+ fi;
+ fi;
+ enddef;
+ vardef TraitsJ(expr nb, lieu)=
+ label.urt(TEX(decimal(nb)),lieu shifted((length(Sfacteur[1])-0.5)*ecart*basei));
+ if (nb mod 2)=1:%le nombre de traits est impair
+ p:=(nb-1) div 2;
+ for k=-p upto p:
+ trace ((lieu shifted(-1*basei))--(lieu shifted ((length(Sfacteur[1])-0.5)*ecart*basei))) shifted(k*0.1*basej) withcolor CoulTraits;
+ endfor;
+ else:%le nombre de traits est pair
+ p:=nb div 2;
+ if nb=0:
+ trace ((lieu shifted(-1*basei))--(lieu shifted ((length(Sfacteur[1])-0.5)*ecart*basei))) withcolor red;
+ else:
+% label(TEX("ici"),lieu);
+ for k=-p upto -1:
+ trace ((lieu shifted(-1*basei))--(lieu shifted ((length(Sfacteur[1])-0.5)*ecart*basei))) shifted(k*0.1*basej+0.05*basej) withcolor CoulTraits;
+ endfor;
+ for k=1 upto p:
+ trace ((lieu shifted(-1*basei))--(lieu shifted ((length(Sfacteur[1])-0.5)*ecart*basei))) shifted(k*0.1*basej-0.05*basej) withcolor CoulTraits;
+ endfor;
+ fi;
+ fi;
+ enddef;
+ % drawoptions(withpen pencircle scaled 1.25 withcolor Orange);
+ for k=1 upto length(Sfacteur[1]):
+ TraitsI(chiffrea[k],ta+ecart*(k-1)*basei);
+ endfor;
+% drawoptions(withcolor blue);
+ for k=1 upto length(Sfacteur[2]):
+ TraitsJ(chiffreb[k],ta+ecart*(k-1)*basej);
+ endfor;
+ % Les blocs ?
+ pair testi[],testj[];
+ numeric rt,st;
+ rt:=0;st:=0;
+ for k=0 upto (length(Sfacteur[1])-1):
+ rt:=rt+1;
+ testi[rt]=ta shifted(k*ecart*basei);
+ endfor;
+ for k=1 upto (length(Sfacteur[2])-1):
+ rt:=rt+1;
+ testi[rt]=testi[rt-1] shifted(ecart*basej);
+ endfor;
+ %
+ for k=0 upto (length(Sfacteur[2])-1):
+ st:=st+1;
+ testj[st]=ta shifted(k*ecart*basej);
+ endfor;
+ for k=1 upto (length(Sfacteur[1])-1):
+ st:=st+1;
+ testj[st]=testj[st-1] shifted(ecart*basei);
+ endfor;
+ if Bloc:
+ for k=1 upto rt:
+ draw polygone(testi[k]+u*0.5*ecart*(-cosd(45),sind(45)),testi[k]+u*0.5*ecart*(cosd(45),sind(45)),testj[k]+u*0.5*ecart*(cosd(45),-sind(45)),testj[k]+u*0.5*ecart*(-cosd(45),-sind(45)));
+ endfor;
+ fi;
+ % On détaille le calcul
+ for k=1 upto 50:
+ RetiensDecimal[k]=0;
+ endfor;
+ for k=1 upto length(Sfacteur[1]):
+ for l=1 upto length(Sfacteur[2]):
+ RetiensDecimal[k+l]:=RetiensDecimal[k+l]+chiffrea[k]*chiffreb[l];
+ endfor;
+ endfor;
+ %
+ miny=4000;
+ for k=1 upto st:
+ if ypart(testj[k])<miny:
+ miny:=ypart(testj[k]);
+ fi;
+ endfor;
+ pair PointBasea[],PointBaseb[],PointBasec[];
+ for k=1 upto rt:
+ PointBasea[k]=(xpart(testj[k]),miny-ecart*u);
+ PointBaseb[k]=PointBasea[k]+u*ecart*(0,-1);
+ PointBasec[k]=PointBasea[k]+(0,-7.5mm);
+ endfor;
+ numeric NouveauNombre[];
+ if DessinSeul=false:
+ for k=1 upto rt:
+ label(decimal(RetiensDecimal[k+1]),PointBasea[k]);
+ endfor;
+ % Affichage des retenues, des nombres, des unités...
+ Retenue[rt+1]:=0;
+ for k=rt downto 1:
+ NouveauNombre[k]=RetiensDecimal[k+1]+Retenue[k+1];
+ Retenue[k]:=NouveauNombre[k] div 10;
+ endfor;
+ %fleche haut -> bas
+ for k=rt downto 1:
+ drawarrow (PointBasea[k]--PointBaseb[k]) cutbefore cercles(PointBasea[k],if k=rt:5mm else: 10mm fi) cutafter cercles(PointBaseb[k],5mm);
+ endfor;
+ % fleche diag
+ for k=rt downto 2:
+ if Retenue[k]>0:
+ if k=rt:
+ drawarrow (PointBasea[k]--PointBasea[k-1]) cutbefore cercles(PointBasea[k],5mm) cutafter cercles(PointBasea[k-1],5mm);
+ else:
+ drawarrow (PointBasec[k]--PointBasea[k-1]) cutbefore cercles(PointBasec[k],5mm) cutafter cercles(PointBasea[k-1],5mm);
+ fi;
+ fi;
+ endfor;
+ for k=rt downto 1:
+ if k>1:
+ label(decimal(NouveauNombre[k] mod 10),PointBaseb[k]);
+ else:
+ label(decimal(NouveauNombre[k]),PointBaseb[k]);
+ fi;
+ if k>1:
+ if Retenue[k]>0:
+ if k=rt:
+ fill cercles(iso(PointBasea[k],PointBasea[k-1]),5mm) withcolor white;
+ label(TEX("$+"&decimal(Retenue[k])&"$"),iso(PointBasea[k],PointBasea[k-1]));
+ else:
+ fill cercles(iso(PointBasec[k],PointBasea[k-1]),5mm) withcolor white;
+ label(TEX("$+"&decimal(Retenue[k])&"$"),iso(PointBasec[k],PointBasea[k-1]));
+ fi;
+ draw pointarc(cercles(PointBasea[k-1],3mm),45)--pointarc(cercles(PointBasea[k-1],3mm),225);
+ fi;
+ if k<rt:
+ if Retenue[k+1]>0:
+ label(TEX("$"&decimal(NouveauNombre[k])&"$"),PointBasec[k]);
+ fi;
+ fi;
+ elseif k=1:
+ if Retenue[k]>0:
+ draw pointarc(cercles(PointBasea[k],3mm),45)--pointarc(cercles(PointBasea[k],3mm),225);
+ label(TEX("$"&decimal(NouveauNombre[k])&"$"),PointBasec[k]);
+ fi;
+ fi;
+ endfor;
+ fi;
+ \end{mplibcode}
+ \fi
+}%
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/profcollege/PfCMulJap.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCNombreAstral.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCNombreAstral.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCNombreAstral.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,7 +1,7 @@
%%%
% Nombre Astral
%%%
-\setKVdefault[NombreAstral]{Solution=false,Graines=false,Echelle=1,Couleur=LightSteelBlue}
+\setKVdefault[NombreAstral]{Solution=false,Graines=false,Echelle=1,Couleur=LightSteelBlue,Horizontal=false}
\defKV[NombreAstral]{Graine=\setKV[NombreAstral]{Graines}}%
\newtoks\toklisteNANombres%
@@ -55,8 +55,9 @@
color MiseEnValeurSol;
MiseEnValeurSol=\useKV[NombreAstral]{Couleur};
- boolean Solution;
+ boolean Solution,Horizontal;
Solution=\useKV[NombreAstral]{Solution};
+ Horizontal=\useKV[NombreAstral]{Horizontal};
Echelle:=\useKV[NombreAstral]{Echelle};
@@ -128,8 +129,13 @@
k:=k+1;
fill ca[p_] withcolor if Solution=false: white else: MiseEnValeurSol fi;
trace ca[p_];
+ if Horizontal:
+ label(TEX("\Large"&Rappel[p_]),(xpart(C2)+1.5*(k-1)*u,ypart(C2)-7.5u));
+ trace cercles((xpart(C2)+1.5*(k-1)*u,ypart(C2)-7.5u),0.6u);
+ else:
label(TEX("\Large"&Rappel[p_]),u*(-7,5.6-1.5k));
trace cercles(u*(-7,5.6-1.5k),0.6u);
+ fi;
endfor;
enddef;
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -7,6 +7,8 @@
\newtoks\toklistePtsFn%pour la discipline
\newtoks\tokPfCListeDesFonctions%
\newtoks\tokPfCListeDesNomsFonctions%
+\newtoks\tokPfCLabelX%
+\newtoks\tokPfCLabelY%
\def\UpdatePfCListeDesFonctions#1\nil{\addtotok\tokPfCListeDesFonctions{"#1",}}%
\def\UpdatePfCListeDesNomsFonctions#1\nil{\addtotok\tokPfCListeDesNomsFonctions{"#1",}}%
\def\UpdatePtsFn#1/#2/#3/#4\nil{\addtotok\toklistePtsFn{#1,(#2,#3),#4,}}%
@@ -31,8 +33,10 @@
\else
\readlist*\ListeDesNomsFonctions{\PfCFooNomFn}
\foreachitem\compteur\in\ListeDesNomsFonctions{\expandafter\UpdatePfCListeDesNomsFonctions\compteur\nil}%
- \fi
- \TraceMultiGraphique{\the\tokPfCListeDesFonctions}{\the\tokPfCListeDesNomsFonctions}%
+ \fi
+ \addtotok\tokPfCLabelX{"\useKV[TraceG]{LabelX}"}%
+ \addtotok\tokPfCLabelY{"\useKV[TraceG]{LabelY}"}%
+ \TraceMultiGraphique{\the\tokPfCListeDesFonctions}{\the\tokPfCListeDesNomsFonctions}%
}{%
\ifboolKV[ClesFonction]{Points}{%
\toklistePtsFn{}%
@@ -591,6 +595,10 @@
grady=\useKV[TraceG]{PasGradY};
Epaisseur:=\useKV[TraceG]{Epaisseur};
%
+ string LabelX,LabelY;
+ LabelX=\the\tokPfCLabelX;
+ LabelY=\the\tokPfCLabelY;
+ %
color colortrace[];
vardef RetiensCouleur(text t)=
n:=0;
@@ -606,8 +614,10 @@
Origine=(xmin,ymin)+\useKV[TraceG]{Origine};
DecalageOrigine=\useKV[TraceG]{Origine};
%
- boolean Grille,Vide,Graduations,Code,LegendeX,LegendeY;
+ boolean Grille,Vide,Graduations,Code,LegendeX,LegendeY,Millimetre,Tiret;
Grille=\useKV[TraceG]{Grille};
+ Tiret=\useKV[TraceG]{Tiret};
+ Millimetre=\useKV[TraceG]{Millimetre};
Vide=\useKV[TraceG]{Vide};
Graduations=\useKV[TraceG]{Graduations};
Code=\useKV[TraceG]{Code};
@@ -692,10 +702,12 @@
%
vardef LegendeCourbe=
if LegendeX=true:
- label.ulft(btex \useKV[TraceG]{LabelX} etex,u*(xmax,ypart(Origine)));
+ %label.ulft(btex \useKV[TraceG]{LabelX} etex,u*(xmax,ypart(Origine)));
+ label.ulft(TEX(LabelX),u*(xmax,ypart(Origine)));
fi;
if LegendeY=true:
- label.lrt(btex \useKV[TraceG]{LabelY} etex,u*(xpart(Origine),ymax));
+ % label.lrt(btex \useKV[TraceG]{LabelY} etex,u*(xpart(Origine),ymax));
+ label.lrt(TEX(LabelY),u*(xpart(Origine),ymax));
fi;
enddef;
}%
@@ -704,9 +716,55 @@
% #1 paramètres
% #2 Liste fonctions
\ifluatex
- \mplibforcehmode
+ \mplibforcehmode
\begin{mplibcode}
\PfCTraceMGCode
+ color PfCOrange;
+ PfCOrange=(.75,.5,.25);
+ if Millimetre:
+ drawoptions(withpen pencircle scaled 0.25 withcolor 0.7[PfCOrange,white]);
+ for k=xpart(Origine) step 0.1 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -0.1 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 0.1 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -0.1 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ drawoptions(withpen pencircle scaled 0.675 withcolor 0.5[PfCOrange,white]);
+ for k=xpart(Origine) step 1 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -1 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 1 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -1 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ drawoptions(withpen pencircle scaled 1 withcolor 0.3[PfCOrange,white]);
+ for k=xpart(Origine) step 5 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -5 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 5 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -5 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ fi;
if Grille:
drawoptions(withcolor 0.75white);
for k=xpart(Origine) step grillex until (xmax+grillex):
@@ -725,16 +783,36 @@
fi;
if Graduations:
for k=gradx step gradx until (((xmax-xmin)-xpart(DecalageOrigine))*pasx):
+ if Tiret:
+ draw ((0,-0.5mm)--(0,0.5mm)) shifted placepoint(k,0);
+ label.bot(TEX("\num{"&decimal(k)&"}"),Origine*cm+(k*xu,0));
+ else:
dotlabel.bot(TEX("\num{"&decimal(k)&"}"),Origine*cm+(k*xu,0));
+ fi;
endfor;
for k=-gradx step -gradx until (xpart(-DecalageOrigine)*pasx):
+ if Tiret:
+ draw ((0,-0.5mm)--(0,0.5mm)) shifted placepoint(k,0);
+ label.bot(TEX("\num{"&decimal(k)&"}"),Origine*cm+(k*xu,0));
+ else:
dotlabel.bot(TEX("\num{"&decimal(k)&"}"),Origine*cm+(k*xu,0));
+ fi;
endfor;
for k=grady step grady until (((ymax-ymin)-ypart(DecalageOrigine))*pasy):
+ if Tiret:
+ draw ((-0.5mm,0)--(0.5mm,0)) shifted placepoint(0,k);
+ label.lft(TEX("\num{"&decimal(k)&"}"),Origine*cm+(0,k*yu));
+ else:
dotlabel.lft(TEX("\num{"&decimal(k)&"}"),Origine*cm+(0,k*yu));
+ fi;
endfor;
for k=-grady step -grady until (ypart(-DecalageOrigine)*pasy):
+ if Tiret:
+ draw ((-0.5mm,0)--(0.5mm,0)) shifted placepoint(0,k);
+ label.lft(TEX("\num{"&decimal(k)&"}"),Origine*cm+(0,k*yu));
+ else:
dotlabel.lft(TEX("\num{"&decimal(k)&"}"),Origine*cm+(0,k*yu));
+ fi;
endfor;
fi;
%
@@ -767,7 +845,53 @@
LegendeCourbe;
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={\PfCTraceMGCode}]
+ \begin{mpost}[mpsettings={\PfCTraceMGCode}]
+ color PfCOrange;
+ PfCOrange=(.75,.5,.25);
+ if Millimetre:
+ drawoptions(withpen pencircle scaled 0.25 withcolor 0.7[PfCOrange,white]);
+ for k=xpart(Origine) step 0.1 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -0.1 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 0.1 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -0.1 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ drawoptions(withpen pencircle scaled 0.675 withcolor 0.5[PfCOrange,white]);
+ for k=xpart(Origine) step 1 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -1 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 1 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -1 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ drawoptions(withpen pencircle scaled 1 withcolor 0.3[PfCOrange,white]);
+ for k=xpart(Origine) step 5 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -5 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 5 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -5 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ fi;
if Grille:
drawoptions(withcolor 0.75white);
for k=xpart(Origine) step grillex until xmax:
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCOperationsTrou.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCOperationsTrou.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCOperationsTrou.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -6,7 +6,7 @@
\newcommand\PfCchiffre[2]{\tikz[remember picture] \node[inner sep=0pt](#1){#2};}
\newcommand\PfCentoure[2]{\tikz[remember picture,overlay] \node[preaction={draw={\useKV[ClesOperations]{CouleurCadre}},ultra thick,opacity=1,
-transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,inner sep=.55em,fit=(#1.center)(#2.center)]{} ;}
+transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,inner sep=.55em,fit=(#1.center)(#2.center)]{};}
\newcounter{divxlop}%
\newcounter{mulxlop}%
@@ -42,10 +42,19 @@
\setKV[ClesOperations]{#1}%
\setcounter{mulxlop}{0}%
\ifboolKV[ClesOperations]{Solution}{\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurSolution}}\colorlet{PfCCouleurVirgule}{PfCSolOp}}{\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurFond}}\colorlet{PfCCouleurVirgule}{\useKV[ClesOperations]{CouleurVirgule}}}%
- \opmul[decimalsepsymbol={,},lineheight=2em,columnwidth=1.5em,displayintermediary=all,voperator=bottom,intermediarystyle=\stepcounter{mulxlop}\color{PfCSolOp}\PfCchiffre{A\themulxlop},resultstyle=\stepcounter{mulxlop}\color{PfCSolOp}\PfCchiffre{A\themulxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \begingroup
+ \setlength{\baselineskip}{2em}
+ \StrLen{#3}[\PfCLongueurFacteurDeux]
+ \ifnum\PfCLongueurFacteurDeux=1\relax
+ \opset{lineheight=\baselineskip} % nécessaire
+ \else
+ \opset{lineheight=\baselineskip,displayintermediary=all,displayshiftintermediary=all} % nécessaire
+ \fi
+ \opmul[decimalsepsymbol={,},lineheight=2em,columnwidth=1.5em,voperator=bottom,intermediarystyle=\stepcounter{mulxlop}\color{PfCSolOp}\PfCchiffre{A\themulxlop},resultstyle=\stepcounter{mulxlop}\color{PfCSolOp}\PfCchiffre{A\themulxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
\foreach \i in {1,...,\themulxlop}{%
\PfCentoure{A\i}{A\i}%
}%
+ \endgroup
}%
\newcommand\Addition[3][]{%
@@ -53,7 +62,7 @@
\setKV[ClesOperations]{#1}%
\setcounter{addxlop}{0}%
\ifboolKV[ClesOperations]{Solution}{\opset{carryadd,carrystyle=\color{PfCSolOp}\scriptsize}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurSolution}}\colorlet{PfCCouleurVirgule}{PfCSolOp}}{\opset{carryadd=false}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurFond}}\colorlet{PfCCouleurVirgule}{\useKV[ClesOperations]{CouleurVirgule}}}%
- \opadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,displayintermediary=all,voperator=bottom,intermediarystyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}
+ \opadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,resultstyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}
\foreach \i in {1,...,\theaddxlop}{%
\PfCentoure{A\i}{A\i}%
}%
@@ -64,7 +73,7 @@
\setKV[ClesOperations]{#1}%
\setcounter{subxlop}{0}%
\ifboolKV[ClesOperations]{Solution}{\opset{carrysub,carrystyle=\color{PfCSolOp}\scriptsize}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurSolution}}\colorlet{PfCCouleurVirgule}{PfCSolOp}}{\opset{carrysub=false}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurFond}}\colorlet{PfCCouleurVirgule}{\useKV[ClesOperations]{CouleurVirgule}}}%
- \opsub[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,displayintermediary=all,voperator=bottom,intermediarystyle=\stepcounter{subxlop}\color{PfCSolOp}\PfCchiffre{A\thesubxlop},resultstyle=\stepcounter{subxlop}\color{PfCSolOp}\PfCchiffre{A\thesubxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \opsub[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,resultstyle=\stepcounter{subxlop}\color{PfCSolOp}\PfCchiffre{A\thesubxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
\foreach \i in {1,...,\thesubxlop}{%
\PfCentoure{A\i}{A\i}
}%
@@ -75,7 +84,7 @@
\setKV[ClesOperations]{#1}%
\setcounter{addxlop}{0}%
\ifboolKV[ClesOperations]{Solution}{\opset{carryadd,carrystyle=\color{PfCSolOp}\scriptsize}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurSolution}}\colorlet{PfCCouleurVirgule}{PfCSolOp}}{\opset{carryadd=false}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurFond}}\colorlet{PfCCouleurVirgule}{\useKV[ClesOperations]{CouleurVirgule}}}%
- \opmanyadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,displayintermediary=all,vmanyoperator=bottom,intermediarystyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle.d=\color{PfCCouleurVirgule}]#2
+ \opmanyadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,vmanyoperator=bottom,resultstyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle.d=\color{PfCCouleurVirgule}]#2
\foreach \i in {1,...,\theaddxlop}{%
\PfCentoure{A\i}{A\i}%
}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPixelArt.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCPixelArt.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCPixelArt.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -31,7 +31,9 @@
Nombres:=\useKV[ClesPixelArt]{Nombres};
string BaseLettres;
BaseLettres=str #2;
-
+ numeric EchelleScale;
+ EchelleScale=Unite/5mm;
+
color ColorEntier[],ColFond;
n:=0;
for p_=#3:
@@ -60,11 +62,11 @@
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]),((l-1)*Unite,(h-1)*Unite));
+ label(TEX(RetiensNombres[m+1]) scaled EchelleScale,((l-1)*Unite,(h-1)*Unite));
fi;
endfor;
else:
- label(TEX(substring(p,p+1) of p_),((l-1)*Unite,(h-1)*Unite));
+ label(TEX(substring(p,p+1) of p_) scaled EchelleScale,((l-1)*Unite,(h-1)*Unite));
fi;
if Solution:
for m=0 upto (length BaseLettres-1):
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPropor.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCPropor.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCPropor.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,12 +1,12 @@
%%%
% Proportionnalit\'e
%%%
-\setKVdefault[ClesPropor]{GrandeurA=Grandeur A,GrandeurB=Grandeur B,Largeur=1cm,Math=false,Stretch=1,ColorFill=white,CouleurTab=gray!15,Vertical=false,Simple=false}%
+\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]
\def\Updatetoksmath#1/#2\nil{\addtotok\tabtoksa{}\addtotok\tabtoksb{}}%
-\def\updatetokspropor#1/#2\nil{\addtotok\tabtoksa{&\num{#1}}\addtotok\tabtoksb{&\num{#2}}}
+\def\updatetokspropor#1/#2\nil{\addtotok\tabtoksa{&\num{#1}}\addtotok\tabtoksb{&\num{#2}}}%
\def\Buildtabpropor{%
\setcounter{NbProporG}{0}%
\setcounter{NbProporD}{0}%
@@ -13,7 +13,7 @@
\renewcommand{\arraystretch}{\useKV[ClesPropor]{Stretch}}%
\ifboolKV[ClesPropor]{Vertical}{%
\begin{tabular}{c|*{2}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}c}%
- \multicolumn{1}{c}{}&\multicolumn{1}{c}{\setcounter{NbPropor}{1}\TikzPH}&\multicolumn{1}{c}{\TikzPH}&\\
+ \multicolumn{1}{c}{}&\multicolumn{1}{c}{\setcounter{NbPropor}{1}\TikzPH}&\multicolumn{1}{c}{\TikzPH}&\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\hhline{~--~}%
&\cellcolor{\useKV[ClesPropor]{CouleurTab}}\useKV[ClesPropor]{GrandeurA}&\cellcolor{\useKV[ClesPropor]{CouleurTab}}\useKV[ClesPropor]{GrandeurB}&\\
\hhline{~--~}%
@@ -21,7 +21,7 @@
\stepcounter{NbProporG}\TikzPG&\ifboolKV[ClesPropor]{Math}{\ListeValeur[##1,1]}{\num{\ListeValeur[##1,1]}}&\ifboolKV[ClesPropor]{Math}{\ListeValeur[##1,2]}{\num{\ListeValeur[##1,2]}}&\stepcounter{NbProporD}\TikzPD\\
\hhline{~--~}%
}%
- \multicolumn{1}{c}{}&\multicolumn{1}{c}{\setcounter{NbPropor}{1}\TikzPB}&\multicolumn{1}{c}{\TikzPB}&\\
+ \multicolumn{1}{c}{}&\multicolumn{1}{c}{\setcounter{NbPropor}{1}\TikzPB}&\multicolumn{1}{c}{\TikzPB}&\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\end{tabular}%
}{%
\tabtoksa{}\tabtoksb{}%
@@ -36,23 +36,24 @@
\xdef\LongListe{\ListeValeurlen}%
\ifboolKV[ClesPropor]{Simple}{%
\begin{tabular}{r|*{\number\numexpr\ListeValeurlen}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}l}%
- \multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}&\multicolumn{1}{c}{}\\%
+ \multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}&\multicolumn{1}{c}{}\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\hhline{~*{\number\numexpr\ListeValeurlen}{-}~}%
- \multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}\the\tabtoksa&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\%
+ \multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}\the\tabtoksa&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\%
\hhline{~*{\number\numexpr\ListeValeurlen}{-}~}%
\multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}\the\tabtoksb&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\%
\hhline{~*{\number\numexpr\ListeValeurlen}{-}~}%
- \multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPB}}&\multicolumn{1}{c}{}\\%
+ \multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPB}}&\multicolumn{1}{c}{}\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\end{tabular}%
}{%
\begin{tabular}{rc|*{\number\numexpr\ListeValeurlen}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}l}%
- \multicolumn{1}{c}{}&\multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}&\multicolumn{1}{c}{}\\%
+ %
+ \multicolumn{1}{c}{}&\multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}&\multicolumn{1}{c}{}\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\hhline{~*{\number\numexpr\ListeValeurlen+1}{-}~}%
\multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}&\the\tabtoksa&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\%
\hhline{~*{\number\numexpr\ListeValeurlen+1}{-}~}%
\multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}&\the\tabtoksb&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\%
\hhline{~*{\number\numexpr\ListeValeurlen+1}{-}~}%
- \multicolumn{1}{c}{\stepcounter{NbProporG}\TikzPG}&\multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPB}}&\multicolumn{1}{c}{}\\%
+ \multicolumn{1}{c}{\stepcounter{NbProporG}\TikzPG}&\multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPB}}&\multicolumn{1}{c}{}\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\end{tabular}%
}%
}%
@@ -151,10 +152,10 @@
\NewDocumentCommand\FlechePCH{mm}{%
\begin{tikzpicture}[remember picture,overlay,node distance=\getstrut\ht]%
- \node[inner sep=0pt] (MilieuH-#1) at ($(ProporH-#1)!0.33!(ProporB-#1)$) {};%
- \node[inner sep=0pt] (MilieuH-#2) at ($(ProporH-#2)!0.33!(ProporB-#2)$) {};%
- \node[inner sep=0pt] (MilieuB-#1) at ($(ProporH-#1)!0.67!(ProporB-#1)$) {};%
- \node[inner sep=0pt] (MilieuB-#2) at ($(ProporH-#2)!0.67!(ProporB-#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[left of=MilieuH-#2] (aux2);%
@@ -175,10 +176,10 @@
\NewDocumentCommand\FlechePCB{mm}{%
\begin{tikzpicture}[remember picture,overlay,node distance=\getstrut\ht]%
- \node[inner sep=0pt] (MilieuH-#1) at ($(ProporH-#1)!0.33!(ProporB-#1)$) {};%
- \node[inner sep=0pt] (MilieuH-#2) at ($(ProporH-#2)!0.33!(ProporB-#2)$) {};%
- \node[inner sep=0pt] (MilieuB-#1) at ($(ProporH-#1)!0.67!(ProporB-#1)$) {};%
- \node[inner sep=0pt] (MilieuB-#2) at ($(ProporH-#2)!0.67!(ProporB-#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[left of=MilieuH-#2] (aux2);%
@@ -273,6 +274,8 @@
\newcommand\Propor[2][]{%
\useKVdefault[ClesPropor]%
\setKV[ClesPropor]{#1}%
+ \ifboolKV[ClesPropor]{Condense}{\xdef\PfCCoeffH{-0.1}}{\xdef\PfCCoeffH{0.33}}%
+ \ifboolKV[ClesPropor]{Condense}{\xdef\PfCCoeffB{0.5}}{\xdef\PfCCoeffB{0.67}}%
\xdef\colorfill{\useKV[ClesPropor]{ColorFill}}%
\xdef\EcartLargeur{\useKV[ClesPropor]{Largeur}}%
% % on lit la liste \'ecrite sous la forme valeur/effectif
@@ -279,6 +282,7 @@
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListeValeur{#2}%
\Buildtabpropor%
+% \BuildTabPropor%
}%
\newcommand\FlecheCoef[2][\EcartLargeur]{%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCPythagore.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCPythagore.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCPythagore.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,10 +1,10 @@
%%%
% Le th\'eor\`eme de Pythagore
%%%
-\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}
-\defKV[ClesPythagore]{ValeurA=\setKV[ClesPythagore]{EnchaineA}}
-\defKV[ClesPythagore]{ValeurB=\setKV[ClesPythagore]{EnchaineB}}
-\defKV[ClesPythagore]{ValeurC=\setKV[ClesPythagore]{EnchaineC}}
+\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}%
+\defKV[ClesPythagore]{ValeurA=\setKV[ClesPythagore]{EnchaineA}}%
+\defKV[ClesPythagore]{ValeurB=\setKV[ClesPythagore]{EnchaineB}}%
+\defKV[ClesPythagore]{ValeurC=\setKV[ClesPythagore]{EnchaineC}}%
% On d\'efinit les figures \`a utiliser
\def\MPFigurePytha#1#2#3#4#5#6{%
% #1 Premier sommet
@@ -14,8 +14,8 @@
% #5 2eme longueur
% #6 angle de rotation de la figure
\ifluatex
- \mplibforcehmode
- \begin{mplibcode}
+ \mplibforcehmode%
+ \begin{mplibcode}
u:=\useKV[ClesPythagore]{Echelle};
pair A,B,C,O,D,E,F;%B est le sommet de l'angle droit
O=u*(2.5,2.5);
@@ -107,7 +107,7 @@
label(btex #1 etex,1.2[O,C]);
\end{mpost}
\fi
-}
+}%
\def\MPFigureReciPytha#1#2#3#4#5#6#7{%
% #1 Premier sommet
@@ -182,7 +182,7 @@
label(btex #3 etex,1.2[O,C]);
\end{mpost}
\fi
-}
+}%
\def\MPFigurePythaSansMots#1#2#3#4#5#6{%
% #1 Premier sommet
@@ -264,7 +264,7 @@
label(btex #1 etex,1.2[O,C]);
\end{mplibcode}
\fi
-}
+}%
\newcommand\RedactionPythagore{}%
\newcommand\RedactionReciPythagore{}%
@@ -272,7 +272,7 @@
\newcommand\RedactionCalculsReciPythagore{}%
\newcommand\RedactionConclusionReciPythagore{}%
-\NewDocumentCommand\CalculsPythagore{o m m m m}{
+\NewDocumentCommand\CalculsPythagore{o m m m m}{%
\xintifboolexpr{#3<#4 || #3==#4}{%\ifnum#3<#4%
\xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}%
\begin{align*}
@@ -312,7 +312,7 @@
\end{align*}
}%
}%\fi%
-}
+}%
\NewDocumentCommand\PfCCalculsReciPythagore{ommmm}{%
\ifboolKV[ClesPythagore]{ReciColonnes}{%
@@ -430,8 +430,8 @@
\ifboolKV[ClesPythagore]{Perso}{%
\RedactionReciPythagore%
}{%
- Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand c\^ot\'e.%
- }
+ Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand c\^ot\'e.%
+ }%
\PfCCalculsReciPythagore[#1]{#2}{#3}{#4}{#5}%
\ifboolKV[ClesPythagore]{Egalite}{%
\xintifboolexpr{\PfCRetiensReciHypo==\PfCRetiensReciSomme}{%
@@ -455,7 +455,7 @@
}{%
\ifboolKV[ClesPythagore]{Perso}{\RedactionReciPythagore}{%
Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand c\^ot\'e.%
- }
+ }%
\PfCCalculsReciPythagore[#1]{#2}{#3}{#4}{#5}%
\ifboolKV[ClesPythagore]{Egalite}{%
\xintifboolexpr{\PfCRetiensReciHypo==\PfCRetiensReciSomme}{%
@@ -477,7 +477,7 @@
\opcopy{#3}{A1}%
\opcopy{#4}{A2}%
\opcopy{\useKV[ClesPythagore]{Precision}}{pres}%
- \xintifboolexpr{#3<#4 || #3==#4}{
+ \xintifboolexpr{#3<#4 || #3==#4}{%
\xdef\PetitCote{#3}%
\xdef\MoyenCote{#4}%
\xdef\GrandCote{}%
@@ -485,7 +485,7 @@
\xdef\GrandCote{#3}%
\xdef\MoyenCote{#4}%
\xdef\PetitCote{}% Pour la personnalisation
- }
+ }%
% On retient les noms des sommets
\StrMid{#2}{1}{1}[\NomA]%
\StrMid{#2}{2}{2}[\NomB]%
@@ -501,7 +501,7 @@
}{%
\xdef\ResultatPytha{\fpeval{round(sqrt(#3^2-#4^2),\useKV[ClesPythagore]{Precision})}}%
}%
- \MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}
+ \MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}%
}{%
\ifboolKV[ClesPythagore]{Figure}{%
\begin{multicols}{2}%
@@ -518,7 +518,7 @@
}{%
\ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
}%
- }
+ }%
\CalculsPythagore[#1]{#2}{#3}{#4}{}
}%
\end{multicols}
@@ -533,7 +533,7 @@
}{%
\ifboolKV[ClesPythagore]{Perso}{\RedactionPythagore}{\ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
}}%
- \CalculsPythagore[#1]{#2}{#3}{#4}{}
+ \CalculsPythagore[#1]{#2}{#3}{#4}{}%
}%
}%
}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -2,15 +2,15 @@
% Reperage
%%%
\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,Etages=4,Code=false,Globe=false,Rho=1500,Phi=22,Theta=10,CouleurE=orange,CouleurG=green,Axes=false,TypeProj="persp",Niveaux=false}
-\defKV[ClesReperage]{Traces=\setKV[ClesReperage]{Code}}
-\defKV[ClesReperage]{Niveau=\setKV[ClesReperage]{Etages=#1}\setKV[ClesReperage]{Niveaux}}
+\defKV[ClesReperage]{Traces=\setKV[ClesReperage]{Code}}%
+\defKV[ClesReperage]{Niveau=\setKV[ClesReperage]{Etages=#1}\setKV[ClesReperage]{Niveaux}}%
% ValeurOrigine permet de faire des morceaux de demi-droite gradu\'ee en passant par droite :)
-\def\Updatetoksdroite#1/#2\nil{\addtotok\toklistepointdroite{#1,"#2",}}
+\def\Updatetoksdroite#1/#2\nil{\addtotok\toklistepointdroite{#1,"#2",}}%
%\def\Updatetoksdroite#1/#2\nil{\addtotok\toklistepointdroite{#1,"#2",}}
-\def\Updatetoksdemidroite#1/#2\nil{\addtotok\toklistenompointdemidroite{"#2",}}
-\def\Updatetoksrepere#1/#2/#3\nil{\addtotok\toklistepointrepere{#1,#2,"#3",}}
-\def\Updatetoksespace#1/#2/#3/#4\nil{\addtotok\toklistepointespace{#1,#2,#3,"#4",}}
+\def\Updatetoksdemidroite#1/#2\nil{\addtotok\toklistenompointdemidroite{"#2",}}%
+\def\Updatetoksrepere#1/#2/#3\nil{\addtotok\toklistepointrepere{#1,#2,"#3",}}%
+\def\Updatetoksespace#1/#2/#3/#4\nil{\addtotok\toklistepointespace{#1,#2,#3,"#4",}}%
\newtoks\toklistepointrepere%
\newtoks\toklistepointdroite%
@@ -23,24 +23,24 @@
\toklistepointespace{}%
\ifboolKV[ClesReperage]{Globe}{%
\foreachitem\compteur\in\ListePointEspace{\expandafter\Updatetoksrepere\compteur\nil}%
- \[\MPGlobe{\the\toklistepointrepere}{\useKV[ClesReperage]{EchelleEspace}}\]
+ \MPGlobe{\the\toklistepointrepere}{\useKV[ClesReperage]{EchelleEspace}}%
}{%
\ifboolKV[ClesReperage]{Sphere}{%
\foreachitem\compteur\in\ListePointEspace{\expandafter\Updatetoksrepere\compteur\nil}%
- \[\MPEspaceSphere{\the\toklistepointrepere}{\useKV[ClesReperage]{EchelleEspace}}\]
+ \MPEspaceSphere{\the\toklistepointrepere}{\useKV[ClesReperage]{EchelleEspace}}%
}{%
\foreachitem\compteur\in\ListePointEspace{\expandafter\Updatetoksespace\compteur\nil}%
\ifboolKV[ClesReperage]{AffichageNom}{%
\ifboolKV[ClesReperage]{AffichageCoord}{%
- \[\MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{3}{\useKV[ClesReperage]{EchelleEspace}}\]%
+ \MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{3}{\useKV[ClesReperage]{EchelleEspace}}%
}{%
- \[\MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{2}{\useKV[ClesReperage]{EchelleEspace}}\]%
+ \MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{2}{\useKV[ClesReperage]{EchelleEspace}}%
}%
}{%
\ifboolKV[ClesReperage]{AffichageCoord}{%
- \[\MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{1}{\useKV[ClesReperage]{EchelleEspace}}\]%
+ \MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{1}{\useKV[ClesReperage]{EchelleEspace}}%
}{%
- \[\MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{0}{\useKV[ClesReperage]{EchelleEspace}}\]%
+ \MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{0}{\useKV[ClesReperage]{EchelleEspace}}%
}%
}%
}%
@@ -49,8 +49,8 @@
\def\MPGlobe#1#2{%
\ifluatex
- \mplibnumbersystem{double}
- \mplibforcehmode
+ \mplibnumbersystem{double}%
+ \mplibforcehmode%
\begin{mplibcode}
input PfCSolid;
% Pour convertir les (Long,lat) données en degrés en (Long,lat) données en radians
@@ -233,6 +233,7 @@
\def\MPEspaceSphere#1#2{%
\ifluatex
+ \mplibforcehmode
\begin{mplibcode}
typetrace:="3D";
typerepre:="persp";
@@ -421,7 +422,8 @@
}
\def\MPEspacePave#1#2#3#4#5#6#7#8#9{%
- \ifluatex
+ \ifluatex%
+ \mplibforcehmode%
\begin{mplibcode}
typetrace:="3D";
typerepre:="persp";
@@ -1536,7 +1538,9 @@
n:=n+1;
if substring(1,2) of p_="*":
ACoord:=scantokens(substring(0,1) of p_);
- if ACoord=3:
+ if ACoord=4:
+ pointe(unitp*(valeur[n],0));
+ elseif ACoord=3:
drawarrow ((unitp*valeur[n],-7mm))--((unitp*valeur[n],-3mm));
label.bot(btex \hbox to2em{\dotfill} etex,((unitp*valeur[n],-8mm)));
pointe(unitp*(valeur[n],0));
@@ -1552,7 +1556,9 @@
pointe(unitp*(valeur[n],0));
fi;
else:
- if AffichageCoord=3:
+ if AffichageCoord=4:
+ pointe(unitp*(valeur[n],0));
+ elseif AffichageCoord=3:
if p_<>"":
drawarrow ((unitp*valeur[n],-7mm))--((unitp*valeur[n],-3mm));
label.bot(btex \hbox to2em{\dotfill} etex,((unitp*valeur[n],-8mm)));
@@ -1685,7 +1691,9 @@
n:=n+1;
if substring(1,2) of p_="*":
ACoord:=scantokens(substring(0,1) of p_);
- if ACoord=3:
+ if ACoord=4:
+ pointe(unitp*(valeur[n],0));
+ elseif ACoord=3:
drawarrow (unitp*(valeur[n],-1))--(unitp*(valeur[n],-0.3));
label.bot(btex \noexpand\hbox to2em{\noexpand\dotfill} etex,(unitp*(valeur[n],-1)));
pointe(unitp*(valeur[n]-ValeurOrigine,0));
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresentationGraphique.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresentationGraphique.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresentationGraphique.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,7 +1,7 @@
%%%
% Diff\'erentes représentations graphiques
%%%
-\setKVdefault[TraceG]{Grille=false,Graduations=false,PasGradX=1,PasGradY=1,PasGrilleX=1,PasGrilleY=1,Xmin=-5.5,Xmax=5.5,Xstep=1,Ymin=-5.5,Ymax=5.5,Ystep=1,Bornea=-5.5,Borneb=5.5,LabelX={},LabelY={},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}%
+\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}%
\defKV[TraceG]{Traces=\setKV[TraceG]{Code}}%
\defKV[TraceG]{LabelX=\setKV[TraceG]{LegendeX}}%
\defKV[TraceG]{LabelY=\setKV[TraceG]{LegendeY}}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterEntier.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterEntier.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCRepresenterEntier.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,14 +1,15 @@
%%%
-% Représenter un entier
+% Représenter un entier dans une base
%%%
-\setKVdefault[ClesREntier]{Echelle=1,Unite=false,Compact=false,Impression=false,ListeCouleurs={Tomato,LightSteelBlue,LightGreen,Cornsilk}}%
+\setKVdefault[ClesRBase]{Base=10,Echelle=1,Unite=false,Compact=false,Impression=false,ListeCouleurs={Tomato,LightSteelBlue,LightGreen,Cornsilk}}%
\newcommand\RepresenterEntier[2][]{%
- \useKVdefault[ClesREntier]%
- \setKV[ClesREntier]{#1}%
- \ifboolKV[ClesREntier]{Unite}{%
- \begin{Geometrie}[TypeTrace="Espace",CoinBG={u*(-10,-10)}]
- Echelle=\useKV[ClesREntier]{Echelle};
+ \useKVdefault[ClesRBase]%
+ \setKV[ClesRBase]{#1}%
+ \ifboolKV[ClesRBase]{Unite}{%
+ \begin{Geometrie}[TypeTrace="Espace",CoinBG={u*(-10,-10)}]%,CoinHD={u*(30,10)}]
+ Base=\useKV[ClesRBase]{Base};
+ Echelle=\useKV[ClesRBase]{Echelle};
Initialisation(5,30,15,50*Echelle);
color A,B,C,D,E,F,G,H;
pointilles:="non";
@@ -16,15 +17,29 @@
\end{Geometrie}
}{%
% On décompose le nombre
- \StrLen{#2}[\LongueurNombreEntier]%
- \xdef\FooListeEntier{}
- \xintFor* ##1 in{\xintSeq{1}{\LongueurNombreEntier}}\do{%
- \StrChar{#2}{##1}[\ChiffreAAjouter]
- \xdef\FooListeEntier{\FooListeEntier \ChiffreAAjouter,}
- }
+ \xintifboolexpr{#2>\fpeval{\useKV[ClesRBase]{Base}**4-1}}{Le nombre est trop grand pour être représenté.}{%
+ \xdef\PfCRetiensDecomp{}%
+ \xdef\PfCResteConversion{#2}%
+% \#2 vaut #2 et $Base+1$ vaut \fpeval{\useKV[ClesRBase]{Base}-1}\\
+ \whiledo{\PfCResteConversion>\fpeval{\useKV[ClesRBase]{Base}-1}}{%
+ \quotient{\PfCResteConversion}{\useKV[ClesRBase]{Base}}
+% Le quotient de \PfCResteConversion{} par \useKV[ClesRBase]{Base} est \the\intquotient\\
+ \modulo{\PfCResteConversion}{\useKV[ClesRBase]{Base}}
+% Le reste de \PfCResteConversion{} par \useKV[ClesRBase]{Base} est \the\remainder\\
+ \xdef\PfCRetiensDecomp{\the\remainder,\PfCRetiensDecomp}
+% Je retiens le reste : \the\remainder\\
+ \xdef\PfCResteConversion{\the\intquotient}
+% Je recommence avec \PfCResteConversion\\
+ }%
+% Je retiens le dernier reste (ou quotient) :
+ \xdef\PfCRetiensDecomp{\PfCResteConversion,\PfCRetiensDecomp}%
+ }%
+% On obtient la décomposition de #2 sous la forme \PfCRetiensDecomp\\
+ % transformation en liste
\setsepchar{,}\ignoreemptyitems
- \readlist*\ListeDesChiffres{\FooListeEntier}%
- \xdef\ListeAvantCouleurs{\useKV[ClesREntier]{ListeCouleurs}}%
+ \readlist*\ListeDesChiffres{\PfCRetiensDecomp}%
+ \xdef\LongueurNombreEntier{\ListeDesChiffreslen}%
+ \xdef\ListeAvantCouleurs{\useKV[ClesRBase]{ListeCouleurs}}%
\readlist*\ListeCouleurEntier{\ListeAvantCouleurs}%
\xintifboolexpr{\LongueurNombreEntier==4}{%
\xdef\NombreMilliers{\ListeDesChiffres[1]}%
@@ -52,11 +67,12 @@
}%
}%
\begin{Geometrie}[TypeTrace="Espace",CoinBG={u*(-10,-10)},CoinHD={u*(20,20)}]
- Echelle=\useKV[ClesREntier]{Echelle};
+ Echelle=\useKV[ClesRBase]{Echelle};
NM=\NombreMilliers;
NC=\NombreCentaines;
ND=\NombreDizaines;
NU=\NombreUnites;
+ Base=\useKV[ClesRBase]{Base};
color ColorEntier[];
ColorEntier1=\ListeCouleurEntier[1];
ColorEntier2=\ListeCouleurEntier[2];
@@ -63,9 +79,9 @@
ColorEntier3=\ListeCouleurEntier[3];
ColorEntier4=\ListeCouleurEntier[4];
boolean Compact,Print;
- Compact=\useKV[ClesREntier]{Compact};
- Print=\useKV[ClesREntier]{Impression};
- Initialisation(5,30,15,50*Echelle);
+ Compact=\useKV[ClesRBase]{Compact};
+ Print=\useKV[ClesRBase]{Impression};
+ Initialisation(5,30,20,50*Echelle);
color A,B,C,D,E,F,G,H;
picture TypePave[];
TypePave0=image(
@@ -72,44 +88,44 @@
trace Pave(A,B,C,D,E,F,G,H)(1,1,1);
currentpicture:=nullpicture;
remplis polygone(A,B,C,H,E,F) withcolor if Print : blanc else: ColorEntier1 fi;
- for k=0 upto 10:
- trace chemin((k/10)[A,B],(k/10)[F,G],(k/10)[E,H]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[A,B],(k/Base)[F,G],(k/Base)[E,H]);
endfor;
- for k=0 upto 10:
- trace chemin((k/10)[B,C],(k/10)[G,H],(k/10)[F,E]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[B,C],(k/Base)[G,H],(k/Base)[F,E]);
endfor;
- for k=0 upto 10:
- trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[A,F],(k/Base)[B,G],(k/Base)[C,H]);
endfor;
);
color A,B,C,D,E,F,G,H;
TypePave1=image(
- trace Pave(A,B,C,D,E,F,G,H)(0.1,1,1);
+ trace Pave(A,B,C,D,E,F,G,H)(1/Base,1,1);
currentpicture:=nullpicture;
remplis polygone(A,B,C,H,E,F) withcolor if Print : blanc else: ColorEntier2 fi;
trace chemin(C,H,E);
- for k=0 upto 10:
- trace chemin((k/10)[A,B],(k/10)[F,G],(k/10)[E,H]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[A,B],(k/Base)[F,G],(k/Base)[E,H]);
endfor;
- for k=0 upto 10:
- trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[A,F],(k/Base)[B,G],(k/Base)[C,H]);
endfor;
);
color A,B,C,D,E,F,G,H;
TypePave2=image(
- trace Pave(A,B,C,D,E,F,G,H)(0.1,0.1,1);
+ trace Pave(A,B,C,D,E,F,G,H)(1/Base,1/Base,1);
currentpicture:=nullpicture;
remplis polygone(A,B,C,H,E,F) withcolor if Print : blanc else: ColorEntier3 fi;
trace chemin(C,H,E);
trace chemin(A,F,E);
trace chemin(B,G,F);
- for k=0 upto 10:
- trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[A,F],(k/Base)[B,G],(k/Base)[C,H]);
endfor;
);
color A,B,C,D,E,F,G,H;
TypePave3=image(
- trace Pave(A,B,C,D,E,F,G,H)(0.1,0.1,0.1);
+ trace Pave(A,B,C,D,E,F,G,H)(1/Base,1/Base,1/Base);
currentpicture:=nullpicture;
remplis polygone(A,B,C,H,E,F) withcolor if Print : blanc else: ColorEntier4 fi;
trace chemin(C,H,E);
@@ -119,32 +135,32 @@
trace chemin(B,G);
);
if Compact:
- for k=0 upto (\NombreMilliers-1):
- trace TypePave0 shifted ((Projette((k,0,0))-Projette((0,0,0))));
+ for k=0 upto (NM-1):
+ trace TypePave0 shifted ((Projette((k/Base,0,0))-Projette((0,0,0))));
endfor;
- for k=0 upto (\NombreCentaines-1):
- trace TypePave1 shifted ((Projette((0.1*k,1.5,0))-Projette((0,0,0))));
+ for k=0 upto (NC-1):
+ trace TypePave1 shifted ((Projette((k/Base,1+1/Base,0))-Projette((0,0,0))));
endfor;
- for k=0 upto (\NombreDizaines-1):
- trace TypePave2 shifted ((Projette((0.1*k,3,0))-Projette((0,0,0))));
+ for k=0 upto (ND-1):
+ trace TypePave2 shifted ((Projette((k/Base,2+2/Base,0))-Projette((0,0,0))));
endfor;
- for k=0 upto (\NombreUnites-1):
- trace TypePave3 shifted ((Projette((0,3.6,0.1*k))-Projette((0,0,0))));
+ for k=0 upto (NU-1):
+ trace TypePave3 shifted ((Projette((k/Base,2+4/Base,0))-Projette((0,0,0))));
endfor;
else:
- for k=0 upto (\NombreMilliers-1):
- trace TypePave0 shifted ((Projette((0,1.1*(k-1),0))-Projette((0,0,0))));
+ for k=0 upto (NM-1):
+ trace TypePave0 shifted ((Projette((0,(1+1/Base)*(k-1),0))-Projette((0,0,0))));
endfor;
- for k=0 upto (\NombreCentaines-1):
- trace TypePave1 shifted ((Projette((0,1.1*\NombreMilliers+1.1*(k-1),0))-Projette((0,0,0))));
+ for k=0 upto (NC-1):
+ trace TypePave1 shifted ((Projette((0,(1+1/Base)*NM+(1+1/Base)*(k-1),0))-Projette((0,0,0))));
endfor;
- for k=0 upto (\NombreDizaines-1):
- trace TypePave2 shifted ((Projette((0,1.1*\NombreMilliers+1.1*(\NombreCentaines-1)+0.2+0.2*(k-1),0))-Projette((0,0,0))));
+ for k=0 upto (ND-1):
+ trace TypePave2 shifted ((Projette((0,(1+1/Base)*NM+(1+1/Base)*(NC-1)+(2/Base)+(2/Base)*(k-1),0))-Projette((0,0,0))));
endfor;
for k=0 upto (\NombreUnites-1):
- trace TypePave3 shifted ((Projette((0,1.1*\NombreMilliers+1.1*(\NombreCentaines-1)+0.2+0.2*(\NombreDizaines-1),0.2*(k)))-Projette((0,0,0))));
+ trace TypePave3 shifted ((Projette((0,(1+1/Base)*NM+(1+1/Base)*(NC-1)+(2/Base)+(2/Base)*(ND-1),(2/Base)*(k)))-Projette((0,0,0))));
endfor;
fi;
\end{Geometrie}
- }
-}
\ No newline at end of file
+ }%
+}%
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCRose.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCRose.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCRose.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,7 +1,7 @@
%%%
% Rose
%%%
-\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}%
+\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}%
\defKV[ClesRose]{LesNombres=\setKV[ClesRose]{Creation}}%
\defKV[ClesRose]{LesProduits=\setKV[ClesRose]{Creation}}%
\defKV[ClesRose]{LesSommes=\setKV[ClesRose]{Addition}}%
@@ -176,6 +176,39 @@
nbpetales:=nbpetales+1;
endfor;
enddef;
+ %
+ vardef AffichagedelaListePDF(text t)=
+ nbpetales:=0;
+ for p_=t:
+ if nbpetales<Petales:
+ if p_="":
+ if Solution:
+ fill rotation(polygone(O,B[Petales-1],A[0],B[Petales]),O,nbpetales*(360/Petales)) withcolor Fond;
+ if unknown FacteurSol[nbpetales]:
+ else:
+ label(LATEX("\num{"&decimal(FacteurSol[nbpetales])&"}"),(0.5[O,A[nbpetales]]-center BoiteRec));
+ fi;
+ fi;
+ else:
+ label(LATEX("\num{"&p_&"}"),(0.5[O,A[nbpetales]]-center BoiteRec));
+ fi;
+ else:
+ if p_="":
+ if Solution:
+ fill (BoiteRec shifted (B[nbpetales-Petales]+0.5*Rayon*unitvector(B[nbpetales-Petales]))) withcolor Fond;
+ if Addition:
+ label(LATEX("\num{\noexpand\fpeval{"&decimal(Facteur[nbpetales-Petales])&"+"&decimal(Facteur[nbpetales+1-Petales])&"}}"),(B[nbpetales-Petales]+0.5*Rayon*unitvector(B[nbpetales-Petales])));
+ else:
+ label(LATEX("\num{\noexpand\fpeval{"&decimal(Facteur[nbpetales-Petales])&"*"&decimal(Facteur[nbpetales+1-Petales])&"}}"),(B[nbpetales-Petales]+0.5*Rayon*unitvector(B[nbpetales-Petales])));
+ fi;
+ fi;
+ else:
+ label(LATEX("\num{"&p_&"}"),(B[nbpetales-Petales]+0.5*Rayon*unitvector(B[nbpetales-Petales])));
+ fi;
+ fi;
+ nbpetales:=nbpetales+1;
+ endfor;
+ enddef;
}
\NewDocumentCommand\DessineRoseMulPerso{mm}{%
@@ -231,7 +264,7 @@
}]
RecupListe(#2);
RechercheFacteurs;
- AffichagedelaListe(#1);
+ AffichagedelaListePDF(#1);
if Aide:
for k=0 upto Petales-1:
drawarrow (0.5[O,A[k]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (B[k]+0.5*Rayon*unitvector(B[k])) dashed evenly scaled 0.5;
@@ -246,9 +279,9 @@
fill cercles(O,4mm) withcolor white;
draw cercles(O,4mm);
if Addition:
- label(TEX("\Huge$+$"),O);
+ label(LATEX("\Huge$+$"),O);
else:
- label(TEX("\Huge$\times$"),O);
+ label(LATEX("\Huge$\times$"),O);
fi;
\end{mpost}
\fi
@@ -270,20 +303,13 @@
if ProduitVide:Solution:=true fi;
if CaseVide:Solution:=true fi;
% on labelise
- if Vide=false:
- if Produits:
- else:
for k=0 upto Petales-1:
label(TEX("\num{"&decimal(Facteur[k])&"}"),(0.5[O,A[k]]-center BoiteRec));
endfor;
- fi;
- if Produits or Solution:
for k=0 upto Petales-1:
label(TEX("\num{"&decimal(Produit[k])&"}"),(B[k]+0.5*Rayon*unitvector(B[k])));
endfor;
- fi;
- fi;
- % On trace et on affiche...éventuellement :)
+ % On trace
if Aide:
for k=0 upto Petales-1:
drawarrow (0.5[O,A[k]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (B[k]+0.5*Rayon*unitvector(B[k])) dashed evenly scaled 0.5;
@@ -290,20 +316,6 @@
drawarrow (0.5[O,A[k+1]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (B[k]+0.5*Rayon*unitvector(B[k])) dashed evenly scaled 0.5;
endfor;
fi;
- if ProduitVide:
- %choix=floor(uniformdeviate(Petales-1));
- fill (BoiteRec shifted (1.75[O,B[choix]]-center BoiteRec)) withcolor Fond;
- fill rotation(polygone(O,B0,A1,B1),O,(choix-1)*(360/Petales)) withcolor Fond;
- fill rotation(polygone(O,B0,A1,B1),O,choix*(360/Petales)) withcolor Fond;
- fi;
- if CaseVide:
- %choix:=floor(uniformdeviate(Petales-1));
- for k=0 upto Petales-1:
- if k<>choix:
- fill rotation(polygone(O,B0,A1,B1),O,k*(360/Petales)) withcolor Fond;
- fi;
- endfor;
- fi;
trace A0 for k=1 upto Petales:--A[k] endfor --cycle;
for k=0 upto Petales-1:
trace segment(O,B[k]) dashed withdots scaled 0.25;
@@ -326,6 +338,7 @@
\begin{mplibcode}[\PfCNomRose]
vardef ExtraireListe(expr nbmin,nbmax,nbfacteurs)=
numeric ElementE[],ElementS[];
+ boolean VueE[];
%% éléments d'entrée
nbe:=1;
for k=nbmin upto nbmax:
@@ -335,6 +348,7 @@
totalE:=(nbmax-nbmin)+1;
numeric rec;
for k=1 upto nbfacteurs:
+ VueE[k-1]=true;
rec:=ceiling(uniformdeviate(totalE+1-k));
ElementS[k]=ElementE[rec];
numeric ElementI[];
@@ -345,6 +359,7 @@
ElementI[p]=ElementE[l];
fi;
endfor;
+ VueE[Petales]:=true;
numeric ElementE[];
for l=1 upto p:
ElementE[l]=ElementI[l];
@@ -353,7 +368,8 @@
enddef;
pair A[],B[],O;
Rayon:=\useKV[ClesRose]{Rayon};
- boolean Aide,Produits,Solution,Vide,ProduitVide,CaseVide,Polygone,Addition;
+ boolean Aide,Produits,Solution,Vide,ProduitVide,CaseVide,Polygone,Addition,Melange;
+ Melange:=\useKV[ClesRose]{Melange};
Addition=\useKV[ClesRose]{Addition};
Aide:=\useKV[ClesRose]{Aide};
Vide:=\useKV[ClesRose]{Vide};
@@ -418,6 +434,37 @@
drawarrow (0.5[O,A[k+1]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (B[k]+0.5*Rayon*unitvector(B[k])) dashed evenly scaled 0.5;
endfor;
fi;
+ if Melange:
+ % on gère les "oublis"
+ nbvide:=0;
+ for k=0 step 2 until Petales-1:
+ if uniformdeviate(1)<0.5:
+ nbk:=k;
+ else:
+ nbk:=k+1
+ fi;
+ VueE[nbk]:=false;
+ endfor;
+ VueE[Petales]:=VueE[0];
+ for k=0 upto Petales-1:
+ fill rotation(polygone(O,B0,A1,B1),O,(k-1)*(360/Petales)) withcolor Fond;
+ if VueE[k]:
+ label(TEX("\num{"&decimal(Facteur[k])&"}"),(0.5[O,A[k]]-center BoiteRec));
+ fi;
+ endfor;
+ % on affiche les produits pour les effacer
+ for k=0 upto Petales-1:
+ if VueE[k]:
+ if VueE[k+1]=false:
+ label(TEX("\num{"&decimal(Produit[k])&"}"),(B[k]+0.5*Rayon*unitvector(B[k])));
+ fi;
+ else:
+ if VueE[k+1]=false:
+ label(TEX("\num{"&decimal(Produit[k])&"}"),(B[k]+0.5*Rayon*unitvector(B[k])));
+ fi;
+ fi;
+ endfor;
+ else:
if ProduitVide:
choix:=floor(uniformdeviate(Petales-1));
fill (BoiteRec shifted (1.75[O,B[choix]]-center BoiteRec)) withcolor Fond;
@@ -432,6 +479,7 @@
fi;
endfor;
fi;
+ fi;
trace A0 for k=1 upto Petales:--A[k] endfor --cycle;
for k=0 upto Petales-1:
trace segment(O,B[k]) dashed withdots scaled 0.25;
@@ -557,9 +605,9 @@
fill cercles(O,3mm) withcolor white;
draw cercles(O,3mm);
if Addition:
- label(TEX("\Large$+$"),O);
+ label(LATEX("\noexpand\Large$+$"),O);
else:
- label(TEX("\Large$\times$"),O);
+ label(LATEX("\noexpand\Large$\times$"),O);
fi;
\end{mpost}
\fi
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCSimplifierFraction.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCSimplifierFraction.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCSimplifierFraction.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -123,7 +123,7 @@
}
\newcount\anpdc\newcount\bnpdc\newcount\cnpdc\newcount\dnpdc%
-\newcount\DivCom
+\newcount\PfCDivCom%
\newcommand\DiviseurCommun[2]{%
% #1 : le premier nombre entier
% #2 : le deuxi\`eme nombre entier
@@ -131,50 +131,50 @@
\cnpdc=#2%
\bnpdc=2\relax%
\dnpdc=\numexpr#1+1\relax%
- \DivCom=1\relax%
+ \PfCDivCom=1\relax%
\whiledo{\bnpdc<\dnpdc}{%
\modulo{\the\anpdc}{\the\bnpdc}\relax
\ifnum\remainder=0%
\modulo{\the\cnpdc}{\the\bnpdc}
\ifnum\remainder=0%
- \DivCom=\bnpdc%
+ \PfCDivCom=\bnpdc%
\bnpdc=\anpdc%
\else%
- \DivCom=1%
+ \PfCDivCom=1%
\fi
\else%
- \DivCom=1%
+ \PfCDivCom=1%
\fi
\bnpdc=\numexpr\bnpdc+1\relax%
}%
}
-\newcommand\LongueSimplification[2]{%
- \xdef\NumerateurDiv{#1}%
- \xdef\DenominateurDiv{#2}%
+\NewDocumentCommand\LongueSimplification{mm}{%
+ \xdef\PfCNumerateurDiv{#1}%
+ \xdef\PfCDenominateurDiv{#2}%
\ifboolKV[ClesSimplification]{Impose}{%
- \DivCom=\useKV[ClesSimplification]{Nombre}%
+ \PfCDivCom=\useKV[ClesSimplification]{Nombre}%
}{%
\DiviseurCommun{#1}{#2}%
}%
\ifboolKV[ClesSimplification]{Debut}{%
\ensuremath{%
- \whiledo{\DivCom>1}{%
- \frac{\mathcolor{PfCSimpliCol}{\num{\the\DivCom}}\times\num{\fpeval{\NumerateurDiv/\the\DivCom}}}{\mathcolor{PfCSimpliCol}{\num{\the\DivCom}}\times\num{\fpeval{\DenominateurDiv/\the\DivCom}}}=\frac{\num{\fpeval{\NumerateurDiv/\DivCom}}}{\num{\fpeval{\DenominateurDiv/\DivCom}}}%
- \xdef\NumerateurDiv{\fpeval{\NumerateurDiv/\DivCom}}%
- \xdef\DenominateurDiv{\fpeval{\DenominateurDiv/\DivCom}}%
- \DiviseurCommun{\NumerateurDiv}{\DenominateurDiv}%
- \xintifboolexpr{\DivCom>1}{=}{}%
+ \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}}}%
+ \xdef\PfCNumerateurDiv{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}%
+ \xdef\PfCDenominateurDiv{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}%
+ \DiviseurCommun{\PfCNumerateurDiv}{\PfCDenominateurDiv}%
+ \xintifboolexpr{\PfCDivCom>1}{=}{}%
}%
}%
}{%
\ensuremath{%
- \whiledo{\DivCom>1}{%
- \frac{\num{\fpeval{\NumerateurDiv/\the\DivCom}}\times\mathcolor{PfCSimpliCol}{\num{\the\DivCom}}}{\num{\fpeval{\DenominateurDiv/\the\DivCom}}\times\mathcolor{PfCSimpliCol}{\num{\the\DivCom}}}=\frac{\num{\fpeval{\NumerateurDiv/\DivCom}}}{\num{\fpeval{\DenominateurDiv/\DivCom}}}%
- \xdef\NumerateurDiv{\fpeval{\NumerateurDiv/\DivCom}}%
- \xdef\DenominateurDiv{\fpeval{\DenominateurDiv/\DivCom}}%
- \DiviseurCommun{\NumerateurDiv}{\DenominateurDiv}%
- \xintifboolexpr{\DivCom>1}{=}{}%
+ \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}}}%
+ \xdef\PfCNumerateurDiv{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}%
+ \xdef\PfCDenominateurDiv{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}%
+ \DiviseurCommun{\PfCNumerateurDiv}{\PfCDenominateurDiv}%
+ \xintifboolexpr{\PfCDivCom>1}{=}{}%
}%
}%
}%
@@ -186,7 +186,7 @@
\newcounter{NbFrac}%
\setcounter{NbFrac}{0}%
-\newcommand\Simplification[3][]{%
+\NewDocumentCommand\Simplification{omm}{%
\stepcounter{NbFrac}%
\useKVdefault[ClesSimplification]%
\setKV[ClesSimplification]{#1}%
@@ -198,15 +198,15 @@
\setbox2=\hbox{\Listeb[1,1]}%
\setbox3=\hbox{\Listea[1,3]}%
\setbox4=\hbox{\Listeb[1,3]}%
- \ensuremath{%
- \frac{\tikzmarknode[anchor=north]{A-\theNbFrac}{\Listea[1,1]}{}}{\tikzmarknode[anchor=south]{B-\theNbFrac}{\Listeb[1,1]}{}}=\frac{\tikzmarknode[anchor=north]{C-\theNbFrac}{\Listea[1,3]}{}}{\tikzmarknode[anchor=south]{D-\theNbFrac}{\Listeb[1,3]}{}}%
- }%
- \begin{tikzpicture}[remember picture,overlay]%
- \draw[out=45,in=135,-stealth,transform canvas={yshift=0.25em}]
- let
- \p1=(pic cs:A-\theNbFrac),
- \p2=(pic cs:C-\theNbFrac)
- in (pic cs:A-\theNbFrac) to node[midway,above]{\Listea[1,2]}(\x2,\y1);
+ \ensuremath{%
+ \frac{\tikzmarknode[anchor=north]{A-\theNbFrac}{\Listea[1,1]}{}}{\tikzmarknode[anchor=south]{B-\theNbFrac}{\Listeb[1,1]}{}}=\frac{\tikzmarknode[anchor=north]{C-\theNbFrac}{\Listea[1,3]}{}}{\tikzmarknode[anchor=south]{D-\theNbFrac}{\Listeb[1,3]}{}}%
+ }%
+ \begin{tikzpicture}[remember picture,overlay]%
+ \draw[out=45,in=135,-stealth,transform canvas={yshift=0.25em}]
+ let
+ \p1=(pic cs:A-\theNbFrac),
+ \p2=(pic cs:C-\theNbFrac)
+ in (pic cs:A-\theNbFrac) to node[midway,above]{\Listea[1,2]}(\x2,\y1);
\draw[out=-45,in=-135,-stealth,transform canvas={yshift=-0.25em}] (pic cs:B-\theNbFrac) to node[midway,below]{\Listeb[1,2]}(pic cs:D-\theNbFrac);%
\end{tikzpicture}%
}{%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -18,7 +18,7 @@
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,%
+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,%
% 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,%
%Pour les représentations
@@ -464,7 +464,7 @@
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;
+ boolean Rotation,Lecture,LectureFine,AideLecture,DonneesSup,Reponses,Qualitatif,Tiret,LegendeVide,Retour,GrandNombrex,GrandNombrey,Date,Grille;
GrandNombrex=\useKV[ClesStat]{GrandNombrex};
GrandNombrey=\useKV[ClesStat]{GrandNombrey};
if GrandNombrex:
@@ -485,6 +485,11 @@
Qualitatif=\useKV[ClesStat]{Qualitatif};
Tiret=\useKV[ClesStat]{Tiret};
Retour=false;
+ Grille:=\useKV[ClesStat]{Grille};
+ Pasx:=\useKV[ClesStat]{Pasx};
+ Pasy:=\useKV[ClesStat]{Pasy};
+ PasGrillex:=\useKV[ClesStat]{PasGrillex};
+ PasGrilley:=\useKV[ClesStat]{PasGrilley};
color CoulDefaut;
CoulDefaut=\useKV[ClesStat]{CouleurDefaut};
Depart=\useKV[ClesStat]{Depart};
@@ -635,16 +640,13 @@
endfor;
enddef;
if Qualitatif: tutu(#1); else: toto(#1); fi;
- boolean Grille;
- Grille:=\useKV[ClesStat]{Grille};
- Pasx:=\useKV[ClesStat]{Pasx};
- Pasy:=\useKV[ClesStat]{Pasy};
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if Grille:
drawoptions(withcolor 0.75white);
- for k=0 step Pasx until ((maxx+1)):
- trace (k*unitex,0)--(k*unitex,unitey*(maxy+2*Pasy));
+ for k=0 step PasGrillex until ((maxx+1)):
+ trace (k*unitex,0)--(k*unitex,unitey*((floor(maxy/Pasy)+1)*Pasy));
endfor;
- for k=0 step Pasy until ((maxy+2*Pasy)):
+ for k=0 step PasGrilley until (floor(maxy/Pasy)+1)*Pasy:%((maxy+2*Pasy)):
trace (0,k*unitey)--(unitex*(maxx+1),k*unitey);
endfor;
drawoptions();
@@ -694,9 +696,9 @@
endfor;
fi;
drawarrow (0,0)--unitex*(maxx+1,0);
- drawarrow (0,0)--unitey*(0,maxy+2*Pasy);
+ drawarrow (0,0)--unitey*(0,(floor(maxy/Pasy)+1)*Pasy);
label.lrt(btex \useKV[ClesStat]{Donnee} etex,unitex*(maxx+1,0));
- label.urt(btex \useKV[ClesStat]{Effectif} etex,unitey*(0,maxy+2*Pasy));
+ label.urt(btex \useKV[ClesStat]{Effectif} etex,unitey*(0,(floor(maxy/Pasy)+1)*Pasy));
if Qualitatif: titi(#1); else:tata(#1); fi;
\end{mplibcode}
\else
@@ -837,6 +839,7 @@
LegendeVide=\useKV[ClesStat]{LegendeVide};
Retour=false;
ACompleter=\useKV[ClesStat]{ACompleter};
+ DebutAngle=\useKV[ClesStat]{DebutAngle};
%
pair A[],O,B[],C[],D[];
O=(0,0);
@@ -933,7 +936,7 @@
\mplibforcehmode
\begin{mplibcode}
\NewMPStatCirculaireCodeQ
- DebutAngle=\useKV[ClesStat]{DebutAngle};
+% DebutAngle=\useKV[ClesStat]{DebutAngle};
if Inverse=false:
A[0]=point(0+DebutAngle) of cc;
else:
@@ -1072,7 +1075,12 @@
fi;
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={\NewMPStatCirculaireCodeQ}]
+ \begin{mpost}[mpsettings={\NewMPStatCirculaireCodeQ}]
+ if Inverse=false:
+ A[0]=point(0+DebutAngle) of cc;
+ else:
+ A[0]=point(180+DebutAngle) of cc;
+ fi;
pair A[],O,B[],C[],D[];
O=(0,0);
n:=0;
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/PfCTableauxUnites.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/PfCTableauxUnites.tex 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/PfCTableauxUnites.tex 2023-09-07 20:15:03 UTC (rev 68199)
@@ -1,7 +1,7 @@
%%%
% Tableaux d'unit\'es
%%%
-\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1,Octet=false,CouleurGN=white,CadreGN=black}
+\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1,Octet=false,CouleurGN=white,CadreGN=black,Tabcolsep=0.275\tabcolsep}
\newcommand\PfCTBstrut{\rule[-1.2ex]{0pt}{3.8ex}}% Top and Bottom strut
\newcommand\PfCTstrut{\rule{0pt}{3.8ex}}% Top strut
@@ -8,6 +8,7 @@
\newcommand\PfCBstrut{\rule[-1.2ex]{0pt}{0ex}}% Bottom strut
\newlength\PfCTableauPuissances%
+\newlength\PfCCubeTabColSep
\def\PfCCG{centaines de milliards}
\def\PfCDG{dizaines de milliards}
@@ -1179,10 +1180,11 @@
%%% Prise en compte de la cl\'e Cube
%
\ifboolKV[ClesTableaux]{Cube}{%
+ \setlength{\PfCCubeTabColSep}{\useKV[ClesTableaux]{Tabcolsep}}
\[\renewcommand{\arraystretch}{1.15}%
% \setlength{\tabcolsep}{0.625\tabcolsep}%
% \begin{NiceTabular}{*{7}{wc{3.5mm}wc{3.5mm}wc{3.5mm}}}
- \setlength{\tabcolsep}{0.275\tabcolsep}%
+ \setlength{\tabcolsep}{\PfCCubeTabColSep}%
\begin{NiceTabular}{*{7}{wc{15pt}wc{15pt}wc{15pt}}}
\Block[]{1-3}{}%
&&&\Block[]{1-3}{}%
Modified: trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty 2023-09-07 20:14:13 UTC (rev 68198)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty 2023-09-07 20:15:03 UTC (rev 68199)
@@ -2,9 +2,9 @@
% licence : Released under the LaTeX Project Public License v1.3c
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}%
-\def\filedate{2023/08/16}%
+\def\filedate{2023/09/06}%
\let\PfCfiledate\filedate%
-\def\fileversion{0.99-z-s}%
+\def\fileversion{0.99-z-t}%
\let\PfCfileversion\fileversion%
\ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]%
@@ -31,7 +31,8 @@
reset-text-series = false, reset-text-shape = false,%
text-family-to-math = true, text-series-to-math = true,%
output-decimal-marker={,},%
- group-minimum-digits=4%
+ group-minimum-digits=4,%
+ quantity-product={~}%
}%
\DeclareSIUnit{\kmh}{\km\per\hour}%
\newcommand\speed[1]{\SI{#1}{\kmh}}%
@@ -360,6 +361,31 @@
\day=\the\PfCrappeljour\relax%
}
+\newcommand\MelangeLettres[2]{%
+ % #2 Nombre d'éléments à conserver
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeInter{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z}%
+ \xdef\faa{}% Liste construite
+ \xdef\fii{}% Liste détruite
+ \xintFor* ##1 in {\xintSeq{1}{#1}}\do{%
+ \xintifboolexpr{\ListeInterlen>1}{%
+ \xdef\Alea{\fpeval{randint(\ListeInterlen)}}%
+ \xdef\faa{\faa\ListeInter[\Alea]}%
+ \xdef\fii{}%
+ \xintFor* ##2 in {\xintSeq{1}{\ListeInterlen}}\do{%
+ \xintifboolexpr{##2 == \Alea}{%
+ }{%
+ \xdef\fii{\fii \ListeInter[##2],}%
+ }%
+ }%
+ }{%
+ \xdef\faa{\faa\ListeInter[1]}%
+ }%
+ \readlist*\ListeInter{\fii}%
+ }%
+ \xdef#2{\faa}%
+}%
+
\newcommand\MelangeListe[2]{%
% #1 Liste à mélanger
% #2 Nombre d'éléments à conserver
@@ -573,6 +599,10 @@
}%\emoticon
}%\raisebox
}%
+\input{PfCCibleQOp}
+\input{PfCFubuki}
+\input{PfCMulJap}
+\input{PfCCryptarithme}
\input{PfCDefiCalc}
\input{PfCMulArt}
\input{PfCGrimuku}
@@ -583,7 +613,7 @@
\input{PfCAutomatismes}
\input{PfCNumberHive}
\input{PfCPatronPaves}
-\input{PfCErathostene}
+\input{PfCEratosthene}
\input{PfCDobble}
\input{PfCPavage}
\input{PfCNonogramme}
@@ -686,7 +716,7 @@
\ensuremath{%
\xintifboolexpr{#2==0}{1}{\xintifboolexpr{#2>0}{\xdef\TotalP{\fpeval{#2-1}}#1\multido{\i=1+1}{\TotalP}{\times#1}}{\xdef\TotalP{\fpeval{-#2-1}}\frac{1}{#1\multido{\i=1+1}{\TotalP}{\times#1}}}}%
}%
-}
+}%
\input{PfCEcritureUnites}
\input{PfCTableauxUnites}
More information about the tex-live-commits
mailing list.