summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-03-13 20:48:57 +0000
committerKarl Berry <karl@freefriends.org>2022-03-13 20:48:57 +0000
commite178dd8e5072a961829b8d3e5ff93fb37dd76a35 (patch)
tree91c0f5f020df68f331586be4842cb04dd3814a4b /Master
parent0e50ee67cfd0fd2f4042ee94f72bb0c2d24e1e8f (diff)
profcollege (13mar22)
git-svn-id: svn://tug.org/texlive/trunk@62686 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdfbin7636879 -> 7679593 bytes
-rw-r--r--Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zipbin2123906 -> 2127632 bytes
-rw-r--r--Master/texmf-dist/metapost/profcollege/PfCArithmetique.mp237
-rw-r--r--Master/texmf-dist/metapost/profcollege/PfCScratchpdf.mp38
-rw-r--r--Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty1061
5 files changed, 889 insertions, 447 deletions
diff --git a/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf b/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
index d5bd2b67496..77976e2bf7d 100644
--- a/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
+++ b/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip b/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
index d7ad93e5099..7832f3eaafd 100644
--- a/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
+++ b/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
Binary files differ
diff --git a/Master/texmf-dist/metapost/profcollege/PfCArithmetique.mp b/Master/texmf-dist/metapost/profcollege/PfCArithmetique.mp
new file mode 100644
index 00000000000..870049c0113
--- /dev/null
+++ b/Master/texmf-dist/metapost/profcollege/PfCArithmetique.mp
@@ -0,0 +1,237 @@
+% Fichier regroupant les macros pour les schémas des nombres premiers
+
+numeric retenirnb[];
+
+vardef Estcepremier(expr NBa)=
+ boolean $;
+ c:=2;
+ departa:=NBa;
+ test:=1;
+ $=true;
+ if departa=1:
+ $:=false;
+ else:
+ forever:
+ if (departa mod c)=0:
+ departa:=departa div c;
+ test:=test+1;
+ else:
+ c:=c+1;
+ fi;
+ exitif departa=1;
+ endfor;
+ fi;
+ if test=2:
+ $:=true
+ else:
+ $:=false;
+ fi;
+ $
+enddef;
+
+vardef PremierSimple(expr NB)=
+ b:=2;
+ depart:=NB;
+ if Estcepremier(depart)=false:
+ forever:
+ if (depart mod b)=0:
+ Ancre[k+1]-Ancre[k]=(-decalage*0.5,-decalage);
+ Ancre[k+2]-Ancre[k+1]=(decalage,0);
+ depart:=depart div b;
+ retenirnb[k+1]=b;
+ retenirnb[k+2]=depart;
+ label(TEX("\num{"&decimal(b)&"}"),Ancre[k+1]);
+ label(TEX("\num{"&decimal(depart)&"}"),Ancre[k+2]);
+ draw 1/5[Ancre[k],Ancre[k+1]]--4/5[Ancre[k],Ancre[k+1]];
+ draw 1/5[Ancre[k],Ancre[k+2]]--4/5[Ancre[k],Ancre[k+2]];
+ k:=k+2;
+ racine:=depart;
+ depart:=1;
+ else:
+ b:=b+1;
+ fi;
+ exitif depart=1;
+ endfor;
+ else:
+ racine:=1;
+ fi;
+enddef;
+
+vardef PremierSimplePdf(expr NB)=
+ b:=2;
+ depart:=NB;
+ if Estcepremier(depart)=false:
+ forever:
+ if (depart mod b)=0:
+ Ancre[k+1]-Ancre[k]=(-decalage*0.5,-decalage);
+ Ancre[k+2]-Ancre[k+1]=(decalage,0);
+ depart:=depart div b;
+ retenirnb[k+1]=b;
+ retenirnb[k+2]=depart;
+ label(LATEX("\num{"&decimal(b)&"}"),Ancre[k+1]);
+ label(LATEX("\num{"&decimal(depart)&"}"),Ancre[k+2]);
+ draw 1/5[Ancre[k],Ancre[k+1]]--4/5[Ancre[k],Ancre[k+1]];
+ draw 1/5[Ancre[k],Ancre[k+2]]--4/5[Ancre[k],Ancre[k+2]];
+ k:=k+2;
+ racine:=depart;
+ depart:=1;
+ else:
+ b:=b+1;
+ fi;
+ exitif depart=1;
+ endfor;
+ else:
+ racine:=1;
+ fi;
+enddef;
+
+vardef PremierSimpleArbre(expr NB)=
+ b:=2;
+ depart:=NB;
+ if Estcepremier(depart)=false:
+ forever:
+ if (depart mod b)=0:
+ Ancre[k+1]-Ancre[k]=(-decalage*0.5,-decalage);
+ Ancre[k+2]-Ancre[k+1]=(decalage,0);
+ depart:=depart div b;
+ retenirnb[k+1]=b;
+ retenirnb[k+2]=depart;
+ draw Branche(Ancre[k],Ancre[k+1]);
+ draw Branche(Ancre[k],Ancre[k+2]);
+ k:=k+2;
+ racine:=depart;
+ depart:=1;
+ else:
+ b:=b+1;
+ fi;
+ exitif depart=1;
+ endfor;
+ else:
+ racine:=1;
+ fi;
+enddef;
+
+vardef NbEtape(expr nb)=
+ b:=2;
+ depart:=nb;
+ etape:=0;
+ Stock[0][0]=depart;
+ forever:
+ if (depart mod b)=0:
+ etape:=etape+1;
+ if etape=1:
+ Stock[etape][0]=b;
+ Stock[etape][etape]:=depart div b;
+ else:
+ for k=0 upto etape-2:
+ Stock[etape][k]:=Stock[etape-1][k];
+ endfor;
+ Stock[etape][etape-1]:=b;
+ Stock[etape][etape]:=depart div b;
+ fi;
+ depart:=depart div b;
+ else:
+ b:=b+1;
+ fi;
+ exitif depart=1;
+ endfor;
+ etape
+enddef;
+
+vardef Positions(expr Step)=
+ for k=0 upto (Step-1):
+ for l=0 upto k:
+ N[k][l]=(-k*dx+(l+k*.5)*dx,-k*dy);
+ label(TEX("\num{"&decimal(Stock[k][l])&"}"),N[k][l]);
+ endfor;
+ for l=0 upto k-1:
+ label(btex $\times$ etex,1/2[N[k][l],N[k][l+1]]);
+ endfor;
+ endfor;
+ for k=0 upto (Step-1):
+ for l=0 upto (k-1):
+ draw 1/5[N[k][l],N[k-1][l]]--4/5[N[k][l],N[k-1][l]];
+ endfor;
+ if k>0:
+ draw 1/5[N[k][k],N[k-1][k-1]]--4/5[N[k][k],N[k-1][k-1]];
+ fi;
+ endfor;
+enddef;
+
+vardef PositionsPdf(expr Step)=
+ for k=0 upto (Step-1):
+ for l=0 upto k:
+ N[k][l]=(-k*dx+(l+k*.5)*dx,-k*dy);
+ label(LATEX("\num{"&decimal(Stock[k][l])&"}"),N[k][l]);
+ endfor;
+ for l=0 upto k-1:
+ label(btex $\times$ etex,1/2[N[k][l],N[k][l+1]]);
+ endfor;
+ endfor;
+ for k=0 upto (Step-1):
+ for l=0 upto (k-1):
+ draw 1/5[N[k][l],N[k-1][l]]--4/5[N[k][l],N[k-1][l]];
+ endfor;
+ if k>0:
+ draw 1/5[N[k][k],N[k-1][k-1]]--4/5[N[k][k],N[k-1][k-1]];
+ fi;
+ endfor;
+enddef;
+
+vardef PositionsVide(expr Step)=
+ for k=0 upto (Step-1):
+ for l=0 upto k:
+ N[k][l]=(-k*dx+(l+k*.5)*dx,-k*dy);
+ endfor;
+ for l=0 upto k-1:
+ label(btex $\times$ etex,1/2[N[k][l],N[k][l+1]]);
+ endfor;
+ endfor;
+ for k=0 upto (Step-1):
+ for l=0 upto (k-1):
+ draw 1/5[N[k][l],N[k-1][l]]--4/5[N[k][l],N[k-1][l]];
+ endfor;
+ if k>0:
+ draw 1/5[N[k][k],N[k-1][k-1]]--4/5[N[k][k],N[k-1][k-1]];
+ fi;
+ endfor;
+ label(TEX("\num{"&decimal(Stock[0][0])&"}"),N[0][0]);
+enddef;
+
+vardef PositionsVidePdf(expr Step)=
+ for k=0 upto (Step-1):
+ for l=0 upto k:
+ N[k][l]=(-k*dx+(l+k*.5)*dx,-k*dy);
+ endfor;
+ for l=0 upto k-1:
+ label(btex $\times$ etex,1/2[N[k][l],N[k][l+1]]);
+ endfor;
+ endfor;
+ for k=0 upto (Step-1):
+ for l=0 upto (k-1):
+ draw 1/5[N[k][l],N[k-1][l]]--4/5[N[k][l],N[k-1][l]];
+ endfor;
+ if k>0:
+ draw 1/5[N[k][k],N[k-1][k-1]]--4/5[N[k][k],N[k-1][k-1]];
+ fi;
+ endfor;
+ label(LATEX("\num{"&decimal(Stock[0][0])&"}"),N[0][0]);
+enddef;
+
+vardef Branche(expr nbd,nba)=
+ save $;
+ picture $;
+ pair UnitVector;
+ numeric AngleVector;
+ UnitVector=unitvector(nba-nbd) rotated 90;
+ AngleVector=angle(nba-nbd)+(-10+uniformdeviate(20));
+ path branche;
+ branche=(nbd+UnitVector){dir AngleVector}..(nba+UnitVector)--reverse((nbd-UnitVector){dir AngleVector}..(nba-UnitVector))--cycle;
+ $=image(
+ fill branche withcolor gris;
+ draw branche;
+ );
+ $
+enddef;
+
+endinput;
diff --git a/Master/texmf-dist/metapost/profcollege/PfCScratchpdf.mp b/Master/texmf-dist/metapost/profcollege/PfCScratchpdf.mp
index b9edf3873ff..94a37beccc1 100644
--- a/Master/texmf-dist/metapost/profcollege/PfCScratchpdf.mp
+++ b/Master/texmf-dist/metapost/profcollege/PfCScratchpdf.mp
@@ -319,7 +319,7 @@ vardef OvalMenuCap(expr art)=OvalCapMenu(art) enddef;
vardef OvalCapMenu(expr ar)=
save $; picture $;
string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
path TAMC;
TAMC=OvalBox(TTm);
@@ -349,8 +349,8 @@ enddef;
vardef OvalMouvMenu(expr ar)=
save $; picture $;
path ta; string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else:
- "\color{white}"&ar&"\hbox to1em{\barre}\color{black}\blacktriangledown"
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else:
+ "\color{white}"&ar&"\hbox to1em{\barre}\color{black}$\blacktriangledown$"
fi;
ta=OvalBox(TTm);
$=image(
@@ -364,7 +364,7 @@ enddef;
vardef OvalAppMenu(expr ar)=
save $; picture $;
path ta; string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
ta=OvalBox(TTm);
$=image(
@@ -381,7 +381,7 @@ vardef OvalMenuSon(expr ar)=
save $; save TA;
picture $;
string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
path TA;
TA=OvalBox(TTm);
@@ -397,7 +397,7 @@ vardef OvalMenuControle(expr ar)=
save $; save TA;
picture $;
string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
path TA;
TA=OvalBox(TTm);
@@ -415,11 +415,11 @@ vardef OvalStylo(expr ar)=
string TT,TTI;
if string ar:
if print:
- TT=ar&"\hbox to1em{\barre}\blacktriangledown"
+ TT=ar&"\hbox to1em{\barre}$\blacktriangledown$"
else:
- TT=ar&"\hbox to1em{\barre}\color{white}\blacktriangledown"
+ TT=ar&"\hbox to1em{\barre}\color{white}$\blacktriangledown$"
fi;
- TTI=ar&"\hbox to1em{\barre}\phantom{\blacktriangledown}";
+ TTI=ar&"\hbox to1em{\barre}\phantom{$\blacktriangledown$}";
path TA;
TA=OvalBox(TT);
$=image(
@@ -452,7 +452,7 @@ vardef OvalMenuEvenement(expr ar)=
save $; save TA;
picture $;
string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
path TA;
TA=OvalBox(TTm);
@@ -468,7 +468,7 @@ enddef;
vardef RecMouvMenu(expr ar)=
save $; picture $;
path ta; string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown"
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$"
fi;
ta=RecBox(TTm);
$=image(
@@ -482,7 +482,7 @@ enddef;
vardef RecMenuApp(expr ar)=
save $; picture $;
save ta; path ta; string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
ta=RecBox(TTm);
$=image(
@@ -496,7 +496,7 @@ enddef;
vardef RecMenuOp(expr ar)=
save $; save TA;
picture $; string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
path TA;
TA=RecBox(TTm);
@@ -511,7 +511,7 @@ enddef;
vardef RecMenuSon(expr ar)=
save $; save TA;
picture $; string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown" fi;
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$" fi;
path TA;
TA=RecBox(TTm);
$=image(
@@ -525,7 +525,7 @@ enddef;
vardef RecEvenementMenu(expr ar)=
save $; picture $;
path ta; string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
ta=RecBox(TTm);
$=image(
@@ -539,7 +539,7 @@ enddef;
vardef RecMenuCap(expr ar)=
save $; picture $;
path ta; string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
ta=RecBox(TTm);
$=image(
@@ -553,7 +553,7 @@ enddef;
vardef RecMenuVar(expr ar)=
save $; save TA;
picture $; string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
path TA;
TA=RecBox(TTm);
@@ -568,7 +568,7 @@ enddef;
vardef RecMenuList(expr ar)=
save $; save TA;
picture $; string TTm;
- TTm=if print:ar&"\hbox to1em{\barre}\blacktriangledown" else: "\color{white}"&ar&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:ar&"\hbox to1em{\barre}$\blacktriangledown$" else: "\color{white}"&ar&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
path TA;
TA=RecBox(TTm);
@@ -2005,7 +2005,7 @@ vardef Stop(expr nbpas)=
save $;
picture $,texto;
string TTm;%Pour sauvegarder le nbpas car en l'utilisant dans les if, il ne permet pas la concaténation...
- TTm=if print:nbpas&"\hbox to1em{\barre}\blacktriangledown" else:"\color{white}"&nbpas&"\hbox to1em{\barre}\blacktriangledown";
+ TTm=if print:nbpas&"\hbox to1em{\barre}$\blacktriangledown$" else:"\color{white}"&nbpas&"\hbox to1em{\barre}$\blacktriangledown$";
fi;
texto=image(
path ti;
diff --git a/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty b/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
index 8497e8d9d34..5e1c7177930 100644
--- a/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
+++ b/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
@@ -3,7 +3,7 @@
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfCollege}[2022/02/17 v0.99-l Aide pour l'utilisation de LaTeX au collège]
+\ProvidesPackage{ProfCollege}[2022/03/10 v0.99-m Aide pour l'utilisation de LaTeX au collège]
\RequirePackage{verbatim}
@@ -14,11 +14,13 @@
\RequirePackage{siunitx}
\sisetup{%
locale=FR,%
- detect-all,%
+ mode = match, propagate-math-font = true,%
+ reset-math-version = false, reset-text-family = false,%
+ reset-text-series = false, reset-text-shape = false,%
+ text-family-to-math = true, text-series-to-math = true,%
output-decimal-marker={,},%
group-minimum-digits=4%
}%
-
\DeclareSIUnit{\kmh}{\km\per\hour}
\newcommand\speed[1]{\SI{#1}{\kmh}}
\newcommand\Speed[1]{\SI[per-mode=symbol]{#1}{\kmh}}
@@ -1690,7 +1692,7 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
}{%
\TableMultiplicationSeule{#2}%
}%
- }{
+ }{%
\ifboolKV[Tables]{Addition}{%
\TableAdditionComplete%
}{%
@@ -2526,6 +2528,64 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
}%
%%%
+% Mots croisés
+%%%
+\setKVdefault[ClesCroises]{Lignes=6,Colonnes=8,Solution=false,Croises=false,Couleur=gray,Largeur=1em}
+
+\newcounter{PfCLettreHorizontal}
+
+\newcommand\MotsCroises[2][]{%
+ \useKVdefault[ClesCroises]%
+ \setKV[ClesCroises]{#1}%
+ \setcounter{PfCLettreHorizontal}{0}%
+ \setsepchar[*]{§*,*/}%
+ \readlist*\ListeCasesCroises{#2}%
+ \begin{NiceTabular}{*{\fpeval{\useKV[ClesCroises]{Colonnes}}}{p{\useKV[ClesCroises]{Largeur}}}}[first-row,first-col]%
+ \xintFor* ##1 in {\xintSeq{1}{\fpeval{\useKV[ClesCroises]{Colonnes}}}}\do{%
+ &\ifboolKV[ClesCroises]{Croises}{\stepcounter{PfCLettreHorizontal}\footnotesize\Alph{PfCLettreHorizontal}}{}
+ }\\
+ \xintFor* ##1 in {\xintSeq{1}{\fpeval{\useKV[ClesCroises]{Lignes}}}}\do{%
+ \ifboolKV[ClesCroises]{Croises}{\footnotesize##1}{}\xintFor* ##2 in {\xintSeq{1}{\fpeval{\useKV[ClesCroises]{Colonnes}}}}\do{%
+ &\IfStrEq{\ListeCasesCroises[##1,##2,1]}{!}{%
+ }{%
+ \IfStrEq{\ListeCasesCroises[##1,##2,1]}{*}{%
+ \Block[draw,fill=black]{}{\PfCTBstrut}}{%
+ \IfStrEq{\ListeCasesCroises[##1,##2,1]}{+}{%
+ \Block[draw,fill=\useKV[ClesCroises]{Couleur}]{}{%
+ \PfCTBstrut\ifboolKV[ClesCroises]{Solution}{%
+ \ListeCasesCroises[##1,##2,2]%
+ }{}%
+ }
+ }{%
+ \Block[draw]{}{\PfCTBstrut\ifboolKV[ClesCroises]{Solution}{%
+ \ListeCasesCroises[##1,##2,2]}{}%
+ }%
+ }%
+ }%
+ }%
+ }\\
+ }%
+ \CodeAfter
+ \xintFor* ##1 in {\xintSeq{1}{\fpeval{\useKV[ClesCroises]{Lignes}}}}\do{%
+ \xintFor* ##2 in {\xintSeq{1}{\fpeval{\useKV[ClesCroises]{Colonnes}}}}\do{%
+ \IfStrEq{\ListeCasesCroises[##1,##2,1]}{!}{%
+ }{%
+ \IfStrEq{\ListeCasesCroises[##1,##2,1]}{*}{%
+ }{%
+ \IfStrEq{\ListeCasesCroises[##1,##2,1]}{+}{%
+ }{%
+ \xintifboolexpr{\fpeval{\ListeCasesCroises[##1,##2,1]}>0}{\tikz\node[transform canvas={xshift=1mm,yshift=-1mm}] at (\fpeval{##1}-|\fpeval{##2}){\tiny\ListeCasesCroises[##1,##2,1]};}{}%
+ }%
+ }%
+ }%
+ }%
+ }%
+ \end{NiceTabular}%
+ \setsepchar{,}%
+}%
+
+
+%%%
% Mots empilés
%%%
\setKVdefault[ClesMotEmpile]{Colonne=4,Solution=false,Couleur=black}
@@ -7163,9 +7223,10 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
%%%
% Nombre Premier
%%%
-\setKVdefault[ClesNombrePremier]{Tableau=false,TableauVertical=false,TableauVerticalVide=false,Exposant=false,Longue=false,All=false,Arbre=false,ArbreVide=false,ArbreComplet=false,Diviseurs=false,DiviseursT=false,Dot=\dotfill,Impose=false,ImposeAll=false,Potence=false}
-\defKV[ClesNombrePremier]{Nombre=\setKV[ClesNombrePremier]{Impose}}
-\defKV[ClesNombrePremier]{AllNombre=\setKV[ClesNombrePremier]{ImposeAll}}
+\setKVdefault[ClesNombrePremier]{Tableau=false,TableauVertical=false,TableauVerticalVide=false,Exposant=false,Longue=false,All=false,Arbre=false,ArbreVide=false,ArbreComplet=false,ArbreDessine=false,ArbreDessineVide=false,Entoure=false,Entourefin=false,Diviseurs=false,DiviseursT=false,Dot=\dotfill,Impose=false,ImposeAll=false,Potence=false,Decalage=10,Vide=false,CouleurFeuillage=ForestGreen,CouleurTronc=BurlyWood,CouleurFruits=Red,CouleurTexte=white}%
+\defKV[ClesNombrePremier]{Nombre=\ifboolKV[ClesNombrePremier]{ArbreDessine}{}{\ifboolKV[ClesNombrePremier]{ArbreDessineVide}{}{\setKV[ClesNombrePremier]{Impose}}}}%
+\defKV[ClesNombrePremier]{AllNombre=\setKV[ClesNombrePremier]{ImposeAll}}%
+\defKV[ClesNombrePremier]{Impression=\setKV[ClesNombrePremier]{CouleurFeuillage=white,CouleurTronc=white,CouleurFruits=gris,CouleurTexte=black}}
\newcommand\Decomposition[2][]{%
\useKVdefault[ClesNombrePremier]%
@@ -7181,414 +7242,333 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
\ifboolKV[ClesNombrePremier]{All}{\NombrePremierExposant{#2}}{}%
\ifboolKV[ClesNombrePremier]{Arbre}{\MPArbre{#2}}{}%
\ifboolKV[ClesNombrePremier]{ArbreComplet}{\MPArbreComplet{#2}}{}%
+ \ifboolKV[ClesNombrePremier]{ArbreVide}{\MPArbreVide{#2}}{}%
+ \ifboolKV[ClesNombrePremier]{ArbreDessine}{\MPArbreDessine{#2}{\useKV[ClesNombrePremier]{Nombre}}}{}%
+ \ifboolKV[ClesNombrePremier]{ArbreDessineVide}{\setKV[ClesNombrePremier]{Vide=true}\MPArbreDessine{#2}{\useKV[ClesNombrePremier]{Nombre}}}{}%
\ifboolKV[ClesNombrePremier]{Diviseurs}{\ListeDiviseur{#2}}{}%
\ifboolKV[ClesNombrePremier]{DiviseursT}{\ListeDiviseurT{#2}}{}%
- \ifboolKV[ClesNombrePremier]{ArbreVide}{\MPArbreVide{#2}}{}%
}%
\def\MPArbre#1{%
\ifluatex
- \mplibforcehmode
+ \mplibforcehmode
\begin{mplibcode}
+ input PfCArithmetique;
numeric depart;
pair Ancre[];
numeric decalage;
- decalage=10mm;
+ decalage=\useKV[ClesNombrePremier]{Decalage}*1mm;
- vardef PremierSimple(expr NB)=
- b:=2;
- depart:=NB;
- if Estcepremier(depart)=false:
+ k:=0;
+ Ancre0:=(0,0);
+ racine:=#1;
+
+ label(btex \num{#1} etex,(0,0));
forever:
- if (depart mod b)=0:
- Ancre[k+1]-Ancre[k]=(-decalage*0.5,-decalage);
- Ancre[k+2]-Ancre[k+1]=(decalage,0);
- depart:=depart div b;
- label(TEX("\num{"&decimal(b)&"}"),Ancre[k+1]);
- label(TEX("\num{"&decimal(depart)&"}"),Ancre[k+2]);
- draw 1/5[Ancre[k],Ancre[k+1]]--4/5[Ancre[k],Ancre[k+1]];
- draw 1/5[Ancre[k],Ancre[k+2]]--4/5[Ancre[k],Ancre[k+2]];
- k:=k+2;
- racine:=depart;
- depart:=1;
- else:
- b:=b+1;
- fi;
- exitif depart=1;
+ PremierSimple(racine);
+ exitif racine=1;
endfor;
- else:
- racine:=1;
- fi;
-enddef;
-
-vardef Estcepremier(expr NBa)=
- boolean $;
- c:=2;
- departa:=NBa;
- test:=1;
- $=true;
- if departa=1:
- $:=false;
- else:
- forever:
- if (departa mod c)=0:
- departa:=departa div c;
- test:=test+1;
- else:
- c:=c+1;
- fi;
- exitif departa=1;
+
+ if \useKV[ClesNombrePremier]{Entoure}:
+ for l=1 upto k:
+ if Estcepremier(retenirnb[l]):
+ draw cercles(Ancre[l],0.25*decalage);
+ fi;
endfor;
- fi;
- if test=2:
- $:=true
- else:
- $:=false;
- fi;
- $
- enddef;
- k:=0;
- Ancre0:=(0,0);
- racine:=#1;
-
- label(btex \num{#1} etex,(0,0));
- forever:
- PremierSimple(racine);
- exitif racine=1;
- endfor;
+ fi;
\end{mplibcode}
\else
- \begin{mpost}
+ \begin{mpost}[mpsettings={numeric decalage;decalage=\useKV[ClesNombrePremier]{Decalage}*1mm; boolean Entoure; Entoure=\useKV[ClesNombrePremier]{Entoure};}]
+ input PfCArithmetique;
numeric depart;
pair Ancre[];
- numeric decalage;
- decalage=10mm;
- vardef PremierSimple(expr NB)=
- b:=2;
- depart:=NB;
- if Estcepremier(depart)=false:
+ k:=0;
+ Ancre0:=(0,0);
+ racine:=#1;
+ label(LATEX("\num{"&decimal(racine)&"}"),(0,0));
forever:
- if (depart mod b)=0:
- Ancre[k+1]-Ancre[k]=(-decalage*0.5,-decalage);
- Ancre[k+2]-Ancre[k+1]=(decalage,0);
- depart:=depart div b;
- label(LATEX("\num{"&decimal(b)&"}"),Ancre[k+1]);
- label(LATEX("\num{"&decimal(depart)&"}"),Ancre[k+2]);
- draw 1/5[Ancre[k],Ancre[k+1]]--4/5[Ancre[k],Ancre[k+1]];
- draw 1/5[Ancre[k],Ancre[k+2]]--4/5[Ancre[k],Ancre[k+2]];
- k:=k+2;
- racine:=depart;
- depart:=1;
- else:
- b:=b+1;
- fi;
- exitif depart=1;
- endfor;
- else:
- racine:=1;
- fi;
-enddef;
-
-vardef Estcepremier(expr NBa)=
- boolean $;
- c:=2;
- departa:=NBa;
- test:=1;
- $=true;
- if departa=1:
- $:=false;
- else:
- forever:
- if (departa mod c)=0:
- departa:=departa div c;
- test:=test+1;
- else:
- c:=c+1;
- fi;
- exitif departa=1;
+ PremierSimplePdf(racine);
+ exitif racine=1;
endfor;
- fi;
- if test=2:
- $:=true
- else:
- $:=false;
- fi;
- $
- enddef;
- k:=0;
- Ancre0:=(0,0);
- racine:=#1;
- label(LATEX("\num{"&decimal(racine)&"}"),(0,0));
- forever:
- PremierSimple(racine);
- exitif racine=1;
- endfor;
+ if \useKV[ClesNombrePremier]{Entoure}:
+ for l=1 upto k:
+ if Estcepremier(retenirnb[l]):
+ draw cercles(Ancre[l],0.25*decalage);
+ fi;
+ endfor;
+ fi;
\end{mpost}
\fi
}
\def\MPArbreComplet#1{%
\ifluatex
- \mplibforcehmode
+ \mplibforcehmode
\begin{mplibcode}
- beginfig(1);
+ input PfCArithmetique;
numeric depart;
pair Ancre[];
numeric decalage;
- decalage=7.5mm;
+ decalage=\useKV[ClesNombrePremier]{Decalage}*1mm;
-vardef NbEtape(expr nb)=
- b:=2;
- depart:=nb;
- etape:=0;
- Stock[0][0]=depart;
- forever:
- if (depart mod b)=0:
- etape:=etape+1;
- if etape=1:
- Stock[etape][0]=b;
- Stock[etape][etape]:=depart div b;
- else:
- for k=0 upto etape-2:
- Stock[etape][k]:=Stock[etape-1][k];
- endfor;
- Stock[etape][etape-1]:=b;
- Stock[etape][etape]:=depart div b;
- fi;
- depart:=depart div b;
- else:
- b:=b+1;
- fi;
- exitif depart=1;
- endfor;
- etape
-enddef;
-
-dx:=1cm;
-dy:=1cm;
-
-pair N[][];
-
-vardef Positions(expr Step)=
- for k=0 upto (Step-1):
- for l=0 upto k:
- N[k][l]=(-k*dx+(l+k*.5)*dx,-k*dy);
- label(TEX("\num{"&decimal(Stock[k][l])&"}"),N[k][l]);
- endfor;
- for l=0 upto k-1:
- label(btex $\times$ etex,1/2[N[k][l],N[k][l+1]]);
- endfor;
- endfor;
- for k=0 upto (Step-1):
- for l=0 upto (k-1):
- draw 1/5[N[k][l],N[k-1][l]]--4/5[N[k][l],N[k-1][l]];
- endfor;
- if k>0:
- draw 1/5[N[k][k],N[k-1][k-1]]--4/5[N[k][k],N[k-1][k-1]];
- fi;
- endfor;
- enddef;
-
- Positions(NbEtape(#1));
+ dx:=1cm;
+ dy:=1cm;
+
+ pair N[][];
+ nbe:=NbEtape(#1);
+ Positions(nbe);
+ if \useKV[ClesNombrePremier]{Entoure}:
+ draw polygone(N[nbe-1][0]+(-0.25*dx,0.25*decalage),N[nbe-1][nbe-1]+(0.25*dx,0.25*decalage),N[nbe-1][nbe-1]+(0.25*dx,-0.25*decalage),N[nbe-1][0]+(-0.25*dx,-0.25*decalage)) dashed evenly;
+ fi;
\end{mplibcode}
\else
- \begin{mpost}
+ \begin{mpost}[mpsettings={numeric decalage;decalage=\useKV[ClesNombrePremier]{Decalage}*1mm;}]
+ input PfCArithmetique;
numeric depart;
-pair Ancre[];
-numeric decalage;
-decalage=7.5mm;
-
-vardef NbEtape(expr nb)=
- b:=2;
- depart:=nb;
- etape:=0;
- Stock[0][0]=depart;
- forever:
- if (depart mod b)=0:
- etape:=etape+1;
- if etape=1:
- Stock[etape][0]=b;
- Stock[etape][etape]:=depart div b;
- else:
- for k=0 upto etape-2:
- Stock[etape][k]:=Stock[etape-1][k];
- endfor;
- Stock[etape][etape-1]:=b;
- Stock[etape][etape]:=depart div b;
- fi;
- depart:=depart div b;
- else:
- b:=b+1;
- fi;
- exitif depart=1;
- endfor;
- etape
-enddef;
-
-dx:=1cm;
-dy:=1cm;
+ pair Ancre[];
-pair N[][];
+ dx:=1cm;
+ dy:=1cm;
-vardef Positions(expr Step)=
- for k=0 upto (Step-1):
- for l=0 upto k:
- N[k][l]=(-k*dx+(l+k*.5)*dx,-k*dy);
- label(LATEX("\num{"&decimal(Stock[k][l])&"}"),N[k][l]);
- endfor;
- for l=0 upto k-1:
- label(btex $\times$ etex,1/2[N[k][l],N[k][l+1]]);
- endfor;
- endfor;
- for k=0 upto (Step-1):
- for l=0 upto (k-1):
- draw 1/5[N[k][l],N[k-1][l]]--4/5[N[k][l],N[k-1][l]];
- endfor;
- if k>0:
- draw 1/5[N[k][k],N[k-1][k-1]]--4/5[N[k][k],N[k-1][k-1]];
- fi;
- endfor;
- enddef;
+ pair N[][];
- Positions(NbEtape(#1));
+ PositionsPdf(NbEtape(#1));
\end{mpost}
\fi
}
\def\MPArbreVide#1{%
\ifluatex
- \mplibforcehmode
+ \mplibforcehmode
\begin{mplibcode}
+ input PfCArithmetique;
numeric depart;
pair Ancre[];
numeric decalage;
- decalage=7.5mm;
-
-vardef NbEtape(expr nb)=
- b:=2;
- depart:=nb;
- etape:=0;
- Stock[0][0]=depart;
- forever:
- if (depart mod b)=0:
- etape:=etape+1;
- if etape=1:
- Stock[etape][0]=b;
- Stock[etape][etape]:=depart div b;
- else:
- for k=0 upto etape-2:
- Stock[etape][k]:=Stock[etape-1][k];
- endfor;
- Stock[etape][etape-1]:=b;
- Stock[etape][etape]:=depart div b;
- fi;
- depart:=depart div b;
- else:
- b:=b+1;
- fi;
- exitif depart=1;
- endfor;
- etape
-enddef;
-
-dx:=1cm;
-dy:=1cm;
+ decalage=\useKV[ClesNombrePremier]{Decalage}*1mm;
+
+ dx:=1cm;
+ dy:=1cm;
+
+ pair N[][];
+
+ PositionsVide(NbEtape(#1));
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={numeric decalage; decalage=\useKV[ClesNombrePremier]{Decalage}*1mm;}]
+ input PfCArithmetique;
+ numeric depart;
+ pair Ancre[];
+
+ dx:=1cm;
+ dy:=1cm;
-pair N[][];
+ pair N[][];
-vardef Positions(expr Step)=
+ PositionsVidePdf(NbEtape(#1));
+ \end{mpost}
+ \fi
+}
- for k=0 upto (Step-1):
- for l=0 upto k:
- N[k][l]=(-k*dx+(l+k*.5)*dx,-k*dy);
+\def\MPArbreDessine#1#2{%
+ \ifluatex%
+ \mplibforcehmode%
+ \begin{mplibcode}
+ input PfCArithmetique;
+ numeric depart;
+ pair Ancre[];
+ numeric decalage;
+ decalage=\useKV[ClesNombrePremier]{Decalage}*1mm;
+ rayonfruits:=3mm;
+
+ color CouleurTronc,CouleurFeuillage,CouleurFruits,CouleurTexte;
+ CouleurTronc=\useKV[ClesNombrePremier]{CouleurTronc};
+ CouleurFeuillage=\useKV[ClesNombrePremier]{CouleurFeuillage};
+ CouleurFruits=\useKV[ClesNombrePremier]{CouleurFruits};
+ CouleurTexte=\useKV[ClesNombrePremier]{CouleurTexte};
+
+ k:=0;
+ Ancre0:=(0,0);
+ racine:=#1;
+ k:=1;
+ Ancre1:=(-decalage,-decalage);
+ draw Branche(Ancre0,Ancre1);
+ retenirnb[1]:=#2;
+ racine:=#2;
+ forever:
+ PremierSimpleArbre(racine);
+ exitif racine=1;
endfor;
- for l=0 upto k-1:
- label(btex $\times$ etex,1/2[N[k][l],N[k][l+1]]);
+ k:=k+1;
+ Ancre[k]:=(decalage,-decalage);
+ draw Branche(Ancre0,Ancre[k]);
+ retenirnb[k]:=#1 div #2;
+ racine:=retenirnb[k];
+ forever:
+ PremierSimpleArbre(racine);
+ exitif racine=1;
endfor;
- endfor;
- for k=0 upto (Step-1):
- for l=0 upto (k-1):
- draw 1/5[N[k][l],N[k-1][l]]--4/5[N[k][l],N[k-1][l]];
+
+ fill cercles(Ancre[0],rayonfruits) withcolor white;
+ label(btex \num{#1} etex,(0,0));
+ for l=1 upto k:
+ if \useKV[ClesNombrePremier]{Vide}:
+ fill cercles(Ancre[l],rayonfruits) withcolor white;
+ else:
+ if Estcepremier(retenirnb[l]):
+ fill cercles(Ancre[l],rayonfruits) withcolor CouleurFruits;
+ drawoptions(withcolor CouleurTexte);
+ label(TEX("\num{"&decimal(retenirnb[l])&"}"),Ancre[l]);
+ drawoptions();
+ else:
+ fill cercles(Ancre[l],rayonfruits) withcolor white;
+ label(TEX("\num{"&decimal(retenirnb[l])&"}"),Ancre[l]);
+ fi;
+ fi;
endfor;
- if k>0:
- draw 1/5[N[k][k],N[k-1][k-1]]--4/5[N[k][k],N[k-1][k-1]];
+ for l=0 upto k:
+ draw cercles(Ancre[l],rayonfruits);
+ endfor;
+ picture Bilan;
+ Bilan=currentpicture;
+ currentpicture:=nullpicture;
+ % Habillage
+ % On récupère le min des ordonnées des Ancre pour le feuillage
+ minord=1000;
+ nbancrearetenir=0;
+ for l=0 upto k:
+ if ypart(Ancre[l])<minord:
+ minord:=ypart(Ancre[l]);
+ nbancrearetenir:=l;
fi;
endfor;
- label(TEX("\num{"&decimal(Stock[0][0])&"}"),N[0][0]);
- enddef;
-
- Positions(NbEtape(#1));
+ pair D[];
+ D0=0.5[Ancre0,(0,ypart(Ancre[nbancrearetenir]))];
+ dotlabel("",D0);
+ % Herbe du sol
+ pair A[];
+ A0=(xpart(Ancre0)-1cm,ypart(Ancre[nbancrearetenir])-2cm);
+ A10=(xpart(Ancre0)+1cm,ypart(Ancre[nbancrearetenir])-2cm);
+ for l=1 upto 9:
+ A[l]=(l/10)[A0,A10]+uniformdeviate(5)*(unitvector(A10-A0) rotated 90);
+ endfor;
+ %Pour le tronc
+ pair B[];
+ B1=D0+(10+uniformdeviate(10))*(unitvector(D0-A0) rotated 90);
+ B2=symetrie(B1,Ancre0,1/2[A0,A10]);%=(-2mm,0);
+ B3=1/2[Ancre0,(xpart(1/2[A0,A10]),ypart(Ancre[k]))];
+ path tronc;
+ tronc=A0{dir angle(A1-A0)}..{dir90}B1--B2{dir-90}..{dir angle(A10-A9)}A10--reverse(A0 for l=1 upto 10:--A[l] endfor)--cycle;%
+ fill tronc withcolor CouleurTronc;
+ trace tronc;
+ % Pour le feuillage
+ path feuillage;
+ feuillage=cercles((0,0),abs(Ancre[nbancrearetenir]-D0));%
+ pair C[];
+ for l=0 upto 7:
+ C[l]=(pointarc(feuillage,l*45+(-5+uniformdeviate(10))) xscaled 1.25 yscaled 1) shifted D0;
+ endfor;
+ feuillage:=C[0] for l=1 upto 7:..(C[l] if (l mod 2)=0:+(0,2mm) else: +(0,-2mm) fi) endfor ..cycle;
+ fill feuillage withcolor CouleurFeuillage;
+ trace feuillage;
+ draw Bilan;
\end{mplibcode}
\else
- \begin{mpost}
+ \begin{mpost}[mpsettings={numeric decalage;decalage=\useKV[ClesNombrePremier]{Decalage}*1mm;color CouleurTronc,CouleurFeuillage,CouleurFruits,CouleurTexte;CouleurTronc=\useKV[ClesNombrePremier]{CouleurTronc};CouleurFeuillage=\useKV[ClesNombrePremier]{CouleurFeuillage};CouleurFruits=\useKV[ClesNombrePremier]{CouleurFruits}; CouleurTexte=\useKV[ClesNombrePremier]{CouleurTexte}; boolean Vide; Vide=\useKV[ClesNombrePremier]{Vide};}]
+ input PfCArithmetique;
numeric depart;
pair Ancre[];
-numeric decalage;
-decalage=7.5mm;
-
-vardef NbEtape(expr nb)=
- b:=2;
- depart:=nb;
- etape:=0;
- Stock[0][0]=depart;
- forever:
- if (depart mod b)=0:
- etape:=etape+1;
- if etape=1:
- Stock[etape][0]=b;
- Stock[etape][etape]:=depart div b;
- else:
- for k=0 upto etape-2:
- Stock[etape][k]:=Stock[etape-1][k];
- endfor;
- Stock[etape][etape-1]:=b;
- Stock[etape][etape]:=depart div b;
- fi;
- depart:=depart div b;
+ rayonfruits:=3mm;
+
+ k:=0;
+ Ancre0:=(0,0);
+ racine:=#1;
+ k:=1;
+ Ancre1:=(-decalage,-decalage);
+ draw Branche(Ancre0,Ancre1);
+ retenirnb[1]:=#2;
+ racine:=#2;
+ forever:
+ PremierSimpleArbre(racine);
+ exitif racine=1;
+ endfor;
+ k:=k+1;
+ Ancre[k]:=(decalage,-decalage);
+ draw Branche(Ancre0,Ancre[k]);
+ retenirnb[k]:=#1 div #2;
+ racine:=retenirnb[k];
+ forever:
+ PremierSimpleArbre(racine);
+ exitif racine=1;
+ endfor;
+
+ fill cercles(Ancre[0],rayonfruits) withcolor white;
+ label(btex \num{#1} etex,(0,0));
+ for l=1 upto k:
+ if Vide:
+ fill cercles(Ancre[l],rayonfruits) withcolor white;
else:
- b:=b+1;
+ if Estcepremier(retenirnb[l]):
+ fill cercles(Ancre[l],rayonfruits) withcolor CouleurFruits;
+ drawoptions(withcolor CouleurTexte);
+ label(LATEX("\num{"&decimal(retenirnb[l])&"}"),Ancre[l]);
+ drawoptions();
+ else:
+ fill cercles(Ancre[l],rayonfruits) withcolor white;
+ label(LATEX("\num{"&decimal(retenirnb[l])&"}"),Ancre[l]);
+ fi;
fi;
- exitif depart=1;
- endfor;
- etape
-enddef;
-
-dx:=1cm;
-dy:=1cm;
-
-pair N[][];
-
-vardef Positions(expr Step)=
-
- for k=0 upto (Step-1):
- for l=0 upto k:
- N[k][l]=(-k*dx+(l+k*.5)*dx,-k*dy);
- endfor;
- for l=0 upto k-1:
- label(btex $\times$ etex,1/2[N[k][l],N[k][l+1]]);
endfor;
- endfor;
- for k=0 upto (Step-1):
- for l=0 upto (k-1):
- draw 1/5[N[k][l],N[k-1][l]]--4/5[N[k][l],N[k-1][l]];
+ for l=0 upto k:
+ draw cercles(Ancre[l],rayonfruits);
endfor;
- if k>0:
- draw 1/5[N[k][k],N[k-1][k-1]]--4/5[N[k][k],N[k-1][k-1]];
+ picture Bilan;
+ Bilan=currentpicture;
+ currentpicture:=nullpicture;
+ % Habillage
+ minord=1000;
+ nbancrearetenir=0;
+ for l=0 upto k:
+ if ypart(Ancre[l])<minord:
+ minord:=ypart(Ancre[l]);
+ nbancrearetenir:=l;
fi;
endfor;
- label(LATEX("\num{"&decimal(Stock[0][0])&"}"),N[0][0]);
- enddef;
-
- Positions(NbEtape(#1));
+ pair D[];
+ D0=0.5[Ancre0,(0,ypart(Ancre[nbancrearetenir]))];
+ pair A[];
+ A0=(xpart(Ancre0)-1cm,ypart(Ancre[nbancrearetenir])-2cm);
+ A10=(xpart(Ancre0)+1cm,ypart(Ancre[nbancrearetenir])-2cm);
+ for l=1 upto 9:
+ A[l]=(l/10)[A0,A10]+uniformdeviate(5)*(unitvector(A10-A0) rotated 90);
+ endfor;
+ pair B[];
+ B1=D0+(10+uniformdeviate(10))*(unitvector(D0-A0) rotated 90);
+ B2=symetrie(B1,Ancre0,1/2[A0,A10]);%
+ B3=1/2[Ancre0,(xpart(1/2[A0,A10]),ypart(Ancre[k]))];
+ path tronc;
+ tronc=A0{dir angle(A1-A0)}..{dir90}B1--B2{dir-90}..{dir angle(A10-A9)}A10--reverse(A0 for l=1 upto 10:--A[l] endfor)--cycle;%
+ fill tronc withcolor CouleurTronc;
+ trace tronc;
+ path feuillage;
+ feuillage=cercles((0,0),abs(Ancre[nbancrearetenir]-D0));%
+ pair C[];
+ for l=0 upto 7:
+ C[l]=(pointarc(feuillage,l*45+(-5+uniformdeviate(10))) xscaled 1.25 yscaled 1) shifted D0;
+ endfor;
+ feuillage:=C[0] for l=1 upto 7:..(C[l] if (l mod 2)=0:+(0,2mm) else: +(0,-2mm) fi) endfor ..cycle;
+ fill feuillage withcolor CouleurFeuillage;
+ trace feuillage;
+ draw Bilan;
\end{mpost}
- \fi
+\fi
}
-\newcount\premier
+\newcount\premier%
-\newcommand{\NombrePremier}[1]{%\'ecrire la d\'ecomposition compl\`ete
+\newcommand\NombrePremier[1]{%\'ecrire la d\'ecomposition compl\`ete
% #1 le nombre premier \`a tester
\newcount\anp\newcount\bnp\newcount\cnp%\newcount\e\newcount\f%
\anp=#1\relax
@@ -7810,7 +7790,7 @@ vardef Positions(expr Step)=
\fi%
}
-\newcommand{\PremierDiviseurVide}[2]{%
+\newcommand\PremierDiviseurVide[2]{%
%#1 : le nombre entier \`a tester
%#2 : le nombre d'\'etapes \`a effectuer
\newcount\anpvv\newcount\bnpvv\newcount\cnpvv\newcount\dnpvv%
@@ -7835,7 +7815,7 @@ vardef Positions(expr Step)=
}
}
-\newcommand{\PremierMultipleVide}[2]{%
+\newcommand\PremierMultipleVide[2]{%
%#1 : le nombre entier \`a tester
%#2 : le nombre d'\'etapes \`a effectuer
\newcount\anpmv\newcount\bnpmv\newcount\cnpmv\newcount\dnpmv%
@@ -7860,9 +7840,9 @@ vardef Positions(expr Step)=
}
}
-\newcommand{\NombrePremierVerticalVide}[1]{%\'ecrire la d\'ecomposition compl\`ete
+\newcommand\NombrePremierVerticalVide[1]{%\'ecrire la d\'ecomposition compl\`ete
% #1 le nombre premier \`a tester
- \newcount\anpv\newcount\bnpv\newcount\cnpv%\newcount\e\newcount\f%
+ \newcount\anpv\newcount\bnpv\newcount\cnpv%
\anpv=#1\relax
\bnpv=2\relax
\premier=-1\relax
@@ -7878,7 +7858,7 @@ vardef Positions(expr Step)=
\fi%
}
\ifnum\premier=0
- Le nombre \num{#1} est un nombre premier.
+ Le nombre \num{#1} est un nombre premier.%
\else
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{c|c}
@@ -7892,9 +7872,9 @@ vardef Positions(expr Step)=
\fi
}
-\newcommand{\NombrePremierExposant}[1]{%\'ecrire la d\'ecomposition
+\newcommand\NombrePremierExposant[1]{%\'ecrire la d\'ecomposition
% compl\`ete
- \newcount\anp\newcount\bnp\newcount\cnp%\newcount\e\newcount\f%
+ \newcount\anp\newcount\bnp\newcount\cnp%
% #1 le nombre premier \`a tester
\anp=#1\relax%
\bnp=2\relax%
@@ -7920,7 +7900,7 @@ vardef Positions(expr Step)=
\fi%
}%
-\newcommand{\PremierEtape}[2]{%
+\newcommand\PremierEtape[2]{%
%#1 : le nombre entier \`a tester
%#2 : le nombre d'\'etapes \`a effectuer
\newcount\anp\newcount\bnp\newcount\cnp\newcount\dnp%
@@ -7946,7 +7926,7 @@ vardef Positions(expr Step)=
}
}
-\newcommand{\PremierExposant}[1]{%
+\newcommand\PremierExposant[1]{%
%#1 : le nombre entier \`a tester
\ensuremath{%
\newcount\anp\newcount\bnp\newcount\cnp%
@@ -7976,7 +7956,7 @@ vardef Positions(expr Step)=
}%
}%
-\newcommand{\PremierLong}[1]{%
+\newcommand\PremierLong[1]{%
%#1 : le nombre entier \`a tester
\ensuremath{%
\newcount\anpl\newcount\bnpl\newcount\cnpl%
@@ -7998,7 +7978,7 @@ vardef Positions(expr Step)=
}
}
-\newcommand{\ListeDiviseur}[1]{%#1 : le nombre entier \`a tester
+\newcommand\ListeDiviseur[1]{%#1 : le nombre entier \`a tester
\newcount\anp\newcount\bnp%
\anp=#1%
\bnp=2\relax%
@@ -8023,26 +8003,26 @@ vardef Positions(expr Step)=
\whiledo{\bnpT<\anpT}{%
\modulo{\the\anpT}{\the\bnpT}{}%
\ifnum\remainder=0%
- \cnpT=\numexpr\cnpT+1
+ \cnpT=\numexpr\cnpT+1%
\fi%
\bnpT=\numexpr\bnpT+1%
}%
- \ifodd\cnpT
- \begin{tabular}{c|c}
+ \ifodd\cnpT%
+ \begin{tabular}{c|c}%
1&\num{#1}\\
\xintFor* ##1 in {\xintSeq {1}{\fpeval{(\cnpT+1)/2}}}\do{%
\DiviseurNumero{#1}{##1}\num{\fpeval{\dnpT}}\uppercase{&}\DiviseurNumero{#1}{##1}\xintifboolexpr{\dnpT=\fpeval{#1/\dnpT}}{}{\num{\fpeval{#1/\dnpT}}}\\
}
- \end{tabular}
- \else
+ \end{tabular}%
+ \else%
\begin{tabular}{c|c}
1&\num{#1}\\
\xintFor* ##1 in {\xintSeq {1}{\fpeval{\cnpT/2}}}\do{%
\DiviseurNumero{#1}{##1}\num{\fpeval{\dnpT}}\uppercase{&}\DiviseurNumero{#1}{##1}\num{\fpeval{#1/\dnpT}}\\
}
- \end{tabular}
- \fi
-}
+ \end{tabular}%
+ \fi%
+}%
\newcommand\DiviseurNumero[2]{%
% #1 nb entier \`a tester
@@ -10175,7 +10155,7 @@ vardef Positions(expr Step)=
FreqVide=false,AngVide=false,ECCVide=false,TotalVide=false,Sondage=false,%
Tableau=false,Stretch=1,Frequence=false,EffectifTotal=false,%
Etendue=false,Moyenne=false,SET=false,Mediane=false,QuartileUn=false,QuartileTrois=false,Total=false,Concret=false,%
-Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,Origine=0,Angle=false,SemiAngle=false,Qualitatif=false,TableauVide=false,Graphique=false,Batons=true,Pasx=1,Pasy=1,Unitex=0.5,Unitey=0.5,Rayon=3cm,AffichageAngle=false,Liste=false,ECC=false,Coupure=10,CouleurTab=gray!15,ListeCouleurs={white},Hachures=false,Inverse=false,AbscisseRotation=false,Representation=false}
+Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,Origine=0,Angle=false,SemiAngle=false,Qualitatif=false,TableauVide=false,Graphique=false,Batons=true,Pasx=1,Pasy=1,Unitex=0.5,Unitey=0.5,Rayon=3cm,AffichageAngle=false,Liste=false,ECC=false,Coupure=10,CouleurTab=gray!15,ListeCouleurs={white},Hachures=false,Inverse=false,AbscisseRotation=false,Representation=false,EcartHachures=0.25,EpaisseurHachures=1,Longueur=10cm,Hauteur=5mm,Barre=false}
% La construction du tableau
\def\addtotok#1#2{#1\expandafter{\the#1#2}}
@@ -10265,22 +10245,48 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
\]%
}%
+% Pour construire le diagramme en barres horizontales
+\def\UpdatetoksHor#1/#2/#3\nil{\addtotok\toklistenomhor{"#1",}\addtotok\toklistedonhor{#3,}\addtotok\toklisteaffhor{"#2",}}%
+
+\newcommand\buildgraphbarhor{%
+ \newtoks\toklistenomhor%
+ \newtoks\toklistedonhor%
+ \newtoks\toklisteaffhor%
+ \newtoks\toklistecouleur%
+ \xdef\PfCfooStat{}%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{%
+ \xdef\PfCfooStat{\PfCfooStat \ListeComplete[##1,2],}%
+ }%
+ \xdef\DivMax{\fpeval{max(\PfCfooStat)}}%
+ \xdef\DivMax{\fpeval{round(ln(\DivMax)/ln(10))}}%
+ \xdef\DivMax{\fpeval{10**\DivMax}}%
+ \xdef\PfCfooStat{}%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{%
+ \xdef\PfCfooStat{\PfCfooStat \ListeComplete[##1,1]/\ListeComplete[##1,2]/\fpeval{\ListeComplete[##1,2]/\DivMax},}%
+ }%
+ \readlist*\ListeCompleteDiagHor{\PfCfooStat}%
+ \foreachitem\compteur\in\ListeCompleteDiagHor{\expandafter\UpdatetoksHor\compteur\nil}%
+ \xdef\ListeAvantCouleurs{\useKV[ClesStat]{ListeCouleurs}}%
+ \readlist*\ListeCouleur{\ListeAvantCouleurs}%
+ \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}%
+ \[\MPDiagBarreHor{\the\toklistenomhor}{\the\toklistedonhor}{\the\toklisteaffhor}{\the\toklistecouleur}\]%
+}%
+
% Pour construire le diagramme en bâtons
-\def\Updatetoks#1/#2\nil{\addtotok\toklistepoint{(#1,#2),}}
+\def\Updatetoks#1/#2\nil{\addtotok\toklistepoint{(#1,#2),}}%
\newcommand\buildgraph[1][]{%
- \newtoks\toklistepoint
+ \newtoks\toklistepoint%
\foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoks\compteur\nil}%
- \[\MPStat[#1]{\useKV[ClesStat]{Unitex}}{\useKV[ClesStat]{Unitey}}{\the\toklistepoint}{\useKV[ClesStat]{Donnee}}{\useKV[ClesStat]{Effectif}}{\useKV[ClesStat]{Origine}}{\useKV[ClesStat]{AbscisseRotation}}\]%
+ \[\MPStat[#1]{\useKV[ClesStat]{Unitex}}{\useKV[ClesStat]{Unitey}}{\the\toklistepoint}{\useKV[ClesStat]{Donnee}}{\useKV[ClesStat]{Effectif}}{\useKV[ClesStat]{Origine}}{\useKV[ClesStat]{AbscisseRotation}}\]%
}%
% Pour construire le diagramme en bâtons qualitatif
-\def\Updatetoksq#1/#2\nil{\addtotok\toklistepointq{"#1",#2,}}
+\def\Updatetoksq#1/#2\nil{\addtotok\toklistepointq{"#1",#2,}}%
\newcommand\buildgraphq[1][]{%
- \newtoks\toklistepointq
- \foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoksq\compteur\nil}
- \[\MPStatQ[#1]{2*\useKV[ClesStat]{Unitex}}{0.5*\useKV[ClesStat]{Unitey}}{\the\toklistepointq}{\useKV[ClesStat]{Donnee}}{\useKV[ClesStat]{Effectif}}{\useKV[ClesStat]{Origine}}{\useKV[ClesStat]{AbscisseRotation}}\]
-}
-
+ \newtoks\toklistepointq%
+ \foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoksq\compteur\nil}%
+ \[\MPStatQ[#1]{2*\useKV[ClesStat]{Unitex}}{0.5*\useKV[ClesStat]{Unitey}}{\the\toklistepointq}{\useKV[ClesStat]{Donnee}}{\useKV[ClesStat]{Effectif}}{\useKV[ClesStat]{Origine}}{\useKV[ClesStat]{AbscisseRotation}}\]%
+}%
\def\UpdateCoul#1\nil{\addtotok\toklistecouleur{#1,}}%
@@ -10354,6 +10360,149 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
\num{\TotalECC}%
}
+% Construction d'un diagramme en barres horizontal
+\newcommand\MPDiagBarreHor[4]{%
+ % #1 Liste des noms
+ % #2 Liste des valeurs associées
+ % #3 Liste des valeurs à afficher (si pb calcul MP)
+ \ifluatex
+ \mplibforcehmode%
+ \begin{mplibcode}%
+ Longueur:=\useKV[ClesStat]{Longueur};
+ Hauteur:=\useKV[ClesStat]{Hauteur};
+ ecarthachures=\useKV[ClesStat]{EcartHachures};
+ epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};
+ boolean Hachures;
+ Hachures=\useKV[ClesStat]{Hachures};
+ vardef CalculNombreDonneesEtDonneeMax(text t)=
+ nbdon:=0;%nombre de données
+ DonneeMax:=0;%donnée DonneeMaximale
+ for p_=t:
+ nbdon:=nbdon+1;
+ if p_>DonneeMax:
+ DonneeMax:=p_;
+ fi;
+ endfor;
+ enddef;
+ vardef ListeDonnees(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Donnees[n]:=p_;
+ endfor;
+ enddef;
+ vardef RecuperationCouleurs(text t)=
+ color Col[];
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+ vardef TraceDiag=
+ for k=0 upto nbdon-1:
+ path RectangleDonnee;
+ RectangleDonnee=(unitsquare xscaled ((Donnees[k+1]/DonneeMax)*Longueur) yscaled Hauteur) shifted(0,-k*Hauteur);
+ if Hachures:
+ trace Hachurage(RectangleDonnee,60 if
+ (k mod 2)=0: +90 fi,ecarthachures,if (k mod 2)=0 : 0 else: 1 fi)
+ withpen pencircle scaled epaisseurhachures;
+ else:
+ remplis RectangleDonnee withcolor if unknown Col[k+1]: white else:Col[k+1] fi;
+ fi;
+ trace RectangleDonnee;
+ endfor;
+ enddef;
+ vardef AffichageNom(text t)=
+ k:=0;
+ for p_=t:
+ label.lft(TEX(p_),0.5[(0,0),(0,Hauteur)] shifted (0,-k*Hauteur));
+ k:=k+1;
+ endfor;
+ enddef;
+ vardef AffichageDonnees(text t)=
+ k:=0;
+ for p_=t:
+ label.rt(TEX("\num{"&p_&"}"),0.5[(0,0),(0,Hauteur)] shifted (((Donnees[k+1]/DonneeMax)*Longueur),-k*Hauteur));
+ k:=k+1;
+ endfor;
+ enddef;
+ CalculNombreDonneesEtDonneeMax(#2);
+ ListeDonnees(#2);
+ RecuperationCouleurs(#4);
+ TraceDiag;
+ AffichageNom(#1);
+ AffichageDonnees(#3);
+ \end{mplibcode}
+ \else
+ \mpxcommands{%
+ \xdef\Nom{\expand#1}
+ }
+ \begin{mpost}[mpsettings={Longueur:=\useKV[ClesStat]{Longueur};Hauteur:=\useKV[ClesStat]{Hauteur};ecarthachures=\useKV[ClesStat]{EcartHachures};epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};boolean Hachures;Hachures=\useKV[ClesStat]{Hachures};}]
+ % Pb avec les noms accentués : pas de solution (27/02/2022)
+ vardef CalculNombreDonneesEtDonneeMax(text t)=
+ nbdon:=0;%nombre de données
+ DonneeMax:=0;%donnée DonneeMaximale
+ for p_=t:
+ nbdon:=nbdon+1;
+ if p_>DonneeMax:
+ DonneeMax:=p_;
+ fi;
+ endfor;
+ enddef;
+ vardef ListeDonnees(text t)=
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Donnees[n]:=p_;
+ endfor;
+ enddef;
+ vardef RecuperationCouleurs(text t)=
+ color Col[];
+ n:=0;
+ for p_=t:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ enddef;
+ vardef TraceDiag=
+ for k=0 upto nbdon-1:
+ path RectangleDonnee;
+ RectangleDonnee=(unitsquare xscaled ((Donnees[k+1]/DonneeMax)*Longueur) yscaled Hauteur) shifted(0,-k*Hauteur);
+ if Hachures:
+ trace Hachurage(RectangleDonnee,60 if
+ (k mod 2)=0: +90 fi,ecarthachures,if (k mod 2)=0 : 0 else: 1 fi)
+ withpen pencircle scaled epaisseurhachures;
+ else:
+ remplis RectangleDonnee withcolor if unknown Col[k+1]: white else:Col[k+1] fi;
+ fi;
+ trace RectangleDonnee;
+ endfor;
+ enddef;
+ vardef AffichageNom(text t)=
+ k:=0;
+ for p_=t:
+ label.lft(LATEX(p_),0.5[(0,0),(0,Hauteur)] shifted (0,-k*Hauteur));
+ k:=k+1;
+ endfor;
+ enddef;
+ vardef AffichageDonnees(text t)=
+ k:=0;
+ for p_=t:
+ label.rt(LATEX("\num{"&p_&"}"),0.5[(0,0),(0,Hauteur)] shifted (((Donnees[k+1]/DonneeMax)*Longueur),-k*Hauteur));
+ k:=k+1;
+ endfor;
+ enddef;
+ CalculNombreDonneesEtDonneeMax(#2);
+ ListeDonnees(#2);
+ RecuperationCouleurs(#4);
+ TraceDiag;
+ AffichageNom(#1);
+ AffichageDonnees(#3);
+ \end{mpost}
+ \fi
+}%
+
% la construction du graphique en bâtons pour quantitatif
\newcommand\MPStat[8][]{%
\ifluatex
@@ -10577,8 +10726,10 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
% la construction du graphique qualitatif
\def\MPStatCirculaireQ#1#2#3#4#5#6#7{%
\ifluatex
- \mplibforcehmode
+ \mplibforcehmode
\begin{mplibcode}
+ ecarthachures=\useKV[ClesStat]{EcartHachures};
+ epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};
pair A[],O,B[],C[],D[];
O=(0,0);
n:=0;
@@ -10626,10 +10777,10 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
arccercle(A[n],A[n-1],O) fi--cycle) withcolor if unknown Col[n]: white else:Col[n] fi;
else:
draw
- hachurage((O--if #7=0:arccercle(A[n-1],A[n],O)
+ Hachurage((O--if #7=0:arccercle(A[n-1],A[n],O)
else:arccercle(A[n],A[n-1],O) fi--cycle),p_*(#3/total[N]) if
- (n mod 2)=0: +90 else: -90 fi,0.25,if (n mod 2)=0 : 0 else: 1 fi)
- if #4=1: withcolor 0.5white fi;
+ (n mod 2)=0: +90 else: -90 fi,ecarthachures,if (n mod 2)=0 : 0 else: 1 fi)
+ withpen pencircle scaled epaisseurhachures if #4=1: withcolor 0.5white fi;
fi;
draw A[n-1]--O--A[n] if #6=1: withpen pencircle scaled2 fi;
% Affichage des angles associ\'es
@@ -10703,7 +10854,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
toto(#2);
\end{mplibcode}
\else
- \begin{mpost}%[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={ecarthachures=\useKV[ClesStat]{EcartHachures};epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};}]
pair A[],O,B[],C[],D[];
O=(0,0);
n:=0;
@@ -10751,10 +10902,10 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
arccercle(A[n],A[n-1],O) fi--cycle) withcolor if unknown Col[n]: white else:Col[n] fi;
else:
draw
- hachurage((O--if #7=0:arccercle(A[n-1],A[n],O)
+ Hachurage((O--if #7=0:arccercle(A[n-1],A[n],O)
else:arccercle(A[n],A[n-1],O) fi--cycle),p_*(#3/total[N]) if
- (n mod 2)=0: +90 else: -90 fi,0.25,if (n mod 2)=0 : 0 else: 1 fi)
- if #4=1: withcolor 0.5white fi;
+ (n mod 2)=0: +90 else: -90 fi,ecarthachures,if (n mod 2)=0 : 0 else: 1 fi)
+ withpen pencircle epaisseurhachures if #4=1: withcolor 0.5white fi;
fi;
draw A[n-1]--O--A[n] if #6=1: withpen pencircle scaled2 fi;
% Affichage des angles associ\'es
@@ -11130,7 +11281,9 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
% Construction du graphique
\ifboolKV[ClesStat]{Graphique}{%
\ifboolKV[ClesStat]{Liste}{Pas de graphique possible avec la cl\'e Liste.\\Utilisez plut\^ot la cl\'e Sondage si vous voulez un graphique avec cette liste.}{%
- \ifboolKV[ClesStat]{Angle}{\buildgraphcq{360}}{\ifboolKV[ClesStat]{SemiAngle}{\buildgraphcq{180}}{\buildgraphq[#1]}}%
+ \ifboolKV[ClesStat]{Barre}{%
+ \buildgraphbarhor%
+ }{\ifboolKV[ClesStat]{Angle}{\buildgraphcq{360}}{\ifboolKV[ClesStat]{SemiAngle}{\buildgraphcq{180}}{\buildgraphq[#1]}}}%
}}{}%
}{%%%%%%%%%%%%%%%%%%%%%D\'ebut quantitatif
% % on effectue les calculs
@@ -17573,13 +17726,32 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
%%%
% Tableaux d'unit\'es
%%%
-\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false}
+\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false}
\newcommand\PfCTBstrut{\rule[-1.2ex]{0pt}{3.8ex}} % Top and Bottom strut
\newcommand\Tableau[2][]{%
\useKVdefault[ClesTableaux]%
\setKV[ClesTableaux]{#1}%
+ \ifboolKV[ClesTableaux]{Escalier}{%
+ \ifboolKV[ClesTableaux]{Metre}{%
+ \xdef\PfCTableauUnite{\meter}%
+ \xdef\PfCCoefConversion{10}%
+ }{}%
+ \ifboolKV[ClesTableaux]{Carre}{%
+ \xdef\PfCTableauUnite{\square\meter}%
+ \xdef\PfCCoefConversion{100}%
+ }{}%
+ \ifboolKV[ClesTableaux]{Cube}{%
+ \xdef\PfCTableauUnite{\cubic\meter}%
+ \xdef\PfCCoefConversion{1000}%
+ }{}%
+ \ifboolKV[ClesTableaux]{Gramme}{%
+ \xdef\PfCTableauUnite{\gram}%
+ \xdef\PfCCoefConversion{10}%
+ }{}%
+ \PfCTableauIncline%
+ }{%
%
%%% Cl\'e Prefixes
%
@@ -18599,6 +18771,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
\]%
\Conversion{10}%
}{}%
+ }
}%
\newcommand\Conversion[1]{%
@@ -18622,44 +18795,78 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
}{}%
}%
+\newcommand\PfCTableauIncline{%
+\begin{NiceTabular}{p{1.5em}p{1.5em}p{1.5em}p{1.5em}p{1.5em}p{1.5em}p{1.5em}}
+ &&&&&&\\
+ \Block[borders={bottom}]{}{\si{\kilo\PfCTableauUnite}}&\\
+ &\Block[borders={left}]{}{}&\\
+ &\Block[borders={left,bottom}]{}{\si{\hecto\PfCTableauUnite}}&\\
+ &&\Block[borders={left}]{}{}&\\
+ &&\Block[borders={left,bottom}]{}{\si{\deca\PfCTableauUnite}}&\\
+ &&&\Block[borders={left}]{}{}&\\
+ &&&\Block[borders={left,bottom}]{}{\si{\PfCTableauUnite}}&\\
+ &&&&\Block[borders={left}]{}{}&\\
+ &&&&\Block[borders={left,bottom}]{}{\si{\deci\PfCTableauUnite}}&\\
+ &&&&&\Block[borders={left}]{}{}&\\
+ &&&&&\Block[borders={left,bottom}]{}{\si{\centi\PfCTableauUnite}}&\\
+ &&&&&&\Block[borders={left}]{}{}\\
+ &&&&&&\Block[borders={left,bottom}]{}{\si{\milli\PfCTableauUnite}}\\
+ &&&&&&
+ \CodeAfter
+ \tikz\draw[out=35,in=90,-stealth,gray] (2-|1.5) to node[midway,right]{\footnotesize$\times\num{\PfCCoefConversion}$}(4-|2.5);
+ \tikz\draw[out=35,in=90,-stealth,gray] (4-|2.5) to node[midway,right]{\footnotesize$\times\num{\PfCCoefConversion}$}(6-|3.5);
+ \tikz\draw[out=35,in=90,-stealth,gray] (6-|3.5) to node[midway,right]{\footnotesize$\times\num{\PfCCoefConversion}$}(8-|4.5);
+ \tikz\draw[out=35,in=90,-stealth,gray] (8-|4.5) to node[midway,right]{\footnotesize$\times\num{\PfCCoefConversion}$}(10-|5.5);
+ \tikz\draw[out=35,in=90,-stealth,gray] (10-|5.5) to node[midway,right]{\footnotesize$\times\num{\PfCCoefConversion}$}(12-|6.5);
+ \tikz\draw[out=35,in=90,-stealth,gray] (12-|6.5) to node[midway,right]{\footnotesize$\times\num{\PfCCoefConversion}$}(14-|7.5);
+ % bas
+ \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (15-|7.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(13-|6.5);
+ \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (13-|6.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(11-|5.5);
+ \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (11-|5.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(9-|4.5);
+ \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (9-|4.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(7-|3.5);
+ \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (7-|3.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(5-|2.5);
+ \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (5-|2.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(3-|1.5);
+\end{NiceTabular}
+}
+
%%%
% Cards
%%%
\newtcolorbox{Mybox}[3]{%
- enhanced,
- nobeforeafter,
- left=0pt,right=0pt,top=0pt,
- text fill,
- width=\largeurcarte,
- height=\hauteurcarte,
- arc=5pt,
+ enhanced,%
+ nobeforeafter,%
+ left=0pt,right=0pt,top=0pt,%
+ text fill,%
+ width=\largeurcarte,%
+ height=\hauteurcarte,%
+ arc=5pt,%
overlay unbroken and first={%
- \coordinate[yshift=-0.5\hauteurtitre] (A1) at (frame.north west);
- \coordinate[yshift=-0.5\hauteurtitre] (B1) at (frame.north east);
- \coordinate[yshift=-\hauteurtitre] (A) at (frame.north west);
- \coordinate[yshift=-\hauteurtitre] (B) at (frame.north east);
- \coordinate[xshift=1.5pt,yshift=8mm] (S1) at (frame.south west);
- \coordinate[xshift=-1.5pt,yshift=8mm] (S2) at (frame.south east);
- \coordinate[xshift=3mm+(\largeurtitre/2)] (A2) at (A1);
- \coordinate[xshift=-3mm-(\largeurtitre/2)] (B2) at (B1);
- \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurtitre,fill=TrameCouleur] (T1) at (A2){};
- \node[TexteCouleur] (T1a) at (T1){\Large #1};
- \node[yshift=-0.65cm] (T1b) at (T1){\tiny r\'eponse pr\'ec\'edente};
- \node[inner sep=0pt,rounded corners, rectangle, draw=black,minimum height=1cm,text width=\largeurtitre,fill=TrameCouleur] (T2) at (B2){};
- \node[inner sep=0pt,TexteCouleur] (T2a) at (T2){
- \begin{minipage}{\largeurtitre}
- \begin{center}
- #2
- \end{center}
- \end{minipage}
- };
- \node[yshift=-0.65cm] (T2b) at (T2){};
- \ifboolKV[Cards]{Titre}{\node[] at (T2b) {\tiny\useKV[Cards]{NomTitre}};}{},
- \node[rectangle,xshift=5pt,yshift=4.25mm,minimum width=2em,rounded corners,fill=TrameCouleur,draw=black,anchor=west] (R) at (frame.south west) {\color{black}\Large\bfseries #3};
- \draw[dashed] (S1) -- (S2);
- },
- colback=white,
- colbacktitle=TrameCouleur,
+ \coordinate[yshift=-0.5\hauteurtitre] (A1) at (frame.north west);%
+ \coordinate[yshift=-0.5\hauteurtitre] (B1) at (frame.north east);%
+ \coordinate[yshift=-\hauteurtitre] (A) at (frame.north west);%
+ \coordinate[yshift=-\hauteurtitre] (B) at (frame.north east);%
+ \coordinate[xshift=1.5pt,yshift=8mm] (S1) at (frame.south west);%
+ \coordinate[xshift=-1.5pt,yshift=8mm] (S2) at (frame.south east);%
+ \coordinate[xshift=3mm+(\largeurtitre/2)] (A2) at (A1);%
+ \coordinate[xshift=-3mm-(\largeurtitre/2)] (B2) at (B1);%
+ \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurtitre,fill=TrameCouleur] (T1) at (A2){};%
+ \node[TexteCouleur] (T1a) at (T1){\Large #1};%
+ \node[yshift=-0.65cm] (T1b) at (T1){\tiny r\'eponse pr\'ec\'edente};%
+ \node[inner sep=0pt,rounded corners, rectangle, draw=black,minimum height=1cm,text width=\largeurtitre,fill=TrameCouleur] (T2) at (B2){};%
+ \node[inner sep=0pt,TexteCouleur] (T2a) at (T2){%
+ \begin{minipage}{\largeurtitre}%
+ \begin{center}%
+ #2%
+ \end{center}%
+ \end{minipage}%
+ };%
+ \node[yshift=-0.65cm] (T2b) at (T2){};%
+ \ifboolKV[Cards]{Titre}{\node[] at (T2b) {\tiny\useKV[Cards]{NomTitre}};}{}%
+ \node[rectangle,xshift=5pt,yshift=4.25mm,minimum width=2em,rounded corners,fill=TrameCouleur,draw=black,anchor=west] (R) at (frame.south west) {\color{black}\Large\bfseries #3};%
+ \draw[dashed] (S1) -- (S2);%
+ },%
+ colback=white,%
+ colbacktitle=TrameCouleur,%
}
\newtcolorbox{MyboxJQ}[2]{%
@@ -18741,15 +18948,15 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
colback=white,%
underlay={%
\ifboolKV[Cards]{BackgroundAr}{%
- \begin{tcbclipinterior}
- \node[anchor=center,opacity=1]
- at (interior.center) {%
- \includegraphics[%
- height=\tcb@height,
- width=\tcb@width,
- ]{\useKV[Cards]{ImageAr}}};
- \end{tcbclipinterior},%
- }{}
+ \begin{tcbclipinterior}
+ \node[anchor=center,opacity=1]
+ at (interior.center) {%
+ \includegraphics[%
+ height=\tcb@height,
+ width=\tcb@width,
+ ]{\useKV[Cards]{ImageAr}}};
+ \end{tcbclipinterior}%,%
+ }{}%
},%
overlay unbroken and first={%
\coordinate[yshift=-0.5\hauteurtitre] (A) at (frame.north);%
@@ -18758,8 +18965,6 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
#1%
\end{center}%
\end{minipage}};%
- % \node[yshift=-1em] (B) at (A){};
- % \ifboolKV[Cards]{Titre}{\node[fill=white] at (B) {\useKV[Cards]{NomTitre}};}{},
}%
}%
\makeatother
@@ -18945,7 +19150,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
\end{center}
#2
-}
+}%
%%%
% Tableur