summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-12-15 20:44:43 +0000
committerKarl Berry <karl@freefriends.org>2022-12-15 20:44:43 +0000
commitd176b8d4006df3b6ee221a59c2a3a4991a1a3c9e (patch)
tree20a06a5f9aa0a2cefab3acaea8e443e2421ebddf /Master/texmf-dist
parenta9286ca7a68c3dc1ce2048c78050f7ba77e2e787 (diff)
proflycee (15dec22)
git-svn-id: svn://tug.org/texlive/trunk@65283 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdfbin744621 -> 755212 bytes
-rw-r--r--Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.tex116
-rw-r--r--Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty259
3 files changed, 288 insertions, 87 deletions
diff --git a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf
index 8c656653b0e..ab2a1ab2736 100644
--- a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf
+++ b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.tex b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.tex
index a084d8c5e04..75756a5bb84 100644
--- a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.tex
+++ b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.tex
@@ -62,8 +62,8 @@
\setlength{\parindent}{0pt}
\definecolor{LightGray}{gray}{0.9}
-\def\PLversion{2.0.6}
-\def\PLdate{30 Novembre 2022}
+\def\PLversion{2.0.9}
+\def\PLdate{15 Décembre 2022}
\tcbset{vignettes/.style={%
nobeforeafter,box align=base,boxsep=0pt,enhanced,sharp corners=all,rounded corners=southeast,%
@@ -263,6 +263,8 @@ Des commandes pour effectuer des calculs de probas (lois binomiale, exponentiell
Une commande pour, en \TikZ, créer des arbres de probas \og classiques \fg.
+Une commande pour générer des listes d'entiers aléatoires (avec ou sans répétitions).
+
\vspace{1.5cm}
\hfill{}\textit{Merci à Anne pour ses retours et sa relecture !}
@@ -1684,6 +1686,7 @@ Plusieurs \Cle{clés} sont disponibles :
\begin{itemize}
\item la clé booléenne \Cle{Lignes} pour afficher ou non les numéros de lignes ; \hfill{}défaut \Cle{true}
\item la clé \Cle{Largeur} qui correspond à la largeur de la \ctex{tcbox} ; \hfill{}défaut \Cle{\textbackslash linewidth}
+ \item la clé \Cle{TaillePolice} pour la taille des caractères ; \hfill{}défaut \Cle{\textbackslash footnotesize}
\item la clé \Cle{Alignement} qui paramètre l'alignement de la \ctex{tcbox}. \hfill{}défaut \Cle{center}
\end{itemize}
\end{codecles}
@@ -1800,6 +1803,8 @@ Comme précédemment, des \Cle{Clés} qui permettent de \textit{légèrement} mo
\begin{itemize}
\item \Cle{Largeur} : largeur de la \textit{tcbox} ;\hfill{}défaut \Cle{\textbackslash linewidth}
\item \Cle{Centre} : booléen pour centrer ou non la \textit{tcbox} ;\hfill{}défaut \Cle{true}
+ \item \Cle{TaillePolice} : taille des caractères ;\hfill{}défaut \Cle{\textbackslash footnotesize}
+ \item \Cle{EspacementVertical} : option (\textit{stretch}) pour l'espacement entre les lignes ;\hfill{}défaut \Cle{1}
\item \Cle{Lignes} : booléen pour afficher ou non les numéros de ligne.\hfill{}défaut \Cle{true}
\end{itemize}
\end{codecles}
@@ -1914,6 +1919,8 @@ Les \Cle{Clés} disponibles sont :
\begin{itemize}
\item \Cle{Largeur} : largeur de la \textit{console} ;\hfill{}défaut \Cle{\textbackslash linewidth}
\item \Cle{Centre} : booléen pour centrer ou non la \textit{console} ;\hfill{}défaut \Cle{true}
+ \item \Cle{TaillePolice} : taille des caractères ;\hfill{}défaut \Cle{\textbackslash footnotesize}
+ \item \Cle{EspacementVertical} : option (\textit{stretch}) pour l'espacement entre les lignes ;\hfill{}défaut \Cle{1}
\item \Cle{Label} : booléen pour afficher ou non le titre.\hfill{}défaut \Cle{true}
\end{itemize}
\end{codecles}
@@ -4099,6 +4106,103 @@ Pour le moment, seules les lois (continues) exponentielles et normales sont disp
\newpage
+\section{Nombres aléatoires}\label{entiersaleatoires}
+
+\subsection{Idée}
+
+\begin{codeidee}
+\cmaj{2.0.9} L'idée est de proposer des commandes pour générer des nombres aléatoires, pour exploitation ultérieure :
+
+\begin{itemize}
+ \item un entier ou un nombre décimal ;
+ \item des nombres entiers, avec ou sans répétitions.
+\end{itemize}
+\end{codeidee}
+
+\begin{codeinfo}
+Pour chacune des commandes, le ou les résultats sont stockés dans une \textsf{macro} dont le nom est choisi par l'utilisateur.
+\end{codeinfo}
+
+\begin{codetex}[listing only]
+%entier aléatoire entre a et b
+\NbAlea{a}{b}{<macro>}
+
+%nombre décimal (n chiffres après la virgule) aléatoire entre a et b+1 (exclus)
+\NbAlea[n]{a}{b}{<macro>}
+
+%création d'un nombre aléatoire sous forme d'une macro
+\VarNbAlea{<macro>}{<calculs>}
+
+%liste d'entiers aléatoires
+\TirageAleatoireEntiers[<options>]{<macro>}
+\end{codetex}
+
+\begin{codetex}[]
+%nombre aléatoire entre 1 et 50, stocké dans \PremierNbAlea
+Entier entre 1 et 50 : \NbAlea{1}{50}{\PremierNbAlea}\PremierNbAlea
+
+%nombre aléatoire créé à partir du 1er, stocké dans \DeuxiemeNbAlea
+Entier à partir du précédent : \VarNbAlea{\DeuxiemeNbAlea}{\PremierNbAlea+randint(0,10)}\DeuxiemeNbAlea
+
+%nombre aléatoire décimal (au millième) entre 0 et 10+1 (exlus), stocké dans \PremierDecAlea
+Décimal entre 0 et $10,999\ldots$ : \NbAlea[3]{0}{10}{\PremierDecAlea}\PremierDecAlea
+
+%liste de 6 nombres, sans répétitions, entre 1 et 50
+Liste par défaut (6 entre 1 et 50) : \TirageAleatoireEntiers{\PremiereListeAlea}\PremiereListeAlea
+\end{codetex}
+
+\begin{codeinfo}
+Les listes créées sont exploitables, \textit{a posteriori}, par le package \ctex{listofitems} par exemple !
+\end{codeinfo}
+
+\begin{codetex}[]
+Liste générée : \TirageAleatoireEntiers{\TestListeA}\TestListeA
+
+Liste traitée : \readlist*\LISTEa{\TestListeA}\showitems{\LISTEa}
+\end{codetex}
+
+\pagebreak
+
+\subsection{Clés et options}
+
+\begin{codecles}
+Quelques clés sont disponibles pour la commande \ctex{TirageAleatoireEntiers} :
+
+\begin{itemize}
+ \item la clé \Cle{ValMin} pour préciser borne inférieure de l'intervalle ;\hfill{}défaut \Cle{1}
+ \item la clé \Cle{ValMax} pour préciser borne supérieure de l'intervalle ;\hfill{}défaut \Cle{50}
+ \item la clé \Cle{NbVal} qui est le nombre d'entiers à générer ;\hfill{}défaut \Cle{6}
+ \item la clé \Cle{Sep} pour spécifier le séparateur d'éléments ;\hfill{}défaut \Cle{,}
+ \item la clé \Cle{Tri} parmi \Cle{non/croissant/decroissant} pour trier les valeurs
+ ;\hfill{}défaut \Cle{non}
+ \item le booléen \Cle{Repetition} pour autoriser la répétition d'éléments.\hfill{}défaut \Cle{false}
+\end{itemize}
+\end{codecles}
+
+\begin{codetex}[]
+Une liste de 15 valeurs (différentes), entre 10 et 100, stockée dans la macro MaListeA : \\
+Liste : \TirageAleatoireEntiers[ValMin=10,ValMax=100,NbVal=15]{\MaListeA}\MaListeA \\
+
+Une liste de 12 valeurs (différentes), entre 1 et 50, ordre croissant : \\
+Liste : \TirageAleatoireEntiers[ValMin=1,ValMax=50,NbVal=12,Tri=croissant]{\MaListeB}\MaListeB \\
+
+Une liste de 12 valeurs (différentes), entre 1 et 50, ordre décroissant : \\
+Liste : \TirageAleatoireEntiers[ValMin=1,ValMax=50,NbVal=12,Tri=decroissant]{\MaListeC}\MaListeC \\
+
+15 tirages de dé à 6 faces : \\ \TirageAleatoireEntiers[ValMin=1,ValMax=6,NbVal=15,Repetition]{\TestDes}\TestDes
+\end{codetex}
+
+\begin{codetex}[]
+Une liste (10) pour le Keno\textcopyright, ordonnée, et séparée par des \texttt{-} :
+
+\TirageAleatoireEntiers[ValMin=1,ValMax=70,NbVal=10,Tri=croissant,Sep={-}]{\ListeKeno}
+$\ListeKeno$
+
+\setsepchar{-}\readlist*\KENO{\ListeKeno}\showitems{\KENO}
+\end{codetex}
+
+\newpage
+
\part{Outils pour l'arithmétique}
\section{Conversions binaire/hexadécimal/décimal}\label{conversions}
@@ -5469,9 +5573,13 @@ La grille, créée en \TikZ, est portée par le rectangle de \og coins \fg{} $(0
\part{Historique}
-{\small \bverb|v 2.0.6|~:~~~~Changement de taille de la police des codes Python (page \pageref{pythonsimple})
+{\small \bverb|v 2.0.9|~:~~~~Nombres aléatoires, tirages aléatoires d'entiers (page \pageref{entiersaleatoires})
-{\small \bverb| |~:~~~~Ajout d'un environnement pour présenter du code \LaTeX{} (page \pageref{prescode})
+{\small \bverb|v 2.0.8|~:~~~~Ajout d'un environnement pour présenter du code \LaTeX{} (page \pageref{prescode})
+
+{\small \bverb|v 2.0.7|~:~~~~Ajout d'options pour stretch et fonte env python(s) (pas tous...)
+
+{\small \bverb|v 2.0.6|~:~~~~Changement de taille de la police des codes Python (page \pageref{pythonsimple})
{\small \bverb|v 2.0.5|~:~~~~Correction d'un bug avec les calculs de suites récurrentes (page \pageref{calcrecurr})
diff --git a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
index fbd1a83b549..6cc5b21e24e 100644
--- a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
+++ b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
@@ -3,7 +3,9 @@
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfLycee}[2022/11/30 2.0.6 Aide pour l'utilisation de LaTeX en lycee]
+\ProvidesPackage{ProfLycee}[2022/12/15 2.0.9 Aide pour l'utilisation de LaTeX en lycee]
+% 2.0.9 Ajouts de commandes pour générer des nombres et listes aléatoires
+% 2.0.8 Ajout d'options pour stretch et fonte env python(s) (pas tous...)
% 2.0.6 Quelques modifications sur les codes python (taille police et marges)...
% 2.0.5 Correction d'un bug avec les calculs en valeurx exactes avec les suites récurrentes...
% 2.0.4 Ajout d'une commande pour présenter un balayage (TVI) + calculs suites récurrentes
@@ -75,6 +77,8 @@
\RequirePackage{xstring}
\RequirePackage{xintexpr}
\RequirePackage{xintbinhex}
+\RequirePackage{xinttools}
+\RequirePackage{randomlist}
\RequirePackage{simplekv}
\RequirePackage{listofitems}
\RequirePackage{tabularray}
@@ -308,11 +312,11 @@
\xintifboolexpr{\CFL == 1}%si c'est la première ligne
{\coordinate (A0\CFL) at (0,0);}
{\coordinate (A0\CFL) at ($(A2\CFLA) + (0,{-\CFesplg})$);}
- \coordinate (A1\CFL) at ($(A0\CFL) + (0,{-\CFhle})$);
- \coordinate (A2\CFL) at ($(A1\CFL) + (0,{-\CFhlr})$);
- \coordinate (A3\CFL) at ($(A0\CFL) + ({\CFlarg},0)$);
- \coordinate (A4\CFL) at ($(A1\CFL) + ({\CFlarg},0)$);
- \coordinate (A5\CFL) at ($(A2\CFL) + ({\CFlarg},0)$);
+ \coordinate (A1\CFL) at ($(A0\CFL) + (0,{-\CFhle})$);
+ \coordinate (A2\CFL) at ($(A1\CFL) + (0,{-\CFhlr})$);
+ \coordinate (A3\CFL) at ($(A0\CFL) + ({\CFlarg},0)$);
+ \coordinate (A4\CFL) at ($(A1\CFL) + ({\CFlarg},0)$);
+ \coordinate (A5\CFL) at ($(A2\CFL) + ({\CFlarg},0)$);
%DÉCLARATION DES NŒUDS INTERMÉDIAIRES (pour les commandes et les résultats)
\coordinate (C1\CFL) at ($(A0\CFL) + (0,{-0.5*\CFhle})$);
\coordinate (C2\CFL) at ($(A0\CFL) + ({0.5*\CFlarg},{-0.5*\CFhle})$);
@@ -366,13 +370,17 @@
Largeur=\def\CSPYlargeur{#1},%
Centre=\testboolKV{#1}
{\def\hookcenterpre{\begin{center}}\def\hookcenterpost{\end{center}}}
- {\def\hookcenterpre{\begin{flushleft}}\def\hookcenterpost{\end{flushleft}}}
+ {\def\hookcenterpre{\begin{flushleft}}\def\hookcenterpost{\end{flushleft}}},%
+ TaillePolice=\def\CSPYfonte{#1},%
+ EspacementVertical=\def\CSPYstretch{#1}
}
\setKVdefault[envpythonconsole]{%
Largeur=\linewidth,%
Centre=true,%
- Label=true
+ Label=true,%
+ TaillePolice=\footnotesize,%
+ EspacementVertical=1
}
\newenvironment{ConsolePythontex}[1][]{%
@@ -383,9 +391,9 @@
\begin{minipage}{\CSPYlargeur}
\ifboolKV[envpythonconsole]{Label}%si label
{\begin{pyconsole}[][%
- framesep=3mm,frame=single,fontsize=\footnotesize,framerule=1pt,rulecolor=\color{ForestGreen},label={[\scriptsize Début de la console python]\scriptsize Fin de la console python}]}%
+ framesep=3mm,frame=single,fontsize=\CSPYfonte,framerule=1pt,rulecolor=\color{ForestGreen},label={[\scriptsize Début de la console python]\scriptsize Fin de la console python},baselinestretch=\CSPYstretch]}%
{\begin{pyconsole}[][%
- framesep=3mm,frame=single,fontsize=\footnotesize,framerule=1pt,rulecolor=\color{ForestGreen}]}
+ framesep=3mm,frame=single,fontsize=\CSPYfonte,framerule=1pt,rulecolor=\color{ForestGreen},baselinestretch=\CSPYstretch]}
}
{
\end{pyconsole}
@@ -396,6 +404,8 @@
%=========CODEPYTHONTEX=========== OK!!
\defKV[envpythonverb]{%
Largeur=\def\CODPYlargeur{#1},%
+ TaillePolice=\def\CODPYfonte{#1},%
+ EspacementVertical=\def\CODPYstretch{#1},%
Centre=\testboolKV{#1}
{\def\verbcenterpre{\begin{center}}\def\verbcenterpost{\end{center}}}
{\def\verbcenterpre{}\def\verbcenterpost{}}
@@ -404,7 +414,9 @@
\setKVdefault[envpythonverb]{%
Largeur=\linewidth,%
Centre=true,%
- Lignes=true
+ Lignes=true,%
+ TaillePolice=\footnotesize,%
+ EspacementVertical=1
}
\tcbset{stylepythontex/.style={%
@@ -429,16 +441,16 @@
\tcbset{stylepythonnolineos/.style={%
stylepythontex,leftupper=10pt,
colframe=Green,colback=ForestGreen!5,%
- fontlower=\small,%
- before upper = \renewcommand\theFancyVerbLine{\scriptsize\ttfamily\color{Green}\arabic{FancyVerbLine}}
+% fontlower=\small,%
+ before upper=\renewcommand\theFancyVerbLine{\scriptsize\ttfamily\color{Gray}\arabic{FancyVerbLine}}
}
}
\tcbset{stylepythonlineos/.style={%
stylepythontex,leftupper=25pt,
colframe=Green,colback=ForestGreen!5,%
- fontlower=\small,%
- before upper = \renewcommand\theFancyVerbLine{\scriptsize\ttfamily\color{Green}\arabic{FancyVerbLine}}
+% fontlower=\small,%
+ before upper=\renewcommand\theFancyVerbLine{\scriptsize\ttfamily\color{Gray}\arabic{FancyVerbLine}}
}
}
@@ -459,8 +471,8 @@
{\begin{tcpythontexcode}[\CODPYlargeur]}
{\begin{tcpythontexcodeno}[\CODPYlargeur]}
\ifboolKV[envpythonverb]{Lignes}%si lignes=true
- {\begin{pyverbatim}[][fontsize=\footnotesize,numbers=left,numbersep=10pt,commandchars=\\\{\},mathescape]}
- {\begin{pyverbatim}[][numbers=none,numbersep=0pt,fontsize=\footnotesize,commandchars=\\\{\},mathescape]}
+ {\begin{pyverbatim}[][fontsize=\CODPYfonte,numbers=left,numbersep=10pt,commandchars=\\\{\},mathescape,baselinestretch=\CODPYstretch]}
+ {\begin{pyverbatim}[][numbers=none,numbersep=0pt,fontsize=\CODPYfonte,commandchars=\\\{\},mathescape,baselinestretch=\CODPYstretch]}
}
{
\end{pyverbatim}
@@ -472,20 +484,20 @@
%=========PYTHONMINTED========= OK !!
\tcbset{pytmintedno/.style={%
- listing engine=minted,minted style=colorful,
- minted language=python,listing only,
- minted options={tabsize=4,fontsize=\footnotesize,autogobble},
+ listing engine=minted,minted style=colorful,
+ minted language=python,listing only,
+ minted options={tabsize=4,fontsize=\footnotesize,autogobble},
}
}
\tcbset{pytminted/.style={%
- listing engine=minted,minted style=colorful,
- minted language=python,listing only,
- minted options={tabsize=4,fontsize=\footnotesize,autogobble,xleftmargin=16pt,linenos,numbersep=10pt},
+ listing engine=minted,minted style=colorful,
+ minted language=python,listing only,
+ minted options={tabsize=4,fontsize=\footnotesize,autogobble,xleftmargin=16pt,linenos,numbersep=10pt},
}
}
-\DeclareTCBListing{CodePythonMinted}{ s O{12cm} O{} }{% étoilée sans numéro, taille puis option...
+\DeclareTCBListing{CodePythonMinted}{ s D<>{12cm} O{} }{% étoilée sans numéro, taille puis options...
\IfBooleanTF{#1}{pytmintedno}{pytminted},
enhanced,width=#2,#3,
colframe=Green,colback=ForestGreen!5,%
@@ -504,7 +516,7 @@
fonttitle=\color{ForestGreen}\itshape\ttfamily\footnotesize,
title={\scriptsize\faPython}\:Code Python\vphantom{y},
watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50,
- before upper = \renewcommand{\theFancyVerbLine}{\scriptsize\ttfamily\color{Green}\arabic{FancyVerbLine}}
+ before upper=\renewcommand{\theFancyVerbLine}{\scriptsize\ttfamily\color{Green}\arabic{FancyVerbLine}}
}
%=======STYLE ALGO LST========= OK !
@@ -606,13 +618,15 @@
%=========PYTHONPITON========== OK !!
\defKV[envpiton]{%
Largeur=\def\CODPITlargeur{#1},%
- Alignement=\def\CODPITalign{#1}
+ Alignement=\def\CODPITalign{#1},%
+ TaillePolice=\def\CODPITfonte{#1}
}
\setKVdefault[envpiton]{%
Largeur=\linewidth,%
Alignement=center,%
- Lignes=true
+ Lignes=true,%
+ TaillePolice=\footnotesize
}
\ifluatex
\RequirePackage{piton}
@@ -623,7 +637,7 @@
\ifboolKV[envpiton]{Lignes}%si lignes=true
{\PitonOptions{left-margin=auto,line-numbers}}%
{\PitonOptions{}}%
- \begin{tcolorbox}[stylepythontex,leftupper=8pt,colframe=Green,colback=ForestGreen!5,width=\CODPITlargeur,fontupper=\footnotesize,fontlower=\footnotesize,\CODPITalign]
+ \begin{tcolorbox}[stylepythontex,leftupper=8pt,colframe=Green,colback=ForestGreen!5,width=\CODPITlargeur,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign]
}%
{%
\end{tcolorbox}%
@@ -688,7 +702,7 @@
\newcommand\algomathttPL[1]{\mathtt{#1}}
\fi
-\DeclareTCBListing{PseudoCode}{ s O{12cm} !O{} }{% étoilée sans numéro, taille puis option...
+\DeclareTCBListing{PseudoCode}{ s D<>{12cm} O{} }{% étoilée sans numéro, <taille> puis option...
width=#2,#3,
stylepseudocodePL,
listing only,listing engine=listings,
@@ -749,7 +763,7 @@
\end{tblr}
}
-\DeclareTCBListing{TerminalWin}{ O{\linewidth} m !O{} }{%[taille] puis {Titre=...} puis [option]
+\DeclareTCBListing{TerminalWin}{ D<>{\linewidth} m !O{} }{%<taille> puis {Titre=...} puis [option]
PLfaketermwin,title={\termwintitre[#2]},%
listing only,listing engine=listings,%
listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},%
@@ -800,7 +814,7 @@
\end{tblr}
}
-\DeclareTCBListing{TerminalUnix}{ O{\linewidth} m !O{} }{%[taille] puis {Titre=...} puis [option]
+\DeclareTCBListing{TerminalUnix}{ D<>{\linewidth} m !O{} }{%<taille> puis {Titre=...} puis [option]
PLtermlinux,title={\termnuxtitre[#2]},%
listing only,listing engine=listings,%
listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},%
@@ -850,7 +864,7 @@
\end{tblr}
}
-\DeclareTCBListing{TerminalOSX}{ O{\linewidth} m !O{} }{%[taille] puis {Titre=...} puis [option]
+\DeclareTCBListing{TerminalOSX}{ D<>{\linewidth} m !O{} }{%<taille> puis {Titre=...} puis [option]
PLfaketermosx,title={\termosxtitre[#2]},%
listing only,listing engine=listings,%
listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},%
@@ -1367,9 +1381,9 @@
%#4 = décalage
%\shorthandoff{:}\shorthandoff{!} %bizzzzzzzzare
%\NoAutoSpacing
- \coordinate (Z) at ($(T2#2)!.5!(T2\the\numexpr#2+1\relax)$) ;
+ \coordinate (ZZZ) at ($(T2#2)!.5!(T2\the\numexpr#2+1\relax)$) ;
%\shorthandon{:}\shorthandon{!}
- \path (Z.east) + (#4,0) pic[right,scale=#3,every node/.style={scale=#3}] {code={\MiniSchemaSignes[#1]}} ;
+ \path (ZZZ.east) + (#4,0) pic[right,scale=#3,every node/.style={scale=#3}] {code={\MiniSchemaSignes[#1]}} ;
}
%=============RegressionLinéaire======= OK !!
@@ -1538,7 +1552,7 @@
\xintBinToHex{\chbrut}\ifboolKV[CONVBINHEX]{AffBase}{_{16}}{}
}
-%bin/hexa/bin->dec avec écriture polynomiale
+%hexa/bin->dec avec écriture polynomiale
\defKV[CONVTODEC]{%
BaseDep=\def\basedepart{#1}
}
@@ -1615,7 +1629,7 @@
{}
\num{\xintBinToDec{\nbdepart}}\ifboolKV[CONVTODEC]{AffBase}{_{10}}{}
}%
- {}
+ {}%
}
\newcommand\ConversionBaseDix[3][]{%1=options,%2=nb,%3=basedep ??
@@ -1645,14 +1659,14 @@
\advance\cpt by 1
\repeat
=
- }
- {}
- \num{\convertbasetobasedix{#2}{#3}}\ifboolKV[CONVTODEC]{AffBase}{_{10}}{}
+ }%
+ {}%
+ \num{\convertbasetobasedix{#2}{#3}}\ifboolKV[CONVTODEC]{AffBase}{_{10}}{}%
}
%==============MainLevée TikZ========== OK !!
\tikzset{%
- mainlevee/.style args={#1et#2}{decorate,decoration={random steps, segment length=#1,amplitude=#2}},
+ mainlevee/.style args={#1et#2}{decorate,decoration={random steps,segment length=#1,amplitude=#2}},
mainlevee/.default={5mm et 0.6pt}
}
@@ -1681,7 +1695,7 @@
\foreach \l [count=\n] in \csvline {%
\StrDel{\l}{ }[\l]
\setsepchar{,}
- \readlist\LCPA\PATcouleurs
+ \readlist*\LCPA\PATcouleurs
\StrPosition{\PATlettres}{\l}[\pixcnt]%
\xintifboolexpr{\pixcnt>0}%
{%
@@ -1703,7 +1717,7 @@
\foreach \l [count=\n] in \csvline {%
\StrDel{\l}{ }[\l]
\setsepchar{,}
- \readlist\LCNA\PATchiffres
+ \readlist*\LCNA\PATchiffres
\StrPosition{\PATlettres}{\l}[\pixpos]%
\xintifboolexpr{\pixpos>0}%
{%
@@ -1955,14 +1969,14 @@
\StrBetween{\point}{(}{,}[\XPT]
\StrBetween{\point}{,}{)}[\YPT]
\IfStrEq{\ptsstyle}{o}%
- {\filldraw[\ptscouleur] ({\XPT-\axexOx},{\YPT-\axeyOy}) circle[radius=\ptstaille] ;}
- {}
+ {\filldraw[\ptscouleur] ({\XPT-\axexOx},{\YPT-\axeyOy}) circle[radius=\ptstaille] ;}
+ {}
\IfStrEq{\ptsstyle}{x}%
- {\draw[\ptscouleur] ({\XPT-\axexOx},{\YPT-\axeyOy}) pic {PLdotcross=\ptstaille/45} ;}
- {}
+ {\draw[\ptscouleur] ({\XPT-\axexOx},{\YPT-\axeyOy}) pic {PLdotcross=\ptstaille/45} ;}
+ {}
\IfStrEq{\ptsstyle}{+}%
- {\draw[\ptscouleur] ({\XPT-\axexOx},{\YPT-\axeyOy}) pic {PLdotcross=\ptstaille/0} ;}
- {}
+ {\draw[\ptscouleur] ({\XPT-\axexOx},{\YPT-\axeyOy}) pic {PLdotcross=\ptstaille/0} ;}
+ {}
}
}
@@ -1977,18 +1991,18 @@
\def\LNB{\inteval{\LXlen}}
\foreach \i in {1,2,...,\LNB} {
\IfStrEq{\ptsstyle}{o}%
- {
- \IfSubStr{\ptscouleur}{/}
- {\StrCut{\ptscouleur}{/}{\ptscouleurA}{\ptscouleurB}\draw[thick,\ptscouleurA,fill=\ptscouleurB] ({\LX[\i]-\axexOx},{\LY[\i]-\axeyOy}) circle[radius=\ptstaille] ;}
- {\draw[\ptscouleur,fill=\ptscouleur] ({\LX[\i]-\axexOx},{\LY[\i]-\axeyOy}) circle[radius=\ptstaille] ;}
- }
- {}
+ {
+ \IfSubStr{\ptscouleur}{/}
+ {\StrCut{\ptscouleur}{/}{\ptscouleurA}{\ptscouleurB}\draw[thick,\ptscouleurA,fill=\ptscouleurB] ({\LX[\i]-\axexOx},{\LY[\i]-\axeyOy}) circle[radius=\ptstaille] ;}
+ {\draw[\ptscouleur,fill=\ptscouleur] ({\LX[\i]-\axexOx},{\LY[\i]-\axeyOy}) circle[radius=\ptstaille] ;}
+ }
+ {}
\IfStrEq{\ptsstyle}{x}%
- {\draw[\ptscouleur] ({\LX[\i]-\axexOx},{\LY[\i]-\axeyOy}) pic {PLdotcross=\ptstaille/45} ;}
- {}
+ {\draw[\ptscouleur] ({\LX[\i]-\axexOx},{\LY[\i]-\axeyOy}) pic {PLdotcross=\ptstaille/45} ;}
+ {}
\IfStrEq{\ptsstyle}{+}%
- {\draw[\ptscouleur] ({\LX[\i]-\axexOx},{\LY[\i]-\axeyOy}) pic {PLdotcross=\ptstaille/0} ;}
- {}
+ {\draw[\ptscouleur] ({\LX[\i]-\axexOx},{\LY[\i]-\axeyOy}) pic {PLdotcross=\ptstaille/0} ;}
+ {}
}
}
@@ -2001,7 +2015,7 @@
yg=\def\ptmoyy{#1},%
Nom=\def\ptmoynom{#1},%
Pos=\def\ptmoypos{#1},%
- Decal=\def\ptmoydecal{#1},%
+ Decal=\def\ptmoydecal{#1}%
}
\setKVdefault[PLptmoy]{%
@@ -2021,12 +2035,12 @@
\useKVdefault[PLptmoy]
\setKV[PLptmoy]{#1}% on paramètres les nouvelles clés et on les simplifie
\IfStrEq{\ptmoystyle}{o}%
- {
- \IfSubStr{\ptmoycouleur}{/}
- {\StrCut{\ptmoycouleur}{/}{\ptmoycouleurA}{\ptmoycouleurB}\draw[thick,\ptmoycouleurA,fill=\ptmoycouleurB] ({\ptmoyx-\axexOx},{\ptmoyy-\axeyOy}) circle[radius=\ptmoytaille] ;}
- {\draw[\ptmoycouleur,fill=\ptmoycouleur] ({\ptmoyx-\axexOx},{\ptmoyy-\axeyOy}) circle[radius=\ptmoytaille] ;}
- }
- {}
+ {
+ \IfSubStr{\ptmoycouleur}{/}
+ {\StrCut{\ptmoycouleur}{/}{\ptmoycouleurA}{\ptmoycouleurB}\draw[thick,\ptmoycouleurA,fill=\ptmoycouleurB] ({\ptmoyx-\axexOx},{\ptmoyy-\axeyOy}) circle[radius=\ptmoytaille] ;}
+ {\draw[\ptmoycouleur,fill=\ptmoycouleur] ({\ptmoyx-\axexOx},{\ptmoyy-\axeyOy}) circle[radius=\ptmoytaille] ;}
+ }
+ {}
\IfStrEq{\ptmoystyle}{x}%
{\draw[\ptmoycouleur] ({\ptmoyx-\axexOx},{\ptmoyy-\axeyOy}) pic {PLdotcross=\ptmoytaille/45} ;}
{}
@@ -2136,26 +2150,26 @@
\draw[\BaMEpaisseur,\BaMCouleur] (\BaMmin,{\BaMElevation-0.5*\BaMHauteur})--(\BaMmin,{\BaMElevation+0.5*\BaMHauteur}) (\BaMmax,{\BaMElevation-0.5*\BaMHauteur})--(\BaMmax,{\BaMElevation+0.5*\BaMHauteur}) (\BaMmed,{\BaMElevation-0.5*\BaMHauteur})--(\BaMmed,{\BaMElevation+0.5*\BaMHauteur});
\draw[\BaMEpaisseur,\BaMCouleur] ({\BaMmin},{\BaMElevation})--({\BaMqu},{\BaMElevation}) ({\BaMqt},{\BaMElevation})--({\BaMmax},{\BaMElevation}) ;
\ifboolKV[boiteamoustaches]{AffMoyenne}
- {\filldraw[\BaMCouleur] ({\BaMMoyenne},{\BaMElevation}) circle[radius=2.5pt] ;}
- {}
+ {\filldraw[\BaMCouleur] ({\BaMMoyenne},{\BaMElevation}) circle[radius=2.5pt] ;}
+ {}
\ifboolKV[boiteamoustaches]{Pointilles}
- {
- \draw[\BaMEpaisseur,densely dashed] (\BaMmin,{\BaMElevation-0.5*\BaMHauteur}) -- (\BaMmin,0) ;
- \draw[\BaMEpaisseur,densely dashed] (\BaMqu,{\BaMElevation-0.5*\BaMHauteur}) -- (\BaMqu,0) ;
- \draw[\BaMEpaisseur,densely dashed] (\BaMmed,{\BaMElevation-0.5*\BaMHauteur}) -- (\BaMmed,0) ;
- \draw[\BaMEpaisseur,densely dashed] (\BaMqt,{\BaMElevation-0.5*\BaMHauteur}) -- (\BaMqt,0) ;
- \draw[\BaMEpaisseur,densely dashed] (\BaMmax,{\BaMElevation-0.5*\BaMHauteur}) -- (\BaMmax,0) ;
- }
- {}
+ {
+ \draw[\BaMEpaisseur,densely dashed] (\BaMmin,{\BaMElevation-0.5*\BaMHauteur}) -- (\BaMmin,0) ;
+ \draw[\BaMEpaisseur,densely dashed] (\BaMqu,{\BaMElevation-0.5*\BaMHauteur}) -- (\BaMqu,0) ;
+ \draw[\BaMEpaisseur,densely dashed] (\BaMmed,{\BaMElevation-0.5*\BaMHauteur}) -- (\BaMmed,0) ;
+ \draw[\BaMEpaisseur,densely dashed] (\BaMqt,{\BaMElevation-0.5*\BaMHauteur}) -- (\BaMqt,0) ;
+ \draw[\BaMEpaisseur,densely dashed] (\BaMmax,{\BaMElevation-0.5*\BaMHauteur}) -- (\BaMmax,0) ;
+ }
+ {}
\ifboolKV[boiteamoustaches]{Valeurs}
- {
- \filldraw (\BaMmin,0) circle[radius=2pt] node[below=4pt] {\num{\BaMmin}} ;
- \filldraw (\BaMqu,0) circle[radius=2pt] node[below=4pt] {\num{\BaMqu}} ;
- \filldraw (\BaMmed,0) circle[radius=2pt] node[below=4pt] {\num{\BaMmed}} ;
- \filldraw (\BaMqt,0) circle[radius=2pt] node[below=4pt] {\num{\BaMqt}} ;
- \filldraw (\BaMmax,0) circle[radius=2pt] node[below=4pt] {\num{\BaMmax}} ;
- }
- {}
+ {
+ \filldraw (\BaMmin,0) circle[radius=2pt] node[below=4pt] {\num{\BaMmin}} ;
+ \filldraw (\BaMqu,0) circle[radius=2pt] node[below=4pt] {\num{\BaMqu}} ;
+ \filldraw (\BaMmed,0) circle[radius=2pt] node[below=4pt] {\num{\BaMmed}} ;
+ \filldraw (\BaMqt,0) circle[radius=2pt] node[below=4pt] {\num{\BaMqt}} ;
+ \filldraw (\BaMmax,0) circle[radius=2pt] node[below=4pt] {\num{\BaMmax}} ;
+ }
+ {}
}
%================SUDOMATHS============= OK !!
@@ -3274,4 +3288,83 @@
}%
}
+%=================ALEATOIRES============= OK!
+\ExplSyntaxOn
+\NewDocumentCommand\TriListeCroiss{m}
+{
+ \clist_sort:Nn #1
+ {
+ \fp_compare:nNnTF {##1} > {##2}
+ { \sort_return_swapped: }
+ { \sort_return_same: }
+ }
+}
+\NewDocumentCommand\TriListeDecroiss{m}
+{
+ \clist_sort:Nn #1
+ {
+ \fp_compare:nNnTF {##1} < {##2}
+ { \sort_return_swapped: }
+ { \sort_return_same: }
+ }
+}
+\ExplSyntaxOff
+
+\newcommand\NbAlea[4][0]{%entier ou décimal
+ \xintifboolexpr{#1 == 0}%
+ {\xdef#4{\fpeval{randint(#2,#3)}}}%
+ {\xdef#4{\fpeval{round(randint(#2,#3)+rand(),#1)}}}%
+}
+\newcommand\VarNbAlea[2]{%
+ \xdef#1{\fpeval{#2}}%
+}
+
+\defKV[TirageAleatoireEntiersEntre]{%
+ ValMin=\def\TAEEmin{#1},%
+ ValMax=\def\TAEEmax{#1},%
+ NbVal=\def\TAEEnb{#1},%
+ Sep=\def\TAEEsep{#1},%
+ Tri=\def\TAEEtri{#1}
+}
+
+\setKVdefault[TirageAleatoireEntiersEntre]{%
+ ValMin=1,%
+ ValMax=50,%
+ NbVal=6,%
+ Sep={,},%
+ Tri=non,%
+ Repetition=false
+}
+
+\NewList{TirageEntiersAleatoires}
+\NewDocumentCommand\TirageAleatoireEntiers{ O{} m }{%1=options,2=nomliste triée ou non
+ \useKVdefault[TirageAleatoireEntiersEntre]%
+ \setKV[TirageAleatoireEntiersEntre]{#1}%
+ \ifboolKV[TirageAleatoireEntiersEntre]{Repetition}%suivant la possibilité de répéter
+ {%répétitions autorisées
+ %création de la liste (le 1er puis les autres)
+ \xdef#2{\fpeval{randint(\TAEEmin,\TAEEmax)}}%
+ \foreach \i in {2,3,...,\TAEEnb}%
+ {\xdef#2{#2,\fpeval{randint(\TAEEmin,\TAEEmax)}}}%
+ }%
+ {%pas de répétitions
+ %melange des nombres
+ \ClearList{TirageEntiersAleatoires}%on vide la liste aléatoire
+ \xintFor* ##1 in {\xintSeq{\TAEEmin}{\TAEEmax}}%
+ \do{\InsertRandomItem{TirageEntiersAleatoires}{##1}}%
+ %création de la liste (le 1er puis les autres)
+ \xdef#2{\TirageEntiersAleatoires[0]}%
+ \foreach \i in {1,2,...,{\inteval{\TAEEnb-1}}}%
+ {\xdef#2{#2,\TirageEntiersAleatoires[\i]}}%
+ }%
+ %on trie si besoin
+ \IfStrEq{\TAEEtri}{croissant}%si tri croissant
+ {\TriListeCroiss{#2}}%
+ {}%
+ \IfStrEq{\TAEEtri}{decroissant}%si tri décroissant
+ {\TriListeDecroiss{#2}}%
+ {}%
+ \StrSubstitute{#2}{,}{\TAEEsep}[#2]%on change le séparateur si besoin
+}
+
\endinput \ No newline at end of file