diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-13 20:37:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-13 20:37:15 +0000 |
commit | d71e95b250f44a62ff464ac94e51914092b10802 (patch) | |
tree | 6d353be212b52eb375f01f11291b3a9868e0f1b5 /Master/texmf-dist/tex/latex | |
parent | 28c1fe4e8f3a427b41b5bb6abaa2d149c2e56d27 (diff) |
proflycee (13oct22)
git-svn-id: svn://tug.org/texlive/trunk@64698 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty | 476 |
1 files changed, 455 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty index cf741e124dc..f869d6dc802 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/07 v1.3.1 - Aide pour l'utilisation de LaTeX en lycee] +\ProvidesPackage{ProfLycee}[2022/10/12 v1.3.3 - Aide pour l'utilisation de LaTeX en lycee] +% 1.3.2 Ajout de commandes pour des arbres de probas classiques, en tikz +% 1.3.1 Correction d'une commande liée à la conversion bintohex (suppression clé trait) % 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...) @@ -1422,15 +1424,14 @@ } %bin->hexa avec blocs de 4 chiffres -\defKV[CONVBINHEX]{% - trait=\def\epcrochet{#1} -} +%\defKV[CONVBINHEX]{% +% trait=\def\epcrochet{#1} +%} \setKVdefault[CONVBINHEX]{% - trait=0.5pt,% + %trait=0.5pt,% affbase=true,% details=true } - %bourrage de 0 avant \ExplSyntaxOn \NewExpandableDocumentCommand{\PLstrzeros}{m} @@ -1442,10 +1443,6 @@ } \ExplSyntaxOff -%conversion (visuelle) d'un bloc de 4 chiffres binaires -\newcommand\PLconvblocbinhex[2][0.5pt]{% - \underbracket[#1]{#2}_{\xintBinToHex{#2}} -} %la conversion complète \newcommand\PLconvbinhex[2][]{% @@ -1468,19 +1465,19 @@ \newcount\cpt \cpt0 \loop\ifnum \cpt<\nbblocs - \def\iinit{\fpeval{4*\cpt+1}} - \def\ifinal{\fpeval{4*(\cpt+1)}} - \StrMid{\resinter}{\iinit}{\ifinal}[\blocinter] - \PLconvblocbinhex[\epcrochet]{\blocinter} + \def\iinit{\fpeval{4*\cpt+1}}% + \def\ifinal{\fpeval{4*(\cpt+1)}}% + \StrMid{\resinter}{\iinit}{\ifinal}[\blocinter]% + {\underbracket{\blocinter}_{\xintBinToHex{\blocinter}}\,} \advance\cpt by 1 \repeat - = + \!= }% {} \xintBinToHex{\chbrut}\ifboolKV[CONVBINHEX]{affbase}{_{16}}{} } -%bin/hexa->dec avec écriture polynomiale +%bin/hexa/bin->dec avec écriture polynomiale \defKV[CONVTODEC]{% basedep=\def\basedepart{#1} } @@ -1491,6 +1488,12 @@ zeros=true } +\ExplSyntaxOn +\newcommand\convertbasetobasedix[2]{% + \int_from_base:nn {#1}{#2} +} +\ExplSyntaxOff + \newcommand\PLconvtodec[2][]{% \useKVdefault[CONVTODEC] \setKV[CONVTODEC]{#1}% on paramètres les nouvelles clés et on les simplifie @@ -1554,6 +1557,38 @@ {} } +\newcommand\PLconvversdix[3][]{%1=options,%2=nb,%3=basedep + \useKVdefault[CONVTODEC] + \setKV[CONVTODEC]{#1}% on paramètres les nouvelles clés et on les simplifie + \def\NBdepart{#2} + \def\basedepart{#3} + \StrLen{\NBdepart}[\nbchiffres] + \StrChar{\NBdepart}{1}[\chiffre] + \NBdepart\ifboolKV[CONVTODEC]{affbase}{_{\basedepart}}{} = + \ifboolKV[CONVTODEC]{details}{% + \xintHexToDec{\chiffre}\times\basedepart^{\inteval{\nbchiffres-1}}% + \newcount\cpt + \cpt2 + \loop\ifnum \cpt<\inteval{\nbchiffres+1} + \def\puiss{\inteval{\nbchiffres-\cpt}} + \StrChar{\NBdepart}{\cpt}[\chiffre] + \ifboolKV[CONVTODEC]{zeros}% + {% + +\xintHexToDec{\chiffre}\times\basedepart^{\puiss}% + } + { + \ifnum\xintHexToDec{\chiffre} > 0 + +\xintHexToDec{\chiffre}\times\basedepart^{\puiss}% + \fi + } + \advance\cpt by 1 + \repeat + = + } + {} + \num{\convertbasetobasedix{#2}{#3}}\ifboolKV[CONVTODEC]{affbase}{_{10}}{} +} + %==============MainLevée TikZ========== OK !! \tikzset{% mainlevee/.style args={#1et#2}{decorate,decoration={random steps, segment length=#1,amplitude=#2}}, @@ -2360,7 +2395,8 @@ decalh=2pt,% decalv=3pt,% rect=true,% - noeud=EEE + noeud=EEE,% + couleurres=false } \newcommand\PLconvDepuisDec[3][]{% @@ -2385,17 +2421,415 @@ %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}} + \end{array} \right| \Rightarrow \num{#2}_{10}=\ifboolKV[convfromten]{couleurres}{\mathcolor{\PLConvCouleur}{\convertbasedixtobase{#2}{#3}_{#3}}}{\convertbasedixtobase{#2}{#3}_{#3}}}% \ifboolKV[convfromten]{rect}% {% \IfSubStr{\PLConvDecalH}{/}% {\StrCut{\PLConvDecalH}{/}{\PLConvDecalHg}{\PLConvDecalHd}}% - {\def\PLConvDecalHg{\PLConvDecalH}\def\PLConvDecalHd{\PLConvDecalH}} + {\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} - }{} + \end{tikzpicture}% + }{}% +} + +%===============ARBRESPROBAS=========== OK !! +\defKV[PLTIKZARBRE]{% + unite=\def\PLAPunite{#1},% + espniv=\def\PLAPespniv{#1},% + espfeuille=\def\PLAPespfeuille{#1},% + type=\def\PLAPtype{#1},% + police=\def\PLAPfont{#1},% + policeprobas=\def\PLAPfontproba{#1},% + styletrait=\def\PLAPtypetrait{#1},% + eptrait=\def\PLAPeptrait{#1} +} + +\setKVdefault[PLTIKZARBRE]{% + unite=1cm,% + espniv=3.25,% + espfeuille=1,% + type=2x2,% + police=\normalfont\normalsize,% + policeprobas=\normalfont\small,% + inclineprobas=true,% + fleche=false,% + styletrait={},% + eptrait=semithick +} + +\NewDocumentCommand\PLarbre{ O{} m }{%1=options,2=libellés + \useKVdefault[PLTIKZARBRE]% + \setKV[PLTIKZARBRE]{#1}% + \setsepchar[.]{,./}% + \readlist*\PLARBREDONNES{#2}% + \begin{tikzpicture}[x=\PLAPunite,y=\PLAPunite] + %styles + \tikzstyle{noeud} = [font=\PLAPfont] + \tikzstyle{probas}= [font=\PLAPfontproba] + \ifboolKV[PLTIKZARBRE]{inclineprobas} + {\tikzstyle{PLetiquette}=[pos=0.525,sloped,fill=white]} + {\tikzstyle{PLetiquette}=[pos=0.525,fill=white]} + \ifboolKV[PLTIKZARBRE]{fleche} + {\tikzstyle{PLfleche}=[->,>=latex,\PLAPtypetrait,\PLAPeptrait]} + {\tikzstyle{PLfleche}=[\PLAPtypetrait,\PLAPeptrait]} + %arbre2x2 + \IfEq{\PLAPtype}{2x2} + {% + \coordinate (R) at ({0*\PLAPespniv},{-1.5*\PLAPespfeuille}) ; + \node[noeud] (A11) at ({1*\PLAPespniv},{-0.5*\PLAPespfeuille}) {\PLARBREDONNES[1,1]}; + \node[noeud] (A21) at ({2*\PLAPespniv},{-0*\PLAPespfeuille}) {\PLARBREDONNES[2,1]}; + \node[noeud] (A22) at ({2*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[3,1]}; + \node[noeud] (A12) at ({1*\PLAPespniv},{-2.5*\PLAPespfeuille}) {\PLARBREDONNES[4,1]}; + \node[noeud] (A23) at ({2*\PLAPespniv},{-2*\PLAPespfeuille}) {\PLARBREDONNES[5,1]}; + \node[noeud] (A24) at ({2*\PLAPespniv},{-3*\PLAPespfeuille}) {\PLARBREDONNES[6,1]}; + \IfEq{\PLARBREDONNES[1,2]}{} + {\draw[PLfleche] (R)--(A11) ;} + {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + \IfEq{\PLARBREDONNES[2,2]}{} + {\draw[PLfleche] (A11)--(A21) ;} + {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + \IfEq{\PLARBREDONNES[3,2]}{} + {\draw[PLfleche] (A11)--(A22) ;} + {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + \IfEq{\PLARBREDONNES[4,2]}{} + {\draw[PLfleche] (R)--(A12) ;} + {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + \IfEq{\PLARBREDONNES[5,2]}{} + {\draw[PLfleche] (A12)--(A23) ;} + {\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + \IfEq{\PLARBREDONNES[6,2]}{} + {\draw[PLfleche] (A12)--(A24) ;} + {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + }{} + %arbre3x2 + \IfEq{\PLAPtype}{3x2} + {% + %sommets + \coordinate (R) at ({0*\PLAPespniv},{-2.5*\PLAPespfeuille}) ; + \node[noeud] (A11) at ({1*\PLAPespniv},{-0.5*\PLAPespfeuille}) {\PLARBREDONNES[1,1]}; + \node[noeud] (A21) at ({2*\PLAPespniv},{-0*\PLAPespfeuille}) {\PLARBREDONNES[2,1]}; + \node[noeud] (A22) at ({2*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[3,1]}; + \node[noeud] (A12) at ({1*\PLAPespniv},{-2.5*\PLAPespfeuille}) {\PLARBREDONNES[4,1]}; + \node[noeud] (A23) at ({2*\PLAPespniv},{-2*\PLAPespfeuille}) {\PLARBREDONNES[5,1]}; + \node[noeud] (A24) at ({2*\PLAPespniv},{-3*\PLAPespfeuille}) {\PLARBREDONNES[6,1]}; + \node[noeud] (A13) at ({1*\PLAPespniv},{-4.5*\PLAPespfeuille}) {\PLARBREDONNES[7,1]}; + \node[noeud] (A25) at ({2*\PLAPespniv},{-4*\PLAPespfeuille}) {\PLARBREDONNES[8,1]}; + \node[noeud] (A26) at ({2*\PLAPespniv},{-5*\PLAPespfeuille}) {\PLARBREDONNES[9,1]}; + %branches + \IfEq{\PLARBREDONNES[1,2]}{} + {\draw[PLfleche] (R)--(A11) ;} + {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + \IfEq{\PLARBREDONNES[2,2]}{} + {\draw[PLfleche] (A11)--(A21) ;} + {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + \IfEq{\PLARBREDONNES[3,2]}{} + {\draw[PLfleche] (A11)--(A22) ;} + {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + \IfEq{\PLARBREDONNES[4,2]}{} + {\draw[PLfleche] (R)--(A12) ;} + {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + \IfEq{\PLARBREDONNES[5,2]}{} + {\draw[PLfleche] (A12)--(A23) ;} + {\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + \IfEq{\PLARBREDONNES[6,2]}{} + {\draw[PLfleche] (A12)--(A24) ;} + {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + \IfEq{\PLARBREDONNES[7,2]}{} + {\draw[PLfleche] (R)--(A13) ;} + {\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + \IfEq{\PLARBREDONNES[8,2]}{} + {\draw[PLfleche] (A13)--(A25) ;} + {\draw[PLfleche] (A13)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + \IfEq{\PLARBREDONNES[9,2]}{} + {\draw[PLfleche] (A13)--(A26) ;} + {\draw[PLfleche] (A13)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ;} + }{} + %arbre2x3 + \IfEq{\PLAPtype}{2x3} + {% + %sommets + \coordinate (R) at ({0*\PLAPespniv},{-2.5*\PLAPespfeuille}) ; + \node[noeud] (A11) at ({1*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[1,1]}; + \node[noeud] (A12) at ({1*\PLAPespniv},{-4*\PLAPespfeuille}) {\PLARBREDONNES[5,1]}; + \node[noeud] (A21) at ({2*\PLAPespniv},{-0*\PLAPespfeuille}) {\PLARBREDONNES[2,1]}; + \node[noeud] (A22) at ({2*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[3,1]}; + \node[noeud] (A23) at ({2*\PLAPespniv},{-2*\PLAPespfeuille}) {\PLARBREDONNES[4,1]}; + \node[noeud] (A24) at ({2*\PLAPespniv},{-3*\PLAPespfeuille}) {\PLARBREDONNES[6,1]}; + \node[noeud] (A25) at ({2*\PLAPespniv},{-4*\PLAPespfeuille}) {\PLARBREDONNES[7,1]}; + \node[noeud] (A26) at ({2*\PLAPespniv},{-5*\PLAPespfeuille}) {\PLARBREDONNES[8,1]}; + %branches + \IfEq{\PLARBREDONNES[1,2]}{} + {\draw[PLfleche] (R)--(A11) ;} + {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + \IfEq{\PLARBREDONNES[5,2]}{} + {\draw[PLfleche] (R)--(A12) ;} + {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + \IfEq{\PLARBREDONNES[2,2]}{} + {\draw[PLfleche] (A11)--(A21) ;} + {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + \IfEq{\PLARBREDONNES[3,2]}{} + {\draw[PLfleche] (A11)--(A22) ;} + {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + \IfEq{\PLARBREDONNES[4,2]}{} + {\draw[PLfleche] (A11)--(A23) ;} + {\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + \IfEq{\PLARBREDONNES[6,2]}{} + {\draw[PLfleche] (A12)--(A24) ;} + {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + \IfEq{\PLARBREDONNES[7,2]}{} + {\draw[PLfleche] (A12)--(A25) ;} + {\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + \IfEq{\PLARBREDONNES[8,2]}{} + {\draw[PLfleche] (A12)--(A26) ;} + {\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + }{} + %arbre2x3 + \IfEq{\PLAPtype}{3x3} + {% + %sommets + \coordinate (R) at ({0*\PLAPespniv},{-4*\PLAPespfeuille}) ; + \node[noeud] (A11) at ({1*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[1,1]}; + \node[noeud] (A12) at ({1*\PLAPespniv},{-4*\PLAPespfeuille}) {\PLARBREDONNES[5,1]}; + \node[noeud] (A13) at ({1*\PLAPespniv},{-7*\PLAPespfeuille}) {\PLARBREDONNES[10,1]}; + \node[noeud] (A21) at ({2*\PLAPespniv},{-0*\PLAPespfeuille}) {\PLARBREDONNES[2,1]}; + \node[noeud] (A22) at ({2*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[3,1]}; + \node[noeud] (A23) at ({2*\PLAPespniv},{-2*\PLAPespfeuille}) {\PLARBREDONNES[4,1]}; + \node[noeud] (A24) at ({2*\PLAPespniv},{-3*\PLAPespfeuille}) {\PLARBREDONNES[6,1]}; + \node[noeud] (A25) at ({2*\PLAPespniv},{-4*\PLAPespfeuille}) {\PLARBREDONNES[7,1]}; + \node[noeud] (A26) at ({2*\PLAPespniv},{-5*\PLAPespfeuille}) {\PLARBREDONNES[8,1]}; + \node[noeud] (A27) at ({2*\PLAPespniv},{-6*\PLAPespfeuille}) {\PLARBREDONNES[10,1]}; + \node[noeud] (A28) at ({2*\PLAPespniv},{-7*\PLAPespfeuille}) {\PLARBREDONNES[11,1]}; + \node[noeud] (A29) at ({2*\PLAPespniv},{-8*\PLAPespfeuille}) {\PLARBREDONNES[12,1]}; + %branches + \IfEq{\PLARBREDONNES[1,2]}{} + {\draw[PLfleche] (R)--(A11) ;} + {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + \IfEq{\PLARBREDONNES[5,2]}{} + {\draw[PLfleche] (R)--(A12) ;} + {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + \IfEq{\PLARBREDONNES[9,2]}{} + {\draw[PLfleche] (R)--(A13) ;} + {\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ;} + %N2 + \IfEq{\PLARBREDONNES[2,2]}{} + {\draw[PLfleche] (A11)--(A21) ;} + {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + \IfEq{\PLARBREDONNES[3,2]}{} + {\draw[PLfleche] (A11)--(A22) ;} + {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + \IfEq{\PLARBREDONNES[4,2]}{} + {\draw[PLfleche] (A11)--(A23) ;} + {\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + \IfEq{\PLARBREDONNES[6,2]}{} + {\draw[PLfleche] (A12)--(A24) ;} + {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + \IfEq{\PLARBREDONNES[7,2]}{} + {\draw[PLfleche] (A12)--(A25) ;} + {\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + \IfEq{\PLARBREDONNES[8,2]}{} + {\draw[PLfleche] (A12)--(A26) ;} + {\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + \IfEq{\PLARBREDONNES[10,2]}{} + {\draw[PLfleche] (A13)--(A27) ;} + {\draw[PLfleche] (A13)--(A27) node[probas,PLetiquette,{\PLARBREDONNES[10,3]}] {{\PLARBREDONNES[10,2]}} ;} + \IfEq{\PLARBREDONNES[11,2]}{} + {\draw[PLfleche] (A13)--(A28) ;} + {\draw[PLfleche] (A13)--(A28) node[probas,PLetiquette,{\PLARBREDONNES[11,3]}] {{\PLARBREDONNES[11,2]}} ;} + \IfEq{\PLARBREDONNES[12,2]}{} + {\draw[PLfleche] (A13)--(A29) ;} + {\draw[PLfleche] (A13)--(A29) node[probas,PLetiquette,{\PLARBREDONNES[12,3]}] {{\PLARBREDONNES[12,2]}} ;} + }{} + \end{tikzpicture} +} + +\NewDocumentEnvironment{PLenvarbre}{ O{} m }%1=options,2=libellés +{ + \useKVdefault[PLTIKZARBRE] + \setKV[PLTIKZARBRE]{#1} + \setsepchar[.]{,./}% + \readlist*\PLARBREDONNES{#2} + \begin{tikzpicture}[x=\PLAPunite,y=\PLAPunite] + %styles + \tikzstyle{noeud} = [font=\PLAPfont] + \tikzstyle{probas}= [font=\PLAPfontproba] + \ifboolKV[PLTIKZARBRE]{inclineprobas} + {\tikzstyle{PLetiquette}=[pos=0.525,sloped,fill=white]} + {\tikzstyle{PLetiquette}=[pos=0.525,fill=white]} + \ifboolKV[PLTIKZARBRE]{fleche} + {\tikzstyle{PLfleche}=[->,>=latex,\PLAPtypetrait,\PLAPeptrait]} + {\tikzstyle{PLfleche}=[\PLAPtypetrait,\PLAPeptrait]} + %arbre2x2 + \IfEq{\PLAPtype}{2x2} + {% + \coordinate (R) at ({0*\PLAPespniv},{-1.5*\PLAPespfeuille}) ; + \node[noeud] (A11) at ({1*\PLAPespniv},{-0.5*\PLAPespfeuille}) {\PLARBREDONNES[1,1]}; + \node[noeud] (A21) at ({2*\PLAPespniv},{-0*\PLAPespfeuille}) {\PLARBREDONNES[2,1]}; + \node[noeud] (A22) at ({2*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[3,1]}; + \node[noeud] (A12) at ({1*\PLAPespniv},{-2.5*\PLAPespfeuille}) {\PLARBREDONNES[4,1]}; + \node[noeud] (A23) at ({2*\PLAPespniv},{-2*\PLAPespfeuille}) {\PLARBREDONNES[5,1]}; + \node[noeud] (A24) at ({2*\PLAPespniv},{-3*\PLAPespfeuille}) {\PLARBREDONNES[6,1]}; + \IfEq{\PLARBREDONNES[1,2]}{} + {\draw[PLfleche] (R)--(A11) ;} + {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + \IfEq{\PLARBREDONNES[2,2]}{} + {\draw[PLfleche] (A11)--(A21) ;} + {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + \IfEq{\PLARBREDONNES[3,2]}{} + {\draw[PLfleche] (A11)--(A22) ;} + {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + \IfEq{\PLARBREDONNES[4,2]}{} + {\draw[PLfleche] (R)--(A12) ;} + {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + \IfEq{\PLARBREDONNES[5,2]}{} + {\draw[PLfleche] (A12)--(A23) ;} + {\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + \IfEq{\PLARBREDONNES[6,2]}{} + {\draw[PLfleche] (A12)--(A24) ;} + {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + }{} + %arbre3x2 + \IfEq{\PLAPtype}{3x2} + {% + %sommets + \coordinate (R) at ({0*\PLAPespniv},{-2.5*\PLAPespfeuille}) ; + \node[noeud] (A11) at ({1*\PLAPespniv},{-0.5*\PLAPespfeuille}) {\PLARBREDONNES[1,1]}; + \node[noeud] (A21) at ({2*\PLAPespniv},{-0*\PLAPespfeuille}) {\PLARBREDONNES[2,1]}; + \node[noeud] (A22) at ({2*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[3,1]}; + \node[noeud] (A12) at ({1*\PLAPespniv},{-2.5*\PLAPespfeuille}) {\PLARBREDONNES[4,1]}; + \node[noeud] (A23) at ({2*\PLAPespniv},{-2*\PLAPespfeuille}) {\PLARBREDONNES[5,1]}; + \node[noeud] (A24) at ({2*\PLAPespniv},{-3*\PLAPespfeuille}) {\PLARBREDONNES[6,1]}; + \node[noeud] (A13) at ({1*\PLAPespniv},{-4.5*\PLAPespfeuille}) {\PLARBREDONNES[7,1]}; + \node[noeud] (A25) at ({2*\PLAPespniv},{-4*\PLAPespfeuille}) {\PLARBREDONNES[8,1]}; + \node[noeud] (A26) at ({2*\PLAPespniv},{-5*\PLAPespfeuille}) {\PLARBREDONNES[9,1]}; + %branches + \IfEq{\PLARBREDONNES[1,2]}{} + {\draw[PLfleche] (R)--(A11) ;} + {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + \IfEq{\PLARBREDONNES[2,2]}{} + {\draw[PLfleche] (A11)--(A21) ;} + {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + \IfEq{\PLARBREDONNES[3,2]}{} + {\draw[PLfleche] (A11)--(A22) ;} + {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + \IfEq{\PLARBREDONNES[4,2]}{} + {\draw[PLfleche] (R)--(A12) ;} + {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + \IfEq{\PLARBREDONNES[5,2]}{} + {\draw[PLfleche] (A12)--(A23) ;} + {\draw[PLfleche] (A12)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + \IfEq{\PLARBREDONNES[6,2]}{} + {\draw[PLfleche] (A12)--(A24) ;} + {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + \IfEq{\PLARBREDONNES[7,2]}{} + {\draw[PLfleche] (R)--(A13) ;} + {\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + \IfEq{\PLARBREDONNES[8,2]}{} + {\draw[PLfleche] (A13)--(A25) ;} + {\draw[PLfleche] (A13)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + \IfEq{\PLARBREDONNES[9,2]}{} + {\draw[PLfleche] (A13)--(A26) ;} + {\draw[PLfleche] (A13)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ;} + }{} + %arbre2x3 + \IfEq{\PLAPtype}{2x3} + {% + %sommets + \coordinate (R) at ({0*\PLAPespniv},{-2.5*\PLAPespfeuille}) ; + \node[noeud] (A11) at ({1*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[1,1]}; + \node[noeud] (A12) at ({1*\PLAPespniv},{-4*\PLAPespfeuille}) {\PLARBREDONNES[5,1]}; + \node[noeud] (A21) at ({2*\PLAPespniv},{-0*\PLAPespfeuille}) {\PLARBREDONNES[2,1]}; + \node[noeud] (A22) at ({2*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[3,1]}; + \node[noeud] (A23) at ({2*\PLAPespniv},{-2*\PLAPespfeuille}) {\PLARBREDONNES[4,1]}; + \node[noeud] (A24) at ({2*\PLAPespniv},{-3*\PLAPespfeuille}) {\PLARBREDONNES[6,1]}; + \node[noeud] (A25) at ({2*\PLAPespniv},{-4*\PLAPespfeuille}) {\PLARBREDONNES[7,1]}; + \node[noeud] (A26) at ({2*\PLAPespniv},{-5*\PLAPespfeuille}) {\PLARBREDONNES[8,1]}; + %branches + \IfEq{\PLARBREDONNES[1,2]}{} + {\draw[PLfleche] (R)--(A11) ;} + {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + \IfEq{\PLARBREDONNES[5,2]}{} + {\draw[PLfleche] (R)--(A12) ;} + {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + \IfEq{\PLARBREDONNES[2,2]}{} + {\draw[PLfleche] (A11)--(A21) ;} + {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + \IfEq{\PLARBREDONNES[3,2]}{} + {\draw[PLfleche] (A11)--(A22) ;} + {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + \IfEq{\PLARBREDONNES[4,2]}{} + {\draw[PLfleche] (A11)--(A23) ;} + {\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + \IfEq{\PLARBREDONNES[6,2]}{} + {\draw[PLfleche] (A12)--(A24) ;} + {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + \IfEq{\PLARBREDONNES[7,2]}{} + {\draw[PLfleche] (A12)--(A25) ;} + {\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + \IfEq{\PLARBREDONNES[8,2]}{} + {\draw[PLfleche] (A12)--(A26) ;} + {\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + }{} + %arbre2x3 + \IfEq{\PLAPtype}{3x3} + {% + %sommets + \coordinate (R) at ({0*\PLAPespniv},{-4*\PLAPespfeuille}) ; + \node[noeud] (A11) at ({1*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[1,1]}; + \node[noeud] (A12) at ({1*\PLAPespniv},{-4*\PLAPespfeuille}) {\PLARBREDONNES[5,1]}; + \node[noeud] (A13) at ({1*\PLAPespniv},{-7*\PLAPespfeuille}) {\PLARBREDONNES[10,1]}; + \node[noeud] (A21) at ({2*\PLAPespniv},{-0*\PLAPespfeuille}) {\PLARBREDONNES[2,1]}; + \node[noeud] (A22) at ({2*\PLAPespniv},{-1*\PLAPespfeuille}) {\PLARBREDONNES[3,1]}; + \node[noeud] (A23) at ({2*\PLAPespniv},{-2*\PLAPespfeuille}) {\PLARBREDONNES[4,1]}; + \node[noeud] (A24) at ({2*\PLAPespniv},{-3*\PLAPespfeuille}) {\PLARBREDONNES[6,1]}; + \node[noeud] (A25) at ({2*\PLAPespniv},{-4*\PLAPespfeuille}) {\PLARBREDONNES[7,1]}; + \node[noeud] (A26) at ({2*\PLAPespniv},{-5*\PLAPespfeuille}) {\PLARBREDONNES[8,1]}; + \node[noeud] (A27) at ({2*\PLAPespniv},{-6*\PLAPespfeuille}) {\PLARBREDONNES[10,1]}; + \node[noeud] (A28) at ({2*\PLAPespniv},{-7*\PLAPespfeuille}) {\PLARBREDONNES[11,1]}; + \node[noeud] (A29) at ({2*\PLAPespniv},{-8*\PLAPespfeuille}) {\PLARBREDONNES[12,1]}; + %branches + \IfEq{\PLARBREDONNES[1,2]}{} + {\draw[PLfleche] (R)--(A11) ;} + {\draw[PLfleche] (R)--(A11) node[probas,PLetiquette,{\PLARBREDONNES[1,3]}] {{\PLARBREDONNES[1,2]}} ;} + \IfEq{\PLARBREDONNES[5,2]}{} + {\draw[PLfleche] (R)--(A12) ;} + {\draw[PLfleche] (R)--(A12) node[probas,PLetiquette,{\PLARBREDONNES[5,3]}] {{\PLARBREDONNES[5,2]}} ;} + \IfEq{\PLARBREDONNES[9,2]}{} + {\draw[PLfleche] (R)--(A13) ;} + {\draw[PLfleche] (R)--(A13) node[probas,PLetiquette,{\PLARBREDONNES[9,3]}] {{\PLARBREDONNES[9,2]}} ;} + %N2 + \IfEq{\PLARBREDONNES[2,2]}{} + {\draw[PLfleche] (A11)--(A21) ;} + {\draw[PLfleche] (A11)--(A21) node[probas,PLetiquette,{\PLARBREDONNES[2,3]}] {{\PLARBREDONNES[2,2]}} ;} + \IfEq{\PLARBREDONNES[3,2]}{} + {\draw[PLfleche] (A11)--(A22) ;} + {\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ;} + \IfEq{\PLARBREDONNES[4,2]}{} + {\draw[PLfleche] (A11)--(A23) ;} + {\draw[PLfleche] (A11)--(A23) node[probas,PLetiquette,{\PLARBREDONNES[4,3]}] {{\PLARBREDONNES[4,2]}} ;} + \IfEq{\PLARBREDONNES[6,2]}{} + {\draw[PLfleche] (A12)--(A24) ;} + {\draw[PLfleche] (A12)--(A24) node[probas,PLetiquette,{\PLARBREDONNES[6,3]}] {{\PLARBREDONNES[6,2]}} ;} + \IfEq{\PLARBREDONNES[7,2]}{} + {\draw[PLfleche] (A12)--(A25) ;} + {\draw[PLfleche] (A12)--(A25) node[probas,PLetiquette,{\PLARBREDONNES[7,3]}] {{\PLARBREDONNES[7,2]}} ;} + \IfEq{\PLARBREDONNES[8,2]}{} + {\draw[PLfleche] (A12)--(A26) ;} + {\draw[PLfleche] (A12)--(A26) node[probas,PLetiquette,{\PLARBREDONNES[8,3]}] {{\PLARBREDONNES[8,2]}} ;} + \IfEq{\PLARBREDONNES[10,2]}{} + {\draw[PLfleche] (A13)--(A27) ;} + {\draw[PLfleche] (A13)--(A27) node[probas,PLetiquette,{\PLARBREDONNES[10,3]}] {{\PLARBREDONNES[10,2]}} ;} + \IfEq{\PLARBREDONNES[11,2]}{} + {\draw[PLfleche] (A13)--(A28) ;} + {\draw[PLfleche] (A13)--(A28) node[probas,PLetiquette,{\PLARBREDONNES[11,3]}] {{\PLARBREDONNES[11,2]}} ;} + \IfEq{\PLARBREDONNES[12,2]}{} + {\draw[PLfleche] (A13)--(A29) ;} + {\draw[PLfleche] (A13)--(A29) node[probas,PLetiquette,{\PLARBREDONNES[12,3]}] {{\PLARBREDONNES[12,2]}} ;} + }{} + } + { + \end{tikzpicture} } \endinput
\ No newline at end of file |