texlive[72483] Master/texmf-dist: proflycee
commits+karl at tug.org
commits+karl at tug.org
Mon Oct 7 23:46:43 CEST 2024
Revision: 72483
https://tug.org/svn/texlive?view=revision&revision=72483
Author: karl
Date: 2024-10-07 23:46:42 +0200 (Mon, 07 Oct 2024)
Log Message:
-----------
proflycee
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.sty
trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-ecritures.tex
trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-recreat.tex
Added Paths:
-----------
trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty
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)
Added: trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty 2024-10-07 21:46:42 UTC (rev 72483)
@@ -0,0 +1,388 @@
+% Author.............: C. Pierquet
+% licence............: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
+% licence cliparts...: CC0 from openclipart
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{ProfLyceeLight}[2024/10/03 1.00a Aide pour l'utilisation de LaTeX en lycee]
+%1.00a Refonte du fonctionnement
+
+%%=====Mathtools (la base)
+\RequirePackage{mathtools}
+
+%%=====Option(s)
+\newif\if at xcolor \@xcolorfalse
+\newif\if at build \@buildfalse
+\newif\if at loadamssymb \@loadamssymbtrue
+\newif\if at loadtikzbabel \@loadtikzbabeltrue
+\DeclareOption{xcolor}{\@xcolortrue}%
+\DeclareOption{build}{\@buildtrue}%
+\DeclareOption{nonamssymb}{\@loadamssymbfalse}%
+\DeclareOption{nontikzbabel}{\@loadtikzbabelfalse}%
+\DeclareOption*{}
+\ProcessOptions\relax
+
+%%=====Packages utiles et indispensables
+\if at loadamssymb
+ \RequirePackage{amssymb}
+\fi
+\if at xcolor
+ \RequirePackage[table,svgnames]{xcolor}%Gestion des couleurs
+\fi
+\RequirePackage{iftex}
+\RequirePackage{tikz}
+\usetikzlibrary{calc}
+\usetikzlibrary{decorations,decorations.pathreplacing,decorations.markings,arrows,arrows.meta,shapes.geometric,decorations.pathmorphing}
+\if at loadtikzbabel
+ \usetikzlibrary{babel}
+\fi
+\RequirePackage{ifthen}
+\RequirePackage{xstring}
+\RequirePackage{xintexpr}
+\RequirePackage{xintbinhex}
+\RequirePackage{xinttools}
+\RequirePackage{randomlist}
+\RequirePackage{simplekv}
+\RequirePackage{listofitems}
+\RequirePackage{tkz-tab}
+\RequirePackage{tabularray}
+\RequirePackage{settobox}
+\RequirePackage{hologo}
+\RequirePackage{fancyvrb}
+\RequirePackage{nicefrac}
+\RequirePackage{siunitx}
+\sisetup{%
+ locale=FR,output-decimal-marker={,},%
+ mode=match,propagate-math-font=true,%
+ reset-math-version=false,reset-text-family=false,%
+ reset-text-series=false,reset-text-shape=false,%
+ text-family-to-math=true,text-series-to-math=true,%
+ group-minimum-digits=4%
+}%
+\RequirePackage{fontawesome5}
+\RequirePackage{tcolorbox}%
+\tcbuselibrary{breakable,fitting,skins,listings,listingsutf8,hooks}
+
+%%=====COULEUR PERSO
+\definecolor{CouleurVertForet}{HTML}{1F8B36} %ForestGreen
+
+%%=====COMMANDES DE BASES xint/siunitx
+\NewDocumentCommand\pflnum{ s D<>{} O{} m }{%version consolidée
+ %1 := version étoilée pour arrondi (normal) / - avant la fraction éventuelle
+ \IfEq{#2}{}%argument <> vide := entier/décimal -> checked
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \IfEq{#3}{}{\num{\xintfloateval{#4}}}{\num{\xintfloateval{round(#4,#3)}}}%
+ }%
+ {%
+ \num{\xintiieval{#4}}%
+ }%
+ }%
+ {}%
+ \IfEq{#2}{frac}%argument <frac> := fraction -> checked
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \xintnumfrac*[#3]{#4}%
+ }%
+ {%
+ \xintnumfrac[#3]{#4}%
+ }%
+ }%
+ {}%
+ \IfEq{#2}{rad}%argument <rad> := angle radian -> checked (juste le - devant...)
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \xintnumrad*[#3]{#4}%
+ }%
+ {%
+ \xintnumrad[#3]{#4}%
+ }%
+ }%
+ {}%
+ \IfEq{#2}{rac}%
+ {%
+ \xintnumsqrt[#3]{#4}%
+ }%
+ {}%
+}
+
+\DeclareDocumentCommand\xintnumsqrt{ O{} m }{% argument mandataire {calcul ou fraction}
+ \xdef\calculargument{\xintIrr{\xinteval{#2}}}%
+ \xintifboolexpr{\calculargument == 1}%
+ {%
+ \ensuremath{1}%
+ }%
+ {%
+ \IfEndWith{\calculargument}{/1}%
+ {%si c'est un entier !
+ \xdef\calculargument{\xintiieval{#2}}%
+ \xdef\ExtractRacStop{\xintiFloor{\xintfloateval{sqrt(\calculargument)}}}%
+ \xintFor* ##1 in {\xintSeq{1}{\ExtractRacStop}}\do{%
+ \xintifboolexpr{ \xintiiRem{\calculargument}{\xintiieval{##1*##1}} == 0}%si le carré divise
+ {\xdef\ExtractRacID{##1}}%
+ {}%
+ }%
+ \xdef\ExtracReste{\xintiieval{\calculargument/(\ExtractRacID*\ExtractRacID)}}%
+ \ensuremath{\xintifboolexpr{\ExtractRacID == 1 && \ExtracReste == 1}%
+ {1}%
+ { \xintifboolexpr{\ExtractRacID == 1}{}{\num{\xintiieval{\ExtractRacID}}}%
+ \xintifboolexpr{\ExtracReste == 1}{}{\sqrt{\num{\ExtracReste}}} }%
+ }%
+ }%
+ {%on va mettre sous forme a\sqrt(d)/b := buggue avec des millièmes...
+ \StrBefore{\calculargument}{/}[\numerateur]%on extrait le numérateur
+ \StrBehind{\calculargument}{/}[\denominateur]%on extrait le dénominateur
+ \xdef\ExtractRacNNum{\xintiieval{\numerateur*\denominateur}}%
+ \xdef\ExtractRacStop{\xintiFloor{\xintfloateval{sqrt(\ExtractRacNNum)}}}%
+ \xintFor* ##1 in {\xintSeq{1}{\ExtractRacStop}}\do{%
+ \xintifboolexpr{ \xintiiRem{\ExtractRacNNum}{\xintiieval{##1*##1}} == 0}%si le carré divise
+ {\xdef\ExtractRacID{##1}}%
+ {}
+ }%
+ \xdef\ExtractRacGCD{\xintiiGCD{\ExtractRacID}{\denominateur}}%
+ \xdef\RacNumSimpl{\xintiieval{\ExtractRacID/\ExtractRacGCD}}%simpl num
+ \xdef\RacDenomSimpl{\xintiieval{\denominateur/\ExtractRacGCD}}%
+ \xdef\RacRacSimpl{\xintiieval{\ExtractRacNNum/(\ExtractRacID*\ExtractRacID)}}%
+ \IfEq{#1}{}%fraction classique
+ {%
+ \ensuremath{\frac{%
+ \xintifboolexpr{\RacNumSimpl == 1 && \RacRacSimpl == 1}%
+ {1}%
+ { \xintifboolexpr{\RacNumSimpl == 1}{}{\RacNumSimpl} \xintifboolexpr{\RacRacSimpl == 1}{}{\sqrt{\num{\RacRacSimpl}}} }%
+ }%
+ { \RacDenomSimpl }}%
+ }%
+ {}%
+ \IfEq{#1}{d}%dfraction
+ {%
+ \ensuremath{\dfrac{%
+ \xintifboolexpr{\RacNumSimpl == 1 && \RacRacSimpl == 1}%
+ {1}%
+ { \xintifboolexpr{\RacNumSimpl == 1}{}{\RacNumSimpl} \xintifboolexpr{\RacRacSimpl == 1}{}{\sqrt{\num{\RacRacSimpl}}} }%
+ }%
+ { \RacDenomSimpl }}%
+ }%
+ {}%
+ \IfEq{#1}{n}%nfraction
+ {%
+ \ensuremath{\nicefrac{%
+ \xintifboolexpr{\RacNumSimpl == 1 && \RacRacSimpl == 1}%
+ {1}%
+ { \xintifboolexpr{\RacNumSimpl == 1}{}{\RacNumSimpl} \xintifboolexpr{\RacRacSimpl == 1}{}{\sqrt{\num{\RacRacSimpl}}} }%
+ }%
+ { \RacDenomSimpl }}%
+ }%
+ {}%
+ }%
+}%
+}
+
+\NewDocumentCommand\xintnumfrac{ s O{} m }{%patch xinttotexfrac
+ %*=moins sur le numérateur
+ %2=argument.optionnel[d/t/dec=...]
+ %3=argument mandataire {calcul ou fraction}
+ \xdef\calculargument{\xintPRaw{\xintIrr{\xinteval{#3}}}}%on calcule et on transforme en A/B
+ \IfSubStr{\calculargument}{/}%on teste si le symbole / apparaît
+ {%si oui := fraction
+ \StrBefore{\calculargument}{/}[\numerateur]%on extrait le numérateur
+ \StrBehind{\calculargument}{/}[\denominateur]%on extrait le dénominateur
+ \ifblank{#2}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{d}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\dfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\dfrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\dfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{t}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\tfrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{n}%
+ {%
+ {\ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfSubStr{#2}{dec}%on veut la forme décimale
+ {%
+ \IfSubStr{#2}{=}%si on rajoute une précision
+ {%
+ \StrBehind{#2}{=}[\precdecimal]%
+ \ensuremath{\num{\xintfloateval{round(#3,\precdecimal)}}}%
+ }%
+ {%
+ \ensuremath{\num{\xintfloateval{#3}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ }%
+ {%si non := entier
+ \num{\calculargument}%on affiche l'entier, avec le package siunitx
+ }%
+}
+
+\NewDocumentCommand\xintnumrad{ s O{} m }{%
+ %1 = options
+ %2 = angle sous la forme a*pi/b
+ \StrDel{#3}{pi}[\MPargument]%
+ \IfBeginWith{#3}{pi}%
+ {\StrSubstitute{#3}{pi}{1}[\MPargument]}%
+ {}%
+ \IfBeginWith{#3}{-pi}%
+ {\StrSubstitute{#3}{pi}{1}[\MPargument]}%
+ {}%
+ %on conserve les données initiales
+ \IfSubStr{\MPargument}{/}%on coupe numérateur/dénominateur
+ {\StrCut{\MPargument}{/}\MPnumerateurinit\MPdenominateurinit}%
+ {\xdef\MPnumerateurinit{\MPargument}\xdef\MPdenominateurinit{1}}%
+ %on affiche le début, avant simplification
+ \IfStrEq{#2}{d}%
+ {%
+ \ensuremath{%
+ \xintifboolexpr{\MPdenominateurinit == 1}%
+ {%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}%
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
+ }%
+ {%
+ \displaystyle\IfBooleanT{#1}{-}\frac{%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{\IfBooleanTF{#1}{}{-}\pi}{}
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{ \IfBooleanTF{#1}{\xinteval{abs(\MPnumerateurinit)}}{\MPnumerateurinit} }\pi}{}%
+ }%
+ {%
+ \num{\MPdenominateurinit}%
+ }%
+ }%
+ }%
+ }%
+ {}%
+ \IfStrEq{#2}{t}%
+ {%
+ \ensuremath{%
+ \xintifboolexpr{\MPdenominateurinit == 1}%
+ {%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}%
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
+ }%
+ {%
+ \IfBooleanT{#1}{-}\tfrac{%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{ \IfBooleanTF{#1}{\xinteval{abs(\MPnumerateurinit)}}{\MPnumerateurinit} }\pi}{}%
+ }%
+ {%
+ \num{\MPdenominateurinit}%
+ }%
+ }%
+ }%
+ }%
+ {}%
+ \IfStrEq{#2}{}%
+ {%
+ \ensuremath{%
+ \xintifboolexpr{\MPdenominateurinit == 1}%
+ {%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}%
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
+ }%
+ {%
+ \IfBooleanT{#1}{-}\frac{%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{ \IfBooleanTF{#1}{\xinteval{abs(\MPnumerateurinit)}}{\MPnumerateurinit} }\pi}{}%
+ }%
+ {%
+ \num{\MPdenominateurinit}%
+ }%
+ }%
+ }%
+ }%
+ {}%
+ \IfStrEq{#2}{n}%
+ {%
+ \ensuremath{%
+ \xintifboolexpr{\MPdenominateurinit == 1}%
+ {%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}%
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
+ }%
+ {%
+ \nicefrac{%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
+ }%
+ {%
+ \num{\MPdenominateurinit}%
+ }%
+ }%
+ }%
+ }%
+ {}%
+}
+
+%%=====LIBRAIRIES/BIBIOTHÈQUES
+\newcommand\useproflyclib[1]{%ajout d'une commande "librairie" pour charger des modules
+ \IfSubStr{#1}{most}{%
+ \input{proflycee-tools-analyse.tex}
+ \input{proflycee-tools-graphiques.tex}
+ \input{proflycee-tools-listings.tex}
+ \input{proflycee-tools-trigo.tex}
+ \input{proflycee-tools-probas.tex}
+ \input{proflycee-tools-stats.tex}
+ \input{proflycee-tools-arithm.tex}
+ \input{proflycee-tools-aleatoire.tex}
+ \input{proflycee-tools-suites.tex}
+ \input{proflycee-tools-cliparts.tex}
+ }%
+ {%
+ \IfSubStr{#1}{analyse}{\input{proflycee-tools-analyse.tex}}{}%
+ \IfSubStr{#1}{graphiques}{\input{proflycee-tools-graphiques.tex}}{}%
+ \IfSubStr{#1}{listings}{\input{proflycee-tools-listings.tex}}{}%
+ \IfSubStr{#1}{trigo}{\input{proflycee-tools-trigo.tex}}{}%
+ \IfSubStr{#1}{probas}{\input{proflycee-tools-probas.tex}}{}%
+ \IfSubStr{#1}{stats}{\input{proflycee-tools-stats.tex}}{}%
+ \IfSubStr{#1}{arithm}{\input{proflycee-tools-arithm.tex}}{}%
+ \IfSubStr{#1}{aleatoire}{\input{proflycee-tools-aleatoire.tex}}{}%
+ \IfSubStr{#1}{suites}{\input{proflycee-tools-suites.tex}}{}%
+ \IfSubStr{#1}{geom}{\input{proflycee-tools-geom.tex}}{}%
+ \IfSubStr{#1}{cliparts}{\input{proflycee-tools-cliparts.tex}}{}%
+ }%
+ \IfSubStr{#1}{piton}{\input{proflycee-tools-piton.tex}}{}%
+ \IfSubStr{#1}{espace}{\input{proflycee-tools-espace.tex}}{}%
+ \IfSubStr{#1}{ecritures}{\input{proflycee-tools-ecritures.tex}}{}%
+ \IfSubStr{#1}{complexes}{\input{proflycee-tools-complexes.tex}}{}%
+ \IfSubStr{#1}{recreat}{\input{proflycee-tools-recreat.tex}}{}%
+ \IfSubStr{#1}{competences}{\input{proflycee-tools-competences.tex}}{}%
+ \IfSubStr{#1}{exams}{\input{proflycee-tools-exams.tex}}{}%
+}
+
+\endinput
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee-Light.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty 2024-10-07 08:08:12 UTC (rev 72482)
+++ trunk/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty 2024-10-07 21:46:42 UTC (rev 72483)
@@ -3,7 +3,9 @@
% licence cliparts...: CC0 from openclipart
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfLycee}[2024/09/27 3.05b Aide pour l'utilisation de LaTeX en lycee]
+\ProvidesPackage{ProfLycee}[2024/10/04 3.10b Aide pour l'utilisation de LaTeX en lycee]
+% 3.10b Ajout des empilements d'oranges + commandes sur les dates
+% 3.10a Bifurcation pfl / pfllight + pflnum consolidée
% 3.05b Mise en standby des commandes liées à minted (attente de compatibilité complète avec tcblisting) + Clé [ValeursTan] pour les cercles trigo
% 3.05a Conversions entre bases + vectorial clipart (de openclipart)
% 3.04g Ajout de clés pour les arbres de probas
@@ -103,9 +105,11 @@
\newif\if at xcolor \@xcolorfalse
\newif\if at build \@buildfalse
\newif\if at loadamssymb \@loadamssymbtrue
+\newif\if at loadtikzbabel \@loadtikzbabeltrue
\DeclareOption{xcolor}{\@xcolortrue}%
\DeclareOption{build}{\@buildtrue}%
\DeclareOption{nonamssymb}{\@loadamssymbfalse}%
+\DeclareOption{nontikzbabel}{\@loadtikzbabelfalse}%
\DeclareOption*{}
\ProcessOptions\relax
@@ -117,6 +121,10 @@
\RequirePackage[table,svgnames]{xcolor}%Gestion des couleurs
\fi
\RequirePackage{tikz}
+\usetikzlibrary{decorations,decorations.pathreplacing,decorations.markings,arrows,arrows.meta,shapes.geometric,decorations.pathmorphing}
+\if at loadtikzbabel
+ \usetikzlibrary{babel}
+\fi
\RequirePackage{tkz-tab}
\RequirePackage{pgf,pgffor}
\RequirePackage{ifthen}
@@ -143,15 +151,6 @@
group-minimum-digits=4%
}%
\RequirePackage{fontawesome5}
-%librairies tikz
-\usetikzlibrary{calc}
-\usetikzlibrary{decorations}
-\usetikzlibrary{decorations.pathreplacing}
-\usetikzlibrary{decorations.markings}
-\usetikzlibrary{arrows,arrows.meta}
-\usetikzlibrary{babel}
-\usetikzlibrary{shapes.geometric}
-\usetikzlibrary{decorations.pathmorphing}
%tcolorbox
\RequirePackage{tcolorbox}%
\tcbuselibrary{breakable,fitting,skins,listings,listingsutf8,hooks}
@@ -200,16 +199,289 @@
}
%%------patch num et xint
-\NewDocumentCommand\pflnum{ s O{} m }{%
- \IfBooleanTF{#1}%
+\NewDocumentCommand\pflnum{ s D<>{} O{} m }{%version consolidée
+ %1 := version étoilée pour arrondi (normal) / - avant la fraction éventuelle
+ \IfEq{#2}{}%argument <> vide := entier/décimal -> checked
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \IfEq{#3}{}{\num{\xintfloateval{#4}}}{\num{\xintfloateval{round(#4,#3)}}}%
+ }%
+ {%
+ \num{\xintiieval{#4}}%
+ }%
+ }%
+ {}%
+ \IfEq{#2}{frac}%argument <frac> := fraction -> checked
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \xintnumfrac*[#3]{#4}%
+ }%
+ {%
+ \xintnumfrac[#3]{#4}%
+ }%
+ }%
+ {}%
+ \IfEq{#2}{rad}%argument <rad> := angle radian -> checked (juste le - devant...)
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \xintnumrad*[#3]{#4}%
+ }%
+ {%
+ \xintnumrad[#3]{#4}%
+ }%
+ }%
+ {}%
+ \IfEq{#2}{rac}%
+ {%
+ \xintnumsqrt[#3]{#4}%
+ }%
+ {}%
+}
+
+\DeclareDocumentCommand\xintnumsqrt{ O{} m }{% argument mandataire {calcul ou fraction}
+ \xdef\calculargument{\xintIrr{\xinteval{#2}}}%
+ \xintifboolexpr{\calculargument == 1}%
{%
- \IfEq{#2}{}{\num{\xintfloateval{#3}}}{\num{\xintfloateval{round(#3,#2)}}}%
+ \ensuremath{1}%
}%
{%
- \num{\xintiieval{#3}}%
+ \IfEndWith{\calculargument}{/1}%
+ {%si c'est un entier !
+ \xdef\calculargument{\xintiieval{#2}}%
+ \xdef\ExtractRacStop{\xintiFloor{\xintfloateval{sqrt(\calculargument)}}}%
+ \xintFor* ##1 in {\xintSeq{1}{\ExtractRacStop}}\do{%
+ \xintifboolexpr{ \xintiiRem{\calculargument}{\xintiieval{##1*##1}} == 0}%si le carré divise
+ {\xdef\ExtractRacID{##1}}%
+ {}%
+ }%
+ \xdef\ExtracReste{\xintiieval{\calculargument/(\ExtractRacID*\ExtractRacID)}}%
+ \ensuremath{\xintifboolexpr{\ExtractRacID == 1 && \ExtracReste == 1}%
+ {1}%
+ { \xintifboolexpr{\ExtractRacID == 1}{}{\num{\xintiieval{\ExtractRacID}}}%
+ \xintifboolexpr{\ExtracReste == 1}{}{\sqrt{\num{\ExtracReste}}} }%
+ }%
}%
+ {%on va mettre sous forme a\sqrt(d)/b := buggue avec des millièmes...
+ \StrBefore{\calculargument}{/}[\numerateur]%on extrait le numérateur
+ \StrBehind{\calculargument}{/}[\denominateur]%on extrait le dénominateur
+ \xdef\ExtractRacNNum{\xintiieval{\numerateur*\denominateur}}%
+ \xdef\ExtractRacStop{\xintiFloor{\xintfloateval{sqrt(\ExtractRacNNum)}}}%
+ \xintFor* ##1 in {\xintSeq{1}{\ExtractRacStop}}\do{%
+ \xintifboolexpr{ \xintiiRem{\ExtractRacNNum}{\xintiieval{##1*##1}} == 0}%si le carré divise
+ {\xdef\ExtractRacID{##1}}%
+ {}
+ }%
+ \xdef\ExtractRacGCD{\xintiiGCD{\ExtractRacID}{\denominateur}}%
+ \xdef\RacNumSimpl{\xintiieval{\ExtractRacID/\ExtractRacGCD}}%simpl num
+ \xdef\RacDenomSimpl{\xintiieval{\denominateur/\ExtractRacGCD}}%
+ \xdef\RacRacSimpl{\xintiieval{\ExtractRacNNum/(\ExtractRacID*\ExtractRacID)}}%
+ \IfEq{#1}{}%fraction classique
+ {%
+ \ensuremath{\frac{%
+ \xintifboolexpr{\RacNumSimpl == 1 && \RacRacSimpl == 1}%
+ {1}%
+ { \xintifboolexpr{\RacNumSimpl == 1}{}{\RacNumSimpl} \xintifboolexpr{\RacRacSimpl == 1}{}{\sqrt{\num{\RacRacSimpl}}} }%
+ }%
+ { \RacDenomSimpl }}%
+ }%
+ {}%
+ \IfEq{#1}{d}%dfraction
+ {%
+ \ensuremath{\dfrac{%
+ \xintifboolexpr{\RacNumSimpl == 1 && \RacRacSimpl == 1}%
+ {1}%
+ { \xintifboolexpr{\RacNumSimpl == 1}{}{\RacNumSimpl} \xintifboolexpr{\RacRacSimpl == 1}{}{\sqrt{\num{\RacRacSimpl}}} }%
+ }%
+ { \RacDenomSimpl }}%
+ }%
+ {}%
+ \IfEq{#1}{n}%nfraction
+ {%
+ \ensuremath{\nicefrac{%
+ \xintifboolexpr{\RacNumSimpl == 1 && \RacRacSimpl == 1}%
+ {1}%
+ { \xintifboolexpr{\RacNumSimpl == 1}{}{\RacNumSimpl} \xintifboolexpr{\RacRacSimpl == 1}{}{\sqrt{\num{\RacRacSimpl}}} }%
+ }%
+ { \RacDenomSimpl }}%
+ }%
+ {}%
+ }%
+}%
}
+\NewDocumentCommand\xintnumfrac{ s O{} m }{%patch xinttotexfrac
+ %*=moins sur le numérateur
+ %2=argument.optionnel[d/t/dec=...]
+ %3=argument mandataire {calcul ou fraction}
+ \xdef\calculargument{\xintPRaw{\xintIrr{\xinteval{#3}}}}%on calcule et on transforme en A/B
+ \IfSubStr{\calculargument}{/}%on teste si le symbole / apparaît
+ {%si oui := fraction
+ \StrBefore{\calculargument}{/}[\numerateur]%on extrait le numérateur
+ \StrBehind{\calculargument}{/}[\denominateur]%on extrait le dénominateur
+ \ifblank{#2}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{d}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\dfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\dfrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\dfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{t}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\tfrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{n}%
+ {%
+ {\ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfSubStr{#2}{dec}%on veut la forme décimale
+ {%
+ \IfSubStr{#2}{=}%si on rajoute une précision
+ {%
+ \StrBehind{#2}{=}[\precdecimal]%
+ \ensuremath{\num{\xintfloateval{round(#3,\precdecimal)}}}%
+ }%
+ {%
+ \ensuremath{\num{\xintfloateval{#3}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ }%
+ {%si non := entier
+ \num{\calculargument}%on affiche l'entier, avec le package siunitx
+ }%
+}
+
+\NewDocumentCommand\xintnumrad{ s O{} m }{%
+ %1 = options
+ %2 = angle sous la forme a*pi/b
+ \StrDel{#3}{pi}[\MPargument]%
+ \IfBeginWith{#3}{pi}%
+ {\StrSubstitute{#3}{pi}{1}[\MPargument]}%
+ {}%
+ \IfBeginWith{#3}{-pi}%
+ {\StrSubstitute{#3}{pi}{1}[\MPargument]}%
+ {}%
+ %on conserve les données initiales
+ \IfSubStr{\MPargument}{/}%on coupe numérateur/dénominateur
+ {\StrCut{\MPargument}{/}\MPnumerateurinit\MPdenominateurinit}%
+ {\xdef\MPnumerateurinit{\MPargument}\xdef\MPdenominateurinit{1}}%
+ %on affiche le début, avant simplification
+ \IfStrEq{#2}{d}%
+ {%
+ \ensuremath{%
+ \xintifboolexpr{\MPdenominateurinit == 1}%
+ {%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}%
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
+ }%
+ {%
+ \displaystyle\IfBooleanT{#1}{-}\frac{%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{\IfBooleanTF{#1}{}{-}\pi}{}
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{ \IfBooleanTF{#1}{\xinteval{abs(\MPnumerateurinit)}}{\MPnumerateurinit} }\pi}{}%
+ }%
+ {%
+ \num{\MPdenominateurinit}%
+ }%
+ }%
+ }%
+ }%
+ {}%
+ \IfStrEq{#2}{t}%
+ {%
+ \ensuremath{%
+ \xintifboolexpr{\MPdenominateurinit == 1}%
+ {%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}%
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
+ }%
+ {%
+ \IfBooleanT{#1}{-}\tfrac{%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{ \IfBooleanTF{#1}{\xinteval{abs(\MPnumerateurinit)}}{\MPnumerateurinit} }\pi}{}%
+ }%
+ {%
+ \num{\MPdenominateurinit}%
+ }%
+ }%
+ }%
+ }%
+ {}%
+ \IfStrEq{#2}{}%
+ {%
+ \ensuremath{%
+ \xintifboolexpr{\MPdenominateurinit == 1}%
+ {%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}%
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
+ }%
+ {%
+ \IfBooleanT{#1}{-}\frac{%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{ \IfBooleanTF{#1}{\xinteval{abs(\MPnumerateurinit)}}{\MPnumerateurinit} }\pi}{}%
+ }%
+ {%
+ \num{\MPdenominateurinit}%
+ }%
+ }%
+ }%
+ }%
+ {}%
+ \IfStrEq{#2}{n}%
+ {%
+ \ensuremath{%
+ \xintifboolexpr{\MPdenominateurinit == 1}%
+ {%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}%
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
+ }%
+ {%
+ \nicefrac{%
+ \xintifboolexpr{\MPnumerateurinit == 1}{\pi}{}%
+ \xintifboolexpr{\MPnumerateurinit == -1}{-\pi}{}
+ \xintifboolexpr{\xinteval{abs(\MPnumerateurinit) != 1}}{\num{\MPnumerateurinit}\pi}{}%
+ }%
+ {%
+ \num{\MPdenominateurinit}%
+ }%
+ }%
+ }%
+ }%
+ {}%
+}
+
%%------Codes listings
\input{proflycee-tools-listings.tex}
%%------Trigo
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-07 08:08:12 UTC (rev 72482)
+++ trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-ecritures.tex 2024-10-07 21:46:42 UTC (rev 72483)
@@ -310,6 +310,12 @@
}%
}
+\NewDocumentCommand\EqCartDroite{ O{t} m m m }{%
+ \ensuremath{%
+ \begin{dcases} #2 \\ #3 \\ #4 \end{dcases}\text{, } #1 \in \R%
+ }%
+}
+
%====PROBAS
\setKVdefault[probascondit]{%
min=false,%
Modified: trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-recreat.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-recreat.tex 2024-10-07 08:08:12 UTC (rev 72482)
+++ trunk/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-recreat.tex 2024-10-07 21:46:42 UTC (rev 72483)
@@ -610,4 +610,122 @@
\end{tikzpicture}
}
+%====PYRAMIDE D'ORANGES
+\usetikzlibrary{shadings}
+\usepackage{simplekv}
+
+\setKVdefault[PyrBalls]{%
+ Couleur=gray,%
+ Rotation=-5,%
+ Echelle=1
+}
+
+\NewDocumentCommand\EmpilementBalles{ O{} m }{%
+ \restoreKV[PyrBalls]%
+ \setKV[PyrBalls]{#1}%
+ \IfSubStr{#2}{-}%
+ {%
+ \StrCut{#2}{-}{\pyrballsdeb}{\pyrballsfin}%
+ \foreach \i in {\pyrballsdeb,...,\pyrballsfin}{%
+ \begin{tikzpicture}[scale=\fpeval{0.5*\useKV[PyrBalls]{Echelle}},rotate={\useKV[PyrBalls]{Rotation}},transform shape]
+ \foreach \x in {\numexpr\i-1\relax,...,0}{
+ \foreach \y in {\x,...,\numexpr\i-1\relax}{
+ %côté gauche
+ \shade[ball color={\useKV[PyrBalls]{Couleur}},shading angle=50] (0.6*\x,-\y+0.3*\x) circle[radius=0.55] ;
+ %côté 'droit'
+ \shade[ball color={\useKV[PyrBalls]{Couleur}},shading angle=0] (-0.6*\x,-\y+0.3*\x) circle[radius=0.55] ;
+ }
+ }
+ \end{tikzpicture}%
+ }%
+ }%
+ {%
+ \begin{tikzpicture}[scale={\useKV[PyrBalls]{Echelle}},rotate={\useKV[PyrBalls]{Rotation}},transform shape]
+ \foreach \x in {\numexpr#2-1\relax,...,0}{
+ \foreach \y in {\x,...,\numexpr#2-1\relax}{
+ %côté gauche
+ \shade[ball color={\useKV[PyrBalls]{Couleur}},shading angle=50] (0.6*\x,-\y+0.3*\x) circle[radius=0.55] ;
+ %côté 'droit'
+ \shade[ball color={\useKV[PyrBalls]{Couleur}},shading angle=0] (-0.6*\x,-\y+0.3*\x) circle[radius=0.55] ;
+ }
+ }
+ \end{tikzpicture}%
+ }%
+}
+
+%====DATES
+\IfPackageLoadedTF{datetime2}%
+ {}%
+ {%
+ \RequirePackage[fr-FR]{datetime2}
+ }%
+
+\RequirePackage{datetime2-calc}
+
+\newcount\tmpmyct
+
+\NewDocumentCommand\JourSelonDate{ s m }{%
+ \StrBehind[2]{#2}{/}[\tmptheyear]%
+ \StrBetween[1,2]{#2}{/}{/}[\tmpthemonth]%
+ \StrBefore[1]{#2}{/}[\tmptheday]%
+ \xdef\tmpdate{\tmptheyear-\tmpthemonth-\tmptheday}%
+ \DTMcomputedayofweekindex{\tmpdate}{\indexjdls}%
+ \IfStrEqCase{\indexjdls}{%
+ {0}{\IfBooleanTF{#1}{L}{l}undi}%
+ {1}{\IfBooleanTF{#1}{M}{m}ardi}%
+ {2}{\IfBooleanTF{#1}{M}{m}ercredi}%
+ {3}{\IfBooleanTF{#1}{J}{j}eudi}%
+ {4}{\IfBooleanTF{#1}{V}{v}endredi}%
+ {5}{\IfBooleanTF{#1}{S}{s}amedi}%
+ {6}{\IfBooleanTF{#1}{D}{d}imanche}%
+ }{}%
+}
+
+\NewDocumentCommand\DateComplete{ s m }{%
+ \IfBooleanTF{#1}%
+ {%
+ \JourSelonDate*{#2} %
+ }%
+ {
+ \JourSelonDate{#2} %
+ }%
+ \xdef\tmpdateinit{\tmptheyear-\tmpthemonth-\tmptheday}%
+ \DTMsavedate{datecplt}{\tmpdateinit}%
+ \DTMusedate{datecplt}{}%
+}
+
+\NewDocumentCommand\NbJoursEntreDates{ s m m O{\nbjoursentre} }{%
+ \StrBehind[2]{#2}{/}[\tmptheyear]%
+ \StrBetween[1,2]{#2}{/}{/}[\tmpthemonth]%
+ \StrBefore[1]{#2}{/}[\tmptheday]%
+ \xdef\tmpdateA{\tmptheyear-\tmpthemonth-\tmptheday}%
+ \StrBehind[2]{#3}{/}[\tmptheyear]%
+ \StrBetween[1,2]{#3}{/}{/}[\tmpthemonth]%
+ \StrBefore[1]{#3}{/}[\tmptheday]%
+ \xdef\tmpdateB{\tmptheyear-\tmpthemonth-\tmptheday}%
+ \DTMsavedate{dateinitiale}{\tmpdateA}%
+ \DTMsavedate{datefinale}{\tmpdateB}%
+ \DTMsaveddatediff{dateinitiale}{datefinale}{\tmpmyct}%
+ \xdef#4{\fpeval{abs(\tmpmyct)}}%
+ \IfBooleanT{#1}{#4}%
+}
+
+\NewDocumentCommand\AjoutJoursDate{ s m m }{%
+ \StrBehind[2]{#2}{/}[\tmptheyear]%
+ \StrBetween[1,2]{#2}{/}{/}[\tmpthemonth]%
+ \StrBefore[1]{#2}{/}[\tmptheday]%
+ \xdef\tmpdateinit{\tmptheyear-\tmpthemonth-\tmptheday}%
+ \DTMsavedate{dateinitiale}{\tmpdateinit}%
+ \DTMsaveddateoffsettojulianday{dateinitiale}{#3}\tmpmyct%
+ \DTMsavejulianday{datefinale}{\number\tmpmyct}%
+ \IfBooleanTF{#1}%
+ {%
+ \DTMfetchday{datefinale}/\DTMfetchmonth{datefinale}/\DTMfetchyear{datefinale}{}%
+ }%
+ {%
+ \DTMusedate{datefinale}{}%
+ }%
+}
+
+
\endinput
\ No newline at end of file
More information about the tex-live-commits
mailing list.