diff options
author | Karl Berry <karl@freefriends.org> | 2022-06-01 20:08:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-06-01 20:08:07 +0000 |
commit | 8d14dc414fc83144e865139e86b269f970bd183a (patch) | |
tree | 7cf368f0bcbf3dc1d66d4355b21fd2642067ff0d /Master/texmf-dist/tex/latex/profcollege | |
parent | b0b871a84bd57524b8aa6ff2562148b111741af2 (diff) |
profcollege (1jun22)
git-svn-id: svn://tug.org/texlive/trunk@63467 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/profcollege')
-rw-r--r-- | Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty | 2222 |
1 files changed, 1497 insertions, 725 deletions
diff --git a/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty b/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty index 5e1c7177930..45e407cf363 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/03/10 v0.99-m Aide pour l'utilisation de LaTeX au collège] +\ProvidesPackage{ProfCollege}[2022/06/01 v0.99-p Aide pour l'utilisation de LaTeX au college] \RequirePackage{verbatim} @@ -129,6 +129,12 @@ } \makeatother +% Pb ProfCollege<->Chinois soulev\'e par Denis +% Solution by egreg :) +\newcommand\getstrut[1]{% + \the\expandafter#1\expanded{\strutbox}% +} + % Colorer uniquement la barre de soulignement % https://tex.stackexchange.com/questions/9466/color-underline-a-formula/153884 \def\mathunderline#1#2{\color{#1}\underline{{\color{black}#2}}\color{black}} @@ -158,7 +164,7 @@ } \newcommand\LogoTW[2]{% -\setbox1=\hbox{\includegraphics[scale=#2]{#1}} +\setbox1=\hbox{\includegraphics[scale=#2]{#1}}% \begin{tikzpicture}% \clip (0,0) circle (4mm); \draw (0,0) circle (4mm); @@ -168,12 +174,12 @@ \end{tikzpicture}% }% -\makeatletter +\makeatletter% \def\Dotfill{% -\leavevmode -\cleaders \hb@xt@ .44em{\hss\xleaders\hrule width0.33em\hss}\hfill -\kern\z@} -\makeatother +\leavevmode% +\cleaders \hb@xt@ .44em{\hss\xleaders\hrule width0.33em\hss}\hfill% +\kern\z@}% +\makeatother% \newcommand\pointilles[1][]{% \ifx\bla#1\bla% @@ -331,6 +337,68 @@ } %%% +% Geometrie +%%% +\setKVdefault[Geometrie]{CoinBG={(0,0)},CoinHD={(10u,10u)},TypeTrace="Instruments"}% + +\ifluatex +\NewDocumentEnvironment{Geometrie}{o +b}{% + \useKVdefault[Geometrie]% + \setKV[Geometrie]{#1}% + \mplibforcehmode + \begin{mplibcode} + % input PfCMPFr; + pair Coinbg,Coinhd; + Coinbg=\useKV[Geometrie]{CoinBG}; + Coinhd=\useKV[Geometrie]{CoinHD}; + if \useKV[Geometrie]{TypeTrace}="Instruments": + typetrace:="normal"; + elseif \useKV[Geometrie]{TypeTrace}="MainLevee": + typetrace:="mainlevee"; + elseif \useKV[Geometrie]{TypeTrace}="Espace": + typetrace:="3D"; + typerepre:="persp"; + fi; + xa=xpart(Coinbg); + xb=xpart(Coinhd); + ya=ypart(Coinbg); + yb=ypart(Coinhd); + feuille(xa,ya,xb,yb); + _tfig:=if (xb-xa)>(yb-ya): (xb-xa) else: (yb-ya) fi; + _tfig:=2*_tfig; + #2% + \end{mplibcode} +}{} +\else +\NewDocumentEnvironment{Geometrie}{o +b}{% + \useKVdefault[Geometrie]% + \setKV[Geometrie]{#1}% + \begin{mpost}[mpsettings={ + pair Coinbg,Coinhd; + Coinbg=\useKV[Geometrie]{CoinBG}; + Coinhd=\useKV[Geometrie]{CoinHD}; + if \useKV[Geometrie]{TypeTrace}="Instruments": + typetrace:="normal"; + elseif \useKV[Geometrie]{TypeTrace}="MainLevee": + typetrace:="mainlevee"; + elseif \useKV[Geometrie]{TypeTrace}="Espace": + typetrace:="3D"; + typerepre:="persp"; + fi;} + ]% + xa=xpart(Coinbg); + xb=xpart(Coinhd);; + ya=ypart(Coinbg); + yb=ypart(Coinhd); + feuille(xa,ya,xb,yb); + _tfig:=if (xb-xa)>(yb-ya): (xb-xa) else: (yb-ya) fi; + _tfig:=2*_tfig; + #2% + \end{mpost} +}{} +\fi% + +%%% % Smiley %%% %%https://tex.stackexchange.com/questions/3695/smileys-in-latex/227226 @@ -518,11 +586,140 @@ }%\raisebox } +%%%%% +% Enquête +%%%%% +\setKVdefault[ClesEnquete]{Perso=Qui ?,Objet=Quoi ?,Lieu=Où ?,Largeur=4.5cm} + +\newcommand\Enquete[1][]{% + \useKVdefault[ClesEnquete]% + \setKV[ClesEnquete]{#1}% +} + +\newcommand\ListePersonnages[1]{% + \setsepchar{§}% + \readlist*\RetiensListePersonnages{#1} +} + +\newcommand\ListeObjets[1]{% + \setsepchar{§}% + \readlist*\RetiensListeObjets{#1} +} + +\newcommand\ListeLieux[1]{% + \setsepchar{§}% + \readlist*\RetiensListeLieux{#1} +} + +\newcommand\MelangeListe[2]{% + % #1 Liste à mélanger + % #2 Nombre d'éléments à conserver + \setsepchar{,}\ignoreemptyitems + \readlist*\ListeInter{#1} + \xdef\faa{}% Liste construite + \xdef\fii{}% Liste détruite + % on crée les #2 premieres solutions. + \xintFor* ##1 in {\xintSeq{1}{#2}}\do{% + \xintifboolexpr{\ListeInterlen>1}{% + \xdef\Alea{\fpeval{randint(\ListeInterlen)}}% + \xdef\faa{\faa \ListeInter[\Alea],}% + \xdef\fii{}% + \xintFor* ##2 in {\xintSeq{1}{\ListeInterlen}}\do{% + \xintifboolexpr{##2 == \Alea}{% + }{% + \xdef\fii{\fii \ListeInter[##2],}% + }% + }% + }{% + \xdef\faa{\faa \ListeInter[1]}% + }% + \readlist*\ListeInter{\fii}% + }% +}% + +\newcommand\ListeQuestions[1]{% + \setsepchar[*]{§*/}% + \readlist*\RetiensListeQuestions{#1} + % On crée la liste des numéros des questions + \xdef\foo{}% + \xintFor* ##1 in {\xintSeq{1}{\RetiensListeQuestionslen}}\do{% + \xdef\foo{\foo ##1,}% + }% + % Mélange des questions + % on crée les 6 premieres solutions. + \MelangeListe{\foo}{\fpeval{\RetiensListePersonnageslen}}% + \readlist*\ListeMelangeePersonnages{\faa}% + \readlist*\ListeRestante{\fii}%\ListeRestante[] + \MelangeListe{\faa}{\fpeval{\RetiensListePersonnageslen-1}}% + \readlist*\ListefuuPerso{\faa}% + % on crée les 6 solutions suivantes. + \xdef\fuuu{}% + \foreachitem\compteur\in\ListeRestante{\xdef\fuuu{\fuuu,\ListeRestante[\compteurcnt]}}% + \MelangeListe{\fuuu}{\fpeval{\RetiensListeObjetslen}}% + \readlist*\ListeMelangeeObjets{\faa}% + \readlist*\ListeRestante{\fii}% + \MelangeListe{\faa}{\fpeval{\RetiensListeObjetslen-1}}% + \readlist*\ListefuuObjets{\faa}% + % on crée les dernieres solutions. + \xdef\fuuu{}% + \foreachitem\compteur\in\ListeRestante{\xdef\fuuu{\fuuu,\ListeRestante[\compteurcnt]}}% + \MelangeListe{\fuuu}{\fpeval{\RetiensListeLieuxlen}} + \readlist*\ListeMelangeeLieux{\faa}% + %% \readlist*\ListeRestante{\fii}% + \MelangeListe{\faa}{\fpeval{\RetiensListeLieuxlen-1}}% + \readlist*\ListefuuLieux{\faa}% + % -------------- + % Liste des questions sauvegardees + \xdef\fuu{}% + \foreachitem\compteur\in\ListefuuPerso{\xdef\fuu{\fuu,\ListefuuPerso[\compteurcnt]}}% + \foreachitem\compteur\in\ListefuuObjets{\xdef\fuu{\fuu,\ListefuuObjets[\compteurcnt]}}% + \foreachitem\compteur\in\ListefuuLieux{\xdef\fuu{\fuu,\ListefuuLieux[\compteurcnt]}}% + \ignoreemptyitems\setsepchar{,}% + \MelangeListe{\fuu}{\fpeval{\RetiensListePersonnageslen+\RetiensListeObjetslen+\RetiensListeLieuxlen-3}}% + \readlist*\ListeMelangeeQuestions{\faa}% +} + +\newcommand\AffichageQuestions{% + \begin{enumerate} + \xintFor* ##1 in {\xintSeq{1}{\fpeval{\RetiensListePersonnageslen+\RetiensListeObjetslen+\RetiensListeLieuxlen-3}}}\do{% + \item\xdef\Compteur{\ListeMelangeeQuestions[##1]}\RetiensListeQuestions[\Compteur,1] + } + \end{enumerate} +} + +\newcommand\AffichageTableau{% + \begin{tabular}{|>{\PfCTBstrut$\square$~}m{\useKV[ClesEnquete]{Largeur}}|} + \hline + \rowcolor{gray!15}\multicolumn{1}{|c|}{\PfCTBstrut\useKV[ClesEnquete]{Perso}}\\ + \hline + \xintFor* ##1 in {\xintSeq{1}{\RetiensListePersonnageslen}}\do{% + \RetiensListePersonnages[##1]\xdef\PfCCompteurMelange{\ListeMelangeePersonnages[##1]} $\star$ \RetiensListeQuestions[\PfCCompteurMelange,2]\\ + } + % + \hline + \rowcolor{gray!15}\multicolumn{1}{|c|}{\PfCTBstrut\useKV[ClesEnquete]{Objet}}\\ + \hline + \xintFor* ##1 in {\xintSeq{1}{\RetiensListeObjetslen}}\do{% + \RetiensListeObjets[##1]\xdef\PfCCompteurMelange{\ListeMelangeeObjets[##1]} $\star$ \RetiensListeQuestions[\PfCCompteurMelange,2]\\ + } + % + \hline + \rowcolor{gray!15}\multicolumn{1}{|c|}{\PfCTBstrut\useKV[ClesEnquete]{Lieu}}\\ + \hline + \xintFor* ##1 in {\xintSeq{1}{\RetiensListeLieuxlen}}\do{% + \RetiensListeLieux[##1]\xdef\PfCCompteurMelange{\ListeMelangeeLieux[##1]} $\star$ \RetiensListeQuestions[\PfCCompteurMelange,2] + \\ + } + \hline + \end{tabular} +}% + + %%% % Modele en barre %%% \setKVdefault[ClesModeleBarre]{Hauteur=0.5cm,Largeur=1cm,Separation=0,Homogene=false}%Separation pour conserver le lien avec les équations. -\defKV[ClesModeleBarre]{Longueur=\setKV[ClesModeleBarre]{Homogene}} +\defKV[ClesModeleBarre]{Longueur=\setKV[ClesModeleBarre]{Homogene}}% \newtoks\toklistemodelbarresup% \toklistemodelbarresup{}% @@ -560,7 +757,7 @@ }% \newcommand\PfCMPDessineModelBarre[2]{% - \begin{mplibcode} + \begin{mplibcode}% Longueur:=\useKV[ClesModeleBarre]{Longueur}; Hauteur:=\useKV[ClesModeleBarre]{Hauteur}; @@ -674,7 +871,7 @@ endfor; endfor; \end{mplibcode} -} +}% \newcommand\PfCMPDessineModelBarreNonHomogene[2]{% \ifluatex% @@ -777,10 +974,10 @@ MBnbdepla:=0; for k=1 upto MBnbcolinf: for l=1 upto MBnbinfoinf[k]: - trace Brique(MBColInf[k],MBnbcasesinf[k][l])(MBTextcasesinf[k][l]) shifted(MBnbdepla*VecteurDepla+u*(0,-0.5)); + trace Brique(MBColInf[k],MBnbcasesinf[k][l])(MBTextcasesinf[k][l]) shifted(MBnbdepla*VecteurDepla+(0,-Hauteur)); if MBnbcasesinf[k][l]<0: for j=1 upto (abs(MBnbcasesinf[k][l])-1): - trace ((0,0)--(0,Hauteur)) shifted((MBnbdepla+j)*VecteurDepla+u*(0,-0.5)) withcolor black; + trace ((0,0)--(0,Hauteur)) shifted((MBnbdepla+j)*VecteurDepla+(0,-Hauteur)) withcolor black; endfor; fi; MBnbdepla:=MBnbdepla+abs(MBnbcasesinf[k][l]); @@ -788,10 +985,10 @@ endfor; if Separation>0: - draw u*(Separation,-0.75)--u*(Separation,0.75) withpen pencircle scaled 1.5 dashed evenly withcolor red; + draw (u*Separation,-1.5Hauteur)--(u*Separation,1.5Hauteur) withpen pencircle scaled 1.5 dashed evenly withcolor red; fi; - \end{mplibcode} + \end{mplibcode}% \else \begin{mpost}[mpsettings={Longueur:=\useKV[ClesModeleBarre]{Largeur};Hauteur:=\useKV[ClesModeleBarre]{Hauteur};Separation:=\useKV[ClesModeleBarre]{Separation};}] vardef Brique(expr col,nbfois)(text t)= @@ -903,7 +1100,7 @@ \end{mpost} \fi -} +}% %%% % Fiche m\'emorisation active @@ -996,6 +1193,17 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, }% }% +\newcommand\DivisionD[3][]{% + \useKVdefault[ClesOperations]% + \setKV[ClesOperations]{#1}% + \setcounter{divxlop}{0}% + \ifboolKV[ClesOperations]{Solution}{\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurSolution}}\colorlet{PfCCouleurVirgule}{PfCSolOp}}{\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurFond}}\colorlet{PfCCouleurVirgule}{\useKV[ClesOperations]{CouleurVirgule}}}% + \opdiv[decimalsepsymbol={,},lineheight=1.5em,columnwidth=1.5em,displayintermediary=all,voperator=bottom,intermediarystyle=\stepcounter{divxlop}\color{PfCSolOp}\PfCchiffre{A\thedivxlop},remainderstyle=\stepcounter{divxlop}\color{PfCSolOp}\PfCchiffre{A\thedivxlop},resultstyle=\stepcounter{divxlop}\color{PfCSolOp}\PfCchiffre{A\thedivxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}% + \foreach \i in {1,...,\thedivxlop}{% + \PfCentoure{A\i}{A\i}% + }% +}% + \newcommand\Multiplication[3][]{% \useKVdefault[ClesOperations]% \setKV[ClesOperations]{#1}% @@ -1032,7 +1240,7 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, %%% % Cartographie %%% -\setKVdefault[Cartographie]{Echelle=1,Carte=false,All=false,Europe=false,Asie=false,Amsud=false,Amnord=false,Amcentre=false,Caraibes=false,Afrique=false,AfficheEchelle=false,PaysSeul=false,VillesSup=false,Capitales=false,Impression=false,Fleuves=false,CouleurFond=ciel,Largeur=12,Hauteur=12,Arborescence="/usr/local/texlive/2021/texmf-dist/metapost/profcollege/datastest/"} +\setKVdefault[Cartographie]{Echelle=1,Carte=false,All=false,Europe=false,Asie=false,Amsud=false,Amnord=false,Amcentre=false,Caraibes=false,Afrique=false,AfficheEchelle=false,PaysSeul=false,VillesSup=false,Capitales=false,Impression=false,Fleuves=false,CouleurFond=ciel,Largeur=12,Hauteur=12,Arborescence="/usr/local/texlive/2022/texmf-dist/metapost/profcollege/datastest/",Projection=false,TypeProjection="mercator",CouleurPays=Cornsilk,Pasl=2,PasL=2} \defKV[Cartographie]{EchelleCarte=\setKV[Cartographie]{Carte}} \defKV[Cartographie]{Pays=\setKV[Cartographie]{PaysSeul}} \defKV[Cartographie]{Villes=\setKV[Cartographie]{VillesSup}} @@ -1041,43 +1249,164 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, \ifluatex \useKVdefault[Cartographie] \setKV[Cartographie]{#1} - \mplibforcehmode - \begin{mplibcode} - input PfCMonde; - string arborescence; - arborescence:=\useKV[Cartographie]{Arborescence}; - LargeurCadre=\useKV[Cartographie]{Largeur}; - HauteurCadre=\useKV[Cartographie]{Hauteur}; - distanceecran=100*\useKV[Cartographie]{Echelle}; - fleuves:=\useKV[Cartographie]{Fleuves}; - boolean Carte,Impression,VillesSup; - Carte=\useKV[Cartographie]{Carte}; - Impression=\useKV[Cartographie]{Impression}; - VillesSup=\useKV[Cartographie]{VillesSup}; - couleurfond:=\useKV[Cartographie]{CouleurFond}; - if Impression: - noncolore:=true; - payscolor:=0.85white; - couleurfond:=white; - couleurfleuve:=couleurfond; - fi; - capitales:=\useKV[Cartographie]{Capitales}; - All:=\useKV[Cartographie]{All}; - Europe:=\useKV[Cartographie]{Europe}; - Asie:=\useKV[Cartographie]{Asie}; - Amsud:=\useKV[Cartographie]{Amsud}; - Amnord:=\useKV[Cartographie]{Amnord}; - Amcentrale:=\useKV[Cartographie]{Amcentre}; - Caraibes:=\useKV[Cartographie]{Caraibes}; - Afrique:=\useKV[Cartographie]{Afrique}; - if Carte: - Echelle:=\useKV[Cartographie]{AfficheEchelle}; - figure(-0.5u*LargeurCadre,-0.5u*HauteurCadre,0.5u*LargeurCadre,0.5u*HauteurCadre); - if \useKV[Cartographie]{PaysSeul}: - projection:="bonne"; - theta:=#2; - phi:=#3; - zoom(echelle(#2,#3,\useKV[Cartographie]{EchelleCarte})); + \ifboolKV[Cartographie]{Projection}{% + \mplibforcehmode + \begin{mplibcode} + input PfCMonde; + string arborescence; + arborescence:=\useKV[Cartographie]{Arborescence}; + boolean Impression,VillesSup; + VillesSup=\useKV[Cartographie]{VillesSup}; + Impression=\useKV[Cartographie]{Impression}; + + maillage:=true; + fleuves:=false; + lacs:=false; + capitales:=false; + + if Impression: + noncolore:=true; + payscolor:=white; + else: + noncolore:=true; + payscolor:=\useKV[Cartographie]{CouleurPays}; + fi; + + projection:=\useKV[Cartographie]{TypeProjection}; + feuillet:=u*(-20,-20)--u*(20,-20)--u*(20,20)--u*(-20,20)--cycle; + drawoptions(withpen pencircle scaled 0.5 withcolor 0.5white); + Projection(3,48,\useKV[Cartographie]{Echelle}); + drawoptions(); + + if projection="mercator": + clip currentpicture to (mercatorc(-85,-180)--mercatorc(-85,180)--mercatorc(85,180)--mercatorc(85,-180)--cycle); + draw mercatorc(0,-180)--mercatorc(0,180); + draw mercatorc(-85,0)--mercatorc(85,0); + label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),mercatorc(0,0)); + for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8: + label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),mercatorc(-k*10,0)); + label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),mercatorc(k*10,0)); + endfor; + for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 18: + label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),mercatorc(0,-k*10)); + label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),mercatorc(0,k*10)); + endfor; + elseif projection="cylindrique": + clip currentpicture to (cylindriquec(-85,-180)--cylindriquec(-85,180)--cylindriquec(85,180)--cylindriquec(85,-180)--cycle); + draw cylindriquec(0,-180)--cylindriquec(0,180); + draw cylindriquec(-85,0)--cylindriquec(85,0); + label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),cylindriquec(0,0)); + for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8: + label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(-k*10,0)); + label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(k*10,0)); + endfor; + for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 18: + label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(0,-k*10)); + label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(0,k*10)); + endfor; + elseif projection="winkel": + clip currentpicture to (winkelc(-85,-180)--winkelc(-85,180) for k=-80 step 5 until 85:--winkelc(k,180) endfor --winkelc(85,-180) for k=80 step -5 until -85:--winkelc(k,-180) endfor --cycle); + draw winkelc(0,-180)--winkelc(0,180); + draw winkelc(-85,0)--winkelc(85,0); + label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),winkelc(0,0)); + for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8: + label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),winkelc(-k*10,0)); + label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),winkelc(k*10,0)); + endfor; + for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 18: + label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),winkelc(0,-k*10)); + label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),winkelc(0,k*10)); + endfor; + elseif projection="cylindrique": + clip currentpicture to (cylindriquec(-85,-180)--cylindriquec(-85,180)--cylindriquec(85,180)--cylindriquec(85,-180)--cycle); + draw cylindriquec(0,-180)--cylindriquec(0,180); + draw cylindriquec(-85,0)--cylindriquec(85,0); + label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),cylindriquec(0,0)); + for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8: + label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(-k*10,0)); + label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(k*10,0)); + endfor; + for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 18: + label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(0,-k*10)); + label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),cylindriquec(0,k*10)); + endfor; + elseif projection="simple": + clip currentpicture to (simplec(-85,-180)--simplec(-85,180)--simplec(85,180)--simplec(85,-180)--cycle); + draw simplec(0,-180)--simplec(0,180); + draw simplec(-85,0)--simplec(85,0); + label.llft(TEX("\tiny \ang{"&decimal(0)&"}"),simplec(0,0)); + for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 8: + label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),simplec(-k*10,0)); + label.lft(TEX("\tiny \ang{"&decimal(k*10)&"}"),simplec(k*10,0)); + endfor; + for k=\useKV[Cartographie]{Pasl} step \useKV[Cartographie]{Pasl} until 18: + label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),simplec(0,-k*10)); + label.bot(TEX("\tiny \ang{"&decimal(k*10)&"}"),simplec(0,k*10)); + endfor; + fi; + if VillesSup: + nomfichiermul:=\useKV[Cartographie]{Villes}; + nblec:=scantokens readfrom nomfichiermul; + drawoptions(withcolor (0.15,0.15,0.15)); + for p=1 upto nblec: + pair Coord[],latlon;string p_; + latlon=scantokens readfrom nomfichiermul; + p_=scantokens readfrom nomfichiermul; + if projection="mercator": + Coord[p]=mercatorc(ypart(latlon),xpart(latlon)); + elseif projection="winkel": + Coord[p]=winkelc(ypart(latlon),xpart(latlon)); + elseif projection="cylindrique": + Coord[p]=cylindriquec(ypart(latlon),xpart(latlon)); + elseif projection="simple": + Coord[p]=simplec(ypart(latlon),xpart(latlon)); + fi; + marque_p:="croix"; + pointe(Coord[p]); + label.scantokens readfrom nomfichiermul(TEX(""&p_&""),Coord[p]); + endfor; + drawoptions(); + closefrom nomfichiermul; + fi; + \end{mplibcode} + }{% + \mplibforcehmode + \begin{mplibcode} + input PfCMonde; + string arborescence; + arborescence:=\useKV[Cartographie]{Arborescence}; + LargeurCadre=\useKV[Cartographie]{Largeur}; + HauteurCadre=\useKV[Cartographie]{Hauteur}; + distanceecran=100*\useKV[Cartographie]{Echelle}; + fleuves:=\useKV[Cartographie]{Fleuves}; + boolean Carte,Impression,VillesSup; + Carte=\useKV[Cartographie]{Carte}; + Impression=\useKV[Cartographie]{Impression}; + VillesSup=\useKV[Cartographie]{VillesSup}; + couleurfond:=\useKV[Cartographie]{CouleurFond}; + if Impression: + noncolore:=true; + payscolor:=0.85white; + couleurfond:=white; + couleurfleuve:=couleurfond; + fi; + capitales:=\useKV[Cartographie]{Capitales}; + All:=\useKV[Cartographie]{All}; + Europe:=\useKV[Cartographie]{Europe}; + Asie:=\useKV[Cartographie]{Asie}; + Amsud:=\useKV[Cartographie]{Amsud}; + Amnord:=\useKV[Cartographie]{Amnord}; + Amcentrale:=\useKV[Cartographie]{Amcentre}; + Caraibes:=\useKV[Cartographie]{Caraibes}; + Afrique:=\useKV[Cartographie]{Afrique}; + if Carte: + Echelle:=\useKV[Cartographie]{AfficheEchelle}; + figure(-0.5u*LargeurCadre,-0.5u*HauteurCadre,0.5u*LargeurCadre,0.5u*HauteurCadre); + if \useKV[Cartographie]{PaysSeul}: + projection:="bonne"; + theta:=#2; + phi:=#3; + zoom(echelle(#2,#3,\useKV[Cartographie]{EchelleCarte})); fill (bonnec(-90,-180) for k=-85 step 5 until 90:..bonnec(k,-180) endfor)..reverse(bonnec(-90,180) for k=-85 step 5 until 90:..bonnec(k,180) endfor)..cycle withcolor couleurfond; lecturep(arborescence&\useKV[Cartographie]{Pays}&".dat",couleurfond);% trace feuillet withpen pencircle scaled 2; @@ -1090,30 +1419,31 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, draw ((Xa,Ya)+u*(1,1.1))--((Xa,Ya)+u*(1,0.9)); draw (((Xa,Ya)+u*(1,1.1))--((Xa,Ya)+u*(1,0.9))) shifted(u*(1,0)); fi; - else: + else: projection:="bonne"; Projection(#2,#3,echelle(#2,#3,\useKV[Cartographie]{EchelleCarte})); trace feuillet withpen pencircle scaled 2; fi; if VillesSup: - nomfichiermul:=\useKV[Cartographie]{Villes}; - nblec:=scantokens readfrom nomfichiermul; - drawoptions(withcolor (0.15,0.15,0.15)); - projection:="bonne"; - for p=1 upto nblec: - pair Coord[],latlon;string p_; - latlon=scantokens readfrom nomfichiermul; - p_=scantokens readfrom nomfichiermul; - Coord[p]=bonnec(ypart(latlon),xpart(latlon)); - dotlabel.scantokens readfrom nomfichiermul(TEX(""&p_&""),Coord[p]); - endfor; - drawoptions(); - closefrom nomfichiermul; + nomfichiermul:=\useKV[Cartographie]{Villes}; + nblec:=scantokens readfrom nomfichiermul; + drawoptions(withcolor (0.15,0.15,0.15)); + projection:="bonne"; + for p=1 upto nblec: + pair Coord[],latlon;string p_; + latlon=scantokens readfrom nomfichiermul; + p_=scantokens readfrom nomfichiermul; + Coord[p]=bonnec(ypart(latlon),xpart(latlon)); + dotlabel.scantokens readfrom nomfichiermul(TEX(""&p_&""),Coord[p]); + endfor; + drawoptions(); + closefrom nomfichiermul; fi; - else: - mappemonde(#2,#3); - fi; - \end{mplibcode} + else: + mappemonde(#2,#3); + fi; + \end{mplibcode} + } \else \PackageWarning{ProfCollege}{"La commande Cartographie n'est compatible qu'avec LuaLaTeX."} \fi @@ -3580,7 +3910,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \node[anchor=west,xshift=2em,text width=0.8*0.25\paperwidth] (Test\i) at (S\i) {\ListeAutoQ[\i,2]};% \node[anchor=north,yshift=-1em,text width=0.85*0.25\paperwidth] (TestEn\i) - at (T\i) {\textbf{\useKV[Autonomie]{TitreAtoi} :} \ListeAutoEn[\i,1]};% + at (T\i) {\textbf{\useKV[Autonomie]{TitreAtoi}} \ListeAutoEn[\i,1]};% \ifboolKV[Autonomie]{Enigme}{% \node[anchor=south,yshift=1em,text width=0.85*0.25\paperwidth] (TestREn\i) at (U\i) {% @@ -6298,14 +6628,14 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \end{tikzpicture} } -\newcommand{\DrawArrowSimple}[1]{% +\newcommand\DrawArrowSimple[1]{% \begin{tikzpicture}[overlay,remember picture] \draw[-stealth,out=50,in=140,DCFlechesh,transform canvas={yshift=2pt}] (Distri-#1.north) to (Distri-2.north); \draw[-stealth,out=50,in=140,DCFlechesh!50,transform canvas={yshift=2pt}] (Distri-#1.north) to (Distri-3.north); \end{tikzpicture} } -\newcommand{\DrawArrowSimpleRenverse}[1]{% +\newcommand\DrawArrowSimpleRenverse[1]{% \begin{tikzpicture}[overlay,remember picture] \draw[-stealth,out=140,in=50,DCFlechesh,transform canvas={yshift=2pt}] (Distri-#1.north) to (Distri-0.north); \draw[-stealth,out=140,in=50,DCFlechesh!50,transform canvas={yshift=2pt}] (Distri-#1.north) to (Distri-1.north); @@ -6319,7 +6649,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. % y a dans un "seul calcul". \setcounter{NbCalculDistri}{0} -\setKVdefault[ClesDistributivite]{Etape=1,Lettre=x,Fleches=false,AideMul=false,Reduction=false,AideAdda=false,AideAddb=false,CouleurAide=red,CouleurReduction=black,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,Impression=false}%,AideAdd=false:inutile ? +\setKVdefault[ClesDistributivite]{Cours=false,Etape=1,Lettre=x,Fleches=false,AideMul=false,Reduction=false,AideAdda=false,AideAddb=false,CouleurAide=red,CouleurReduction=black,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,Impression=false}%,AideAdd=false:inutile ? \newcommand\Tuile[4]{% \ifluatex @@ -6696,186 +7026,241 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \colorlet{DCReduction}{\useKV[ClesDistributivite]{CouleurReduction}}% \colorlet{DCFlechesh}{\useKV[ClesDistributivite]{CouleurFH}}% \colorlet{DCFlechesb}{\useKV[ClesDistributivite]{CouleurFB}}% - \ifboolKV[ClesDistributivite]{Tuile}{% - \Tuile{#2}{#3}{#4}{#5}% - }{% + \ifboolKV[ClesDistributivite]{Cours}{% \ensuremath{% - \xintifboolexpr{\useKV[ClesDistributivite]{Echange}>0}{% - \DistriEchange[#1]{#2}{#3}{#4}{#5}% - }{% - \ifboolKV[ClesDistributivite]{Remarquable}{% - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==1}{% - \ifx\bla#4\bla(\Affichage{0}{#2}{#3})^2\else(\Affichage{0}{#2}{#3})(\Affichage{0}{#4}{#5})\fi% - }{} - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==2}{\ifx\bla#4\bla\xintifboolexpr{#3>0}{\xintifboolexpr{#2==1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2==1}{}{)}^2+2\times\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesDistributivite]{Lettre}\times\num{#3}+\num{#3}^2}{\xintifboolexpr{#2==1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2==1}{}{)}^2-2\times\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesDistributivite]{Lettre}\times\num{\fpeval{0-#3}}+\num{\fpeval{0-#3}}^2}\else\xintifboolexpr{#2==1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2==1}{}{)}^2-\num{#3}^2\fi}{} - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==3}{% - \xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}% - \stepcounter{NbCalculDistri}% - \ifx\bla#4\bla% - \xdef\Multi{\fpeval{#2*#2}}% - \xdef\Multij{\fpeval{#2*#3}}% - \xdef\Multik{\fpeval{#3*#2}}% - \xdef\Multil{\fpeval{#3*#3}}% - %% ils sont red\'efinis pour pouvoir envisager la somme de deux - %% expressions \`a d\'evelopper - \xdef\Multim{\fpeval{#2*#3+#3*#2}}% - \ifboolKV[ClesDistributivite]{Oppose}{% - \xdef\Multi{\fpeval{-\Multi}}% - \xdef\Multim{\fpeval{-\Multim}}% - \xdef\Multil{\fpeval{-\Multil}}% - \xintifboolexpr{\Multi==0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}% - \xintifboolexpr{\Multim==0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}% - \xintifboolexpr{\Multil==0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}% - }{% - \Affichage{\Multi}{\Multim}{\Multil}% - } - \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#2}}\xdef\SommeB{\fpeval{\SommeB+#2*#3+#3*#2}}\xdef\SommeC{\fpeval{\SommeC+#3*#3}}}{}% - \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#2}}\xdef\SommeB{\fpeval{\SommeB-#2*#3-#3*#2}}\xdef\SommeC{\fpeval{\SommeC-#3*#3}}}{}% - \else% - \xdef\Multi{\fpeval{#2*#4}}% - \xdef\Multij{\fpeval{#2*#5}}% - \xdef\Multik{\fpeval{#3*#4}}% - \xdef\Multil{\fpeval{#3*#5}}% + \xintifboolexpr{#2==0}{% + }{\xintifboolexpr{#3==0}{}{(}}\xintifboolexpr{#2==0}{\Tikzmark{}}{\Tikzmark{a}} + \ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{+(}}{}% + \xintifboolexpr{#3>0}{\xintifboolexpr{#2==0}{}{+}}{\xintifboolexpr{#3<0}{-}{}}\Tikzmark{b}% + \ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{)}}{}% + \xintifboolexpr{#2==0}{}{\xintifboolexpr{#3==0}{}{)}}% + % + \ifboolKV[ClesDistributivite]{AideMul}{\times}{}%on aide dans le cas double + \xdef\Multi{\fpeval{#4*#5}}%affichage auto si (a+b)xk + % + \xintifboolexpr{\Multi==0}{\times% + \xintifboolexpr{#4<0}{(}{\xintifboolexpr{#5<0}{(}{}}}{(}% + \Tikzmark{c}% + \ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{+(}}{}% + \xintifboolexpr{#5>0}{\xintifboolexpr{#4==0}{}{+}}{\xintifboolexpr{#5<0}{\xintifboolexpr{#4==0}{{-}}{-}}{}}\Tikzmark{d}% + \ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{)}}{}% + \xintifboolexpr{\Multi==0}{% + \xintifboolexpr{#4<0}{)}{\xintifboolexpr{#5<0}{)}{}}}{)}% + % + = + % + \xdef\Multi{\fpeval{#2*#4}}% + \xintifboolexpr{\Multi==0}{}{% + \xintifboolexpr{#2<0}{(-}{}a\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#4<0}{(-}{}c\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}{)}{}% + }% + \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}{)}{}% + }% + \xdef\Multil{\fpeval{#3*#5}}% + \xintifboolexpr{\Multil==0}{}{+% + \xintifboolexpr{#3<0}{(-}{}b\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#5<0}{(-}{}d\xintifboolexpr{#5<0}{)}{}% + }% + % Fleches + \ifboolKV[ClesDistributivite]{Fleches}{% + \xdef\Multi{\fpeval{#2*#3*#4*#5}}% + \xintifboolexpr{\Multi==0}{% + \xdef\Multij{\fpeval{#2*#3}}%\relax + \xintifboolexpr{\Multij==0}{\xintifboolexpr{#2==0}{\DrawArrowSimple{1} + }{\DrawArrowSimple{0}}}{\xintifboolexpr{#4==0}{\DrawArrowSimpleRenverse{3}}{\DrawArrowSimpleRenverse{2}}}% + }{% + \DrawArrow% + }% + }{}\setcounter{NbDistri}{0}% + }% + }{% + \ifboolKV[ClesDistributivite]{Tuile}{% + \Tuile{#2}{#3}{#4}{#5}% + }{% + \ensuremath{% + \xintifboolexpr{\useKV[ClesDistributivite]{Echange}>0}{% + \DistriEchange[#1]{#2}{#3}{#4}{#5}% + }{% + \ifboolKV[ClesDistributivite]{Remarquable}{% + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==1}{% + \ifx\bla#4\bla(\Affichage{0}{#2}{#3})^2\else(\Affichage{0}{#2}{#3})(\Affichage{0}{#4}{#5})\fi% + }{} + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==2}{\ifx\bla#4\bla\xintifboolexpr{#3>0}{\xintifboolexpr{#2==1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2==1}{}{)}^2+2\times\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesDistributivite]{Lettre}\times\num{#3}+\num{#3}^2}{\xintifboolexpr{#2==1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2==1}{}{)}^2-2\times\xintifboolexpr{#2==1}{}{\num{#2}}\useKV[ClesDistributivite]{Lettre}\times\num{\fpeval{0-#3}}+\num{\fpeval{0-#3}}^2}\else\xintifboolexpr{#2==1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2==1}{}{)}^2-\num{#3}^2\fi}{} + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==3}{% + \xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}% + \stepcounter{NbCalculDistri}% + \ifx\bla#4\bla% + \xdef\Multi{\fpeval{#2*#2}}% + \xdef\Multij{\fpeval{#2*#3}}% + \xdef\Multik{\fpeval{#3*#2}}% + \xdef\Multil{\fpeval{#3*#3}}% + %% ils sont red\'efinis pour pouvoir envisager la somme de deux + %% expressions \`a d\'evelopper + \xdef\Multim{\fpeval{#2*#3+#3*#2}}% + \ifboolKV[ClesDistributivite]{Oppose}{% + \xdef\Multi{\fpeval{-\Multi}}% + \xdef\Multim{\fpeval{-\Multim}}% + \xdef\Multil{\fpeval{-\Multil}}% + \xintifboolexpr{\Multi==0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}% + \xintifboolexpr{\Multim==0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}% + \xintifboolexpr{\Multil==0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}% + }{% + \Affichage{\Multi}{\Multim}{\Multil}% + } + \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#2}}\xdef\SommeB{\fpeval{\SommeB+#2*#3+#3*#2}}\xdef\SommeC{\fpeval{\SommeC+#3*#3}}}{}% + \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#2}}\xdef\SommeB{\fpeval{\SommeB-#2*#3-#3*#2}}\xdef\SommeC{\fpeval{\SommeC-#3*#3}}}{}% + \else% + \xdef\Multi{\fpeval{#2*#4}}% + \xdef\Multij{\fpeval{#2*#5}}% + \xdef\Multik{\fpeval{#3*#4}}% + \xdef\Multil{\fpeval{#3*#5}}% %% ils sont red\'efinis pour pouvoir envisager la somme de deux %% expressions \`a d\'evelopper - \xdef\Multim{\fpeval{#2*#5+#3*#4}}% - \ifboolKV[ClesDistributivite]{Oppose}{% - \xdef\Multi{\fpeval{-\Multi}}% - \xdef\Multim{\fpeval{-\Multim}}% - \xdef\Multil{\fpeval{-\Multil}}% - \xintifboolexpr{\Multi==0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}% - \xintifboolexpr{\Multim==0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}% - \xintifboolexpr{\Multil==0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}% - }{% - \Affichage{\Multi}{\Multim}{\Multil}% - } - \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#4}}\xdef\SommeB{\fpeval{\SommeB+#2*#5+#3*#4}}\xdef\SommeC{\fpeval{\SommeC+#3*#5}}}{}% - \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#4}}\xdef\SommeB{\fpeval{\SommeB-#2*#5-#3*#4}}\xdef\SommeC{\fpeval{\SommeC-#3*#5}}}{}% - \fi% - }{}% - }{% - \ifboolKV[ClesDistributivite]{Numerique}{% - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==0}{% - \num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}\multido{\i=2+1}{4}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}% - }{% - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==-1}{% - \Distri[Numerique,Etape=3]{#2}{#3}{#4}{#5}\multido{\i=2+-1}{2}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}=\num{\fpeval{(#2+#3)*(#4+#5)}}% + \xdef\Multim{\fpeval{#2*#5+#3*#4}}% + \ifboolKV[ClesDistributivite]{Oppose}{% + \xdef\Multi{\fpeval{-\Multi}}% + \xdef\Multim{\fpeval{-\Multim}}% + \xdef\Multil{\fpeval{-\Multil}}% + \xintifboolexpr{\Multi==0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}% + \xintifboolexpr{\Multim==0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}% + \xintifboolexpr{\Multil==0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}% }{% - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==1}{\num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}}{}% - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==2}{\num{\fpeval{#2+#3}}\times(\num{#4}\xintifboolexpr{#5>0}{+}{-}\num{\fpeval{abs(#5)}})}{}% - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==3}{\num{#3}\times\num{#4}\xintifboolexpr{#5>0}{+}{-}\num{#3}\times\num{\fpeval{abs(#5)}}}{}% - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==4}{\num{\fpeval{#3*#4}}\xintifboolexpr{#5>0}{+}{-}\num{\fpeval{abs(#3*#5)}}}{}% - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==5}{\num{\fpeval{#3*#4+#3*#5}}}{}% - }% - }% + \Affichage{\Multi}{\Multim}{\Multil}% + } + \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#4}}\xdef\SommeB{\fpeval{\SommeB+#2*#5+#3*#4}}\xdef\SommeC{\fpeval{\SommeC+#3*#5}}}{}% + \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#4}}\xdef\SommeB{\fpeval{\SommeB-#2*#5-#3*#4}}\xdef\SommeC{\fpeval{\SommeC-#3*#5}}}{}% + \fi% + }{}% }{% - \ifboolKV[ClesDistributivite]{All}{% - \xdef\NomLettre{\useKV[ClesDistributivite]{NomExpression}}% - \xdef\NomFin{\useKV[ClesDistributivite]{Fin}}% - \xdef\NomVariable{\useKV[ClesDistributivite]{Lettre}}% - \xintFor* ##1 in {\xintSeq {1}{\useKV[ClesDistributivite]{Fin}-1}}\do - {\NomLettre&=\Distri[Etape=##1,Lettre=\NomVariable]{#2}{#3}{#4}{#5}\\}% - \NomLettre&=\Distri[Etape=\NomFin,Lettre=\NomVariable]{#2}{#3}{#4}{#5}% + \ifboolKV[ClesDistributivite]{Numerique}{% + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==0}{% + \num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}\multido{\i=2+1}{4}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}% + }{% + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==-1}{% + \Distri[Numerique,Etape=3]{#2}{#3}{#4}{#5}\multido{\i=2+-1}{2}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}=\num{\fpeval{(#2+#3)*(#4+#5)}}% + }{% + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==1}{\num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}}{}% + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==2}{\num{\fpeval{#2+#3}}\times(\num{#4}\xintifboolexpr{#5>0}{+}{-}\num{\fpeval{abs(#5)}})}{}% + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==3}{\num{#3}\times\num{#4}\xintifboolexpr{#5>0}{+}{-}\num{#3}\times\num{\fpeval{abs(#5)}}}{}% + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==4}{\num{\fpeval{#3*#4}}\xintifboolexpr{#5>0}{+}{-}\num{\fpeval{abs(#3*#5)}}}{}% + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==5}{\num{\fpeval{#3*#4+#3*#5}}}{}% + }% + }% }{% - % Etape 1 - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==1}{% - \xintifboolexpr{#2==0}{% - }{\xintifboolexpr{#3==0}{}{(}}\Tikzmark{\Affichage[#1]{0}{#2}{0}}% - \ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{+(}}{}% - \xintifboolexpr{#3>0}{\xintifboolexpr{#2==0}{}{+}}{\xintifboolexpr{#3<0}{-}{}}\Tikzmark{\Affichage[#1]{0}{0}{\fpeval{abs(#3)}}}% - \ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{)}}{}% - \xintifboolexpr{#2==0}{}{\xintifboolexpr{#3==0}{}{)}}% - % - \ifboolKV[ClesDistributivite]{AideMul}{\times}{}%on aide dans le cas double - \xdef\Multi{\fpeval{#4*#5}}%affichage auto si (a+b)xk - % - \xintifboolexpr{\Multi==0}{\times% - \xintifboolexpr{#4<0}{(}{\xintifboolexpr{#5<0}{(}{}}}{(}% - \Tikzmark{\Affichage[#1]{0}{#4}{0}}% - \ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{+(}}{}% - \xintifboolexpr{#5>0}{\xintifboolexpr{#4==0}{}{+}}{\xintifboolexpr{#5<0}{\xintifboolexpr{#4==0}{{-}}{-}}{}}\Tikzmark{\Affichage[#1]{0}{0}{\fpeval{abs(#5)}}}% - \ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{)}}{}% - \xintifboolexpr{\Multi==0}{% - \xintifboolexpr{#4<0}{)}{\xintifboolexpr{#5<0}{)}{}}}{)}% - \ifboolKV[ClesDistributivite]{Fleches}{% - \xdef\Multi{\fpeval{#2*#3*#4*#5}}% + \ifboolKV[ClesDistributivite]{All}{% + \xdef\NomLettre{\useKV[ClesDistributivite]{NomExpression}}% + \xdef\NomFin{\useKV[ClesDistributivite]{Fin}}% + \xdef\NomVariable{\useKV[ClesDistributivite]{Lettre}}% + \xintFor* ##1 in {\xintSeq {1}{\useKV[ClesDistributivite]{Fin}-1}}\do + {\NomLettre&=\Distri[Etape=##1,Lettre=\NomVariable]{#2}{#3}{#4}{#5}\\}% + \NomLettre&=\Distri[Etape=\NomFin,Lettre=\NomVariable]{#2}{#3}{#4}{#5}% + }{% + % Etape 1 + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==1}{% + \xintifboolexpr{#2==0}{% + }{\xintifboolexpr{#3==0}{}{(}}\Tikzmark{\Affichage[#1]{0}{#2}{0}}% + \ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{+(}}{}% + \xintifboolexpr{#3>0}{\xintifboolexpr{#2==0}{}{+}}{\xintifboolexpr{#3<0}{-}{}}\Tikzmark{\Affichage[#1]{0}{0}{\fpeval{abs(#3)}}}% + \ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{)}}{}% + \xintifboolexpr{#2==0}{}{\xintifboolexpr{#3==0}{}{)}}% + % + \ifboolKV[ClesDistributivite]{AideMul}{\times}{}%on aide dans le cas double + \xdef\Multi{\fpeval{#4*#5}}%affichage auto si (a+b)xk + % + \xintifboolexpr{\Multi==0}{\times% + \xintifboolexpr{#4<0}{(}{\xintifboolexpr{#5<0}{(}{}}}{(}% + \Tikzmark{\Affichage[#1]{0}{#4}{0}}% + \ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{+(}}{}% + \xintifboolexpr{#5>0}{\xintifboolexpr{#4==0}{}{+}}{\xintifboolexpr{#5<0}{\xintifboolexpr{#4==0}{{-}}{-}}{}}\Tikzmark{\Affichage[#1]{0}{0}{\fpeval{abs(#5)}}}% + \ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{)}}{}% \xintifboolexpr{\Multi==0}{% - \xdef\Multij{\fpeval{#2*#3}}%\relax - \xintifboolexpr{\Multij==0}{\xintifboolexpr{#2==0}{\DrawArrowSimple{1}}{\DrawArrowSimple{0}}}{\xintifboolexpr{#4==0}{\DrawArrowSimpleRenverse{3}}{\DrawArrowSimpleRenverse{2}}}% - }{% - \DrawArrow% + \xintifboolexpr{#4<0}{)}{\xintifboolexpr{#5<0}{)}{}}}{)}% + \ifboolKV[ClesDistributivite]{Fleches}{% + \xdef\Multi{\fpeval{#2*#3*#4*#5}}% + \xintifboolexpr{\Multi==0}{% + \xdef\Multij{\fpeval{#2*#3}}%\relax + \xintifboolexpr{\Multij==0}{\xintifboolexpr{#2==0}{\DrawArrowSimple{1}}{\DrawArrowSimple{0}}}{\xintifboolexpr{#4==0}{\DrawArrowSimpleRenverse{3}}{\DrawArrowSimpleRenverse{2}}}% + }{% + \DrawArrow% + }% + }{}\setcounter{NbDistri}{0}% + }{} + % Etape 2 + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==2}{% + \xdef\Multi{\fpeval{#2*#4}}% + \xintifboolexpr{\Multi==0}{}{% + \xintifboolexpr{#2<0}{(}{}\Affichage[#1]{0}{#2}{0}\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#4<0}{(}{}\Affichage[#1]{0}{#4}{0}\xintifboolexpr{#4<0}{)}{}% + } + \xdef\Multij{\fpeval{#2*#5}}% + \xintifboolexpr{\Multij==0}{}{% + \xintifboolexpr{\Multi==0}{}{+}% + \xintifboolexpr{#2<0}{(}{}\Affichage[#1]{0}{#2}{0}\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#5<0}{(}{}\Affichage[#1]{0}{0}{#5}\xintifboolexpr{#5<0}{)}{}% }% - }{}\setcounter{NbDistri}{0}% - }{} - % Etape 2 - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==2}{% - \xdef\Multi{\fpeval{#2*#4}}% - \xintifboolexpr{\Multi==0}{}{% - \xintifboolexpr{#2<0}{(}{}\Affichage[#1]{0}{#2}{0}\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#4<0}{(}{}\Affichage[#1]{0}{#4}{0}\xintifboolexpr{#4<0}{)}{}% - } - \xdef\Multij{\fpeval{#2*#5}}% - \xintifboolexpr{\Multij==0}{}{% - \xintifboolexpr{\Multi==0}{}{+}% - \xintifboolexpr{#2<0}{(}{}\Affichage[#1]{0}{#2}{0}\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#5<0}{(}{}\Affichage[#1]{0}{0}{#5}\xintifboolexpr{#5<0}{)}{}% - }% - \xdef\Multik{\fpeval{#3*#4}}% - \xintifboolexpr{\Multik==0}{}{% - \xintifboolexpr{\Multi==0}{}{+}% - \xintifboolexpr{#3<0}{(}{}\Affichage[#1]{0}{0}{#3}\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#4<0}{(}{}\Affichage[#1]{0}{#4}{0}\xintifboolexpr{#4<0}{)}{}% - }% - \xdef\Multil{\fpeval{#3*#5}}% - \xintifboolexpr{\Multil==0}{}{+% - \xintifboolexpr{#3<0}{(}{}\Affichage[#1]{0}{0}{#3}\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#5<0}{(}{}\Affichage[#1]{0}{0}{#5}\xintifboolexpr{#5<0}{)}{}% - }% - }{}% - % Etape 3 - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==3}{% - \stepcounter{NbCalculDistri}% - \xdef\Multi{\fpeval{#2*#4}}% - \xdef\Multij{\fpeval{#2*#5}}% - \xdef\Multik{\fpeval{#3*#4}}% - \xdef\Multil{\fpeval{#3*#5}}% - %% ils sont red\'efinis pour pouvoir envisager la somme de deux - %% expressions \`a d\'evelopper - \xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multi<0}{(\Affichage{\Multi}{0}{0})}{\Affichage{\Multi}{0}{0}}}{\Affichage{\Multi}{0}{0}}% - \ifboolKV[ClesDistributivite]{Reduction}{\mathunderline{DCReduction}{% - \xintifboolexpr{\Multij==0}{}{\xintifboolexpr{\Multi==0}{}{{}+}\xintifboolexpr{\Multij<0}{(}{}\Affichage{0}{\Multij}{0}\xintifboolexpr{\Multij<0}{)}{}}% - \xintifboolexpr{\Multik==0}{}{\xintifboolexpr{\Multil==0}{\xintifboolexpr{#2==0}{}{+}}{+}\xintifboolexpr{\Multik<0}{(}{}\Affichage{0}{\Multik}{0}\xintifboolexpr{\Multik<0}{)}{}}% + \xdef\Multik{\fpeval{#3*#4}}% + \xintifboolexpr{\Multik==0}{}{% + \xintifboolexpr{\Multi==0}{}{+}% + \xintifboolexpr{#3<0}{(}{}\Affichage[#1]{0}{0}{#3}\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#4<0}{(}{}\Affichage[#1]{0}{#4}{0}\xintifboolexpr{#4<0}{)}{}% }% - }{% - \xintifboolexpr{\Multij==0}{}{\xintifboolexpr{\Multi==0}{}{+}\xintifboolexpr{\Multij<0}{(}{}\Affichage{0}{\Multij}{0}\xintifboolexpr{\Multij<0}{)}{}}% - \xintifboolexpr{\Multik==0}{}{\xintifboolexpr{\Multil==0}{\xintifboolexpr{#2==0}{}{+}}{\xintifboolexpr{#2==0}{}{+}}\xintifboolexpr{\Multik<0}{(}{}\Affichage{0}{\Multik}{0}\xintifboolexpr{\Multik<0}{)}{}}% - }% - \xintifboolexpr{\Multil==0}{}{+}\xintifboolexpr{\Multil<0}{(}{}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}% - }{}% - % Etape 4 - \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==4}{% - \xdef\Multi{\fpeval{#2*#4}}% - \xdef\Multij{\fpeval{#2*#5}}% - \xdef\Multik{\fpeval{#3*#4}}% - \xdef\Multil{\fpeval{#3*#5}}% - %% ils sont red\'efinis pour pouvoir envisager la somme de deux - %% expressions \`a d\'evelopper - \xdef\Multim{\fpeval{#2*#5+#3*#4}}% - \xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}% - \stepcounter{NbCalculDistri}% - \ifboolKV[ClesDistributivite]{Oppose}{% - \xdef\Multi{\fpeval{-\Multi}}% - \xdef\Multim{\fpeval{-\Multim}}% - \xdef\Multil{\fpeval{-\Multil}}% - \xintifboolexpr{\Multi==0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}% - \xintifboolexpr{\Multim==0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}% - \xintifboolexpr{\Multil==0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}% - }{% + \xdef\Multil{\fpeval{#3*#5}}% + \xintifboolexpr{\Multil==0}{}{+% + \xintifboolexpr{#3<0}{(}{}\Affichage[#1]{0}{0}{#3}\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#5<0}{(}{}\Affichage[#1]{0}{0}{#5}\xintifboolexpr{#5<0}{)}{}% + }% + }{}% + % Etape 3 + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==3}{% + \stepcounter{NbCalculDistri}% + \xdef\Multi{\fpeval{#2*#4}}% + \xdef\Multij{\fpeval{#2*#5}}% + \xdef\Multik{\fpeval{#3*#4}}% + \xdef\Multil{\fpeval{#3*#5}}% + %% ils sont red\'efinis pour pouvoir envisager la somme de deux + %% expressions \`a d\'evelopper \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}}% + \ifboolKV[ClesDistributivite]{Reduction}{\mathunderline{DCReduction}{% + \xintifboolexpr{\Multij==0}{}{\xintifboolexpr{\Multi==0}{}{{}+}\xintifboolexpr{\Multij<0}{(}{}\Affichage{0}{\Multij}{0}\xintifboolexpr{\Multij<0}{)}{}}% + \xintifboolexpr{\Multik==0}{}{\xintifboolexpr{\Multil==0}{\xintifboolexpr{#2==0}{}{+}}{+}\xintifboolexpr{\Multik<0}{(}{}\Affichage{0}{\Multik}{0}\xintifboolexpr{\Multik<0}{)}{}}% + }% + }{% + \xintifboolexpr{\Multij==0}{}{\xintifboolexpr{\Multi==0}{}{+}\xintifboolexpr{\Multij<0}{(}{}\Affichage{0}{\Multij}{0}\xintifboolexpr{\Multij<0}{)}{}}% + \xintifboolexpr{\Multik==0}{}{\xintifboolexpr{\Multil==0}{\xintifboolexpr{#2==0}{}{+}}{\xintifboolexpr{#2==0}{}{+}}\xintifboolexpr{\Multik<0}{(}{}\Affichage{0}{\Multik}{0}\xintifboolexpr{\Multik<0}{)}{}}% }% - \xintifboolexpr{\Multil==0}{}{\xintifboolexpr{\Multil<0}{-\Affichage{0}{0}{\fpeval{-\Multil}}}{+\Affichage{0}{0}{\Multil}}}% - } - \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#4}}\xdef\SommeB{\fpeval{\SommeB+#2*#5+#3*#4}}\xdef\SommeC{\fpeval{\SommeC+#3*#5}}}{}% - \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#4}}\xdef\SommeB{\fpeval{\SommeB-#2*#5-#3*#4}}\xdef\SommeC{\fpeval{\SommeC-#3*#5}}}{}% - }{}% + \xintifboolexpr{\Multil==0}{}{+}\xintifboolexpr{\Multil<0}{(}{}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}% + }{}% + % Etape 4 + \xintifboolexpr{\useKV[ClesDistributivite]{Etape}==4}{% + \xdef\Multi{\fpeval{#2*#4}}% + \xdef\Multij{\fpeval{#2*#5}}% + \xdef\Multik{\fpeval{#3*#4}}% + \xdef\Multil{\fpeval{#3*#5}}% + %% ils sont red\'efinis pour pouvoir envisager la somme de deux + %% expressions \`a d\'evelopper + \xdef\Multim{\fpeval{#2*#5+#3*#4}}% + \xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}% + \stepcounter{NbCalculDistri}% + \ifboolKV[ClesDistributivite]{Oppose}{% + \xdef\Multi{\fpeval{-\Multi}}% + \xdef\Multim{\fpeval{-\Multim}}% + \xdef\Multil{\fpeval{-\Multil}}% + \xintifboolexpr{\Multi==0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}% + \xintifboolexpr{\Multim==0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}% + \xintifboolexpr{\Multil==0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}% + }{% + \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{\Multil==0}{}{\xintifboolexpr{\Multil<0}{-\Affichage{0}{0}{\fpeval{-\Multil}}}{+\Affichage{0}{0}{\Multil}}}% + } + \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#4}}\xdef\SommeB{\fpeval{\SommeB+#2*#5+#3*#4}}\xdef\SommeC{\fpeval{\SommeC+#3*#5}}}{}% + \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#4}}\xdef\SommeB{\fpeval{\SommeB-#2*#5-#3*#4}}\xdef\SommeC{\fpeval{\SommeC-#3*#5}}}{}% + }{}% + }% }% }% }% @@ -7223,7 +7608,7 @@ 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,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}% +\setKVdefault[ClesNombrePremier]{Tableau=false,TableauVide=false,TableauVertical=false,TableauVerticalVide=false,Exposant=false,Longue=false,All=false,Arbre=false,ArbreVide=false,ArbreComplet=false,ArbreDessine=false,ArbreDessineVide=false,Entoure=false,Entourefin=false,Diviseurs=false,DiviseursT=false,Dot=\dotfill,Impose=false,ImposeAll=false,Potence=false,Decalage=10,Vide=false,CouleurFeuillage=ForestGreen,CouleurTronc=BurlyWood,CouleurFruits=Red,CouleurTexte=white}% \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}} @@ -7234,6 +7619,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \ifboolKV[ClesNombrePremier]{Impose}{\NombrePremierImpose{#2}{\useKV[ClesNombrePremier]{Nombre}}{\fpeval{#2/\useKV[ClesNombrePremier]{Nombre}}}}{}% \ifboolKV[ClesNombrePremier]{ImposeAll}{\NombrePremierImposeAll{#2}{\useKV[ClesNombrePremier]{AllNombre}}{\fpeval{#2/\useKV[ClesNombrePremier]{AllNombre}}}}{}% \ifboolKV[ClesNombrePremier]{Tableau}{\NombrePremier{#2}}{}% + \ifboolKV[ClesNombrePremier]{TableauVide}{\NombrePremierVide{#2}}{}% \ifboolKV[ClesNombrePremier]{Potence}{\NombrePremierPotence{#2}}{}% \ifboolKV[ClesNombrePremier]{TableauVertical}{\NombrePremierVertical{#2}}{}% \ifboolKV[ClesNombrePremier]{TableauVerticalVide}{\NombrePremierVerticalVide{#2}}{}% @@ -7594,6 +7980,32 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \fi } +\newcommand\NombrePremierVide[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 + \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 + Le nombre \num{#1} est un nombre premier. + \else + \begin{align*} + \xintFor* ##1 in {\xintSeq {1}{\premier}}\do {\num{#1}&=\phantom{\PremierEtape{#1}{##1}}\xintifboolexpr{##1<\premier}{\\}{}}% + \end{align*} + \fi +} + \newcount\premierun \newcount\premierdeux @@ -8275,7 +8687,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. % #5 point sur le segment #1#3 % #6 angle de rotation \ifluatex - \mplibcodeinherit{enable} +% \mplibcodeinherit{enable} \mplibforcehmode \begin{mplibcode} u:=\useKV[ClesThales]{Echelle}; @@ -8324,7 +8736,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. label(btex $//$ etex ,K); drawoptions(); \end{mplibcode} - \mplibcodeinherit{disable} +% \mplibcodeinherit{disable} \else \begin{mpost}[mpsettings={u:=\useKV[ClesThales]{Echelle};}] pair A,B,C,M,N,O;% @@ -9832,7 +10244,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \fi } -\setKVdefault[ClesTrigo]{Angle=0,Propor=false,Figure=false,FigureSeule=false,Precision=2,Unite=cm,Sinus=false,Cosinus=false,Tangente=false,Perso=false,Echelle=1cm}% +\setKVdefault[ClesTrigo]{Angle=0,Propor=false,Figure=false,FigureSeule=false,ValeurExacte=false,Precision=2,Unite=cm,Sinus=false,Cosinus=false,Tangente=false,Perso=false,Echelle=1cm}% \newcommand\RedactionTrigo{}% @@ -9863,15 +10275,17 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \ifboolKV[ClesTrigo]{Propor}{% \begin{align*} \NomA\NomC\times\cos(\widehat{\NomB\NomA\NomC})&=\NomA\NomB\\ - \num{#4}\times\cos(\ang{#5})&=\NomA\NomB\\ - \num{\fpeval{round(#4*cosd(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*cosd(#5),9)}}{=}{\approx}\NomA\NomB% + \num{#4}\times\cos(\ang{#5})&=\NomA\NomB%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\ + \num{\fpeval{round(#4*cosd(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*cosd(#5),9)}}{=}{\approx}\NomA\NomB} \end{align*}% }{% \begin{align*} \cos(\widehat{\NomB\NomA\NomC})&=\frac{\NomA\NomB}{\NomA\NomC}\\ \cos(\ang{#5})&=\frac{\NomA\NomB}{\num{#4}}\\ - \num{#4}\times\cos(\ang{#5})&=\NomA\NomB\\ - \num{\fpeval{round(#4*cosd(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*cosd(#5),9)}}{=}{\approx}\NomA\NomB + \num{#4}\times\cos(\ang{#5})&=\NomA\NomB%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \num{\fpeval{round(#4*cosd(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*cosd(#5),9)}}{=}{\approx}\NomA\NomB}% \end{align*} }% \else% @@ -9881,15 +10295,17 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \begin{align*} \NomA\NomC\times\cos(\widehat{\NomB\NomA\NomC})&=\NomA\NomB\\ \NomA\NomC\times\cos(\ang{#5})&=\num{#3}\\ - \NomA\NomC&=\frac{\num{#3}}{\cos(\ang{#5})}\\ - \NomA\NomC&\IfInteger{\fpeval{round(#3/cosd(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/cosd(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}% + \NomA\NomC&=\frac{\num{#3}}{\cos(\ang{#5})}%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \NomA\NomC&\IfInteger{\fpeval{round(#3/cosd(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/cosd(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}}% \end{align*} }{% \begin{align*} \cos(\widehat{\NomB\NomA\NomC})&=\frac{\NomA\NomB}{\NomA\NomC}\\ \cos(\ang{#5})&=\frac{\num{#3}}{\NomA\NomC}\\ - \NomA\NomC&=\frac{\num{#3}}{\cos(\ang{#5})}\\ - \NomA\NomC&\IfInteger{\fpeval{round(#3/cosd(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/cosd(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}% + \NomA\NomC&=\frac{\num{#3}}{\cos(\ang{#5})}%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \NomA\NomC&\IfInteger{\fpeval{round(#3/cosd(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/cosd(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}}% \end{align*}% }% \else%on calcule l'angle @@ -9919,15 +10335,17 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \ifboolKV[ClesTrigo]{Propor}{% \begin{align*} \NomA\NomC\times\sin(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\ - \num{#4}\times\sin(\ang{#5})&=\NomB\NomC\\ - \num{\fpeval{round(#4*sind(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*sind(#5),9)}}{=}{\approx}\NomB\NomC% + \num{#4}\times\sin(\ang{#5})&=\NomB\NomC%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \num{\fpeval{round(#4*sind(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*sind(#5),9)}}{=}{\approx}\NomB\NomC}% \end{align*}% }{% \begin{align*} \sin(\widehat{\NomB\NomA\NomC})&=\frac{\NomB\NomC}{\NomA\NomC}\\ \sin(\ang{#5})&=\frac{\NomB\NomC}{\num{#4}}\\ - \num{#4}\times\sin(\ang{#5})&=\NomB\NomC\\ - \num{\fpeval{round(#4*sind(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*sind(#5),9)}}{=}{\approx}\NomB\NomC% + \num{#4}\times\sin(\ang{#5})&=\NomB\NomC%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \num{\fpeval{round(#4*sind(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*sind(#5),9)}}{=}{\approx}\NomB\NomC}% \end{align*}% }% \else @@ -9937,15 +10355,17 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \begin{align*} \NomA\NomC\times\sin(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\ \NomA\NomC\times\sin(\ang{#5})&=\num{#3}\\ - \NomA\NomC&=\frac{\num{#3}}{\sin(\ang{#5})}\\ - \NomA\NomC&\IfInteger{\fpeval{round(#3/sind(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/sind(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}% + \NomA\NomC&=\frac{\num{#3}}{\sin(\ang{#5})}%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \NomA\NomC&\IfInteger{\fpeval{round(#3/sind(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/sind(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}}% \end{align*}% }{% \begin{align*} \sin(\widehat{\NomB\NomA\NomC})&=\frac{\NomB\NomC}{\NomA\NomC}\\ \sin(\ang{#5})&=\frac{\num{#3}}{\NomA\NomC}\\ - \NomA\NomC&=\frac{\num{#3}}{\sin(\ang{#5})}\\ - \NomA\NomC&\IfInteger{\fpeval{round(#3/sind(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/sind(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}% + \NomA\NomC&=\frac{\num{#3}}{\sin(\ang{#5})}%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \NomA\NomC&\IfInteger{\fpeval{round(#3/sind(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/sind(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}}% \end{align*}% }% \else%on calcule l'angle @@ -9975,15 +10395,17 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \ifboolKV[ClesTrigo]{Propor}{% \begin{align*} \NomA\NomB\times\tan(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\% - \num{#4}\times\tan(\ang{#5})&=\NomB\NomC\\% - \num{\fpeval{round(#4*tand(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*tand(#5),9)}}{=}{\approx}\NomB\NomC% + \num{#4}\times\tan(\ang{#5})&=\NomB\NomC%\\% + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \num{\fpeval{round(#4*tand(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*tand(#5),9)}}{=}{\approx}\NomB\NomC}% \end{align*}% }{% \begin{align*} \tan(\widehat{\NomB\NomA\NomC})&=\frac{\NomB\NomC}{\NomA\NomB}\\ \tan(\ang{#5})&=\frac{\NomB\NomC}{\num{#4}}\\ - \num{#4}\times\tan(\ang{#5})&=\NomB\NomC\\ - \num{\fpeval{round(#4*tand(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*tand(#5),9)}}{=}{\approx}\NomB\NomC% + \num{#4}\times\tan(\ang{#5})&=\NomB\NomC%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \num{\fpeval{round(#4*tand(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(#4*tand(#5),9)}}{=}{\approx}\NomB\NomC}% \end{align*}% }% \else @@ -9993,15 +10415,17 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \begin{align*} \NomA\NomB\times\tan(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\ \NomA\NomB\times\tan(\ang{#5})&=\num{#3}\\ - \NomA\NomB&=\frac{\num{#3}}{\tan(\ang{#5})}\\ - \NomA\NomB&\IfInteger{\fpeval{round(#3/tand(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/tand(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}% + \NomA\NomB&=\frac{\num{#3}}{\tan(\ang{#5})}%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \NomA\NomB&\IfInteger{\fpeval{round(#3/tand(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/tand(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}}% \end{align*}% }{% \begin{align*} \tan(\widehat{\NomB\NomA\NomC})&=\frac{\NomB\NomC}{\NomA\NomB}\\ \tan(\ang{#5})&=\frac{\num{#3}}{\NomA\NomB}\\ - \NomA\NomB&=\frac{\num{#3}}{\tan(\ang{#5})}\\ - \NomA\NomB&\IfInteger{\fpeval{round(#3/tand(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/tand(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}% + \NomA\NomB&=\frac{\num{#3}}{\tan(\ang{#5})}%\\ + \ifboolKV[ClesTrigo]{ValeurExacte}{}{\\% + \NomA\NomB&\IfInteger{\fpeval{round(#3/tand(#5),9)}}{=}{\approx}\num{\fpeval{round(#3/tand(#5),\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}}% \end{align*}% }% \else%on calcule l'angle @@ -10151,98 +10575,121 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \newcommand\DonneeMin{}% \newcommand\EffectifMax{}% -\setKVdefault[ClesStat]{ColVide=0,EffVide=false,% -FreqVide=false,AngVide=false,ECCVide=false,TotalVide=false,Sondage=false,% +\setKVdefault[ClesStat]{ColVide=0,CaseVide=false,EffVide=false,% +FreqVide=false,AngVide=false,ECCVide=false,TotalVide=false,Sondage=false,Liste=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,EcartHachures=0.25,EpaisseurHachures=1,Longueur=10cm,Hauteur=5mm,Barre=false} - +Etendue=false,Moyenne=false,SET=false,ValeurExacte=false,Mediane=false,QuartileUn=false,QuartileTrois=false,Total=false,Concret=false,% +Unite={},Largeur=1cm,Precision=2,PrecisionF=0,Donnee=Valeurs,Effectif=Effectif,Grille=false,Origine=0,Angle=false,SemiAngle=false,Qualitatif=false,TableauVide=false,ECC=false,Coupure=10,CouleurTab=gray!15,Graphique=false,Batons=true,% +% Pour les diags batons +EpaisseurBatons=1,ListeCouleursB={black},Lecture=false,LectureFine=false,AideLecture=false,Reponses=false,DonneesSup=false,AbscisseRotation=false,Tiret=false,AngleRotationAbscisse=0,Pasx=1,Pasy=1,Unitex=0.5,Unitey=0.5,% +% Pour les diags circulaires +Rayon=3cm,AffichageAngle=false,AffichageDonnee=false,ListeCouleurs={white},Hachures=false,LectureInverse=false,EcartHachures=0.25,EpaisseurHachures=1,Legende,LegendeVide=false,% +%Pour les représentations +Representation=false,% +%Pour les barres horizontales +Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% +} +%compl\'ements +\defKV[ClesStat]{AngleRotationAbscisse=\setKV[ClesStat]{AbscisseRotation}}% +\defKV[ClesStat]{AffichageDonnees=\setKV[ClesStat]{AffichageAngle=false}\setKV[ClesStat]{AffichageDonnee}}% +\defKV[ClesStat]{CasesVides=\setKV[ClesStat]{CaseVide}}% +\defKV[ClesStat]{LegendesVides=\setKV[ClesStat]{LegendeVide}}% % La construction du tableau \def\addtotok#1#2{#1\expandafter{\the#1#2}} \newtoks\tabtoksa\newtoks\tabtoksb\newtoks\tabtoksc -\def\updatetoks#1/#2\nil{\addtotok\tabtoksa{\ifboolKV[ClesStat]{Qualitatif}{&\cellcolor{\useKV[ClesStat]{CouleurTab}}#1}{&\cellcolor{\useKV[ClesStat]{CouleurTab}}\num{#1}}}\addtotok\tabtoksb{&\num{#2}}} -\def\buildtab{% %%Tableau sans total +\def\updatetoks#1/#2\nil{\addtotok\tabtoksa{\ifboolKV[ClesStat]{Qualitatif}{}{&\num{#1}}}\addtotok\tabtoksb{&\num{#2}}} +% +\newcounter{PfCCompteLignes}% +% +\def\BuildtabStat{% %%Tableau sans total + \setcounter{PfCCompteLignes}{0}% \tabtoksa{\useKV[ClesStat]{Donnee}}\tabtoksb{\useKV[ClesStat]{Effectif}}% \foreachitem\compteur\in\ListeComplete{\expandafter\updatetoks\compteur\nil}% - \[% + \ifboolKV[ClesStat]{Total}{% \renewcommand{\arraystretch}{\useKV[ClesStat]{Stretch}}% - \begin{tabular}{|>{\columncolor{\useKV[ClesStat]{CouleurTab}}}c|*{\fpeval{\ListeCompletelen}}{>{\centering\arraybackslash}p{\useKV[ClesStat]{Largeur}}|}}% - \hline% - \the\tabtoksa\\\hline% - \xintifboolexpr{\useKV[ClesStat]{ColVide}<1 || \useKV[ClesStat]{ColVide}>\ListeCompletelen}{% - \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\the\tabtoksb}\\\hline% - \ifboolKV[ClesStat]{Frequence}{Fr\'equence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}\\\hline}{}% - \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}\\\hline}{}% - \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}\\\hline}{}% - \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}\\\hline}{}% - }{% - \xintifboolexpr{\useKV[ClesStat]{ColVide}==1}{% - \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\useKV[ClesStat]{Effectif}&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ListeComplete[##1,2]}}\\\hline% - \ifboolKV[ClesStat]{Frequence}{Fr\'equence (\%)&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}\\\hline}{}% - \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}\\\hline}{}% - \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}\\\hline}{}% - \ifboolKV[ClesStat]{ECC}{E.C.C.&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}\\\hline}{}% - }{% - \xintifboolexpr{\useKV[ClesStat]{ColVide}==\ListeCompletelen}{% - \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ListeComplete[##1,2]}}&\\\hline% - \ifboolKV[ClesStat]{Frequence}{Fr\'equence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\\\hline}{}% - \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\\\hline}{}% - \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\\\hline}{}% - \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\\\hline}{}% - }{% - \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesStat]{ColVide}-1}}}\do{&\ListeComplete[##1,2]}&\xintFor* ##1 in {\xintSeq {\fpeval{\useKV[ClesStat]{ColVide}+1}}{\ListeCompletelen}}\do{&\ListeComplete[##1,2]}}\\\hline% - \ifboolKV[ClesStat]{Frequence}{Fr\'equence (\%)\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesStat]{ColVide}-1}}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\xintFor* ##1 in {\xintSeq {\fpeval{\useKV[ClesStat]{ColVide}+1}}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}\\\hline}{}% - \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesStat]{ColVide}-1}}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\xintFor* ##1 in {\xintSeq {\fpeval{\useKV[ClesStat]{ColVide}+1}}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculAngle{##1}}}}\\\hline}{}% - \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesStat]{ColVide}-1}}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\xintFor* ##1 in {\xintSeq {\fpeval{\useKV[ClesStat]{ColVide}+1}}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculSemiAngle{##1}}}}\\\hline}{}% - \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesStat]{ColVide}-1}}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\xintFor* ##1 in {\xintSeq {\fpeval{\useKV[ClesStat]{ColVide}+1}}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}\\\hline}{}% - }% + \begin{NiceTabular}{c*{\fpeval{\ListeCompletelen+1}}{>{\centering\arraybackslash}p{\useKV[ClesStat]{Largeur}}}}% + \CodeBefore% + \rowcolor{\useKV[ClesStat]{CouleurTab}}{1}% + \columncolor{\useKV[ClesStat]{CouleurTab}}{1}% + \Body% + \the\tabtoksa&Total\\% + \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\the\tabtoksb&\num{\EffectifTotal}}\\% + \ifboolKV[ClesStat]{Frequence}{\stepcounter{PfCCompteLignes}Fr\'equence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\num{\CalculFrequence{##1}}}}}&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{100}}\\}{}% + \ifboolKV[ClesStat]{Angle}{\stepcounter{PfCCompteLignes}Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{360}}\\}{}% + \ifboolKV[ClesStat]{SemiAngle}{\stepcounter{PfCCompteLignes}Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{180}}\\}{}% + \ifboolKV[ClesStat]{ECC}{\stepcounter{PfCCompteLignes}E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\num{\EffectifTotal}}}\\}{}% + \CodeAfter% + % On crée la liste des colonnes à vider + \xintifboolexpr{\useKV[ClesStat]{ColVide}>0}{% + \xdef\FooStat{\useKV[ClesStat]{ColVide}}% + \setsepchar{,}% + \readlist*\ListeColonnesAVider{\FooStat}% + \foreachitem\compteur\in\ListeColonnesAVider{% + \tikz\fill[white] (row-2-|col-\fpeval{\compteur+1}) rectangle (last-|col-\fpeval{\compteur+2});% + }% + }{}% + % On crée la liste des cases à vider + \ifboolKV[ClesStat]{CaseVide}{% + \xdef\FooStatCases{\useKV[ClesStat]{CasesVides}}% + \setsepchar[*]{,*/}% + \readlist*\ListeCasesAVider{\FooStatCases}% + \foreachitem\compteur\in\ListeCasesAVider{% + \tikz\fill[white] (row-\fpeval{\ListeCasesAVider[\compteurcnt,1]+1}-|col-\fpeval{\ListeCasesAVider[\compteurcnt,2]+1}) rectangle (row-\fpeval{\ListeCasesAVider[\compteurcnt,1]+2}-|col-\fpeval{\ListeCasesAVider[\compteurcnt,2]+2});% + }% + }{}% + % On retrace le tableau + %Les colonnes + \xintFor* ##1 in {\xintSeq{1}{\fpeval{\ListeCompletelen+3}}}\do{% + \tikz\draw (row-1-|col-##1) -- (last-|col-##1);% }% + % Les lignes + \xintFor* ##1 in {\xintSeq{1}{\fpeval{\thePfCCompteLignes+3}}}\do{% + \tikz\draw (row-##1-|col-1) -- (row-##1-|last);% }% - \end{tabular} - \renewcommand{\arraystretch}{1}% - \]% -}% - -\def\buildtabt{% %%Tableau avec total - \tabtoksa{\useKV[ClesStat]{Donnee}}\tabtoksb{\useKV[ClesStat]{Effectif}}% - \foreachitem\compteur\in\ListeComplete{\expandafter\updatetoks\compteur\nil}% - \[% + \end{NiceTabular}% + }{% \renewcommand{\arraystretch}{\useKV[ClesStat]{Stretch}}% - \begin{tabular}{|>{\columncolor{\useKV[ClesStat]{CouleurTab}}}c|*{\fpeval{\ListeCompletelen+1}}{>{\centering\arraybackslash}p{\useKV[ClesStat]{Largeur}}|}}% - \hline% - \the\tabtoksa&\cellcolor{\useKV[ClesStat]{CouleurTab}}Total\\\hline% - \xintifboolexpr{\useKV[ClesStat]{ColVide}<1 || \useKV[ClesStat]{ColVide}>\ListeCompletelen}{% - \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}&}{\the\tabtoksb&\ifboolKV[ClesStat]{TotalVide}{}{\num{\EffectifTotal}}}\\\hline% - \ifboolKV[ClesStat]{Frequence}{Fr\'equence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{100}}}\\\hline}{}% - \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{360}}}\\\hline}{}% - \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{180}}}\\\hline}{}% - \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\num{\EffectifTotal}}}}\\\hline}{}% - }{% - \xintifboolexpr{\useKV[ClesStat]{ColVide}==1}{% - \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\useKV[ClesStat]{Effectif}&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ListeComplete[##1,2]}&\ifboolKV[ClesStat]{TotalVide}{}{\num{\EffectifTotal}}}\\\hline% - \ifboolKV[ClesStat]{Frequence}{Fr\'equence (\%)&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{100}}}\\\hline}{}% - \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{360}}}\\\hline}{}% - \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{180}}}\\\hline}{}% - \ifboolKV[ClesStat]{ECC}{E.C.C.&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\num{\EffectifTotal}}}}\\\hline}{}% - }{% - \xintifboolexpr{\useKV[ClesStat]{ColVide}==\ListeCompletelen}{% - \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ListeComplete[##1,2]}&&\ifboolKV[ClesStat]{TotalVide}{}{\num{\EffectifTotal}}}\\\hline% - \ifboolKV[ClesStat]{Frequence}{Fr\'equence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{100}}}\\\hline}{}% - \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{360}}}\\\hline}{}% - \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{180}}}\\\hline}{}% - \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\num{\EffectifTotal}}}}\\\hline}{}% - }{% - \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesStat]{ColVide}-1}}}\do{&\ListeComplete[##1,2]}&\xintFor* ##1 in {\xintSeq {\fpeval{\useKV[ClesStat]{ColVide}+1}}{\ListeCompletelen}}\do{&\ListeComplete[##1,2]}&\ifboolKV[ClesStat]{TotalVide}{}{\num{\EffectifTotal}}}\\\hline% - \ifboolKV[ClesStat]{Frequence}{Fr\'equence (\%)\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesStat]{ColVide}-1}}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\xintFor* ##1 in {\xintSeq {\fpeval{\useKV[ClesStat]{ColVide}+1}}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{100}}}\\\hline}{}% - \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesStat]{ColVide}-1}}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\xintFor* ##1 in {\xintSeq {\fpeval{\useKV[ClesStat]{ColVide}+1}}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{360}}}\\\hline}{}% - \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesStat]{ColVide}-1}}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\xintFor* ##1 in {\xintSeq {\fpeval{\useKV[ClesStat]{ColVide}+1}}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculSemiAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{180}}}\\\hline}{}% - \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesStat]{ColVide}-1}}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\xintFor* ##1 in {\xintSeq {\fpeval{\useKV[ClesStat]{ColVide}+1}}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\num{\EffectifTotal}}}}\\\hline}{}% - }% + \begin{NiceTabular}{c*{\fpeval{\ListeCompletelen}}{>{\centering\arraybackslash}p{\useKV[ClesStat]{Largeur}}}}% + \CodeBefore% + \rowcolor{\useKV[ClesStat]{CouleurTab}}{1}% + \columncolor{\useKV[ClesStat]{CouleurTab}}{1}% + \Body% + \the\tabtoksa\\% + \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\the\tabtoksb}\\% + \ifboolKV[ClesStat]{Frequence}{\stepcounter{PfCCompteLignes}Fr\'equence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\num{\CalculFrequence{##1}}}}}\\}{}% + \ifboolKV[ClesStat]{Angle}{\stepcounter{PfCCompteLignes}Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}\\}{}% + \ifboolKV[ClesStat]{SemiAngle}{\stepcounter{PfCCompteLignes}Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}\\}{}% + \ifboolKV[ClesStat]{ECC}{\stepcounter{PfCCompteLignes}E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}\\}{}% + \CodeAfter% + % On crée la liste des colonnes à vider + \xintifboolexpr{\useKV[ClesStat]{ColVide}>0}{% + \xdef\FooStat{\useKV[ClesStat]{ColVide}}% + \setsepchar{,}% + \readlist*\ListeColonnesAVider{\FooStat}% + \foreachitem\compteur\in\ListeColonnesAVider{% + \tikz\fill[white] (row-2-|col-\fpeval{\compteur+1}) rectangle (last-|col-\fpeval{\compteur+2});% + }% + }{}% + % On crée la liste des cases à vider + \ifboolKV[ClesStat]{CaseVide}{% + \xdef\FooStatCases{\useKV[ClesStat]{CasesVides}}% + \setsepchar[*]{,*/}% + \readlist*\ListeCasesAVider{\FooStatCases}% + \foreachitem\compteur\in\ListeCasesAVider{% + \tikz\fill[white] (row-\fpeval{\ListeCasesAVider[\compteurcnt,1]+1}-|col-\fpeval{\ListeCasesAVider[\compteurcnt,2]+1}) rectangle (row-\fpeval{\ListeCasesAVider[\compteurcnt,1]+2}-|col-\fpeval{\ListeCasesAVider[\compteurcnt,2]+2});% + }% + }{}% + % On retrace le tableau + %Les colonnes + \xintFor* ##1 in {\xintSeq{1}{\fpeval{\ListeCompletelen+2}}}\do{% + \tikz\draw (row-1-|col-##1) -- (last-|col-##1);% }% + % Les lignes + \xintFor* ##1 in {\xintSeq{1}{\fpeval{\thePfCCompteLignes+3}}}\do{% + \tikz\draw (row-##1-|col-1) -- (row-##1-|last);% }% - \end{tabular} - \renewcommand{\arraystretch}{1}% - \]% + \end{NiceTabular}% + }% }% % Pour construire le diagramme en barres horizontales @@ -10269,7 +10716,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \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}\]% + \[\NewMPDiagBarreHor{\the\toklistenomhor}{\the\toklistedonhor}{\the\toklisteaffhor}{\the\toklistecouleur}\]% }% % Pour construire le diagramme en bâtons @@ -10277,7 +10724,11 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \newcommand\buildgraph[1][]{% \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}}\]% + \newtoks\toklistecouleur% + \xdef\ListeAvantCouleurs{\useKV[ClesStat]{ListeCouleursB}}% + \readlist*\ListeCouleur{\ListeAvantCouleurs}% + \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}% + \[\MPStatNew{\the\toklistepoint}{\the\toklistecouleur}\]% }% % Pour construire le diagramme en bâtons qualitatif @@ -10285,56 +10736,38 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \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\toklistecouleur% + \xdef\ListeAvantCouleurs{\useKV[ClesStat]{ListeCouleursB}}% + \readlist*\ListeCouleur{\ListeAvantCouleurs}% + \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}% + \[\MPStatNew{\the\toklistepointq}{\the\toklistecouleur}\]% }% \def\UpdateCoul#1\nil{\addtotok\toklistecouleur{#1,}}% +\def\UpdateLegende#1\nil{\addtotok\toklistelegende{#1,}}% % Pour construire le diagramme circulaire qualitatif \def\buildgraphcq#1{% - \newtoks\toklistepointq% - \toklistepointq{}% - \newtoks\toklistecouleur% - \toklistecouleur{}% + \newtoks\toklistepointq\toklistepointq{}% + \newtoks\toklistecouleur\toklistecouleur{}% + \newtoks\toklistelegende\toklistelegende{}% + \ifboolKV[ClesStat]{LegendeVide}{% + \xdef\foo{\useKV[ClesStat]{LegendesVides}}% + \readlist*\ListeLegendesAEffacer{\foo}% + }{\xdef\foo{0}\readlist*\ListeLegendesAEffacer{\foo}% + }% + \foreachitem\compteur\in\ListeLegendesAEffacer{\expandafter\UpdateLegende\compteur\nil}% % \foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoksq\compteur\nil}% \xdef\ListeAvantCouleurs{\useKV[ClesStat]{ListeCouleurs}}% \readlist*\ListeCouleur{\ListeAvantCouleurs}% \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}% - \ifboolKV[ClesStat]{AffichageAngle}{% - \ifboolKV[ClesStat]{Hachures}{% - \ifboolKV[ClesStat]{Inverse}{% - \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{1}{\the\toklistecouleur}{1}{1}\]% - }{% - \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{1}{\the\toklistecouleur}{1}{0}\]% - }% - }{% - \ifboolKV[ClesStat]{Inverse}{% - \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{1}{\the\toklistecouleur}{0}{1}\]% - }{% - \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{1}{\the\toklistecouleur}{0}{0}\]% - }% - }% - }{% - \ifboolKV[ClesStat]{Hachures}{% - \ifboolKV[ClesStat]{Inverse}{% - \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{0}{\the\toklistecouleur}{1}{1}\]% - }{% - \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{0}{\the\toklistecouleur}{1}{0}\]% - }% - }{% - \ifboolKV[ClesStat]{Inverse}{% - \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{0}{\the\toklistecouleur}{0}{1}\]% - }{% - \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{0}{\the\toklistecouleur}{0}{0}\]% - }% - }% - }% + \NewMPStatCirculaireQ{\the\toklistepointq}{#1}{\the\toklistecouleur}{\the\toklistelegende}% }% %% calcul des fr\'equences \newcommand\CalculFrequence[1]{% - \fpeval{round(\ListeComplete[#1,2]*100/\EffectifTotal,0)} + \fpeval{round(\ListeComplete[#1,2]*100/\EffectifTotal,\useKV[ClesStat]{PrecisionF})} } %% calcul des angles @@ -10361,10 +10794,11 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O } % Construction d'un diagramme en barres horizontal -\newcommand\MPDiagBarreHor[4]{% +\newcommand\NewMPDiagBarreHor[4]{% % #1 Liste des noms % #2 Liste des valeurs associées % #3 Liste des valeurs à afficher (si pb calcul MP) + % #4 Liste des couleurs \ifluatex \mplibforcehmode% \begin{mplibcode}% @@ -10374,6 +10808,8 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures}; boolean Hachures; Hachures=\useKV[ClesStat]{Hachures}; + boolean Bicolore; + Bicolore=\useKV[ClesStat]{Bicolore}; vardef CalculNombreDonneesEtDonneeMax(text t)= nbdon:=0;%nombre de données DonneeMax:=0;%donnée DonneeMaximale @@ -10408,7 +10844,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O (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; + remplis RectangleDonnee withcolor if unknown Col[k+1]: if Bicolore:Col[(k mod 2)+1] else: white fi; else:if Bicolore:Col[(k mod 2)+1] else: Col[k+1] fi; fi; fi; trace RectangleDonnee; endfor; @@ -10435,11 +10871,16 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O 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) + \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}; + boolean Bicolore; + Bicolore=\useKV[ClesStat]{Bicolore}; + }] vardef CalculNombreDonneesEtDonneeMax(text t)= nbdon:=0;%nombre de données DonneeMax:=0;%donnée DonneeMaximale @@ -10474,7 +10915,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O (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; + remplis RectangleDonnee withcolor if unknown Col[k+1]: if Bicolore:Col[(k mod 2)+1] else: white fi; else:if Bicolore:Col[(k mod 2)+1] else: Col[k+1] fi; fi; fi; trace RectangleDonnee; endfor; @@ -10500,43 +10941,142 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O AffichageNom(#1); AffichageDonnees(#3); \end{mpost} - \fi + \fi }% % la construction du graphique en bâtons pour quantitatif -\newcommand\MPStat[8][]{% +\newcommand\MPStatNew[2]{% \ifluatex - \mplibforcehmode + \mplibforcehmode \begin{mplibcode} maxx:=0; maxy:=0; - unitex:=#2*cm; - unitey:=#3*cm; + unitex:=\useKV[ClesStat]{Unitex}*cm; + unitey:=\useKV[ClesStat]{Unitey}*cm; + xpartorigine:=\useKV[ClesStat]{Origine}; + AngleRotation=\useKV[ClesStat]{AngleRotationAbscisse}; + boolean Rotation; + Rotation=\useKV[ClesStat]{AbscisseRotation}; + boolean Lecture; + Lecture:=\useKV[ClesStat]{Lecture}; + boolean LectureFine; + LectureFine:=\useKV[ClesStat]{LectureFine}; + boolean AideLecture; + AideLecture:=\useKV[ClesStat]{AideLecture}; + boolean DonneesSup; + DonneesSup:=\useKV[ClesStat]{DonneesSup}; + boolean Reponses; + Reponses:=\useKV[ClesStat]{Reponses}; + epaisseurbatons=\useKV[ClesStat]{EpaisseurBatons}; + boolean Qualitatif; + Qualitatif=\useKV[ClesStat]{Qualitatif}; + boolean Tiret; + Tiret=\useKV[ClesStat]{Tiret}; + % on r\'ecup\`ere les couleurs + color Col[]; + n:=0; + for p_=#2: + n:=n+1; + if color p_: + Col[n]=p_; + else: + Col[n]=black; + fi; + endfor; + % pair A[],B[],P[]; + vardef toto(text t)=%points quantitatif n:=0; - vardef toto(text t)= for p_=t: if pair p_: n:=n+1; - P[n]=((xpart(p_)-(#7))*unitex,ypart(p_)*unitey); + P[n]=((xpart(p_)-(xpartorigine))*unitex,ypart(p_)*unitey); if xpart(p_)>maxx: - maxx:=xpart(p_)-(#7); + maxx:=xpart(p_)-(xpartorigine); fi; if ypart(p_)>maxy: maxy:=ypart(p_); fi; - A[n]=unitex*(xpart(p_)-(#7),0); + A[n]=unitex*(xpart(p_)-(xpartorigine),0); B[n]=unitey*(0,ypart(p_)); - if (#8): - label.bot(TEX("\num{"&decimal(xpart(p_))&"}") rotated 90,A[n]); + fi; + endfor; + enddef; + vardef tata(text t)=%affichage quantitatif + l=0; + for p_=t: + if pair p_: + l:=l+1; + if Rotation: + label.bot(TEX("\num{"&decimal(xpart(p_))&"}") rotated AngleRotation,A[l]); else : - label.bot(TEX("\num{"&decimal(xpart(p_))&"}"),A[n]); + label.bot(TEX("\num{"&decimal(xpart(p_))&"}"),A[l]); + fi; + if Reponses: + if DonneesSup: + label.top(TEX("\num{"&decimal(ypart(p_))&"}"),P[l]); + else: + if Tiret: + trace (B[l]+(-1pt,0))--(B[l]+(1pt,0)); + label.lft(TEX("\num{"&decimal(p_)&"}"),B[l]); + else: + dotlabel.lft(TEX("\num{"&decimal(ypart(p_))&"}"),B[l]); + fi; fi; - label.lft(TEX("\num{"&decimal(ypart(p_))&"}"),B[n]); fi; endfor; enddef; - toto(#4); + vardef tutu(text t)=%points qualitatif + n:=0; + for p_=t: + if numeric p_: + P[n]=((n)*unitex,unitey*p_); + B[n]=(0,unitey*p_); + if p_>maxy: + maxy:=p_; + fi; + else: + n:=n+1; + A[n]=unitex*(n,0); + fi; + endfor; + maxx:=n; + enddef; + vardef titi(text t)=%affichage qualitatif + l:=0; + for p_=t: + if numeric p_: + if Reponses: + if DonneesSup: + label.top(TEX("\num{"&decimal(p_)&"}"),P[l]); + else: + if Tiret: + trace (B[l]+(-1pt,0))--(B[l]+(1pt,0)); + label.lft(TEX("\num{"&decimal(p_)&"}"),B[l]); + else: + dotlabel.lft(TEX("\num{"&decimal(p_)&"}"),B[l]); + fi; + fi; + fi; + else: + l:=l+1; + if Rotation: + if AngleRotation<>0: + picture TEXTELABEL; + TEXTELABEL=image( + labeloffset:=labeloffset*2; + label.lft(TEX(p_),A[l]); + labeloffset:=labeloffset/2; + ); + trace rotation(TEXTELABEL,A[l],AngleRotation); + else : + label.bot(TEX(p_),A[l]); + fi; + fi; + fi; + endfor; + enddef; + if Qualitatif: tutu(#1); else: toto(#1); fi; boolean Grille; Grille:=\useKV[ClesStat]{Grille}; Pasx:=\useKV[ClesStat]{Pasx}; @@ -10544,192 +11084,249 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O if Grille: drawoptions(withcolor 0.75white); for k=0 step Pasx until ((maxx+1)): - trace (k*unitex,0)--(k*unitex,unitey*(maxy+1)); + trace (k*unitex,0)--(k*unitex,unitey*(maxy+2*Pasy)); endfor; - for k=0 step Pasy until ((maxy+1)): + for k=0 step Pasy until ((maxy+2*Pasy)): trace (0,k*unitey)--(unitex*(maxx+1),k*unitey); endfor; drawoptions(); fi; for k=1 upto n: - draw A[k]--P[k] withpen pencircle scaled 2bp; + fill polygone(A[k]-(epaisseurbatons*1pt,0),A[k]+(epaisseurbatons*1pt,0),P[k]+(epaisseurbatons*1pt,0),P[k]-(epaisseurbatons*1pt,0)) withcolor if unknown Col[k]: black else:Col[k] fi; + if AideLecture: draw B[k]--P[k] dashed evenly; + fi; + endfor; + if LectureFine: + for k=0 step Pasy until ((maxy+1*Pasy)): + if Tiret: + trace (1pt,k*unitey)--(-1pt,k*unitey); + label.lft(TEX("\num{"&decimal(k)&"}"),(0,k*unitey)); + else: + dotlabel.lft(TEX("\num{"&decimal(k)&"}"),(0,k*unitey)); + fi; endfor; + fi; + if Lecture: + for k=0 step Pasy until Pasy: + if Tiret: + trace (1pt,k*unitey)--(-1pt,k*unitey); + label.lft(TEX("\num{"&decimal(k)&"}"),(0,k*unitey)); + else: + dotlabel.lft(TEX("\num{"&decimal(k)&"}"),(0,k*unitey)); + fi; + endfor; + fi; drawarrow (0,0)--unitex*(maxx+1,0); - drawarrow (0,0)--unitey*(0,maxy+1); - label.lrt(btex #5 etex,unitex*(maxx+1,0)); - label.urt(btex #6 etex,unitey*(0,maxy+1)); + drawarrow (0,0)--unitey*(0,maxy+2*Pasy); + label.lrt(btex \useKV[ClesStat]{Donnee} etex,unitex*(maxx+1,0)); + label.urt(btex \useKV[ClesStat]{Effectif} etex,unitey*(0,maxy+2*Pasy)); + if Qualitatif: titi(#1); else:tata(#1); fi; \end{mplibcode} \else - \mpxcommands{% - \setKV[ClesStat]{#1}% - } - \begin{mpost}[mpsettings={boolean Grille; Grille:=\useKV[ClesStat]{Grille}; Pasx:=\useKV[ClesStat]{Pasx}; Pasy:=\useKV[ClesStat]{Pasy};}] - maxx:=0; - maxy:=0; - unitex:=#2*cm; - unitey:=#3*cm; + \begin{mpost}[mpsettings={% + unitex:=\useKV[ClesStat]{Unitex}*cm; + unitey:=\useKV[ClesStat]{Unitey}*cm; + xpartorigine:=\useKV[ClesStat]{Origine}; + AngleRotation=\useKV[ClesStat]{AngleRotationAbscisse}; + boolean Rotation; + Rotation=\useKV[ClesStat]{AbscisseRotation}; + boolean Lecture; + Lecture:=\useKV[ClesStat]{Lecture}; + boolean LectureFine; + LectureFine:=\useKV[ClesStat]{LectureFine}; + boolean AideLecture; + AideLecture:=\useKV[ClesStat]{AideLecture}; + boolean DonneesSup; + DonneesSup:=\useKV[ClesStat]{DonneesSup}; + boolean Reponses; + Reponses:=\useKV[ClesStat]{Reponses}; + epaisseurbatons=\useKV[ClesStat]{EpaisseurBatons}; + boolean Qualitatif; + Qualitatif=\useKV[ClesStat]{Qualitatif}; + boolean Tiret; + Tiret=\useKV[ClesStat]{Tiret};} + ] + % on r\'ecup\`ere les couleurs + color Col[]; + n:=0; + for p_=#2: + n:=n+1; + if color p_: + Col[n]=p_; + else: + Col[n]=black; + fi; + endfor; + % pair A[],B[],P[]; + vardef toto(text t)=%points quantitatif n:=0; - vardef toto(text t)= for p_=t: if pair p_: n:=n+1; - P[n]=((xpart(p_)-(#7))*unitex,ypart(p_)*unitey); + P[n]=((xpart(p_)-(xpartorigine))*unitex,ypart(p_)*unitey); if xpart(p_)>maxx: - maxx:=xpart(p_)-(#7); + maxx:=xpart(p_)-(xpartorigine); fi; if ypart(p_)>maxy: maxy:=ypart(p_); fi; - A[n]=unitex*(xpart(p_)-(#7),0); + A[n]=unitex*(xpart(p_)-(xpartorigine),0); B[n]=unitey*(0,ypart(p_)); - if (#8): - label.bot(LATEX("\num{"&decimal(xpart(p_))&"}") rotated 90,A[n]); - else : - label.bot(LATEX("\num{"&decimal(xpart(p_))&"}"),A[n]); - fi; - label.lft(LATEX("\num{"&decimal(ypart(p_))&"}"),B[n]); fi; endfor; enddef; - toto(#4); - if Grille: - drawoptions(withcolor 0.75white); - for k=0 step Pasx until ((maxx+1)): - trace (k*unitex,0)--(k*unitex,unitey*(maxy+1)); - endfor; - for k=0 step Pasy until ((maxy+1)): - trace (0,k*unitey)--(unitex*(maxx+1),k*unitey); - endfor; - drawoptions(); + vardef tata(text t)=%affichage quantitatif + l=0; + for p_=t: + if pair p_: + l:=l+1; + if Rotation: + label.bot(TEX("\num{"&decimal(xpart(p_))&"}") rotated AngleRotation,A[l]); + else : + label.bot(TEX("\num{"&decimal(xpart(p_))&"}"),A[l]); + fi; + if Reponses: + if DonneesSup: + label.top(TEX("\num{"&decimal(ypart(p_))&"}"),P[l]); + else: + if Tiret: + trace (B[l]+(-1pt,0))--(B[l]+(1pt,0)); + label.lft(TEX("\num{"&decimal(p_)&"}"),B[l]); + else: + dotlabel.lft(TEX("\num{"&decimal(ypart(p_))&"}"),B[l]); + fi; + fi; fi; - for k=1 upto n: - draw A[k]--P[k] withpen pencircle scaled 2bp; - draw B[k]--P[k] dashed evenly; endfor; - drawarrow (0,0)--unitex*(maxx+1,0); - drawarrow (0,0)--unitey*(0,maxy+1); - label.lrt(\btex \useKV[ClesStat]{Donnee} etex,unitex*(maxx+1,0)); - label.urt(\btex \useKV[ClesStat]{Effectif} etex,unitey*(0,maxy+1)); - \end{mpost} - \fi -} - -% la construction du graphique en bâtons pour qualitatif -\newcommand\MPStatQ[8][]{% - \ifluatex - \mplibforcehmode - \begin{mplibcode} - maxy:=0; - unitex:=#2*cm; - unitey:=#3*cm; - pair A[],B[],P[]; + enddef; + vardef tutu(text t)=%points qualitatif n:=0; - vardef toto(text t)= for p_=t: if numeric p_: - P[n]=((n+1)*unitex,unitey*p_); + P[n]=((n)*unitex,unitey*p_); B[n]=(0,unitey*p_); - label.lft(TEX("\num{"&decimal(p_)&"}"),B[n]); if p_>maxy: maxy:=p_; fi; + else: n:=n+1; + A[n]=unitex*(n,0); + fi; + endfor; + maxx:=n; + enddef; + vardef titi(text t)=%affichage qualitatif + l:=0; + for p_=t: + if numeric p_: + if Reponses: + if DonneesSup: + label.top(TEX("\num{"&decimal(p_)&"}"),P[l]); + else: + if Tiret: + trace (B[l]+(-1pt,0))--(B[l]+(1pt,0)); + label.lft(TEX("\num{"&decimal(p_)&"}"),B[l]); else: - A[n]=unitex*(n+1,0); - if (#8): - label.bot(TEX(p_) rotated 90,A[n]); + dotlabel.lft(TEX("\num{"&decimal(p_)&"}"),B[l]); + fi; + fi; + fi; + else: + l:=l+1; + if Rotation: + if AngleRotation<>0: + picture TEXTELABEL; + TEXTELABEL=image( + labeloffset:=labeloffset*2; + label.lft(TEX(p_),A[l]); + labeloffset:=labeloffset/2; + ); + trace rotation(TEXTELABEL,A[l],AngleRotation); else : - label.bot(TEX(p_),A[n]); + label.bot(TEX(p_),A[l]); + fi; fi; fi; endfor; enddef; - toto(#4); + if Qualitatif: tutu(#1); else: toto(#1); fi; boolean Grille; Grille:=\useKV[ClesStat]{Grille}; Pasx:=\useKV[ClesStat]{Pasx}; Pasy:=\useKV[ClesStat]{Pasy}; if Grille: drawoptions(withcolor 0.75white); - for k=0 step Pasx until ((n+1)): - trace (k*unitex,0)--(k*unitex,unitey*(maxy+1)); + for k=0 step Pasx until ((maxx+1)): + trace (k*unitex,0)--(k*unitex,unitey*(maxy+2*Pasy)); endfor; - for k=0 step Pasy until ((maxy+1)): - trace (0,k*unitey)--(unitex*(n+1),k*unitey); + for k=0 step Pasy until ((maxy+2*Pasy)): + trace (0,k*unitey)--(unitex*(maxx+1),k*unitey); endfor; drawoptions(); fi; - for k=0 upto n-1: - draw A[k]--P[k] withpen pencircle scaled 2bp; + for k=1 upto n: + fill polygone(A[k]-(epaisseurbatons*1pt,0),A[k]+(epaisseurbatons*1pt,0),P[k]+(epaisseurbatons*1pt,0),P[k]-(epaisseurbatons*1pt,0)) withcolor if unknown Col[k]: black else:Col[k] fi; + if AideLecture: draw B[k]--P[k] dashed evenly; - endfor; - drawarrow (0,0)--unitex*(n+1,0); - drawarrow (0,0)--unitey*(0,maxy+1); - label.lrt(btex #5 etex,unitex*(n+1,0)); - label.urt(btex #6 etex,unitey*(0,maxy+1)); - \end{mplibcode} - \else - \mpxcommands{% - \setKV[ClesStat]{#1}% - } - \begin{mpost}[mpsettings={boolean Grille; Grille:=\useKV[ClesStat]{Grille}; Pasx:=\useKV[ClesStat]{Pasx}; Pasy:=\useKV[ClesStat]{Pasy};}] - maxy:=0; - unitex:=#2*cm; - unitey:=#3*cm; - pair A[],B[],P[]; - n:=0; - vardef toto(text t)= - for p_=t: - if numeric p_: - P[n]=((n+1)*unitex,unitey*p_); - B[n]=(0,unitey*p_); - label.lft(LATEX("\num{"&decimal(p_)&"}"),B[n]); - if p_>maxy: - maxy:=p_; fi; - n:=n+1; + endfor; + if LectureFine: + for k=0 step Pasy until ((maxy+1*Pasy)): + if Tiret: + trace (1pt,k*unitey)--(-1pt,k*unitey); + label.lft(TEX("\num{"&decimal(k)&"}"),(0,k*unitey)); else: - A[n]=unitex*(n+1,0); - if (#8): - label.bot(LATEX(p_) rotated 90,A[n]); - else : - label.bot(LATEX(p_),A[n]); - fi; + dotlabel.lft(TEX("\num{"&decimal(k)&"}"),(0,k*unitey)); fi; endfor; - enddef; - toto(#4); - if Grille: - drawoptions(withcolor 0.75white); - for k=0 step Pasx until ((n+1)): - trace (k*unitex,0)--(k*unitex,unitey*(maxy+1)); - endfor; - for k=0 step Pasy until ((maxy+1)): - trace (0,k*unitey)--(unitex*(n+1),k*unitey); - endfor; - drawoptions(); fi; - for k=0 upto n-1: - draw A[k]--P[k] withpen pencircle scaled 2bp; - draw B[k]--P[k] dashed evenly; + if Lecture: + for k=0 step Pasy until Pasy: + if Tiret: + trace (1pt,k*unitey)--(-1pt,k*unitey); + label.lft(TEX("\num{"&decimal(k)&"}"),(0,k*unitey)); + else: + dotlabel.lft(TEX("\num{"&decimal(k)&"}"),(0,k*unitey)); + fi; endfor; - drawarrow (0,0)--unitex*(n+1,0); - drawarrow (0,0)--unitey*(0,maxy+1); - label.lrt(\btex \useKV[ClesStat]{Donnee} etex,unitex*(n+1,0)); - label.urt(\btex \useKV[ClesStat]{Effectif} etex,unitey*(0,maxy+1)); + fi; + drawarrow (0,0)--unitex*(maxx+1,0); + drawarrow (0,0)--unitey*(0,maxy+2*Pasy); + label.lrt(btex \useKV[ClesStat]{Donnee} etex,unitex*(maxx+1,0)); + label.urt(btex \useKV[ClesStat]{Effectif} etex,unitey*(0,maxy+2*Pasy)); + if Qualitatif: titi(#1); else:tata(#1); fi; \end{mpost} \fi } % la construction du graphique qualitatif -\def\MPStatCirculaireQ#1#2#3#4#5#6#7{% +\def\NewMPStatCirculaireQ#1#2#3#4{% + %#1 : la liste des données + %#2 : 360 ou 180 + %#3 : liste des couleurs + %#4 : liste des légendes à effacer. \ifluatex \mplibforcehmode \begin{mplibcode} + Rayon:=\useKV[ClesStat]{Rayon}; ecarthachures=\useKV[ClesStat]{EcartHachures}; epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures}; + boolean AffichageAngle; + AffichageAngle=\useKV[ClesStat]{AffichageAngle}; + boolean AffichageDonnee; + AffichageDonnee=\useKV[ClesStat]{AffichageDonnee}; + boolean Hachures; + Hachures=\useKV[ClesStat]{Hachures}; + boolean Inverse; + Inverse=\useKV[ClesStat]{LectureInverse}; + boolean Legende; + Legende=\useKV[ClesStat]{Legende}; + boolean LegendeVide; + LegendeVide=\useKV[ClesStat]{LegendeVide}; + boolean Retour; + Retour=false; pair A[],O,B[],C[],D[]; O=(0,0); n:=0; @@ -10737,15 +11334,15 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O total[0]=0; ang[0]:=0; path cc; - cc=(fullcircle scaled (2*#1)); + cc=(fullcircle scaled (2*Rayon)); % on r\'ecup\`ere les couleurs color Col[]; n:=0; - for p_=#5: + for p_=#3: n:=n+1; Col[n]=p_; endfor; - if #7=0: + if Inverse=false: A[0]=point(0) of cc; else: A[0]=point(180) of cc; @@ -10760,101 +11357,159 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O endfor; N=n; for k=1 upto N: - ang[k]=(#3/total[N])*total[k]; + ang[k]=(#2/total[N])*total[k]; endfor; n:=0; for p_=t: if numeric p_: n:=n+1; - if #7=0: - A[n]=A[n-1] rotatedabout(O,p_*(#3/total[N])); + if Inverse=false: + A[n]=A[n-1] rotatedabout(O,p_*(#2/total[N])); else: - A[n]=A[n-1] rotatedabout(O,-p_*(#3/total[N])); + A[n]=A[n-1] rotatedabout(O,-p_*(#2/total[N])); fi; %hachure ou pas ? - if #6=0: - fill (O--if #7=0:arccercle(A[n-1],A[n],O) else: + if Hachures=false: + fill (O--if Inverse=false:arccercle(A[n-1],A[n],O) else: 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) - else:arccercle(A[n],A[n-1],O) fi--cycle),p_*(#3/total[N]) if + Hachurage((O--if Inverse=false:arccercle(A[n-1],A[n],O) + else:arccercle(A[n],A[n-1],O) fi--cycle),p_*(#2/total[N]) if (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; + withpen pencircle scaled epaisseurhachures if AffichageAngle: withcolor 0.5white fi; fi; - draw A[n-1]--O--A[n] if #6=1: withpen pencircle scaled2 fi; + draw A[n-1]--O--A[n] if Hachures: withpen pencircle scaled2 fi; % Affichage des angles associ\'es - if #4=1: - if round(p_*(#3/total[N]))>15: + if AffichageAngle: + if round(p_*(#2/total[N]))>15: if (n mod 2)=0: - marque_a:=20*0.75*#1/cm; + marque_a:=20*0.75*Rayon/cm; else: - marque_a:=20*0.5*#1/cm; + marque_a:=20*0.5*Rayon/cm; fi; - if #6=1: - if #7=0: + if Hachures: + if Inverse=false: + undraw + Codeangle(A[n-1],O,A[n],0,(((TEX("\ang{"&decimal(round(p_*(#2/total[N])))&"}"))))); + else: + undraw + Codeangle(A[n],O,A[n-1],0,(((TEX("\ang{"&decimal(round(p_*(#2/total[N])))&"}"))))); + fi; + fill cercles(w shifted(marque_ang*unitvector(w-O)),3mm) withcolor + blanc; + fi; + if Inverse=false: + draw + Codeangle(A[n-1],O,A[n],0,(((TEX("\ang{"&decimal(round(p_*(#2/total[N])))&"}"))))); + else: + draw + Codeangle(A[n],O,A[n-1],0,(((TEX("\ang{"&decimal(round(p_*(#2/total[N])))&"}"))))); + fi; + fi; + elseif AffichageDonnee: + if round(p_*(#2/total[N]))>15: + if (n mod 2)=0: + marque_a:=20*0.75*Rayon/cm; + else: + marque_a:=20*0.5*Rayon/cm; + fi; + if Hachures: + if Inverse=false: undraw - Codeangle(A[n-1],O,A[n],0,(((TEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}"))))); + Codeangle(A[n-1],O,A[n],0,TEX(""&decimal(p_)&"")); else: undraw - Codeangle(A[n],O,A[n-1],0,(((TEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}"))))); + Codeangle(A[n],O,A[n-1],0,(((TEX(""&decimal(p_)&""))))); fi; fill cercles(w shifted(marque_ang*unitvector(w-O)),3mm) withcolor blanc; fi; - if #7=0: + if Inverse=false: draw - Codeangle(A[n-1],O,A[n],0,(((TEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}"))))); + Codeangle(A[n-1],O,A[n],0,(((TEX(""&decimal(p_)&""))))); else: draw - Codeangle(A[n],O,A[n-1],0,(((TEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}"))))); + Codeangle(A[n],O,A[n-1],0,(((TEX(""&decimal(p_)&""))))); fi; fi; fi; % fi; endfor; - if #3=360: - draw cc if #6=1: withpen pencircle scaled2 fi; + if #2=360: + draw cc if Hachures: withpen pencircle scaled2 fi; else: - draw (subpath(0,length cc/2) of cc)--cycle if #6=1: withpen pencircle scaled2 fi;; + draw (subpath(0,length cc/2) of cc)--cycle if Hachures: withpen pencircle scaled2 fi;; fi; n:=0; - path cd[]; + if Legende: for p_=t: if string p_: n:=n+1; - C[n]=A[n-1] rotatedabout(O,if #7=1:-1* fi(ang[n]-ang[n-1])/2); + C[n]=A[n-1] rotatedabout(O,if Inverse:-1* fi(ang[n]-ang[n-1])/2); draw 0.95[O,C[n]]--1.05[O,C[n]]; C[n]:=1.05[O,C[n]]; + Test(n); if (xpart(C[n])>xpart(O)) and (ypart(C[n])>ypart(O)): D[n]=C[n]+(0.5cm,0); draw C[n]--D[n]; - label.urt(TEX(p_),D[n]); + if Retour=false:label.urt(TEX(p_),D[n]);fi; fi; if (xpart(C[n])<xpart(O)) and (ypart(C[n])>ypart(O)): D[n]=C[n]-(0.5cm,0); draw C[n]--D[n]; - label.ulft(TEX(p_),D[n]); + if Retour=false:label.ulft(TEX(p_),D[n]);fi; fi; if (xpart(C[n])<xpart(O)) and (ypart(C[n])<ypart(O)): D[n]=C[n]-(0.5cm,0); draw C[n]--D[n]; - label.llft(TEX(p_),D[n]); + if Retour=false:label.llft(TEX(p_),D[n]);fi; fi; if (xpart(C[n])>xpart(O)) and (ypart(C[n])<ypart(O)): D[n]=C[n]+(0.5cm,0); draw C[n]--D[n]; - label.lrt(TEX(p_),D[n]); + if Retour=false:label.lrt(TEX(p_),D[n]);fi; fi; fi; endfor; + fi; enddef; + vardef Test(expr nb)= + Retour:=false; + op:=0; + for l_=#4: + if l_=nb: + op:=op+1; + fi; + endfor; + if op>0: + Retour:=true; + fi; + enddef; Figure(-10u,-10u,10u,10u); - toto(#2); + toto(#1); \end{mplibcode} \else - \begin{mpost}[mpsettings={ecarthachures=\useKV[ClesStat]{EcartHachures};epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures};}] + \begin{mpost}[mpsettings={% + Rayon:=\useKV[ClesStat]{Rayon}; + ecarthachures=\useKV[ClesStat]{EcartHachures}; + epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures}; + boolean AffichageAngle; + AffichageAngle=\useKV[ClesStat]{AffichageAngle}; + boolean AffichageDonnee; + AffichageDonnee=\useKV[ClesStat]{AffichageDonnee}; + boolean Hachures; + Hachures=\useKV[ClesStat]{Hachures}; + boolean Inverse; + Inverse=\useKV[ClesStat]{LectureInverse}; + boolean Legende; + Legende=\useKV[ClesStat]{Legende}; + boolean LegendeVide; + LegendeVide=\useKV[ClesStat]{LegendeVide}; + }] + boolean Retour; + Retour=false; pair A[],O,B[],C[],D[]; O=(0,0); n:=0; @@ -10862,15 +11517,15 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O total[0]=0; ang[0]:=0; path cc; - cc=(fullcircle scaled (2*#1)); + cc=(fullcircle scaled (2*Rayon)); % on r\'ecup\`ere les couleurs color Col[]; n:=0; - for p_=#5: + for p_=#3: n:=n+1; Col[n]=p_; endfor; - if #7=0: + if Inverse=false: A[0]=point(0) of cc; else: A[0]=point(180) of cc; @@ -10885,73 +11540,101 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O endfor; N=n; for k=1 upto N: - ang[k]=(#3/total[N])*total[k]; + ang[k]=(#2/total[N])*total[k]; endfor; n:=0; for p_=t: if numeric p_: n:=n+1; - if #7=0: - A[n]=A[n-1] rotatedabout(O,p_*(#3/total[N])); + if Inverse=false: + A[n]=A[n-1] rotatedabout(O,p_*(#2/total[N])); else: - A[n]=A[n-1] rotatedabout(O,-p_*(#3/total[N])); + A[n]=A[n-1] rotatedabout(O,-p_*(#2/total[N])); fi; %hachure ou pas ? - if #6=0: - fill (O--if #7=0:arccercle(A[n-1],A[n],O) else: + if Hachures=false: + fill (O--if Inverse=false:arccercle(A[n-1],A[n],O) else: 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) - else:arccercle(A[n],A[n-1],O) fi--cycle),p_*(#3/total[N]) if + Hachurage((O--if Inverse=false:arccercle(A[n-1],A[n],O) + else:arccercle(A[n],A[n-1],O) fi--cycle),p_*(#2/total[N]) if (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; + withpen pencircle scaled epaisseurhachures if AffichageAngle: withcolor 0.5white fi; fi; - draw A[n-1]--O--A[n] if #6=1: withpen pencircle scaled2 fi; + draw A[n-1]--O--A[n] if Hachures: withpen pencircle scaled2 fi; % Affichage des angles associ\'es - if #4=1: - if round(p_*(#3/total[N]))>15: + if AffichageAngle: + if round(p_*(#2/total[N]))>15: if (n mod 2)=0: - marque_a:=20*0.75*#1/cm; + marque_a:=20*0.75*Rayon/cm; else: - marque_a:=20*0.5*#1/cm; + marque_a:=20*0.5*Rayon/cm; fi; - if #6=1: - if #7=0: + if Hachures: + if Inverse=false: undraw - Codeangle(A[n-1],O,A[n],0,(((LATEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}"))))); + Codeangle(A[n-1],O,A[n],0,(((LATEX("\ang{"&decimal(round(p_*(#2/total[N])))&"}"))))); else: undraw - Codeangle(A[n],O,A[n-1],0,(((LATEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}"))))); + Codeangle(A[n],O,A[n-1],0,(((LATEX("\ang{"&decimal(round(p_*(#2/total[N])))&"}"))))); fi; fill cercles(w shifted(marque_ang*unitvector(w-O)),3mm) withcolor blanc; fi; - if #7=0: + if Inverse=false: draw - Codeangle(A[n-1],O,A[n],0,(((LATEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}"))))); + Codeangle(A[n-1],O,A[n],0,(((LATEX("\ang{"&decimal(round(p_*(#2/total[N])))&"}"))))); else: draw - Codeangle(A[n],O,A[n-1],0,(((LATEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}"))))); + Codeangle(A[n],O,A[n-1],0,(((LATEX("\ang{"&decimal(round(p_*(#2/total[N])))&"}"))))); + fi; + fi; + elseif AffichageDonnee: + if round(p_*(#2/total[N]))>15: + if (n mod 2)=0: + marque_a:=20*0.75*Rayon/cm; + else: + marque_a:=20*0.5*Rayon/cm; + fi; + if Hachures: + if Inverse=false: + undraw + Codeangle(A[n-1],O,A[n],0,LATEX(""&decimal(p_)&"")); + else: + undraw + Codeangle(A[n],O,A[n-1],0,(((LATEX(""&decimal(p_)&""))))); + fi; + fill cercles(w shifted(marque_ang*unitvector(w-O)),3mm) withcolor + blanc; + fi; + if Inverse=false: + draw + Codeangle(A[n-1],O,A[n],0,(((LATEX(""&decimal(p_)&""))))); + else: + draw + Codeangle(A[n],O,A[n-1],0,(((LATEX(""&decimal(p_)&""))))); fi; fi; fi; % fi; endfor; - if #3=360: - draw cc if #6=1: withpen pencircle scaled2 fi; + if #2=360: + draw cc if Hachures: withpen pencircle scaled2 fi; else: - draw (subpath(0,length cc/2) of cc)--cycle if #6=1: withpen pencircle scaled2 fi;; + draw (subpath(0,length cc/2) of cc)--cycle if Hachures: withpen pencircle scaled2 fi;; fi; n:=0; - path cd[]; + if Legende: for p_=t: if string p_: n:=n+1; - C[n]=A[n-1] rotatedabout(O,if #7=1:-1* fi(ang[n]-ang[n-1])/2); + C[n]=A[n-1] rotatedabout(O,if Inverse:-1* fi(ang[n]-ang[n-1])/2); draw 0.95[O,C[n]]--1.05[O,C[n]]; C[n]:=1.05[O,C[n]]; + Test(n); + if Retour=false: if (xpart(C[n])>xpart(O)) and (ypart(C[n])>ypart(O)): D[n]=C[n]+(0.5cm,0); draw C[n]--D[n]; @@ -10973,13 +11656,27 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O label.lrt(LATEX(p_),D[n]); fi; fi; + fi; endfor; + fi; enddef; + vardef Test(expr nb)= + Retour:=false; + op:=0; + for l_=#4: + if l_=nb: + op:=op+1; + fi; + endfor; + if op>0: + Retour:=true; + fi; + enddef; Figure(-10u,-10u,10u,10u); - toto(#2); + toto(#1); \end{mpost} \fi -} +}% %Pour la m\'ediane. \DTLgnewdb{mtdb}% @@ -11154,10 +11851,12 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \ifboolKV[ClesStat]{SET}{}{Le nombre de donn\'ees de la s\'erie est \num{\ListeCompletelen}.\\}% Donc la moyenne de la s\'erie est \'egale \`a :% \[\frac{\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}}{\num{\ListeCompletelen}}%\IfInteger{\fpeval{round(\fpeval{\SommeDonnees/\ListeCompletelen},\useKV[ClesStat]{Precision})}}{=}{\approx} - \opdiv*{\SommeDonnees}{\ListeCompletelen}{resultatmoy}{restemoy}% - \opround{resultatmoy}{\useKV[ClesStat]{Precision}}{resultatmoy1}% - \opcmp{resultatmoy}{resultatmoy1}\ifopeq=\else\approx\fi% - \num{\fpeval{round(\SommeDonnees/\ListeCompletelen,\useKV[ClesStat]{Precision})}}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}.}{.}% + \ifboolKV[ClesStat]{ValeurExacte}{}{% + \opdiv*{\SommeDonnees}{\ListeCompletelen}{resultatmoy}{restemoy}% + \opround{resultatmoy}{\useKV[ClesStat]{Precision}}{resultatmoy1}% + \opcmp{resultatmoy}{resultatmoy1}\ifopeq=\else\approx\fi% + \num{\fpeval{round(\SommeDonnees/\ListeCompletelen,\useKV[ClesStat]{Precision})}}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}% + }% \]% }{Pas de moyenne possible pour une s\'erie de donn\'ees \`a caract\`ere qualitatif.}}{}% % % %% celui de l'\'etendue @@ -11275,9 +11974,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O }% % Construction du tableau \ifboolKV[ClesStat]{Tableau}{% - \ifboolKV[ClesStat]{Liste}{Pas de tableau possible avec la cl\'e Liste.\\Utilisez plut\^ot la cl\'e Sondage si vous voulez un tableau avec cette liste.}{% - \ifboolKV[ClesStat]{Total}{\buildtabt}{\buildtab}}}% - {}% + \ifboolKV[ClesStat]{Liste}{Pas de tableau possible avec la cl\'e Liste.\\Utilisez plut\^ot la cl\'e Sondage si vous voulez un tableau avec cette liste.}{\BuildtabStat}}{}% % 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.}{% @@ -11336,10 +12033,12 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O }% Donc la moyenne de la s\'erie est \'egale \`a :% \[\frac{\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}}{\num{\EffectifTotal}}% - \opdiv*{\SommeDonnees}{\EffectifTotal}{resultatmoy}{restemoy}% - \opround{resultatmoy}{\useKV[ClesStat]{Precision}}{resultatmoy1}% - \opcmp{resultatmoy}{resultatmoy1}\ifopeq=\else\approx\fi% - \num{\fpeval{round(\SommeDonnees/\EffectifTotal,\useKV[ClesStat]{Precision})}}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}.}{.}% + \ifboolKV[ClesStat]{ValeurExacte}{}{% + \opdiv*{\SommeDonnees}{\EffectifTotal}{resultatmoy}{restemoy}% + \opround{resultatmoy}{\useKV[ClesStat]{Precision}}{resultatmoy1}% + \opcmp{resultatmoy}{resultatmoy1}\ifopeq=\else\approx\fi% + \num{\fpeval{round(\SommeDonnees/\EffectifTotal,\useKV[ClesStat]{Precision})}}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}% + }% \]% }{}% % % Affichage des r\'eponses. @@ -11440,10 +12139,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O }% }% % Construction de tableau - \ifboolKV[ClesStat]{Tableau}{\ifboolKV[ClesStat]{Total}{\buildtabt}{% - \buildtab% - } - }{}% + \ifboolKV[ClesStat]{Tableau}{\BuildtabStat}{}% % Construction du graphique ?? \ifboolKV[ClesStat]{Graphique}{% \ifboolKV[ClesStat]{Angle}{\buildgraphcq{360}}{\ifboolKV[ClesStat]{SemiAngle}{\buildgraphcq{180}}{\buildgraph[#1]}} @@ -11964,82 +12660,105 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O %%% % Proportionnalit\'e %%% -\setKVdefault[ClesPropor]{GrandeurA=Grandeur A,GrandeurB=Grandeur B,Largeur=1cm,Math=false,Stretch=1,ColorFill=white,CouleurTab=gray!15}% +\setKVdefault[ClesPropor]{GrandeurA=Grandeur A,GrandeurB=Grandeur B,Largeur=1cm,Math=false,Stretch=1,ColorFill=white,CouleurTab=gray!15,Vertical=false}% \def\Updatetoksmath#1/#2\nil{\addtotok\tabtoksa{}\addtotok\tabtoksb{}}% - -\def\buildtabpropor{% - \tabtoksa{}\tabtoksb{}% - \tabtoksa{\useKV[ClesPropor]{GrandeurA}}\tabtoksb{\useKV[ClesPropor]{GrandeurB}}% - \ifboolKV[ClesPropor]{Math}{% - \foreachitem\compteur\in\ListeValeur{\expandafter\Updatetoksmath\compteur\nil}% - }{\foreachitem\compteur\in\ListeValeur{\expandafter\updatetoks\compteur\nil}% - }% - \xdef\LongListe{\ListeValeurlen}% +\def\updatetokspropor#1/#2\nil{\addtotok\tabtoksa{&\num{#1}}\addtotok\tabtoksb{&\num{#2}}} +\def\Buildtabpropor{% + \setcounter{NbProporG}{0}% + \setcounter{NbProporD}{0}% \renewcommand{\arraystretch}{\useKV[ClesPropor]{Stretch}}% - \begin{tabular}{|>{\columncolor{\useKV[ClesPropor]{CouleurTab}}}c|*{\number\numexpr\ListeValeurlen}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}}% - \multicolumn{1}{c}{\TikzPHD\setcounter{NbPropor}{1}}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}\\% - \hhline{*{\number\numexpr\ListeValeurlen+1}{-}}% - \the\tabtoksa\\% - \hhline{*{\number\numexpr\ListeValeurlen+1}{-}}% - \the\tabtoksb\\% - \hhline{*{\number\numexpr\ListeValeurlen+1}{-}}% - \multicolumn{1}{c}{\TikzPBD\setcounter{NbPropor}{1}}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPB}}\\% - \end{tabular}% + \ifboolKV[ClesPropor]{Vertical}{% + \begin{tabular}{c|*{2}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}c}% + \multicolumn{1}{c}{}&\multicolumn{1}{c}{\setcounter{NbPropor}{1}\TikzPH}&\multicolumn{1}{c}{\TikzPH}&\\ + \hhline{~--~}% + &\cellcolor{\useKV[ClesPropor]{CouleurTab}}\useKV[ClesPropor]{GrandeurA}&\cellcolor{\useKV[ClesPropor]{CouleurTab}}\useKV[ClesPropor]{GrandeurB}&\\ + \hhline{~--~}% + \xintFor* ##1 in {\xintSeq{1}{\fpeval{\ListeValeurlen}}}\do{% + \stepcounter{NbProporG}\TikzPG&\ifboolKV[ClesPropor]{Math}{\ListeValeur[##1,1]}{\num{\ListeValeur[##1,1]}}&\ifboolKV[ClesPropor]{Math}{\ListeValeur[##1,2]}{\num{\ListeValeur[##1,2]}}&\stepcounter{NbProporD}\TikzPD\\ + \hhline{~--~}% + }% + \multicolumn{1}{c}{}&\multicolumn{1}{c}{\setcounter{NbPropor}{1}\TikzPB}&\multicolumn{1}{c}{\TikzPB}&\\ + \end{tabular}% + }{% + \tabtoksa{}\tabtoksb{}% + \tabtoksa{\cellcolor{\useKV[ClesPropor]{CouleurTab}}\useKV[ClesPropor]{GrandeurA}}\tabtoksb{\cellcolor{\useKV[ClesPropor]{CouleurTab}}\useKV[ClesPropor]{GrandeurB}}% + \ifboolKV[ClesPropor]{Math}{% + \foreachitem\compteur\in\ListeValeur{\expandafter\Updatetoksmath\compteur\nil}% + }{\foreachitem\compteur\in\ListeValeur{\expandafter\updatetokspropor\compteur\nil}% + }% + \xdef\LongListe{\ListeValeurlen}% + \begin{tabular}{rc|*{\number\numexpr\ListeValeurlen}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}l}% + \multicolumn{1}{c}{}&\multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}&\multicolumn{1}{c}{}\\% + \hhline{~*{\number\numexpr\ListeValeurlen+1}{-}~}% + \multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}&\the\tabtoksa&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\% + \hhline{~*{\number\numexpr\ListeValeurlen+1}{-}~}% + \multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}&\the\tabtoksb&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\% + \hhline{~*{\number\numexpr\ListeValeurlen+1}{-}~}% + \multicolumn{1}{c}{\stepcounter{NbProporG}\TikzPG}&\multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPB}}&\multicolumn{1}{c}{}\\% + \end{tabular}% + }% \renewcommand{\arraystretch}{1}% }% -\newcounter{NbPropor} +\newcounter{NbPropor}% -\newcommand{\TikzPH}{% - \tikz[remember picture,overlay]{% - \coordinate[name=ProporH-\theNbPropor,yshift=-\the\dp\strutbox*\arraystretch];}% - \stepcounter{NbPropor}% - }% +\newcommand\TikzPH{% + \tikz[remember picture,overlay]{% + \coordinate[name=ProporH-\theNbPropor,yshift=-\getstrut\dp*\arraystretch];}% + \stepcounter{NbPropor}% +}% - \newcommand{\TikzPHD}{% - \setbox1=\hbox{\useKV[ClesPropor]{GrandeurA}}% - \setbox2=\hbox{\useKV[ClesPropor]{GrandeurB}}% - \xintifboolexpr{\wd1>\wd2}{% - \tikz[remember picture,overlay]{% - \coordinate[name=ProporHD,xshift=-0.5\wd1,yshift=-\the\dp\strutbox*\arraystretch];}% - }{% - \tikz[remember picture,overlay]{% - \coordinate[name=ProporHD,xshift=-0.5\wd2,yshift=-\the\dp\strutbox*\arraystretch];}% - } - }% +\newcommand\TikzPB{% + \tikz[remember picture, overlay]{% + \coordinate[name=ProporB-\theNbPropor,yshift=\getstrut\ht*\arraystretch];}% + \stepcounter{NbPropor}% +}% - \newcommand{\TikzPB}{% - \tikz[remember picture, overlay]{% - \coordinate[name=ProporB-\theNbPropor,yshift=\the\ht\strutbox*\arraystretch];}% - \stepcounter{NbPropor}% - }% +\newcommand\TikzPG{% + \tikz[remember picture,overlay]{% + \coordinate[name=ProporG-\theNbProporG,xshift=\tabcolsep+\arrayrulewidth,yshift=\getstrut\dp];}% +}% +\newcommand\TikzPD{% + \tikz[remember picture,overlay]{% + \coordinate[name=ProporD-\theNbProporD,xshift=-\tabcolsep-\arrayrulewidth,yshift=\getstrut\dp];}% +}% - \newcommand{\TikzPBD}{% - \setbox1=\hbox{\useKV[ClesPropor]{GrandeurA}}% - \setbox2=\hbox{\useKV[ClesPropor]{GrandeurB}}% - \xintifboolexpr{\wd1>\wd2}{% - \tikz[remember picture, overlay]{% - \coordinate[name=ProporBD,xshift=-0.5*\the\wd1,yshift=\the\ht\strutbox*\arraystretch];}% - }{% - \tikz[remember picture, overlay]{% - \coordinate[name=ProporBD,xshift=-0.5*\the\wd2,yshift=\the\ht\strutbox*\arraystretch];}% - } - \stepcounter{NbPropor}% - }% - - \newcommand\FlechesPH[3]{% - \ifnum#1<#2\relax% +\newcommand\TikzPHD{% + \setbox1=\hbox{\useKV[ClesPropor]{GrandeurA}}% + \setbox2=\hbox{\useKV[ClesPropor]{GrandeurB}}% + \xintifboolexpr{\wd1>\wd2}{% + \tikz[remember picture,overlay]{% + \coordinate[name=ProporHD,xshift=-0.5\wd1,yshift=-\getstrut\dp*\arraystretch];}% + }{% + \tikz[remember picture,overlay]{% + \coordinate[name=ProporHD,xshift=-0.5\wd2,yshift=-\getstrut\dp*\arraystretch];}% + } +}% + +\newcommand\TikzPBD{% + \setbox1=\hbox{\useKV[ClesPropor]{GrandeurA}}% + \setbox2=\hbox{\useKV[ClesPropor]{GrandeurB}}% + \xintifboolexpr{\wd1>\wd2}{% + \tikz[remember picture, overlay]{% + \coordinate[name=ProporBD,xshift=-0.5*\the\wd1,yshift=\getstrut\ht*\arraystretch];}% + }{% + \tikz[remember picture, overlay]{% + \coordinate[name=ProporBD,xshift=-0.5*\the\wd2,yshift=\getstrut\ht*\arraystretch];}% + } + \stepcounter{NbPropor}% +}% +% +\newcommand\FlechesPH[3]{% \begin{tikzpicture}[remember picture,overlay]% + \ifnum#1<#2\relax% \draw[-stealth,out=50,in=130] (ProporH-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5, sloped]{#3}(ProporH-#2);% - \end{tikzpicture}% \else% -\begin{tikzpicture}[remember picture,overlay]% \draw[-stealth,out=130,in=50] (ProporH-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5, sloped]{#3}(ProporH-#2);% + \fi% \end{tikzpicture}% - \fi% }% - +% \newcommand\FlechesPB[3]{% \ifnum\number#1<\number#2\relax% \begin{tikzpicture}[remember picture,overlay]% @@ -12050,18 +12769,63 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \draw[-stealth,out=-130,in=-50] (ProporB-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5, sloped]{#3}(ProporB-#2);% \end{tikzpicture}% \fi% -} +}% +% +\newcommand\FlechesPG[3]{% + \begin{tikzpicture}[remember picture,overlay]% + \ifnum#1<#2\relax% + \draw[-stealth,out=-150,in=150] (ProporG-#1) to node[transform canvas={xshift=-1pt},inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5,left]{#3}(ProporG-#2);% + \else% + \draw[-stealth,out=150,in=-150] (ProporG-#1) to node[transform canvas={xshift=-1pt},inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5, left]{#3}(ProporG-#2);% + \fi% + \end{tikzpicture}% +}% + +\newcommand\FlechesPD[3]{% + \begin{tikzpicture}[remember picture,overlay]% + \ifnum#1<#2\relax% + \draw[-stealth,out=-30,in=30] (ProporD-#1) to node[transform canvas={xshift=1pt},inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5,right]{#3}(ProporD-#2);% + \else% + \draw[-stealth,out=30,in=-30] (ProporD-#1) to node[transform canvas={xshift=1pt},inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5,right]{#3}(ProporD-#2);% + \fi% + \end{tikzpicture}% +}% + +\newcommand\FlecheLineaireG[4]{% + \begin{tikzpicture}[remember picture,overlay,node distance=1em]% + \node[inner sep=0pt] (MilieuH) at ($(ProporG-#1)!0.5!(ProporG-#2)$) {};% + \node[circle,draw,inner sep=0pt] [left of=MilieuH] (aux) {#4} ;% + \coordinate[left of=aux] (aux1);% + \draw[-stealth] (ProporG-#1) -| (aux);% + \draw[-stealth] (ProporG-#2) -| (aux);% + \draw[-stealth] (aux) -- (aux1) |- (ProporG-#3);% + \end{tikzpicture}% +}% + +\newcommand\FlecheLineaireD[4]{% + \begin{tikzpicture}[remember picture,overlay,node distance=1em]% + \node[inner sep=0pt] (MilieuH) at ($(ProporD-#1)!0.5!(ProporD-#2)$) {};% + \node[circle,draw,inner sep=0pt] [right of=MilieuH] (aux) {#4} ;% + \coordinate[right of=aux] (aux1);% + \draw[-stealth] (ProporD-#1) -| (aux);% + \draw[-stealth] (ProporD-#2) -| (aux);% + \draw[-stealth] (aux) -- (aux1) |- (ProporD-#3);% + \end{tikzpicture}% +}% + +\newcounter{NbProporG}% +\newcounter{NbProporD}% \newcommand\Propor[2][]{% \useKVdefault[ClesPropor]% \setKV[ClesPropor]{#1}% \xdef\colorfill{\useKV[ClesPropor]{ColorFill}}% \xdef\EcartLargeur{\useKV[ClesPropor]{Largeur}}% -% %on lit la liste \'ecrite sous la forme valeur/effectif + % % on lit la liste \'ecrite sous la forme valeur/effectif \setsepchar[*]{,*/}\ignoreemptyitems% \readlist*\ListeValeur{#2}% - \buildtabpropor% -} + \Buildtabpropor% +}% \newcommand\FlecheCoef[2][\EcartLargeur]{% \begin{tikzpicture}[remember picture, overlay]% @@ -12070,7 +12834,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \coordinate[right of=Point1,node distance=0.5*#1+\tabcolsep] (point1);% \coordinate[right of=Point2,node distance=0.5*#1+\tabcolsep] (point2);% \draw[-stealth,out=-20,in=20] (point1) to node[midway,right,inner sep=1pt]{#2}(point2);% -\end{tikzpicture}% + \end{tikzpicture}% }% \newcommand\FlecheCoefDebut[2][\tabcolsep+\arrayrulewidth]{% @@ -12080,7 +12844,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \coordinate[left of=Noeud1,node distance=#1] (noeud1);% \coordinate[left of=Noeud2,node distance=#1] (noeud2);% \draw[-stealth,out=160,in=-160] (noeud2) to node[midway,left,inner sep=1pt]{#2}(noeud1);% -\end{tikzpicture}% + \end{tikzpicture}% }% \newcommand\FlecheCoefInv[2][1cm]{% @@ -12090,30 +12854,30 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \coordinate[right of=Point1,node distance=0.5*#1+\tabcolsep] (point1);% \coordinate[right of=Point2,node distance=0.5*#1+\tabcolsep] (point2);% \draw[-stealth,out=20,in=-20] (point2) to node[midway,right,inner sep=1pt]{#2}(point1);% -\end{tikzpicture}% + \end{tikzpicture}% }% \newcommand\FlecheLineaireH[4]{% - \begin{tikzpicture}[remember picture,overlay,node distance=\ht\strutbox] - \node[inner sep=0pt] (MilieuH) at ($(ProporH-#1)!0.5!(ProporH-#2)$) {}; - \node[circle,draw,inner sep=0pt] [above of=MilieuH] (aux) {#4} ; - \coordinate[above of=aux] (aux1); - \draw[-stealth] (ProporH-#1) |- (aux); - \draw[-stealth] (ProporH-#2) |- (aux); - \draw[-stealth] (aux) -- (aux1) -| (ProporH-#3); -\end{tikzpicture} -} + \begin{tikzpicture}[remember picture,overlay,node distance=\getstrut\ht]% + \node[inner sep=0pt] (MilieuH) at ($(ProporH-#1)!0.5!(ProporH-#2)$) {};% + \node[circle,draw,inner sep=0pt] [above of=MilieuH] (aux) {#4} ;% + \coordinate[above of=aux] (aux1);% + \draw[-stealth] (ProporH-#1) |- (aux);% + \draw[-stealth] (ProporH-#2) |- (aux);% + \draw[-stealth] (aux) -- (aux1) -| (ProporH-#3);% + \end{tikzpicture}% +}% \newcommand\FlecheLineaireB[4]{% - \begin{tikzpicture}[remember picture,overlay,node distance=3mm] - \node[inner sep=0pt] (MilieuB) at ($(ProporB-#1)!0.5!(ProporB-#2)$) {}; - \node[circle,draw,inner sep=0pt] [below of=MilieuB] (aux) {#4} ; - \coordinate[below of=aux,node distance=3mm] (aux1); - \draw[-stealth] (ProporB-#1) |- (aux); - \draw[-stealth] (ProporB-#2) |- (aux); - \draw[-stealth] (aux) -- (aux1) -| (ProporB-#3); -\end{tikzpicture} -} + \begin{tikzpicture}[remember picture,overlay,node distance=3mm]% + \node[inner sep=0pt] (MilieuB) at ($(ProporB-#1)!0.5!(ProporB-#2)$) {};% + \node[circle,draw,inner sep=0pt] [below of=MilieuB] (aux) {#4};% + \coordinate[below of=aux,node distance=3mm] (aux1);% + \draw[-stealth] (ProporB-#1) |- (aux);% + \draw[-stealth] (ProporB-#2) |- (aux);% + \draw[-stealth] (aux) -- (aux1) -| (ProporB-#3);% + \end{tikzpicture}% +}% %%% % Application : pourcentage @@ -12496,13 +13260,13 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \newcommand{\TikzRH}{% \tikz[remember picture,overlay]{% - \coordinate[name=ProporH-\theNbPropor,yshift=\the\ht\strutbox*\arraystretch];}% + \coordinate[name=ProporH-\theNbPropor,yshift=\getstrut\ht*\arraystretch];}% \stepcounter{NbPropor}% }% \newcommand{\TikzRB}{% \tikz[remember picture, overlay]{% - \coordinate[name=ProporB-\theNbPropor,yshift=-\the\dp\strutbox*\arraystretch];}% + \coordinate[name=ProporB-\theNbPropor,yshift=-\getstrut\dp*\arraystretch];}% \stepcounter{NbPropor}% }% @@ -12531,7 +13295,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \setKV[ClesRatio]{#1}% \xdef\EcartLargeur{\useKV[ClesRatio]{Largeur}}% \ifboolKV[ClesRatio]{FigureCours}{% - \ignoreemptyitems% + \setsepchar{,}\ignoreemptyitems% \readlist*\ListeRatio{#2}% \toklisteratio{}% \foreachitem\compteur\in\ListeRatio{\expandafter\UpdateRatio\compteur\nil}% @@ -12541,7 +13305,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \MPTestCours[#1]{\useKV[ClesRatio]{Longueur}}{\NbUn}{\NbDeux}{\NbTrois}{\the\toklisteratio}{\useKV[ClesRatio]{CouleurUn}}{\useKV[ClesRatio]{CouleurDeux}}{\useKV[ClesRatio]{CouleurTrois}}% }{% \ifboolKV[ClesRatio]{Figure}{% - \ignoreemptyitems% + \setsepchar{,}\ignoreemptyitems% \readlist*\ListeRatio{#2}% \toklisteratio{}% \foreachitem\compteur\in\ListeRatio{\expandafter\UpdateRatio\compteur\nil}% @@ -17449,7 +18213,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O %%% % Ecritures d'unit\'es %%% -\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,kmh=true,kms=false,ms=false,mh=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false} +\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,mmin=false,kmh=true,kms=false,ms=false,mh=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false} %D'apres https://tex.stackexchange.com/questions/38905/time-of-the-day-or-time-period-using-the-package-siunitx \ExplSyntaxOn @@ -17698,16 +18462,20 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \newcommand\Vitesse[2][]{% \useKVdefault[Unites]% \setKV[Unites]{#1}% - \ifboolKV[Unites]{mh}{% - \SI[per-mode=symbol]{#2}{\meter\per\hour}% + \ifboolKV[Unites]{mmin}{% + \SI[per-mode=symbol]{#2}{\meter\per\minute}% }{% - \ifboolKV[Unites]{ms}{% - \SI[per-mode=symbol]{#2}{\meter\per\second}% + \ifboolKV[Unites]{mh}{% + \SI[per-mode=symbol]{#2}{\meter\per\hour}% }{% - \ifboolKV[Unites]{kms}{% - \SI[per-mode=symbol]{#2}{\kilo\meter\per\second}% + \ifboolKV[Unites]{ms}{% + \SI[per-mode=symbol]{#2}{\meter\per\second}% }{% - \SI[per-mode=symbol]{#2}{\kilo\meter\per\hour}% + \ifboolKV[Unites]{kms}{% + \SI[per-mode=symbol]{#2}{\kilo\meter\per\second}% + }{% + \SI[per-mode=symbol]{#2}{\kilo\meter\per\hour}% + }% }% }% }% @@ -17729,6 +18497,8 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \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\PfCTstrut{\rule{0pt}{3.8ex}} % Top strut +\newcommand\PfCBstrut{\rule[-1.2ex]{0pt}{0ex}} % Bottom strut \newcommand\Tableau[2][]{% \useKVdefault[ClesTableaux]% @@ -17931,11 +18701,13 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O &\Block[borders={right}]{}{\fontsize{5}{5}\selectfont $\times\num{10}^{-2}$}% &\Block[borders={right}]{}{\fontsize{5}{5}\selectfont $\times\num{10}^{-3}$}% \ifboolKV[ClesTableaux]{Micro}{&% - \Block[borders={right}]{}{}&% - &\Block[borders={right}]{}{\fontsize{5}{5}\selectfont $\times\num{10}^{-6}$}}{% + \Block[borders={right}]{}{}&% + \Block[borders={right}]{}{}& + \Block[borders={right}]{}{\fontsize{5}{5}\selectfont $\times\num{10}^{-6}$}}{% \ifboolKV[ClesTableaux]{Nano}{&% + \Block[borders={right}]{}{}&% \Block[borders={right}]{}{}&% - &\Block[borders={right}]{}{\fontsize{5}{5}\selectfont $\times\num{10}^{-6}$}% + \Block[borders={right}]{}{\fontsize{5}{5}\selectfont $\times\num{10}^{-6}$}% &\Block[borders={right}]{}{}% &\Block[borders={right}]{}{}% &\Block[borders={right}]{}{\fontsize{5}{5}\selectfont $\times\num{10}^{-9}$}}{}% @@ -19460,7 +20232,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \StrSubstitute{\tempa}{**}{^}[\tempab]% \StrSubstitute{\tempab}{*}{\times}[\tempac]% \StrSubstitute{\tempac}{/}{\div}[\tempad]% - $\ifboolKV[ClesProg]{Details}{\num{\NbDepart}\tempad=}{}\xdef\NbDepart{\fpeval{(\NbDepart)\ListeProg[2,\etapecnt]}}\num{\NbDepart}$% + $\ifboolKV[ClesProg]{Details}{\xintifboolexpr{\NbDepart<0}{(\num{\NbDepart})}{\num{\NbDepart}}\tempad=}{}\xdef\NbDepart{\fpeval{(\NbDepart)\ListeProg[2,\etapecnt]}}\num{\NbDepart}$% }% \end{enumerate} } @@ -19951,10 +20723,10 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \def\barre{\vrule height2.1ex depth.9ex width0pt}% \def\demibarre{\vrule height1.4ex depth.6ex width0pt}% -\setKVdefault[Scratch]{Impression=false,Numerotation=false,Echelle=1} +\setKVdefault[Scratch]{Impression=false,Numerotation=false,Echelle=1}% \ifluatex -\NewEnviron{Scratch}[1][]{% +\NewDocumentEnvironment{Scratch}{o +b}{% \useKVdefault[Scratch]% \setKV[Scratch]{#1}% \mplibforcehmode% @@ -19963,22 +20735,22 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O input PfCScratch;% print:=\useKV[Scratch]{Impression};% NumeroteLignes:=\useKV[Scratch]{Numerotation};% - \BODY + #2% picture recap;% recap:=currentpicture scaled \useKV[Scratch]{Echelle};% - currentpicture:=nullpicture; - draw recap; - \end{mplibcode} -}% -\else -\NewEnviron{Scratch}[1][]{% + currentpicture:=nullpicture;% + draw recap;% + \end{mplibcode}% + }{} +\else% +\NewDocumentEnvironment{Scratch}{o +b}{% \setKV[Scratch]{#1}% \begin{mpost}[mpsettings={input PfCScratchpdf;print:=\useKV[Scratch]{Impression};NumeroteLignes:=\useKV[Scratch]{Numerotation};Echelle:=\useKV[Scratch]{Echelle};}]% - \BODY + #2% picture recap;% recap:=currentpicture scaled Echelle;% - currentpicture:=nullpicture; - draw recap; + currentpicture:=nullpicture;% + draw recap;% \end{mpost} -}% -\fi
\ No newline at end of file +}{}% +\fi%
\ No newline at end of file |