summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/proflycee/tex/ProfLycee.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/proflycee/tex/ProfLycee.sty')
-rw-r--r--macros/latex/contrib/proflycee/tex/ProfLycee.sty128
1 files changed, 111 insertions, 17 deletions
diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty
index dd2d5b02f0..c16b078219 100644
--- a/macros/latex/contrib/proflycee/tex/ProfLycee.sty
+++ b/macros/latex/contrib/proflycee/tex/ProfLycee.sty
@@ -3,7 +3,9 @@
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfLycee}[2022/12/28 2.1.1 Aide pour l'utilisation de LaTeX en lycee]
+\ProvidesPackage{ProfLycee}[2022/12/30 2.1.3 Aide pour l'utilisation de LaTeX en lycee]
+% 2.1.3 Ajout de l'option auto-tabs-gobble sur piton (v1.0) + correction d'un bug sur CodePiton
+% 2.1.2 Ajout d'une commande pour déterminer la mesure principale d'un angle + option <ElargirOx/y> pour les axes
% 2.1.1 Ajout d'une section pour les tracés de repère et courbe, en tikz
% 2.1.0 Ajout du calcul du seuil pour les suites récurrentes + racines de nombres décimaux + option pour pythontex
% 2.0.9 Ajouts de commandes pour générer des nombres et listes aléatoires
@@ -632,8 +634,29 @@
Largeur=\linewidth,%
Alignement=center,%
Lignes=true,%
+ Gobble=true,%
TaillePolice=\footnotesize
}
+
+\tcbset{stylepiton/.style={%
+ enhanced,boxrule=1.25pt,%
+ sharp corners=downhill,arc=12pt,
+ before skip=12pt,after skip=12pt,%
+ top=10pt,bottom=1mm,rightupper=4pt,%leftupper=25pt,
+ attach boxed title to top right={yshift=-\tcboxedtitleheight},
+ boxed title style={
+ size=small,colback=ForestGreen!25,boxrule=1.25pt,
+ colframe=Green,boxsep=1.25pt,
+ sharp corners=downhill,
+ arc=12pt,
+ top=2pt,bottom=1pt,left=6pt,right=6pt
+ },
+ fonttitle=\color{ForestGreen}\itshape\ttfamily\footnotesize,
+ title={\scriptsize\faPython}\:Code Python\vphantom{p},
+ watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50,
+ }
+}
+
\ifluatex
\RequirePackage{piton}
\NewPitonEnvironment{CodePiton}{ O{} }%
@@ -641,13 +664,17 @@
\useKVdefault[envpiton]%
\setKV[envpiton]{#1}% on paramètres les nouvelles clés et on les simplifie
\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=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign]
+ {\PitonOptions{left-margin=auto,all-line-numbers}}%
+ {}%
+ \ifboolKV[envpiton]{Gobble}%si gobble=true
+ {\PitonOptions{tabs-auto-gobble}}%
+ {}%
+ \PitonOptions{break-lines,indent-broken-lines}%
+ \begin{tcolorbox}[stylepiton,leftupper=8pt,colframe=Green,colback=ForestGreen!5,width=\CODPITlargeur,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign]
}%
{%
\end{tcolorbox}%
- }
+ }%
\fi
%=========PSEUDOCODE=========== OK !!
@@ -1156,8 +1183,8 @@
}%
{}
%tracés
- \draw[\PLcerclethick,->] ({-\PLcerclerayon-\PLcerclemarge},0)--({\PLcerclerayon+\PLcerclemarge},0) ;
- \draw[\PLcerclethick,->] (0,{-\PLcerclerayon-\PLcerclemarge})--(0,{\PLcerclerayon+\PLcerclemarge}) ;
+ \draw[\PLcerclethick,->,>=latex] ({-\PLcerclerayon-\PLcerclemarge},0)--({\PLcerclerayon+\PLcerclemarge},0) ;
+ \draw[\PLcerclethick,->,>=latex] (0,{-\PLcerclerayon-\PLcerclemarge})--(0,{\PLcerclerayon+\PLcerclemarge}) ;
\draw[\PLcerclethick] (0,0) circle[radius=\PLcerclerayon] ;
\draw (0,0) node[below left=2pt,PLval] {0} ;
%equations
@@ -1880,7 +1907,9 @@
PosLabely=\def\axesposlabely{#1},%
EchelleFleche=\def\axesechellefleche{#1},%
TypeFleche=\def\axestypefleche{#1},%
- AffLabel=\def\axesafflabel{#1}
+ AffLabel=\def\axesafflabel{#1},%
+ ElargirOx=\def\axeselargx{#1},%
+ ElargirOy=\def\axeselargy{#1}
}
\setKVdefault[PLaxestkz]{%
@@ -1892,15 +1921,28 @@
PosLabelx=right,%
PosLabely=above,%
EchelleFleche=1,%
- TypeFleche=>
+ TypeFleche=latex,%
+ ElargirOx=0/0.05,%
+ ElargirOy=0/0.05
}
\DeclareDocumentCommand\AxesTikz{ O{} }{%
\useKVdefault[PLaxestkz]
\setKV[PLaxestkz]{#1}%
+ %les petits élargissements
+ \IfSubStr{\axeselargx}{/}
+ {\StrCut{\axeselargx}{/}{\axeselargxG}{\axeselargxD}}
+ {\def\axeselargxG{\axeselargx}\def\axeselargxD{\axeselargx}}
+ \def\axesenlargxG{\fpeval{\axeselargxG*(\xmax-\xmin)}}
+ \def\axesenlargxD{\fpeval{\axeselargxD*(\xmax-\xmin)}}
+ \IfSubStr{\axeselargy}{/}
+ {\StrCut{\axeselargy}{/}{\axeselargyG}{\axeselargyD}}
+ {\def\axeselargyG{\axeselargy}\def\axeselargyD{\axeselargy}}
+ \def\axesenlargyG{\fpeval{\axeselargyG*(\ymax-\ymin)}}
+ \def\axesenlargyD{\fpeval{\axeselargyD*(\ymax-\ymin)}}
%on affiche les deux axes
- \draw[line width=\axeswidth,-{\axestypefleche[scale=\axesechellefleche]}] ({\xmin-\axexOx},0) -- ({\xmax-\axexOx},0) ;
- \draw[line width=\axeswidth,-{\axestypefleche[scale=\axesechellefleche]}] (0,{\ymin-\axeyOy}) -- (0,{\ymax-\axeyOy}) ;
+ \draw[line width=\axeswidth,-{\axestypefleche[scale=\axesechellefleche]}] ({\xmin-\axexOx-\axesenlargxG},0) -- ({\xmax-\axexOx+\axesenlargxD},0) ;
+ \draw[line width=\axeswidth,-{\axestypefleche[scale=\axesechellefleche]}] (0,{\ymin-\axeyOy-\axesenlargyG}) -- (0,{\ymax-\axeyOy++\axesenlargyD}) ;
%les labels éventuels
\IfSubStr{\axesafflabel}{x}%
{\draw ({\xmax-\axexOx},0) node[\axesposlabelx,font=\axesfont] {\axeslabelx} ;}
@@ -2076,14 +2118,16 @@
Grille=true,%
}
-\DeclareDocumentCommand\FenetreSimpleTikz{ O{} D<>{} m D<>{} m }{%
+\DeclareDocumentCommand\FenetreSimpleTikz{ O{} D(){} D<>{} m D<>{} m }{%
\useKVdefault[PLsimplewindow]%
\setKV[PLsimplewindow]{#1}% on paramètres les nouvelles clés et on les simplifie
\ifboolKV[PLsimplewindow]{Grille}%
{\GrilleTikz}%
{}%
\ifboolKV[PLsimplewindow]{Axes}%
- {\AxesTikz\AxexTikz[#2]{#3}\AxeyTikz[#4]{#5}}%
+ {\AxesTikz[#2]%
+ \AxexTikz[#3]{#4}
+ \AxeyTikz[#5]{#6}}%
{}%
}
@@ -2136,7 +2180,7 @@
\def\BaMaxelargeur{\fpeval{\BaMAxeMax-\BaMAxeMin}}
\def\BaMaxexmin{\fpeval{\BaMAxeMin-\BaMAxeElarg*\BaMaxelargeur}}
\def\BaMaxexmax{\fpeval{\BaMAxeMax+\BaMAxeElarg*\BaMaxelargeur}}
- \draw[\BaMAxeEpaisseur,->] (\BaMaxexmin,0) -- (\BaMaxexmax,0) ;
+ \draw[\BaMAxeEpaisseur,->,>=latex] (\BaMaxexmin,0) -- (\BaMaxexmax,0) ;
\ifboolKV[boiteamoustachesaxe]{AffValeurs}
{\foreach \x in \BaMAxeValeurs \draw[\BaMAxeEpaisseur] (\x,3pt)--(\x,-3pt) node[below=3pt] {\num{\x}} ;}
{}
@@ -3033,7 +3077,7 @@
{}
\clip (-4,-0.075) rectangle (4,0.425) ;
\draw[black,semithick,fill=\GRPHPROBcoulsurf] ({\BorneInf},0) -- plot [domain={\BorneInf}:{\BorneSup},samples=100] (\x,{\densnorm{\x}}) -- ({\BorneSup},0) -- cycle;
- \draw[thick,->,>=stealth] (-4,0)--(4,0) ;
+ \draw[thick,->,>=latex] (-4,0)--(4,0) ;
\draw[thick,densely dotted] (0,0)--(0,0.39894) ;
\draw[thick,domain=-4:4,samples=100,\GRPHPROBcoulcbe] plot (\x,{\densnorm{\x}}) ;
\end{tikzpicture}
@@ -3061,8 +3105,8 @@
{\draw (1,-0.075) node[font=\tiny,scale={\UNITEX}] {\MOYENNE} ;
\draw[thick,densely dotted] (1,0)--(1,{0.7*\densexpo{1}}) ;}
{}
- \draw[thick,->,>=stealth] (-0.2,0)--(3.8,0) ;
- \draw[thick,->,>=stealth] (0,-0.15)--(0,0.85) ;
+ \draw[thick,->,>=latex] (-0.2,0)--(3.8,0) ;
+ \draw[thick,->,>=latex] (0,-0.15)--(0,0.85) ;
\draw[thick,domain=0:3.8,samples=100,\GRPHPROBcoulcbe] plot (\x,{0.7*\densexpo{\x}}) ;
\end{tikzpicture}
}
@@ -3480,4 +3524,54 @@
}%
}
+%================MESUREPPALE============= OK!
+\setKVdefault[MesurePpale]{%
+ Crochets=false,
+ d=false
+}
+
+\newcommand{\MesurePrincipale}[2][]{%fraction sous la forme a/b ou entier :-)
+ \useKVdefault[MesurePpale]%
+ \setKV[MesurePpale]{#1}%
+ \StrDel{#2}{pi}[\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
+ \ifboolKV[MesurePpale]{d}%
+ {\displaystyle}%
+ {}%
+ \xintifboolexpr{\MPdenominateurinit == 1}%
+ { \num{\MPnumerateurinit}\pi = }%
+ { \frac{\num{\MPnumerateurinit}\pi}{\num{\MPdenominateurinit}}= }%
+ %on simplifie puis on réduit
+ \xdef\MPsimpl{\xintPRaw{\xintIrr{\MPargument}}}%
+ %test si l'argument est une fraction ou un entier
+ \IfSubStr{\MPsimpl}{/}%
+ { \StrCut{\MPsimpl}{/}\MPnumerateur\MPdenominateur }%
+ { \xdef\MPnumerateur{\MPsimpl}\xdef\MPdenominateur{1} }%
+ %calculs
+ \xdef\MPtour{\inteval{2*\MPdenominateur}}%
+ \xdef\MPreste{\xintiiRem{\MPnumerateur}{\MPtour}}%reste
+ \xintifboolexpr{\MPreste>\MPdenominateur}%
+ {\xdef\MPreste{\inteval{\MPreste-\MPtour}}}{}%
+ \xintifboolexpr{\MPreste<-\MPdenominateur}%
+ {\xdef\MPreste{\inteval{\MPreste+\MPtour}}}{}%
+ %sortie suivant fraction ou non...
+ \xintifboolexpr{\MPdenominateur == 1}%
+ {%entier
+ \xintifboolexpr{\MPreste == 1}{\pi \: \ifboolKV[MesurePpale]{Crochets}{[2\pi]}{(2\pi)} }{}%
+ \xintifboolexpr{\MPreste == 0}{0 \: \ifboolKV[MesurePpale]{Crochets}{[2\pi]}{(2\pi)} }{}%
+ \xintifboolexpr{\MPreste != 0 && \MPreste != 1}{\MPreste\pi \: \ifboolKV[MesurePpale]{Crochets}{[2\pi]}{(2\pi)} }{}%
+ }%
+ {%fraction
+ \frac{%
+ \xintifboolexpr{\xinteval{\MPreste == 1}}{}{}%
+ \xintifboolexpr{\xinteval{\MPreste == -1}}{-}{}%
+ \xintifboolexpr{\xinteval{abs(\MPreste) != 1}}{\num{\MPreste}}{}%
+ \pi}{\num{\MPdenominateur}} \: \ifboolKV[MesurePpale]{Crochets}{[2\pi]}{(2\pi)}%
+ }%
+}
+
\endinput \ No newline at end of file