From 42a6a66cf489d90b1f6f8b9d0ba1d5401239d05b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 10 Sep 2022 20:10:52 +0000 Subject: profcollege (10sep22) git-svn-id: svn://tug.org/texlive/trunk@64334 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/profcollege/ProfCollege.sty | 481 +++++++++++++++------ 1 file changed, 360 insertions(+), 121 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty b/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty index 9636b935d43..8f8525a8041 100644 --- a/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty +++ b/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty @@ -2,9 +2,9 @@ % licence : Released under the LaTeX Project Public License v1.3c % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e}% -\def\filedate{2022/08/30}% +\def\filedate{2022/09/10}% \let\PfCfiledate\filedate% -\def\fileversion{0.99-y}% +\def\fileversion{0.99-z}% \let\PfCfileversion\fileversion% \ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college] @@ -346,6 +346,89 @@ \day=\the\PfCrappeljour\relax% } +%%% +% Calculs Croises +%%% +\setKVdefault[CalculsCroises]{Largeur=20pt,Solution=false,Inverse=false,Creation=false,Graines=false,Vide=false,Couleur=LightGray,Negatifs=false} +\defKV[CalculsCroises]{Graine=\setKV[CalculsCroises]{Graines}}% + +\newlength\PfCCalculsCroises% +\NewDocumentCommand\CalculsCroises{o m}{% + \useKVdefault[CalculsCroises]% + \savecomparemode% + \comparestrict% + \setKV[CalculsCroises]{#1}% + \colorlet{PfCCouleurCC}{\useKV[CalculsCroises]{Couleur}}% + \setlength{\PfCCalculsCroises}{\useKV[CalculsCroises]{Largeur}+\tabcolsep}% + \ifboolKV[CalculsCroises]{Inverse}{\setKV[CalculsCroises]{Solution}}{}% + \ifboolKV[CalculsCroises]{Creation}{% + \ifboolKV[CalculsCroises]{Graines}{\PfCGraineAlea{\useKV[CalculsCroises]{Graine}}}{}% + \ifboolKV[CalculsCroises]{Negatifs}{% + \xdef\PfCCCFoo{-1,-2,-3,-4,-5,-6,-7,-8,-9}% + }{% + \xdef\PfCCCFoo{1,2,3,4,5,6,7,8,9}% + }% + \MelangeListe{\PfCCCFoo}{9}% + \setsepchar{,}% + \readlist*\PfCListeCCNb{\faa}% + \readlist*\PfCListeCCOp{#2}% + \begin{NiceTabular}{*{6}{m{\useKV[CalculsCroises]{Largeur}}}} + \rule{0pt}{\PfCCalculsCroises}\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCNb[1]}}{~}}&\StrCompare{\PfCListeCCOp[1]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[1]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCNb[2]}}{~}}&\StrCompare{\PfCListeCCOp[2]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[2]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCNb[3]}}{~}}&\Block[borders={bottom,right,top},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCNb[1]\PfCListeCCOp[1]\PfCListeCCNb[2]\PfCListeCCOp[2]\PfCListeCCNb[3]}}}}\\ + \rule{0pt}{\PfCCalculsCroises}\StrCompare{\PfCListeCCOp[3]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[3]$}}&\Block[fill=black]{}{~}&\StrCompare{\PfCListeCCOp[4]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[4]$}}&\Block[fill=black]{}{~}&\StrCompare{\PfCListeCCOp[5]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[5]$}}\\ + \rule{0pt}{\PfCCalculsCroises}\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCNb[4]}}{~}}&\StrCompare{\PfCListeCCOp[6]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[6]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCNb[5]}}{~}}&\StrCompare{\PfCListeCCOp[7]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[7]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCNb[6]}}{~}}&\Block[borders={bottom,right,top},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCNb[4]\PfCListeCCOp[6]\PfCListeCCNb[5]\PfCListeCCOp[7]\PfCListeCCNb[6]}}}}\\ + \rule{0pt}{\PfCCalculsCroises}\StrCompare{\PfCListeCCOp[8]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[8]$}}&\Block[fill=black]{}{~}&\StrCompare{\PfCListeCCOp[9]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[9]$}}&\Block[fill=black]{}{~}&\StrCompare{\PfCListeCCOp[10]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[10]$}}\\ + \rule{0pt}{\PfCCalculsCroises}\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCNb[7]}}{~}}&\StrCompare{\PfCListeCCOp[11]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[11]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCNb[8]}}{~}}&\StrCompare{\PfCListeCCOp[12]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[12]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCNb[9]}}{~}}&\Block[borders={bottom,right,top},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCNb[7]\PfCListeCCOp[11]\PfCListeCCNb[8]\PfCListeCCOp[12]\PfCListeCCNb[9]}}}}\\ + \rule{0pt}{\PfCCalculsCroises}\Block[borders={left,bottom,right},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCNb[1]\PfCListeCCOp[3]\PfCListeCCNb[4]\PfCListeCCOp[8]\PfCListeCCNb[7]}}}}&&\Block[borders={left,bottom,right},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCNb[2]\PfCListeCCOp[4]\PfCListeCCNb[5]\PfCListeCCOp[9]\PfCListeCCNb[8]}}}}&&\Block[borders={left,bottom,right},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCNb[3]\PfCListeCCOp[5]\PfCListeCCNb[6]\PfCListeCCOp[10]\PfCListeCCNb[9]}}}}\\ + \CodeAfter + \tikz\draw (1-|1) rectangle (6-|6); + \xintFor* ##1 in{\xintSeq{2}{5}}\do{% + \tikz\draw (1-|##1) -- (6-|##1); + }% + \xintFor* ##1 in{\xintSeq{2}{5}}\do{% + \tikz\draw (##1-|1) -- (##1-|6); + }% + \end{NiceTabular} + }{% + \ifboolKV[CalculsCroises]{Vide}{% + \begin{NiceTabular}{*{6}{m{\useKV[CalculsCroises]{Largeur}}}} + \rule{0pt}{\PfCCalculsCroises}\Block{}{}&\Block{}{}&\Block{}{}&\Block{}{}&\Block{}{}&\Block[borders={bottom,right,top},fill=PfCCouleurCC]{}{}\\ + \rule{0pt}{\PfCCalculsCroises}\Block{}{}&\Block[fill=black]{}{}&\Block{}{}&\Block[fill=black]{}{}&\Block{}{}\\ + \rule{0pt}{\PfCCalculsCroises}\Block{}{}&\Block{}{}&\Block{}{}&\Block{}{}&\Block{}{}&\Block[borders={bottom,right,top},fill=PfCCouleurCC]{}{}\\ + \rule{0pt}{\PfCCalculsCroises}\Block{}{}&\Block[fill=black]{}{}&\Block{}{}&\Block[fill=black]{}{}&\Block{}{}\\ + \rule{0pt}{\PfCCalculsCroises}\Block{}{}&\Block{}{}&\Block{}{}&\Block{}{}&\Block{}{}&\Block[borders={bottom,right,top},fill=PfCCouleurCC]{}{}\\ + \rule{0pt}{\PfCCalculsCroises}\Block[borders={left,bottom,right},fill=PfCCouleurCC]{}{}&&\Block[borders={left,bottom,right},fill=PfCCouleurCC]{}{}&&\Block[borders={left,bottom,right},fill=PfCCouleurCC]{}{}\\ + \CodeAfter + \tikz\draw (1-|1) rectangle (6-|6); + \xintFor* ##1 in{\xintSeq{2}{5}}\do{% + \tikz\draw (1-|##1) -- (6-|##1); + }% + \xintFor* ##1 in{\xintSeq{2}{5}}\do{% + \tikz\draw (##1-|1) -- (##1-|6); + }% + \end{NiceTabular} + }{% + \readlist*\PfCListeCCOp{#2}% + \begin{NiceTabular}{*{6}{m{\useKV[CalculsCroises]{Largeur}}}} + \rule{0pt}{\PfCCalculsCroises}\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCOp[1]}}{~}}&\StrCompare{\PfCListeCCOp[2]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[2]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCOp[3]}}{~}}&\StrCompare{\PfCListeCCOp[4]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[4]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCOp[5]}}{~}}&\Block[borders={bottom,right,top},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCOp[1]\PfCListeCCOp[2]\PfCListeCCOp[3]\PfCListeCCOp[4]\PfCListeCCOp[5]}}}}\\ + \rule{0pt}{\PfCCalculsCroises}\StrCompare{\PfCListeCCOp[6]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[6]$}}&\Block[fill=black]{}{~}&\StrCompare{\PfCListeCCOp[7]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[7]$}}&\Block[fill=black]{}{~}&\StrCompare{\PfCListeCCOp[8]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[8]$}}\\ + \rule{0pt}{\PfCCalculsCroises}\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCOp[9]}}{~}}&\StrCompare{\PfCListeCCOp[10]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[10]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCOp[11]}}{~}}&\StrCompare{\PfCListeCCOp[12]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[12]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCOp[13]}}{~}}&\Block[borders={bottom,right,top},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCOp[9]\PfCListeCCOp[10]\PfCListeCCOp[11]\PfCListeCCOp[12]\PfCListeCCOp[13]}}}}\\ + \rule{0pt}{\PfCCalculsCroises}\StrCompare{\PfCListeCCOp[14]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[14]$}}&\Block[fill=black]{}{~}&\StrCompare{\PfCListeCCOp[15]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[15]$}}&\Block[fill=black]{}{~}&\StrCompare{\PfCListeCCOp[16]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[16]$}}\\ + \rule{0pt}{\PfCCalculsCroises}\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCOp[17]}}{~}}&\StrCompare{\PfCListeCCOp[18]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[18]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCOp[19]}}{~}}&\StrCompare{\PfCListeCCOp[20]}{*}[\PfCTestEtoile]\Block{}{\xintifboolexpr{\PfCTestEtoile==0}{$\times$}{$\PfCListeCCOp[20]$}}&\Block{}{\ifboolKV[CalculsCroises]{Solution}{\num{\PfCListeCCOp[21]}}{~}}&\Block[borders={bottom,right,top},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCOp[17]\PfCListeCCOp[18]\PfCListeCCOp[19]\PfCListeCCOp[20]\PfCListeCCOp[21]}}}}\\ + \rule{0pt}{\PfCCalculsCroises}\Block[borders={left,bottom,right},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCOp[1]\PfCListeCCOp[6]\PfCListeCCOp[9]\PfCListeCCOp[14]\PfCListeCCOp[17]}}}}&&\Block[borders={left,bottom,right},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCOp[3]\PfCListeCCOp[7]\PfCListeCCOp[11]\PfCListeCCOp[15]\PfCListeCCOp[19]}}}}&&\Block[borders={left,bottom,right},fill=PfCCouleurCC]{}{\ifboolKV[CalculsCroises]{Inverse}{}{\num{\fpeval{\PfCListeCCOp[5]\PfCListeCCOp[8]\PfCListeCCOp[13]\PfCListeCCOp[16]\PfCListeCCOp[21]}}}}\\ + \CodeAfter + \tikz\draw (1-|1) rectangle (6-|6); + \xintFor* ##1 in{\xintSeq{2}{5}}\do{% + \tikz\draw (1-|##1) -- (6-|##1); + }% + \xintFor* ##1 in{\xintSeq{2}{5}}\do{% + \tikz\draw (##1-|1) -- (##1-|6); + }% + \end{NiceTabular} + }% + }% + \restorecomparemode% +}% + %%% % Shikaku %%% @@ -795,6 +878,7 @@ \setKV[ClesPixelArt]{#1}% \xdef\ListeAvantCouleurs{\useKV[ClesPixelArt]{ListeCouleurs}}% \xdef\ListeAvantNombres{\useKV[ClesPixelArt]{ListeNombres}}% + \setsepchar{,}% \readlist*\ListePANombre{\ListeAvantNombres}% \foreachitem\compteur\in\ListePANombre{\expandafter\UpdatetoksPANombre\compteur\nil}% \BuildPixelArt{#2}{\useKV[ClesPixelArt]{Lettres}}{\ListeAvantCouleurs}{\the\toklistePANombre}% @@ -2104,6 +2188,7 @@ }% \MelangeListe{\CANSGFoo}{#1}% \readlist*\SommetsMelanges{\faa}% + \readlist*\PtAlea{\faa}% }% \newcommand\ExtraitFruit[1]{% @@ -4361,26 +4446,26 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, \newcommand\TableMultiplicationCompleteColore{% \xdef\NbColTabMul{\fpeval{\useKV[Tables]{Fin}+1-\useKV[Tables]{Debut}}}% - \begin{tabular}{|>{\columncolor{gray!15}\centering\arraybackslash}p{1.5em}|*{\NbColTabMul}{>{\centering\arraybackslash}p{1.5em}|}}% + \begin{tabular}{|>{\columncolor{gray!15}\centering}p{15pt}|*{\NbColTabMul}{>{\centering\arraybackslash}p{15pt}|}}% \hline $\times$\xintFor* ##1 in {\xintSeq {\useKV[Tables]{Debut}}{\useKV[Tables]{Fin}}}\do{% - &\cellcolor{gray!15}\fpeval{##1} + &\cellcolor{gray!15}\fpeval{##1}% } \\ \hline \xintFor* ##1 in {\xintSeq {0}{10}}\do{% ##1\xintFor* ##2 in {\xintSeq {\useKV[Tables]{Debut}}{\useKV[Tables]{Fin}}}\do{% - &\xintifboolexpr{##2<##1}{\cellcolor{\useKV[Tables]{Couleur}!\fpeval{##1*10}}}{\xintifboolexpr{##2>##1}{\cellcolor{\useKV[Tables]{Couleur}!\fpeval{##2*10}}}{}}\fpeval{##2*##1} - } + &\xintifboolexpr{##2<##1}{\cellcolor{\useKV[Tables]{Couleur}!\fpeval{##1*10}}}{\xintifboolexpr{##2>##1}{\cellcolor{\useKV[Tables]{Couleur}!\fpeval{##2*10}}}{}}\fpeval{##2*##1}% + }% \\ \hline - } + }% \end{tabular}% -} +}% \newcommand\TableAdditionComplete{% \xdef\NbColTabMul{\fpeval{\useKV[Tables]{Fin}+1-\useKV[Tables]{Debut}}}% - \begin{tabular}{|>{\columncolor{gray!15}\centering\arraybackslash}p{1.5em}|*{\NbColTabMul}{>{\centering\arraybackslash}p{1.5em}|}}% + \begin{tabular}{|>{\columncolor{gray!15}\centering}p{15pt}|*{\NbColTabMul}{>{\centering\arraybackslash}p{15pt}|}}% \hline $+$\xintFor* ##1 in {\xintSeq {\useKV[Tables]{Debut}}{\useKV[Tables]{Fin}}}\do{% &\cellcolor{gray!15}\fpeval{##1} @@ -4437,13 +4522,130 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, }% }% -\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm} +%%% +% Defi Table +%%% + +\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm,Graines=false,Creation=false} +\defKV[DefiTable]{Graine=\setKV[DefiTable]{Graines}}% + +\newcommand\MelangeListeNew[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}% + }% + \reademptyitems% +}% + +\newcommand\DefiTableNombreLettreduCode[1]{% + \xdef\ListeDesCaracteresFoo{a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/à/é/è/ê/ï/î/ô/ö/ù/ç/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/À/É/È/,/$?$/$;$/./$!$/$:$/-} + \savecomparemode% + \comparestrict% + \xdef\PfCFooDepart{} + \StrLen{#1}[\LongueurMot]% + \xintFor* ##1 in{\xintSeq{1}{\LongueurMot}}\do{% + \StrChar{#1}{##1}[\LettreMot] + \xdef\PfCFooDepart{\PfCFooDepart \LettreMot/} + }% + \setsepchar[*]{/}\reademptyitems% + \readlist*\ListeDesLettres{\PfCFooDepart}% + \xdef\PfCFooArrivee{\ListeDesLettres[1]}% + \xintFor* ##1 in{\xintSeq{2}{\LongueurMot}}\do{% + \StrCompare{\ListeDesLettres[##1]}{\\}[\PfCRetiensEtoile] + \StrCompare{\ListeDesLettres[##1]}{ }[\PfCRetiensPara] + \xintifboolexpr{\PfCRetiensEtoile==0 || \PfCRetiensPara==0}{}{% + \xdef\PfCTotal{0}% + \xintFor* ##2 in{\xintSeq{1}{\fpeval{##1-1}}}\do{% + \StrCompare{\ListeDesLettres[##1]}{\ListeDesLettres[##2]}[\PfCRetiens] + \xdef\PfCTotal{\fpeval{\PfCTotal+\PfCRetiens}}% + }% + \xintifboolexpr{\PfCTotal==\fpeval{##1-1}}{\xdef\PfCFooArrivee{\PfCFooArrivee/\ListeDesLettres[##1]}}{}% + }% + }% + %Arrivee = \PfCFooArrivee\par + \setsepchar[*]{/}\ignoreemptyitems% + \readlist*\ListeDesLettresUniques{\PfCFooArrivee}% + %La liste des lettres uniques ainsi créée :\par + %\showitems\ListeDesLettresUniques[]% + % Il faut retirer les lettres uniques de la liste des caracteres + \readlist*\ListeTotaleDesCaracteres{\ListeDesCaracteresFoo}% + %\par + %La liste totale des caractères est :\par + %\showitems\ListeTotaleDesCaracteres[] + %\par + \xdef\ListeCaracteresUniques{}% + \xintFor* ##1 in{\xintSeq{1}{\ListeTotaleDesCaractereslen}}\do{% + %Le caractère testé est \ListeTotaleDesCaracteres[##1]. On le compare à :% + \xdef\PfCTotal{0}% + \xintFor* ##2 in{\xintSeq{1}{\ListeDesLettresUniqueslen}}\do{% + \StrCompare{\ListeTotaleDesCaracteres[##1]}{\ListeDesLettresUniques[##2]}[\PfCRetiens] + \xdef\PfCTotal{\fpeval{\PfCTotal+\PfCRetiens}}% + }% + \xintifboolexpr{\PfCTotal==\ListeDesLettresUniqueslen}{\xdef\ListeCaracteresUniques{\ListeCaracteresUniques\ListeTotaleDesCaracteres[##1]/}}{}% + }% + %La liste des caractères uniques à ajouter + \MelangeListeNew{\ListeCaracteresUniques}{\fpeval{42-\ListeDesLettresUniqueslen}}% + %\par La liste des éléments à mélanger est :\par + \xdef\ListeDesCaracteresAUtiliser{} + \xintFor* ##1 in{\xintSeq{1}{\ListeDesLettresUniqueslen}}\do{% + \xdef\ListeDesCaracteresAUtiliser{\ListeDesCaracteresAUtiliser \ListeDesLettresUniques[##1]/}% + }% + \xdef\ListeDesCaracteresAUtiliser{\ListeDesCaracteresAUtiliser \faa} + \MelangeListeNew{\ListeDesCaracteresAUtiliser}{42} + %Finalement, on utilise ces caractères :\par + \ignoreemptyitems% + \readlist*\ListeFinaleDesCaracteres{\faa} + \xdef\ListeDesProduitsFoo{1/2/3/4/5/6/7/8/9/10/12/14/16/18/20/15/21/24/27/30/28/32/36/40/25/35/45/50/42/48/54/60/49/56/63/70/64/72/80/81/90/100} + \MelangeListeNew{\ListeDesProduitsFoo}{42} + %Les produits mélangés sont :\par + \readlist*\ListeDesProduits{\faa}% + \restorecomparemode + \reademptyitems +} \newcommand\DefiTable[2][]{% % 1 les clés % 2 la table de décodage \useKVdefault[DefiTable]% \setKV[DefiTable]{#1}% + \ifboolKV[DefiTable]{Creation}{ + \ifboolKV[DefiTable]{Graines}{\PfCGraineAlea{\useKV[DefiTable]{Graine}}}{}% + \DefiTableNombreLettreduCode{#2} + \begin{center} + \begin{tabular}{|>{\columncolor{gray!15}}c|*{10}{c|}} + \hline + \rowcolor{gray!15}$\times$&\xintFor* ##1 in {\xintSeq {1}{10}}\do{% + \xintifForFirst{}{&}##1% + }\\\hline% + \xintFor* ##1 in{\xintSeq{1}{10}}\do{% + ##1\xintFor* ##2 in{\xintSeq{1}{10}}\do{% + &\xintFor* ##3 in{\xintSeq{1}{42}}\do{% + \xintifboolexpr{\fpeval{##1*##2}==\ListeDesProduits[##3]}{\ListeFinaleDesCaracteres[##3]}{}% + }% + }\\\hline% + }% + \end{tabular}% + \end{center} + }{% \setsepchar[*]{§* }% \readlist*\ListeDefiTableCode{#2}% \begin{NiceTabular}{>{\columncolor{gray!15}}{c}*{10}{c}}[hvlines] @@ -4463,37 +4665,73 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, }% 10&\ListeDefiTableCode[1,10]&\ListeDefiTableCode[2,9]&\ListeDefiTableCode[3,8]&\ListeDefiTableCode[4,7]&\ListeDefiTableCode[5,6]&\ListeDefiTableCode[6,5]&\ListeDefiTableCode[7,4]&\ListeDefiTableCode[8,3]&\ListeDefiTableCode[9,2]&\ListeDefiTableCode[10,1]\\ \end{NiceTabular}% + }% }% \newcommand\DefiTableTexte[3][]{% \useKVdefault[DefiTable]% \setKV[DefiTable]{#1}% - \setsepchar[*]{§*/}% - \readlist*\ListeDefiTableTableau{#2}% - \xdef\ListeDefiTableMax{0}% - \setsepchar{§}% - \readlist*\ListeDefiTablePhrase{#3}% - \foreachitem\compteur\in\ListeDefiTableTableau{% - \xintifboolexpr{\ListeDefiTableMax<\listlen\ListeDefiTableTableau[\compteurcnt]}{\xdef\ListeDefiTableMax{\fpeval{\listlen\ListeDefiTableTableau[\compteurcnt]}}}{}% - }% - \begin{NiceTabular}{*{\fpeval{\ListeDefiTableMax}}{>{\centering\arraybackslash}m{\useKV[DefiTable]{LargeurT}}}} - \xintFor* ##1 in {\xintSeq {1}{\fpeval{\ListeDefiTableTableaulen}}}\do{% - \xintFor* ##2 in {\xintSeq {1}{\listlen\ListeDefiTableTableau[##1]}}\do{% - \xintifForFirst{}{&}\ifboolKV[DefiTable]{Solution}{% - \StrMid{\ListeDefiTablePhrase[##1]}{##2}{##2}[\DefiTableMaLettre]% - \IfStrEq{\DefiTableMaLettre}{*}{\Block[]{2-1}{}}{\Block[borders={bottom}]{2-1}{\StrMid{\ListeDefiTablePhrase[##1]}{##2}{##2}}}% - }{% - \IfStrEq{\ListeDefiTableTableau[##1,##2]}{*}{\Block[]{2-1}{}}{\Block[borders={bottom}]{2-1}{}}% - }%% - }\\ - \xintFor* ##2 in {\xintSeq {1}{\listlen\ListeDefiTableTableau[##1]}}\do{% - \xintifForFirst{}{&} - }\\ - \xintFor* ##2 in {\xintSeq {1}{\listlen\ListeDefiTableTableau[##1]}}\do{% - \xintifForFirst{}{&}\IfStrEq{\ListeDefiTableTableau[##1,##2]}{*}{}{\footnotesize\ifboolKV[DefiTable]{Math}{\ListeDefiTableTableau[##1,##2]}{\num{\ListeDefiTableTableau[##1,##2]}}}% - }\\ + \ifboolKV[DefiTable]{Creation}{% + \setsepchar[*]{\\* }% + \readlist*\ListeDefiTableTableau{#3}% + \xdef\ListeDefiTableMax{0}% + \xintFor* ##1 in{\xintSeq{1}{\ListeDefiTableTableaulen}}\do{% + \StrLen{\ListeDefiTableTableau[##1]}[\PfCDTLongueur]% + \xintifboolexpr{\ListeDefiTableMax<\PfCDTLongueur}{\xdef\ListeDefiTableMax{\fpeval{\PfCDTLongueur}}}{}%% }% - \end{NiceTabular}% + %\par Le max est \ListeDefiTableMax + \begin{NiceTabular}{*{\fpeval{\ListeDefiTableMax}}{>{\centering\arraybackslash}m{\useKV[DefiTable]{LargeurT}}}} + \xintFor* ##1 in {\xintSeq {1}{\fpeval{\ListeDefiTableTableaulen}}}\do{% + \StrLen{\ListeDefiTableTableau[##1]}[\PfCDTLongueur]% + \xintFor* ##2 in {\xintSeq {1}{\PfCDTLongueur}}\do{% + \xintifForFirst{}{&}% + \StrMid{\ListeDefiTableTableau[##1]}{##2}{##2}[\DefiTableMaLettre]% + \IfStrEq{\DefiTableMaLettre}{ }{\Block[]{1-1}{}}{\Block[borders={bottom}]{1-1}{\ifboolKV[DefiTable]{Solution}{\StrMid{\ListeDefiTableTableau[##1]}{##2}{##2}}{}}}% + }\\ + \StrLen{\ListeDefiTableTableau[##1]}[\PfCDTLongueur]% + \xintFor* ##2 in {\xintSeq {1}{\PfCDTLongueur}}\do{% + \xintifForFirst{}{&}% + \StrMid{\ListeDefiTableTableau[##1]}{##2}{##2}[\DefiTableMaLettre]% + \IfStrEq{\DefiTableMaLettre}{*}{}{% + \xintFor* ##3 in{\xintSeq{1}{42}}\do{% + \IfStrEq{\DefiTableMaLettre}{\ListeFinaleDesCaracteres[##3]}{\Block{}{\footnotesize\ListeDesProduits[##3]}}{}% + }% + }% + }\\ + \StrLen{\ListeDefiTableTableau[##1]}[\PfCDTLongueur]% + \xintFor* ##2 in {\xintSeq {1}{\PfCDTLongueur}}\do{% + \xintifForFirst{}{&} + }\\ + }% + \end{NiceTabular}% + }{% + \setsepchar[*]{§*/}% + \readlist*\ListeDefiTableTableau{#2}% + \xdef\ListeDefiTableMax{0}% + \setsepchar{§}% + \readlist*\ListeDefiTablePhrase{#3}% + \foreachitem\compteur\in\ListeDefiTableTableau{% + \xintifboolexpr{\ListeDefiTableMax<\listlen\ListeDefiTableTableau[\compteurcnt]}{\xdef\ListeDefiTableMax{\fpeval{\listlen\ListeDefiTableTableau[\compteurcnt]}}}{}% + }% + \begin{NiceTabular}{*{\fpeval{\ListeDefiTableMax}}{>{\centering\arraybackslash}m{\useKV[DefiTable]{LargeurT}}}} + \xintFor* ##1 in {\xintSeq {1}{\fpeval{\ListeDefiTableTableaulen}}}\do{% + \xintFor* ##2 in {\xintSeq {1}{\listlen\ListeDefiTableTableau[##1]}}\do{% + \xintifForFirst{}{&}\ifboolKV[DefiTable]{Solution}{% + \StrMid{\ListeDefiTablePhrase[##1]}{##2}{##2}[\DefiTableMaLettre]% + \IfStrEq{\DefiTableMaLettre}{*}{\Block[]{2-1}{}}{\Block[borders={bottom}]{2-1}{\StrMid{\ListeDefiTablePhrase[##1]}{##2}{##2}}}% + }{% + \IfStrEq{\ListeDefiTableTableau[##1,##2]}{*}{\Block[]{2-1}{}}{\Block[borders={bottom}]{2-1}{}}% + }%% + }\\ + \xintFor* ##2 in {\xintSeq {1}{\listlen\ListeDefiTableTableau[##1]}}\do{% + \xintifForFirst{}{&} + }\\ + \xintFor* ##2 in {\xintSeq {1}{\listlen\ListeDefiTableTableau[##1]}}\do{% + \xintifForFirst{}{&}\IfStrEq{\ListeDefiTableTableau[##1,##2]}{*}{}{\footnotesize\ifboolKV[DefiTable]{Math}{\ListeDefiTableTableau[##1,##2]}{\num{\ListeDefiTableTableau[##1,##2]}}}% + }\\ + }% + \end{NiceTabular}% + }% }% %%% @@ -5443,14 +5681,14 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, \setKV[ClesMotEmpile]{#1}% \setcounter{CompteurMotEmpile}{0}% \setsepchar[*]{,*/}% - \readlist*\ListeMotsEmpiles{#2} + \readlist*\ListeMotsEmpiles{#2}% \xdef\ListeMotsEmpilesMax{0}% \colorlet{MotEmpileCouleur}{\useKV[ClesMotEmpile]{Couleur}}% \foreachitem\compteur\in\ListeMotsEmpiles{% \StrLen{\ListeMotsEmpiles[\compteurcnt,2]}[\LongueurMot]% \xintifboolexpr{\ListeMotsEmpilesMax<\fpeval{\ListeMotsEmpiles[\compteurcnt,1]+\LongueurMot}}{\xdef\ListeMotsEmpilesMax{\fpeval{\ListeMotsEmpiles[\compteurcnt,1]+\LongueurMot}}}{}% }% - \begin{NiceTabular}{c|*{\fpeval{\ListeMotsEmpilesMax}}{m{0.5em}}} + \begin{NiceTabular}{c|*{\fpeval{\ListeMotsEmpilesMax}}{m{0.5em}}}% \Block{1-\fpeval{\useKV[ClesMotEmpile]{Colonne}+2}}{}\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesMotEmpile]{Colonne}}}}\do{&}&$\downarrow$\xintFor* ##1 in {\xintSeq {1}{\fpeval{\ListeMotsEmpilesMax-\useKV[ClesMotEmpile]{Colonne}-1}}}\do{&}\\ \xintFor* ##1 in {\xintSeq {1}{\fpeval{\ListeMotsEmpileslen}}}\do{% \rule[-1.2ex]{0pt}{3.8ex}\stepcounter{CompteurMotEmpile}\Alph{CompteurMotEmpile}&\Block{1-\fpeval{\ListeMotsEmpiles[##1,1]}}{}\xintFor* ##2 in {\xintSeq {1}{\fpeval{\ListeMotsEmpiles[##1,1]}}}\do{% @@ -5459,11 +5697,11 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, \StrLen{\ListeMotsEmpiles[##1,2]}[\LongueurMot]% \xintFor* ##3 in {\xintSeq {1}{\fpeval{\LongueurMot}}}\do{% \xintifForFirst{}{&}\Block[draw=black]{1-1}{\ifboolKV[ClesMotEmpile]{Solution}{\centering\arraybackslash\StrMid{\ListeMotsEmpiles[##1,2]}{##3}{##3}}{}}%% - } + }% \\ }% \CodeAfter\tikz\draw[line width=1.5pt,MotEmpileCouleur](row-2-|col-\fpeval{\useKV[ClesMotEmpile]{Colonne}+2}) rectangle (row-\fpeval{\ListeMotsEmpileslen+2}-|col-\fpeval{\useKV[ClesMotEmpile]{Colonne}+3}); - \end{NiceTabular} + \end{NiceTabular}% }% %%% Colorilude %%% @@ -9894,7 +10132,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \setKV[ClesDistributivite]{#1}%On lit les arguments optionnels \ensuremath{% \Affichage{\SommeA}{\SommeB}{\SommeC} - } + }% } \newcommand\AffichageEchange[4][]{% @@ -9915,8 +10153,8 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \newcommand\DistriEchange[5][]{% \ensuremath{% - \useKVdefault[ClesDistributivite]%obligatoire car la macro n'est pas dans un groupe. - \setKV[ClesDistributivite]{#1}%On lit les arguments optionnels + \useKVdefault[ClesDistributivite]% + \setKV[ClesDistributivite]{#1}% \ifboolKV[ClesDistributivite]{RAZ}{\xdef\SommeA{0}\xdef\SommeB{0}\xdef\SommeC{0}% \setcounter{NbCalculDistri}{0}% }{}% @@ -10160,8 +10398,8 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \xdef\Multil{\fpeval{#3*#5}}% %% ils sont red\'efinis pour pouvoir envisager la somme de deux %% expressions \`a d\'evelopper - \xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}% - \stepcounter{NbCalculDistri}% + % \xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}% + %\stepcounter{NbCalculDistri}% \xintifboolexpr{\useKV[ClesDistributivite]{Echange}==1}{% \xdef\Multim{\fpeval{#2*#4+#3*#5}}% \ifboolKV[ClesDistributivite]{Oppose}{% @@ -10191,7 +10429,8 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \xintifboolexpr{\Multimo==0}{}{\xintifboolexpr{\Multimo>0}{+}{+(}\Affichage{0}{\Multimo}{0}\xintifboolexpr{\Multimo<0}{)}{}}% \xintifboolexpr{\Multiko==0}{}{\xintifboolexpr{\Multiko>0}{+}{+(}\Affichage{0}{0}{\Multiko}\xintifboolexpr{\Multiko<0}{)}{}}% }{% - \xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multij<0}{(\Affichage{\Multij}{0}{0})}{\Affichage{\Multij}{0}{0}}}{\Affichage{\Multij}{0}{0}}% + \xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multij<0}{%%%%%%%%%%%%%%%%%%%%% + (\Affichage{\Multij}{0}{0})}{\Affichage{\Multij}{0}{0}}}{\Affichage{\Multij}{0}{0}}% \xintifboolexpr{\Multim==0}{}{% \xintifboolexpr{\Multim>0}{+\Affichage{0}{\Multim}{0}}{-\Affichage{0}{\fpeval{-\Multim}}{0}}% }% @@ -14615,7 +14854,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \ifnum\remainder=0% \PfCQuartileUn=\fpeval{\ListeCompletelen/4}% \else% - \PfCQuartileUn=\fpeval{ceil(\ListeCompletelen/4)+1}% + \PfCQuartileUn=\fpeval{ceil(\ListeCompletelen/4)}% \fi% \newcount\PfCQunk% \PfCQunk=0% @@ -14630,7 +14869,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \ifnum\remainder=0% \PfCQuartileTrois=\fpeval{3*\ListeCompletelen/4}% \else% - \PfCQuartileTrois=\fpeval{ceil(3*\ListeCompletelen/4)+1}% + \PfCQuartileTrois=\fpeval{ceil(3*\ListeCompletelen/4)}% \fi% \newcount\PfCQtroisk% \PfCQtroisk=0% @@ -14775,7 +15014,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \ifnum\remainder=0% \PfCQuartileUn=\fpeval{\EffectifTotal/4}% \else% - \PfCQuartileUn=\fpeval{ceil(\EffectifTotal/4)+1}% + \PfCQuartileUn=\fpeval{ceil(\EffectifTotal/4)}% \fi% \newcount\PfCQunk% \PfCQunk=0% @@ -14793,7 +15032,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \ifnum\remainder=0% \PfCQuartileTrois=\fpeval{3*\EffectifTotal/4}% \else% - \PfCQuartileTrois=\fpeval{ceil(3*\EffectifTotal/4)+1}% + \PfCQuartileTrois=\fpeval{ceil(3*\EffectifTotal/4)}% \fi% \newcount\PfCQtroisk% \PfCQtroisk=0% @@ -17744,7 +17983,6 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \begin{mplibcode} drawoptions( dashed dashpattern(on1cm)); typetrace:="3D"; - Figure(-10u,-10u,10u,10u); Initialisation(5,0,10,\useKV[ClesFormule]{EchelleEspace}); color O,A,B,C; O=(0,0,0); @@ -21443,9 +21681,9 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V %%% \setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1} -\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\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 \newlength\PfCTableauPuissances% @@ -22463,26 +22701,26 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V \ifboolKV[ClesTableaux]{Carre}{% \[\renewcommand{\arraystretch}{1.15}% \begin{NiceTabular}{*{7}{wc{3.5mm}wc{3.5mm}}}% - \Block[]{1-2}{} - &&\Block[]{1-2}{} - &&\Block[]{1-2}{} - &&\Block[]{1-2}{} - &&\Block[]{1-2}{} - &&\Block[]{1-2}{} + \Block[]{1-2}{}% + &&\Block[]{1-2}{}% + &&\Block[]{1-2}{}% + &&\Block[]{1-2}{}% + &&\Block[]{1-2}{}% + &&\Block[]{1-2}{}% &&\Block[]{1-2}{}\\ - \Block[borders={left,top,right}]{1-2}{km$^2$\PfCTBstrut}&&\Block[borders={left,top,right}]{1-2}{hm$^2$\PfCTBstrut}&&\Block[borders={left,top,right}]{1-2}{dam$^2$\PfCTBstrut}&&\Block[borders={left,top,right}]{1-2}{m$^2$\PfCTBstrut}&&\Block[borders={left,top,right}]{1-2}{dm$^2$\PfCTBstrut}&&\Block[borders={left,top,right}]{1-2}{cm$^2$\PfCTBstrut}&&\Block[borders={left,top,right}]{1-2}{mm$^2$\PfCTBstrut}&\\ + \Block[borders={left,top,right}]{1-2}{km$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{hm$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{dam$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{m$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{dm$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{cm$^2$\PfCTBstrut}&&\Block[borders={top,right}]{1-2}{mm$^2$\PfCTBstrut}&\\ \ifboolKV[ClesTableaux]{Are}{% - \Block[borders={left,right,bottom}]{1-2}{}&&\Block[draw=gray!50,borders={left,top,bottom}]{1-1}{}&\Block[borders={top,right,bottom}]{1-1}{\scriptsize ha}&\Block[draw=gray!50,borders={left,top,bottom}]{1-1}{}&\Block[borders={top,right,bottom}]{1-1}{\scriptsize a}&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&\\ + \Block[borders={left,right,bottom}]{1-2}{}&&\Block[draw=gray!50,borders={left,top,bottom}]{}{~}&\Block[borders={top,right,bottom}]{}{\scriptsize ha}&\Block[draw=gray!50,borders={left,top,bottom}]{}{~}&\Block[borders={top,right,bottom}]{}{\scriptsize a}&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&\\ }{\hline}% \xintFor* ##1 in {\xintSeq {1}{\useKV[ClesTableaux]{NbLignes}}}\do{% &&&&&&&&&&&&&\\ }% - \Block[]{1-2}{} - &&\Block[]{1-2}{} - &&\Block[]{1-2}{} - &&\Block[]{1-2}{} - &&\Block[]{1-2}{} - &&\Block[]{1-2}{} + \Block[]{1-2}{}% + &&\Block[]{1-2}{}% + &&\Block[]{1-2}{}% + &&\Block[]{1-2}{}% + &&\Block[]{1-2}{}% + &&\Block[]{1-2}{}% &&\Block[]{1-2}{}\\ \CodeAfter % on trace les lignes verticales @@ -22539,26 +22777,26 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V \[\renewcommand{\arraystretch}{1.15}% \setlength{\tabcolsep}{0.625\tabcolsep}% \begin{NiceTabular}{*{7}{wc{3.5mm}wc{3.5mm}wc{3.5mm}}} - \Block[]{1-3}{} - &&&\Block[]{1-3}{} - &&&\Block[]{1-3}{} - &&&\Block[]{1-3}{} - &&&\Block[]{1-3}{} - &&&\Block[]{1-3}{} + \Block[]{1-3}{}% + &&&\Block[]{1-3}{}% + &&&\Block[]{1-3}{}% + &&&\Block[]{1-3}{}% + &&&\Block[]{1-3}{}% + &&&\Block[]{1-3}{}% &&&\Block[]{1-3}{}\\ - \Block[borders={left,top,right}]{1-3}{km$^3$\PfCTBstrut}&&&\Block[borders={left,top,right}]{1-3}{hm$^3$\PfCTBstrut}&&&\Block[borders={left,top,right}]{1-3}{dam$^3$\PfCTBstrut}&&&\Block[borders={left,top,right}]{1-3}{m$^3$\PfCTBstrut}&&&\Block[borders={left,top,right}]{1-3}{dm$^3$\PfCTBstrut}&&&\Block[borders={left,top,right}]{1-3}{cm$^3$\PfCTBstrut}&&&\Block[borders={left,top,right}]{1-3}{mm$^3$\PfCTBstrut}&&\\ + \Block[borders={left,top,right}]{1-3}{km$^3$\PfCTBstrut}&&&\Block[borders={top,right}]{1-3}{hm$^3$\PfCTBstrut}&&&\Block[borders={top,right}]{1-3}{dam$^3$\PfCTBstrut}&&&\Block[borders={top,right}]{1-3}{m$^3$\PfCTBstrut}&&&\Block[borders={top,right}]{1-3}{dm$^3$\PfCTBstrut}&&&\Block[borders={top,right}]{1-3}{cm$^3$\PfCTBstrut}&&&\Block[borders={top,right}]{1-3}{mm$^3$\PfCTBstrut}&&\\ \ifboolKV[ClesTableaux]{Capacite}{% - \Block[borders={left,right,bottom}]{1-3}{}&&&\Block[borders={left,right,bottom}]{1-3}{}&&&\Block[borders={left,right,bottom}]{1-3}{}&&&\Block[borders={left,right,bottom}]{1-3}{}&&&\Block[draw=gray!50,borders={top,left,bottom}]{}{\scriptsize hL}&\Block[draw=gray!50,borders={top,bottom},l]{}{\scriptsize daL}&\Block[draw=gray!50,borders={top,right,bottom}]{}{\scriptsize L}&\Block[draw=gray!50,borders={top,left,bottom}]{}{\scriptsize dL}&\Block[draw=gray!50,borders={top,bottom}]{}{\scriptsize cL}&\Block[draw=gray!50,borders={top,right,bottom}]{}{\scriptsize mL}&\Block[borders={left,right,bottom}]{1-3}{}&&\\ + \Block[borders={left,right,bottom}]{1-3}{}&&&\Block[borders={right,bottom}]{1-3}{}&&&\Block[borders={right,bottom}]{1-3}{}&&&\Block[borders={right,bottom}]{1-3}{}&&&\Block[draw=gray!50,borders={top,left,bottom}]{}{\scriptsize hL}&\Block[draw=gray!50,borders={top,bottom},l]{}{\scriptsize daL}&\Block[draw=gray!50,borders={top,right,bottom}]{}{\scriptsize L}&\Block[draw=gray!50,borders={top,left,bottom}]{}{\scriptsize dL}&\Block[draw=gray!50,borders={top,bottom}]{}{\scriptsize cL}&\Block[draw=gray!50,borders={top,right,bottom}]{}{\scriptsize mL}&\Block[borders={right,bottom}]{1-3}{}&&\\ }{\hline}% \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesTableaux]{NbLignes}}}\do{% &&&&&&&&&&&&&&&&&&&&\\ }% - \Block[]{1-3}{} - &&&\Block[]{1-3}{} - &&&\Block[]{1-3}{} - &&&\Block[]{1-3}{} - &&&\Block[]{1-3}{} - &&&\Block[]{1-3}{} + \Block[]{1-3}{}% + &&&\Block[]{1-3}{}% + &&&\Block[]{1-3}{}% + &&&\Block[]{1-3}{}% + &&&\Block[]{1-3}{}% + &&&\Block[]{1-3}{}% &&&\Block[]{1-3}{}\\ \CodeAfter % on trace les lignes verticales @@ -22591,7 +22829,7 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V \xintFor* ##1 in{\xintSeq {1}{\TabLongueurNombre}}\do{% \tikz\node at (\fpeval{##2+\ifboolKV[ClesTableaux]{Capacite}{3.5}{2.5}}-|\fpeval{\ListeNombreAPlacer[##2,2]-0.5+##1}) {\PfCTBstrut\StrMid{\ListeNombreAPlacer[##2,1]}{##1}{##1}}; }% - } + }% \fi% % on trace les flèches \ifboolKV[ClesTableaux]{Fleches}{\setKV[ClesTableaux]{FlechesH,FlechesB}}{}% @@ -22609,7 +22847,6 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V \useKV[ClesTableaux]{CodeAfter}% \end{NiceTabular} \]% -% \setlength{\tabcolsep}{1.6\tabcolsep}% }{}% % %%% Prise en compte de la cl\'e Litre @@ -22727,7 +22964,7 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V }% \newcommand\PfCTableauIncline{% -\begin{NiceTabular}{wc{1.5em}wc{1.5em}wc{1.5em}wc{1.5em}wc{1.5em}wc{1.5em}wc{1.5em}} +\begin{NiceTabular}{wc{30pt}wc{30pt}wc{30pt}wc{30pt}wc{30pt}wc{30pt}wc{30pt}} &&&&&&\\ \Block[borders={bottom}]{}{\si{\kilo\PfCTableauUnite}}&\\ &\Block[borders={left}]{}{}&\\ @@ -22751,12 +22988,12 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V \tikz\draw[out=35,in=90,-stealth,gray] (10-|5.5) to node[midway,right]{\footnotesize$\times\num{\PfCCoefConversion}$}(12-|6.5); \tikz\draw[out=35,in=90,-stealth,gray] (12-|6.5) to node[midway,right]{\footnotesize$\times\num{\PfCCoefConversion}$}(14-|7.5); % bas - \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (15-|7.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(13-|6.5); - \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (13-|6.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(11-|5.5); - \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (11-|5.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(9-|4.5); - \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (9-|4.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(7-|3.5); - \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (7-|3.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(5-|2.5); - \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (5-|2.5) to node[midway,left]{\footnotesize$\div{\PfCCoefConversion}$}(3-|1.5); + \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (15-|7.5) to node[midway,left]{\footnotesize$\div\num{\PfCCoefConversion}$}(13-|6.5); + \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (13-|6.5) to node[midway,left]{\footnotesize$\div\num{\PfCCoefConversion}$}(11-|5.5); + \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (11-|5.5) to node[midway,left]{\footnotesize$\div\num{\PfCCoefConversion}$}(9-|4.5); + \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (9-|4.5) to node[midway,left]{\footnotesize$\div\num{\PfCCoefConversion}$}(7-|3.5); + \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (7-|3.5) to node[midway,left]{\footnotesize$\div\num{\PfCCoefConversion}$}(5-|2.5); + \tikz\draw[out=215,in=-90,-stealth,gray,transform canvas={yshift=-2mm}] (5-|2.5) to node[midway,left]{\footnotesize$\div\num{\PfCCoefConversion}$}(3-|1.5); \end{NiceTabular}% }% @@ -23196,60 +23433,62 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V %%% % Tableur %%% -\setKVdefault[Tableur]{Colonnes=4,Largeur=3,LargeurUn=3,Bandeau=true,Formule={},Cellule=A1,Ligne=0,Colonne=0,PasL=1,PasC=1,Selection=false}% +\setKVdefault[Tableur]{Colonnes=4,Largeur=30pt,LargeurUn=30pt,Bandeau=true,Formule={},Cellule=A1,Ligne=0,Colonne=0,PasL=1,PasC=1,Selection=false}% %Idee de P. Nuns \defKV[Tableur]{Couleur=\setKV[Tableur]{Selection}}% % %Bas\'e sur un code de Christian T\'ell\'ech\'ea. -\makeatletter -\newcount\cntlin -\newcount\cntcol +\newcount\cntlin% +\newcount\cntcol% -\newtoks\t@b +\makeatletter% +\newtoks\t@b% \long\def\ifremain@lines#1\\#2\@nil{% - \csname @\ifx\@empty#2\@empty second\else first\fi oftwo\endcsname} + \csname @\ifx\@empty#2\@empty second\else first\fi oftwo\endcsname}% \long\def\subst@eol#1\\#2\@nil{\addtot@b{#1\\}% \ifremain@lines#2\\\@nil{\addtot@b&\subst@eol#2\@nil}{\addtot@b{#2\CodeAfter\xintifboolexpr{\useKV[Tableur]{Ligne}==0 || \useKV[Tableur]{Colonne}==0}{}{% \tikz\node at (row-\fpeval{\useKV[Tableur]{Ligne}+1+\useKV[Tableur]{PasL}}-|col-\fpeval{\useKV[Tableur]{Colonne}+1+\useKV[Tableur]{PasC}}) {\tiny$\blacksquare$};% }% \end{NiceTabular}}}}% -\long\def\collectcp@body#1\end{\subst@eol#1\@nil\end} +\long\def\collectcp@body#1\end{\subst@eol#1\@nil\end}% -\newcommand\addtot@b[1]{\t@b\expandafter{\the\t@b#1}} -\newcommand\edftot@b[1]{\edef\temp@{#1}\expandafter\addtot@b\expandafter{\temp@}} +\newcommand\addtot@b[1]{\t@b\expandafter{\the\t@b#1}}% +\newcommand\edftot@b[1]{\edef\temp@{#1}\expandafter\addtot@b\expandafter{\temp@}}% \newlength\PfCLongInter% \newlength\PfCTableurLargeurUn% \newlength\PfCTableurLargeur% -\setlength{\PfCTableurLargeurUn}{\useKV[Tableur]{LargeurUn}em} -\setlength{\PfCTableurLargeur}{\useKV[Tableur]{Largeur}em} + +\RequirePackage{printlen} + \newenvironment{Tableur}[1][]{% \useKVdefault[Tableur]% \setKV[Tableur]{#1}% - + \setlength{\PfCTableurLargeurUn}{\fpeval{\useKV[Tableur]{LargeurUn}}pt}% + \setlength{\PfCTableurLargeur}{\fpeval{\useKV[Tableur]{Largeur}}pt}% \ttfamily% - \newcolumntype Y{>{\centering\arraybackslash}wc{\PfCTableurLargeurUn}}% - \newcolumntype X{>{\centering\arraybackslash}wc{\PfCTableurLargeurUn}}% + \newcolumntype{Y}{>{\centering\arraybackslash}m{\PfCTableurLargeurUn}}% + \newcolumntype{X}{>{\centering\arraybackslash}m{\PfCTableurLargeur}}% + \setlength{\PfCLongInter}{-40pt+\fpeval{\useKV[Tableur]{LargeurUn}}pt+\fpeval{(\useKV[Tableur]{Colonnes}-2)*\useKV[Tableur]{Largeur}}pt+\fpeval{2*\useKV[Tableur]{Colonnes}-6}\tabcolsep+\fpeval{\useKV[Tableur]{Colonnes}+2}\arrayrulewidth}% \ifboolKV[Tableur]{Bandeau}{% - \setlength{\PfCLongInter}{\fpeval{\useKV[Tableur]{LargeurUn}+(\useKV[Tableur]{Colonnes}-2)*\useKV[Tableur]{Largeur}-4}em+\fpeval{\useKV[Tableur]{Colonnes}*2-6}\tabcolsep+\fpeval{\useKV[Tableur]{Colonnes}+1}\arrayrulewidth}% - \begin{NiceTabular}{wc{\PfCTableurLargeur}wc{1em}wc{5em}wc{\PfCLongInter}}% - \Block[draw]{}{}\useKV[Tableur]{Cellule}&\Block[draw]{}{}\centering\arraybackslash\scriptsize$\blacktriangledown$&$f_x$\hfill$\sum$~\scriptsize$\blacktriangledown$\hfill$=$&\Block[draw]{}{}\useKV[Tableur]{Formule}\hfill\scriptsize$\blacktriangledown$\\ + \begin{NiceTabular}{p{\PfCTableurLargeur}p{10pt}p{50pt}p{\PfCLongInter}} + \Block[draw]{}{\useKV[Tableur]{Cellule}}&\Block[draw]{}{\scriptsize$\blacktriangledown$}&\Block{}{$f_x$\hfill$\sum$~\scriptsize$\blacktriangledown$\hfill$=$}&\Block[draw]{}{\useKV[Tableur]{Formule}\hfill\scriptsize$\blacktriangledown$}\\ \end{NiceTabular}% - \nopagebreak - \\ - }{} - \cntlin\z@ + \nopagebreak% + \\% + }{}% + \cntlin\z@% \t@b{% \begin{NiceTabular}{% >{% - \global\cntcol\z@\global\advance\cntlin\@ne - \centering\arraybackslash - \ifnum\cntlin>\@ne + \global\cntcol\z@\global\advance\cntlin\@ne% + \centering\arraybackslash% + \ifnum\cntlin>\@ne% \ifboolKV[Tableur]{Selection}{% - \xintifboolexpr{\cntlin>\useKV[Tableur]{Ligne} && \cntlin<\fpeval{\useKV[Tableur]{Ligne}+\useKV[Tableur]{PasL}+1}}{\textcolor{white}{\number\numexpr\cntlin-1\relax}}{\number\numexpr\cntlin-1\relax} - }{\number\numexpr\cntlin-1\relax}\fi} - wc{2em}Y*{\fpeval{\useKV[Tableur]{Colonnes}-1}}{X}}[hvlines]% + \xintifboolexpr{\cntlin>\useKV[Tableur]{Ligne} && \cntlin<\fpeval{\useKV[Tableur]{Ligne}+\useKV[Tableur]{PasL}+1}}{\textcolor{white}{\number\numexpr\cntlin-1\relax}}{\number\numexpr\cntlin-1\relax}% + }{\number\numexpr\cntlin-1\relax}\fi}% + wc{20pt}Y*{\fpeval{\useKV[Tableur]{Colonnes}-1}}{X}}[hvlines]% \CodeBefore % on colorie en gris toute la première ligne \tikz\draw[fill=gray!15](row-1-|col-1) rectangle (row-2-|last);% @@ -23280,8 +23519,8 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V \addtot@b{&}% % modif by Pascal Nuns \ifboolKV[Tableur]{Selection}{% - \ifnum \cntcol>\fpeval{\useKV[Tableur]{Colonne}-1}% - \ifnum \cntcol<\fpeval{\useKV[Tableur]{Colonne}+\useKV[Tableur]{PasC}}% + \ifnum\cntcol>\fpeval{\useKV[Tableur]{Colonne}-1}% + \ifnum\cntcol<\fpeval{\useKV[Tableur]{Colonne}+\useKV[Tableur]{PasC}}% \edftot@b{{\noexpand\textcolor{white}{\noexpand\bfseries\@Alph{\the\cntcol}}}}% \else% \edftot@b{\@Alph{\the\cntcol}}% @@ -23291,9 +23530,9 @@ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(V \fi% }{\edftot@b{\@Alph{\the\cntcol}}}% % fin de modif - \repeat + \repeat% \addtot@b{\\&}% - \collectcp@body}{\the\t@b} + \collectcp@body}{\the\t@b}% \makeatother %%% -- cgit v1.2.3