From ad334beadbb0679b7608a2d9612050802d5273d1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 28 Dec 2021 22:48:31 +0000 Subject: profcollege (28dec21) git-svn-id: svn://tug.org/texlive/trunk@61428 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/profcollege/ProfCollege.sty | 407 +++++++++++++++++++-- 1 file changed, 373 insertions(+), 34 deletions(-) (limited to 'Master/texmf-dist/tex/latex/profcollege') diff --git a/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty b/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty index 1dd88a757a7..ba5e7d56751 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}[2021/11/01 v0.99-i Aide pour l'utilisation de LaTeX au collège] +\ProvidesPackage{ProfCollege}[2022/01/01 v0.99-j Aide pour l'utilisation de LaTeX au collège] \RequirePackage{verbatim} @@ -830,13 +830,17 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, %%% % Bon de sortie %%% +\newcommand\BonSortieBandeau{% + Nom : \hfill Date : \hspace*{3cm} +} + \newtcolorbox{Sortie}{% %Titre colbacktitle=white, fonttitle=\color{black}\Large\bfseries, toptitle=2mm, bottomtitle=2mm, - title={Nom : \hfill Date : \hspace*{3cm}}, + title={\BonSortieBandeau}, %%Cadre principal enhanced, nobeforeafter, @@ -1245,6 +1249,65 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, }% }% +\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm} + +\newcommand\DefiTable[2][]{% + % 1 les clés + % 2 la table de décodage + \useKVdefault[DefiTable]% + \setKV[DefiTable]{#1}% + \setsepchar[*]{§* }% + \readlist*\ListeDefiTableCode{#2}% + \begin{NiceTabular}{>{\columncolor{gray!15}}{c}*{10}{c}}[hvlines] + \rowcolor{gray!15}$\times$&\xintFor* ##1 in {\xintSeq {1}{10}}\do{% + \xintifForFirst{}{&}##1} + \\ + 1\xintFor* ##1 in {\xintSeq {1}{10}}\do{% + &\ListeDefiTableCode[1,##1]% + }\\ + \xintFor* ##1 in {\xintSeq {2}{9}}\do{% + ##1\xintFor* ##2 in {\xintSeq {1}{##1}}\do{% + &\ListeDefiTableCode[##2,\fpeval{##1-##2+1}]% + }\xintFor* ##2 in {\xintSeq {1}{\fpeval{10-##1}}}\do{% + &\ListeDefiTableCode[##1,\fpeval{##2+1}]% + }% + \\ + }% + 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]}}}% + }\\ + }% + \end{NiceTabular}% +}% + %%% % Rangement des nombres %%% @@ -1512,7 +1575,7 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, %%% % Triominos %%% -\setKVdefault[ClesTriomino]{Longueur=5cm,Etages=3,AffichagePiece=false}% +\setKVdefault[ClesTriomino]{Longueur=5cm,Etages=3,Ecart=0.6,AffichagePiece=false,Hexagone=false,Recapitulatif=false,Colonnes=2}% \defKV[ClesTriomino]{Piece=\setKV[ClesTriomino]{AffichagePiece=true}}% \def\TraceTriomino#1{% @@ -1636,6 +1699,222 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, \fi } +\def\TraceTriominoHexa#1{% + \ifluatex + \mplibforcehmode + \begin{mplibcode} + u:=\useKV[ClesTriomino]{Longueur}; + RayonCercle:=u; + Rayon:=\useKV[ClesTriomino]{Ecart}*0.5*u*sqrt(3)/6; + pair O,A,B,C,D,E,F,G,H[],I[]; + O=(0,0); + path cc; + cc=cercles(O,RayonCercle); + A=pointarc(cc,0); + B=rotation(A,O,60); + C=rotation(B,O,60); + D=rotation(C,O,60); + E=rotation(D,O,60); + F=rotation(E,O,60); + G=rotation(F,O,60); + H1=iso(A,B); + H2=iso(B,C); + H3=iso(C,D); + H4=iso(D,E); + H5=iso(E,F); + H6=iso(F,A); + I1=iso(C,1/2[C,D],rotation(1/2[C,D],C,60)); + I2=symetrie(I1,C,F); + I3=symetrie(I2,1/2[B,C],1/2[D,E]); + I4=symetrie(I3,1/2[B,C],1/2[F,A]); + I5=symetrie(I4,B,E); + I6-I1=0.5*(D-C); + I7-I2=0.5*(D-C); + I8-I3=0.5*(D-C); + I9-I4=0.5*(D-C); + I10-I5=0.5*(D-C); + I11=symetrie(I10,1/2[C,B],1/2[F,A]); + I12=symetrie(I11,1/2[A,B],1/2[E,F]); + I13=symetrie(I6,A,D); + I14=symetrie(I7,A,D); + I15=symetrie(I8,A,D); + I16=symetrie(I9,A,D); + I17=symetrie(I10,A,D); + I18=symetrie(I11,A,D); + I19=symetrie(I12,A,D); + I20=symetrie(I1,A,D); + I21=symetrie(I2,A,D); + I22=symetrie(I3,A,D); + I23=symetrie(I4,A,D); + I24=symetrie(I5,A,D); + trace polygone(A,B,C,D,E,F); + trace polygone(H1,H3,H5); + trace polygone(H2,H4,H6); + trace segment(A,D); + trace segment(B,E); + trace segment(C,F); + color N[];%Couleur pour garder l'orientation des textes... + N1=blue; + for l=2 upto 5: + if (l mod 2=0): + N[l]=green; + else: + N[l]=blue; + fi; + endfor; + for l=6 upto 12: + if (l mod 2=0): + N[l]=blue; + else: + N[l]=green; + fi; + endfor; + for l=13 upto 19: + if (l mod 2=0): + N[l]=blue; + else: + N[l]=green; + fi; + endfor; + for l=20 upto 24: + if (l mod 2=0): + N[l]=green; + else: + N[l]=blue; + fi; + endfor; + % affichage des textes + nba=0; + for p_=#1: + if (nba mod 3)=1: + if N[(nba div 3)+1]=blue: + label(TEX(p_) rotated 120,pointarc(cercles(I[(nba div 3)+1],Rayon),30)); + else: + label(TEX(p_) rotated 180,pointarc(cercles(I[(nba div 3)+1],Rayon),90)); + fi; + elseif (nba mod 3)=2: + if N[(nba div 3)+1]=blue: + label(TEX(p_),pointarc(cercles(I[(nba div 3)+1],Rayon),270)); + else: + label(TEX(p_) rotated 60,pointarc(cercles(I[(nba div 3)+1],Rayon),330)); + fi; + else: + if N[(nba div 3)+1]=blue: + label(TEX(p_) rotated 240,pointarc(cercles(I[(nba div 3)+1],Rayon),150)); + else: + label(TEX(p_) rotated 300,pointarc(cercles(I[(nba div 3)+1],Rayon),210)); + fi; + fi; + nba:=nba+1; + endfor; + \end{mplibcode} + \else + \begin{mpost}[mpsettings={u:=\useKV[ClesTriomino]{Longueur};RayonCercle:=u; Rayon:=\useKV[ClesTriomino]{Ecart}*0.5*u*sqrt(3)/6;}] + pair O,A,B,C,D,E,F,G,H[],I[]; + O=(0,0); + path cc; + cc=cercles(O,RayonCercle); + A=pointarc(cc,0); + B=rotation(A,O,60); + C=rotation(B,O,60); + D=rotation(C,O,60); + E=rotation(D,O,60); + F=rotation(E,O,60); + G=rotation(F,O,60); + H1=iso(A,B); + H2=iso(B,C); + H3=iso(C,D); + H4=iso(D,E); + H5=iso(E,F); + H6=iso(F,A); + I1=iso(C,1/2[C,D],rotation(1/2[C,D],C,60)); + I2=symetrie(I1,C,F); + I3=symetrie(I2,1/2[B,C],1/2[D,E]); + I4=symetrie(I3,1/2[B,C],1/2[F,A]); + I5=symetrie(I4,B,E); + I6-I1=0.5*(D-C); + I7-I2=0.5*(D-C); + I8-I3=0.5*(D-C); + I9-I4=0.5*(D-C); + I10-I5=0.5*(D-C); + I11=symetrie(I10,1/2[C,B],1/2[F,A]); + I12=symetrie(I11,1/2[A,B],1/2[E,F]); + I13=symetrie(I6,A,D); + I14=symetrie(I7,A,D); + I15=symetrie(I8,A,D); + I16=symetrie(I9,A,D); + I17=symetrie(I10,A,D); + I18=symetrie(I11,A,D); + I19=symetrie(I12,A,D); + I20=symetrie(I1,A,D); + I21=symetrie(I2,A,D); + I22=symetrie(I3,A,D); + I23=symetrie(I4,A,D); + I24=symetrie(I5,A,D); + trace polygone(A,B,C,D,E,F); + trace polygone(H1,H3,H5); + trace polygone(H2,H4,H6); + trace segment(A,D); + trace segment(B,E); + trace segment(C,F); + color N[];%Couleur pour garder l'orientation des textes... + N1=blue; + for l=2 upto 5: + if (l mod 2=0): + N[l]=green; + else: + N[l]=blue; + fi; + endfor; + for l=6 upto 12: + if (l mod 2=0): + N[l]=blue; + else: + N[l]=green; + fi; + endfor; + for l=13 upto 19: + if (l mod 2=0): + N[l]=blue; + else: + N[l]=green; + fi; + endfor; + for l=20 upto 24: + if (l mod 2=0): + N[l]=green; + else: + N[l]=blue; + fi; + endfor; + % affichage des textes + nba=0; + for p_=#1: + if (nba mod 3)=1: + if N[(nba div 3)+1]=blue: + label(LATEX(p_) rotated 120,pointarc(cercles(I[(nba div 3)+1],Rayon),30)); + else: + label(LATEX(p_) rotated 180,pointarc(cercles(I[(nba div 3)+1],Rayon),90)); + fi; + elseif (nba mod 3)=2: + if N[(nba div 3)+1]=blue: + label(LATEX(p_),pointarc(cercles(I[(nba div 3)+1],Rayon),270)); + else: + label(LATEX(p_) rotated 60,pointarc(cercles(I[(nba div 3)+1],Rayon),330)); + fi; + else: + if N[(nba div 3)+1]=blue: + label(LATEX(p_) rotated 240,pointarc(cercles(I[(nba div 3)+1],Rayon),150)); + else: + label(LATEX(p_) rotated 300,pointarc(cercles(I[(nba div 3)+1],Rayon),210)); + fi; + fi; + nba:=nba+1; + endfor; + \end{mpost} + \fi +} + \newtoks\toklisteTriomino% \def\UpdatetoksTriomino#1\nil{\addtotok\toklisteTriomino{"#1",}}% @@ -1645,19 +1924,36 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, \setsepchar{§}%\ignoreemptyitems% \readlist*\ListeTriominos{#2}% \toklisteTriomino{}% - \ifboolKV[ClesTriomino]{AffichagePiece}{% - \setKV[ClesTriomino]{Etages=1}% - \TraceTriomino{"\ListeTriominos[\fpeval{3*\useKV[ClesTriomino]{Piece}-2}]","\ListeTriominos[\fpeval{3*\useKV[ClesTriomino]{Piece}-1}]","\ListeTriominos[\fpeval{3*\useKV[ClesTriomino]{Piece}}]"}% + \ifboolKV[ClesTriomino]{Recapitulatif}{% + %\begin{longtable}{|>{\centering}p{0.45\linewidth}|p{0.45\linewidth}|} + % \hline + % \xintFor* ##1 in {\xintSeq{1}{\ListeTriominoslen}}\do{ + % &\\ + % &\\ + % \ListeTriominos[##1]&\\ + % &\\ + % &\\ + % \hline + % }% + %\end{longtable} }{% - \foreachitem\compteur\in\ListeTriominos{\expandafter\UpdatetoksTriomino\compteur\nil}% - \TraceTriomino{\the\toklisteTriomino}% + \ifboolKV[ClesTriomino]{AffichagePiece}{% + \setKV[ClesTriomino]{Etages=1}% + \TraceTriomino{"\ListeTriominos[\fpeval{3*\useKV[ClesTriomino]{Piece}-2}]","\ListeTriominos[\fpeval{3*\useKV[ClesTriomino]{Piece}-1}]","\ListeTriominos[\fpeval{3*\useKV[ClesTriomino]{Piece}}]"}% + }{% + \foreachitem\compteur\in\ListeTriominos{\expandafter\UpdatetoksTriomino\compteur\nil}% + \ifboolKV[ClesTriomino]{Hexagone}{% + \TraceTriominoHexa{\the\toklisteTriomino}% + }{% + \TraceTriomino{\the\toklisteTriomino}% + }% + }% }% }% %%% % Labyrinthe Nombre %%% - \setKVdefault[ClesLabyNombre]{Multiple=5,XDepart=0,YDepart=0,Longueur=7,Largeur=4,XArrivee=6,YArrivee=3,Solution=false,Echelle=1,Angle=0,Couleur=red,Murs=false} \newcommand\LabyNombre[1][]{% @@ -2628,9 +2924,9 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \clearpage \begin{tikzpicture}[remember picture,overlay]% \ifboolKV[Autonomie]{AfficheMarge}{% - \node[xshift=5mm,yshift=-5mm,circle] (A) at (current page.north west) {}; - \node[xshift=-5mm,yshift=5mm] (B) at (current page.south east) {}; - \draw[blue,dashed] (A) rectangle (B); + \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);% @@ -2687,9 +2983,9 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \clearpage \begin{tikzpicture}[remember picture,overlay]% \ifboolKV[Autonomie]{AfficheMarge}{% - \node[xshift=5mm,yshift=-5mm,circle] (A) at (current page.north west) {}; - \node[xshift=-5mm,yshift=5mm] (B) at (current page.south east) {}; - \draw[blue,dashed] (A) rectangle (B); + \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);% @@ -5966,9 +6262,10 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \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]{#2}{#3}{#4}{#5}\\}% - \NomLettre&=\Distri[Etape=\NomFin]{#2}{#3}{#4}{#5}% + {\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}{% @@ -16163,13 +16460,13 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \xdef\Listedesvaleursaplacersurlademidroite{}% \foreachitem\compteur\in\ListePointDroite{\expandafter\Updatetoksdemidroite\compteur\nil}% \foreachitem\compteur\in\ListePointDroite{\xdef\Listedesvaleursaplacersurlademidroite{\Listedesvaleursaplacersurlademidroite,\ListePointDroite[\compteurcnt,1]}}% - \Listedesvaleursaplacersurlademidroite% + %\Listedesvaleursaplacersurlademidroite% \[\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% + %\Listedesvaleursaplacersurlademidroite% \[\MPNewDROITEGraduee{\Listedesvaleursaplacersurlademidroite}{\the\toklistenompointdemidroite}\]% }% }% @@ -17862,7 +18159,10 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O %%% % Tableur %%% -\setKVdefault[Tableur]{Colonnes=4,Largeur=3,LargeurUn=3,Bandeau=true,Formule={},Cellule=A1,Ligne=0,Colonne=0,PasL=1,PasC=1} +\setKVdefault[Tableur]{Colonnes=4,Largeur=3,LargeurUn=3,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 @@ -17873,7 +18173,10 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \long\def\ifremain@lines#1\\#2\@nil{% \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\draw[line width=2pt](row-\fpeval{\useKV[Tableur]{Ligne}+1}-|col-\fpeval{\useKV[Tableur]{Colonne}+1}) rectangle (row-\fpeval{\useKV[Tableur]{Ligne}+1+\useKV[Tableur]{PasL}}-|col-\fpeval{\useKV[Tableur]{Colonne}+1+\useKV[Tableur]{PasC}});}\end{NiceTabular}}}} + \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} \newcommand\addtot@b[1]{\t@b\expandafter{\the\t@b#1}} @@ -17892,7 +18195,6 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \setlength{\LongInter}{\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}{p{\useKV[Tableur]{Largeur}em}p{1em}p{5em}p{\LongInter}}% \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$\\ - %\cline{1-2}\cline{4-4}% \end{NiceTabular}% \nopagebreak \\ @@ -17901,21 +18203,58 @@ Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Grille=false,O \t@b{% \begin{NiceTabular}{% >{% - \columncolor{gray!15} \global\cntcol\z@\global\advance\cntlin\@ne \centering\arraybackslash - \ifnum\cntlin>\@ne\number\numexpr\cntlin-1\relax\fi} + \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} p{2em}Y*{\fpeval{\useKV[Tableur]{Colonnes}-1}}{X}}[hvlines]% - \rowcolor{gray!15}}% - \loop - \ifnum\cntcol<\useKV[Tableur]{Colonnes} - \advance\cntcol\@ne - \addtot@b{&}% - \edftot@b{{\noexpand\@Alph{\the\cntcol}}}% - \repeat - \addtot@b{\\&}% - \collectcp@body}{\the\t@b} - \makeatother + \CodeBefore + % on colorie en gris toute la première ligne + \tikz\draw[fill=gray!15](row-1-|col-1) rectangle (row-2-|last);% + % on colorie en gris toute la première colonne + \tikz\draw[fill=gray!15](row-1-|col-1) rectangle (last-|col-2);% + % + \xintifboolexpr{\useKV[Tableur]{Ligne}==0 || \useKV[Tableur]{Colonne}==0}{}{% + \ifboolKV[Tableur]{Selection}{% + \xdef\PfCTabCouleur{\useKV[Tableur]{Couleur}}% + % on colorie les cellules sans les tracer + \tikz\draw[fill=\PfCTabCouleur!50](row-\fpeval{\useKV[Tableur]{Ligne}+1}-|col-\fpeval{\useKV[Tableur]{Colonne}+1}) rectangle (row-\fpeval{\useKV[Tableur]{Ligne}+1+\useKV[Tableur]{PasL}}-|col-\fpeval{\useKV[Tableur]{Colonne}+1+\useKV[Tableur]{PasC}});% + % on trace la première cellule qui a servi à sélectionner + \tikz\draw[line width=1.25pt,fill=\PfCTabCouleur!50](row-\fpeval{\useKV[Tableur]{Ligne}+1}-|col-\fpeval{\useKV[Tableur]{Colonne}+1}) rectangle (row-\fpeval{\useKV[Tableur]{Ligne}+1+1}-|col-\fpeval{\useKV[Tableur]{Colonne}+1+1});% + % on colorie la zone nécessaire sur la première ligne + \tikz\draw[fill=\PfCTabCouleur](row-1-|col-\fpeval{\useKV[Tableur]{Colonne}+1}) rectangle (row-2-|col-\fpeval{\useKV[Tableur]{Colonne}+1+\useKV[Tableur]{PasC}});% + % on colorie la zone nécessaire sur la première colonne + \tikz\draw[fill=\PfCTabCouleur](row-\fpeval{\useKV[Tableur]{Ligne}+1}-|col-1) rectangle (row-\fpeval{\useKV[Tableur]{Ligne}+1+\useKV[Tableur]{PasL}}-|col-2);% + }{% + \tikz\draw[line width=1.25pt](row-\fpeval{\useKV[Tableur]{Ligne}+1}-|col-\fpeval{\useKV[Tableur]{Colonne}+1}) rectangle (row-\fpeval{\useKV[Tableur]{Ligne}+1+\useKV[Tableur]{PasL}}-|col-\fpeval{\useKV[Tableur]{Colonne}+1+\useKV[Tableur]{PasC}});% + }% + }% + \Body + % + }% + \loop% + \ifnum\cntcol<\useKV[Tableur]{Colonnes}% + \advance\cntcol\@ne% + \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}}% + \edftot@b{{\noexpand\textcolor{white}{\noexpand\bfseries\@Alph{\the\cntcol}}}}% + \else% + \edftot@b{\@Alph{\the\cntcol}}% + \fi% + \else% + \edftot@b{\@Alph{\the\cntcol}}% + \fi% + }{\edftot@b{\@Alph{\the\cntcol}}}% + % fin de modif + \repeat + \addtot@b{\\&}% + \collectcp@body}{\the\t@b} +\makeatother %%% % Domino -- cgit v1.2.3