diff options
author | Karl Berry <karl@freefriends.org> | 2024-10-31 20:33:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-10-31 20:33:51 +0000 |
commit | 3514781d0cdda81802453d4d7ba1be66101e1068 (patch) | |
tree | 4554e3d1166037152f22599aa8f60b8249c4645f /Master/texmf-dist/tex/latex/proflycee | |
parent | c3fe621ade19af531461daec2675f653501b4fd7 (diff) |
proflycee (31oct24)
git-svn-id: svn://tug.org/texlive/trunk@72722 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/proflycee')
4 files changed, 138 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty b/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty index 949c3d6fbe2..eb98631aed5 100644 --- a/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty +++ b/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty @@ -3,7 +3,7 @@ % licence cliparts...: CC0 from openclipart \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLyceeLight}[2024/10/24 1.00b Aide pour l'utilisation de LaTeX en lycee] +\ProvidesPackage{ProfLycee-Light}[2024/10/24 1.00b Aide pour l'utilisation de LaTeX en lycee] %1.00b Changement du préfixage de certaines commandes + \logo calculatrice interdite %1.00a Refonte du fonctionnement diff --git a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty index 63b47ebf2dd..dbeb301429c 100644 --- a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty +++ b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty @@ -5,8 +5,9 @@ % code \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2024/10/24 3.10e Aide pour l'utilisation de LaTeX en lycee] -% 3.10e Corection de noms de commandes + \logo calculatrice interdite +\ProvidesPackage{ProfLycee}[2024/10/30 3.10f Aide pour l'utilisation de LaTeX en lycee] +% 3.10f Ajout de quelques commandes arithmétiques (test premier + décompo) +% 3.10e Correction de noms de commandes + \logo calculatrice interdite % 3.10d Correction d'un nom de commande (doublon avec ProfMaquette) % 3.10c Ajout de clés/arguments pour les arbres de probas + paramètres stats + arbres de dénombrement(s) % 3.10b Ajout des empilements d'oranges + commandes sur les dates diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex index 76b2d3016b2..63258375cad 100644 --- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex +++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex @@ -3,8 +3,91 @@ % Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt \RequirePackage{ifthen} +\RequirePackage{etoolbox} \RequirePackage{modulus} +%%-----Nombres premiers (code venant de la documentation de xint :-)) +\NewDocumentCommand\pflboolestpremier{ m }{% + \ifnumodd{#1}% + {% + \ifnumless{#1}{8}% + {% + \ifnumequal{#1}{1}{0}{1}% + }%le cas 3,5,7 qui sont premiers + {% + \if\xintiloop[3+2]% + \ifnum#1<\numexpr\xintiloopindex*\xintiloopindex\relax% + \expandafter\xintbreakiloopanddo\expandafter1\expandafter.% + \fi% + \ifnum#1=\numexpr(#1/\xintiloopindex)*\xintiloopindex\relax% + \else + \repeat 00\expandafter0% + \else% + \expandafter1% + \fi% + }% + }%fin de la partie impaire + {% + \ifnumequal{#1}{2}{1}{0}% + }%partie paire +}% + +\NewDocumentCommand\pflestpremier{ O{est premier} O{n'est pas premier} m }{% + \num{#3} \xintifboolexpr{\pflboolestpremier{#3} == 1}{#1}{#2}\relax% +}% + +%%------Décomposition, adaptée de pfc +\NewDocumentCommand\pfldecompnb{ s m }{% + \xdef\tmpcalc{\xinteval{#2}}% + \xdef\tmparg{}% + \newcount\pflanp\newcount\pflbnp\newcount\pflcnp% + \newcount\pflpileb\newcount\pflexposant% + \pflexposant=0\relax% + \pflanp=\tmpcalc\relax% + \pflbnp=2\relax% + \pflpileb=2\relax% + \ensuremath{% + \whiledo{\the\pflanp > 1}{% + \modulo{\the\pflanp}{\the\pflbnp}% + \ifnum\remainder=0\relax% + \pflcnp=\numexpr\pflanp/\pflbnp\relax% + \pflexposant=\numexpr\pflexposant+1\relax% + \pflanp=\pflcnp\relax% + \else% + \ifnum\pflexposant>0\relax% + \IfBooleanTF{#1}% + {% + \xdef\tmparg{\tmparg\num{\the\pflpileb}^{\the\pflexposant}\times}% + }% + {% + \ifnum\pflexposant=1\relax% + \xdef\tmparg{\tmparg\num{\the\pflpileb}\times}% + \else% + \xdef\tmparg{\tmparg\num{\the\pflpileb}^{\the\pflexposant}\times}% + \fi% + }% + \fi% + \pflbnp=\numexpr\pflbnp+1\relax% + \pflpileb=\pflbnp\relax% + \pflexposant=0\relax% + \fi% + }% + \IfBooleanTF{#1}% + {% + \xdef\tmparg{\tmparg\num{\the\pflpileb}^{\the\pflexposant}}% + }% + {% + \ifnum\pflexposant=1\relax% + \xdef\tmparg{\tmparg\num{\the\pflpileb}}% + \else% + \xdef\tmparg{\tmparg\num{\the\pflpileb}^{\the\pflexposant}}% + \fi% + }% + \tmparg\relax% + }% +} + + %%------ConversionsBases %dec->bin avec blocs de 4 chiffres \setKVdefault[CONVDECBIN]{% @@ -1287,8 +1370,6 @@ \StrChar{#1}{##1}[\tmpchar]% \settowidth{\charwd}{\tmpchar}% \setlength{\widestcharwd}{\maxof{\widestcharwd}{\charwd}}% - - }% } diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-ecritures.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-ecritures.tex index e8cb62a6016..7086b10b220 100644 --- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-ecritures.tex +++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-ecritures.tex @@ -42,7 +42,6 @@ }% } - %===ENSEMBLES CLASSIQUES \ifthenelse{\isundefined{\N}}% {% @@ -212,11 +211,57 @@ } %====COORDONNEES, VECTEURS -\NewDocumentCommand\CoordPtPl{ m m }{\ensuremath{\left(#1;#2\right)}} -\NewDocumentCommand\CoordPtEsp{ m m m }{\ensuremath{\left(#1;#2;#3\right)}} -\NewDocumentCommand\CoordVecPl{ m m }{\ensuremath{\begin{pmatrix} #1 \\ #2 \end{pmatrix}}} -\NewDocumentCommand\CoordVecEsp{ m m m }{\ensuremath{\begin{pmatrix} #1 \\ #2 \\ #3 \end{pmatrix}}} -\NewDocumentCommand\MatDeux{ m m m m }{\ensuremath{\begin{pmatrix} #1 & #2 \\ #3 & #4 \end{pmatrix}}} +\RequirePackage{nicematrix} + +\NewDocumentCommand\CoordPtPl{ O{0} m m }{% + \IfEq{#1}{0}%si pas d'argument optionnel := array, sinon nicematrix avec cell-space-limits + {% + \ensuremath{\left(#2;#3\right)}% + }% + {% + \ensuremath{\begin{pNiceMatrix}[cell-space-limits=#1] #2 ; #3 \end{pNiceMatrix}}% + }% +} +\NewDocumentCommand\CoordPtEsp{ O{0} m m m }{% + \IfEq{#1}{0}%si pas d'argument optionnel := array, sinon nicematrix avec cell-space-limits + {% + \ensuremath{\left(#2;#3;#4\right)}% + }% + {% + \ensuremath{\begin{pNiceMatrix}[cell-space-limits=#1] #2 ; #3 ; #4 \end{pNiceMatrix}}% + }% +} + +\NewDocumentCommand\CoordVecPl{ O{0} m m }{% + \IfEq{#1}{0}%si pas d'argument optionnel := array, sinon nicematrix avec cell-space-limits + {% + \ensuremath{\begin{pmatrix} #2 \\ #3 \end{pmatrix}}% + }% + {% + \ensuremath{\begin{pNiceMatrix}[cell-space-limits=#1] #2 \\ #3 \end{pNiceMatrix}}% + }% +} + +\NewDocumentCommand\CoordVecEsp{ O{0} m m m }{% + \IfEq{#1}{0}%si pas d'argument optionnel := array, sinon nicematrix avec cell-space-limits + {% + \ensuremath{\begin{pmatrix} #2 \\ #3 \\ #4 \end{pmatrix}}% + }% + {% + \ensuremath{\begin{pNiceMatrix}[cell-space-limits=#1] #2 \\ #3 \\ #4 \end{pNiceMatrix}}% + }% +} + +\NewDocumentCommand\MatDeux{ O{0} m m m m }{% + \IfEq{#1}{0}%si pas d'argument optionnel := array, sinon nicematrix avec cell-space-limits + {% + \ensuremath{\begin{pmatrix} #2 & #3 \\ #4 & #5 \end{pmatrix}}% + }% + {% + \ensuremath{\begin{pNiceMatrix}[cell-space-limits=#1] #2 & #3 \\ #4 & #5 \end{pNiceMatrix}}% + }% +} + \NewDocumentCommand\Vecteur{ s m O{} }{% \IfBooleanTF{#1}{\ensuremath{\vv*{#2}{#3}}}{\ensuremath{\vv{#2}}}% } |