summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/profcollege
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-11-14 03:01:05 +0000
committerNorbert Preining <norbert@preining.info>2023-11-14 03:01:05 +0000
commite20928a0f9f4a7faa8bb21915e761e11e34f04ff (patch)
tree32b28652fc038d4e06485fe1eb5a25517d15ef87 /macros/latex/contrib/profcollege
parent88ed039ed13674ce7440cc57dba288cf166796fe (diff)
CTAN sync 202311140301
Diffstat (limited to 'macros/latex/contrib/profcollege')
-rw-r--r--macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdfbin9664421 -> 9706655 bytes
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCAN.tex2
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex40
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCalculsFractionsoldv1.tex192
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCritere.tex127
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex24
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDefiCalc.tex13
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDefiTables.tex2
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDistributivite.tex20
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex32
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCErathostene.tex80
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFractionNombre.tex30
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCGeometrie.tex6
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCKakuro.tex2
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCKenKen.tex2
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMotsCodes.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex24
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCNumberHive.tex6
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCProgrammeCalcul.tex157
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCProprietesDroites.tex34
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPythagore.tex41
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCQuestionsFlash.tex1
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCQuestionsRelier.tex11
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRangementNombres.tex41
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRapido.tex1
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCReperage.tex743
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRepresenterFraction.tex2
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex6
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex97
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCSommeAngles.tex2
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCStatistiques.tex13
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex48
-rw-r--r--macros/latex/contrib/profcollege/latex/ProfCollege.sty68
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp11
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCScratch.mp22
35 files changed, 1159 insertions, 745 deletions
diff --git a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
index de905b070a..b13797000f 100644
--- a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
+++ b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/profcollege/latex/PfCCAN.tex b/macros/latex/contrib/profcollege/latex/PfCCAN.tex
index 9e4b195e48..5334568dff 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCAN.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCAN.tex
@@ -79,7 +79,7 @@
\setsepchar{,}%
\readlist*\ListeObjetsCAN{bonbons,billes,jouets,fruits,biscuits,gâteaux,pommes,poires,pains au chocolat,cookies,croissants,muffins,brioches,saucisses,cuisses de poulet}%
\readlist*\ListePetitsObjetsCAN{bonbons,billes,biscuits,gommes,clous,vis}
-\readlist*\ListeFruitsCAN{pommes,poires,abricots,cerises,fraises,framboises,noix,pêches,nectarines,myrtilles}
+\readlist*\ListeFruitsCAN{pommes,poires,abricots,cerises,fraises,framboises,noix,pêches,nectarines,myrtilles,oranges,mandarines}
\readlist*\ListeSommetsCAN{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}
\newcommand\ExtraitPetitsObjets[1]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex b/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex
index 06a02de387..fdf037ef81 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex
@@ -1,11 +1,32 @@
\setKVdefault[CalculsFractions]{Couleurs=false,Negatif=false}%
-\defKV[CalculsFractions]{Couleur=\setKV[CalculsFractions]{Couleurs}}%
+\defKV[CalculsFractions]{Couleur=\setKV[CalculsFractions]{Couleurs}\setKV[ClesSimplification]{Couleur=#1}}%
\NewDocumentCommand\tofrac{m}{%
\IfDecimal{#1}{#1}{%
\StrBefore{#1}{/}[\PfCnum]%
\StrBehind{#1}{/}[\PfCden]%
- \frac{\PfCnum}{\PfCden}%
+ \ifnum\PfCden=1\relax%
+ \num{\PfCnum}%
+ \else%
+ \frac{\num{\PfCnum}}{\num{\PfCden}}%
+ \fi%
+ }%
+}%
+
+\NewDocumentCommand\Tofrac{m}{%
+ \IfDecimal{#1}{#1}{%
+ \StrBefore{#1}{/}[\PfCnum]%
+ \StrBehind{#1}{/}[\PfCden]%
+ \ifnum\PfCden=1\relax%
+ \num{\PfCnum}%
+ \else%
+ %\PGCD{\PfCnum}{\PfCden}%
+ %\ifnum\the\pgcd>1\relax%
+ \Simplification{\PfCnum}{\PfCden}%\frac{\num{\PfCnum}}{\num{\PfCden}}%
+ %\else%
+ %\frac{\num{\PfCnum}}{\num{\PfCden}}%
+ %\fi%
+ \fi%
}%
}%
@@ -36,8 +57,10 @@
\reademptyitems%
\setsepchar{,}%
% Partie calculs
- \PGCD{\ListeFractions[1,2]}{\ListeFractions[2,2]}%
+ \PGCD{\fpeval{abs(\ListeFractions[1,2])}}{\fpeval{abs(\ListeFractions[2,2])}}%
+% pgcd=\the\pgcd%
\xdef\PfCPremierMul{\fpeval{\ListeFractions[2,2]/\the\pgcd}}%
+% PfCPremierMul=\PfCPremierMul
\xdef\PfCDeuxiemeMul{\fpeval{\ListeFractions[1,2]/\the\pgcd}}%
\xdef\PfCAddNumFin{\fpeval{(\ListeFractions[1,1])*(\PfCPremierMul)\PfCFractionOp(\ListeFractions[2,1])*(\PfCDeuxiemeMul)}}%
\xdef\PfCAddDenoFin{\fpeval{(\ListeFractions[1,2])*(\PfCPremierMul)}}%
@@ -59,14 +82,14 @@
\SSimpliTest{\fpeval{abs(\PfCAddNumFin)}}{\fpeval{abs(\PfCAddDenoFin)}}\ifthenelse{\boolean{Simplification}}{\tofrac{\PfCAddNumFin/\PfCAddDenoFin}}{\tofrac{\PfCAddSumSimp}}%
\else%
\ifnum#3=1\relax%
- \ifnum\PfCPremierMul>1\relax%
- \frac{\ListeFractions[1,1]_{\mathcolor{CouleurDenoCom}{\times\num{\PfCPremierMul}}}}{\ListeFractions[1,2]_{\mathcolor{CouleurDenoCom}{\times\num{\PfCPremierMul}}}}
+ \ifnum\fpeval{abs(\PfCPremierMul)}>1\relax%
+ \frac{\ListeFractions[1,1]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCPremierMul}}}}{\ListeFractions[1,2]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCPremierMul}}}}
\else%
\tofrac{#4}%
\fi%
\PfCFractionOp%
- \ifnum\PfCDeuxiemeMul>1\relax%
- \frac{\ListeFractions[2,1]_{\mathcolor{CouleurDenoCom}{\times\num{\PfCDeuxiemeMul}}}}{\ListeFractions[2,2]_{\mathcolor{CouleurDenoCom}{\times\num{\PfCDeuxiemeMul}}}}%
+ \ifnum\fpeval{abs(\PfCDeuxiemeMul)}>1\relax%
+ \frac{\ListeFractions[2,1]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCDeuxiemeMul}}}}{\ListeFractions[2,2]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCDeuxiemeMul}}}}%
\else%
\tofrac{#5}%
\fi%
@@ -122,7 +145,8 @@
}{\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}}%
+ %\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}}%
+ \DecompositionSimplificationSeule{\PfCMulNumFin}{\PfCMulDenoFin}%
\else%
\ifnum#2=1\relax%
\frac{\ListeFractions[1,1]\times\ifnum\ListeFractions[2,1]<0\relax(\fi\ListeFractions[2,1]\ifnum\ListeFractions[2,1]<0\relax)\fi}{\ListeFractions[1,2]\times\ifnum\ListeFractions[2,2]<0\relax(\fi\ListeFractions[2,2]\ifnum\ListeFractions[2,2]<0\relax)\fi}
diff --git a/macros/latex/contrib/profcollege/latex/PfCCalculsFractionsoldv1.tex b/macros/latex/contrib/profcollege/latex/PfCCalculsFractionsoldv1.tex
new file mode 100644
index 0000000000..0e4dac5a68
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCCalculsFractionsoldv1.tex
@@ -0,0 +1,192 @@
+\setKVdefault[CalculsFractions]{Couleurs=false,Negatif=false}%
+\defKV[CalculsFractions]{Couleur=\setKV[CalculsFractions]{Couleurs}}%
+
+\NewDocumentCommand\tofrac{m}{%
+ \IfDecimal{#1}{#1}{%
+ \StrBefore{#1}{/}[\PfCnum]%
+ \StrBehind{#1}{/}[\PfCden]%
+ \ifnum\PfCden=1\relax%
+ \num{\PfCnum}%
+ \else%
+ \frac{\num{\PfCnum}}{\num{\PfCden}}%
+ \fi%
+ }%
+}%
+
+\NewDocumentCommand\AddFraction{soommo}{%
+ \useKVdefault[CalculsFractions]%
+ \setKV[CalculsFractions]{#2}%
+ \ifboolKV[CalculsFractions]{Couleurs}{\colorlet{CouleurDenoCom}{\useKV[CalculsFractions]{Couleur}}}{\colorlet{CouleurDenoCom}{black}}%
+ \IfBooleanTF{#1}{%
+ \xdef\PfCFractionOp{-}%
+ }{%
+ \xdef\PfCFractionOp{+}%
+ }%
+ \IfDecimal{#4}{%
+ \xdef\PfCNumA{#4}%
+ \xdef\PfCNumB{1}%
+ }{%
+ \StrCut{#4}{/}\PfCNumA\PfCNumB%
+ }%
+ \IfDecimal{#5}{%
+ \xdef\PfCNumC{#5}%
+ \xdef\PfCNumD{1}%
+ }{%
+ \StrCut{#5}{/}\PfCNumC\PfCNumD%
+ }
+ \xdef\PfCAddFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
+ \setsepchar[*]{,*/}\ignoreemptyitems%
+ \readlist*\ListeFractions{\PfCAddFoo}%
+ \reademptyitems%
+ \setsepchar{,}%
+ % Partie calculs
+ \PGCD{\fpeval{abs(\ListeFractions[1,2])}}{\fpeval{abs(\ListeFractions[2,2])}}%
+% pgcd=\the\pgcd%
+ \xdef\PfCPremierMul{\fpeval{\ListeFractions[2,2]/\the\pgcd}}%
+% PfCPremierMul=\PfCPremierMul
+ \xdef\PfCDeuxiemeMul{\fpeval{\ListeFractions[1,2]/\the\pgcd}}%
+ \xdef\PfCAddNumFin{\fpeval{(\ListeFractions[1,1])*(\PfCPremierMul)\PfCFractionOp(\ListeFractions[2,1])*(\PfCDeuxiemeMul)}}%
+ \xdef\PfCAddDenoFin{\fpeval{(\ListeFractions[1,2])*(\PfCPremierMul)}}%
+ \PGCD{\fpeval{abs(\PfCAddNumFin)}}{\fpeval{abs(\PfCAddDenoFin)}}\xdef\PfCAddPgcd{\the\pgcd}%
+ \xdef\PfCAddNumSimp{\fpeval{\PfCAddNumFin/\PfCAddPgcd}}%
+ \xdef\PfCAddDenoSimp{\fpeval{\PfCAddDenoFin/\PfCAddPgcd}}%
+ \xdef\PfCAddSumSimp{\PfCAddNumSimp/\PfCAddDenoSimp}%
+ \IfValueT{#6}{\xdef#6{\PfCAddSumSimp}}%
+ % Partie affichage
+ \ensuremath{%
+ \IfValueTF{#3}{%
+ \ifnum#3=4\relax%
+ %test
+ \ifboolKV[CalculsFractions]{Negatif}{%
+ \xintifboolexpr{\fpeval{\PfCAddNumSimp/\PfCAddDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCAddNumSimp)}/\fpeval{abs(\PfCAddDenoSimp)}}}{\tofrac{\PfCAddSumSimp}}%
+ }{\tofrac{\PfCAddSumSimp}}%
+ \else%
+ \ifnum#3=3\relax%
+ \SSimpliTest{\fpeval{abs(\PfCAddNumFin)}}{\fpeval{abs(\PfCAddDenoFin)}}\ifthenelse{\boolean{Simplification}}{\tofrac{\PfCAddNumFin/\PfCAddDenoFin}}{\tofrac{\PfCAddSumSimp}}%
+ \else%
+ \ifnum#3=1\relax%
+ \ifnum\fpeval{abs(\PfCPremierMul)}>1\relax%
+ \frac{\ListeFractions[1,1]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCPremierMul}}}}{\ListeFractions[1,2]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCPremierMul}}}}
+ \else%
+ \tofrac{#4}%
+ \fi%
+ \PfCFractionOp%
+ \ifnum\fpeval{abs(\PfCDeuxiemeMul)}>1\relax%
+ \frac{\ListeFractions[2,1]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCDeuxiemeMul}}}}{\ListeFractions[2,2]_{\mathcolor{CouleurDenoCom}{\times\NumMA{\PfCDeuxiemeMul}}}}%
+ \else%
+ \tofrac{#5}%
+ \fi%
+ \else%
+ \ifnum#3=2\relax%
+ \frac{\num{\fpeval{\ListeFractions[1,1]*\PfCPremierMul}}}{\num{\fpeval{\ListeFractions[1,2]*\PfCPremierMul}}}\PfCFractionOp\frac{\num{\fpeval{\ListeFractions[2,1]*\PfCDeuxiemeMul}}}{\num{\fpeval{\ListeFractions[2,2]*\PfCDeuxiemeMul}}}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ }{\tofrac{#4}\PfCFractionOp\tofrac{#5}
+ }%
+ }%
+}%
+
+\NewDocumentCommand\SousFraction{oommo}{%
+ \AddFraction*[#1][#2]{#3}{#4}[#5]%
+}%
+
+\NewDocumentCommand\MulFraction{oommo}{%
+ \useKVdefault[CalculsFractions]%
+ \setKV[CalculsFractions]{#1}%
+ \IfDecimal{#3}{%
+ \xdef\PfCNumA{#3}%
+ \xdef\PfCNumB{1}%
+ }{%
+ \StrCut{#3}{/}{\PfCNumA}{\PfCNumB}%
+ }%
+ \IfDecimal{#4}{%
+ \xdef\PfCNumC{#4}%
+ \xdef\PfCNumD{1}%
+ }{%
+ \StrCut{#4}{/}{\PfCNumC}{\PfCNumD}%
+ }%
+ \xdef\PfCMulFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
+ \setsepchar[*]{,*/}\ignoreemptyitems%
+ \readlist*\ListeFractions{\PfCMulFoo}%
+ \reademptyitems
+ \setsepchar{,}%
+ % Calculs
+ \xdef\PfCMulNumFin{\fpeval{(\ListeFractions[1,1])*(\ListeFractions[2,1])}}
+ \xdef\PfCMulDenoFin{\fpeval{\ListeFractions[1,2]*\ListeFractions[2,2]}}
+ \PGCD{\fpeval{abs(\PfCMulNumFin)}}{\fpeval{abs(\PfCMulDenoFin)}}\xdef\PfCMulPgcd{\pgcd}%
+ \xdef\PfCMulNumSimp{\fpeval{\PfCMulNumFin/\PfCMulPgcd}}%
+ \xdef\PfCMulDenoSimp{\fpeval{\PfCMulDenoFin/\PfCMulPgcd}}%
+ \xdef\PfCMulPdtSimp{\PfCMulNumSimp/\PfCMulDenoSimp}%
+ \IfValueT{#5}{\xdef#5{\PfCMulPdtSimp}}%
+ \ensuremath{%
+ \IfValueTF{#2}{%
+ \ifnum#2=3\relax
+ \ifboolKV[CalculsFractions]{Negatif}{%
+ \xintifboolexpr{\fpeval{\PfCMulNumSimp/\PfCMulDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCMulNumSimp)}/\fpeval{abs(\PfCMulDenoSimp)}}}{\tofrac{\PfCMulPdtSimp}}%
+ }{\tofrac{\PfCMulPdtSimp}}%
+ \else
+ \ifnum#2=2\relax%
+ \SSimpliTest{\PfCMulNumFin}{\PfCMulDenoFin}\ifthenelse{\boolean{Simplification}}{\frac{\ifnum\PfCMulNumFin<0\relax-\fi\Decomposition[Longue]{\fpeval{abs(\PfCMulNumFin)}}}{\ifnum\PfCMulDenoFin<0\relax-\fi\Decomposition[Longue]{\fpeval{abs(\PfCMulDenoFin)}}}}{\tofrac{\PfCMulPdtSimp}}%
+ \else%
+ \ifnum#2=1\relax%
+ \frac{\ListeFractions[1,1]\times\ifnum\ListeFractions[2,1]<0\relax(\fi\ListeFractions[2,1]\ifnum\ListeFractions[2,1]<0\relax)\fi}{\ListeFractions[1,2]\times\ifnum\ListeFractions[2,2]<0\relax(\fi\ListeFractions[2,2]\ifnum\ListeFractions[2,2]<0\relax)\fi}
+ \fi
+ \fi
+ \fi
+ }{\tofrac{#3}\times\tofrac{#4}
+ }
+ }%
+}%
+
+\NewDocumentCommand\DivFraction{oommo}{%
+ \useKVdefault[CalculsFractions]%
+ \setKV[CalculsFractions]{#1}%
+ \IfDecimal{#3}{%
+ \xdef\PfCNumA{#3}%
+ \xdef\PfCNumB{1}%
+ }{%
+ \StrCut{#3}{/}{\PfCNumA}{\PfCNumB}%
+ }%
+ \IfDecimal{#4}{%
+ \xdef\PfCNumC{#4}%
+ \xdef\PfCNumD{1}%
+ }{%
+ \StrCut{#4}{/}{\PfCNumC}{\PfCNumD}%
+ }%
+ \xdef\PfCDivFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
+ \setsepchar[*]{,*/}\ignoreemptyitems%
+ \readlist*\ListeFractions{\PfCDivFoo}%
+ \reademptyitems%
+ \setsepchar{,}%
+ % Calculs
+ \xdef\PfCDivNumFin{\fpeval{(\ListeFractions[1,1])*(\ListeFractions[2,2])}}%
+ \xdef\PfCDivDenoFin{\fpeval{\ListeFractions[1,2]*\ListeFractions[2,1]}}%
+ \PGCD{\fpeval{abs(\PfCDivNumFin)}}{\fpeval{abs(\PfCDivDenoFin)}}\xdef\PfCDivPgcd{\pgcd}%
+ \xdef\PfCDivNumSimp{\fpeval{\PfCDivNumFin/\PfCDivPgcd}}%
+ \xdef\PfCDivDenoSimp{\fpeval{\PfCDivDenoFin/\PfCDivPgcd}}%
+ \xdef\PfCDivPdtSimp{\PfCDivNumSimp/\PfCDivDenoSimp}%
+ \IfValueT{#5}{\xdef#5{\PfCDivPdtSimp}}%
+ \ensuremath{%
+ \IfValueTF{#2}{%
+ \ifnum#2=4\relax
+ \ifboolKV[CalculsFractions]{Negatif}{%
+ \xintifboolexpr{\fpeval{\PfCDivNumSimp/\PfCDivDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCDivNumSimp)}/\fpeval{abs(\PfCDivDenoSimp)}}}{\tofrac{\PfCDivPdtSimp}}%
+ }{\tofrac{\PfCDivPdtSimp}}%
+ \else\ifnum#2=3\relax
+ \MulFraction[][\fpeval{#2-1}]{\ListeFractions[1,1]/\ListeFractions[1,2]}{\ListeFractions[2,2]/\ListeFractions[2,1]}%
+ \else
+ \ifnum#2=2\relax%
+ \MulFraction[][\fpeval{#2-1}]{\ListeFractions[1,1]/\ListeFractions[1,2]}{\ListeFractions[2,2]/\ListeFractions[2,1]}%
+ \else%
+ \ifnum#2=1\relax%
+ \tofrac{\ListeFractions[1,1]/\ListeFractions[1,2]}\times\tofrac{\ListeFractions[2,2]/\ListeFractions[2,1]}
+ \fi
+ \fi
+ \fi
+ \fi
+ }{\tofrac{#3}\div\tofrac{#4}
+ }
+ }%
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCCritere.tex b/macros/latex/contrib/profcollege/latex/PfCCritere.tex
new file mode 100644
index 0000000000..3fd554b0ba
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCCritere.tex
@@ -0,0 +1,127 @@
+%%%
+% Criteres de divisibilite
+%%%
+\setKVdefault[Critere]{Div=2,Remarque=false,All=false,RemarqueAll=false}
+
+\NewDocumentCommand\Critere{om}{%
+ \useKVdefault[Critere]%
+ \setKV[Critere]{#1}%
+ \xdef\PfCListeARetenirCriteres{}%
+ \ifboolKV[Critere]{All}{%
+ \begin{itemize}
+ \item \CritereDeux{#2}%
+ \item \CritereTrois{#2}
+ \item \CritereQuatre{#2}
+ \item \CritereCinq{#2}
+ \item \CritereNeuf{#2}
+ \item \CritereDix{#2}
+ \end{itemize}
+ \ifx\bla\PfCListeARetenirCriteres\bla%
+ \else
+ \setsepchar{,}\ignoreemptyitems
+ \readlist*\PfCAfficheDivCriteres{\PfCListeARetenirCriteres}%
+ \xdef\PfCNumListe{}%
+ En appliquant les critères de divisibilité connus, \num{#2} est donc divisible par \num{\PfCAfficheDivCriteres[1]}%
+ \xintifboolexpr{\PfCAfficheDivCritereslen>1}{\xintFor* ##1 in{\xintSeq{2}{\PfCAfficheDivCritereslen}}\do{%
+ \xintifForLast{ et }{ ; }\num{\PfCAfficheDivCriteres[##1]}%
+ }%
+ }{}.%
+ \ifboolKV[Critere]{RemarqueAll}{\\\textbf{Remarque} : La liste des diviseurs de \num{#2} est \ListeDiviseur{#2}.}{}
+ \fi%
+ }{%
+ \IfStrEqCase{\useKV[Critere]{Div}}{%
+ {2}{\CritereDeux{#2}}%
+ {3}{\CritereTrois{#2}}%
+ {4}{\CritereQuatre{#2}}%
+ {5}{\CritereCinq{#2}}%
+ {9}{\CritereNeuf{#2}}%
+ {10}{\CritereDix{#2}}%
+ }%
+ }%
+}%
+
+\NewDocumentCommand\CritereDeux{m}{%
+ \StrRight{#1}{1}[\PfCCriDeuxUnite]%
+ Le chiffre des unités de \num{#1} est \num{\PfCCriDeuxUnite}. Donc \num{#1} %
+ \modulo{\PfCCriDeuxUnite}{2}%
+ \ifnum\remainder=0\relax%
+ est divisible par 2.%
+ \ifboolKV[Critere]{Remarque}{\\\textbf{Remarque} : $\num{#1}=\num{\fpeval{#1/2}}\times2$.}{}%
+ \xdef\PfCListeARetenirCriteres{\PfCListeARetenirCriteres,2}%
+ \else%
+ n'est pas divisible par 2.%
+ \fi%
+}%
+
+\NewDocumentCommand\CritereTrois{m}{%
+ La somme des chiffres de \num{#1} est \PfCSommeChiffres{#1}. Comme \num{\PfCSMSomme} %
+ \modulo{\PfCSMSomme}{3}%
+ \ifnum\remainder=0\relax%
+ est divisible par 3, alors \num{#1} est aussi divisible par 3.%
+ \ifboolKV[Critere]{Remarque}{\\\textbf{Remarque} : $\num{#1}=\num{\fpeval{#1/3}}\times3$.}{}%
+ \xdef\PfCListeARetenirCriteres{\PfCListeARetenirCriteres,3}%
+ \else%
+ n'est pas divisible par 3, alors \num{#1} n'est pas divisible par 3.%
+ \fi%
+}%
+
+\NewDocumentCommand\CritereQuatre{m}{%
+ \ifnum#1<100%
+ \quotient{#1}{4}%
+ \modulo{#1}{4}%
+ \ifnum\remainder=0\relax
+ Comme $\num{#1}=\num{\the\intquotient}\times4$ alors \num{#1} est divisible par 4.
+ \xdef\PfCListeARetenirCriteres{\PfCListeARetenirCriteres,4}%
+ \else
+ Comme $\num{#1}=\num{\the\intquotient}\times4+\num{\the\remainder}$ alors \num{#1} n'est pas divisible par 4.
+ \fi
+ \else
+ \StrRight{#1}{2}[\PfCCriQuatreUnite]%
+ \num{#1} se termine par \num{\PfCCriQuatreUnite}. %
+ \modulo{\PfCCriQuatreUnite}{4}%
+ \ifnum\remainder=0\relax%
+ Comme \num{\PfCCriQuatreUnite} est divisible par 4, alors \num{#1} est divisible par 4.%
+ \ifboolKV[Critere]{Remarque}{\\\textbf{Remarque} : $\num{#1}=\num{\fpeval{#1/4}}\times4$.}{}%
+ \xdef\PfCListeARetenirCriteres{\PfCListeARetenirCriteres,4}%
+ \else%
+ Comme \num{\PfCCriQuatreUnite} n'est pas divisible par 4, alors \num{#1} n'est pas divisible par 4.%
+ \fi%
+ \fi
+}%
+
+\NewDocumentCommand\CritereCinq{m}{%
+ \StrRight{#1}{1}[\PfCCriCinqUnite]%
+ Le chiffre des unités de \num{#1} est \num{\PfCCriCinqUnite}. Donc \num{#1} %
+ \modulo{\PfCCriCinqUnite}{5}%
+ \ifnum\remainder=0\relax%
+ est divisible par 5.%
+ \ifboolKV[Critere]{Remarque}{\\\textbf{Remarque} : $\num{#1}=\num{\fpeval{#1/5}}\times5$.}{}%
+ \xdef\PfCListeARetenirCriteres{\PfCListeARetenirCriteres,5}%
+ \else%
+ n'est pas divisible par 5.%
+ \fi%
+}%
+
+\NewDocumentCommand\CritereNeuf{m}{%
+ La somme des chiffres de \num{#1} est \PfCSommeChiffres{#1}. Comme \num{\PfCSMSomme} %
+ \modulo{\PfCSMSomme}{9}%
+ \ifnum\remainder=0\relax%
+ est divisible par 9, alors \num{#1} est aussi divisible par 9.%
+ \ifboolKV[Critere]{Remarque}{\\\textbf{Remarque} : $\num{#1}=\num{\fpeval{#1/9}}\times9$.}{}%
+ \xdef\PfCListeARetenirCriteres{\PfCListeARetenirCriteres,9}%
+ \else%
+ n'est pas divisible par 9, alors \num{#1} n'est pas divisible par 9.%
+ \fi%
+}%
+
+\NewDocumentCommand\CritereDix{m}{%
+ \StrRight{#1}{1}[\PfCCriDixUnite]%
+ Le chiffre des unités de \num{#1} est \num{\PfCCriDixUnite}. Donc \num{#1} %
+ \ifnum\PfCCriDixUnite=0\relax
+ est divisible par 10.%
+ \ifboolKV[Critere]{Remarque}{\\\textbf{Remarque} : $\num{#1}=\num{\fpeval{#1/10}}\times10$.}{}%
+ \xdef\PfCListeARetenirCriteres{\PfCListeARetenirCriteres,10}%
+ \else%
+ n'est pas divisible par 10.%
+ \fi%
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex b/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex
index 41039e7ab6..39ec997a29 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex
@@ -741,6 +741,30 @@
}%
}%
+\newcommand\RecupListeTousFacteursPremier[1]{%
+ %#1 : le nombre entier \`a tester
+ \ensuremath{%
+ \newcount\anpl\newcount\bnpl\newcount\cnpl%
+ \newcount\pilebl%
+ \anpl=#1\relax%
+ \bnpl=2\relax%
+ \pilebl=2\relax%
+ \xdef\PfCPileFacteurs{}%
+ \whiledo{\the\anpl > 1}{%
+ \modulo{\the\anpl}{\the\bnpl}
+ \ifnum\remainder=0\relax
+ \cnpl=\numexpr\anpl/\bnpl\relax
+ \xdef\PfCPileFacteurs{\PfCPileFacteurs,\the\bnpl}%
+% \num{\the\bnpl}\ifnum\anpl>\bnpl,\fi%
+ \anpl=\cnpl\relax
+ \else%
+ \bnpl=\numexpr\bnpl+1\relax%
+ \pilebl=\bnpl\relax%
+ \fi%
+ }%
+ }%
+}%
+
\newcommand\ListeDiviseur[1]{%#1 : le nombre entier \`a tester
\newcount\anp\newcount\bnp%
\anp=#1%
diff --git a/macros/latex/contrib/profcollege/latex/PfCDefiCalc.tex b/macros/latex/contrib/profcollege/latex/PfCDefiCalc.tex
index 8e26111a31..619220704c 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDefiCalc.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDefiCalc.tex
@@ -8,6 +8,9 @@
\def\UpdatetoksTexteEcran#1\nil{\addtotok\toktexteecran{_}}
\def\UpdatetoksCibleEcran#1\nil{\addtotok\tokcibleecran{"#1"}}
+\newlength\Adaptation
+\newlength\Adaptationbis
+
\NewDocumentCommand\DefiCalculatrice{om}{%
\useKVdefault[DefiCalculatrice]%
\setKV[DefiCalculatrice]{#1}%
@@ -24,15 +27,19 @@
\addtotok\toktexteecran{"}
\expandafter\UpdatetoksCibleEcran#2\nil
% Dessin de la calculatrice
- \begin{tcolorbox}[nobeforeafter,left=0pt,right=0pt,top=0pt,bottom=0pt,width=69pt]
+ \setlength{\Adaptation}{7em+0.07\tabcolsep}
+ \setlength{\Adaptationbis}{6em}
+ \begin{tcolorbox}[nobeforeafter,left=0pt,right=0pt,top=0pt,bottom=0pt,width=\Adaptation]
+ \begin{center}
\setlength{\tabcolsep}{0.01\tabcolsep}
- \begin{tabular}{*{4}{m{20pt}}}
- \ifboolKV[DefiCalculatrice]{Impression}{\multicolumn{4}{c}{\Calculatrice[Ecran,Largeur=40,Impression]{\the\toktexteecran/\the\tokcibleecran}}}{\multicolumn{4}{c}{\Calculatrice[Ecran,Largeur=40]{\the\toktexteecran/\the\tokcibleecran}}}\\
+ \begin{tabular}{*{4}{c}}%m{20pt}}}
+ \ifboolKV[DefiCalculatrice]{Impression}{\multicolumn{4}{c}{\Calculatrice[Ecran,Largeur=\mpdim{\Adaptationbis}/0.5mm,Impression]{\the\toktexteecran/\the\tokcibleecran}}}{\multicolumn{4}{c}{\Calculatrice[Ecran,Largeur=\mpdim{\Adaptationbis}/0.5mm]{\the\toktexteecran/\the\tokcibleecran}}}\\
\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{7}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/7}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{8}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/8}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{9}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/9}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{/}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/$\div$}}}\\
\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{4}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/4}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{5}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/5}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{6}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/6}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{*}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/$\times$}}}\\
\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{1}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/1}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{2}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/2}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{3}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/3}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{-}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/$-$}}}\\
\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{0}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/0}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{.}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/.}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{=}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/$=$}}}&\multicolumn{1}{c}{\IfSubStr{\useKV[DefiCalculatrice]{ListeTouches}}{+}{\Calculatrice{/\faScrewdriver}}{\Calculatrice{/$+$}}}\\
\end{tabular}
\setlength{\tabcolsep}{100\tabcolsep}
+ \end{center}
\end{tcolorbox}
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex b/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex
index 20c48cb593..340d598e2f 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex
@@ -165,7 +165,7 @@
}{%
\setsepchar[*]{§* }%
\readlist*\ListeDefiTableCode{#2}%
- \begin{NiceTabular}{>{\columncolor{gray!15}}{c}*{10}{c}}[hvlines]
+ \begin{NiceTabular}{>{\columncolor{gray!15}}{c}*{10}{c}}[hvlines,color-inside]
\rowcolor{gray!15}$\times$&\xintFor* ##1 in {\xintSeq {1}{10}}\do{%
\xintifForFirst{}{&}##1}
\\
diff --git a/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex b/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex
index 272e260d0a..db36fa7d34 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDistributivite.tex
@@ -38,7 +38,7 @@
% y a dans un "seul calcul".
\setcounter{NbCalculDistri}{0}
-\setKVdefault[ClesDistributivite]{Cours=false,Etape=1,Lettre=x,Fleches=false,AideMul=false,Reduction=false,AideAdda=false,AideAddb=false,CouleurAide=red,CouleurFH=blue,CouleurFB=red,Somme=false,Difference=false,RAZ=false,Oppose=false,All=false,NomExpression=A,Fin=4,Numerique=false,Remarquable=false,Echange=0,Tuile=false,Vide=false,Reperes=false,Impression=false,Tableau=false}%,AideAdd=false:inutile ?
+\setKVdefault[ClesDistributivite]{Cours=false,Etape=1,Lettre=x,Lettrea=a,Lettreb=b,Lettrec=c,Lettred=d,Fleches=false,AideMul=false,Reduction=false,AideAdda=false,AideAddb=false,CouleurAide=red,CouleurFH=blue,CouleurFB=red,Somme=false,Difference=false,RAZ=false,Oppose=false,All=false,NomExpression=A,Fin=4,Numerique=false,Remarquable=false,Echange=0,Tuile=false,Vide=false,Reperes=false,Impression=false,Tableau=false}%,AideAdd=false:inutile ?
\defKV[ClesDistributivite]{CouleurReduction=\colorlet{DCReduction}{#1}\setKV[ClesDistributivite]{Reduction}}%
\newcommand\Tuile[4]{%
\ifluatex
@@ -465,9 +465,9 @@
\ifboolKV[ClesDistributivite]{Cours}{%
\ensuremath{%
\xintifboolexpr{#2==0}{%
- }{\xintifboolexpr{#3==0}{}{(}}\xintifboolexpr{#2==0}{\Tikzmark{}}{\Tikzmark{a}}
+ }{\xintifboolexpr{#3==0}{}{(}}\xintifboolexpr{#2==0}{\Tikzmark{}}{\Tikzmark{\useKV[ClesDistributivite]{Lettrea}}}
\ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{+(}}{}%
- \xintifboolexpr{#3==0}{\Tikzmark{}}{\xintifboolexpr{#3>0}{\xintifboolexpr{#2==0}{}{+}}{\xintifboolexpr{#3<0}{-}{}}\Tikzmark{b}}%
+ \xintifboolexpr{#3==0}{\Tikzmark{}}{\xintifboolexpr{#3>0}{\xintifboolexpr{#2==0}{}{+}}{\xintifboolexpr{#3<0}{-}{}}\Tikzmark{\useKV[ClesDistributivite]{Lettreb}}}%
\ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{)}}{}%
\xintifboolexpr{#2==0}{}{\xintifboolexpr{#3==0}{}{)}}%
%
@@ -476,9 +476,9 @@
%
\xintifboolexpr{\Multi==0}{\times%
\xintifboolexpr{#4<0}{(}{\xintifboolexpr{#5<0}{(}{}}}{(}%
- \Tikzmark{c}%
+ \Tikzmark{\useKV[ClesDistributivite]{Lettrec}}%
\ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{+(}}{}%
- \xintifboolexpr{#5>0}{\xintifboolexpr{#4==0}{}{+}}{\xintifboolexpr{#5<0}{\xintifboolexpr{#4==0}{{-}}{-}}{}}\Tikzmark{d}%
+ \xintifboolexpr{#5>0}{\xintifboolexpr{#4==0}{}{+}}{\xintifboolexpr{#5<0}{\xintifboolexpr{#4==0}{{-}}{-}}{}}\Tikzmark{\useKV[ClesDistributivite]{Lettred}}%
\ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{)}}{}%
\xintifboolexpr{\Multi==0}{%
\xintifboolexpr{#4<0}{)}{\xintifboolexpr{#5<0}{)}{}}}{)}%
@@ -487,21 +487,21 @@
%
\xdef\Multi{\fpeval{#2*#4}}%
\xintifboolexpr{\Multi==0}{}{%
- \xintifboolexpr{#2<0}{(-}{}a\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#4<0}{(-}{}c\xintifboolexpr{#4<0}{)}{}%
+ \xintifboolexpr{#2<0}{(-}{}\useKV[ClesDistributivite]{Lettrea}\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#4<0}{(-}{}\useKV[ClesDistributivite]{Lettrec}\xintifboolexpr{#4<0}{)}{}%
}
\xdef\Multij{\fpeval{#2*#5}}%
\xintifboolexpr{\Multij==0}{}{%
\xintifboolexpr{\Multi==0}{}{+}%
- \xintifboolexpr{#2<0}{(-}{}a\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#5<0}{(-}{}d\xintifboolexpr{#5<0}{)}{}%
+ \xintifboolexpr{#2<0}{(-}{}\useKV[ClesDistributivite]{Lettrea}\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#5<0}{(-}{}\useKV[ClesDistributivite]{Lettred}\xintifboolexpr{#5<0}{)}{}%
}%
\xdef\Multik{\fpeval{#3*#4}}%
\xintifboolexpr{\Multik==0}{}{%
\xintifboolexpr{\Multi==0}{}{+}%
- \xintifboolexpr{#3<0}{(-}{}b\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#4<0}{(-}{}c\xintifboolexpr{#4<0}{)}{}%
+ \xintifboolexpr{#3<0}{(-}{}\useKV[ClesDistributivite]{Lettreb}\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#4<0}{(-}{}\useKV[ClesDistributivite]{Lettrec}\xintifboolexpr{#4<0}{)}{}%
}%
\xdef\Multil{\fpeval{#3*#5}}%
\xintifboolexpr{\Multil==0}{}{+%
- \xintifboolexpr{#3<0}{(-}{}b\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#5<0}{(-}{}d\xintifboolexpr{#5<0}{)}{}%
+ \xintifboolexpr{#3<0}{(-}{}\useKV[ClesDistributivite]{Lettreb}\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#5<0}{(-}{}\useKV[ClesDistributivite]{Lettred}\xintifboolexpr{#5<0}{)}{}%
}%
% Fleches
\ifboolKV[ClesDistributivite]{Fleches}{%
@@ -705,7 +705,7 @@
}{%
\xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multi<0}{(\Affichage{\Multi}{0}{0})}{\Affichage{\Multi}{0}{0}}}{\Affichage{\Multi}{0}{0}}%
\xintifboolexpr{\Multim==0}{}{%
- \xintifboolexpr{\Multim>0}{+\Affichage{0}{\Multim}{0}}{-\Affichage{0}{\fpeval{-\Multim}}{0}}%
+ \xintifboolexpr{\Multim>0}{\ifnum\Multi>0\relax{}+\fi\Affichage{0}{\Multim}{0}}{-\Affichage{0}{\fpeval{-\Multim}}{0}}%
}%
\xintifboolexpr{\Multil==0}{}{\xintifboolexpr{\Multil<0}{-\Affichage{0}{0}{\fpeval{-\Multil}}}{+\Affichage{0}{0}{\Multil}}}%
}
diff --git a/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex b/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex
index dc5d541157..188bd3a569 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex
@@ -1,7 +1,7 @@
%%%
% QCM
%%%
-\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=60pt,Couleur=gray!15,Titre=false,Nom=R\'eponse,NomV=Vrai,NomF=Faux,Alph=false,AlphT=false,VF=false,Depart=1,Alterne=false,Noms={A/B/C},Multiple=false,Parties={Yeux,Nez,Bouche}}%
+\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=60pt,Couleur=gray!15,Titre=false,Nom=R\'eponse,NomV=Vrai,NomF=Faux,Alph=false,AlphT=false,VF=false,Depart=1,Alterne=false,Noms={A/B/C},Multiple=false,Parties={Yeux,Nez,Bouche},CouleurAlt=gray!15}%
\newlength{\LargeurQCM}%
\newlength{\PfCLargeurQCM}%
\newcounter{QuestionQCM}%
@@ -12,6 +12,7 @@
\newcommand\QCMPfC[2][]{%
\useKVdefault[ClesQCM]%
\setKV[ClesQCM]{#1}%
+ \colorlet{PfCCouleurAlterneQCM}{\useKV[ClesQCM]{CouleurAlt}}%
\setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
\setcounter{TitreQCM}{0}
\setsepchar[*]{,*&}\ignoreemptyitems%
@@ -30,8 +31,8 @@
\\
\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}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
}\\
}%
\hline%
@@ -49,8 +50,8 @@
\multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\
\hline%
\xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
- \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{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}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
}\\
}%
\hline%
@@ -65,8 +66,8 @@
}{}
\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}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,##2+1]%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,##2+1]%
}\\
}%
\hline%
@@ -74,11 +75,12 @@
}%
}%
\renewcommand{\arraystretch}{1}%
- }
+ }%
}{%
\newcommand\QCM[2][]{%
\useKVdefault[ClesQCM]%
\setKV[ClesQCM]{#1}%
+ \colorlet{PfCCouleurAlterneQCM}{\useKV[ClesQCM]{CouleurAlt}}%
\setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
\setcounter{TitreQCM}{0}
\setsepchar[*]{,*&}\ignoreemptyitems%
@@ -97,8 +99,8 @@
\\
\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}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}%
}\\
}%
\hline%
@@ -115,8 +117,8 @@
\multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\
\hline%
\xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
- \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{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}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
}\\
}%
\hline%
@@ -129,11 +131,11 @@
\multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
&\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}%
\\
- }{}
+ }{}%
\hline%
\xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
- \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{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}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,\fpeval{##2+1}]%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{PfCCouleurAlterneQCM}\fi}{}\ifboolKV[ClesQCM]{Solution}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,\fpeval{##2+1}]%
}\\
}%
\hline%
diff --git a/macros/latex/contrib/profcollege/latex/PfCErathostene.tex b/macros/latex/contrib/profcollege/latex/PfCErathostene.tex
deleted file mode 100644
index 2924d856d5..0000000000
--- a/macros/latex/contrib/profcollege/latex/PfCErathostene.tex
+++ /dev/null
@@ -1,80 +0,0 @@
-\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\Erathostene{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
diff --git a/macros/latex/contrib/profcollege/latex/PfCFractionNombre.tex b/macros/latex/contrib/profcollege/latex/PfCFractionNombre.tex
index f373aecc6c..08e9936d52 100644
--- a/macros/latex/contrib/profcollege/latex/PfCFractionNombre.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCFractionNombre.tex
@@ -4,7 +4,7 @@
\newtoks\tokFractionNombrePerso%
\def\UpdatetoksFN#1\nil{\addtotok\tokFractionNombrePerso{"#1",}}%
-\setKVdefault[ClesFN]{Unite=5cm,Aire=false,Solution=false,Quadrillage=false,PasQuad=5mm,HautQuad=3,LargQuad=8,Vide=false,Creation=false,Couleur=blue,UniteAire=1x1}%
+\setKVdefault[ClesFN]{Unite=5cm,Aire=false,Solution=false,Quadrillage=false,PasQuad=5mm,HautQuad=3,LargQuad=8,Vide=false,Creation=false,Couleur=blue,UniteAire=1x1,Pointilles=false,Tentatives=10}%
\defKV[ClesFN]{Perso=\setKV[ClesFN]{Creation}\xdef\PfCFooCheminFN{#1}}%
\NewDocumentCommand\FractionNombre{om}{%
@@ -131,6 +131,7 @@
enddef;
%
def PopChemin=
+ tentative:=tentative+1;
currentpicture:=nullpicture;
RAZZone;
for k=-1 upto HautQuad:
@@ -192,9 +193,12 @@
fi;
enddef;
%
+ boolean Vide;
+ Vide=\useKV[ClesFN]{Vide};
PasQuad=\useKV[ClesFN]{PasQuad};
HautQuad=\useKV[ClesFN]{HautQuad};
LargQuad=\useKV[ClesFN]{LargQuad};
+ Tentatives=\useKV[ClesFN]{Tentatives};
pair A,B,C,D,U[];
A=(0,0);
B-A=PasQuad*(LargQuad,0);
@@ -215,13 +219,15 @@
ChoixLigneD=ceiling(uniformdeviate(HautQuad-1));
ChoixColonneD=ceiling(uniformdeviate(LargQuad-#3-1));
%
+ tentative:=1;
+ if Vide=false:
PushChemin((ChoixLigneD,ChoixColonneD));
nbcaseschoisies=1;
fill ((unitsquare scaled 5mm) shifted (5mm*(ChoixColonneD-1,ChoixLigneD-1))) withcolor LightSteelBlue;
Impossible[ChoixLigneD][ChoixColonneD]:=true;
VoisinDispo(ChoixLigneD,ChoixColonneD);
% Le "parcours"
- forever: exitif nbcaseschoisies>NbTotalCasesAColorier-1;
+ forever: exitif (nbcaseschoisies>NbTotalCasesAColorier-1) or (tentative>Tentatives);
nb:=ceiling(uniformdeviate(nbvoisin));
if nb>0:
for k=1 upto nbvoisin:
@@ -235,7 +241,19 @@
PopChemin;
fi;
endfor;
+ fi;
% Tracage
+ if tentative>Tentatives:
+ currentpicture:=nullpicture;
+ picture MiseEnGarde;
+ MiseEnGarde=image(
+ label(TEX("\begin{minipage}{0.5\linewidth}
+ La construction automatique a échouée. Relancez en augmentant le nombre de tentatives ou en augmentant les dimensions du quadrillage (Hauteur,Largeur)
+ \end{minipage}"),(0,0));
+ );
+ draw (((llcorner MiseEnGarde)--(lrcorner MiseEnGarde)--(urcorner MiseEnGarde)--(ulcorner MiseEnGarde)--cycle) scaled 1.1) withpen pensquare scaled 2;
+ draw MiseEnGarde;
+ else:
fill polygone(U0,U1,U2,U3) withcolor 0.7white;
label.top(TEX("\textbf{1 ua}"),iso(U1,U0));
%Le quadrillage
@@ -246,6 +264,7 @@
for k=1 upto HautQuad-1:
trace (k/HautQuad)[A,D]--(k/HautQuad)[B,C];
endfor;
+ fi;
\end{mplibcode}
\fi
}%
@@ -298,10 +317,11 @@
Unite:=#2;%\useKV[ClesFN]{Unite};%en carreaux
HautQuad:=\useKV[ClesFN]{HautQuad};
Largeur:=Unite;%en carreaux
- boolean Solution,Vide,Creation;
+ boolean Solution,Vide,Creation,Pointilles;
Solution=\useKV[ClesFN]{Solution};
Vide=\useKV[ClesFN]{Vide};
Creation=\useKV[ClesFN]{Creation};
+ Pointilles=\useKV[ClesFN]{Pointilles};
color CoulFN;
CoulFN=\useKV[ClesFN]{Couleur};
Num:=#1;
@@ -407,10 +427,10 @@
endfor;
fi;
if Vide=false:
- trace ch[0] for k=1 upto #1:--ch[k] endfor withpen pencircle scaled 2 withcolor CoulFN;
+ trace ch[0] for k=1 upto #1:--ch[k] endfor withpen pencircle scaled 2 if Pointilles: dashed evenly else: withcolor CoulFN fi;
fi;
trace cotationmil(D,(D+#2*(PasQuad,0)),5mm,15,TEX("1 ul"));
trace segment(D,D+#2*(PasQuad,0)) withpen pencircle scaled 1.5;
\end{mplibcode}
\fi
-}% \ No newline at end of file
+}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex b/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex
index ab15f8754e..0ae20f54e7 100644
--- a/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex
@@ -3,7 +3,7 @@
%%%
\setKVdefault[Geometrie]{CoinBG={(0,0)},CoinHD={(10u,10u)},TypeTrace="Instruments"}%
-\ifluatex
+\ifluatex%
\NewDocumentEnvironment{Geometrie}{o +b}{%
\useKVdefault[Geometrie]%
\setKV[Geometrie]{#1}%
@@ -30,7 +30,7 @@
_tfig:=2*_tfig;
#2%
\end{mplibcode}
-}{}
+}{}%
\else
\NewDocumentEnvironment{Geometrie}{o +b}{%
\useKVdefault[Geometrie]%
@@ -57,5 +57,5 @@
_tfig:=2*_tfig;
#2%
\end{mpost}
-}{}
+}{}%
\fi% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCKakuro.tex b/macros/latex/contrib/profcollege/latex/PfCKakuro.tex
index 1f8d7f3f49..bbb99424f6 100644
--- a/macros/latex/contrib/profcollege/latex/PfCKakuro.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCKakuro.tex
@@ -22,7 +22,7 @@
\readlist*\ListeKakuroNombres{\ListeAvantNombres}%
\savecomparemode%
\comparestrict%
- \begin{NiceTabular}{*{\useKV[Kakuro]{TLargeur}}{m{\useKV[Kakuro]{Largeur}}}}[hvlines]%
+ \begin{NiceTabular}{*{\useKV[Kakuro]{TLargeur}}{m{\useKV[Kakuro]{Largeur}}}}[hvlines,color-inside]%
\xintFor* ##1 in {\xintSeq{0}{\fpeval{\useKV[Kakuro]{THauteur}-1}}}\do{%
\xintFor* ##2 in {\xintSeq{1}{\useKV[Kakuro]{TLargeur}}}\do{%
\rule{0pt}{\PfCKakuro}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCKenKen.tex b/macros/latex/contrib/profcollege/latex/PfCKenKen.tex
index 60f072b208..8e8daa9f86 100644
--- a/macros/latex/contrib/profcollege/latex/PfCKenKen.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCKenKen.tex
@@ -14,7 +14,7 @@
\readlist*\ListeCasesKK{#2}%
\savecomparemode%
\comparestrict%
- \begin{NiceTabular}{*{\useKV[ClesKK]{Taille}}{m{\useKV[ClesKK]{Largeur}}}}%
+ \begin{NiceTabular}{*{\useKV[ClesKK]{Taille}}{m{\useKV[ClesKK]{Largeur}}}}[color-inside]%
\CodeBefore
\xintFor* ##1 in {\xintSeq{2}{\fpeval{\useKV[ClesKK]{Taille}}}}\do{%
\tikz\draw[gray] (##1-|1) -- (##1-|last);%
diff --git a/macros/latex/contrib/profcollege/latex/PfCMotsCodes.tex b/macros/latex/contrib/profcollege/latex/PfCMotsCodes.tex
index ad49524c71..6a638a7c93 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMotsCodes.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMotsCodes.tex
@@ -9,7 +9,7 @@
\setsepchar[*]{§*/}%
\readlist*\ListeMotsCodes{#2}%
\xdef\ListeMotsCodesPas{\fpeval{\ListeMotsCodeslen/\useKV[MotsCodes]{Colonnes}}}%
- \begin{NiceTabular}{*{\fpeval{\useKV[MotsCodes]{Colonnes}}}{>{\centering\arraybackslash}m{\useKV[MotsCodes]{Largeur}}}}
+ \begin{NiceTabular}{*{\fpeval{\useKV[MotsCodes]{Colonnes}}}{>{\centering\arraybackslash}m{\useKV[MotsCodes]{Largeur}}}}[color-inside]
\xintFor* ##1 in {\xintSeq {1}{\ListeMotsCodesPas}}\do{%
\xintFor* ##2 in {\xintSeq {1}{\fpeval{\useKV[MotsCodes]{Colonnes}}}}\do{%
\xintifForFirst{}{&}\Block[draw=black]{4-1}{}%
@@ -38,7 +38,7 @@
\foreachitem\compteur\in\ListeMotsCodesTableau{%
\xintifboolexpr{\ListeMotsCodesMax<\listlen\ListeMotsCodesTableau[\compteurcnt]}{\xdef\ListeMotsCodesMax{\fpeval{\listlen\ListeMotsCodesTableau[\compteurcnt]}}}{}%
}%
- \begin{NiceTabular}{*{\fpeval{\ListeMotsCodesMax}}{>{\centering\arraybackslash}m{\useKV[MotsCodes]{LargeurT}}}}
+ \begin{NiceTabular}{*{\fpeval{\ListeMotsCodesMax}}{>{\centering\arraybackslash}m{\useKV[MotsCodes]{LargeurT}}}}[color-inside]
\xintFor* ##1 in {\xintSeq {1}{\fpeval{\ListeMotsCodesTableaulen}}}\do{%
\xintFor* ##2 in {\xintSeq {1}{\listlen\ListeMotsCodesTableau[##1]}}\do{%
\xintifForFirst{}{&}\ifboolKV[MotsCodes]{Solution}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex b/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex
index 7723e8b1af..7fdeb47dec 100644
--- a/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex
@@ -90,8 +90,8 @@
}%
}%
-\setKVdefault[LecGra]{NbPoints=7,Image=false,Antecedent=false,Equation=false,UniteX=1,UniteY=1,Epaisseur=1,CouleurTrace=black,Points}
-\defKV[LecGra]{Graine=\PfCGraineAlea{#1}}
+\setKVdefault[LecGra]{NbPoints=7,Image=false,Antecedent=false,Equation=false,UniteX=1,UniteY=1,Epaisseur=1,CouleurTrace=black,Points,Tableau=false,SolutionTableau=false,Prolonge=false}%
+\defKV[LecGra]{Graine=\PfCGraineAlea{#1}}%
\newread\myread
@@ -132,6 +132,20 @@
\setsepchar{,}%
\readlist*\ListeAbscisses{\FooAbscisses}%
\readlist*\ListeOrdonnees{\FooOrdonnees}%
+ \ifboolKV[LecGra]{Tableau}{%
+ \ifboolKV[LecGra]{Prolonge}{\xdef\LecGraDepartTab{2}\xdef\LecGraArriveeTab{\fpeval{\ListeAbscisseslen-1}}}{\xdef\LecGraDepartTab{1}\xdef\LecGraArriveeTab{\ListeAbscisseslen}}
+ \begin{center}
+ \begin{NiceTabular}{c*{\ListeAbscisseslen}{m{12pt}}}[hvlines]
+ $x$\xintFor* ##1 in{\xintSeq{\LecGraDepartTab}{\LecGraArriveeTab}}\do{
+ &\Block{}{\num{\ListeAbscisses[##1]}}%
+ }\\
+ $f(x)$\ifboolKV[LecGra]{SolutionTableau}{\xintFor* ##1 in{\xintSeq{\LecGraDepartTab}{\LecGraArriveeTab}}\do{
+ &\num{\ListeOrdonnees[##1]}%
+ }%
+ }{}\\
+ \end{NiceTabular}
+ \end{center}
+ }{%
\xdef\FooPoints{0/\ListeAbscisses[1]/\ListeOrdonnees[1]/0}%
\xintFor*##1 in{\xintSeq{2}{\useKV[LecGra]{NbPoints}}}\do{%
\xdef\FooPoints{\FooPoints§0/\ListeAbscisses[##1]/\ListeOrdonnees[##1]/0}%
@@ -148,6 +162,7 @@
\Fonction[
Points,
Splines,
+ Prolonge=\useKV[LecGra]{Prolonge},
PointsCourbe=\useKV[LecGra]{Points},
Epaisseur=\useKV[LecGra]{Epaisseur},
CouleurTrace=\useKV[LecGra]{CouleurTrace},
@@ -246,7 +261,8 @@
\xintifForLast{ et }{\xintifForFirst{}{;}}\num{\fpeval{round(\ListeNombreAntecedents,1)}}%
}\else c'est \read\myread to \ListeNombreAntecedents\num{\fpeval{round(\ListeNombreAntecedents,1)}}\fi
\fi.%
- }{}%
+}{}%
+}
}%
\def\MPSplineCode{%
@@ -649,7 +665,7 @@
vardef courbe[](expr a,b,nb)(text texte)=
path Courbe;
for i:=0 upto nb :
- x@[i]:=(a+i*(b-a)/nb);
+ x@[i]:=(a+i*((b-a)/nb));
x:=x@[i];
y@[i]:=texte;
endfor ;
diff --git a/macros/latex/contrib/profcollege/latex/PfCNumberHive.tex b/macros/latex/contrib/profcollege/latex/PfCNumberHive.tex
index 3c7903c3a0..ee37a5b2f1 100644
--- a/macros/latex/contrib/profcollege/latex/PfCNumberHive.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCNumberHive.tex
@@ -28,10 +28,14 @@
\ifboolKV[NumberHive]{Graines}{\PfCGraineAlea{\useKV[NumberHive]{Graine}}}{}%
\ifboolKV[NumberHive]{Produit}{%
\xdef\PfCNHListe{1,2,3,4,5,6,7,8,9,10,11,12,14,16,18,20,22,24,15,21,27,30,33,36,28,32,40,44,48,25,35,45,50,55,60,42,54,66,72,56,63,70,77,84,64,72,80,88,96,81,90,99,108,100,110,120,121,132,144}%
+ \ifboolKV[NumberHive]{Negatif}{%
+ \xdef\PfCNHListe{-1,-2,-3,-4,-5,-6,-8,-10,-12,-9,-15,-18,-16,-20,-24,-25,-30,-36,1,2,3,4,5,6,8,10,12,9,15,18,16,20,24,25,30,36}%
+ \xdef\PfCNHListe{\PfCNHListe,\PfCNHListe}%
+ }{}%
\ifboolKV[NumberHive]{Double}{%
\MelangeListe{\PfCNHListe}{59}%
}{%
- \xdef\PfCNHListe{\PfCNHListe,\PfCNHListe}%
+% \xdef\PfCNHListe{\PfCNHListe,\PfCNHListe}%
\MelangeListe{\PfCNHListe}{46}%
}%
}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCProgrammeCalcul.tex b/macros/latex/contrib/profcollege/latex/PfCProgrammeCalcul.tex
index fd1a46d6e3..9395074379 100644
--- a/macros/latex/contrib/profcollege/latex/PfCProgrammeCalcul.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCProgrammeCalcul.tex
@@ -5,16 +5,22 @@
Ecart=2em,%
Direct,%
SansCalcul=false,%
- Application=false,
- Details=false,
- Enonce=false,
- Nom={},
+ Application=false,%
+ Details=false,%
+ Enonce=false,%
+ Nom={},%
CouleurCadre=black,%
CouleurFond=gray!10,%
Largeur={.95\linewidth},%
Epaisseur=.75pt,%
- Pointilles=0,
- ThemePerso=false,
+ Pointilles=0,%
+ ThemePerso=false,%
+ Vide=false,%pour vider le chemin de flèches
+ Depart=false,%pour indiquer qu'on cherche le nombre de départ (non fractionnaire pour le moment)
+ Retour=false,%on affiche les fleches de retour
+ OpReciproques=false,%on affiche les opérations réciproques
+ Reponses=0,%on affiche les opérations réciproques 1 par 1 :)
+ ReponsesCalculs=0,%on affiche les valeurs 1 par 1 :)
}
\newcounter{NBprog}%
@@ -114,28 +120,73 @@
\setsepchar[*]{,* }\ignoreemptyitems%
\readlist*\ListeProg{#2}%
\stepcounter{NBprog}%
- \xdef\NbDepart{\ListeProg[1]}%
- \ifboolKV[ClesProg]{SansCalcul}{%
- $\NbDepart$\foreachitem\compteur\in\ListeProg[2]{%
- \hspace{0.2em}\tikzmark{A-\theNBprog-\compteurcnt}\hspace{\useKV[ClesProg]{Ecart}}\tikzmark{B-\theNBprog-\compteurcnt}\hspace{0.2em}$\ListeProg[3,\compteurcnt]$%
- }%
- \begin{tikzpicture}[remember picture, overlay]
- \foreachitem\compteur\in\ListeProg[2]{%
- \edef\Test{\ListeProg[2,\compteurcnt]}
- \expandarg%
- \StrSubstitute{\Test}{^}{\empty\dots{}^}[\tempa]%
- \StrSubstitute{\tempa}{**}{^}[\tempab]%
- \StrSubstitute{\tempab}{*}{\times}[\tempac]%
- \StrSubstitute{\tempac}{/}{\div}[\tempad]%
- \draw[-stealth,transform canvas={yshift=0.25em}] (pic cs:A-\theNBprog-\compteurcnt) --
- node[above]{\scriptsize$\tempad$}(pic cs:B-\theNBprog-\compteurcnt);
- }
- \end{tikzpicture}
+ \ifboolKV[ClesProg]{Vide}{%
+ \xdef\PfCNbDepart{\ListeProg[1]}%
+ \ifnum\fpeval{\useKV[ClesProg]{ReponsesCalculs}}=\listlen\ListeProg[2]\relax%
+ \num{\PfCNbDepart}%
+ \else%
+ \phantom{\num{\PfCNbDepart}}%
+ \fi%
+ \foreachitem\compteur\in\ListeProg[2]{%
+ \xdef\PfCNbDepart{\fpeval{(\PfCNbDepart)\ListeProg[2,\compteurcnt]}}%
+ \hspace{0.2em}\tikzmark{A-\theNBprog-\compteurcnt}\hspace{\useKV[ClesProg]{Ecart}}\tikzmark{B-\theNBprog-\compteurcnt}\hspace{0.2em}%
+ \ifnum\fpeval{\listlen\ListeProg[2]-\compteurcnt}<\fpeval{\useKV[ClesProg]{ReponsesCalculs}+1}\relax%
+ \ifboolKV[ClesProg]{Depart}{\num{\PfCNbDepart}}{\phantom{\num{\PfCNbDepart}}}%\num{\PfCNbDepart}%
+ \else%
+ \ifnum\compteurcnt=\listlen\ListeProg[2]\relax%
+ \ifboolKV[ClesProg]{Depart}{\num{\PfCNbDepart}}{\phantom{\num{\PfCNbDepart}}}%
+ \else%
+ \phantom{\num{\PfCNbDepart}}%
+ \fi%
+ \fi%
+ }%
+ \begin{tikzpicture}[remember picture, overlay]
+ \foreachitem\compteur\in\ListeProg[2]{%
+ \edef\Test{\ListeProg[2,\compteurcnt]}%
+ \expandarg%
+ \StrSubstitute{\Test}{^}{\empty\dots{}^}[\tempa]%
+ \StrSubstitute{\tempa}{**}{^}[\tempab]%
+ \StrSubstitute{\tempab}{*}{\times}[\tempac]%
+ \StrSubstitute{\tempac}{/}{\div}[\tempad]%
+ \draw[-stealth,transform canvas={yshift=0.25em}] (pic cs:A-\theNBprog-\compteurcnt) --
+ node[above]{\scriptsize$\tempad$}(pic cs:B-\theNBprog-\compteurcnt);
+ }%
+ \end{tikzpicture}
+ \ifboolKV[ClesProg]{Retour}{%
+ \begin{tikzpicture}[remember picture, overlay]
+ \foreachitem\compteur\in\ListeProg[2]{%
+ \edef\Test{\ListeProg[2,\compteurcnt]}%
+ \expandarg%
+ \StrSubstitute{\Test}{^2}{\empty\sqrt{\dots{}}}[\tempa]%
+ \StrSubstitute{\tempa}{**}{^}[\tempab]%
+ \StrSubstitute{\tempab}{*}{\div}[\tempac]%
+ \StrSubstitute{\tempac}{/}{\times}[\tempad]%
+ \StrSubstitute{\tempad}{-}{+}[\tempae]%
+ \StrSubstitute{\tempae}{+}{-}[\tempaf]%
+ \ifnum\fpeval{\useKV[ClesProg]{Reponses}}>0\relax%
+ \ifnum\fpeval{\listlen\ListeProg[2]-\compteurcnt}<\fpeval{\useKV[ClesProg]{Reponses}}\relax%
+ \ifboolKV[ClesProg]{OpReciproques}{%
+ \draw[-stealth,out=-150,in=-30,transform canvas={yshift=-0.5em}] (pic cs:B-\theNBprog-\compteurcnt) to node[below]{\scriptsize$\tempaf$}(pic cs:A-\theNBprog-\compteurcnt);
+ }{%
+ \draw[-stealth,out=-150,in=-30,transform canvas={yshift=-0.5em}] (pic cs:B-\theNBprog-\compteurcnt) to (pic cs:A-\theNBprog-\compteurcnt);
+ }%
+ \fi%
+ \else%
+ \ifboolKV[ClesProg]{OpReciproques}{%
+ \draw[-stealth,out=-150,in=-30,transform canvas={yshift=-0.5em}] (pic cs:B-\theNBprog-\compteurcnt) to node[below]{\scriptsize$\tempaf$}(pic cs:A-\theNBprog-\compteurcnt);
+ }{%
+ \draw[-stealth,out=-150,in=-30,transform canvas={yshift=-0.5em}] (pic cs:B-\theNBprog-\compteurcnt) to (pic cs:A-\theNBprog-\compteurcnt);
+ }%
+ \fi%
+ }%
+ \end{tikzpicture}%
+ }{}%
}{%
- \num{\NbDepart}\foreachitem\compteur\in\ListeProg[2]{%
- \hspace{0.2em}\tikzmark{A-\theNBprog-\compteurcnt}\hspace{\useKV[ClesProg]{Ecart}}\tikzmark{B-\theNBprog-\compteurcnt}\xdef\NbDepart{\fpeval{(\NbDepart)\ListeProg[2,\compteurcnt]}}\hspace{0.2em}\num{\NbDepart}%
- }%
- \ifboolKV[ClesProg]{Direct}{%
+ \xdef\NbDepart{\ListeProg[1]}%
+ \ifboolKV[ClesProg]{SansCalcul}{%
+ $\NbDepart$\foreachitem\compteur\in\ListeProg[2]{%
+ \hspace{0.2em}\tikzmark{A-\theNBprog-\compteurcnt}\hspace{\useKV[ClesProg]{Ecart}}\tikzmark{B-\theNBprog-\compteurcnt}\hspace{0.2em}$\ListeProg[3,\compteurcnt]$%
+ }%
\begin{tikzpicture}[remember picture, overlay]
\foreachitem\compteur\in\ListeProg[2]{%
\edef\Test{\ListeProg[2,\compteurcnt]}
@@ -145,24 +196,42 @@
\StrSubstitute{\tempab}{*}{\times}[\tempac]%
\StrSubstitute{\tempac}{/}{\div}[\tempad]%
\draw[-stealth,transform canvas={yshift=0.25em}] (pic cs:A-\theNBprog-\compteurcnt) --
- node[above]{\scriptsize$\tempad$}(pic
- cs:B-\theNBprog-\compteurcnt);
- }
- \end{tikzpicture}
+ node[above]{\scriptsize$\tempad$}(pic cs:B-\theNBprog-\compteurcnt);
+ }%
+ \end{tikzpicture}%
}{%
- \begin{tikzpicture}[remember picture, overlay]
- \foreachitem\compteur\in\ListeProg[2]{%
- \edef\Test{\ListeProg[2,\compteurcnt]}
- \expandarg%
- \StrSubstitute{\Test}{^2}{\empty\sqrt{\dots{}}}[\tempa]%
- \StrSubstitute{\tempa}{**}{^}[\tempab]%
- \StrSubstitute{\tempab}{*}{\div}[\tempac]%
- \StrSubstitute{\tempac}{/}{\times}[\tempad]%
- \StrSubstitute{\tempad}{-}{+}[\tempae]%
- \StrSubstitute{\tempae}{++}{-}[\tempaf]%
- \draw[-stealth,transform canvas={yshift=0.25em}] (pic cs:B-\theNBprog-\compteurcnt) -- node[above]{\scriptsize$\tempaf$}(pic cs:A-\theNBprog-\compteurcnt);
- }
- \end{tikzpicture}
+ \num{\NbDepart}\foreachitem\compteur\in\ListeProg[2]{%
+ \hspace{0.2em}\tikzmark{A-\theNBprog-\compteurcnt}\hspace{\useKV[ClesProg]{Ecart}}\tikzmark{B-\theNBprog-\compteurcnt}\xdef\NbDepart{\fpeval{(\NbDepart)\ListeProg[2,\compteurcnt]}}\hspace{0.2em}\num{\NbDepart}%
+ }%
+ \ifboolKV[ClesProg]{Direct}{%
+ \begin{tikzpicture}[remember picture, overlay]
+ \foreachitem\compteur\in\ListeProg[2]{%
+ \edef\Test{\ListeProg[2,\compteurcnt]}
+ \expandarg%
+ \StrSubstitute{\Test}{^}{\empty\dots{}^}[\tempa]%
+ \StrSubstitute{\tempa}{**}{^}[\tempab]%
+ \StrSubstitute{\tempab}{*}{\times}[\tempac]%
+ \StrSubstitute{\tempac}{/}{\div}[\tempad]%
+ \draw[-stealth,transform canvas={yshift=0.25em}] (pic cs:A-\theNBprog-\compteurcnt) --
+ node[above]{\scriptsize$\tempad$}(pic
+ cs:B-\theNBprog-\compteurcnt);
+ }%
+ \end{tikzpicture}%
+ }{%
+ \begin{tikzpicture}[remember picture, overlay]
+ \foreachitem\compteur\in\ListeProg[2]{%
+ \edef\Test{\ListeProg[2,\compteurcnt]}
+ \expandarg%
+ \StrSubstitute{\Test}{^2}{\empty\sqrt{\dots{}}}[\tempa]%
+ \StrSubstitute{\tempa}{**}{^}[\tempab]%
+ \StrSubstitute{\tempab}{*}{\div}[\tempac]%
+ \StrSubstitute{\tempac}{/}{\times}[\tempad]%
+ \StrSubstitute{\tempad}{-}{+}[\tempae]%
+ \StrSubstitute{\tempae}{++}{-}[\tempaf]%
+ \draw[-stealth,transform canvas={yshift=0.25em}] (pic cs:B-\theNBprog-\compteurcnt) -- node[above]{\scriptsize$\tempaf$}(pic cs:A-\theNBprog-\compteurcnt);
+ }%
+ \end{tikzpicture}
+ }%
}%
}%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCProprietesDroites.tex b/macros/latex/contrib/profcollege/latex/PfCProprietesDroites.tex
index cbb7775806..ad9f1b0edb 100644
--- a/macros/latex/contrib/profcollege/latex/PfCProprietesDroites.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCProprietesDroites.tex
@@ -1,7 +1,7 @@
%%%
% Ppt\'es des droites (6eme)
%%%
-\setKVdefault[ClesDroites]{Brouillon=false,CitePropriete=false,Num=1,Figure=false,Remediation=false}
+\setKVdefault[ClesDroites]{Brouillon=false,CitePropriete=false,Num=1,Figure=false,Remediation=false,FigureSeule=false}
\newcommand\Redaction[4][]{%
\ifboolKV[ClesDroites]{Remediation}{%
@@ -21,7 +21,7 @@
Or, si deux droites sont perpendiculaires \`a une m\^eme droite, alors elles sont parall\`eles.%
- Donc les droites $(\hbox to2em{\dotfill})$ et $(\hbox to2em{\dotfill})$ sont perpendiculaires.
+ Donc les droites $(\hbox to2em{\dotfill})$ et $(\hbox to2em{\dotfill})$ sont parall\`eles.
}{%
Comme les droites $(\hbox to2em{\dotfill})$ et $(\hbox to2em{\dotfill})$ sont toutes les deux perpendiculaires \`a la m\^eme droite $(\hbox to2em{\dotfill})$, alors les droites $(\hbox to2em{\dotfill})$ et $(\hbox to2em{\dotfill})$ sont parall\`eles.
}
@@ -29,7 +29,7 @@
\ifboolKV[ClesDroites]{CitePropriete}{%
Les droites $(\hbox to2em{\dotfill})$ et $(\hbox to2em{\dotfill})$ sont parall\`eles. Les droites $(\hbox to2em{\dotfill})$ et $(\hbox to2em{\dotfill})$ sont perpendiculaires.%
- Or, si deux droites sont parall\`eles, alors toute droite droite perpendiculaire \`a l'une est perpendiculaire \`a l'autre.%
+ Or, si deux droites sont parall\`eles, alors toute droite perpendiculaire \`a l'une est perpendiculaire \`a l'autre.%
Donc les droites $(\hbox to2em{\dotfill})$ et $(\hbox to2em{\dotfill})$ sont perpendiculaires.
}{%
@@ -54,7 +54,7 @@
Or, si deux droites sont perpendiculaires \`a une m\^eme droite, alors elles sont parall\`eles.%
- Donc les droites $(#2)$ et $(#3)$ sont perpendiculaires.
+ Donc les droites $(#2)$ et $(#3)$ sont parall\`eles.
}{%
Comme les droites $(#2)$ et $(#3)$ sont toutes les deux perpendiculaires \`a la m\^eme droite $(#4)$, alors les droites $(#2)$ et $(#3)$ sont parall\`eles.
}
@@ -62,7 +62,7 @@
\ifboolKV[ClesDroites]{CitePropriete}{%
Les droites $(#2)$ et $(#4)$ sont parall\`eles. Les droites $(#3)$ et $(#4)$ sont perpendiculaires.%
- Or, si deux droites sont parall\`eles, alors toute droite droite perpendiculaire \`a l'une est perpendiculaire \`a l'autre.%
+ Or, si deux droites sont parall\`eles, alors toute droite perpendiculaire \`a l'une est perpendiculaire \`a l'autre.%
Donc les droites $(#2)$ et $(#3)$ sont perpendiculaires.
}{%
@@ -326,18 +326,22 @@
\newcommand\ProprieteDroites[4][]{%
\useKVdefault[ClesDroites]%
\setKV[ClesDroites]{#1}%
- \ifboolKV[ClesDroites]{Figure}{%
- \begin{multicols}{2}%
- \begin{center}%
- \FaireFigure[#1]{#2}{#3}{#4}%
- \end{center}%
- \columnbreak
- \ifboolKV[ClesDroites]{Brouillon}{\Brouillon[#1]{#2}{#3}{#4}}{}%
- \Redaction[#1]{#2}{#3}{#4}%
- \par%
- \end{multicols}
+ \ifboolKV[ClesDroites]{FigureSeule}{%
+ \FaireFigure[#1]{#2}{#3}{#4}%
}{%
+ \ifboolKV[ClesDroites]{Figure}{%
+ \begin{multicols}{2}%
+ \begin{center}%
+ \FaireFigure[#1]{#2}{#3}{#4}%
+ \end{center}%
+ \columnbreak
+ \ifboolKV[ClesDroites]{Brouillon}{\Brouillon[#1]{#2}{#3}{#4}}{}%
+ \Redaction[#1]{#2}{#3}{#4}%
+ \par%
+ \end{multicols}
+ }{%
\ifboolKV[ClesDroites]{Brouillon}{\Brouillon[#1]{#2}{#3}{#4}}{}%
\Redaction[#1]{#2}{#3}{#4}%
+ }%
}%
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCPythagore.tex b/macros/latex/contrib/profcollege/latex/PfCPythagore.tex
index 5df5f0b03a..d63849f613 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPythagore.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPythagore.tex
@@ -1,10 +1,15 @@
%%%
% 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}%
+\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,FigureSeule=false,Angle=0,Echelle=1cm,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,Perso=false,AllPerso=false,SansMots=false,Decalage=5mm}%
\defKV[ClesPythagore]{ValeurA=\setKV[ClesPythagore]{EnchaineA}}%
\defKV[ClesPythagore]{ValeurB=\setKV[ClesPythagore]{EnchaineB}}%
\defKV[ClesPythagore]{ValeurC=\setKV[ClesPythagore]{EnchaineC}}%
+
+\setsepchar[*]{,*/}%
+\readlist*\ListePythagoreCoteEntier{13/84/85,14/48/50,15/20/25,15/36/39,16/30/34,16/63/65,18/24/30,18/80/82,20/21/29,20/48/52,21/28/35,21/72/75,24/32/40,24/45/51,24/70/74,25/60/65,27/36/45,28/45/53,28/96/100,30/40/50,30/72/78,32/60/68,33/44/55,33/56/65,35/84/91,36/48/60,36/77/85,39/52/65,39/80/89,40/42/58,40/75/85,42/56/70,45/60/75,48/55/73,48/64/80,51/68/85,54/72/90,57/76/95,60/63/87,60/80/100,65/72/97}%%d'après villement.gerard.free.fr%3/4/5}/{5/12/13}/{6/8/10}/{7/24/25}/{8/15/17}/{9/12/15}/{9/40/41}/{10/24/26}/{11/60/61}/{12/16/20}/{12/35/37}/
+\setsepchar{,}%
+
% On d\'efinit les figures \`a utiliser
\def\MPFigurePytha#1#2#3#4#5#6{%
% #1 Premier sommet
@@ -121,6 +126,7 @@
\mplibforcehmode
\begin{mplibcode}
u:=\useKV[ClesPythagore]{Echelle};
+ decalage=\useKV[ClesPythagore]{Decalage};
pair A,B,C,O,D,E,F;%B est le sommet de l'angle droit
O=u*(2.5,2.5);
path cc;
@@ -136,22 +142,15 @@
draw A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)};
draw B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)};
draw C{dir(angle(A-C)+5)}..A{dir(angle(A-C)+5)};
- decalage=3mm;
- if ypart(B)>ypart(O) :
- label(btex \num{#4} etex,1/2[C,A]-decalage*(unitvector(C-A) rotated 90));
- label(btex \num{#5} etex,1/2[C,B]-decalage*(unitvector(C-B)));
- label(btex \num{#6} etex,1/2[A,B]-decalage*(unitvector(C-B)));
- else:
- label(btex \num{#4} etex,1/2[A,C]+decalage*(unitvector(A-C) rotated 90));
- label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
- label(btex \num{#6} etex,1/2[C,B]-decalage*(unitvector(A-B)));
- fi;
- label(btex #1 etex,1.2[O,A]);
- label(btex #2 etex,1.2[O,B]);
- label(btex #3 etex,1.2[O,C]);
+ label(TEX("\num{#4}"),O+decalage*(unitvector(O-B)));
+ label(TEX("\num{#6}"),1/2[C,B]+decalage*(unitvector(1/2[C,B]-O)));
+ label(TEX("\num{#5}"),1/2[A,B]+decalage*(unitvector(1/2[A,B]-O)));
+ label(TEX("#1"),1.2[O,A]);
+ label(TEX("#2"),1.2[O,B]);
+ label(TEX("#3"),1.2[O,C]);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={u:=\useKV[ClesPythagore]{Echelle};}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesPythagore]{Echelle};decalage=\useKV[ClesPythagore]{Decalage};}]
pair A,B,C,O,D,E,F;%B est le sommet de l'angle droit
O=u*(2.5,2.5);
path cc;
@@ -168,15 +167,9 @@
draw B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)};
draw C{dir(angle(A-C)+5)}..A{dir(angle(A-C)+5)};
decalage=3mm;
- if ypart(B)>ypart(O) :
- label(LATEX("\num{"&decimal(#4)&"}") rotated angle(C-A),1/2[C,A]-decalage*(unitvector(C-A) rotated 90));
- label(LATEX("\num{"&decimal(#5)&"}") rotated(angle(C-B)),1/2[C,B]-decalage*(unitvector(C-B)));
- label(LATEX("\num{"&decimal(#6)&"}") rotated(angle(B-A)),1/2[A,B]-decalage*(unitvector(C-B)));
- else:
- label(LATEX("\num{"&decimal(#4)&"}") rotated angle(A-C),1/2[A,C]+decalage*(unitvector(A-C) rotated 90));
- label(LATEX("\num{"&decimal(#5)&"}") rotated(angle(A-B)),1/2[A,B]-decalage*(unitvector(C-B)));
- label(LATEX("\num{"&decimal(#6)&"}") rotated angle(C-B),1/2[C,B]-decalage*(unitvector(A-B)));
- fi;
+ label(LATEX("\num{#4}"),O+decalage*(unitvector(O-B)));
+ label(LATEX("\num{#5}"),1/2[C,B]+decalage*(unitvector(1/2[C,B]-O)));
+ label(LATEX("\num{#6}"),1/2[A,B]+decalage*(unitvector(1/2[A,B]-O)));
label(btex #1 etex,1.2[O,A]);
label(btex #2 etex,1.2[O,B]);
label(btex #3 etex,1.2[O,C]);
diff --git a/macros/latex/contrib/profcollege/latex/PfCQuestionsFlash.tex b/macros/latex/contrib/profcollege/latex/PfCQuestionsFlash.tex
index dd5db3e71b..8edee39f16 100644
--- a/macros/latex/contrib/profcollege/latex/PfCQuestionsFlash.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCQuestionsFlash.tex
@@ -361,6 +361,7 @@
\colorlet{CouleurDeux}{\useKV[ClesFlash]{Couleur2}}%
\colorlet{CouleurTrois}{\useKV[ClesFlash]{Couleur3}}%
\colorlet{CouleurQuatre}{\useKV[ClesFlash]{Couleur4}}%
+ \reademptyitems%
\ifboolKV[ClesFlash]{Evaluation}{%
\ifboolKV[ClesFlash]{Seul}{%
\setsepchar[*]{/}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCQuestionsRelier.tex b/macros/latex/contrib/profcollege/latex/PfCQuestionsRelier.tex
index f921498c54..fa35906ead 100644
--- a/macros/latex/contrib/profcollege/latex/PfCQuestionsRelier.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCQuestionsRelier.tex
@@ -1,13 +1,14 @@
%%%
% R\'eponses \`a relier
%%%
-\setKVdefault[ClesRelie]{Solution=false,LargeurG=5cm,LargeurD=2cm,Stretch=1.5,Ecart=2cm,Couleur=black}
+\setKVdefault[ClesRelie]{Solution=false,LargeurG=5cm,LargeurD=2cm,Stretch=1.5,Ecart=2cm,Couleur=black}%
\newcommand\Relie[2][]{%
\useKVdefault[ClesRelie]%
\setKV[ClesRelie]{#1}%
- \setsepchar[*]{,*/}%
+ \setsepchar[*]{,*/}\reademptyitems%
\readlist*\ListeRelie{#2}%
+ \ignoreemptyitems
\buildtabrelie%
\ifboolKV[ClesRelie]{Solution}{%
\colorlet{PfCRelieCouleurTrace}{\useKV[ClesRelie]{Couleur}}%
@@ -15,14 +16,14 @@
\itemtomacro\ListeRelie[##1,1]\untest
\ifx\bla\untest\bla%
\else
- \tikz[remember picture,overlay]{\draw[PfCRelieCouleurTrace] (RelieG-##1) -- (RelieD-\ListeRelie[##1,3]);}%
+ \tikz[remember picture,overlay]{\draw[PfCRelieCouleurTrace] (RelieG-##1) -- (RelieD-\ListeRelie[##1,3]);}%
\fi
}%
}{%
}%
-}
+}%
-\newcounter{NbRelie}
+\newcounter{NbRelie}%
\def\buildtabrelie{%
\setcounter{NbRelie}{0}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRangementNombres.tex b/macros/latex/contrib/profcollege/latex/PfCRangementNombres.tex
index e248c04401..1c48ab8efc 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRangementNombres.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRangementNombres.tex
@@ -11,9 +11,9 @@
\NewDocumentCommand\RangementListe{m}{%
\readlist*\ListeRgt{#1}%
- \xdef\Foo{\ListeRgt[1]}
+ \xdef\Foo{\ListeRgt[1]}%
\xintFor* ##1 in{\xintSeq{2}{\ListeRgtlen}}\do{%
- \xdef\Foo{\Foo,\ListeRgt[##1]}
+ \xdef\Foo{\Foo,\ListeRgt[##1]}%
}%
\xdef\Fooa{\Foo}%
\xdef\PfCRetiensRangement{}%
@@ -25,15 +25,21 @@
\xdef\PfCRetiensRangement{\Element}%
}%
\readlist*\RetiensListe{\Fooa}%
- % La liste des rangements vaut \RetiensRangement.\par
- % La retiensliste vaut \showitems\RetiensListe[]\par
+ %La liste des rangements vaut \RetiensRangement.\par
+ %La retiensliste vaut \showitems\RetiensListe[]\par
\xdef\Fooi{}%
+ \xdef\PfCNombreFoisElementMini{0}%
\foreachitem\rgt\in\RetiensListe{%
% \rgtcnt~\RetiensListe[\rgtcnt] et \Element%
- \xintifboolexpr{\RetiensListe[\rgtcnt]==\Element}{}{%
- \xdef\Fooi{\Fooi,\RetiensListe[\rgtcnt]}
+ %POur gére les cas où le minimum apparaît plusieurs fois
+ \xintifboolexpr{\RetiensListe[\rgtcnt]==\Element}{%
+ \xdef\PfCNombreFoisElementMini{\fpeval{\PfCNombreFoisElementMini+1}}%
+ %Element mini =\Element -- \PfCNombreFoisElementMini\\
+ \xintifboolexpr{\PfCNombreFoisElementMini>1}{\xdef\Fooi{\Fooi,\RetiensListe[\rgtcnt]}}{}%
+ }{%
+ \xdef\Fooi{\Fooi,\RetiensListe[\rgtcnt]}%
}%
- % La liste Fooi est \Fooi\par
+ % La liste Fooi est \Fooi\par
}%
\readlist*\ListeTempo{\Fooi}%
\xintifboolexpr{\ListeTempolen>1}{%
@@ -43,7 +49,7 @@
}%
}{%
% \xdef\Fooa{\ListeTempo[1]}%
- \xdef\PfCRetiensRangement{\PfCRetiensRangement,\ListeTempo[1]}
+ \xdef\PfCRetiensRangement{\PfCRetiensRangement,\ListeTempo[1]}%
}%
% La liste Fooa vaut \Fooa\par
}%
@@ -59,7 +65,7 @@
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListeRgt{#2}%
% on cherche le d\'enominateur commun
- \ppcm=1\relax
+ \ppcm=1\relax%
\foreachitem\x\in\ListeRgt{%
\PPCM{\fpeval{\ListeRgt[\xcnt,2]}}{\fpeval{\the\ppcm}}%
}%
@@ -79,7 +85,7 @@
}%
}%
}{%
- \ensuremath{
+ \ensuremath{%
\xintFor* ##1 in{\xintSeq{0}{\fpeval{\PfCListeFinaleRgtlen-1}}}\do{%
\xintifForFirst{}{\ifboolKV[ClesRgt]{Strict}{>}{\qeqslant}}\Simplification{\PfCListeFinaleRgt[\fpeval{\PfCListeFinaleRgtlen-##1}]}{\the\ppcm}}%
}%
@@ -98,16 +104,16 @@
}%
}%
}%
- }% %%%%%%%%%%%%%
+ }%
}{%
\RangementListe{#2}%
%
% \PfCRetiensRangement%
- \ifboolKV[ClesRgt]{Seul}{}{%
- \readlist*\PfCListeFinaleRgt{\PfCRetiensRangement}
- % \par \showitems\PfCListeFinaleRgt[] -- La longueur de la liste est \PfCListeFinaleRgtlen
- \ifboolKV[ClesRgt]{Decroissant}{%
- \ensuremath{%
+ \ifboolKV[ClesRgt]{Seul}{}{%
+ \readlist*\PfCListeFinaleRgt{\PfCRetiensRangement}%
+ % \par \showitems\PfCListeFinaleRgt[] -- La longueur de la liste est \PfCListeFinaleRgtlen
+ \ifboolKV[ClesRgt]{Decroissant}{%
+ \ensuremath{%
\xintFor* ##1 in{\xintSeq{0}{\fpeval{\PfCListeFinaleRgtlen-1}}}\do{%
\xintifForFirst{}{\ifboolKV[ClesRgt]{Strict}{>}{\geqslant}}\num{\PfCListeFinaleRgt[\fpeval{\PfCListeFinaleRgtlen-##1}]}%
}%
@@ -122,7 +128,8 @@
}%
}%
\reademptyitems
- }
+%
+}%
\NewDocumentCommand\Rangementold{om}{%
\useKVdefault[ClesRgt]%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRapido.tex b/macros/latex/contrib/profcollege/latex/PfCRapido.tex
index 2fcc701b52..fa3a16bf7e 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRapido.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRapido.tex
@@ -36,6 +36,7 @@
}{}%
\setlength{\WidthRapido}{\useKV[ClesRapido]{Largeur}}%
%
+\reademptyitems
\setsepchar[*]{§*/}%
\readlist*\ListeRapido{#2}%
\begin{RapidoBox}
diff --git a/macros/latex/contrib/profcollege/latex/PfCReperage.tex b/macros/latex/contrib/profcollege/latex/PfCReperage.tex
index 9924f631f8..6ab6ebf847 100644
--- a/macros/latex/contrib/profcollege/latex/PfCReperage.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCReperage.tex
@@ -1,7 +1,7 @@
%%%
% 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,Decale=false}
+\setKVdefault[ClesReperage]{Unitex=1,Pasx=1,Unitey=1,Pasy=1,Unitez=1,Pasz=1,DemiDroite=false,Droite=false,Plan=false,Trace=false,ListeSegment={},Espace=false,Sphere=false,AnglePhi=30,CouleurLa=white,CouleurLon=Tomato,AffichageUnites=true,MarquePrimaire=true,AffichageNom=false,AffichageGrad=false,AffichageAbs=0,AffichageCoord=false,LectureCoord=false,ValeurUnitex=1,ValeurUnitey=1,ValeurOrigine=0,NomOrigine=O,EchelleEspace=50,CouleurCoord=black,Thermometre=false,Mercure=false,CouleurMercure=black,Celsius,Kelvin=false,Farenheit=false,ValeurMin=-4000,ValeurMax=4000,ValeurMiny=-4000,ValeurMaxy=4000,Etages=4,Code=false,Globe=false,Rho=1500,Phi=22,Theta=10,CouleurE=orange,CouleurG=green,Axes=false,TypeProj="persp",Niveaux=false,Decale=false,Tiret=false,Cadre=false}
\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 :)
@@ -21,6 +21,7 @@
% Pour construire le rep\`ere de l'espace
\def\buildespace{%
\toklistepointespace{}%
+ \toklistepointrepere{}%
\ifboolKV[ClesReperage]{Globe}{%
\foreachitem\compteur\in\ListePointEspace{\expandafter\Updatetoksrepere\compteur\nil}%
\MPGlobe{\the\toklistepointrepere}{\useKV[ClesReperage]{EchelleEspace}}%
@@ -299,7 +300,7 @@
fi;
);
CodageDeux=image(
- if k>0:
+ if l>0:
label.rt(TEX("\scriptsize\ang{"&decimal(l)&"} N"),(0,0));
else:
label.lft(TEX("\scriptsize\ang{"&decimal(abs(l))&"} S"),(0,0));
@@ -391,7 +392,7 @@
fi;
);
CodageDeux=image(
- if k>0:
+ if l>0:
label.rt(LATEX("\noexpand\scriptsize\noexpand\ang{"&decimal(l)&"} N"),(0,0));
else:
label.lft(LATEX("\noexpand\scriptsize\noexpand\ang{"&decimal(abs(l))&"} S"),(0,0));
@@ -683,38 +684,93 @@
% Pour construire le rep\`ere du plan
\def\buildreperenew{%
- \toklistepointrepere{}%
- \foreachitem\compteur\in\ListePointRepere{\expandafter\Updatetoksrepere\compteur\nil}%
- \ifboolKV[ClesReperage]{Trace}{%
- \[\MPPlanTrace{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\the\toklistepointrepere}{2}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurUnitey}}{\useKV[ClesReperage]{ListeSegment}}\]%
- }{%
- \xdef\AfficheNom{0}\ifboolKV[ClesReperage]{AffichageNom}{\ifboolKV[ClesReperage]{LectureCoord}{\xdef\AfficheNom{3}}{\xdef\AfficheNom{2}}}{\ifboolKV[ClesReperage]{LectureCoord}{\xdef\AfficheNom{1}}{}}%
- \xdef\AfficheGrad{0}\ifboolKV[ClesReperage]{AffichageGrad}{\xdef\AfficheGrad{1}}{}%
- \xdef\AfficheCoord{\useKV[ClesReperage]{AffichageAbs}}%
- \MPPlannew{(\useKV[ClesReperage]{Unitex},\useKV[ClesReperage]{Pasx})}{(\useKV[ClesReperage]{Unitey},\useKV[ClesReperage]{Pasy})}{\the\toklistepointrepere}{\AfficheNom}{\AfficheCoord}{\AfficheGrad}{(\useKV[ClesReperage]{ValeurUnitex},\useKV[ClesReperage]{ValeurUnitey})}%
+ \xdef\RetiensListePoints{}%
+ \xdef\RetiensListePointsA{}%
+ \xdef\RetiensListePointsCourte{}%
+ \foreachitem\compteur\in\ListePointRepere{%
+ \xdef\RetiensListePoints{\RetiensListePoints\ListePointRepere[\compteurcnt,1],}%
+ \xdef\RetiensListePoints{\RetiensListePoints\ListePointRepere[\compteurcnt,2],}%
+ \xdef\RetiensListePointsA{\RetiensListePointsA\ListePointRepere[\compteurcnt,1],}%
+ \xdef\RetiensListePointsA{\RetiensListePointsA\ListePointRepere[\compteurcnt,2],}%
+ \IfStrEq{\ListePointRepere[\compteurcnt,3]}{ }{%
+ \xdef\RetiensListePoints{\RetiensListePoints PfC,}%
+ \xdef\RetiensListePointsA{\RetiensListePointsA"",}%
+ }{%
+ \xdef\RetiensListePoints{\RetiensListePoints\ListePointRepere[\compteurcnt,3],}%
+ \xdef\RetiensListePointsA{\RetiensListePointsA"\ListePointRepere[\compteurcnt,3]",}%
+ \ifx\bla\RetiensListePointsCourte\bla%
+ \xdef\RetiensListePointsCourte{\ListePointRepere[\compteurcnt,3]}%
+ \else
+ \xdef\RetiensListePointsCourte{\RetiensListePointsCourte,\ListePointRepere[\compteurcnt,3]}%
+ \fi
+ }%
}%
-}
+ \xdef\AfficheNom{0}\ifboolKV[ClesReperage]{AffichageNom}{\ifboolKV[ClesReperage]{LectureCoord}{\xdef\AfficheNom{3}}{\xdef\AfficheNom{2}}}{\ifboolKV[ClesReperage]{LectureCoord}{\xdef\AfficheNom{1}}{}}%
+ \xdef\AfficheGrad{0}\ifboolKV[ClesReperage]{AffichageGrad}{\xdef\AfficheGrad{1}}{}%
+ \xdef\AfficheCoord{\useKV[ClesReperage]{AffichageAbs}}%
+ \MPPlannew{\RetiensListePoints}{\AfficheNom}{\AfficheCoord}{\RetiensListePointsCourte}{\RetiensListePointsA}%
+}%
-\def\MPPlannew#1#2#3#4#5#6#7{%
- %#1 : Unitex, pasx
- %#2 : unitey, pasy
- %#3 : liste de points
- %#4 : Affichage nom + lecture graphique
- %#5 : Affichage des (abscisses/ordonn\'ees)
- %#6 : Graduation compl\`ete ?
- %#7 : (unitex,unitey)
+\def\MPPlannew#1#2#3#4#5{%
+ % #1 : liste de points
+ % #2 : Affichage nom + lecture graphique
+ % #3 : Affichage des (abscisses/ordonn\'ees)
+ % #4 : la liste courte des noms des points.
+ % #5 : liste des points pour les string
\ifluatex
- \begin{mplibcode}
+ \begin{mplibcode}
+ boolean Tiret,Code,AffichageGrad,Cadre;
+ Tiret=\useKV[ClesReperage]{Tiret};
+ Code=\useKV[ClesReperage]{Code};
+ AffichageGrad=\useKV[ClesReperage]{AffichageGrad};
+ Cadre=\useKV[ClesReperage]{Cadre};
+ %
+ Unitex=\useKV[ClesReperage]{Unitex};
+ Pasx=\useKV[ClesReperage]{Pasx};
+ Unitey=\useKV[ClesReperage]{Unitey};
+ Pasy=\useKV[ClesReperage]{Pasy};
+ ValeurUnitex=\useKV[ClesReperage]{ValeurUnitex};
+ ValeurUnitey=\useKV[ClesReperage]{ValeurUnitey};
+ %
+ vardef AvantDefinirSommets(text tu)=
+ pair tu;
+ enddef;
+ %
+ vardef DefinirLesSommets(text t)=
+ nbretiens=1;
+ k:=0;
+ l:=0;
+ for g_=t:
+ if (nbretiens mod 3)=1:
+ if numeric g_:
+ k:=g_;
+ fi;
+ fi;
+ if (nbretiens mod 3)=2:
+ if numeric g_:
+ l:=g_;
+ fi;
+ fi;
+ if (nbretiens mod 3)=0:
+ if pair g_:
+ g_=(k*unitpx,l*unitpy);
+ fi;
+ fi;
+ nbretiens:=nbretiens+1;
+ endfor;
+ enddef;
+ %
maxx:=-4000;
minx=4000;
- unitex:=(xpart(#1))*cm;
- pasx=ypart(#1);
+ unitex:=(Unitex)*cm;
+ pasx=Pasx;
unitpx:=unitex/pasx;
maxy:=-4000;
miny:=4000;
- unitey:=(xpart(#2))*cm;
- pasy:=ypart(#2);
+ unitey:=(Unitey)*cm;
+ pasy:=Pasy;
unitpy:=unitey/pasy;
+ %
n:=1;
vardef toto(text t)=
for p_=t:
@@ -738,23 +794,36 @@
endfor;
maxx:=maxx+1;
minx:=minx-1;
- if maxx<(ypart(#1)+1):
- maxx:=ypart(#1)+1;
+ if maxx<(Pasx+1):
+ maxx:=Pasx+1;
fi;
- if minx>(-ypart(#1)-1):
- minx:=-ypart(#1)-1;
+ if minx>(-Pasx-1):
+ minx:=-Pasx-1;
fi;
maxy:=maxy+1;
miny:=miny-1;
- if maxy<(ypart(#2)+1):
- maxy:=ypart(#2)+1;
+ if maxy<(Pasy+1):
+ maxy:=Pasy+1;
fi;
- if miny>(-ypart(#2)-1):
- miny:=-ypart(#2)-1;
+ if miny>(-Pasy-1):
+ miny:=-Pasy-1;
+ fi;
+ if minx<\useKV[ClesReperage]{ValeurMin}:
+ minx:=\useKV[ClesReperage]{ValeurMin};
+ fi;
+ if maxx>\useKV[ClesReperage]{ValeurMax}:
+ maxx:=\useKV[ClesReperage]{ValeurMax};
+ fi;
+ if miny<\useKV[ClesReperage]{ValeurMiny}:
+ miny:=\useKV[ClesReperage]{ValeurMiny};
+ fi;
+ if maxy>\useKV[ClesReperage]{ValeurMaxy}:
+ maxy:=\useKV[ClesReperage]{ValeurMaxy};
fi;
enddef;
- toto(#3);
+ toto(#1);
Figure((minx-1)*unitpx,(miny-1)*unitpy,(maxx+1)*unitpx,(maxy+1)*unitpy);
+ %Figure(minx*unitpx,miny*unitpy,maxx*unitpx,maxy*unitpy);
pair A,B,C,D,E;
A=(0,0);
B=(minx*unitpx,0);
@@ -771,30 +840,41 @@
drawarrow (D+(0,-0.75*unitpy))--(E+(0,0.75*unitpy));
% graduation compl\`ete ou pas ?
label.llft(TEX("\footnotesize 0"),A);
- if #6>0:
+ if AffichageGrad:
for k=minx upto maxx:
if (xpart((k*unitex,0))>xpart(B+(-0.75*unitpx,0))) and (xpart((k*unitex,0))<xpart(C+(0.75*unitpx,0))):
if k<>0:
+ if Tiret:
+ draw (k*unitex,-1mm)--(k*unitex,1mm);
+ label.lrt(TEX("\footnotesize\num{"&decimal(k)&"}"),(k*unitex,0));
+ else:
dotlabel.lrt(TEX("\footnotesize\num{"&decimal(k)&"}"),(k*unitex,0));
fi;
fi;
+ fi;
endfor;
for k=miny upto maxy:
if (ypart((0,k*unitey))>ypart(D+(0,-0.75*unitpy))) and (ypart((0,k*unitey))<ypart(E+(0,0.75*unitpy))):
if k<>0:
+ if Tiret:
+ draw (-1mm,k*unitey)--(1mm,k*unitey);
+ label.ulft(TEX("\footnotesize\num{"&decimal(k)&"}"),(0,k*unitey));
+ else:
dotlabel.ulft(TEX("\footnotesize\num{"&decimal(k)&"}"),(0,k*unitey));
fi;
fi;
+ fi;
endfor;
else:
- dotlabel.lrt(TEX("\footnotesize\num{"&decimal(xpart(#7))&"}"),(unitex,0));
- dotlabel.ulft(TEX("\footnotesize\num{"&decimal(ypart(#7))&"}"),(0,unitey));
+ dotlabel.lrt(TEX("\footnotesize\num{"&decimal(ValeurUnitex)&"}"),(unitex,0));
+ dotlabel.ulft(TEX("\footnotesize\num{"&decimal(ValeurUnitey)&"}"),(0,unitey));
fi;
% apparition du nom des points ou pas
m_c:=m_c*3;
marque_p:="croix";
vardef tata(text t)=%on place les points
- if #4>0:
+ % {
+ if #2>0:
n:=1;
k:=0;%pour retenir la coordonn\'ee en x
l:=0;%pour retenir la coordonn\'ee en y
@@ -810,7 +890,7 @@
fi;
fi;
if (n mod 3)=0:
- if #4>1:
+ if #2>1:
if p_<>"":
if (k>0) and (l>0):
label.urt(TEX(p_),(k*unitpx,l*unitpy));
@@ -839,85 +919,124 @@
pointe((k*unitpx,l*unitpy));
fi;
fi;
- if (#4=1) or (#4=3):
+ if (#2=1) or (#2=3):
draw (0,l*unitpy)--(k*unitpx,l*unitpy)--(k*unitpx,0) dashed evenly;
fi;
fi;
n:=n+1;
endfor;
fi;
- if #5=2:
+ % }
n:=1;
k:=0;%pour retenir la coordonn\'ee en x
l:=0;%pour retenir la coordonn\'ee en y
for p_=t:
- if (n mod 3)=1:
- if numeric p_:
- k:=p_;
- fi;
- fi;
- if (n mod 3)=2:
- if numeric p_:
- l:=p_;
- fi;
- fi;
- if (n mod 3)=0:
- if p_<>"":
- if (k mod pasx)<>0:
- label.lrt(TEX("\footnotesize$\frac{\num{"&decimal(k)&"}}{\num{"&decimal(pasx)&"}}$"),(k*unitpx,0));
- else:
- label.lrt(TEX("\footnotesize\num{\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
+ if (n mod 3)=1:
+ if numeric p_:
+ k:=p_;
fi;
- if (l mod pasy)<>0:
- label.ulft(TEX("\footnotesize$\frac{\num{"&decimal(l)&"}}{\num{"&decimal(pasy)&"}}$"),(0,l*unitpy));
- else:
- label.ulft(TEX("\footnotesize\num{\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
+ fi;
+ if (n mod 3)=2:
+ if numeric p_:
+ l:=p_;
fi;
- pointe((k*unitpx,0),(0,l*unitpy));
fi;
+ if (n mod 3)=0:
+ if #3=2:
+ if p_<>"":
+ if (k mod pasx)<>0:
+ label.lrt(TEX("\footnotesize$\frac{\num{"&decimal(k)&"}}{\num{"&decimal(pasx)&"}}$"),(k*unitpx,0));
+ else:
+ label.lrt(TEX("\footnotesize\num{\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
+ fi;
+ if (l mod pasy)<>0:
+ label.ulft(TEX("\footnotesize$\frac{\num{"&decimal(l)&"}}{\num{"&decimal(pasy)&"}}$"),(0,l*unitpy));
+ else:
+ label.ulft(TEX("\footnotesize\num{\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
+ fi;
+ pointe((k*unitpx,0),(0,l*unitpy));
+ fi;
+ elseif #3=1:
+ if p_<>"":
+ label.lrt(TEX("\footnotesize\num{\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
+ label.ulft(TEX("\footnotesize\num{\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
+ pointe((k*unitpx,0),(0,l*unitpy));
+ fi;
+ fi;
fi;
n:=n+1;
endfor;
- elseif #5=1:
- n:=1;
- k:=0;%pour retenir la coordonn\'ee en x
- l:=0;%pour retenir la coordonn\'ee en y
- for p_=t:
- if (n mod 3)=1:
- if numeric p_:
- k:=p_;
- fi;
- fi;
- if (n mod 3)=2:
- if numeric p_:
- l:=p_;
- fi;
- fi;
- if (n mod 3)=0:
- if p_<>"":
- label.lrt(TEX("\footnotesize\num{\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
- label.ulft(TEX("\footnotesize\num{\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
- pointe((k*unitpx,0),(0,l*unitpy));
- fi;
- fi;
- n:=n+1;
- endfor;
- fi;
enddef;
- tata(#3);
+ tata(#5);
+ AvantDefinirSommets(#4);
+ DefinirLesSommets(#1);
+ if Code:
+ \useKV[ClesReperage]{Traces};
+ fi;
+ if Cadre:
+ trace polygone(%
+ ((minx-1)*unitpx,(miny-1)*unitpy),
+ ((maxx+1)*unitpx,(miny-1)*unitpy),
+ ((maxx+1)*unitpx,(maxy+1)*unitpy),
+ ((minx-1)*unitpx,(maxy+1)*unitpy)
+ );
+ fi;
\end{mplibcode}
\else
- \begin{mpost}
+ \begin{mpost}[mpsettings={
+ vardef EffectuerTraces=
+ \useKV[ClesFonction]{Traces};
+ enddef;
+ boolean Tiret,Code,AffichageGrad;
+ Tiret=\useKV[ClesReperage]{Tiret};
+ Code=\useKV[ClesReperage]{Code};
+ AffichageGrad=\useKV[ClesReperage]{AffichageGrad};
+ %
+ Unitex=\useKV[ClesReperage]{Unitex};
+ Pasx=\useKV[ClesReperage]{Pasx};
+ Unitey=\useKV[ClesReperage]{Unitey};
+ Pasy=\useKV[ClesReperage]{Pasy};
+ ValeurUnitex=\useKV[ClesReperage]{ValeurUnitex};
+ ValeurUnitey=\useKV[ClesReperage]{ValeurUnitey};
+ };]
+ %
+ vardef AvantDefinirSommets(text tu)=
+ pair tu;
+ enddef;
+ %
+ vardef DefinirLesSommets(text t)=
+ nbretiens=1;
+ k:=0;
+ l:=0;
+ for g_=t:
+ if (nbretiens mod 3)=1:
+ if numeric g_:
+ k:=g_;
+ fi;
+ fi;
+ if (nbretiens mod 3)=2:
+ if numeric g_:
+ l:=g_;
+ fi;
+ fi;
+ if (nbretiens mod 3)=0:
+ g_=(k*unitpx,l*unitpy);
+ fi;
+ nbretiens:=nbretiens+1;
+ endfor;
+ enddef;
+ %
maxx:=-4000;
minx=4000;
- unitex:=(xpart(#1))*cm;
- pasx=ypart(#1);
+ unitex:=(Unitex)*cm;
+ pasx=Pasx;
unitpx:=unitex/pasx;
maxy:=-4000;
miny:=4000;
- unitey:=(xpart(#2))*cm;
- pasy:=ypart(#2);
+ unitey:=(Unitey)*cm;
+ pasy:=Pasy;
unitpy:=unitey/pasy;
+ %
n:=1;
vardef toto(text t)=
for p_=t:
@@ -941,22 +1060,22 @@
endfor;
maxx:=maxx+1;
minx:=minx-1;
- if maxx<(ypart(#1)+1):
- maxx:=ypart(#1)+1;
+ if maxx<(Pasx+1):
+ maxx:=Pasx+1;
fi;
- if minx>(-ypart(#1)-1):
- minx:=-ypart(#1)-1;
+ if minx>(-Pasx-1):
+ minx:=-Pasx-1;
fi;
maxy:=maxy+1;
miny:=miny-1;
- if maxy<(ypart(#2)+1):
- maxy:=ypart(#2)+1;
+ if maxy<(Pasy+1):
+ maxy:=Pasy+1;
fi;
- if miny>(-ypart(#2)-1):
- miny:=-ypart(#2)-1;
+ if miny>(-Pasy-1):
+ miny:=-Pasy-1;
fi;
enddef;
- toto(#3);
+ toto(#1);
Figure((minx-1)*unitpx,(miny-1)*unitpy,(maxx+1)*unitpx,(maxy+1)*unitpy);
pair A,B,C,D,E;
A=(0,0);
@@ -973,31 +1092,42 @@
drawarrow (B+(-0.75*unitpx,0))--(C+(0.75*unitpx,0));
drawarrow (D+(0,-0.75*unitpy))--(E+(0,0.75*unitpy));
% graduation compl\`ete ou pas ?
- label.llft(btex \noexpand\footnotesize 0 etex,A);
- if #6>0:
+ label.llft(LATEX("\noexpand\footnotesize 0"),A);
+ if AffichageGrad:
for k=minx upto maxx:
if (xpart((k*unitex,0))>xpart(B+(-0.75*unitpx,0))) and (xpart((k*unitex,0))<xpart(C+(0.75*unitpx,0))):
if k<>0:
+ if Tiret:
+ draw (k*unitex,-1mm)--(k*unitex,1mm);
+ label.lrt(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(k)&"}"),(k*unitex,0));
+ else:
dotlabel.lrt(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(k)&"}"),(k*unitex,0));
fi;
fi;
+ fi;
endfor;
for k=miny upto maxy:
if (ypart((0,k*unitey))>ypart(D+(0,-0.75*unitpy))) and (ypart((0,k*unitey))<ypart(E+(0,0.75*unitpy))):
if k<>0:
+ if Tiret:
+ draw (-1mm,k*unitey)--(1mm,k*unitey);
+ label.ulft(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(k)&"}"),(0,k*unitey));
+ else:
dotlabel.ulft(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(k)&"}"),(0,k*unitey));
fi;
fi;
+ fi;
endfor;
else:
- dotlabel.lrt(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(xpart(#7))&"}"),(unitex,0));
- dotlabel.ulft(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(ypart(#7))&"}"),(0,unitey));
+ dotlabel.lrt(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(ValeurUnitex)&"}"),(unitex,0));
+ dotlabel.ulft(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(ValeurUnitey)&"}"),(0,unitey));
fi;
% apparition du nom des points ou pas
m_c:=m_c*3;
marque_p:="croix";
vardef tata(text t)=%on place les points
- if #4>0:
+ % {
+ if #2>0:
n:=1;
k:=0;%pour retenir la coordonn\'ee en x
l:=0;%pour retenir la coordonn\'ee en y
@@ -1013,7 +1143,7 @@
fi;
fi;
if (n mod 3)=0:
- if #4>1:
+ if #2>1:
if p_<>"":
if (k>0) and (l>0):
label.urt(LATEX(p_),(k*unitpx,l*unitpy));
@@ -1042,375 +1172,63 @@
pointe((k*unitpx,l*unitpy));
fi;
fi;
- if (#4=1) or (#4=3):
+ if (#2=1) or (#2=3):
draw (0,l*unitpy)--(k*unitpx,l*unitpy)--(k*unitpx,0) dashed evenly;
fi;
fi;
n:=n+1;
endfor;
fi;
- if #5=2:
+ % }
n:=1;
k:=0;%pour retenir la coordonn\'ee en x
l:=0;%pour retenir la coordonn\'ee en y
for p_=t:
- if (n mod 3)=1:
- if numeric p_:
- k:=p_;
- fi;
- fi;
- if (n mod 3)=2:
- if numeric p_:
- l:=p_;
- fi;
- fi;
- if (n mod 3)=0:
- if p_<>"":
- if (k mod pasx)<>0:
- label.lrt(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{"&decimal(k)&"}}{\noexpand\num{"&decimal(pasx)&"}}$"),(k*unitpx,0));
- else:
- label.lrt(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
- fi;
- if (l mod pasy)<>0:
- label.ulft(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{"&decimal(l)&"}}{\noexpand\num{"&decimal(pasy)&"}}$"),(0,l*unitpy));
- else:
- label.ulft(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
+ if (n mod 3)=1:
+ if numeric p_:
+ k:=p_;
fi;
- pointe((k*unitpx,0),(0,l*unitpy));
- fi;
- fi;
- n:=n+1;
- endfor;
- elseif #5=1:
- n:=1;
- k:=0;%pour retenir la coordonn\'ee en x
- l:=0;%pour retenir la coordonn\'ee en y
- for p_=t:
- if (n mod 3)=1:
- if numeric p_:
- k:=p_;
- fi;
- fi;
- if (n mod 3)=2:
- if numeric p_:
- l:=p_;
- fi;
- fi;
- if (n mod 3)=0:
- if p_<>"":
- label.lrt(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
- label.ulft(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
- pointe((k*unitpx,0),(0,l*unitpy));
- fi;
- fi;
- n:=n+1;
- endfor;
- fi;
- enddef;
- tata(#3);
- \end{mpost}
- \fi
-}
-
-\def\MPPlanTrace#1#2#3#4#5#6#7#8#9{%
- \ifluatex
- \begin{mplibcode}
- maxx:=-4000;
- minx=4000;
- unitex:=#1*cm;
- pasx=#2;
- unitpx:=unitex/pasx;
- maxy:=-4000;
- miny:=4000;
- unitey:=#3*cm;
- pasy:=#4;
- unitpy:=unitey/pasy;
- n:=1;
- vardef toto(text t)=
- for p_=t:
- if (n mod 3)=1:
- if p_>maxx:
- maxx:=p_;
- fi;
- if p_<minx:
- minx:=p_;
- fi;
- fi;
- if (n mod 3)=2:
- if p_>maxy:
- maxy:=p_;
- fi;
- if p_<miny:
- miny:=p_;
fi;
+ if (n mod 3)=2:
+ if numeric p_:
+ l:=p_;
+ fi;
fi;
- n:=n+1;
- endfor;
- maxx:=maxx+1;
- minx:=minx-1;
- if maxx<(#2+1):
- maxx:=#2+1;
- fi;
- if minx>(-#2-1):
- minx:=-#2-1;
- fi;
- maxy:=maxy+1;
- miny:=miny-1;
- if maxy<(#4+1):
- maxy:=#2+1;
- fi;
- if miny>(-#4-1):
- miny:=-#4-1;
- fi;
- enddef;
- toto(#5);
- Figure((minx-1)*unitpx,(miny-1)*unitpy,(maxx+1)*unitpx,(maxy+1)*unitpy);
- pair A,B,C,D,E;
- A=(0,0);
- B=(minx*unitpx,0);
- C=(maxx*unitpx,0);
- D=(0,miny*unitpy);
- E=(0,maxy*unitpy);
- for k=0 upto (maxx-minx):
- draw ((xpart(B),ypart(D)-0.75*unitpy)--(xpart(B),ypart(E)+0.75*unitpy)) shifted (k*unitpx,0) withcolor gris;
- endfor;
- for k=0 upto (maxy-miny):
- draw ((xpart(B)-0.75*unitpx,ypart(D))--(xpart(C)+0.75*unitpx,ypart(D))) shifted (0,k*unitpy) withcolor gris;
- endfor;
- drawarrow (B+(-0.75*unitpx,0))--(C+(0.75*unitpx,0));
- drawarrow (D+(0,-0.75*unitpy))--(E+(0,0.75*unitpy));
- dotlabel.bot(TEX("\footnotesize\num{"&decimal(#7)&"}"),(unitex,0));
- dotlabel.lft(TEX("\footnotesize\num{"&decimal(#8)&"}"),(0,unitey));
- label.llft(btex 0 etex,A);
- % apparition du nom des points ou pas
- m_c:=m_c*3;
- marque_p:="croix";
- vardef tata(text t)=%on place les points
- if #6>0:
- n:=1;
- k:=0;%pour retenir la coordonn\'ee en x
- l:=0;%pour retenir la coordonn\'ee en y
- for p_=t:
- if (n mod 3)=1:
- if numeric p_:
- k:=p_;
- fi;
- fi;
- if (n mod 3)=2:
- if numeric p_:
- l:=p_;
- fi;
- fi;
- if (n mod 3)=0:
- if #6>1:
- if (k>0) and (l>0):
- label.urt(TEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k=0) and (l>0):
- label.urt(TEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k>0) and (l=0):
- label.urt(TEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k<0) and (l>0):
- label.ulft(TEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k=0) and (l<0):
- label.llft(TEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k<0) and (l<0):
- label.llft(TEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k<0) and (l=0):
- label.llft(TEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k>0) and (l<0):
- label.lrt(TEX(p_),(k*unitpx,l*unitpy));
- fi;
- pointe((k*unitpx,l*unitpy));
- fi;
- if (#6=1) or (#6=3):
- draw (0,l*unitpy)--(k*unitpx,l*unitpy)--(k*unitpx,0) dashed evenly;
- fi;
- fi;
- n:=n+1;
- endfor;
+ if (n mod 3)=0:
+ if #3=2:
+ if p_<>"":
+ if (k mod pasx)<>0:
+ label.lrt(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{"&decimal(k)&"}}{\noexpand\num{"&decimal(pasx)&"}}$"),(k*unitpx,0));
+ else:
+ label.lrt(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
+ fi;
+ if (l mod pasy)<>0:
+ label.ulft(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{"&decimal(l)&"}}{\noexpand\num{"&decimal(pasy)&"}}$"),(0,l*unitpy));
+ else:
+ label.ulft(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
+ fi;
+ pointe((k*unitpx,0),(0,l*unitpy));
+ fi;
+ elseif #3=1:
+ if p_<>"":
+ label.lrt(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
+ label.ulft(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
+ pointe((k*unitpx,0),(0,l*unitpy));
+ fi;
+ fi;
fi;
- enddef;
- vardef Tracage(text t)(text ls)=%on trace les segments
- pair A[];
- n:=0;%pour parcourir la liste
- m:=0;%pour lister les points par leur nombre
- for p_=t:
n:=n+1;
- if (n mod 3)=1:
- k:=p_;
- fi;
- if (n mod 3)=2:
- l:=p_;
- fi;
- if (n mod 3)=0:
- m:=m+1;
- A[m]=(k*unitpx,l*unitpy);
- fi;
- endfor;
- for p_=ls:
- draw segment(A[p_ div 10],A[p_ mod 10]);
endfor;
enddef;
tata(#5);
- Tracage(#5)(#9);
- \end{mplibcode}
- \else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
- maxx:=-4000;
- minx=4000;
- unitex:=#1*cm;
- pasx=#2;
- unitpx:=unitex/pasx;
- maxy:=-4000;
- miny:=4000;
- unitey:=#3*cm;
- pasy:=#4;
- unitpy:=unitey/pasy;
- n:=1;
- vardef toto(text t)=
- for p_=t:
- if (n mod 3)=1:
- if p_>maxx:
- maxx:=p_;
- fi;
- if p_<minx:
- minx:=p_;
- fi;
- fi;
- if (n mod 3)=2:
- if p_>maxy:
- maxy:=p_;
- fi;
- if p_<miny:
- miny:=p_;
- fi;
- fi;
- n:=n+1;
- endfor;
- maxx:=maxx+1;
- minx:=minx-1;
- if maxx<(#2+1):
- maxx:=#2+1;
- fi;
- if minx>(-#2-1):
- minx:=-#2-1;
- fi;
- maxy:=maxy+1;
- miny:=miny-1;
- if maxy<(#4+1):
- maxy:=#2+1;
- fi;
- if miny>(-#4-1):
- miny:=-#4-1;
- fi;
- enddef;
- toto(#5);
- Figure((minx-1)*unitpx,(miny-1)*unitpy,(maxx+1)*unitpx,(maxy+1)*unitpy);
- pair A,B,C,D,E;
- A=(0,0);
- B=(minx*unitpx,0);
- C=(maxx*unitpx,0);
- D=(0,miny*unitpy);
- E=(0,maxy*unitpy);
- for k=0 upto (maxx-minx):
- draw ((xpart(B),ypart(D)-0.75*unitpy)--(xpart(B),ypart(E)+0.75*unitpy)) shifted (k*unitpx,0) withcolor gris;
- endfor;
- for k=0 upto (maxy-miny):
- draw ((xpart(B)-0.75*unitpx,ypart(D))--(xpart(C)+0.75*unitpx,ypart(D))) shifted (0,k*unitpy) withcolor gris;
- endfor;
- drawarrow (B+(-0.75*unitpx,0))--(C+(0.75*unitpx,0));
- drawarrow (D+(0,-0.75*unitpy))--(E+(0,0.75*unitpy));
- dotlabel.bot(LATEX("\noexpand\footnotesize\num{"&decimal(#7)&"}"),(unitex,0));
- dotlabel.lft(LATEX("\noexpand\footnotesize\num{"&decimal(#8)&"}"),(0,unitey));
- label.llft(btex 0 etex,A);
- % apparition du nom des points ou pas
- m_c:=m_c*3;
- marque_p:="croix";
- vardef tata(text t)=%on place les points
- if #6>0:
- n:=1;
- k:=0;%pour retenir la coordonn\'ee en x
- l:=0;%pour retenir la coordonn\'ee en y
- for p_=t:
- if (n mod 3)=1:
- if numeric p_:
- k:=p_;
- fi;
- fi;
- if (n mod 3)=2:
- if numeric p_:
- l:=p_;
- fi;
- fi;
- if (n mod 3)=0:
- if #6>1:
- if (k>0) and (l>0):
- label.urt(LATEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k=0) and (l>0):
- label.urt(LATEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k>0) and (l=0):
- label.urt(LATEX(p_),(k*unitpx,l*unitpy));
+ AvantDefinirSommets(#4);
+ DefinirLesSommets(#1);
+ if Code:
+ EffectuerTraces;
fi;
- if (k<0) and (l>0):
- label.ulft(LATEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k=0) and (l<0):
- label.llft(LATEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k<0) and (l<0):
- label.llft(LATEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k<0) and (l=0):
- label.llft(LATEX(p_),(k*unitpx,l*unitpy));
- fi;
- if (k>0) and (l<0):
- label.lrt(LATEX(p_),(k*unitpx,l*unitpy));
- fi;
- pointe((k*unitpx,l*unitpy));
- fi;
- if (#6=1) or (#6=3):
- draw (0,l*unitpy)--(k*unitpx,l*unitpy)--(k*unitpx,0) dashed evenly;
- fi;
- fi;
- n:=n+1;
- endfor;
- fi;
- enddef;
- vardef Tracage(text t)(text ls)=%on trace les segments
- pair A[];
- n:=0;%pour parcourir la liste
- m:=0;%pour lister les points par leur nombre
- for p_=t:
- n:=n+1;
- if (n mod 3)=1:
- k:=p_;
- fi;
- if (n mod 3)=2:
- l:=p_;
- fi;
- if (n mod 3)=0:
- m:=m+1;
- A[m]=(k*unitpx,l*unitpy);
- fi;
- endfor;
- for p_=ls:
- draw segment(A[p_ div 10],A[p_ mod 10]);
- endfor;
- enddef;
- tata(#5);
- Tracage(#5)(#9);
\end{mpost}
\fi
-}
+}%
\def\MPTouteDROITEGraduee#1#2{%
% #1 : liste des points \`a placer en pas. pour g\'erer le cas des rep\'erages fractionnaires
@@ -1546,10 +1364,12 @@
drawarrow (unitp*valeur[n],-7mm if (n mod 2)=0:-5mm fi)--(unitp*valeur[n],-3mm);
else:
drawarrow (unitp*valeur[n],-7mm)--(unitp*valeur[n],-3mm);
+ label.bot(TEX("\pointilles[1cm]"),(unitp*valeur[n],-7mm));
fi;
numeric LongPoint;
Labeloffset:=labeloffset;
labeloffset:=0pt;
+ if Decale:
if DemiDroite:
LongPoint=abs(C-(B+unitp*(0.75,0)));
label.rt(TEX("\pointilles["&decimal(LongPoint)&"pt]"),C+(0,-1.6cm));
@@ -1557,6 +1377,7 @@
LongPoint=abs((C+unitp*(-0.75,0))-(B+unitp*(0.75,0)));
label.rt(TEX("\pointilles["&decimal(LongPoint)&"pt]"),C+unitp*(-0.75,0)+(0,-1.6cm));
fi;
+ fi;
labeloffset:=Labeloffset;
pointe(unitp*(valeur[n],0));
elseif ACoord=2:
@@ -1579,10 +1400,12 @@
drawarrow (unitp*valeur[n],-7mm if (n mod 2)=0:-5mm fi)--(unitp*valeur[n],-3mm);
else:
drawarrow (unitp*valeur[n],-7mm)--(unitp*valeur[n],-3mm);
+ label.bot(TEX("\pointilles[1cm]"),(unitp*valeur[n],-7mm));
fi;
numeric LongPoint;
Labeloffset:=labeloffset;
labeloffset:=0pt;
+ if Decale:
if DemiDroite:
LongPoint=abs(C-(B+unitp*(0.75,0)));
label.rt(TEX("\pointilles["&decimal(LongPoint)&"pt]"),C+(0,-1.6cm));
@@ -1590,6 +1413,7 @@
LongPoint=abs((C+unitp*(-0.75,0))-(B+unitp*(0.75,0)));
label.rt(TEX("\pointilles["&decimal(LongPoint)&"pt]"),C+unitp*(-0.75,0)+(0,-1.6cm));
fi;
+ fi;
labeloffset:=Labeloffset;
pointe(unitp*(valeur[n],0));
fi;
@@ -2299,8 +2123,9 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V
\readlist*\ListePointEspace{#2}%
\buildespace%
}{\ifboolKV[ClesReperage]{Plan}{%
- \setsepchar[*]{,*/}\ignoreemptyitems%
- \readlist*\ListePointRepere{#2}%
+ \setsepchar[*]{,*/}%\ignoreemptyitems%
+ \readlist\ListePointRepere{#2}%
+ \ignoreemptyitems
\buildreperenew%
}{%
\setsepchar[*]{,*/}\ignoreemptyitems%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRepresenterFraction.tex b/macros/latex/contrib/profcollege/latex/PfCRepresenterFraction.tex
index aed889bfcb..d0d39859ea 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRepresenterFraction.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRepresenterFraction.tex
@@ -382,7 +382,7 @@
trace FractionRectangle(#1,#2);
\end{mplibcode}
\else%
- \begin{mpost}[mpsettings={\MPFractionRectangleCode}]
+ \begin{mpost}[mpsettings={\MPFractionRectangleCode;color ColRectangle;ColRectangle=\useKV[ClesFraction]{Couleur};}]
trace FractionRectangle(#1,#2);
\end{mpost}
\fi%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex b/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex
index 22ea023935..dbd54d1857 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex
@@ -40,7 +40,7 @@
\newcolumntype{B}{>{\centering\arraybackslash}m{\PfCTableurLargeur}}%
\setlength{\PfCLongInter}{-40pt+\fpeval{\useKV[Tableur]{LargeurUn}}pt+\fpeval{(\useKV[Tableur]{Colonnes}-2)*\useKV[Tableur]{Largeur}}pt+\fpeval{2*\useKV[Tableur]{Colonnes}-6}\tabcolsep+\fpeval{\useKV[Tableur]{Colonnes}+2}\arrayrulewidth}%
\ifboolKV[Tableur]{Bandeau}{%
- \begin{NiceTabular}{p{\PfCTableurLargeur}p{10pt}p{50pt}p{\PfCLongInter}}
+ \begin{NiceTabular}{p{\PfCTableurLargeur}p{10pt}p{50pt}p{\PfCLongInter}}%
\Block[draw,l]{}{\useKV[Tableur]{Cellule}}&\Block[draw]{}{\scriptsize$\blacktriangledown$}&\Block{}{$f_x$\hfill$\sum$~\scriptsize$\blacktriangledown$\hfill$=$}&\Block[draw]{}{\useKV[Tableur]{Formule}\hfill\scriptsize$\blacktriangledown$}\\
\end{NiceTabular}%
\nopagebreak%
@@ -56,7 +56,7 @@
\ifboolKV[Tableur]{Selection}{%
\xintifboolexpr{\cntlin>\useKV[Tableur]{Ligne} && \cntlin<\fpeval{\useKV[Tableur]{Ligne}+\useKV[Tableur]{PasL}+1}}{\textcolor{white}{\number\numexpr\cntlin-1\relax}}{\number\numexpr\cntlin-1\relax}%
}{\number\numexpr\cntlin-1\relax}\fi}%
- wc{20pt}A*{\fpeval{\useKV[Tableur]{Colonnes}-1}}{B}}[hvlines]%
+ wc{20pt}A*{\fpeval{\useKV[Tableur]{Colonnes}-1}}{B}}[hvlines,color-inside]%
\CodeBefore
% on colorie en gris toute la première ligne
\tikz\fill[gray!15](row-1-|col-1) rectangle (row-2-|last);%
@@ -101,4 +101,4 @@
\repeat%
\addtot@b{\\&}%
\collectcp@body}{\the\t@b}%
-\makeatother
+\makeatother \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex b/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex
index 4038ecd1b0..3e2aa47db9 100644
--- a/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex
@@ -180,7 +180,7 @@
}%
}%
-\setKVdefault[ClesSimplification]{Details=false,All=false,Longue=false,Fleches=false,Contraire=0,Couleur=black,Debut=false,Impose=false}
+\setKVdefault[ClesSimplification]{Details=false,All=false,Longue=false,Fleches=false,Contraire=0,Couleur=black,Debut=false,Impose=false,Decomposition=false}
\defKV[ClesSimplification]{Nombre=\setKV[ClesSimplification]{Impose}}
\newcounter{NbFrac}%
@@ -215,12 +215,105 @@
\frac{\num{#2}}{\num{#3}}=\frac{\num{#2}\times\num{\useKV[ClesSimplification]{Contraire}}}{\num{#3}\times\num{\useKV[ClesSimplification]{Contraire}}}=\frac{\num{\fpeval{\useKV[ClesSimplification]{Contraire}*#2}}}{\num{\fpeval{\useKV[ClesSimplification]{Contraire}*#3}}}%
}%
}{%
+ \ifboolKV[ClesSimplification]{Decomposition}{%
+ \DecompositionSimplification{#2}{#3}%
+ }{%
\ifboolKV[ClesSimplification]{Longue}{%
\colorlet{PfCSimpliCol}{\useKV[ClesSimplification]{Couleur}}%
\LongueSimplification{#2}{#3}%
}{%
\ifboolKV[ClesSimplification]{Details}{\SSimpli{#2}{#3}}{\ifboolKV[ClesSimplification]{All}{\ensuremath{\SSimpli{#2}{#3}=\SSimplifie{#2}{#3}}}{\SSimplifie{#2}{#3}}}%
- }%
+ }%
+ }%
}%
}%
+}%
+
+\NewDocumentCommand\DecompositionSimplification{mm}{%
+ \setsepchar{,}\ignoreemptyitems%
+ \RecupListeTousFacteursPremier{#1}%
+ \readlist*\DiviseurHaut{\PfCPileFacteurs}%
+ \RecupListeTousFacteursPremier{#2}%
+ \readlist*\DiviseurBas{\PfCPileFacteurs}%
+ \xdef\LongueurH{\DiviseurHautlen}%
+ \xdef\LongueurB{\DiviseurBaslen}%
+ \xdef\PfCPremierFacteur{#1}%
+ \xdef\PfCDeuxiemeFacteur{#2}%
+ \DiviseurCommun{#1}{#2}%
+ \ensuremath{%
+ \ifnum\PfCDivCom>1%
+ \frac{%
+ \xintFor* ##2 in{\xintSeq{1}{\LongueurH}}\do{%
+ \DiviseurCommun{\DiviseurHaut[##2]}{\PfCDeuxiemeFacteur}
+ \ifnum\PfCDivCom>1%
+ \mathcolor{\useKV[ClesSimplification]{Couleur}}{\DiviseurHaut[##2]}
+ \xdef\PfCDeuxiemeFacteur{\fpeval{\PfCDeuxiemeFacteur/\DiviseurHaut[##2]}}
+ \else
+ \DiviseurHaut[##2]
+ \fi
+ \xintifForLast{}{\times}
+ }
+ }{%
+ \xintFor* ##2 in{\xintSeq{1}{\LongueurB}}\do{%
+ \DiviseurCommun{\DiviseurBas[##2]}{\PfCPremierFacteur}
+ \ifnum\PfCDivCom>1%
+ \mathcolor{\useKV[ClesSimplification]{Couleur}}{\DiviseurBas[##2]}
+ \xdef\PfCPremierFacteur{\fpeval{\PfCPremierFacteur/\DiviseurBas[##2]}}
+ \else
+ \DiviseurBas[##2]
+ \fi
+ \xintifForLast{}{\times}
+ }
+ }=\frac{\PfCPremierFacteur}{\PfCDeuxiemeFacteur}
+ \else
+ \tofrac{#1/#2}
+ \fi
+ }%
+}%
+
+\NewDocumentCommand\DecompositionSimplificationSeule{mm}{%
+ \setsepchar{,}\ignoreemptyitems%
+ \RecupListeTousFacteursPremier{\fpeval{abs(#1)}}%
+ \readlist*\DiviseurHaut{\PfCPileFacteurs}%
+ \RecupListeTousFacteursPremier{\fpeval{abs(#2)}}%
+ \readlist*\DiviseurBas{\PfCPileFacteurs}%
+ \xdef\LongueurH{\DiviseurHautlen}%
+ \xdef\LongueurB{\DiviseurBaslen}%
+ \xintifboolexpr{\fpeval{#1*#2}<0}{%
+ \xdef\PfCPremierFacteur{#1}%
+ \xdef\PfCDeuxiemeFacteur{#2}%
+ }{%
+ \xdef\PfCPremierFacteur{\fpeval{abs(#1)}}%
+ \xdef\PfCDeuxiemeFacteur{\fpeval{abs(#2)}}%
+ }%
+ \DiviseurCommun{\fpeval{abs(#1)}}{\fpeval{abs(#2)}}%
+ \ensuremath{%
+ \ifnum\PfCDivCom>1%
+ \frac{%
+ \xintifboolexpr{\fpeval{#1*#2}<0}{\xintifboolexpr{#1<0}{-}{}}{}\xintFor* ##2 in{\xintSeq{1}{\LongueurH}}\do{%
+ \DiviseurCommun{\DiviseurHaut[##2]}{\PfCDeuxiemeFacteur}
+ \ifnum\PfCDivCom>1%
+ \mathcolor{\useKV[ClesSimplification]{Couleur}}{\DiviseurHaut[##2]}
+ \xdef\PfCDeuxiemeFacteur{\fpeval{\PfCDeuxiemeFacteur/\DiviseurHaut[##2]}}
+ \else
+ \DiviseurHaut[##2]
+ \fi
+ \xintifForLast{}{\times}
+ }
+ }{%
+ \xintifboolexpr{\fpeval{#1*#2}<0}{\xintifboolexpr{#1<0}{}{-}}{}\xintFor* ##2 in{\xintSeq{1}{\LongueurB}}\do{%
+ \DiviseurCommun{\DiviseurBas[##2]}{\PfCPremierFacteur}
+ \ifnum\PfCDivCom>1%
+ \mathcolor{\useKV[ClesSimplification]{Couleur}}{\DiviseurBas[##2]}
+ \xdef\PfCPremierFacteur{\fpeval{\PfCPremierFacteur/\DiviseurBas[##2]}}
+ \else
+ \DiviseurBas[##2]
+ \fi
+ \xintifForLast{}{\times}
+ }
+ }%=\frac{\PfCPremierFacteur}{\PfCDeuxiemeFacteur}
+ \else
+ \tofrac{#1/#2}
+ \fi
+ }%
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCSommeAngles.tex b/macros/latex/contrib/profcollege/latex/PfCSommeAngles.tex
index ec142b6a3f..df62edfbce 100644
--- a/macros/latex/contrib/profcollege/latex/PfCSommeAngles.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCSommeAngles.tex
@@ -274,7 +274,7 @@
\ifboolKV[ClesSommeAngle]{Detail}{2\times\widehat{\NomA\NomB\NomC}&=\ang{180}-\ang{#4}\\}{2\times\widehat{\NomA\NomB\NomC}&=\ang{\totalangle}\\}%
\ifboolKV[ClesSommeAngle]{Detail}{2\times\widehat{\NomA\NomB\NomC}&=\ang{\totalangle}\\}{\widehat{\NomA\NomB\NomC}&=\frac{\ang{\totalangle}}{2}\\}%
\ifboolKV[ClesSommeAngle]{Detail}{\widehat{\NomA\NomB\NomC}&=\frac{\ang{\totalangle}}{2}\\}{\widehat{\NomA\NomB\NomC}&=\ang{\fpeval{0.5*(180-#4)}}}%\\
- \ifboolKV[ClesSommeAngle]{Detail}{\widehat{\NomA\NomB\NomC}&=\ang{\fpeval{0.5*(180-#4)}}\\}{}%
+ \ifboolKV[ClesSommeAngle]{Detail}{\widehat{\NomA\NomB\NomC}&=\ang{\fpeval{0.5*(180-#4)}}}{}%
\end{align*}%
\xdef\ResultatAngle{\fpeval{0.5*(180-#4)}}%
\fi%
diff --git a/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex b/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex
index 720186804f..3be43cc34d 100644
--- a/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex
@@ -1883,13 +1883,12 @@ Histogramme=false,UniteAire=1,MemeAmpli,DepartHisto=1%
On range les donn\'ees par ordre croissant :%
\nbdonnees=0%
\xintifboolexpr{\ListeCompletelen<\useKV[ClesStat]{Coupure}}{%
- \[\DTLforeach{mtdb}{\numeroDonnee=Numeric}{\num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\DTLiflastrow{.}{;}}\]%
+ \[\DTLforeach{mtdb}{\numeroDonnee=Numeric}{\num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\DTLiflastrow{.}{\,;~}}\]%
}{%
%\medskip%
\begin{center}
\begin{minipage}{0.9\linewidth}
- \DTLforeach*{mtdb}{\numeroDonnee=Numeric}{\num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\DTLiflastrow{.}{;
- }\nbdonnees=\fpeval{\nbdonnees+1}\modulo{\nbdonnees}{\useKV[ClesStat]{Coupure}}\xintifboolexpr{\remainder==0}{\\}{}}
+ \DTLforeach*{mtdb}{\numeroDonnee=Numeric}{\num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\DTLiflastrow{.}{\,;~}\nbdonnees=\fpeval{\nbdonnees+1}\modulo{\nbdonnees}{\useKV[ClesStat]{Coupure}}\xintifboolexpr{\remainder==0}{\\}{}}
\end{minipage}
\end{center}%
%\medskip%
@@ -1898,11 +1897,11 @@ Histogramme=false,UniteAire=1,MemeAmpli,DepartHisto=1%
\newcount\meda%
\ifodd\number\ListeCompletelen%odd impair
\med=\fpeval{(\ListeCompletelen+1)/2}\relax%
- L'effectif total de la s\'erie est \num{\ListeCompletelen}. Or, $\num{\ListeCompletelen}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$.\\
+ \ifboolKV[ClesStat]{SET}{On sait que }{L'effectif total de la s\'erie est \num{\ListeCompletelen}. Or, }$\num{\ListeCompletelen}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$.\\
\else% pair
\med=\fpeval{\ListeCompletelen/2}\relax%
\meda=\numexpr\med+1\relax%
- L'effectif total de la s\'erie est \num{\ListeCompletelen}. Or, $\num{\ListeCompletelen}=\num{\the\med}+\num{\the\med}$.\\
+ \ifboolKV[ClesStat]{SET}{On sait que }{L'effectif total de la s\'erie est \num{\ListeCompletelen}. Or, }$\num{\ListeCompletelen}=\num{\the\med}+\num{\the\med}$.\\
\fi%
\newcount\k%
\k=0%
@@ -2070,11 +2069,11 @@ Histogramme=false,UniteAire=1,MemeAmpli,DepartHisto=1%
\newcount\meda%
\ifodd\number\EffectifTotal%odd impair
\med=\fpeval{(\EffectifTotal+1)/2}\relax%
- L'effectif total de la s\'erie est \num{\EffectifTotal}. Or, $\num{\EffectifTotal}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$. %
+ \ifboolKV[ClesStat]{SET}{On sait que }{L'effectif total de la s\'erie est \num{\EffectifTotal}. Or, }$\num{\EffectifTotal}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$. %
\else% pair
\med=\fpeval{\EffectifTotal/2}\relax%
\meda=\numexpr\med+1\relax%
- L'effectif total de la s\'erie est \num{\EffectifTotal}. Or, $\num{\EffectifTotal}=\num{\fpeval{\med}}+\num{\fpeval{\med}}$. %
+ \ifboolKV[ClesStat]{SET}{On sait que }{L'effectif total de la s\'erie est \num{\EffectifTotal}. Or, }$\num{\EffectifTotal}=\num{\fpeval{\med}}+\num{\fpeval{\med}}$. %
\fi%
\newcount\k%
\k=0%
diff --git a/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex b/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
index 84d64c3f09..75270180d3 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
@@ -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,CarreA=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,CubeA=false,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1,Octet=false,CouleurGN=white,CadreGN=black,Tabcolsep=0.275\tabcolsep,Exterieur=false}%
+\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,CarreA=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,CubeA=false,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1,Octet=false,CouleurGN=white,CadreGN=black,Tabcolsep=0.275\tabcolsep,Exterieur=false,Condense=false}%
\defKV[ClesTableaux]{ColonnesSup=\setKV[ClesTableaux]{Exterieur}}%
%
\newcommand\PfCTBstrut{\rule[-1.2ex]{0pt}{3.8ex}}% Top and Bottom strut
@@ -1153,13 +1153,15 @@
\ifboolKV[ClesTableaux]{Carre}{%
\[\renewcommand{\arraystretch}{1.15}%
\begin{NiceTabular}{*{7}{wc{3.5mm}wc{3.5mm}}}%
- \Block[]{1-2}{}%
- &&\Block[]{1-2}{}%
- &&\Block[]{1-2}{}%
- &&\Block[]{1-2}{}%
- &&\Block[]{1-2}{}%
- &&\Block[]{1-2}{}%
- &&\Block[]{1-2}{}\\
+ \ifboolKV[ClesTableaux]{Condense}{}{%
+ \Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}\\
+ }%
\Block[borders={left,top,right}]{1-2}{km$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{hm$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{dam$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{m$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{dm$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{cm$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{mm$^2$\PfCTBstrut}&\\
\ifboolKV[ClesTableaux]{Are}{%
\Block[borders={left,right,bottom}]{1-2}{}&&\Block[draw=gray!50,borders={left,top,bottom}]{}{~}&\Block[borders={top,right,bottom}]{}{\scriptsize ha}&\Block[draw=gray!50,borders={left,top,bottom}]{}{~}&\Block[borders={top,right,bottom}]{}{\scriptsize a}&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&\\
@@ -1167,29 +1169,33 @@
\xintFor* ##1 in {\xintSeq {1}{\useKV[ClesTableaux]{NbLignes}}}\do{%
&&&&&&&&&&&&&\\
}%
- \Block[]{1-2}{}%
- &&\Block[]{1-2}{}%
- &&\Block[]{1-2}{}%
- &&\Block[]{1-2}{}%
- &&\Block[]{1-2}{}%
- &&\Block[]{1-2}{}%
- &&\Block[]{1-2}{}\\
+ \ifboolKV[ClesTableaux]{Condense}{}{%
+ \Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}\\
+ }
\CodeAfter
% on trace les lignes verticales
+ \xdef\PfCRetiensDepart{3}%
+ \ifboolKV[ClesTableaux]{Condense}{\xdef\PfCRetiensDepart{2}}{}%
\xintifboolexpr{\useKV[ClesTableaux]{Are}}{%
\xintFor* ##1 in {\xintSeq{1}{8}}\do{%
- \tikz\draw (4-|\fpeval{2*(##1-1)+1})--(\fpeval{4+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+1});
+ \tikz\draw (\fpeval{\PfCRetiensDepart+1}-|\fpeval{2*(##1-1)+1})--(\fpeval{\fpeval{\PfCRetiensDepart+1}+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+1});
}%
\xintFor* ##1 in {\xintSeq{1}{7}}\do{%
- \tikz\draw[gray!50] (4-|\fpeval{2*(##1-1)+2})--(\fpeval{4+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+2});
+ \tikz\draw[gray!50] (\fpeval{\PfCRetiensDepart+1}-|\fpeval{2*(##1-1)+2})--(\fpeval{\fpeval{\PfCRetiensDepart+1}+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+2});
}%
}{%
\xintFor* ##1 in {\xintSeq{1}{8}}\do{%
- \tikz\draw (3-|\fpeval{2*(##1-1)+1})--(\fpeval{3+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+1});
+ \tikz\draw (\PfCRetiensDepart-|\fpeval{2*(##1-1)+1})--(\fpeval{\PfCRetiensDepart+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+1});
}%
\xintifboolexpr{\useKV[ClesTableaux]{Colonnes}}{%
\xintFor* ##1 in {\xintSeq{1}{7}}\do{%
- \tikz\draw[gray!50] (3-|\fpeval{2*(##1-1)+2})--(\fpeval{3+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+2});
+ \tikz\draw[gray!50] (\PfCRetiensDepart-|\fpeval{2*(##1-1)+2})--(\fpeval{\PfCRetiensDepart+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+2});
}%
}{}%
}%
@@ -1201,11 +1207,12 @@
\xintFor* ##2 in{\xintSeq {1}{\ListeNombreAPlacerlen}}\do{
\StrLen{\ListeNombreAPlacer[##2,1]}[\TabLongueurNombre]%
\xintFor* ##1 in{\xintSeq {1}{\TabLongueurNombre}}\do{%
- \tikz\node at (\fpeval{##2+\ifboolKV[ClesTableaux]{Are}{3.5}{2.5}}-|\fpeval{\ListeNombreAPlacer[##2,2]-0.5+##1}) {\PfCTBstrut\StrMid{\ListeNombreAPlacer[##2,1]}{##1}{##1}};
+ \tikz\node at (\fpeval{##2+\ifboolKV[ClesTableaux]{Are}{\fpeval{\PfCRetiensDepart+0.5}}{\fpeval{\PfCRetiensDepart-0.5}}}-|\fpeval{\ListeNombreAPlacer[##2,2]-0.5+##1}) {\PfCTBstrut\StrMid{\ListeNombreAPlacer[##2,1]}{##1}{##1}};
}%
}
\fi%
% on trace les flèches
+ \ifboolKV[ClesTableaux]{Condense}{}{%
\ifboolKV[ClesTableaux]{Fleches}{\setKV[ClesTableaux]{FlechesH,FlechesB}}{}%
\ifboolKV[ClesTableaux]{Are}{\xdef\PfCTableauDepart{4}}{\xdef\PfCTableauDepart{3}}%
\ifboolKV[ClesTableaux]{FlechesH}{%
@@ -1218,6 +1225,7 @@
\tikz\draw[gray,->,>=latex,out=-150,in=-30] (\fpeval{\PfCTableauDepart+\useKV[ClesTableaux]{NbLignes}+0.5}-|\fpeval{2*(##1+1)}) to node[below,midway]{\small$\div\num{100}$}(\fpeval{\PfCTableauDepart+\useKV[ClesTableaux]{NbLignes}+0.5}-|\fpeval{2*##1});%
}%
}{}%
+ }%
\useKV[ClesTableaux]{CodeAfter}%
\end{NiceTabular}
\]%
diff --git a/macros/latex/contrib/profcollege/latex/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
index 9cf41f3817..18b287fba4 100644
--- a/macros/latex/contrib/profcollege/latex/ProfCollege.sty
+++ b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
@@ -2,9 +2,9 @@
% licence : Released under the LaTeX Project Public License v1.3c
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}%
-\def\filedate{2023/10/15}%
+\def\filedate{2023/11/14}%
\let\PfCfiledate\filedate%
-\def\fileversion{0.99-z-v}%
+\def\fileversion{0.99-z-w}%
\let\PfCfileversion\fileversion%
\ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]%
@@ -49,8 +49,8 @@
\DeclareSIUnit{\Dollar}{\$}%
\DeclareSIUnit{\LivreSterling}{£}%
-
\RequirePackage[table,svgnames]{xcolor}%Gestion des couleurs
+%\PassOptionsToPackage{table,svgnames}{xcolor}
\RequirePackage{xstring}%Gestion de chaines de caractères
\RequirePackage{simplekv}%Gestion de paramètres sous forme de clés
\RequirePackage{ifthen}%
@@ -168,6 +168,62 @@
%%%
% Commandes "utiles"
%%%
+\NewDocumentCommand\NumMA{m}{%
+ \xintifboolexpr{#1<0}{%
+ (\num{#1})%
+ }{%
+ \num{#1}%
+ }%
+}%
+
+\newcounter{Marque}
+
+\NewDocumentCommand\AffichageTab{O{x}mmm}{%
+ \ifnum#2=0\relax%
+ \ifnum#3=0\relax%
+ \ifnum#4=0\relax%
+ \else%
+ #4%
+ \fi%
+ \else%
+ #3*#1%
+ \ifnum#4=0\relax%
+ \else%
+ \ifnum#4<0\relax%
+ #4%
+ \else%
+ +#4%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ #2*#1*#1%
+ \ifnum#3=0\relax%
+ \ifnum#4=0\relax%
+ \else%
+ \ifnum#4<0%
+ #4%
+ \else%
+ +#4%
+ \fi%
+ \fi%
+ \else%
+ \ifnum#3<0%
+ #3*#1%
+ \else%
+ +#3*#1%
+ \fi%
+ \ifnum#4=0\relax%
+ \else%
+ \ifnum#4<0%
+ #4%
+ \else%
+ +#4%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}%
%encadrer avec des "sommets arrondis"
\newsavebox{\logobox}%
@@ -599,6 +655,12 @@
}%\emoticon
}%\raisebox
}%
+
+\setsepchar[*]{,*/}\ignoreemptyitems
+\readlist*\ListeMateriaux{aluminium/'/2.7,chêne/e~/0.69,bouleau/e~/0.65,sapin/e~/0.45,polystyrène/e~/1.04,porcelaine/la/2.5,acier/'/7.85,cuivre/e~/8.92,fer/e~/7.86,or/'/19.3,argent/'/10.5,bronze/e~/8.4,plomb/e~/11.35,marbre/e~/2.75,laiton/e~/7.3,titane/e~/4.5,PVC/e~/1.38}
+\setsepchar{,}
+
+\input{PfCCritere}
\input{PfCLego}
\input{PfCJeton}
\input{PfCDessinAlgo}
diff --git a/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp b/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp
index 37f4809598..bada2c141a 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp
@@ -56,6 +56,17 @@ _tn:=0;
pair _t[];
color _T[];
+%%%%%%%%%
+%Labelisation spéciale :)
+%
+vardef Labelcp(suffix a)(expr s,z) =
+ save p; picture p;
+ if picture s: p=s
+ else: p = s infont defaultfont scaled defaultscale
+ fi;
+ draw p shifted (z + 2*labeloffset*unitvector(z-a)-center p)
+enddef;
+
%%-----------------------------------------------
%% Procedures d'affichage
%%-----------------------------------------------
diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
index d0dbad1a25..f60928745c 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
@@ -1910,8 +1910,12 @@ vardef Sinon=
$=image(
fill cadre withcolor if print=true : coefprint*white else : if unknown colControle : LightOrange else : colControle fi fi;
draw cadre withcolor if print=true : coefprint*white else : if unknown colControle : LightOrange else : colControle fi fi;
- drawoptions(withcolor white);
- label.rt(TEX("\longbarre\sffamily\bfseries sinon"),(xpart(llcorner texto),ypart(center texto)));
+ if print:
+ label.rt(TEX("\longbarre\sffamily\bfseries sinon"),(xpart(llcorner texto),ypart(center texto)));
+ else:
+ drawoptions(withcolor white);
+ label.rt(TEX("\longbarre\sffamily\bfseries sinon"),(xpart(llcorner texto),ypart(center texto)));
+ fi;
drawoptions();
if BlocStopAvant=false:
draw (coindebutbloc[numblocrep]+(0.0625+0.5cm,0)+(eb,0.125)){dir180}..
@@ -2456,13 +2460,13 @@ TEXT=image(
path cadre;
cadre=CADRE(texto);
fill cadre withcolor white;
- draw %(urcorner texto+(0,eb))--
- (ulcorner texto+(0.625cm,0)+(eb,eb)){dir180}..
- {dir180}(ulcorner texto+(0.625cm,0))--
- (ulcorner texto+(0.375cm,0)){dir180}..
- {dir180}(ulcorner texto+(0.375cm,0)+(-eb,eb))
- %--(ulcorner texto+(0,eb))
- withpen pencircle scaled 0.01;
+ %draw %(urcorner texto+(0,eb))--
+ % (ulcorner texto+(0.625cm,0)+(eb,eb)){dir180}..
+ % {dir180}(ulcorner texto+(0.625cm,0))--
+ % (ulcorner texto+(0.375cm,0)){dir180}..
+ % {dir180}(ulcorner texto+(0.375cm,0)+(-eb,eb))
+ % %--(ulcorner texto+(0,eb))
+ % withpen pencircle scaled 0.01;
draw texto;
);
$=TEXT shifted (if unknown _coinprec:(0,0) else :_coinprec fi - ulcorner TEXT);