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.sty208
1 files changed, 6 insertions, 202 deletions
diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty
index b91ab7816d..f553031e8c 100644
--- a/macros/latex/contrib/proflycee/tex/ProfLycee.sty
+++ b/macros/latex/contrib/proflycee/tex/ProfLycee.sty
@@ -3,8 +3,10 @@
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfLycee}[2023/04/04 2.5.7 Aide pour l'utilisation de LaTeX en lycee]
-% 2.5.7 Ajout d'un style classique pour le code python (Piton + ...) + console piton/pyluatex
+\ProvidesPackage{ProfLycee}[2023/04/06 2.5.8 Aide pour l'utilisation de LaTeX en lycee]
+% 2.5.8 Ajout du style Classique pour PythonLst (externalisation listings) + Modification marges CodePiton (1.5)
+% Refonte des commandes pour les codes pour éviter des soucis avec les étoilées
+% 2.5.7 Ajout d'un style classique pour le code python (Piton) + console piton/pyluatex
% Refonte des commandes tcbset pour les codes
% 2.5.6 Ajout d'une clé [Trigo] pour \AxexTikz (avec graduations libres)
% "Suppression" de la fenêtre XCas de la documentation
@@ -114,22 +116,8 @@
{}%
}
-%%------PRESENTATIONDECODES
-\NewTCBListing{PresentationCode}{ O{ForestGreen} m }{%
- sharp corners=downhill,enhanced,arc=12pt,skin=bicolor,%
- colback=#1!5!white,colframe=#1!75!black,colbacklower=White,%
- attach boxed title to top right={yshift=-\tcboxedtitleheight},title=Code \LaTeX,%
- boxed title style={%
- colframe=#1!75!black,colback=#1!15!white,%
- ,sharp corners=downhill,arc=12pt,%
- },%
- fonttitle=\color{#1!90!black}\itshape\ttfamily\footnotesize,%
- listing options={%
- style=tcblatex,basicstyle=\footnotesize\ttfamily,%
- keywordstyle=\bfseries\color{Blue},tabsize=2,%
- },%
- #2
-}
+%%------Codes listings
+\input{proflycee-tools-listings.tex}
%%------SPLINES
%commande utile pour extraire des infos d'une liste
@@ -318,10 +306,6 @@
\IfStrEq{\CFposcmd}{right}%si poscmd=right
{\draw (C3\CFL) node[left,\CFcoulcmd,font=\CFtaille] {#2} ;}
{}
- %LA LIGNE DE SÉPARATION
- %\ifboolKV[paramfenxcas]{Sep}%si sep=true
- % {\draw[\CFcouleur] (A1\CFL) -- (A4\CFL);}
- % {}
%LE RÉSULTAT
\IfStrEq{\CFposres}{centre}%si posrep=center
{\draw (R2\CFL) node[\CFcoulres,font=\CFtaille] {#3} ;}
@@ -347,186 +331,6 @@
{}
}
-%%------STYLE ALGO LST
-\ifluatex
- \tcbuselibrary{listings}
- \lstdefinelanguage{langnat}{%
- keywords={},
- inputencoding=utf8,
- comment=[l]{}}
- \lstdefinestyle{PLpython}{%
- language = python,
- inputencoding = utf8,
- basicstyle = \ttfamily\footnotesize,
- keywordstyle = \color{ForestGreen},
- keywordstyle = [2]\color{magenta},
- commentstyle = \color{gray}\itshape,
- stringstyle = \color{red!75},
- numberstyle = \scriptsize\ttfamily\color{Green},
- aboveskip = 0pt,
- belowskip = 0pt,
- tabsize = 4,
- showstringspaces = false,
- columns = fullflexible,
- keepspaces = true,
- breaklines = true,
- breakatwhitespace = true
- }
-\else
- \tcbuselibrary{listingsutf8}
- \lstdefinelanguage{langnat}{%
- keywords={},
- inputencoding=utf8/latin1,
- comment=[l]{}}
- \lstdefinestyle{PLpython}{%
- language = python,
- inputencoding = utf8/latin1,
- basicstyle = \ttfamily\footnotesize,
- keywordstyle = \color{ForestGreen},
- keywordstyle = [2]\color{magenta},
- commentstyle = \color{gray}\itshape,
- stringstyle = \color{red!75},
- numberstyle = \scriptsize\ttfamily\color{Green},
- aboveskip = 0pt,
- belowskip = 0pt,
- tabsize = 4,
- showstringspaces = false,
- columns = fullflexible,
- keepspaces = true,
- breaklines = true,
- breakatwhitespace = true
- }
-\fi
-
-%%------PYTHONLISTINGS
-\tcbset{stylepythonlst/.style={%
- enhanced,boxrule=1.25pt,%
- leftupper=10pt,
- 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
- },
- colframe=Green,colback=ForestGreen!5,%
- fonttitle=\color{ForestGreen}\itshape\ttfamily\footnotesize,
- title={\scriptsize\faPython}\:Code Python\vphantom{p},
- watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50,
- listing only,listing engine=listings,%
- }
-}
-
-\tcbset{stylepythonlstnolineos/.style={%
- stylepythonlst,
- listing options={style=PLpython,xleftmargin=0pt,numbers=none}
- }
-}
-
-\tcbset{stylepythonlstlineos/.style={%
- stylepythonlst,
- listing options={style=PLpython,xleftmargin=16pt,numbers=left}
- }
-}
-
-\NewTCBListing{CodePythonLst}{ s O{\linewidth} m }{% * off pour numéros de lignes + {largeur} + <options tcbox>
- \IfBooleanTF{#1}{stylepythonlstnolineos}{stylepythonlstlineos},
- width=#2,#3
-}
-
-\NewTCBInputListing{\CodePythonLstFichier}{ s O{\linewidth} m m }{
- \IfBooleanTF{#1}{stylepythonlstnolineos}{stylepythonlstlineos},
- width=#2,#3,
- listing file={#4}
-}
-
-%%------PSEUDOCODE
-%language pseudocode listings
-\lstdefinestyle{pseudocodePL}{%
- language=langnat,
- basicstyle=\footnotesize\ttfamily,
- numberstyle=\scriptsize\ttfamily\color{gray},
- keywordstyle=\bfseries,
- stringstyle=\color{red!75},
- keepspaces=true,
- tabsize=4,numbersep=10pt,
- xleftmargin=14pt,
- numbers=left,
- morestring=[b]",
- showstringspaces=false,
- %showtabs=false,
- escapeinside={(*}{*)}
-}
-
-\lstdefinestyle{pseudocodenoPL}{%
- language=langnat,
- basicstyle=\footnotesize\ttfamily,
- numberstyle=\scriptsize\ttfamily\color{gray},
- keywordstyle=\bfseries,
- stringstyle=\color{red!75},
- keepspaces=true,
- tabsize=4,numbersep=10pt,
- numbers=none,
- showstringspaces=false,
- morestring=[b]",
- %showtabs=true,
- escapeinside={(*}{*)}
-}
-
-%style tcbox pseudocode avec bannière hautdroite
-\tcbset{stylepseudocodePL/.style={%
- %fontupper=\small\sffamily,%
- enhanced,boxrule=1.25pt,sharp corners=downhill,arc=12pt,
- before skip=12pt,after skip=12pt,leftupper=10pt,top=8pt,bottom=2pt,rightupper=4pt,%
- attach boxed title to top right={yshift=-\tcboxedtitleheight},
- boxed title style={
- size=small,colback=gray!25,boxrule=1.25pt,
- colframe=darkgray,boxsep=1.25pt,
- sharp corners=downhill,
- arc=12pt,
- top=2pt,bottom=1pt,left=6pt,right=6pt
- },
- fonttitle=\color{darkgray}\ttfamily\footnotesize,
- title={\scriptsize\faFileCode}\:\textit{Pseudo-Code}\vphantom{p},
- watermark text={\faCode},watermark opacity=0.175,watermark zoom=0.50,
- }
-}
-
-\ifluatex
- \newcommand\algomathttPL[1]{\symtt{#1}}
-\else
- \newcommand\algomathttPL[1]{\mathtt{#1}}
-\fi
-
-\DeclareTCBListing{PseudoCode}{ s O{12cm} O{} }{% étoilée sans numéro, <taille> puis option...
- width=#2,#3,
- stylepseudocodePL,
- listing only,listing engine=listings,
- listing options={
- style=\IfBooleanTF{#1}{pseudocodenoPL}{pseudocodePL},%version étoilée sans numéro de lignes
- aboveskip=2pt,belowskip=2pt,
- columns=fullflexible,
- literate={é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1%
- {ú}{{\'u}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1%
- {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1%
- {À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1%
- {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1%
- {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1%
- {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1%
- {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1%
- {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1%
- {ű}{{\H{u}}}1 {Ű}{{\H{U}}}1 {ő}{{\H{o}}}1 {Ő}{{\H{O}}}1%
- {ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1%
- {€}{{\texteuro}}1 {£}{{\pounds}}1%
- {=}{\textleftarrow}1 {==}{=}1%
- {*}{$\algomathttPL{\times}$}{1}%
- }
-}
-
%%------FakeTerm
%couleurs (inspirées par termsim !)
\definecolor{PLmpurple}{RGB}{48,10,36}