diff options
author | Karl Berry <karl@freefriends.org> | 2024-01-21 21:16:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-01-21 21:16:22 +0000 |
commit | e5db73e8e63d01df709640fd8951e3670a5c6330 (patch) | |
tree | 64449e7f669c153aa846928381bf969306ed942a | |
parent | b98e79271f68ac996a1299a6886a7d43eabe32ba (diff) |
proflycee (21jan24)
git-svn-id: svn://tug.org/texlive/trunk@69525 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf | bin | 1462653 -> 1461582 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/proflycee/ProfLycee-docctan.zip | bin | 244612 -> 244459 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/proflycee/ProfLycee-exemples-pyluatex.pdf | bin | 59733 -> 59463 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/proflycee/ProfLycee-exemples-pyluatex.tex | 22 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty | 5 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/proflycee/proflycee-tools-analyse.tex | 48 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/proflycee/proflycee-tools-graphiques.tex | 12 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/proflycee/proflycee-tools-listings.tex | 287 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex | 164 |
10 files changed, 368 insertions, 174 deletions
diff --git a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf Binary files differindex 6caa3e153f7..e71db25c570 100644 --- a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf +++ b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.pdf diff --git a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.tex b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.tex index e4f56f6dac9..1fd55dfcec1 100644 --- a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.tex +++ b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-doc.tex @@ -5,8 +5,8 @@ % arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') \documentclass[a4paper,french,11pt]{article} -\def\PLversion{3.01e} -\def\PLdate{11 janvier 2024} +\def\PLversion{3.01f} +\def\PLdate{21 janvier 2024} \usepackage{amsfonts} \usepackage{ProfLycee} \useproflyclib{piton,minted,pythontex,ecritures} diff --git a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-docctan.zip b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-docctan.zip Binary files differindex 4900ecb17f5..0e65e150725 100644 --- a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-docctan.zip +++ b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-docctan.zip diff --git a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-exemples-pyluatex.pdf b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-exemples-pyluatex.pdf Binary files differindex ed46efca6a2..e22fb1e4fa0 100644 --- a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-exemples-pyluatex.pdf +++ b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-exemples-pyluatex.pdf diff --git a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-exemples-pyluatex.tex b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-exemples-pyluatex.tex index af24abb9a6b..e1382113175 100644 --- a/Master/texmf-dist/doc/latex/proflycee/ProfLycee-exemples-pyluatex.tex +++ b/Master/texmf-dist/doc/latex/proflycee/ProfLycee-exemples-pyluatex.tex @@ -2,7 +2,7 @@ % !TeX TXS-program:compile = txs:///lualatex/[--shell-escape] \documentclass[french,a4paper,10pt]{article} -\def\PLver{3.01e} +\def\PLver{3.01f} \usepackage[margin=1.5cm]{geometry} \usepackage{ProfLycee} \useproflyclib{piton} @@ -53,8 +53,8 @@ def valeur_absolue(x): \end{CodePiton} {\small \begin{codehigh} -%Sortie avec Style=Classique, Largeur=10cm -\begin{CodePiton}[Style=Classique,Largeur=10cm]{} +%Sortie avec style Classique, Largeur=10cm +\begin{CodePiton}[Largeur=10cm]{} def valeur_absolue(x): "Renvoie la valeur absolue de x" #le petit test qui va bien @@ -65,7 +65,7 @@ def valeur_absolue(x): \end{CodePiton} \end{codehigh}} -\begin{CodePiton}[Style=Classique,Largeur=10cm]{} +\begin{CodePiton}[Largeur=10cm]{} def valeur_absolue(x): "Renvoie la valeur absolue de x" #le petit test qui va bien @@ -78,8 +78,8 @@ def valeur_absolue(x): \pagebreak {\small \begin{codehigh} -%Sortie avec Style=Classique, Sans Titre, Largeur=10cm, centré -\begin{CodePiton}[Style=Classique,Largeur=10cm,BarreTitre=false,Alignement=center]{} +%Sortie avec Style=Moderne, Sans Titre, Largeur=10cm, centré +\begin{CodePiton}[Style=Moderne,Largeur=10cm,BarreTitre=false,Alignement=center]{} def valeur_absolue(x): "Renvoie la valeur absolue de x" #le petit test qui va bien @@ -90,7 +90,7 @@ def valeur_absolue(x): \end{CodePiton} \end{codehigh}} -\begin{CodePiton}[Style=Classique,Largeur=10cm,BarreTitre=false,Alignement=center]{} +\begin{CodePiton}[Style=Moderne,Largeur=10cm,BarreTitre=false,Alignement=center]{} def valeur_absolue(x): "Renvoie la valeur absolue de x" #le petit test qui va bien @@ -103,7 +103,7 @@ def valeur_absolue(x): {\small \begin{codehigh} %Sortie avec Style=Classique, Largeur=0.5\linewidth, aligné à droite, sans Cadre, avec Filigrane \begin{CodePiton}% - [Style=Classique,Largeur=0.5\linewidth,Cadre=false,Alignement=flush right,Filigrane,Titre={Script}]{} + [Largeur=0.5\linewidth,Cadre=false,Alignement=flush right,Filigrane,Titre={Script}]{} #environnement piton avec numéros de ligne, pleine largeur, style moderne def valeur_absolue(x): "Renvoie la valeur absolue de x" @@ -115,7 +115,7 @@ def valeur_absolue(x): \end{CodePiton} \end{codehigh}} -\begin{CodePiton}[Style=Classique,Largeur=0.5\linewidth,Cadre=false,Alignement=flush right,Filigrane,Titre={Script}]{} +\begin{CodePiton}[Largeur=0.5\linewidth,Cadre=false,Alignement=flush right,Filigrane,Titre={Script}]{} def valeur_absolue(x): "Renvoie la valeur absolue de x" #le petit test qui va bien @@ -127,7 +127,7 @@ def valeur_absolue(x): {\small \begin{codehigh} %Sortie Moderne, Largeur=11cm, avec Filigrane, aligné à gauche, sans ligne -\begin{CodePiton}[Largeur=11cm,Filigrane,Alignement=flush left,Lignes=false]{} +\begin{CodePiton}[Style=Moderne,Largeur=11cm,Filigrane,Alignement=flush left,Lignes=false]{} def valeur_absolue(x): "Renvoie la valeur absolue de x" #le petit test qui va bien @@ -138,7 +138,7 @@ def valeur_absolue(x): \end{CodePiton} \end{codehigh}} -\begin{CodePiton}[Largeur=11cm,Filigrane,Alignement=flush left,Lignes=false]{} +\begin{CodePiton}[Style=Moderne,Largeur=11cm,Filigrane,Alignement=flush left,Lignes=false]{} def valeur_absolue(x): "Renvoie la valeur absolue de x" #le petit test qui va bien diff --git a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty index 1d2df533218..3aea0ee3328 100644 --- a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty +++ b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty @@ -3,8 +3,9 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2024/01/11 3.01e Aide pour l'utilisation de LaTeX en lycee] -% 3.01e Mise en conformité avec pyluatex/piton +\ProvidesPackage{ProfLycee}[2024/01/21 3.01f Aide pour l'utilisation de LaTeX en lycee] +% 3.01f PseudoCode avec piton (avec langage=minimal de FP ^^) + Suppression Terminal (doublon avec sim-os-menus) +% 3.01e Mise ne conformité avec pyluatex/piton % 3.01d Ajout des commentaires en gris italique (via #) pour le pseudocode % 3.01c Ajout des splines en mode génération (sans forcément tracer) % 3.01b Ajout de la division euclidienne + correction du bugs mineurs diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-analyse.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-analyse.tex index 90672aaf1d5..d0bd049bd44 100644 --- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-analyse.tex +++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-analyse.tex @@ -114,6 +114,22 @@ \filldraw[#2] (0,0) circle[radius=2pt] ; } +\NewDocumentCommand\schematdsexpo{ s m m m }{%pour les expos (interne) + % * = étoilée -> a négatif + % #2 = couleur + % #3 = largeur + % #4 = hauteur + \IfBooleanTF{#1}%si étoile := expo 'décroissante' + {% + \draw[thick,#2] ({-0.45*#3},{0.5*#4}) to[out=-75,in=179] ({0.5*#3},{-0.325*#4}); + } + {%sinon := expo 'croissante' + \draw[thick,#2] ({-0.5*#3},{-0.325*#4}) to[out=1,in=-105] ({0.5*#3},{0.5*#4}); + } + \draw[#2] ({0},{0}) node[inner sep=0pt,above=0pt,font=\scriptsize] {\textcircled{$+$}}; + +} + \NewDocumentCommand\schematdsparab{ m m m m m o }{%pour les paraboles (interne) % #1 = signe de a (1 ou -1) ? % #2 = couleur @@ -179,17 +195,19 @@ \useKVdefault[aidetds] \setKV[aidetds]{#2} %simplification des codes - \IfEq{\tdsparam}{da+}{\def\xcode{1}}{} - \IfEq{\tdsparam}{da-}{\def\xcode{-1}}{} - \IfEq{\tdsparam}{pa+d+}{\def\xcode{12}}{} - \IfEq{\tdsparam}{pa-d+}{\def\xcode{-12}}{} - \IfEq{\tdsparam}{pa+d0}{\def\xcode{11}}{} - \IfEq{\tdsparam}{pa-d0}{\def\xcode{-11}}{} - \IfEq{\tdsparam}{pa+d-}{\def\xcode{10}}{} - \IfEq{\tdsparam}{pa-d-}{\def\xcode{-10}}{} + \IfEq{\tdsparam}{da+}{\def\xcode{1}\def\xcodehautaxe{0}}{} + \IfEq{\tdsparam}{da-}{\def\xcode{-1}\def\xcodehautaxe{0}}{} + \IfEq{\tdsparam}{pa+d+}{\def\xcode{12}\def\xcodehautaxe{0}}{} + \IfEq{\tdsparam}{pa-d+}{\def\xcode{-12}\def\xcodehautaxe{0}}{} + \IfEq{\tdsparam}{pa+d0}{\def\xcode{11}\def\xcodehautaxe{0}}{} + \IfEq{\tdsparam}{pa-d0}{\def\xcode{-11}\def\xcodehautaxe{0}}{} + \IfEq{\tdsparam}{pa+d-}{\def\xcode{10}\def\xcodehautaxe{0}}{} + \IfEq{\tdsparam}{pa-d-}{\def\xcode{-10}\def\xcodehautaxe{0}}{} + \IfEq{\tdsparam}{expo+}{\def\xcode{20}\def\xcodehautaxe{-0.35}}{} + \IfEq{\tdsparam}{expo-}{\def\xcode{-20}\def\xcodehautaxe{-0.35}}{} %si commande étoilée := commande autonome \IfBooleanTF{#1}% - {\begin{tikzpicture}[#3]}{}% + {\begin{tikzpicture}[#3,>=latex]}{}% %cadre si booléen true \ifboolKV[aidetds]{Cadre} {\draw[lightgray] ({-0.5*\tdslarg},{-0.5*\tdshaut}) rectangle ({0.55*\tdslarg},{0.5*\tdshaut}) ;} @@ -197,7 +215,7 @@ %restriction de la petite fenêtre \clip ({-0.5*\tdslarg},{-0.5*\tdshaut}) rectangle ({0.55*\tdslarg},{0.5*\tdshaut}) ; %axe (Ox) - \draw[thick,->] ({-0.5*\tdslarg},0)--({0.55*\tdslarg},0); + \draw[semithick,->,>=latex] ({-0.5*\tdslarg},{\xcodehautaxe*(\tdshaut)})--({0.55*\tdslarg},{\xcodehautaxe*(\tdshaut)}); %1er degré a+ code = 1 \ifnum\xcode=1 \schematdsaff{\tdscouleur}{\tdslarg}{\tdshaut}{\tdsracine} @@ -230,6 +248,14 @@ \ifnum\xcode=-10 \schematdsparab{-1}{\tdscouleur}{\tdslarg}{\tdshaut}{0} \fi + %expo croissante code = 20 + \ifnum\xcode=20 + \schematdsexpo{\tdscouleur}{\tdslarg}{\tdshaut} + \fi + %expo décroissante code = -20 + \ifnum\xcode=-20 + \schematdsexpo*{\tdscouleur}{\tdslarg}{\tdshaut} + \fi \IfBooleanTF{#1}% {\end{tikzpicture}}{}% } @@ -691,7 +717,7 @@ &\Rightarrow\FracPerVar = \ifboolKV[FracPeriod]{d}{\displaystyle}{}\frac{\num{\tmp@num@brut}}{\num{\tmp@denom@brut}} \end{align*} %affichage(s) OK - \noindent Ainsi on a \ensuremath{\tmp@enonce = \ifboolKV[FracPeriod]{d}{\displaystyle}{}\frac{\num{\tmp@num@brut}}{\num{\tmp@denom@brut}} \xintifboolexpr{\tmp@pgcd == 1}{}{=\ifboolKV[FracPeriod]{d}{\displaystyle}{}\frac{\num{\xintieval{\tmp@num@brut/\tmp@pgcd}}}{\num{\xintieval{\tmp@denom@brut/\tmp@pgcd}}}}% + \noindent Ainsi on a \ensuremath{\tmp@enonce = \ifboolKV[FracPeriod]{d}{\displaystyle}{}\frac{\num{\tmp@num@brut}}{\num{\tmp@denom@brut}} \xintifboolexpr{\tmp@pgcd == 1}{}{=\ifboolKV[FracPeriod]{d}{\displaystyle}{}\frac{\num{\xintieval{\tmp@num@brut/\tmp@pgcd}}}{\num{\xintieval{\tmp@denom@brut/\tmp@pgcd}}}} \xintifboolexpr{\tmp@denom@brut/\tmp@pgcd == 1}{=\num{\xintieval{\tmp@num@brut/\tmp@pgcd}}}{}% }.\par% }% {}% diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-graphiques.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-graphiques.tex index c7208604bfb..747e425b582 100644 --- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-graphiques.tex +++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-graphiques.tex @@ -618,6 +618,18 @@ } +%courbe via xint +\NewDocumentCommand\CourbeTikzXint{ O{} m m }{% + %1 = options tikz du \draw + %2 = formule xint + %3 = début...[pas]...fin + \draw[#1] plot[smooth] coordinates {% + \xintthecoords\xintfloatexpr + seq((x,#2),x=#3) + \relax + }; +} + %courbe ? \newcommand\CourbeTikz[3][]{% \setsepchar{:}% diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-listings.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-listings.tex index b4bf196a479..20cfa254a5f 100644 --- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-listings.tex +++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-listings.tex @@ -2,6 +2,7 @@ % Copyright 2023 Cédric Pierquet % Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt +%3.01f Suppression Terminal (doublon avec sim-os-menus) %3.01d Ajout des commentaires en PseudoCode (via #) %3.00g Amélioration marge gauche PseudoCode %2.7.5 Ajout de clés pour PythonLst + Couleurs optionnelles pour PseudoCode @@ -597,148 +598,148 @@ #2 } -%%------FakeTerm -%couleurs (inspirées par termsim !) -\definecolor{PLmpurple}{RGB}{48,10,36} -\definecolor{PLmgray}{RGB}{70,72,67} -\definecolor{PLogray}{RGB}{148,147,141} -\definecolor{PLoorange}{RGB}{233,101,56} -\definecolor{PLterminal}{RGB}{80,78,70} -\definecolor{PLlinux}{RGB}{0,39,51} -\definecolor{PLwinblue}{HTML}{1883D7} -\definecolor{PLosxgray}{HTML}{D8D6D9} - -%WINDOWS -\tcbset{PLfaketermwin/.style={% - enhanced,boxrule=1pt,sharp corners,before skip=12pt,after skip=12pt,% - colframe=PLwinblue,colback=black,colbacktitle=white,colupper=white,coltitle=black,% - titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=2pt,% - fonttitle=\bfseries\small\sffamily - } -} - -\setKVdefault[fakeTERMwin]{Titre={Terminal Windows}} - -\newcommand\PLcommandeswin{% - \begin{tikzpicture}[thick,scale=0.66] - \draw (0,0)--(1em,0) ; \draw (2em,0) rectangle (3em,1em) ; \draw (4em,1em)--(5em,0) (4em,0)--(5em,1em) ; - \end{tikzpicture}% -} - -\newcommand\termwintitre[1][]{% - \restoreKV[fakeTERMwin] - \setKV[fakeTERMwin]{#1} - \begin{tblr}{colsep=0pt,rowsep=0pt,width=\linewidth,colspec={X[l]r}} - {\footnotesize\faTerminal}~~\useKV[fakeTERMwin]{Titre} & \PLcommandeswin \\ % - \end{tblr} -} - -\DeclareTCBListing{TerminalWin}{ O{\linewidth} m !O{} }{%<taille> puis {Titre=...} puis [option] - PLfaketermwin,title={\termwintitre[#2]},% - listing only,listing engine=listings,% - listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},% - width=#1,#3 -} - -%LINUX -\newcommand{\PLUbuntuWhite}{% - \begin{tikzpicture}[thick,anchor=base,baseline] - \filldraw[PLmgray] (0,0.25em) circle[radius=0.5em] ; - \end{tikzpicture}% -} -\newcommand{\PLUbuntuMin}{% - \begin{tikzpicture}[thick,anchor=base,baseline] - \filldraw[color=PLogray!50!white] (0,0.25em) circle[radius=0.5em]; - \draw[PLterminal](-0.35em,0.25em)--(0.35em,0.25em); - \end{tikzpicture}% -} -\newcommand{\PLUbuntuClose}{% - \begin{tikzpicture}[thick,anchor=base,baseline] - \filldraw[color=PLoorange!70!white] (0,0.25em) circle[radius=0.5em]; - \draw[PLterminal] (-0.32em,-0.07em)--(0.32em,0.57em); - \draw[PLterminal] (-0.32em,0.57em)--(0.32em,-0.07em); - \end{tikzpicture}% -} -\newcommand{\PLUbuntuMax}{% - \begin{tikzpicture}[thick,anchor=base,baseline] - \filldraw[color=PLogray!50!white] (0,0.25em) circle[radius=0.5em]; - \draw[PLterminal] (-0.32em,0.5em) rectangle (0.32em,0); - \end{tikzpicture}% -} - -\tcbset{PLtermlinux/.style={% - enhanced,boxrule=1pt,arc=4pt,before skip=12pt,after skip=12pt,% - colframe=PLmgray,colback=PLmpurple,colbacktitle=PLmgray,colupper=white,coltitle=white,% - titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=2pt,% - fonttitle=\bfseries\small\sffamily - } -} - -\setKVdefault[fakeTERMnux]{Titre={Terminal UNiX}} - -\newcommand\termnuxtitre[1][]{% - \restoreKV[fakeTERMnux] - \setKV[fakeTERMnux]{#1} - \begin{tblr}{colsep=0pt,rowsep=0pt,width=\linewidth,colspec={lX[c]r}} - \PLUbuntuWhite~~\PLUbuntuWhite~~\PLUbuntuWhite & \vphantom{p}\useKV[fakeTERMnux]{Titre} & \PLUbuntuMin~~\PLUbuntuMax~~\PLUbuntuClose \\ - \end{tblr} -} - -\DeclareTCBListing{TerminalUnix}{ O{\linewidth} m !O{} }{%<taille> puis {Titre=...} puis [option] - PLtermlinux,title={\termnuxtitre[#2]},% - listing only,listing engine=listings,% - listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},% - width=#1,#3 -} - -%OSX -\tcbset{PLfaketermosx/.style={% - enhanced,boxrule=1pt,arc=6pt,before skip=12pt,after skip=12pt,% - colframe=PLosxgray,colback=lightgray!15,colbacktitle=PLosxgray,colupper=black,coltitle=black,% - titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=2pt,% - fonttitle=\bfseries\small\sffamily - } -} - -\newcommand{\PLOSXRed}{% - \begin{tikzpicture}[thick,anchor=base,baseline] - \filldraw[red] (0,0.25em) circle[radius=0.45em] ; - \end{tikzpicture}% -} - -\newcommand{\PLOSXOrange}{% - \begin{tikzpicture}[thick,anchor=base,baseline] - \filldraw[orange] (0,0.25em) circle[radius=0.45em] ; - \end{tikzpicture}% -} - -\newcommand{\PLOSXgreen}{% - \begin{tikzpicture}[thick,anchor=base,baseline] - \filldraw[CouleurVertForet] (0,0.25em) circle[radius=0.45em] ; - \end{tikzpicture}% -} - -\newcommand{\PLOSXLG}{% - \begin{tikzpicture}[thick,anchor=base,baseline] - \filldraw[PLosxgray] (0,0.25em) circle[radius=0.45em] ; - \end{tikzpicture}% -} - -\setKVdefault[fakeTERMosx]{titre={Terminal OSX}} - -\newcommand\termosxtitre[1][]{% - \restoreKV[fakeTERMosx] - \setKV[fakeTERMosx]{#1} - \begin{tblr}{colsep=0pt,rowsep=0pt,width=\linewidth,colspec={lX[c]r}} - \PLOSXRed~\PLOSXOrange~\PLOSXgreen & \vphantom{p}\useKV[fakeTERMosx]{Titre} & \PLOSXLG~\PLOSXLG~\PLOSXLG \\ - \end{tblr} -} - -\DeclareTCBListing{TerminalOSX}{ O{\linewidth} m !O{} }{%<taille> puis {Titre=...} puis [option] - PLfaketermosx,title={\termosxtitre[#2]},% - listing only,listing engine=listings,% - listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},% - width=#1,#3 -} +%%%------FakeTerm +%%couleurs (inspirées par termsim !) +%\definecolor{PLmpurple}{RGB}{48,10,36} +%\definecolor{PLmgray}{RGB}{70,72,67} +%\definecolor{PLogray}{RGB}{148,147,141} +%\definecolor{PLoorange}{RGB}{233,101,56} +%\definecolor{PLterminal}{RGB}{80,78,70} +%\definecolor{PLlinux}{RGB}{0,39,51} +%\definecolor{PLwinblue}{HTML}{1883D7} +%\definecolor{PLosxgray}{HTML}{D8D6D9} +% +%%WINDOWS +%\tcbset{PLfaketermwin/.style={% +% enhanced,boxrule=1pt,sharp corners,before skip=12pt,after skip=12pt,% +% colframe=PLwinblue,colback=black,colbacktitle=white,colupper=white,coltitle=black,% +% titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=2pt,% +% fonttitle=\bfseries\small\sffamily +% } +%} +% +%\setKVdefault[fakeTERMwin]{Titre={Terminal Windows}} +% +%\newcommand\PLcommandeswin{% +% \begin{tikzpicture}[thick,scale=0.66] +% \draw (0,0)--(1em,0) ; \draw (2em,0) rectangle (3em,1em) ; \draw (4em,1em)--(5em,0) (4em,0)--(5em,1em) ; +% \end{tikzpicture}% +%} +% +%\newcommand\termwintitre[1][]{% +% \restoreKV[fakeTERMwin] +% \setKV[fakeTERMwin]{#1} +% \begin{tblr}{colsep=0pt,rowsep=0pt,width=\linewidth,colspec={X[l]r}} +% {\footnotesize\faTerminal}~~\useKV[fakeTERMwin]{Titre} & \PLcommandeswin \\ % +% \end{tblr} +%} +% +%\DeclareTCBListing{TerminalWin}{ O{\linewidth} m !O{} }{%<taille> puis {Titre=...} puis [option] +% PLfaketermwin,title={\termwintitre[#2]},% +% listing only,listing engine=listings,% +% listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},% +% width=#1,#3 +%} +% +%%LINUX +%\newcommand{\PLUbuntuWhite}{% +% \begin{tikzpicture}[thick,anchor=base,baseline] +% \filldraw[PLmgray] (0,0.25em) circle[radius=0.5em] ; +% \end{tikzpicture}% +%} +%\newcommand{\PLUbuntuMin}{% +% \begin{tikzpicture}[thick,anchor=base,baseline] +% \filldraw[color=PLogray!50!white] (0,0.25em) circle[radius=0.5em]; +% \draw[PLterminal](-0.35em,0.25em)--(0.35em,0.25em); +% \end{tikzpicture}% +%} +%\newcommand{\PLUbuntuClose}{% +% \begin{tikzpicture}[thick,anchor=base,baseline] +% \filldraw[color=PLoorange!70!white] (0,0.25em) circle[radius=0.5em]; +% \draw[PLterminal] (-0.32em,-0.07em)--(0.32em,0.57em); +% \draw[PLterminal] (-0.32em,0.57em)--(0.32em,-0.07em); +% \end{tikzpicture}% +%} +%\newcommand{\PLUbuntuMax}{% +% \begin{tikzpicture}[thick,anchor=base,baseline] +% \filldraw[color=PLogray!50!white] (0,0.25em) circle[radius=0.5em]; +% \draw[PLterminal] (-0.32em,0.5em) rectangle (0.32em,0); +% \end{tikzpicture}% +%} +% +%\tcbset{PLtermlinux/.style={% +% enhanced,boxrule=1pt,arc=4pt,before skip=12pt,after skip=12pt,% +% colframe=PLmgray,colback=PLmpurple,colbacktitle=PLmgray,colupper=white,coltitle=white,% +% titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=2pt,% +% fonttitle=\bfseries\small\sffamily +% } +%} +% +%\setKVdefault[fakeTERMnux]{Titre={Terminal UNiX}} +% +%\newcommand\termnuxtitre[1][]{% +% \restoreKV[fakeTERMnux] +% \setKV[fakeTERMnux]{#1} +% \begin{tblr}{colsep=0pt,rowsep=0pt,width=\linewidth,colspec={lX[c]r}} +% \PLUbuntuWhite~~\PLUbuntuWhite~~\PLUbuntuWhite & \vphantom{p}\useKV[fakeTERMnux]{Titre} & \PLUbuntuMin~~\PLUbuntuMax~~\PLUbuntuClose \\ +% \end{tblr} +%} +% +%\DeclareTCBListing{TerminalUnix}{ O{\linewidth} m !O{} }{%<taille> puis {Titre=...} puis [option] +% PLtermlinux,title={\termnuxtitre[#2]},% +% listing only,listing engine=listings,% +% listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},% +% width=#1,#3 +%} +% +%%OSX +%\tcbset{PLfaketermosx/.style={% +% enhanced,boxrule=1pt,arc=6pt,before skip=12pt,after skip=12pt,% +% colframe=PLosxgray,colback=lightgray!15,colbacktitle=PLosxgray,colupper=black,coltitle=black,% +% titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=2pt,% +% fonttitle=\bfseries\small\sffamily +% } +%} +% +%\newcommand{\PLOSXRed}{% +% \begin{tikzpicture}[thick,anchor=base,baseline] +% \filldraw[red] (0,0.25em) circle[radius=0.45em] ; +% \end{tikzpicture}% +%} +% +%\newcommand{\PLOSXOrange}{% +% \begin{tikzpicture}[thick,anchor=base,baseline] +% \filldraw[orange] (0,0.25em) circle[radius=0.45em] ; +% \end{tikzpicture}% +%} +% +%\newcommand{\PLOSXgreen}{% +% \begin{tikzpicture}[thick,anchor=base,baseline] +% \filldraw[CouleurVertForet] (0,0.25em) circle[radius=0.45em] ; +% \end{tikzpicture}% +%} +% +%\newcommand{\PLOSXLG}{% +% \begin{tikzpicture}[thick,anchor=base,baseline] +% \filldraw[PLosxgray] (0,0.25em) circle[radius=0.45em] ; +% \end{tikzpicture}% +%} +% +%\setKVdefault[fakeTERMosx]{titre={Terminal OSX}} +% +%\newcommand\termosxtitre[1][]{% +% \restoreKV[fakeTERMosx] +% \setKV[fakeTERMosx]{#1} +% \begin{tblr}{colsep=0pt,rowsep=0pt,width=\linewidth,colspec={lX[c]r}} +% \PLOSXRed~\PLOSXOrange~\PLOSXgreen & \vphantom{p}\useKV[fakeTERMosx]{Titre} & \PLOSXLG~\PLOSXLG~\PLOSXLG \\ +% \end{tblr} +%} +% +%\DeclareTCBListing{TerminalOSX}{ O{\linewidth} m !O{} }{%<taille> puis {Titre=...} puis [option] +% PLfaketermosx,title={\termosxtitre[#2]},% +% listing only,listing engine=listings,% +% listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},% +% width=#1,#3 +%} \endinput
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex index e9fd389d6de..b4690b19201 100644 --- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex +++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex @@ -2,6 +2,7 @@ % Copyright 2023 Cédric Pierquet % Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt +%3.01f PseudoCode via piton (?) %3.01e Correction du comportement de la console repl piton/pyluatex %2.7.6 Correction du comportement de la console, avec une meilleure gestion de la largeur ^^ (merci à ablasz ;-)) %2.7.5 Ajout d'un argument optionnel pour commencer les codes python à un numéro de ligne différent de 1 @@ -33,10 +34,10 @@ Gobble=true,% TaillePolice=\footnotesize,% Filigrane=false,% - Style=Moderne,% + Style=Classique,% Cadre=true,% BarreTitre=true,% - Titre={{\scriptsize\faCode} Code Python},% + Titre={{\scriptsize\faCode}~~Code Python},% EspacementV=0.5\baselineskip,% CouleurNombres=orange } @@ -79,23 +80,90 @@ } } +%-- +\defKV[envpcpiton]{% + Largeur=\def\CODPITPClargeur{#1},% + Alignement=\def\CODPITPCalign{#1},% + TaillePolice=\def\CODPITPCfonte{#1},% + Style=\def\CODPITPCstyle{#1},% + Titre=\def\CODPITPCtitre{#1},% + EspacementV=\def\CODPITPCespV{#1} +} + +\setKVdefault[envpcpiton]{% + Largeur=\linewidth,% + Alignement=center,% + Lignes=true,% + Gobble=true,% + TaillePolice=\footnotesize,% + Filigrane=false,% + Style=Classique,% + Cadre=true,% + BarreTitre=true,% + Titre={{\scriptsize\faFileCode}~~PseudoCode},% + EspacementV=0.5\baselineskip,% + Couleurs=true +} + +%==Style Moderne +\tcbset{stylepcpiton/.style={% + enhanced,boxrule=1.25pt,% + sharp corners=downhill,arc=12pt, + before skip=\CODPITPCespV,after skip=\CODPITPCespV,% + top=\baselineskip,bottom=0mm,left=0.6em,right=5mm,% + attach boxed title to top right={yshift=-\tcboxedtitleheight}, + boxed title style={ + size=small,colback=CouleurVertForet!25,boxrule=1.25pt, + colframe=CouleurVertForet,boxsep=1.25pt, + sharp corners=downhill, + arc=12pt, + top=2pt,bottom=1pt,left=6pt,right=6pt + }, + fonttitle=\color{CouleurVertForet}~~PseudoCode + } +} + +%==Style Classique +\tcbset{thonnypcstyle/.style={% + enhanced,boxrule=0.75pt,colframe=darkgray!50!black,% + sharp corners,top=0mm,bottom=0mm,left=0.4em,right=5mm,% + before skip=\CODPITPCespV,after skip=\CODPITPCespV,% + colback=white + } +} + +\tcbset{thonnypcstylelineos/.style={% + thonnypcstyle,% + underlay={% + \begin{tcbclipinterior} + \draw[draw=none,fill=lightgray!25] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ; + \end{tcbclipinterior}% + } + } +} + %==Création de la boîte (essai v2 ?) \ifluatex \RequirePackage{piton} + +\NewDocumentCommand\PrVal{}{\textleftarrow} + +\PitonOptions{begin-escape={(*},end-escape={*)}} + \NewPitonEnvironment{CodePiton}{ O{} m D<>{} }% {% \tcbset{reset} \useKVdefault[envpiton]% \setKV[envpiton]{#1}% on paramètres les nouvelles clés et on les simplifie %------les styles piton - \SetPitonStyle{ Number = \color{\CODPITcolnb} }% + \SetPitonStyle{ Number = \color{\CODPITcolnb} } \ifboolKV[envpiton]{Lignes}%si lignes=true {\PitonOptions{left-margin=0.75em,all-line-numbers,line-numbers={#3}}}%left-margin=auto, {}% \ifboolKV[envpiton]{Gobble}%si gobble=true {\PitonOptions{tabs-auto-gobble}}% {}% - \PitonOptions{break-lines,indent-broken-lines}%,numbers-sep=0.65em} + \PitonOptions{break-lines,indent-broken-lines}%,numbers-sep=0.65em}%language=Python} %------les styles tcbox \IfEq{\CODPITstyle}{Moderne}%style Moderne (défaut) {% @@ -137,8 +205,92 @@ {% \endtcolorbox% } -\fi +%piton >= 2.4 +\NewPitonEnvironment{PseudoCodePiton}{ O{} m D<>{} }% +{% + \tcbset{reset} + \useKVdefault[envpcpiton]% + \setKV[envpcpiton]{#1}% on paramètres les nouvelles clés et on les simplifie + %------les styles piton + \PitonOptions{break-lines,indent-broken-lines,language=minimal}%,numbers-sep=0.65em}% + \SetPitonStyle{ Number = } + \ifboolKV[envpcpiton]{Couleurs}% + {% + \SetPitonIdentifier[minimal]{Algorithme,Fonction,Début,Paramètre,Paramètres,Faire,Fin,Si,Pour,Tant,Que,que,alors,Alors,Sinon,SinonSi,FinSi,FinPour,FinTantQue,TantQue,Variable,Variables,Procédure}{\color{MotsClesPseudoCodeA}} + \SetPitonIdentifier[minimal]{Afficher,Renvoyer,Saisir}{\color{MotsClesPseudoCodeB}} + % \PitonOptions{ + % identifiers = + % { + % names = {Algorithme,Fonction,Début,Paramètre,Paramètres,allant,Faire,Fin,Si,Pour,Tant,Que,que,alors,Alors,Sinon,SinonSi,FinSi,FinPour,FinTantQue,TantQue,Variable,Variables,Procédure}, + % style = \color{MotsClesPseudoCodeA} + % } , + % identifiers = + % { + % names = {Afficher,Retourner,Saisir}, + % style = \color{MotsClesPseudoCodeB} + % } + % }% + \SetPitonStyle + { + String = \color{MotsClesPseudoCodeChaine}, + Comment = \itshape\color{gray}, + } + }% + {% + \SetPitonStyle + { + String = , + Comment = \itshape + } + }% + \ifboolKV[envpcpiton]{Lignes}%si lignes=true + {\PitonOptions{left-margin=0.75em,all-line-numbers,line-numbers={#3}}}%left-margin=auto, + {}% + \ifboolKV[envpcpiton]{Gobble}%si gobble=true + {\PitonOptions{tabs-auto-gobble}}% + {}% + %------les styles tcbox + \IfEq{\CODPITPCstyle}{Moderne}%style Moderne (défaut) + {% + \tcbset{cadre/.style={}} + \tcbset{titre/.style={}} + \tcbset{stylebase/.style={stylepcpiton,colframe=CouleurVertForet,colback=CouleurVertForet!5,width=\CODPITPClargeur,fontupper=\CODPITPCfonte,fontlower=\CODPITPCfonte,\CODPITPCalign,leftupper=0.75em}} + \ifboolKV[envpcpiton]{Filigrane}%si filigrane + {\tcbset{filigrane/.style={watermark text={\faCode},watermark opacity=0.175,watermark zoom=0.50}}}% + {\tcbset{filigrane/.style={}}}% + } + {}% + \IfEq{\CODPITPCstyle}{Classique}%style Classique + {% + \ifboolKV[envpcpiton]{Lignes}%si lignes=true + {\tcbset{stylebase/.style={thonnypcstylelineos,leftupper=0.75em,width=\CODPITPClargeur,colframe=darkgray!50!black,fontupper=\CODPITPCfonte,fontlower=\CODPITPCfonte,\CODPITPCalign}}}% + {\tcbset{stylebase/.style={thonnypcstyle,leftupper=0.4em,width=\CODPITPClargeur,colframe=darkgray!50!black,fontupper=\CODPITPCfonte,fontlower=\CODPITPCfonte,\CODPITPCalign}}}% + %\tcbset{width=\CODPITlargeur,colframe=darkgray!50!black,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign} + \ifboolKV[envpcpiton]{Filigrane}%si filigrane + {\tcbset{filigrane/.style={watermark text={\faCode},watermark opacity=0.25,watermark zoom=0.50}}}% + {\tcbset{filigrane/.style={}}}% + \ifboolKV[envpcpiton]{BarreTitre}% + {% + \ifboolKV[envpcpiton]{Cadre} + {\tcbset{cadre/.style={}}}% + {\tcbset{cadre/.style={boxrule=0pt,frame hidden}}}% + \tcbset{titre/.style={lefttitle=0.4em,title={\CODPITPCtitre},fonttitle=\bfseries\footnotesize\sffamily,colbacktitle=darkgray!50!black}} + }% + {% + \tcbset{titre/.style={notitle}} + \ifboolKV[envpcpiton]{Cadre} + {\tcbset{cadre/.style={}}} + {\tcbset{cadre/.style={boxrule=0pt,frame hidden}}} + } + } + {}% + %on crée la boîte + \tcolorbox[stylebase,filigrane,cadre,titre,#2] +}% +{% + \endtcolorbox% +} %======CONSOLE PYLUATEX (package à charger manuellement !!) \tcbset{consolepylua/.style={%base de la boîte @@ -206,4 +358,6 @@ \end{tcolorbox} } +\fi + \endinput
\ No newline at end of file |