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.sty79
1 files changed, 78 insertions, 1 deletions
diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty
index 7e32293bc5..1f3e210420 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/08/01 - v1.1.8 - Aide pour l'utilisation de LaTeX en lycée]
+\ProvidesPackage{ProfLycee}[2022/08/10 - v1.2 - Aide pour l'utilisation de LaTeX en lycée]
+% 1.2 Correction d'un méchant bug avec pixelart, erf...
+% 1.1.9 Commande pour du pixelart en tikz (avec option csvii pour compatibilité)
% 1.1.8 Ajout d'un style mainlevee pour tikz
% 1.1.7 Ajout de commandes pour des conversions bin/dec/hex
% 1.1.6 Ajout d'une commande pour déterminer les paramètres d'un régression linéaire par moindres carrés
@@ -29,6 +31,8 @@
\DeclareOption{nominted}{\@nomintedtrue}
\newif\if@build \@buildfalse
\DeclareOption{build}{\@buildtrue}
+\newif\if@csvii \@csviifalse
+\DeclareOption{csvii}{\@csviitrue}
\DeclareOption*{}
\ProcessOptions\relax
@@ -49,6 +53,12 @@
\RequirePackage{listofitems}
\RequirePackage{tabularray}
\RequirePackage{fontawesome5}
+\if@csvii
+ \RequirePackage[legacy]{csvsimple}
+\else
+ \RequirePackage{expl3}
+ \RequirePackage[l3]{csvsimple}
+\fi
%librairies tikz
\usetikzlibrary{calc}
\usetikzlibrary{decorations}
@@ -1444,4 +1454,71 @@
mainlevee/.default={5mm et 0.6pt}
}
+%==============PixelArt TikZ=========== OK !!
+\defKV[pixelarttkz]{%
+ codes=\def\PATlettres{#1},%
+ couleurs=\def\PATcouleurs{#1},%
+ symboles=\def\PATchiffres{#1},%
+ style=\def\PATtaille{#1}
+}
+
+\setKVdefault[pixelarttkz]{%
+ style=\scriptsize,%
+ correction=false,%
+ symb=false
+}
+
+\newcommand\PLpixelart[2][]{%
+ \useKVdefault[pixelarttkz]
+ \setKV[pixelarttkz]{#1}
+ %affichage du corrigé
+ \ifboolKV[pixelarttkz]{correction}
+ {%
+ \csvloop{file=#2,no head,command={%
+ \foreach \l [count=\n] in \csvline {%
+ \setsepchar{,}
+ \readlist\LCPA\PATcouleurs
+ \StrPosition{\PATlettres}{\l}[\pixcnt]%
+ \xintifboolexpr{\pixcnt>0}%
+ {%
+ \itemtomacro\LCPA[\pixcnt]\pixcol%
+ \draw[fill=\pixcol] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;%
+ }%
+ {}
+ }
+ }
+ }
+ }
+ {%
+ \ifboolKV[pixelarttkz]{symb}
+ {%affichage du pixelart versions chiffres si besoin
+ \csvloop{file=#2,no head,command={%
+ \foreach \l [count=\n] in \csvline {%
+ \setsepchar{,}
+ \readlist\LCNA\PATchiffres
+ \StrPosition{\PATlettres}{\l}[\pixpos]%
+ \xintifboolexpr{\pixpos>0}%
+ {%
+ \itemtomacro\LCNA[\pixpos]\pixchf%
+ \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\pixchf} ;%
+ }
+ {}%
+ }
+ }
+ }
+ }
+ {%affichage du pixelart versions lettres ou chiffres simples (<=9)
+ \csvloop{file=#2,no head,command={%
+ \foreach \l [count=\n] in \csvline {%
+ \IfSubStr{\PATlettres}{\l}%
+ {%
+ \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\l};}
+ {}
+ }
+ }
+ }
+ }
+ }
+}
+
\endinput \ No newline at end of file