summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/profcollege/latex/ProfCollege.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-02-17 03:01:15 +0000
committerNorbert Preining <norbert@preining.info>2022-02-17 03:01:15 +0000
commitbd0e05b5b4dba5b38512acb2e7104f180fdb97e6 (patch)
treefd0c2e1e01289d188075990b8126941d5be9c1c0 /macros/latex/contrib/profcollege/latex/ProfCollege.sty
parente1b70cd3906c3b92e231eb8001f1a0c0eb2053c1 (diff)
CTAN sync 202202170301
Diffstat (limited to 'macros/latex/contrib/profcollege/latex/ProfCollege.sty')
-rw-r--r--macros/latex/contrib/profcollege/latex/ProfCollege.sty721
1 files changed, 597 insertions, 124 deletions
diff --git a/macros/latex/contrib/profcollege/latex/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
index ba5e7d5675..411551409e 100644
--- a/macros/latex/contrib/profcollege/latex/ProfCollege.sty
+++ b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
@@ -3,7 +3,7 @@
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfCollege}[2022/01/01 v0.99-j Aide pour l'utilisation de LaTeX au collège]
+\ProvidesPackage{ProfCollege}[2022/02/16 v0.99-k Aide pour l'utilisation de LaTeX au collège]
\RequirePackage{verbatim}
@@ -178,7 +178,7 @@
\Dotfill%
\else%
\hbox to#1{\Dotfill}%
- \fi
+ \fi%
}%
\newcommand\Lignespointilles[1]{%
@@ -517,6 +517,456 @@
}
%%%
+% 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}}
+
+\newtoks\toklistemodelbarresup%
+\toklistemodelbarresup{}%
+\def\UpdateListeModelBarreSup#1\nil{\addtotok\toklistemodelbarresup{#1,}}%
+\newtoks\toklistemodelbarreinf%
+\toklistemodelbarreinf{}%
+\def\UpdateListeModelBarreInf#1\nil{\addtotok\toklistemodelbarreinf{#1,}}%
+
+\newcommand\ModeleBarre[3][]{%
+ % #1 options
+ % #2 éléments de la barre supérieure C1 2 $x$ 1 3/C2 1 1x/
+ % #3 éléments de la barre inférieure (même lecture)
+ \useKVdefault[ClesModeleBarre]%
+ \setKV[ClesModeleBarre]{#1}%
+ \setsepchar{\\/ }%
+ \readlist\ListeModelBarreSup{#2}%
+ \readlist\ListeModelBarreInf{#3}%
+ \toklistemodelbarresup{}%
+ \foreachitem\compteur\in\ListeModelBarreSup{%
+ \foreachitem\valeur\in\ListeModelBarreSup[\compteurcnt]{%
+ \expandafter\UpdateListeModelBarreSup\valeur\nil%
+ }%
+ }%
+ \toklistemodelbarreinf{}%
+ \foreachitem\compteur\in\ListeModelBarreInf{%
+ \foreachitem\valeur\in\ListeModelBarreInf[\compteurcnt]{%
+ \expandafter\UpdateListeModelBarreInf\valeur\nil%
+ }%
+ }%
+ \ifboolKV[ClesModeleBarre]{Homogene}{%
+ \PfCMPDessineModelBarre{\the\toklistemodelbarresup}{\the\toklistemodelbarreinf}%
+ }{%
+ \PfCMPDessineModelBarreNonHomogene{\the\toklistemodelbarresup}{\the\toklistemodelbarreinf}%
+ }%
+}%
+
+\newcommand\PfCMPDessineModelBarre[2]{%
+ \begin{mplibcode}
+ Longueur:=\useKV[ClesModeleBarre]{Longueur};
+ Hauteur:=\useKV[ClesModeleBarre]{Hauteur};
+
+ vardef Briquesup(expr col)(text t)=
+ save $;
+ picture $;
+ $=image(
+ u:=Longueur/MBnbcasessuptotal;
+ remplis polygone((0,0),(u,0),(u,Hauteur),(0,Hauteur)) withcolor col;
+ draw polygone((0,0),(u,0),(u,Hauteur),(0,Hauteur));
+ label(TEX(t),iso((0,0),(u,Hauteur)));
+ u:=1cm;
+ );
+ $
+ enddef;
+
+ vardef Briqueinf(expr col)(text t)=
+ save $;
+ picture $;
+ $=image(
+ u:=Longueur/MBnbcasesinftotal;
+ remplis polygone((0,0),(u,0),(u,Hauteur),(0,Hauteur)) withcolor col;
+ draw polygone((0,0),(u,0),(u,Hauteur),(0,Hauteur));
+ label(TEX(t),iso((0,0),(u,Hauteur)));
+ u:=1cm;
+ );
+ $
+ enddef;
+
+ numeric MBnbcolsup;%compte combien de couleurs
+ MBnbcolsup=0;
+ color MBColSup[];%Sauvegarde les couleurs de la barre sup
+ numeric MBnbinfosup[];%compte combien d'infos par couleurs.
+ numeric MBnbcasessup[][];
+ numeric MBnbcasessuptotal;
+ MBnbcasessuptotal=0;
+ string MBTextcasessup[][];
+ vardef toto(text t)=
+ for p_=t:
+ if color p_:
+ MBnbcolsup:=MBnbcolsup+1;% on incrémente le nombre de couleurs
+ MBColSup[MBnbcolsup]:=p_;% on définit la couleur de la série de cases
+ MBnbinfosup[MBnbcolsup]:=0;
+ else:
+ if numeric p_:
+ MBnbinfosup[MBnbcolsup]:=MBnbinfosup[MBnbcolsup]+1;
+ MBnbcasessuptotal:=MBnbcasessuptotal+p_;
+ MBnbcasessup[MBnbcolsup][MBnbinfosup[MBnbcolsup]]:=p_;
+ else:
+ MBTextcasessup[MBnbcolsup][MBnbinfosup[MBnbcolsup]]:=p_;
+ fi;
+ fi;
+ endfor;
+ enddef;
+
+ toto(#1);
+
+ numeric MBnbcolinf;%compte combien de couleurs
+ MBnbcolinf=0;
+ color MBColInf[];%Sauvegarde les couleurs de la barre inf
+ numeric MBnbinfoinf[];%compte combien d'infos par couleurs.
+ numeric MBnbcasesinf[][];
+ numeric MBnbcasesinftotal;
+ MBnbcasesinftotal=0;
+ string MBTextcasesinf[][];
+ vardef tata(text t)=
+ for p_=t:
+ if color p_:
+ MBnbcolinf:=MBnbcolinf+1;% on incrémente le nombre de couleurs
+ MBColInf[MBnbcolinf]:=p_;% on définit la couleur de la série de cases
+ MBnbinfoinf[MBnbcolinf]:=0;
+ else:
+ if numeric p_:
+ MBnbinfoinf[MBnbcolinf]:=MBnbinfoinf[MBnbcolinf]+1;
+ MBnbcasesinftotal:=MBnbcasesinftotal+p_;
+ MBnbcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
+ else:
+ MBTextcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
+ fi;
+ fi;
+ endfor;
+ enddef;
+
+ tata(#2);
+
+ pair VecteurDeplasup;
+ VecteurDeplasup=(Longueur/MBnbcasessuptotal,0);
+
+ numeric MBnbdepla;
+ MBnbdepla=0;
+ for k=1 upto MBnbcolsup:
+ for l=1 upto MBnbinfosup[k]:
+ for j=1 upto MBnbcasessup[k][l]:
+ trace Briquesup(MBColSup[k])(MBTextcasessup[k][l]) shifted(MBnbdepla*VecteurDeplasup);
+ MBnbdepla:=MBnbdepla+1;
+ endfor;
+ endfor;
+ endfor;
+
+ pair VecteurDeplainf;
+ VecteurDeplainf=(Longueur/MBnbcasesinftotal,0);
+
+ numeric MBnbdepla;
+ MBnbdepla=0;
+ for k=1 upto MBnbcolinf:
+ for l=1 upto MBnbinfoinf[k]:
+ for j=1 upto MBnbcasesinf[k][l]:
+ trace Briqueinf(MBColInf[k])(MBTextcasesinf[k][l]) shifted(MBnbdepla*VecteurDeplainf+(0,-Hauteur));
+ MBnbdepla:=MBnbdepla+1;
+ endfor;
+ endfor;
+ endfor;
+ \end{mplibcode}
+}
+
+\newcommand\PfCMPDessineModelBarreNonHomogene[2]{%
+ \ifluatex%
+ \mplibforcehmode%
+ \begin{mplibcode}
+ Longueur:=\useKV[ClesModeleBarre]{Largeur};
+ Hauteur:=\useKV[ClesModeleBarre]{Hauteur};
+ Separation:=\useKV[ClesModeleBarre]{Separation};
+
+ vardef Brique(expr col,nbfois)(text t)=
+ save $;
+ picture $;
+ $=image(
+ u:=Longueur;
+ if t="?":
+ draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) dashed evenly;
+ else:
+ remplis polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) withcolor col;
+ draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur));
+ fi;
+ if nbfois>0:
+ label(TEX(t),iso((0,0),(u*abs(nbfois),Hauteur)));
+ else:
+ label.bot(TEX(t),iso((0,0),(u*abs(nbfois),-Hauteur)));
+ drawdblarrow (0,-0.5*Hauteur)--(u*abs(nbfois),-0.5*Hauteur);
+ fi;
+ u:=1cm;
+ );
+ $
+ enddef;
+
+ numeric MBnbcolsup;%compte combien de couleurs
+ MBnbcolsup=0;
+ color MBColSup[];%Sauvegarde les couleurs de la barre sup
+ numeric MBnbinfosup[];%compte combien d'infos par couleurs.
+ numeric MBnbcasessup[][];
+ numeric MBnbcasessuptotal;
+ MBnbcasessuptotal=0;
+ string MBTextcasessup[][];
+ vardef toto(text t)=
+ for p_=t:
+ if color p_:
+ MBnbcolsup:=MBnbcolsup+1;% on incrémente le nombre de couleurs
+ MBColSup[MBnbcolsup]:=p_;% on définit la couleur de la série de cases
+ MBnbinfosup[MBnbcolsup]:=0;
+ else:
+ if numeric p_:
+ MBnbinfosup[MBnbcolsup]:=MBnbinfosup[MBnbcolsup]+1;
+ MBnbcasessuptotal:=MBnbcasessuptotal+p_;
+ MBnbcasessup[MBnbcolsup][MBnbinfosup[MBnbcolsup]]:=p_;
+ else:
+ MBTextcasessup[MBnbcolsup][MBnbinfosup[MBnbcolsup]]:=p_;
+ fi;
+ fi;
+ endfor;
+ enddef;
+
+ toto(#1);
+
+ numeric MBnbcolinf;%compte combien de couleurs
+ MBnbcolinf=0;
+ color MBColInf[];%Sauvegarde les couleurs de la barre inf
+ numeric MBnbinfoinf[];%compte combien d'infos par couleurs.
+ numeric MBnbcasesinf[][];
+ numeric MBnbcasesinftotal;
+ MBnbcasesinftotal=0;
+ string MBTextcasesinf[][];
+ vardef tata(text t)=
+ for p_=t:
+ if color p_:
+ MBnbcolinf:=MBnbcolinf+1;% on incrémente le nombre de couleurs
+ MBColInf[MBnbcolinf]:=p_;% on définit la couleur de la série de cases
+ MBnbinfoinf[MBnbcolinf]:=0;
+ else:
+ if numeric p_:
+ MBnbinfoinf[MBnbcolinf]:=MBnbinfoinf[MBnbcolinf]+1;
+ MBnbcasesinftotal:=MBnbcasesinftotal+p_;
+ MBnbcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
+ else:
+ MBTextcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
+ fi;
+ fi;
+ endfor;
+ enddef;
+
+ tata(#2);
+
+ pair VecteurDepla;
+ VecteurDepla=(Longueur,0);
+
+ numeric MBnbdepla;
+ MBnbdepla=0;
+ for k=1 upto MBnbcolsup:
+ for l=1 upto MBnbinfosup[k]:
+ trace Brique(MBColSup[k],MBnbcasessup[k][l])(MBTextcasessup[k][l]) shifted(MBnbdepla*VecteurDepla);
+ MBnbdepla:=MBnbdepla+MBnbcasessup[k][l];
+ endfor;
+ endfor;
+
+ 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));
+ 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;
+ endfor;
+ fi;
+ MBnbdepla:=MBnbdepla+abs(MBnbcasesinf[k][l]);
+ endfor;
+ endfor;
+
+ if Separation>0:
+ draw u*(Separation,-0.75)--u*(Separation,0.75) withpen pencircle scaled 1.5 dashed evenly withcolor red;
+ fi;
+
+ \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)=
+ save $;
+ picture $;
+ $=image(
+ u:=Longueur;
+ if t="?":
+ draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) dashed evenly;
+ else:
+ remplis polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) withcolor col;
+ draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur));
+ fi;
+ if nbfois>0:
+ label(LATEX(t),iso((0,0),(u*abs(nbfois),Hauteur)));
+ else:
+ label.bot(LATEX(t),iso((0,0),(u*abs(nbfois),-Hauteur)));
+ drawdblarrow (0,-0.5*Hauteur)--(u*abs(nbfois),-0.5*Hauteur);
+ fi;
+ u:=1cm;
+ );
+ $
+ enddef;
+
+ numeric MBnbcolsup;%compte combien de couleurs
+ MBnbcolsup=0;
+ color MBColSup[];%Sauvegarde les couleurs de la barre sup
+ numeric MBnbinfosup[];%compte combien d'infos par couleurs.
+ numeric MBnbcasessup[][];
+ numeric MBnbcasessuptotal;
+ MBnbcasessuptotal=0;
+ string MBTextcasessup[][];
+ vardef toto(text t)=
+ for p_=t:
+ if color p_:
+ MBnbcolsup:=MBnbcolsup+1;% on incrémente le nombre de couleurs
+ MBColSup[MBnbcolsup]:=p_;% on définit la couleur de la série de cases
+ MBnbinfosup[MBnbcolsup]:=0;
+ else:
+ if numeric p_:
+ MBnbinfosup[MBnbcolsup]:=MBnbinfosup[MBnbcolsup]+1;
+ MBnbcasessuptotal:=MBnbcasessuptotal+p_;
+ MBnbcasessup[MBnbcolsup][MBnbinfosup[MBnbcolsup]]:=p_;
+ else:
+ MBTextcasessup[MBnbcolsup][MBnbinfosup[MBnbcolsup]]:=p_;
+ fi;
+ fi;
+ endfor;
+ enddef;
+
+ toto(#1);
+
+ numeric MBnbcolinf;%compte combien de couleurs
+ MBnbcolinf=0;
+ color MBColInf[];%Sauvegarde les couleurs de la barre inf
+ numeric MBnbinfoinf[];%compte combien d'infos par couleurs.
+ numeric MBnbcasesinf[][];
+ numeric MBnbcasesinftotal;
+ MBnbcasesinftotal=0;
+ string MBTextcasesinf[][];
+ vardef tata(text t)=
+ for p_=t:
+ if color p_:
+ MBnbcolinf:=MBnbcolinf+1;% on incrémente le nombre de couleurs
+ MBColInf[MBnbcolinf]:=p_;% on définit la couleur de la série de cases
+ MBnbinfoinf[MBnbcolinf]:=0;
+ else:
+ if numeric p_:
+ MBnbinfoinf[MBnbcolinf]:=MBnbinfoinf[MBnbcolinf]+1;
+ MBnbcasesinftotal:=MBnbcasesinftotal+p_;
+ MBnbcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
+ else:
+ MBTextcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_;
+ fi;
+ fi;
+ endfor;
+ enddef;
+
+ tata(#2);
+
+ pair VecteurDepla;
+ VecteurDepla=(Longueur,0);
+
+ numeric MBnbdepla;
+ MBnbdepla=0;
+ for k=1 upto MBnbcolsup:
+ for l=1 upto MBnbinfosup[k]:
+ trace Brique(MBColSup[k],MBnbcasessup[k][l])(MBTextcasessup[k][l]) shifted(MBnbdepla*VecteurDepla);
+ MBnbdepla:=MBnbdepla+MBnbcasessup[k][l];
+ endfor;
+ endfor;
+
+ 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));
+ 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;
+ endfor;
+ fi;
+ MBnbdepla:=MBnbdepla+abs(MBnbcasesinf[k][l]);
+ endfor;
+ endfor;
+
+ if Separation>0:
+ draw u*(Separation,-0.75)--u*(Separation,0.75) withpen pencircle scaled 1.5 dashed evenly withcolor red;
+ fi;
+
+ \end{mpost}
+ \fi
+}
+
+%%%
+% Fiche m\'emorisation active
+%%%
+\setKVdefault[ClesFicheMemo]{TexteReponses=Réponses,TexteQuestions=Questions,Solution=false,Largeur=\linewidth}
+
+\newcommand\FicheMemo[3][]{%
+ \xdef\CountcolUn{0}%
+ \xdef\CountcolDeux{0}%
+ \useKVdefault[ClesFicheMemo]%
+ \setKV[ClesFicheMemo]{#1}%
+ \setsepchar[*]{§*/}%
+ \readlist*\ListeQuestionColonneUn{#2}%
+ \readlist*\ListeQuestionColonneDeux{#3}%
+ \renewcommand{\arraystretch}{1.35}%
+ \begin{NiceTabular}[width=\useKV[ClesFicheMemo]{Largeur}]{X[1]X[1]X[1]X[1]}[hvlines]
+ \CodeBefore%
+ \rowcolor{gray!15}{1}%
+ \tikz\draw[dashed,gray!50](2-|1.5) to (last-|1.5);%
+ \tikz\draw[dashed,gray!50](2-|4.5) to (last-|4.5);%
+ \Body%
+ \Block{1-1}{\bfseries\useKV[ClesFicheMemo]{TexteReponses}}&&&\Block{1-1}{\bfseries\useKV[ClesFicheMemo]{TexteReponses}}\\
+ \xintFor* ##4 in {\xintSeq {1}{\ListeQuestionColonneUnlen}}\do{%
+ \xintifboolexpr{\listlen\ListeQuestionColonneUn[##4]==2}{%
+ \uppercase{&}}{%
+ \Block[l]{\fpeval{\ListeQuestionColonneUn[##4,1]}-1}{\ifboolKV[ClesFicheMemo]{Solution}{\ListeQuestionColonneUn[##4,3]}{}}\uppercase{&}\xdef\CountcolUn{\fpeval{\CountcolUn+1}}\Block[l]{\fpeval{\ListeQuestionColonneUn[##4,1]}-1}{\ListeQuestionColonneUn[##4,2]}%
+ }%
+ &%
+ \xintifboolexpr{\listlen\ListeQuestionColonneDeux[##4]==2}{%
+ \uppercase{&}%
+ }{%
+ \xdef\CountcolDeux{\fpeval{\CountcolDeux+1}}\Block[l]{\fpeval{\ListeQuestionColonneDeux[##4,1]}-1}{\ListeQuestionColonneDeux[##4,2]}\uppercase{&}\Block[l]{\fpeval{\ListeQuestionColonneDeux[##4,1]}-1}{\ifboolKV[ClesFicheMemo]{Solution}{\ListeQuestionColonneDeux[##4,3]}{}}%
+ }%
+ \\%
+ }%
+ \CodeAfter%
+ \tikz\node[xshift=0.5em] at (2-|1) {\scriptsize\faCut};%
+ \xdef\PfCCountCutUn{2}%
+ \xintFor* ##4 in {\xintSeq {1}{\ListeQuestionColonneUnlen}}\do{%
+ \xintifboolexpr{\listlen\ListeQuestionColonneUn[##4]==2}{%
+ }{%
+ \xdef\PfCCountCutUn{\fpeval{\PfCCountCutUn+\ListeQuestionColonneUn[##4,1]}}%
+ \tikz\node[xshift=0.5em] at (\fpeval{\PfCCountCutUn}-|1) {\scriptsize\faCut};%
+ }%
+ }%
+ \tikz\node[xshift=-0.5em] at (2-|last) {\scriptsize\rotatebox{180}{\faCut}};%
+ \xdef\PfCCountCutDeux{2}%
+ \xintFor* ##4 in {\xintSeq {1}{\ListeQuestionColonneDeuxlen}}\do{%
+ \xintifboolexpr{\listlen\ListeQuestionColonneDeux[##4]==2}{%
+ }{%
+ \xdef\PfCCountCutDeux{\fpeval{\PfCCountCutDeux+\ListeQuestionColonneDeux[##4,1]}}%
+ \tikz\node[xshift=-0.5em] at (\fpeval{\PfCCountCutDeux}-|last) {\scriptsize\rotatebox{180}{\faCut}};%
+ }%
+ }%
+ \tikz\node[xshift=0.5em] at (1-|1) {\color{gray}\scriptsize\faCut};%
+ \tikz\node[xshift=0.5em] at (last-|1) {\color{gray}\scriptsize\faCut};%
+ \tikz\node[xshift=-0.5em] at (1-|last) {\color{gray}\scriptsize\rotatebox{180}{\faCut}};%
+ \tikz\node[xshift=-0.5em] at (last-|last) {\color{gray}\scriptsize\rotatebox{180}{\faCut}};%
+ \tikz\node at (1.5-|2.5) {\bfseries\useKV[ClesFicheMemo]{TexteQuestions} 1 à \num{\CountcolUn}};%
+ \tikz\node at (1.5-|3.5) {\bfseries\useKV[ClesFicheMemo]{TexteQuestions} \num{\fpeval{\CountcolUn+1}} à \num{\fpeval{\CountcolUn+\CountcolDeux}}};%
+ \end{NiceTabular}%
+ \renewcommand{\arraystretch}{1}%
+}%
+
+%%%
% Op\'erations pos\'es à trou
%%%
%% D'après https://tex.stackexchange.com/questions/277246/drawing-a-circle-around-the-numbers-in-xlop-package
@@ -2465,7 +2915,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
%%%
% Qui suis-je
%%%
-\setKVdefault[Quisuisje]{Solution=false,Largeur=5mm,Colonnes=5,CodePerso=false}%
+\setKVdefault[Quisuisje]{Solution=false,Largeur=5mm,Colonnes=5,CodePerso=false,TexteA=Lettre,TexteB=R\'esultat du calcul}%
\newcommand\QuisuisjeEnonce{%
Chaque lettre du mot à découvrir porte un numéro qui correspond à un
@@ -2481,11 +2931,11 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
\readlist*\ListeQuisuisje{#2}%
\begin{NiceTabular}{|l|*{\ListeQuisuisjelen}{m{\useKV[Quisuisje]{Largeur}}|}}%
\hline
- Lettre\xintFor* ##1 in {\xintSeq {1}{\ListeQuisuisjelen}}\do{%
+ \useKV[Quisuisje]{TexteA}\xintFor* ##1 in {\xintSeq {1}{\ListeQuisuisjelen}}\do{%
&\centering\arraybackslash\ListeQuisuisje[##1,1]
}\\
\hline
- R\'esultat du calcul\xintFor* ##1 in {\xintSeq {1}{\ListeQuisuisjelen}}\do{%
+ \useKV[Quisuisje]{TexteB}\xintFor* ##1 in {\xintSeq {1}{\ListeQuisuisjelen}}\do{%
&\centering\arraybackslash\ListeQuisuisje[##1,2]
}\\
\hline
@@ -2919,16 +3369,16 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
\readlist*\ListeAutoQ{#2}%
% \setsepchar{§}
% \readlist*\ListeAutoR{#3}%
- \setsepchar[*]{§*/}
+ \setsepchar[*]{§*/}%
\readlist*\ListeAutoEn{#3}%
\clearpage
\begin{tikzpicture}[remember picture,overlay]%
\ifboolKV[Autonomie]{AfficheMarge}{%
- \node[xshift=5mm,yshift=-5mm,circle] (PfCA) at (current page.north west) {};
- \node[xshift=-5mm,yshift=5mm] (PfCB) at (current page.south east) {};
- \draw[blue,dashed] (PfCA) rectangle (PfCB);
+ \node[xshift=5mm,yshift=-5mm,circle] (PfCA) at (current page.north west) {};%
+ \node[xshift=-5mm,yshift=5mm] (PfCB) at (current page.south east) {};%
+ \draw[blue,dashed] (PfCA) rectangle (PfCB);%
}{}%
- \foreach \i in {1,...,3}{
+ \foreach \i in {1,...,3}{%
\coordinate[xshift=\i*0.25*\paperwidth] (A\i) at (current page.north west);%
\coordinate[xshift=\i*0.25*\paperwidth] (B\i) at (current page.south west);%
}
@@ -2939,53 +3389,53 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
\coordinate[yshift=-\i*0.25*\paperheight] (E\i) at (A3);%
}%
\ifboolKV[Autonomie]{Deux}{%
- \draw (C2) to (D2);
- \draw (E2) to (F2);
+ \draw (C2) to (D2);%
+ \draw (E2) to (F2);%
}{%
\foreach\i in{1,...,4}{%
- \draw (C\i) to (D\i);
- \draw (E\i) to (F\i);
+ \draw (C\i) to (D\i);%
+ \draw (E\i) to (F\i);%
}%
}%
- \coordinate (Q1) at ($(F1)!0.5!(A3)$);
- \coordinate (Q2) at ($(F2)!0.5!(E1)$);
- \coordinate (Q3) at ($(F3)!0.5!(E2)$);
- \coordinate (Q4) at ($(F4)!0.5!(E3)$);
- \coordinate (Q5) at ($(C1)!0.5!(A1)$);
- \coordinate (Q6) at ($(C2)!0.5!(D1)$);
- \coordinate (Q7) at ($(C3)!0.5!(D2)$);
- \coordinate (Q8) at ($(C4)!0.5!(D3)$);
+ \coordinate (Q1) at ($(F1)!0.5!(A3)$);%
+ \coordinate (Q2) at ($(F2)!0.5!(E1)$);%
+ \coordinate (Q3) at ($(F3)!0.5!(E2)$);%
+ \coordinate (Q4) at ($(F4)!0.5!(E3)$);%
+ \coordinate (Q5) at ($(C1)!0.5!(A1)$);%
+ \coordinate (Q6) at ($(C2)!0.5!(D1)$);%
+ \coordinate (Q7) at ($(C3)!0.5!(D2)$);%
+ \coordinate (Q8) at ($(C4)!0.5!(D3)$);%
\draw[dashed] (A1) to (B1);%
\draw[dashed] (A3) to (B3);%
\ifboolKV[Autonomie]{ARemplir}{%
\ifboolKV[Autonomie]{Deux}{%
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test1) at ($(Q1)!0.5!(Q2)$) {\ListeAutoQ[1,1]};
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test2) at ($(Q3)!0.5!(Q4)$) {\ListeAutoQ[2,1]};
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test3) at ($(Q5)!0.5!(Q6)$) {\ListeAutoQ[3,1]};
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test4) at ($(Q7)!0.5!(Q8)$) {\ListeAutoQ[4,1]};
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test1) at ($(Q1)!0.5!(Q2)$) {\ListeAutoQ[1,1]};%
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test2) at ($(Q3)!0.5!(Q4)$) {\ListeAutoQ[2,1]};%
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test3) at ($(Q5)!0.5!(Q6)$) {\ListeAutoQ[3,1]};%
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test4) at ($(Q7)!0.5!(Q8)$) {\ListeAutoQ[4,1]};%
}{%
\foreach \i in {1,...,4}{%
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test\i) at (Q\i) {\ListeAutoQ[\i,1]};
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test\i) at (Q\i) {\ListeAutoQ[\i,1]};%
}%
\foreach \i in {5,...,8}{%
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test\i) at (Q\i) {\ListeAutoQ[\i,1]};
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] (Test\i) at (Q\i) {\ListeAutoQ[\i,1]};%
}%
}%
}{%
\foreach \i in {1,...,4}{%
- \node[xshift=-5mm,align=justify,anchor=center,text width=0.8*0.25\textwidth] (Test\i) at (Q\i) {\ding{\fpeval{171+\i}}~\ListeAutoQ[\i,1]};
+ \node[xshift=-5mm,align=justify,anchor=center,text width=0.8*0.25\textwidth] (Test\i) at (Q\i) {\ding{\fpeval{171+\i}}~\ListeAutoQ[\i,1]};%
}%
\foreach \i in {5,...,8}{%
- \node[align=justify,anchor=center,text width=0.8*0.25\textwidth] (Test\i) at (Q\i) {\ding{\fpeval{171+\i}}~\ListeAutoQ[\i,1]};
+ \node[align=justify,anchor=center,text width=0.8*0.25\textwidth] (Test\i) at (Q\i) {\ding{\fpeval{171+\i}}~\ListeAutoQ[\i,1]};%
}%
}%
- \end{tikzpicture}
- \clearpage
+ \end{tikzpicture}%
+ \clearpage%
\begin{tikzpicture}[remember picture,overlay]%
\ifboolKV[Autonomie]{AfficheMarge}{%
- \node[xshift=5mm,yshift=-5mm,circle] (PfCA) at (current page.north west) {};
- \node[xshift=-5mm,yshift=5mm] (PfCB) at (current page.south east) {};
- \draw[blue,dashed] (PfCA) rectangle (PfCB);
+ \node[xshift=5mm,yshift=-5mm,circle] (PfCA) at (current page.north west) {};%
+ \node[xshift=-5mm,yshift=5mm] (PfCB) at (current page.south east) {};%
+ \draw[blue,dashed] (PfCA) rectangle (PfCB);%
}{}%
\foreach \i in {1,...,3}{%
\coordinate[xshift=\i*0.25*\paperwidth] (A\i) at (current page.north west);%
@@ -2999,83 +3449,83 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
\coordinate[yshift=-\i*0.25*\paperheight] (E\i) at (A3);%
}%
\ifboolKV[Autonomie]{Deux}{%
- \draw (C2) to (F2);
+ \draw (C2) to (F2);%
}{%
\foreach \i in{1,...,4}{%
- \draw (C\i) to (F\i);
+ \draw (C\i) to (F\i);%
}%
}%
- \coordinate (T1) at ($(current page.north west)!0.5!(A1)$);
- \coordinate (T2) at ($(C1)!0.5!(D1)$);
- \coordinate (T3) at ($(C2)!0.5!(D2)$);
- \coordinate (T4) at ($(C3)!0.5!(D3)$);
- \coordinate (T5) at ($(current page.north east)!0.5!(A3)$);
- \coordinate (T6) at ($(E1)!0.5!(F1)$);
- \coordinate (T7) at ($(E2)!0.5!(F2)$);
- \coordinate (T8) at ($(E3)!0.5!(F3)$);
- \coordinate (U1) at ($(C1)!0.5!(D1)$);
- \coordinate (U2) at ($(C2)!0.5!(D2)$);
- \coordinate (U3) at ($(C3)!0.5!(D3)$);
- \coordinate (U4) at ($(current page.south west)!0.5!(B1)$);
- \coordinate (U5) at ($(E1)!0.5!(F1)$);
- \coordinate (U6) at ($(E2)!0.5!(F2)$);
- \coordinate (U7) at ($(E3)!0.5!(F3)$);
- \coordinate (U8) at ($(B3)!0.5!(current page.south east)$);
- \coordinate (R1) at ($(D1)!0.5!(A2)$);
- \coordinate (R2) at ($(D2)!0.5!(G1)$);
- \coordinate (R3) at ($(D3)!0.5!(G2)$);
- \coordinate (R4) at ($(D4)!0.5!(G3)$);
- \coordinate (R5) at ($(E1)!0.5!(A2)$);
- \coordinate (R6) at ($(E2)!0.5!(G1)$);
- \coordinate (R7) at ($(E3)!0.5!(G2)$);
- \coordinate (R8) at ($(E4)!0.5!(G3)$);
- \coordinate (S1) at ($(A1)!0.5!(D1)$);
- \coordinate (S2) at ($(D1)!0.5!(D2)$);
- \coordinate (S3) at ($(D2)!0.5!(D3)$);
- \coordinate (S4) at ($(D3)!0.5!(B1)$);
- \coordinate (S5) at ($(R1)!0.5!(R5)$);
- \coordinate (S6) at ($(R2)!0.5!(R6)$);
- \coordinate (S7) at ($(R3)!0.5!(R7)$);
- \coordinate (S8) at ($(R4)!0.5!(R8)$);
- \coordinate (V1) at ($(T1)!0.5!(U1)$);
- \coordinate (V2) at ($(T2)!0.5!(U2)$);
- \coordinate (V3) at ($(T3)!0.5!(U3)$);
- \coordinate (V4) at ($(T4)!0.5!(U4)$);
- \coordinate (V5) at ($(T5)!0.5!(U5)$);
- \coordinate (V6) at ($(T6)!0.5!(U6)$);
- \coordinate (V7) at ($(T7)!0.5!(U7)$);
- \coordinate (V8) at ($(T8)!0.5!(U8)$);
+ \coordinate (T1) at ($(current page.north west)!0.5!(A1)$);%
+ \coordinate (T2) at ($(C1)!0.5!(D1)$);%
+ \coordinate (T3) at ($(C2)!0.5!(D2)$);%
+ \coordinate (T4) at ($(C3)!0.5!(D3)$);%
+ \coordinate (T5) at ($(current page.north east)!0.5!(A3)$);%
+ \coordinate (T6) at ($(E1)!0.5!(F1)$);%
+ \coordinate (T7) at ($(E2)!0.5!(F2)$);%
+ \coordinate (T8) at ($(E3)!0.5!(F3)$);%
+ \coordinate (U1) at ($(C1)!0.5!(D1)$);%
+ \coordinate (U2) at ($(C2)!0.5!(D2)$);%
+ \coordinate (U3) at ($(C3)!0.5!(D3)$);%
+ \coordinate (U4) at ($(current page.south west)!0.5!(B1)$);%
+ \coordinate (U5) at ($(E1)!0.5!(F1)$);%
+ \coordinate (U6) at ($(E2)!0.5!(F2)$);%
+ \coordinate (U7) at ($(E3)!0.5!(F3)$);%
+ \coordinate (U8) at ($(B3)!0.5!(current page.south east)$);%
+ \coordinate (R1) at ($(D1)!0.5!(A2)$);%
+ \coordinate (R2) at ($(D2)!0.5!(G1)$);%
+ \coordinate (R3) at ($(D3)!0.5!(G2)$);%
+ \coordinate (R4) at ($(D4)!0.5!(G3)$);%
+ \coordinate (R5) at ($(E1)!0.5!(A2)$);%
+ \coordinate (R6) at ($(E2)!0.5!(G1)$);%
+ \coordinate (R7) at ($(E3)!0.5!(G2)$);%
+ \coordinate (R8) at ($(E4)!0.5!(G3)$);%
+ \coordinate (S1) at ($(A1)!0.5!(D1)$);%
+ \coordinate (S2) at ($(D1)!0.5!(D2)$);%
+ \coordinate (S3) at ($(D2)!0.5!(D3)$);%
+ \coordinate (S4) at ($(D3)!0.5!(B1)$);%
+ \coordinate (S5) at ($(R1)!0.5!(R5)$);%
+ \coordinate (S6) at ($(R2)!0.5!(R6)$);%
+ \coordinate (S7) at ($(R3)!0.5!(R7)$);%
+ \coordinate (S8) at ($(R4)!0.5!(R8)$);%
+ \coordinate (V1) at ($(T1)!0.5!(U1)$);%
+ \coordinate (V2) at ($(T2)!0.5!(U2)$);%
+ \coordinate (V3) at ($(T3)!0.5!(U3)$);%
+ \coordinate (V4) at ($(T4)!0.5!(U4)$);%
+ \coordinate (V5) at ($(T5)!0.5!(U5)$);%
+ \coordinate (V6) at ($(T6)!0.5!(U6)$);%
+ \coordinate (V7) at ($(T7)!0.5!(U7)$);%
+ \coordinate (V8) at ($(T8)!0.5!(U8)$);%
\draw[dashed] (A1) to (B1);%
- \draw[dashed] (A2) to (B2);
+ \draw[dashed] (A2) to (B2);%
\draw[dashed] (A3) to (B3);%
\ifboolKV[Autonomie]{ARemplir}{%
\ifboolKV[Autonomie]{Deux}{%
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V1)!0.5!(V2)$) {\ListeAutoEn[1,1]};
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V3)!0.5!(V4)$) {\ListeAutoEn[2,1]};
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V5)!0.5!(V6)$) {\ListeAutoEn[3,1]};
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V7)!0.5!(V8)$) {\ListeAutoEn[4,1]};
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R1)!0.5!(R2)$) {\ListeAutoQ[1,2]};
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R3)!0.5!(R4)$) {\ListeAutoQ[2,2]};
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R5)!0.5!(R6)$) {\ListeAutoQ[3,2]};
- \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R7)!0.5!(R8)$) {\ListeAutoQ[4,2]};
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V1)!0.5!(V2)$) {\ListeAutoEn[1,1]};%
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V3)!0.5!(V4)$) {\ListeAutoEn[2,1]};%
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V5)!0.5!(V6)$) {\ListeAutoEn[3,1]};%
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V7)!0.5!(V8)$) {\ListeAutoEn[4,1]};%
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R1)!0.5!(R2)$) {\ListeAutoQ[1,2]};%
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R3)!0.5!(R4)$) {\ListeAutoQ[2,2]};%
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R5)!0.5!(R6)$) {\ListeAutoQ[3,2]};%
+ \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R7)!0.5!(R8)$) {\ListeAutoQ[4,2]};%
}{%
\foreach \i in {1,...,8}{%
- \node[text width=0.9*0.25\paperwidth] at (V\i) {\ListeAutoQ[\i,2]};
- \node[text width=0.9*0.25\paperwidth] at (R\i) {\ListeAutoEn[\i,1]};
+ \node[text width=0.9*0.25\paperwidth] at (V\i) {\ListeAutoQ[\i,2]};%
+ \node[text width=0.9*0.25\paperwidth] at (R\i) {\ListeAutoEn[\i,1]};%
}%
}%
}{%
\foreach \i in {1,...,8}{%
- \node[rotate=90,anchor=north] (Cor\i) at (S\i) {\useKV[Autonomie]{TexteCorrection}};
+ \node[rotate=90,anchor=north] (Cor\i) at (S\i) {\useKV[Autonomie]{TexteCorrection}};%
\node[anchor=west,xshift=2em,text width=0.8*0.25\paperwidth] (Test\i)
- at (S\i) {\ListeAutoQ[\i,2]};
+ 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) {%
- \ListeAutoEn[\i,2] : \pointilles\\
- Lettre \ding{\fpeval{171+\i}} : \pointilles
+ \ListeAutoEn[\i,2] : \pointilles\\%
+ Lettre \ding{\fpeval{171+\i}} : \pointilles%
};%
}{%
\node[anchor=south,yshift=1em,text width=0.85*0.25\paperwidth] (TestREn\i)
@@ -3084,9 +3534,9 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
};%
}%
}%
- }
- \end{tikzpicture}
-}
+ }%
+ \end{tikzpicture}%
+}%
%%%
% Calculatrice
@@ -3200,7 +3650,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
\def\MPCalculatrice#1#2#3{
% #1 Calcul %2 r\'eponse
\ifluatex
- \mplibforcehmode%
+ \mplibforcehmode%
\begin{mplibcode}%
input PfCCalculatrice;
LCD(#1)(#2)(#3);
@@ -6374,7 +6824,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
}%
}%
-\newcommand{\Resultat}[1][]{%
+\newcommand\Resultat[1][]{%
\setKV[ClesDistributivite]{#1}%On lit les arguments optionnels
\ensuremath{%
\Affichage{\SommeA}{\SommeB}{\SommeC}
@@ -9263,7 +9713,7 @@ vardef Positions(expr Step)=
% #6 hyp
% #7 angle de rotation
\ifluatex
- \mplibcodeinherit{enable}
+ \mplibcodeinherit{enable}
\mplibforcehmode
\begin{mplibcode}
u:=\useKV[ClesTrigo]{Echelle};
@@ -10795,7 +11245,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
\fi%
\fi%
\ifnum\k=\meda%
- La \the\meda\ieme{} valeur est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}\\Donc la m\'ediane de la s\'erie est \xdef\Mediane{\fpeval{(\Mediane+\ListeComplete[##1,1])/2}}\num{\Mediane}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}%
+ La \the\meda\ieme{} donn\'ee est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}\\Donc la m\'ediane de la s\'erie est \xdef\Mediane{\fpeval{(\Mediane+\ListeComplete[##1,1])/2}}\num{\Mediane}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}%
\fi%
}%
}%
@@ -13020,8 +13470,8 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
}
\newcommand\Fonction[2][]{%
- \useKVdefault[ClesFonction]
- \setKV[ClesFonction]{#1}
+ \useKVdefault[ClesFonction]%
+ \setKV[ClesFonction]{#1}%
\ifboolKV[ClesFonction]{Trace}{%
\useKVdefault[TraceG]%
\setKV[TraceG]{#1}%
@@ -13029,7 +13479,6 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
}{%
\ifboolKV[ClesFonction]{Points}{%
\toklistePtsFn{}%
- % \setsepchar[*]{,*/}%\ignoreemptyitems%
\setsepchar[*]{§*/}%\ignoreemptyitems%
\readlist*\ListePoints{#2}%
\ifboolKV[ClesFonction]{Tangentes}{%
@@ -13052,25 +13501,26 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
}%
}%
}{%
- \ignoreemptyitems%
- \readlist*\ListeFonction{#2}
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeFonction{#2}%
\StrSubstitute{\useKV[ClesFonction]{Calcul}}{\useKV[ClesFonction]{Variable}}{\i}[\temp]%
\StrSubstitute{\useKV[ClesFonction]{Calcul}}{**}{^}[\tempa]%
\StrSubstitute{\tempa}{*}{}[\tempab]%
\ifboolKV[ClesFonction]{Ecriture}{%
- \ensuremath{\useKV[ClesFonction]{Nom}(\useKV[ClesFonction]{Variable})=\tempab}
+ \ensuremath{\useKV[ClesFonction]{Nom}(\useKV[ClesFonction]{Variable})=\tempab}%
}{}%
\ifboolKV[ClesFonction]{Definition}{%
- \ensuremath{\useKV[ClesFonction]{Nom}:\useKV[ClesFonction]{Variable}\mapsto\tempab}
+ \ensuremath{\useKV[ClesFonction]{Nom}:\useKV[ClesFonction]{Variable}\mapsto\tempab}%
}{}%
\ifboolKV[ClesFonction]{Tableau}{%
\buildtabfonction%
}{}%
+ \reademptyitems%
}%
}%
}%
-\def\buildtabfonction{%\\
+\def\buildtabfonction{%
\[%
\begin{array}{|>{\columncolor{gray!15}}c|*{\number\numexpr\ListeFonctionlen}{>{\centering\arraybackslash}p{\useKV[ClesFonction]{Largeur}}|}}%
\hline
@@ -13078,9 +13528,9 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
\hline
\useKV[ClesFonction]{Nom}(\useKV[ClesFonction]{Variable})\xintFor* ##1 in {\xintSeq {1}{\ListeFonctionlen}}\do{& \StrSubstitute{\useKV[ClesFonction]{Calcul}}{\useKV[ClesFonction]{Variable}}{(\ListeFonction[##1])}[\tempab]\num{\fpeval{\tempab}}}
\\\hline
- \end{array}
- \]
-}
+ \end{array}%
+ \]%
+}%
%%%
% Diff\'erentes représentations graphiques
@@ -14513,7 +14963,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
%%%
% Proba
%%%
-\setKVdefault[ClesProba]{Echelle=false,Arbre=false,Branche=2,Angle=60,Rayon=0.25,LongueurEchelle=5,Affichage=0,Grille=1}
+\setKVdefault[ClesProba]{Echelle=false,Arbre=false,Branche=2,Angle=60,Rayon=0.25,LongueurEchelle=5,Affichage=0,Grille=1,Incline}
\def\Updatetoksproba#1/#2\nil{\addtotok\toklistepointproba{"#1","\footnotesize #2",}}
\def\Updatetoksprobaechelle#1/#2/#3\nil{\addtotok\toklistepointproba{#1,#2,"#3",}}
@@ -14666,6 +15116,8 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
% #3:Liste des \'ev\`enements/proba
\ifluatex
\begin{mplibcode}
+ boolean Incline;
+ Incline=\useKV[ClesProba]{Incline};
pair A[],B[];%les noeuds de l'arbre
Figure(-10u,-10u,10u,10u);
A0=u*(1,1);
@@ -14697,11 +15149,19 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
else:
if (l mod 2)=1:
if p_<>"":
+ if Incline:
draw appelation(A[(l-1) div 2],A[l],4mm,TEX(p_));
+ else:
+ label.ulft(TEX(p_),iso(A[(l-1) div 2],A[l]));
+ fi;
fi;
else:
if p_<>"":
+ if Incline:
draw appelation(A[(l-1) div 2],A[l],-4mm,TEX(p_));
+ else:
+ label.llft(TEX(p_),iso(A[(l-1) div 2],A[l]));
+ fi;
fi;
fi;
l:=l+1;
@@ -14712,7 +15172,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
toto(#3);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={input PfCGeometrie; boolean Incline; Incline=\useKV[ClesProba]{Incline};}]
pair A[],B[];%les noeuds de l'arbre
Figure(-10u,-10u,10u,10u);
A0=u*(1,1);
@@ -14737,13 +15197,27 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
vardef toto(text t)=
for p_=t:
if (n mod 2)=1:
+ if p_<>"":
label(LATEX(p_),A[k]);
+ fi;
k:=k+1;
else:
if (l mod 2)=1:
+ if p_<>"":
+ if Incline:
draw appelation(A[(l-1) div 2],A[l],4mm,LATEX(p_));
else:
+ label.ulft(LATEX(p_),iso(A[(l-1) div 2],A[l]));
+ fi;
+ fi;
+ else:
+ if p_<>"":
+ if Incline:
draw appelation(A[(l-1) div 2],A[l],-4mm,LATEX(p_));
+ else:
+ label.llft(LATEX(p_),iso(A[(l-1) div 2],A[l]));
+ fi;
+ fi;
fi;
l:=l+1;
fi;
@@ -16065,8 +16539,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
n:=n+1;
if p_<>"":
drawarrow (unitp*(valeur[n],-1))--(unitp*(valeur[n],-0.3));
- label.bot(btex \hbox to2em{\dotfill} etex,(unitp*(valeur[n],-1)));
- pointe(unitp*(valeur[n]-ValeurOrigine,0));
+ label.bot(btex \pointilles[2em] etex,(unitp*(valeur[n],-1)));
fi;
endfor;
elseif AffichageCoord=2:
@@ -16075,7 +16548,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
n:=n+1;
if p_<>"":
if ((ValeurUnitex*valeur[n]) mod pasx)<>0:
- label.bot(TEX("\footnotesize$\frac{\num{\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"}}}{\num{"&decimal(pasx)&"}}$"),unitp*(valeur[n],0));
+ label.bot(TEX("\footnotesize$\frac{\num{\fpeval{"&decimal(ValeurOrigine*pasx)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(valeur[n])&"}}}{\num{"&decimal(pasx)&"}}$"),unitp*(valeur[n],0));
else:
label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
fi;
@@ -16087,7 +16560,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
for p_=t:
n:=n+1;
if p_<>"":
- label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
pointe(unitp*(valeur[n],0));
fi;
endfor;
@@ -16163,8 +16636,8 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
n:=n+1;
if p_<>"":
drawarrow (unitp*(valeur[n],-1))--(unitp*(valeur[n],-0.3));
- label.bot(btex \noexpand\hbox to2em{\noexpand\dotfill} etex,(unitp*(valeur[n],-1)));
- pointe(unitp*(valeur[n]-ValeurOrigine,0));
+ label.bot(btex \noexpand\hbox to2em{\noexpand\pointilles[2em]} etex,(unitp*(valeur[n],-1)));
+ %pointe(unitp*(valeur[n]-ValeurOrigine,0));
fi;
endfor;
elseif AffichageCoord=2:
@@ -16173,7 +16646,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
n:=n+1;
if p_<>"":
if ((ValeurUnitex*valeur[n]) mod pasx)<>0:
- label.bot(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{\noexpand\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"}}}{\noexpand\num{"&decimal(pasx)&"}}$"),unitp*(valeur[n],0));
+ label.bot(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{\noexpand\fpeval{"&decimal(ValeurOrigine*pasx)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(valeur[n])&"}}}{\noexpand\num{"&decimal(pasx)&"}}$"),unitp*(valeur[n],0));
else:
label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
fi;
@@ -16185,7 +16658,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
for p_=t:
n:=n+1;
if p_<>"":
- label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
pointe(unitp*(valeur[n],0));
fi;
endfor;
@@ -16461,13 +16934,13 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
\foreachitem\compteur\in\ListePointDroite{\expandafter\Updatetoksdemidroite\compteur\nil}%
\foreachitem\compteur\in\ListePointDroite{\xdef\Listedesvaleursaplacersurlademidroite{\Listedesvaleursaplacersurlademidroite,\ListePointDroite[\compteurcnt,1]}}%
%\Listedesvaleursaplacersurlademidroite%
- \[\MPNewDEMIGraduee{\Listedesvaleursaplacersurlademidroite}{\the\toklistenompointdemidroite}\]%
+ \MPNewDEMIGraduee{\Listedesvaleursaplacersurlademidroite}{\the\toklistenompointdemidroite}%
}{%
\foreachitem\compteur\in\ListePointDroite{\expandafter\Updatetoksdemidroite\compteur\nil}%
\xdef\Listedesvaleursaplacersurlademidroite{}%
\foreachitem\compteur\in\ListePointDroite{\xdef\Listedesvaleursaplacersurlademidroite{\Listedesvaleursaplacersurlademidroite,\ListePointDroite[\compteurcnt,1]}}%
%\Listedesvaleursaplacersurlademidroite%
- \[\MPNewDROITEGraduee{\Listedesvaleursaplacersurlademidroite}{\the\toklistenompointdemidroite}\]%
+ \MPNewDROITEGraduee{\Listedesvaleursaplacersurlademidroite}{\the\toklistenompointdemidroite}%
}%
}%
@@ -17935,7 +18408,7 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O
\end{center}%
\end{minipage}};%
\node[yshift=-0.5em-0.5\hauteurtitre] (B) at (A){};%
- \ifboolKV[Cards]{Titre}{\node[fill=white] at (B) {\useKV[Cards]{NomTitre}};}{},%
+ \ifboolKV[Cards]{Titre}{\node[fill=white] at (B) {\useKV[Cards]{NomTitre}};}{}%
}%
}%