summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-02-08 21:00:49 +0000
committerKarl Berry <karl@freefriends.org>2023-02-08 21:00:49 +0000
commit35670eff73db8009e4de2e843b88932510f90879 (patch)
tree49ec13b5a64b7e85b44fdd5ac1942b6593db2e56 /Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex
parentca1d8bda0868015697b3b464a86275bd18d84ce3 (diff)
proflycee (8feb23)
git-svn-id: svn://tug.org/texlive/trunk@65759 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex')
-rw-r--r--Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex67
1 files changed, 67 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex
new file mode 100644
index 00000000000..5e97e82cc1f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-piton.tex
@@ -0,0 +1,67 @@
+% proflycee-tools-piton.tex
+% Copyright 2023 Cédric Pierquet
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+
+\RequirePackage{iftex}
+
+%%------PYTHONPITON
+\defKV[envpiton]{%
+ Largeur=\def\CODPITlargeur{#1},%
+ Alignement=\def\CODPITalign{#1},%
+ TaillePolice=\def\CODPITfonte{#1}
+}
+
+\setKVdefault[envpiton]{%
+ 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{} }%
+{%
+ \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,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
+
+\endinput