diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-07 21:05:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-07 21:05:45 +0000 |
commit | 5fbee6dcf6215517129cc4addc249c57cb23cc10 (patch) | |
tree | a4bf7dde35abcc8ca2f22af49162ce719d7515cf /Master/texmf-dist/tex/latex/proflycee | |
parent | a3a56833f1b4688189ece55f0a2f73ab3e958afb (diff) |
proflycee (7oct22)
git-svn-id: svn://tug.org/texlive/trunk@64649 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/proflycee')
-rw-r--r-- | Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty | 74 |
1 files changed, 69 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty index e13bf2a31e0..cf741e124dc 100644 --- a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty +++ b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty @@ -3,7 +3,9 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2022/10/03 v1.2.9 - Aide pour l'utilisation de LaTeX en lycee] +\ProvidesPackage{ProfLycee}[2022/10/07 v1.3.1 - Aide pour l'utilisation de LaTeX en lycee] +% 1.3.1 Ajout d'une option pour ne pas afficher les bords des cases en pixelart +% 1.3.0 Ajout d'une commande pour mettre en forme une conversion depuis la base 10 % 1.2.9 Correction d'une incompatibilité avec simplekv (clés vides...) % 1.2.8 Correction de l'oubli d'une librairie tikz et remise en forme de la documentation % 1.2.7 Calculs de probas pour des lois classiques @@ -932,8 +934,8 @@ } \newcommand\ensPL[2][1]{% - \useKVdefault[kvensemble] - \setKV[kvensemble]{#1} + \useKVdefault[kvensemble]% + \setKV[kvensemble]{#1}% \ifboolKV[kvensemble]{mathpunct}% {\left\lbrace \PLensopt{} \mathpunct{} \StrSubstitute{#2}{/}{\mathpunct{}{\PLenssep}\mathpunct{}} \mathpunct{} \right\rbrace}% {\left\lbrace \PLensopt{} \StrSubstitute{#2}{/}{{\PLenssep}} \right\rbrace} @@ -1569,7 +1571,8 @@ \setKVdefault[pixelarttkz]{% style=\scriptsize,% correction=false,% - symb=false + symb=false,% + bordcases=true } \newcommand\PLpixelart[2][]{% @@ -1587,7 +1590,10 @@ \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]{bordcases}% + {\draw[fill=\pixcol] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% + {\filldraw[\pixcol] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% + % }% {} } @@ -2334,4 +2340,62 @@ } } +%===============CONVFROMDEC============ OK !! +\newcommand\PLnoeud[2]{\tikz[remember picture,baseline=(#1.base)]\node[shape=rectangle,inner sep=0pt](#1){#2};} +\ExplSyntaxOn +\newcommand\convertbasedixtobase[2]{% + \int_to_Base:nn {#1}{#2} +} +\ExplSyntaxOff + +\defKV[convfromten]{% + couleur=\def\PLConvCouleur{#1},% + decalh=\def\PLConvDecalH{#1},% + decalv=\def\PLConvDecalV{#1},% + noeud=\def\PLConvNoeud{#1} +} + +\setKVdefault[convfromten]{% + couleur=red,% + decalh=2pt,% + decalv=3pt,% + rect=true,% + noeud=EEE +} + +\newcommand\PLconvDepuisDec[3][]{% + \useKVdefault[convfromten]% + \setKV[convfromten]{#1}% + \xdef\ValRes{\xintDecToHex{#2}}% + \xdef\ValA{#2}\xdef\ValB{#3}% + \xdef\ValTMP{#2}% + \xdef\ValMU{\inteval{#3-1}}% + \ensuremath{% + \left\lbrace\begin{array}{@{\,}r@{\;=\;}l@{\;+\;}r} + %1ere division + \xdef\ValQ{\fpeval{trunc(\ValTMP/#3,0)}}\xdef\ValR{\fpeval{\ValTMP-#3*\ValQ}} + \num{\ValTMP}\uppercase{&}\num{\ValB}\times\num{\ValQ}\uppercase{&}\PLnoeud{\PLConvNoeud1}{\num{\ValR}}% + \xdef\ValTMP{\ValQ}% + \whiledo {\ValTMP > \ValMU}% + {% + \xdef\ValQ{\fpeval{trunc(\ValTMP/#3,0)}}\xdef\ValR{\fpeval{\ValTMP-#3*\ValQ}}% + \\ \num{\ValTMP}\uppercase{&}\num{\ValB}\times\num{\ValQ}\uppercase{&}\num{\ValR} + \xdef\ValTMP{\ValQ}% + } + %dernière + \xdef\ValQ{\fpeval{trunc(\ValTMP/#3,0)}}\xdef\ValR{\fpeval{\ValTMP-#3*\ValQ}}% + \\ \num{\ValTMP}\uppercase{&}\num{\ValB}\times\num{\ValQ}\uppercase{&}\PLnoeud{\PLConvNoeud2}{\num{\ValR}} + \end{array} \right| \Rightarrow \num{#2}_{10}=\convertbasedixtobase{#2}{#3}_{#3}} + \ifboolKV[convfromten]{rect}% + {% + \IfSubStr{\PLConvDecalH}{/}% + {\StrCut{\PLConvDecalH}{/}{\PLConvDecalHg}{\PLConvDecalHd}}% + {\def\PLConvDecalHg{\PLConvDecalH}\def\PLConvDecalHd{\PLConvDecalH}} + \begin{tikzpicture} + \draw[overlay,rounded corners=4pt,\PLConvCouleur,thick] ($(\PLConvNoeud1.north west)+(-\PLConvDecalHg,\PLConvDecalV)$) rectangle ($(\PLConvNoeud2.south east)+(\PLConvDecalHd,-\PLConvDecalV)$) ; + \draw[overlay,rounded corners=4pt,\PLConvCouleur,thick,->,>=latex] ($(\PLConvNoeud2.east)+(\PLConvDecalHd,0)$)--++(0,{0.75\baselineskip}) ; + \end{tikzpicture} + }{} +} + \endinput
\ No newline at end of file |