texlive[72722] Master/texmf-dist: proflycee (31oct24)

commits+karl at tug.org commits+karl at tug.org
Thu Oct 31 21:33:51 CET 2024


Revision: 72722
          https://tug.org/svn/texlive?view=revision&revision=72722
Author:   karl
Date:     2024-10-31 21:33:51 +0100 (Thu, 31 Oct 2024)
Log Message:
-----------
proflycee (31oct24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf
    trunk/Master/texmf-dist/doc/latex/proflycee/ProfLycee-docctan.zip
    trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty
    trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
    trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex
    trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-ecritures.tex

Modified: trunk/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/proflycee/ProfLycee-docctan.zip
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty	2024-10-31 20:33:39 UTC (rev 72721)
+++ trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty	2024-10-31 20:33:51 UTC (rev 72722)
@@ -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
 

Modified: trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty	2024-10-31 20:33:39 UTC (rev 72721)
+++ trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty	2024-10-31 20:33:51 UTC (rev 72722)
@@ -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

Modified: trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex	2024-10-31 20:33:39 UTC (rev 72721)
+++ trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex	2024-10-31 20:33:51 UTC (rev 72722)
@@ -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}}%
-		
-		
 	}%
 }
 

Modified: trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-ecritures.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-ecritures.tex	2024-10-31 20:33:39 UTC (rev 72721)
+++ trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-ecritures.tex	2024-10-31 20:33:51 UTC (rev 72722)
@@ -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}}}%
 }



More information about the tex-live-commits mailing list.