texlive[58540] Master/texmf-dist: profcollege (19mar21)

commits+karl at tug.org commits+karl at tug.org
Fri Mar 19 22:27:45 CET 2021


Revision: 58540
          http://tug.org/svn/texlive?view=revision&revision=58540
Author:   karl
Date:     2021-03-19 22:27:45 +0100 (Fri, 19 Mar 2021)
Log Message:
-----------
profcollege (19mar21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf
    trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
    trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty

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

Modified: trunk/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty	2021-03-19 21:27:27 UTC (rev 58539)
+++ trunk/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty	2021-03-19 21:27:45 UTC (rev 58540)
@@ -3,7 +3,7 @@
 % or later, see http://www.latex-project.org/lppl.txtf
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfCollege}[2021/03/10 v0.95 Aide pour l'utilisation de LaTeX au collège]
+\ProvidesPackage{ProfCollege}[2021/03/18 v0.96 Aide pour l'utilisation de LaTeX au collège]
 
 \RequirePackage{verbatim}
 
@@ -542,8 +542,8 @@
 \def\MPCalculatrice#1#2#3{
   % #1 Calcul %2 réponse
   \ifluatex
-   \mplibforcehmode
-  \begin{mplibcode}
+   \mplibforcehmode%
+  \begin{mplibcode}%
     input PfC-Calculatrice;
     LCD(#1)(#2)(#3);
   \end{mplibcode}
@@ -554,10 +554,10 @@
   \fi
 }
 
-\setKVdefault[ClesCalculatrice]{Ecran=false,NbLignes=0}
+\setKVdefault[ClesCalculatrice]{Ecran=false,NbLignes=0,BL=0.775}
 
 \newcommand\Calculatrice[2][]{%
-  \setstackgap{L}{0.775\baselineskip}%
+  \setstackgap{L}{\useKV[ClesCalculatrice]{BL}\baselineskip}%
   \useKVdefault[ClesCalculatrice]%
   \setKV[ClesCalculatrice]{#1}%
   \ifboolKV[ClesCalculatrice]{Ecran}{%
@@ -2256,7 +2256,7 @@
 %%%
 % Le théorème de Pythagore
 %%%
-\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,FigureSeule=false,Angle=0,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,ValeurA=0,ValeurB=0,ValeurC=0}
+\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,FigureSeule=false,Angle=0,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,ValeurA=0,ValeurB=0,ValeurC=0,Perso=false}
 
 % On définit les figures à utiliser
 \def\MPFigurePytha#1#2#3#4#5#6{%
@@ -2438,6 +2438,8 @@
   \fi
 }
 
+\newcommand\RedactionPythagore{}
+
 \newcommand{\Pythagore}[5][]{%
   % #1 Paramètres sous forme de clés
   % #2 Nom "complet" du triangle : ABC par exemple
@@ -2536,6 +2538,10 @@
     \StrMid{#2}{1}{1}[\NomA]%
     \StrMid{#2}{2}{2}[\NomB]%
     \StrMid{#2}{3}{3}[\NomC]%
+    \xdef\NomTriangle{\NomA\NomB\NomC}%
+    \xdef\NomAngleDroit{\NomB}%
+    \xdef\NomSommetA{\NomA}%
+    \xdef\NomSommetC{\NomC}%
     % On trace une figure ou pas ?
     \ifboolKV[ClesPythagore]{FigureSeule}{%
       \MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}
@@ -2546,7 +2552,8 @@
           \[\MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}\]
           \par\columnbreak\par%
           % On démarre la résolution
-          \ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'égalité de Pythagore est vérifiée :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
+          \ifboolKV[ClesPythagore]{Perso}{\RedactionPythagore}{\ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'égalité de Pythagore est vérifiée :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
+            }%
           }%
           \xintifboolexpr{#3<#4 || #3=#4}{%\ifnum#3<#4%
             \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}%
@@ -2578,8 +2585,8 @@
         \end{multicols}
       }{%
         % On démarre la résolution
-        \ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'égalité de Pythagore est vérifiée :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
-        }%
+        \ifboolKV[ClesPythagore]{Perso}{\RedactionPythagore}{\ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'égalité de Pythagore est vérifiée :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
+        }}%
         \xintifboolexpr{#3<#4 || #3=#4}{%\ifnum#3<#4%
           \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}%
           \begin{align*}
@@ -5716,8 +5723,10 @@
 \fi
 }
 
-\setKVdefault[ClesTrigo]{Angle=0,Propor=false,Figure=false,FigureSeule=false,Precision=2,Unite=cm,Sinus=false,Cosinus=false,Tangente=false}%
+\setKVdefault[ClesTrigo]{Angle=0,Propor=false,Figure=false,FigureSeule=false,Precision=2,Unite=cm,Sinus=false,Cosinus=false,Tangente=false,Perso=false}%
 
+\newcommand\RedactionTrigo{}%
+
 \newcommand\TrigoCalculs[5][]{%
   \setKV[ClesTrigo]{#1}%
   % #1 Clés
@@ -5729,7 +5738,16 @@
   \StrMid{#2}{1}{1}[\NomA]%
   \StrMid{#2}{2}{2}[\NomB]%
   \StrMid{#2}{3}{3}[\NomC]%
-  Dans le triangle $\NomA\NomB\NomC$, rectangle en $\NomB$, on a :%
+  \xdef\NomTriangle{\NomA\NomB\NomC}%
+  \xdef\NomAngleDroit{\NomB}%
+  \xdef\NomSommetA{\NomA}%
+  \xdef\NomSommetB{\NomB}%
+  \xdef\NomSommetC{\NomC}%  
+  \ifboolKV[ClesTrigo]{Perso}{%
+    \RedactionTrigo%
+  }{%
+    Dans le triangle $\NomA\NomB\NomC$, rectangle en $\NomB$, on a :%
+  }%
   \ifboolKV[ClesTrigo]{Cosinus}{%
     \ifx\bla#3\bla%on calcule le côté adjacent
     \xdef\ResultatTrigo{\fpeval{round(\fpeval{#4*cosd(#5)},\useKV[ClesTrigo]{Precision})}}%
@@ -8764,6 +8782,78 @@
     ..Fn[k]
     endfor;
   \end{mplibcode}
+  \else
+  \begin{mpost}
+    x.u:=#2;
+    y.u:=#3;
+    X.u:=#4;
+    Y.u:=#5;
+    numeric dirav[],dirap[];
+    pair Fn[],Gn[];
+    n=0;
+    for p_=#1:
+    Gn[n]=p_;
+    Fn[n]=cm*(X.u*xpart(p_),Y.u*ypart(p_));
+    n:=n+1;
+    endfor;
+    N:=(n-1);
+    MinX=999;
+    MaxX=-999;
+    MinY=999;
+    MaxY=-999;
+    for k=0 upto N:
+    if xpart(Gn[k])<MinX:
+    MinX:=xpart(Gn[k]);
+    fi;
+    if xpart(Gn[k])>MaxX:
+    MaxX:=xpart(Gn[k]);
+    fi;
+    if ypart(Gn[k])<MinY:
+    MinY:=ypart(Gn[k]);
+    fi;
+    if ypart(Gn[k])>MaxY:
+    MaxY:=ypart(Gn[k]);
+    fi;
+    endfor;
+    if #6=0:
+    for k=MinY-1 step y.u until MaxY+1:
+    draw cm*((MinX-1)*X.u,k*Y.u)--cm*((MaxX+1)*X.u,k*Y.u) withcolor 0.75white;
+    endfor;
+    for k=MinX-1 step x.u until MaxX+1:
+    draw cm*(k*X.u,(MinY-1)*Y.u)--cm*(k*X.u,(MaxY+1)*Y.u) withcolor 0.75white;
+    endfor;
+    else:
+    for k=MinY-1 step y.u until MaxY+1:
+    draw cm*((MinX)*X.u,k*Y.u)--cm*((MaxX)*X.u,k*Y.u) withcolor 0.75white;
+    endfor;
+    for k=MinX step x.u until MaxX:
+    draw cm*(k*X.u,(MinY-1)*Y.u)--cm*(k*X.u,(MaxY+1)*Y.u) withcolor 0.75white;
+    endfor;
+    fi;
+    if #6=0:
+    for k=0 upto N:
+    fill cercles(Fn[k],0.5mm);
+    endfor;
+    else:
+    for k=1 upto N-1:
+    fill cercles(Fn[k],0.5mm);
+    endfor;
+    fi;
+    if #6=0:
+    drawarrow (0,(MinY-1)*Y.u*cm)--(0,(MaxY+1)*Y.u*cm);
+    drawarrow ((MinX-1)*X.u*cm,0)--((MaxX+1)*X.u*cm,0);
+    else:
+    drawarrow (0,(MinY-1)*Y.u*cm)--(0,(MaxY+1)*Y.u*cm);
+    drawarrow ((MinX)*X.u*cm,0)--((MaxX)*X.u*cm,0);
+    fi;
+    label.llft(btex O etex,(0,0));
+    dotlabel.bot(btex 1 etex,cm*X.u*(1,0));
+    dotlabel.lft(btex 1 etex,cm*Y.u*(0,1));
+    draw Fn[0]
+    for k=1 upto N:
+    ..Fn[k]
+    endfor;
+  \end{mpost}
   \fi
 }
 
@@ -8850,6 +8940,87 @@
     endfor
     ..{dir dirav[N]}Fn[N];
   \end{mplibcode}
+  \else
+  \begin{mpost}
+        x.u:=#2;
+    y.u:=#3;
+    X.u:=#4;
+    Y.u:=#5;
+    numeric dirav[],dirap[];
+    pair Fn[],Gn[];
+    n=0;
+    for p_=#1:
+    if (n mod 3)=0:
+    dirav[n div 3]=p_;
+    fi;
+    if (n mod 3)=1:
+    Gn[n div 3]=p_;
+    Fn[n div 3]=cm*(X.u*xpart(p_),Y.u*ypart(p_));
+    fi;
+    if (n mod 3)=2:
+    dirap[n div 3]=p_;
+    fi;
+    n:=n+1;
+    endfor;
+    N:=(n-1) div 3;
+    MinX=999;
+    MaxX=-999;
+    MinY=999;
+    MaxY=-999;
+    for k=0 upto N:
+    if xpart(Gn[k])<MinX:
+    MinX:=xpart(Gn[k]);
+    fi;
+    if xpart(Gn[k])>MaxX:
+    MaxX:=xpart(Gn[k]);
+    fi;
+    if ypart(Gn[k])<MinY:
+    MinY:=ypart(Gn[k]);
+    fi;
+    if ypart(Gn[k])>MaxY:
+    MaxY:=ypart(Gn[k]);
+    fi;
+    endfor;
+        if #6=0:
+    for k=MinY-1 step y.u until MaxY+1:
+    draw cm*((MinX-1)*X.u,k*Y.u)--cm*((MaxX+1)*X.u,k*Y.u) withcolor 0.75white;
+    endfor;
+    for k=MinX-1 step x.u until MaxX+1:
+    draw cm*(k*X.u,(MinY-1)*Y.u)--cm*(k*X.u,(MaxY+1)*Y.u) withcolor 0.75white;
+    endfor;
+    else:
+    for k=MinY-1 step y.u until MaxY+1:
+    draw cm*((MinX)*X.u,k*Y.u)--cm*((MaxX)*X.u,k*Y.u) withcolor 0.75white;
+    endfor;
+    for k=MinX step x.u until MaxX:
+    draw cm*(k*X.u,(MinY-1)*Y.u)--cm*(k*X.u,(MaxY+1)*Y.u) withcolor 0.75white;
+    endfor;
+    fi;
+    if #6=0:
+    for k=0 upto N:
+    fill cercles(Fn[k],0.5mm);
+    endfor;
+    else:
+    for k=1 upto N-1:
+    fill cercles(Fn[k],0.5mm);
+    endfor;
+    fi;
+    if #6=0:
+    drawarrow (0,(MinY-1)*Y.u*cm)--(0,(MaxY+1)*Y.u*cm);
+    drawarrow ((MinX-1)*X.u*cm,0)--((MaxX+1)*X.u*cm,0);
+    else:
+    drawarrow (0,(MinY-1)*Y.u*cm)--(0,(MaxY+1)*Y.u*cm);
+    drawarrow ((MinX)*X.u*cm,0)--((MaxX)*X.u*cm,0);
+    fi;
+    label.llft(btex O etex,(0,0));
+    dotlabel.bot(btex 1 etex,cm*X.u*(1,0));
+    dotlabel.lft(btex 1 etex,cm*Y.u*(0,1));
+    draw Fn[0]{dir dirap[0]}
+    for k=1 upto (N-1):
+    ..{dir dirav[k]}Fn[k]{dir dirap[k]}
+    endfor
+    ..{dir dirav[N]}Fn[N];
+  \end{mpost}
   \fi
 }
 
@@ -13039,4 +13210,73 @@
       \end{MyDominoMini}%
     }%
   }%
-}%
\ No newline at end of file
+}%
+
+%%%%
+% Prog de calculs "simples"
+%%%%
+\setKVdefault[ClesProg]{Ecart=2em,SansCalcul=false,Direct=true}
+
+\newcounter{nbprog}
+\setcounter{nbprog}{0}%
+
+\newcommand\ProgCalcul[2][]{%
+  % #1 : clés
+  % #2 : étapes
+  \useKVdefault[ClesProg]%
+  \setKV[ClesProg]{#1}%
+  \setsepchar[*]{,* }\ignoreemptyitems%
+  \readlist*\ListeProg{#2}%
+  \stepcounter{nbprog}%
+  \xdef\NbDepart{\ListeProg[1]}%
+  \ifboolKV[ClesProg]{SansCalcul}{%
+    $\NbDepart$\foreachitem\compteur\in\ListeProg[2]{%
+      \hspace{0.2em}\tikzmark{A-\thenbprog-\compteurcnt}\hspace{\useKV[ClesProg]{Ecart}}\tikzmark{B-\thenbprog-\compteurcnt}\hspace{0.2em}$\ListeProg[3,\compteurcnt]$%
+    }%
+    \begin{tikzpicture}[remember picture, overlay]
+      \foreachitem\compteur\in\ListeProg[2]{%
+        \edef\Test{\ListeProg[2,\compteurcnt]}
+        \expandarg%
+        \StrSubstitute{\Test}{^}{\empty\dots{}^}[\tempa]
+        \StrSubstitute{\tempa}{**}{^}[\tempab]
+        \StrSubstitute{\tempab}{*}{\times}[\tempac]
+        \StrSubstitute{\tempac}{/}{\div}[\tempad]
+        \draw[-stealth,transform canvas={yshift=0.25em}] (pic cs:A-\thenbprog-\compteurcnt) --
+        node[above]{\scriptsize$\tempad$}(pic cs:B-\thenbprog-\compteurcnt);
+      }
+    \end{tikzpicture}  
+  }{%
+    \num{\NbDepart}\foreachitem\compteur\in\ListeProg[2]{%
+      \hspace{0.2em}\tikzmark{A-\thenbprog-\compteurcnt}\hspace{\useKV[ClesProg]{Ecart}}\tikzmark{B-\thenbprog-\compteurcnt}\xdef\NbDepart{\fpeval{(\NbDepart)\ListeProg[2,\compteurcnt]}}\hspace{0.2em}\num{\NbDepart}%
+    }%
+    \ifboolKV[ClesProg]{Direct}{%
+      \begin{tikzpicture}[remember picture, overlay]
+        \foreachitem\compteur\in\ListeProg[2]{%
+          \edef\Test{\ListeProg[2,\compteurcnt]}
+          \expandarg%
+          \StrSubstitute{\Test}{^}{\empty\dots{}^}[\tempa]
+          \StrSubstitute{\tempa}{**}{^}[\tempab]
+          \StrSubstitute{\tempab}{*}{\times}[\tempac]
+          \StrSubstitute{\tempac}{/}{\div}[\tempad]
+          \draw[-stealth,transform canvas={yshift=0.25em}] (pic cs:A-\thenbprog-\compteurcnt) --
+          node[above]{\scriptsize$\tempad$}(pic
+          cs:B-\thenbprog-\compteurcnt);
+        }
+      \end{tikzpicture}
+    }{%
+      \begin{tikzpicture}[remember picture, overlay]
+        \foreachitem\compteur\in\ListeProg[2]{%
+          \edef\Test{\ListeProg[2,\compteurcnt]}
+          \expandarg%
+          \StrSubstitute{\Test}{^2}{\empty\sqrt{\dots{}}}[\tempa]
+          \StrSubstitute{\tempa}{**}{^}[\tempab]
+          \StrSubstitute{\tempab}{*}{\div}[\tempac]
+          \StrSubstitute{\tempac}{/}{\times}[\tempad]
+          \StrSubstitute{\tempad}{-}{+}[\tempae]
+          \StrSubstitute{\tempae}{++}{-}[\tempaf]
+          \draw[-stealth,transform canvas={yshift=0.25em}] (pic cs:B-\thenbprog-\compteurcnt) --  node[above]{\scriptsize$\tempaf$}(pic cs:A-\thenbprog-\compteurcnt);
+        }
+      \end{tikzpicture}
+    }%
+  }%
+}
\ No newline at end of file



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