summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/proflycee/tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-05-22 03:05:17 +0000
committerNorbert Preining <norbert@preining.info>2023-05-22 03:05:17 +0000
commitaaab1b0cf810d8f8df45d972eb51da24a0114047 (patch)
treece163b5286c1960439c0f182f803164e1e028eeb /macros/latex/contrib/proflycee/tex
parentacbf029eb7f81c05b715461ab1ce2ab7e4f6ce09 (diff)
CTAN sync 202305220305
Diffstat (limited to 'macros/latex/contrib/proflycee/tex')
-rw-r--r--macros/latex/contrib/proflycee/tex/ProfLycee.sty14
-rw-r--r--macros/latex/contrib/proflycee/tex/proflycee-tools-arithm.tex6
-rw-r--r--macros/latex/contrib/proflycee/tex/proflycee-tools-geom.tex233
3 files changed, 176 insertions, 77 deletions
diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty
index 89b82dd10c..d07d2975a2 100644
--- a/macros/latex/contrib/proflycee/tex/ProfLycee.sty
+++ b/macros/latex/contrib/proflycee/tex/ProfLycee.sty
@@ -3,7 +3,8 @@
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfLycee}[2023/05/19 2.6.4 Aide pour l'utilisation de LaTeX en lycee]
+\ProvidesPackage{ProfLycee}[2023/05/20 2.6.5 Aide pour l'utilisation de LaTeX en lycee]
+% 2.6.5 Ajout d'une option[noamssymb] pour éviter les clashs avec fourier (merci PfC) + Corections de bugs + Bug avec ; et pdflatex (utlisation de | à la place !)
% 2.6.4 Correction d'un dysfonctionnement avec les racines (oubli du \num) + Equation diophantienne ax+by=c + Eq cartésiennes (plan & droite) + Corrections de bugs mineurs
% 2.6.3 Ajout d'une commande pour rédiger l'obtention de l'équation affine d'une droite passant par deux points
% 2.6.2 Correction de commandes pour la pseudo3d + nouvelle clé pour la trigo
@@ -46,14 +47,21 @@
% 2.0.1 Chargement de piton uniquement si lua...
% 2.0.0 Refonte des commandes, des options, et de la documentation !!!
+%------Mathtools
+\RequirePackage{mathtools}
+
%------Option(s)
\newif\if@build \@buildfalse
-\DeclareOption{build}{\@buildtrue}
+\newif\if@loadamssymb \@loadamssymbtrue
+\DeclareOption{build}{\@buildtrue}%
+\DeclareOption{nonamssymb}{\@loadamssymbfalse}%
\DeclareOption*{}
\ProcessOptions\relax
%------Packages utiles
-\RequirePackage{mathtools}
+\if@loadamssymb
+ \RequirePackage{amssymb}
+\fi
\RequirePackage[table,svgnames]{xcolor}%Gestion des couleurs
\RequirePackage{tikz}
\RequirePackage{tkz-tab}
diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-arithm.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-arithm.tex
index 42e9264e5d..5980ef9000 100644
--- a/macros/latex/contrib/proflycee/tex/proflycee-tools-arithm.tex
+++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-arithm.tex
@@ -322,7 +322,7 @@
}
%%===Équations diophantiennes
-\RequirePackage{cancel}
+\RequirePackage[thicklines]{cancel}%comme PfC
\NewDocumentCommand\AffCoeffDioph{ m }{%
\xintifboolexpr{#1 < 0}%
{\left( \num{#1} \right)}%
@@ -418,8 +418,8 @@
& \num{\AAA} & \left( \XXX \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\TmpU*\CCC}}} \right)& \AffCoeffDioph{\BBB} & \left( \YYY \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\TmpV*\CCC}}} \right) & 0\\
\end{array}}
\]%
- \xdef\TmpPartieA{\XXX \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\TmpU*\CCC}}}}%
- \xdef\TmpPartieB{\YYY \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\TmpV*\CCC}}}}%
+ \def\TmpPartieA{\XXX \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\TmpU*\CCC}}}}%
+ \def\TmpPartieB{\YYY \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\TmpV*\CCC}}}}%
%
On en déduit que $\num{\AAA} \times \underbrace{\left( \TmpPartieA \right)}_{\text{entier}} = \num{\xinteval{-\BBB}} \times \left( \TmpPartieB \right)$, et donc que $\num{\AAA} \mid \num{\xinteval{-\BBB}} \times \left( \TmpPartieB \right)$.\par\smallskip
Or \num{\xinteval{abs(\AAA)}} et \num{\xinteval{abs(\BBB)}} sont premiers entre eux, donc d'après le théorème de Gauss, on a $\num{\AAA} \mid \TmpPartieB$.\par
diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-geom.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-geom.tex
index 1758c015fd..b274d1a6ec 100644
--- a/macros/latex/contrib/proflycee/tex/proflycee-tools-geom.tex
+++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-geom.tex
@@ -137,6 +137,8 @@
%%Equations Cartésiennes + Affichages coordonnées
\RequirePackage{nicematrix}
+%\RequirePackage{ifpdf}
+
\NewDocumentCommand\AffCoeffSgn{ s O{} m m D<>{} }{%
\IfStrEq{#5}{}%si argument vide, on convertit en fraction
{%
@@ -159,7 +161,7 @@
}%
%sinon on met en brut
{%
- #3#4
+ #3#4%
}%
}
@@ -173,19 +175,19 @@
{%
\IfBooleanTF{#1}{}{+}%
\xintifboolexpr{\xinteval{#3} == 1}%
- {#3}%
+ {+1}%
{+\ConversionFraction[#2]{#3}}%
}%
{%
\xintifboolexpr{\xinteval{#3} == -1}%
- {#3\relax}%
+ {-1}%
{\ConversionFraction[#2]{#3}}%
} %
}%
}%
%sinon on met en brut
{%
- #3
+ #3%
}%
}
@@ -200,7 +202,14 @@
Facteur=1
}
-\NewDocumentCommand\TrouveEqCartPlan{ O{} r() r() d() }{%test commande générique avec VP ou PPP ou PVV
+\NewDocumentCommand\TrouveEqCartPlan{ }{%
+ \begingroup
+ \catcode`\;12
+ \TrouveEqCartPlanAux
+}
+
+\NewDocumentCommand\TrouveEqCartPlanAux{ O{} r() r() d() }{%test commande générique avec VP ou PPP ou PVV
+ \endgroup
\restoreKV[eqcartplan]% revenir au valeurs par défaut
\setKV[eqcartplan]{#1}% lit les arguments optionnels
\IfNoValueTF{#4}%c'est Vect+Point
@@ -327,11 +336,45 @@
Facteur=1
}
-\NewDocumentCommand\TrouveEqCartDroite{ O{} r() r() }{%vect/point ou point/point
+\NewDocumentCommand\TrouveEqCartDroite{ }{%
+ \begingroup
+ \catcode`\;12
+ \TrouveEqCartDroiteAux
+}
+
+\NewDocumentCommand\TrouveEqCartDroiteAux{ O{} r() r() }{%vect/point ou point/point
+ \endgroup
\restoreKV[eqcartdroite]% revenir au valeurs par défaut
\setKV[eqcartdroite]{#1}% lit les arguments optionnels
%on teste si c'est point/point
- \IfSubStr{#2}{;}%c'est vecteur+point, sinon c'est point+point
+ \IfSubStr{#2}{,}%c'est point+point, sinon c'est vecteur+point
+ {%
+ \setsepchar{,}\readlist*\CoordPtA{#2}%
+ \setsepchar{,}\readlist*\CoordPtB{#3}%
+ \itemtomacro\CoordPtA[1]\xpta%
+ \itemtomacro\CoordPtA[2]\ypta%
+ \itemtomacro\CoordPtB[1]\xptb%
+ \itemtomacro\CoordPtB[2]\yptb%
+ \xdef\vecnx{((\xptb)-(\xpta))}%
+ \xdef\vecny{((\yptb)-(\ypta))}%
+ %calculs
+ \xdef\coeffd{((\xpta)*(\vecny)-(\ypta)*(\vecnx))}%
+ \xdef\PPCMDenom{\xinteval{lcm([\xintDenominator{\xintIrr{\xinteval{\vecnx}}},\xintDenominator{\xintIrr{\xinteval{\vecny}}},\xintDenominator{\xintIrr{\xinteval{\coeffd}}}])}}%
+ \xdef\PGCDsiEntiers{1}%
+ \xintifboolexpr{\xinteval{isint(\vecnx)}*\xinteval{isint(\vecny)}*\xinteval{isint(\coeffd)} == 1}%tous les coeffs sont entiers
+ {%
+ \xdef\PGCDsiEntiers{\xinteval{gcd([\xinteval{\vecnx},\xinteval{\vecny},\xinteval{\coeffd}])}}%
+ }%
+ {}%
+ %affichages
+ \ifboolKV[eqcartdroite]{SimplifCoeffs}%
+ {%
+ \AffCoeffSgn*[\eqcartdteformat]{-\vecny*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{x} \AffCoeffSgn[\eqcartdteformat]{\vecnx*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers} = 0%
+ }%
+ {%
+ \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecnx)}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{(\coeffd)} = 0%
+ }%
+ }
{%
\setsepchar{;}\readlist*\CoordVec{#2}%
\setsepchar{,}\readlist*\CoordPt{#3}%
@@ -359,56 +402,36 @@
{%
\ifboolKV[eqcartdroite]{VectDirecteur}%
{%
- \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecnx)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers} = 0%
+ \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)*(\eqcartdtefact)*(\PPCMDenom)/(\PGCDsiEntiers)}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecnx)*(\eqcartdtefact)*(\PPCMDenom)/(\PGCDsiEntiers)}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{(\coeffd)*(\eqcartdtefact)*(\PPCMDenom)/(\PGCDsiEntiers)} = 0%
}%
{%
- \AffCoeffSgn*[\eqcartdteformat]{(\vecnx)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecny)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers} = 0%
+ \AffCoeffSgn*[\eqcartdteformat]{(\vecnx)*(\eqcartdtefact)*(\PPCMDenom)/(\PGCDsiEntiers)}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecny)*(\eqcartdtefact)*(\PPCMDenom)/(\PGCDsiEntiers)}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{(\coeffd)*(\eqcartdtefact)*(\PPCMDenom)/(\PGCDsiEntiers)} = 0%
}%
}%
{%
\ifboolKV[eqcartdroite]{VectDirecteur}%
{%
- \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)}{x} \AffCoeffSgn[\eqcartdteformat]{\vecnx}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd} = 0%
+ \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)}{x} \AffCoeffSgn[\eqcartdteformat]{\vecnx}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{(\coeffd)} = 0%
}%
{%
- \AffCoeffSgn*[\eqcartdteformat]{\vecnx}{x} \AffCoeffSgn[\eqcartdteformat]{\vecny}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd} = 0%
+ \AffCoeffSgn*[\eqcartdteformat]{\vecnx}{x} \AffCoeffSgn[\eqcartdteformat]{\vecny}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{(\coeffd)} = 0%
}%
}%
- }%
- {%
- \setsepchar{,}\readlist*\CoordPtA{#2}%
- \setsepchar{,}\readlist*\CoordPtB{#3}%
- \itemtomacro\CoordPtA[1]\xpta%
- \itemtomacro\CoordPtA[2]\ypta%
- \itemtomacro\CoordPtB[1]\xptb%
- \itemtomacro\CoordPtB[2]\yptb%
- \xdef\vecnx{((\xptb)-(\xpta))}%
- \xdef\vecny{((\yptb)-(\ypta))}%
- %calculs
- \xdef\coeffd{((\xpta)*(\vecny)-(\ypta)*(\vecnx))}%
- \xdef\PPCMDenom{\xinteval{lcm([\xintDenominator{\xintIrr{\xinteval{\vecnx}}},\xintDenominator{\xintIrr{\xinteval{\vecny}}},\xintDenominator{\xintIrr{\xinteval{\coeffd}}}])}}%
- \xdef\PGCDsiEntiers{1}%
- \xintifboolexpr{\xinteval{isint(\vecnx)}*\xinteval{isint(\vecny)}*\xinteval{isint(\coeffd)} == 1}%tous les coeffs sont entiers
- {%
- \xdef\PGCDsiEntiers{\xinteval{gcd([\xinteval{\vecnx},\xinteval{\vecny},\xinteval{\coeffd}])}}%
- }%
- {}%
- %affichages
- \ifboolKV[eqcartdroite]{SimplifCoeffs}%
- {%
- \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecnx)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers} = 0%
- }%
- {%
- \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecnx)}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd} = 0%
- }%
- }%
+ }%%
+}
+
+\NewDocumentCommand\AffVecteur{ }{%
+ \begingroup
+ \catcode`\;12
+ \AffVecteurAux
}
-\NewDocumentCommand\AffVecteur{ O{d} D<>{} r() }{%
+\NewDocumentCommand\AffVecteurAux{ O{d} D<>{} r() }{%
+ \endgroup
\setsepchar{;}\readlist*\CoordVec{#3}%
\xintifboolexpr{\CoordVeclen == 2}%
{%
- \IfSubStr{#1}{;}%si l'option est globale...
+ \IfSubStr{#1}{;}%
{%
\setsepchar{;}\readlist*\OptVec{#1}%
\itemtomacro\OptVec[1]\optvecx%
@@ -423,23 +446,23 @@
}%
{}%
\xintifboolexpr{\CoordVeclen == 3}%
- {%
- \IfSubStr{#1}{;}%si l'option est globale...
- {%
- \setsepchar{;}\readlist*\OptVec{#1}%
- \itemtomacro\OptVec[1]\optvecx%
- \itemtomacro\OptVec[2]\optvecy%
- \itemtomacro\OptVec[3]\optvecz%
- }%
- {%
- \xdef\optvecx{#1}\xdef\optvecy{#1}\xdef\optvecz{#1}%
- }%
- \itemtomacro\CoordVec[1]\vecx%
- \itemtomacro\CoordVec[2]\vecy%
- \itemtomacro\CoordVec[3]\vecz%
- \begin{pNiceMatrix}[#2] \ConversionFraction[\optvecx]{\vecx} \\ \ConversionFraction[\optvecy]{\vecy} \\ \ConversionFraction[\optvecz]{\vecz} \end{pNiceMatrix}%
- }%
- {}%
+ {%
+ \IfSubStr{#1}{;}%
+ {%
+ \setsepchar{;}\readlist*\OptVec{#1}%
+ \itemtomacro\OptVec[1]\optvecx%
+ \itemtomacro\OptVec[2]\optvecy%
+ \itemtomacro\OptVec[3]\optvecz%
+ }%
+ {%
+ \xdef\optvecx{#1}\xdef\optvecy{#1}\xdef\optvecz{#1}%
+ }%
+ \itemtomacro\CoordVec[1]\vecx%
+ \itemtomacro\CoordVec[2]\vecy%
+ \itemtomacro\CoordVec[3]\vecz%
+ \begin{pNiceMatrix}[#2] \ConversionFraction[\optvecx]{\vecx} \\ \ConversionFraction[\optvecy]{\vecy} \\ \ConversionFraction[\optvecz]{\vecz} \end{pNiceMatrix}%
+ }%
+ {}%
}
\NewDocumentCommand\AffPoint{ O{d} r() }{%
@@ -509,21 +532,18 @@
\restmp%
}
-\NewDocumentCommand\TrouveEqParamDroite{ O{} r() r() }{%vect/point ou point/point
+\NewDocumentCommand\TrouveEqParamDroite{ }{%
+ \begingroup
+ \catcode`\;12
+ \TrouveEqParamDroiteAux
+}
+
+\NewDocumentCommand\TrouveEqParamDroiteAux{ O{} r() r() }{%vect/point ou point/point
+ \endgroup
\restoreKV[eqparamdroite]% revenir au valeurs par défaut
\setKV[eqparamdroite]{#1}% lit les arguments optionnels
%on teste si c'est point/point
- \IfSubStr{#2}{;}%c'est vecteur+point, sinon c'est point+point
- {%
- \setsepchar{;}\readlist*\CoordVec{#2}%
- \setsepchar{,}\readlist*\CoordPt{#3}%
- \itemtomacro\CoordVec[1]\vecdirx%
- \itemtomacro\CoordVec[2]\vecdiry%
- \itemtomacro\CoordVec[3]\vecdirz%
- \itemtomacro\CoordPt[1]\xpta%
- \itemtomacro\CoordPt[2]\ypta%
- \itemtomacro\CoordPt[3]\zpta%
- }%
+ \IfSubStr{#2}{,}%c'est point+point, sinon c'est vecteur+point
{%
\setsepchar{,}\readlist*\CoordPtA{#2}%
\setsepchar{,}\readlist*\CoordPtB{#3}%
@@ -545,6 +565,16 @@
\xdef\vecdirz{((\zptb)-(\zpta))}%
}%
}%
+ {%
+ \setsepchar{;}\readlist*\CoordVec{#2}%
+ \setsepchar{,}\readlist*\CoordPt{#3}%
+ \itemtomacro\CoordVec[1]\vecdirx%
+ \itemtomacro\CoordVec[2]\vecdiry%
+ \itemtomacro\CoordVec[3]\vecdirz%
+ \itemtomacro\CoordPt[1]\xpta%
+ \itemtomacro\CoordPt[2]\ypta%
+ \itemtomacro\CoordPt[3]\zpta%
+ }%
\ifboolKV[eqparamdroite]{Aligne}%
{%
\left\lbrace\begin{array}{@{\,}l@{\;=\;}l@{\;}r}
@@ -564,7 +594,14 @@
}%
}
-\NewDocumentCommand\TrouveDistancePtPlan{ r() r() d() }{%pt+vect+pt
+\NewDocumentCommand\TrouveDistancePtPlan{ }{%
+ \begingroup
+ \catcode`\;12
+ \TrouveDistancePtPlanAux
+}
+
+\NewDocumentCommand\TrouveDistancePtPlanAux{ r() r() d() }{%pt+vect+pt
+ \endgroup
\IfNoValueTF{#3}%c'est Point + Equation // sinon c'est point + vectnorm + point
{%
\StrDel{#2}{=0}[\tmpeq]%
@@ -624,4 +661,58 @@
\SimplificationRacine{\restmp}%
}
+\NewDocumentCommand\TrouveNorme{ }{%
+ \begingroup
+ \catcode`\;12
+ \TrouveNormeAux
+}
+
+\NewDocumentCommand\TrouveNormeAux{ r() d() }{%pt+vect+pt
+ \endgroup
+ \IfNoValueTF{#2}%c'est Vecteur // sinon c'est point point
+ {%
+ \setsepchar{;}\readlist*\CoordVec{#1}%
+ \xintifboolexpr{\CoordVeclen == 2}%
+ {%
+ \itemtomacro\CoordVec[1]\xveca%
+ \itemtomacro\CoordVec[2]\yveca%
+ \xdef\restmp{(\xveca)**2+(\yveca)**2}%
+ }
+ {}%
+ \xintifboolexpr{\CoordVeclen == 3}%%
+ {%
+ \itemtomacro\CoordVec[1]\xveca%
+ \itemtomacro\CoordVec[2]\yveca%
+ \itemtomacro\CoordVec[3]\zveca%
+ \xdef\restmp{(\xveca)**2+(\yveca)**2+(\zveca)**2}%
+ }%
+ {}%
+ }%
+ {%
+ \setsepchar{,}\readlist*\CoordPtA{#1}%
+ \setsepchar{,}\readlist*\CoordPtB{#2}%
+ \xintifboolexpr{\CoordPtAlen == 2}%
+ {%
+ \itemtomacro\CoordPtA[1]\xa%
+ \itemtomacro\CoordPtA[2]\ya%
+ \itemtomacro\CoordPtB[1]\xb%
+ \itemtomacro\CoordPtB[2]\yb%
+ \xdef\restmp{((\xb)-(\xa))**2+((\yb)-(\ya))**2}%
+ }%
+ {}
+ \xintifboolexpr{\CoordPtAlen == 3}%
+ {%
+ \itemtomacro\CoordPtA[1]\xa%
+ \itemtomacro\CoordPtA[2]\ya%
+ \itemtomacro\CoordPtA[3]\za%
+ \itemtomacro\CoordPtB[1]\xb%
+ \itemtomacro\CoordPtB[2]\yb%
+ \itemtomacro\CoordPtB[3]\zb%
+ \xdef\restmp{((\xb)-(\xa))**2+((\yb)-(\ya))**2+((\zb)-(\za))**2}
+ }%
+ {}%
+ }%
+ \SimplificationRacine{\restmp}%
+}
+
\endinput \ No newline at end of file