diff options
Diffstat (limited to 'macros/latex/contrib/profcollege/latex/ProfCollege.sty')
-rw-r--r-- | macros/latex/contrib/profcollege/latex/ProfCollege.sty | 122 |
1 files changed, 96 insertions, 26 deletions
diff --git a/macros/latex/contrib/profcollege/latex/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty index d09cfda988..ca3b52ba9a 100644 --- a/macros/latex/contrib/profcollege/latex/ProfCollege.sty +++ b/macros/latex/contrib/profcollege/latex/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{2024/03/24}% +\def\filedate{2024/05/18}% \let\PfCfiledate\filedate% -\def\fileversion{0.99-A-b}% +\def\fileversion{0.99-A-f}% \let\PfCfileversion\fileversion% \ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]% @@ -39,7 +39,7 @@ % mathématiques \RequirePackage{siunitx}% \sisetup{% - locale=FR,%mode = match, + locale=FR,mode = match, propagate-math-font = true,% reset-math-version = false, reset-text-family = false,% reset-text-series = false, reset-text-shape = false,% @@ -165,18 +165,6 @@ \def\bla{}%JCC :) Pour les tests sur arguments vides -%% Colorer en mode mathématique. \color ne gère pas les espaces propres au mode mathématique. Donc besoin de changer -% https://tex.stackexchange.com/questions/21598/how-to-color-math-symbols -%\makeatletter% -%\def\mathcolor#1#{\@mathcolor{#1}}% -%\def\@mathcolor#1#2#3{% -% \protect\leavevmode% -% \begingroup% -% \color#1{#2}#3% -% \endgroup% -%}% -%\makeatother% - % Pb ProfCollege<->Chinois soulev\'e par Denis % Solution by egreg :) \newcommand\getstrut[1]{% @@ -326,12 +314,31 @@ \IfNoValueTF{#1}{\Dotfill}{\makebox[#1]{\Dotfill}}% }% -\NewDocumentCommand\Lignespointilles{m}{% - \xintifboolexpr{\fpeval{#1}>1}{% - \xintFor* ##1 in {\xintSeq {1}{\fpeval{#1}}}\do{% - \pointilles\par% - }% +\NewDocumentCommand\PfCNbLignesRestantes{}{% + \edef\measurepage{\dimexpr\pagegoal-\pagetotal\relax}% + \xintifboolexpr{\fpeval{\the\measurepage}>\fpeval{\the\textheight}}{% + \edef\measurepage{\dimexpr\textheight\relax}% }{}% + \xdef\PfCResteLignes{\fpeval{trunc((\the\measurepage)/(\baselineskip),0)}}% +}% + +\NewDocumentCommand\PfCLignesFinales{}{% + \PfCNbLignesRestantes% + \xintFor* ##1 in {\xintSeq {1}{\PfCResteLignes}}\do{% + \pointilles\par% + }% +}% + +\NewDocumentCommand\Lignespointilles{m}{% + \ifx\bla#1\bla% + \par\PfCLignesFinales% + \else% + \xintifboolexpr{\fpeval{#1}>1}{% + \xintFor* ##1 in {\xintSeq {1}{#1}}\do{% + \pointilles\par% + }% + }{}% + \fi }% %https://tex.stackexchange.com/questions/128991/frac-or-inference-rule-with-dotted-line @@ -481,16 +488,76 @@ \day=\the\PfCrappeljour\relax% } -\newcommand\MelangeLettres[2]{% +\NewDocumentCommand\MelangeLettres{smm}{% % #2 Nombre d'éléments à conserver + % #3 Nom de la commande qui reçoit la liste. \setsepchar{,}\ignoreemptyitems% \readlist*\ListeInter{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}% \xdef\faa{}% Liste construite \xdef\fii{}% Liste détruite - \xintFor* ##1 in {\xintSeq{1}{#1}}\do{% + \IfBooleanTF{#1}{% + \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}% + }% + }{% + \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}% + }% + }% + \xdef#3{\faa}% +}% + +\NewDocumentCommand\MelangeListe{smm}{% + \IfBooleanTF{#1}{% + %Si on cherche un seul élément, on peut l'utiliser directement + \MelangeListeOne{#2}{#3}% + }{% + \MelangeListeNoOne{#2}{#3}% + }% +} + +\NewDocumentCommand\MelangeListeOne{mm}{% + % #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]}% + \ifnum\fpeval{##1}=1\relax + \xdef\faa{\ListeInter[\Alea]}% + \else + \xdef\faa{\faa,\ListeInter[\Alea]}% + \fi \xdef\fii{}% \xintFor* ##2 in {\xintSeq{1}{\ListeInterlen}}\do{% \xintifboolexpr{##2 == \Alea}{% @@ -499,14 +566,14 @@ }% }% }{% - \xdef\faa{\faa\ListeInter[1]}% + \xdef\faa{\faa,\ListeInter[1]}% }% \readlist*\ListeInter{\fii}% }% - \xdef#2{\faa}% + \reademptyitems% }% -\newcommand\MelangeListe[2]{% +\NewDocumentCommand\MelangeListeNoOne{mm}{% % #1 Liste à mélanger % #2 Nombre d'éléments à conserver \setsepchar{,}\ignoreemptyitems% @@ -759,6 +826,9 @@ \def\PfCSymbolTimes{\times}% \def\PfCSymbolDiv{\div}% +\input{PfCVisualisationMulDeci} +\input{PfCArbreChiffre} +\input{PfCAssemblagesSolides} \input{PfCTicketCaisse} \input{PfCRecyclage} \input{PfCDontCountDots} |