diff options
Diffstat (limited to 'graphics/pgf/contrib/dynkin-diagrams/dynkin-diagrams.sty')
-rw-r--r-- | graphics/pgf/contrib/dynkin-diagrams/dynkin-diagrams.sty | 1508 |
1 files changed, 946 insertions, 562 deletions
diff --git a/graphics/pgf/contrib/dynkin-diagrams/dynkin-diagrams.sty b/graphics/pgf/contrib/dynkin-diagrams/dynkin-diagrams.sty index e7c4af6022..4a5f69c3ac 100644 --- a/graphics/pgf/contrib/dynkin-diagrams/dynkin-diagrams.sty +++ b/graphics/pgf/contrib/dynkin-diagrams/dynkin-diagrams.sty @@ -1,8 +1,7 @@ % -% % The Dynkin Diagrams package. % -% Version 3.141592653 +% Version 3.1415926535 % % % This package draws Dynkin diagrams in LaTeX documents, using the TikZ package. @@ -18,7 +17,7 @@ % % \NeedsTeXFormat{LaTeX2e}[1994/06/01] -\ProvidesPackage{dynkin-diagrams}[2019/12/04 Dynkin diagrams] +\ProvidesPackage{dynkin-diagrams}[2020/02/02 Dynkin diagrams] \RequirePackage{tikz} \RequirePackage{xstring} \RequirePackage{xparse} @@ -44,6 +43,16 @@ %%% See dynkin-diagrams.tex file for examples of use. %%% + +\ifx\draw@lie@hasse@root\undefined +\pgfdeclarelayer{background} +\pgfdeclarelayer{Dynkin behind} +%\pgfdeclarelayer{Dynkin middle} +%\pgfdeclarelayer{Dynkin above} +\pgfsetlayers{background,Dynkin behind,%Dynkin middle,Dynkin above, +main} +\fi + \newif\ifold@dynkin@is@backwards \newif\ifold@dynkin@is@upsidedown \newif\ifold@dynkin@is@extended @@ -70,7 +79,7 @@ \NewDocumentEnvironment{dynkinDiagram}{O{}mO{0}m}% {% \dynkin@save{}% -\begin{tikzpicture}% +\begin{tikzpicture}[baseline=(origin.base)]% \@dynkin[#1]{#2}[#3]{#4}% }% {% @@ -98,10 +107,10 @@ }% \NewDocumentCommand\dynkinName{O{}mO{0}m}% {% -\dynkin@save{}% -\xdef\dynkin@ply@value{1}% -\xdef\dynkin@label@directions{}% -\xdef\dynkin@label@directions@star{}% + \dynkin@save{}% + \xdef\dynkin@ply@value{1}% + \xdef\dynkin@label@directions{}% + \xdef\dynkin@label@directions@star{}% \setcounter{dynkinRootNo}{0}% \dynkin@clear@indefinite@edge@list% \xdef\dynkin@parabolic{0}% @@ -109,9 +118,28 @@ \xdef\dynkin@user@series{#2}% \xdef\dynkin@twisted@series{#3}% \xdef\dynkin@user@string{#4}% + \xdef\dynkin@string{#4}% \xdef\dynkin@series{#2}% \dynkin@grok@series% \IfSubStr{ABCDEFGHI}{\dynkin@series}{}{\dynkin@error@series}% + \IfInteger{\dynkin@string}% + {% + \dynkin@integer@rank% + }% + {% + % Turn Satake codes into Dynkin diagram expressions in \dynkin@string. + \dynkin@grok@Satake@codes% + }% + % Expand out any digits in \dynkin@string into multiples of the various root marks. + \expand@Dynkin@Roots@Digits% + % Assign to \dynkin@roots the input string \dynkin@string with all . symbols removed, + % so we only get the symbols representing the marks for the various roots. + \StrDel{\dynkin@string}{.}[\temp]% + \xdef\dynkin@roots{\temp}% + \StrLen{\dynkin@roots}[\temp]% + \global\dynkin@nodes=\temp\relax% + \dynkin@grok@indefinite@edges% + \dynkin@find@rank{}% \ensuremath{% \dynkin@series^{% \ifdynkin@is@extended{1}% @@ -126,7 +154,18 @@ {% \IfStrEq{\dynkin@user@string}{}% {\dynkin@indefinite@number@symbol}% - {\dynkin@user@string}% + {\ifdynkin@Satake@diagram% + \dynkin@user@string% + \else% + \IfStrEq{\dynkin@user@string}{even}{ev}% + {% + \IfStrEq{\dynkin@user@string}{odd}{od}% + {% + \the\dynkin@rank% + }% + }% + \fi% + }% \IfStrEq{\dynkin@parabolic}{0}% {}% {,\dynkin@parabolic} @@ -135,6 +174,11 @@ \dynkin@restore{}% }% +%% Returns the current Dynkin diagram ordering as a string. +\NewDocumentCommand\currentDynkinOrdering{}% +{% + \dynkin@ordering% +}% \NewDocumentCommand\dynkinRefreshRoots{}% {% @@ -215,14 +259,19 @@ {% \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \ifnum\dynkin@nodes<#2% - \ClassError{Dynkin diagrams}{Unrecognized root: ``#2'' found when labelling Dynkin diagram \dynkin@user@series{\dynkin@user@string}. Allowed values are up to \the\dynkin@nodes}{}% + \ClassError{Dynkin diagrams}% + {Unrecognized root: + ``#2'' found when labelling Dynkin diagram + \dynkin@user@series{\dynkin@user@string}. + Allowed values are up to \the\dynkin@nodes}% + {}% \fi% \IfStrEq{#3}{}% {% }% {% - \rpo=#2% - \advance\rpo by 1% + \rpo=#2\relax% + \advance\rpo by 1\relax% \IfBooleanTF{#1}% {% \StrMid{\dynkin@label@directions@star}{\the\rpo}{\the\rpo}[\dynkin@direction@letter]% @@ -282,15 +331,18 @@ \setcounter{dynkinRootNo}{0}% \fi% \fi% - \edef\XXX{#2}% - \foreach \i in \XXX% + \edef\dynkin@labelies{#2}% + \IfBooleanTF{#1}% {% - \IfBooleanTF{#1}% + \foreach \i in \dynkin@labelies% {% - \@dynkinLabelThisRootStar{\i}% + \@dynkinLabelThisRootStar{\i}% }% + }% + {% + \foreach \i in \dynkin@labelies% {% - \@dynkinLabelThisRoot{\i}% + \@dynkinLabelThisRoot{\i}% }% }% }% @@ -298,26 +350,26 @@ \NewDocumentCommand\dynkinBrace{somm}%[text]{start}{end} {% \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% -\draw[ -decoration= - { - brace, - \IfBooleanF{#1}{mirror}, - raise=0.05cm, - }, - decorate] - ($(root #3)-({\dynkin@root@radius},\IfBooleanTF{#1}{{-\dynkin@root@radius}}{{\dynkin@root@radius}})$) - -- - ($(root #4)+({\dynkin@root@radius},\IfBooleanTF{#1}{{\dynkin@root@radius}}{{-\dynkin@root@radius}})$) - node - [ - pos=0.5, - anchor=\IfBooleanTF{#1}{south}{north}, - yshift=\IfBooleanTF{#1}{1mm}{-1mm}, - /Dynkin diagram/text style -] -{\IfValueT{#2}{\(#2\)}};% -} + \draw[% + decoration=% + {% + brace, + \IfBooleanF{#1}{mirror}, + raise=0.05cm, + },% + decorate]% + ($(root #3)-({\dynkin@root@radius},\IfBooleanTF{#1}{{-\dynkin@root@radius}}{{\dynkin@root@radius}})$) + -- + ($(root #4)+({\dynkin@root@radius},\IfBooleanTF{#1}{{\dynkin@root@radius}}{{-\dynkin@root@radius}})$) + node% + [% + pos=0.5,% + anchor=\IfBooleanTF{#1}{south}{north},% + yshift=\IfBooleanTF{#1}{1mm}{-1mm},% + /Dynkin diagram/text style% + ]% + {\IfValueT{#2}{\(#2\)}};% +}% %% \dynkinPrintLabels @@ -384,7 +436,17 @@ decoration= }% - +\NewDocumentCommand\dynkinDrawCrossRootMark{O{}m}% +{% + \draw[/Dynkin diagram,x,#1]% + ($(#2)+(\dynkin@root@radius,\dynkin@root@radius)$)% + --% + ($(#2)-(\dynkin@root@radius,\dynkin@root@radius)$);% + \draw[/Dynkin diagram,x,#1]% + ($(#2)+(-\dynkin@root@radius,\dynkin@root@radius)$)% + --% + ($(#2)+(\dynkin@root@radius,-\dynkin@root@radius)$);% +}% %% \dynkinCrossRootMark{<n>} %% Prints a cross at root <n> on the current Dynkin diagram. @@ -397,16 +459,9 @@ decoration= \convertRootNumber{#3}% }% {% - \RootNumber=#3% + \RootNumber=#3\relax% }% - \draw[/Dynkin diagram,x,#2]% - ($(\dynkin@root@name \the\RootNumber)+(\dynkin@root@radius,\dynkin@root@radius)$)% - --% - ($(\dynkin@root@name \the\RootNumber)-(\dynkin@root@radius,\dynkin@root@radius)$);% - \draw[/Dynkin diagram,x,#2]% - ($(\dynkin@root@name \the\RootNumber)+(-\dynkin@root@radius,\dynkin@root@radius)$)% - --% - ($(\dynkin@root@name \the\RootNumber)+(\dynkin@root@radius,-\dynkin@root@radius)$);% + \dynkinDrawCrossRootMark[#2]{\dynkin@root@name \the\RootNumber}% }% %% \dynkinHeavyCrossRootMark{<n>} @@ -420,7 +475,7 @@ decoration= \convertRootNumber{#3}% }% {% - \RootNumber=#3% + \RootNumber=#3\relax% }% \draw[/Dynkin diagram,X,#2]% ($(\dynkin@root@name \the\RootNumber)+(\dynkin@root@radius,\dynkin@root@radius)$)% @@ -444,7 +499,7 @@ decoration= \convertRootNumber{#3}% }% {% - \RootNumber=#3% + \RootNumber=#3\relax% }% \fill[/Dynkin diagram,o,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);% }% @@ -460,12 +515,18 @@ decoration= \convertRootNumber{#3}% }% {% - \RootNumber=#3% + \RootNumber=#3\relax% }% \fill[/Dynkin diagram,o,#2] (\dynkin@root@name \the\RootNumber) circle (2*\dynkin@root@radius);% \fill[/Dynkin diagram,o,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);% }% +\NewDocumentCommand\dynkinDrawSolidRootMark{O{}m}% +{% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% + \fill[/Dynkin diagram,*,#1] (#2) circle (\dynkin@root@radius);% +}% + %% \dynkinSolidRootMark{<n>} %% Prints a solid dot at root <n> on the current Dynkin diagram. %% The starred form accepts <n> in the Bourbaki ordering. @@ -477,9 +538,10 @@ decoration= \convertRootNumber{#3}% }% {% - \RootNumber=#3% + \RootNumber=#3\relax% }% - \fill[/Dynkin diagram,*,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);% + \dynkinDrawSolidRootMark[#2]{\dynkin@root@name \the\RootNumber}% +% \fill[/Dynkin diagram,*,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);% }% %% \dynkinTensorRootMark{<n>} @@ -493,7 +555,7 @@ decoration= \convertRootNumber{#3}% }% {% - \RootNumber=#3% + \RootNumber=#3\relax% }% \fill[/Dynkin diagram,o,#2] (\dynkin@root@name \the\RootNumber) circle ({\dynkin@root@radius});% \draw[/Dynkin diagram,t,#2]% @@ -557,15 +619,15 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram,edge,#2] ($(\dynkin@root@name \the\@fromRoot)$) -- ($(\dynkin@root@name \the\@toRoot)$);% - \end{scope}% + \end{pgfonlayer}% }% %% \dynkinIndefiniteSingleEdge{<p>}{<q>} @@ -580,23 +642,23 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram,edge,#2] ($(\dynkin@root@name \the\@fromRoot)$) -- - (${(2/3)}*(\dynkin@root@name \the\@fromRoot)+{(1/3)}*(\dynkin@root@name \the\@toRoot)$); + (${(2/3)}*(\dynkin@root@name \the\@fromRoot)+{(1/3)}*(\dynkin@root@name \the\@toRoot)$);% \draw[/Dynkin diagram,indefinite edge,#2] (${(2/3)}*(\dynkin@root@name \the\@fromRoot)+{(1/3)}*(\dynkin@root@name \the\@toRoot)$) -- - (${(1/3)}*(\dynkin@root@name \the\@fromRoot)+{(2/3)}*(\dynkin@root@name \the\@toRoot)$); + (${(1/3)}*(\dynkin@root@name \the\@fromRoot)+{(2/3)}*(\dynkin@root@name \the\@toRoot)$);% \draw[/Dynkin diagram,edge,#2] (${(1/3)}*(\dynkin@root@name \the\@fromRoot)+{(2/3)}*(\dynkin@root@name \the\@toRoot)$) -- - ($(\dynkin@root@name \the\@toRoot)$); - \end{scope}% + ($(\dynkin@root@name \the\@toRoot)$);% + \end{pgfonlayer}% }% %%% \dynkinRightFold{<p>}{<q>} @@ -640,16 +702,16 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% % \convertRootPair{\@fromRoot}{\@toRoot}% - \begin{scope}[on background layer] + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram/fold style,#2] ($(\dynkin@root@name \the\@fromRoot)$) to ($(\dynkin@root@name \the\@toRoot)$); - \end{scope}% + \end{pgfonlayer}% }% @@ -664,14 +726,14 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram,edge,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:0:\dynkin@fold@radius);% - \end{scope}% + \end{pgfonlayer}% }% %% \dynkinIndefiniteRightDownArc{<p>}{<q>} @@ -685,11 +747,11 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% \node (center) at ($(\dynkin@root@name \the\@fromRoot)-(0,\dynkin@fold@radius)$) {};% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(90:\dynkin@fold@radius) @@ -702,7 +764,7 @@ decoration= (center) ++(30:\dynkin@fold@radius) arc [start angle=30, end angle=0, radius=\dynkin@fold@radius];% - \end{scope}% + \end{pgfonlayer}% }% %% \dynkinDefiniteRightUpArc{<p>}{<q>} @@ -716,14 +778,14 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram,edge,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (-90:0:\dynkin@fold@radius);% - \end{scope}% + \end{pgfonlayer}% }% %% \dynkinIndefiniteRightUpArc{<p>}{<q>} @@ -737,11 +799,11 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% \node (center) at ($(\dynkin@root@name \the\@fromRoot)+(0,\dynkin@fold@radius)$) {};% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(-90:\dynkin@fold@radius) @@ -754,7 +816,7 @@ decoration= (center) ++(-30:\dynkin@fold@radius) arc [start angle=-30, end angle=0, radius=\dynkin@fold@radius];% - \end{scope}% + \end{pgfonlayer}% }% @@ -769,14 +831,14 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram,edge,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:180:\dynkin@fold@radius);% - \end{scope}% + \end{pgfonlayer}% }% %% \dynkinIndefiniteLeftDownArc{<p>}{<q>} @@ -790,11 +852,11 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% \node (center) at ($(\dynkin@root@name \the\@fromRoot)-(0,\dynkin@fold@radius)$) {};% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(90:\dynkin@fold@radius) @@ -807,7 +869,7 @@ decoration= (center) ++(150:\dynkin@fold@radius) arc [start angle=150, end angle=180, radius=\dynkin@fold@radius];% - \end{scope}% + \end{pgfonlayer}% }% %% \dynkinDefiniteLeftUpArc{<p>}{<q>} @@ -821,14 +883,14 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram,edge,fill=none,#2] ($(\dynkin@root@name \the\@fromRoot)$) arc (-90:-180:\dynkin@fold@radius);% - \end{scope}% + \end{pgfonlayer}% }% %% \dynkinIndefiniteLeftUpArc{<p>}{<q>} @@ -842,11 +904,11 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% \node (center) at ($(\dynkin@root@name \the\@fromRoot)+(0,\dynkin@fold@radius)$) {};% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(-90:\dynkin@fold@radius) @@ -859,7 +921,7 @@ decoration= (center) ++(-150:\dynkin@fold@radius) arc [start angle=-150, end angle=-180, radius=\dynkin@fold@radius];% - \end{scope}% + \end{pgfonlayer}% }% @@ -874,14 +936,14 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,fill=none,#2] ($(\dynkin@root@name \the\@fromRoot)$) arc (90:-90:\dynkin@fold@radius);% - \end{scope}% + \end{pgfonlayer}% }% %% \dynkinIndefiniteSemiCircle{<p>}{<q>} @@ -895,11 +957,11 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% \node (center) at ($(\dynkin@root@name \the\@fromRoot)-(0,\dynkin@fold@radius)$) {};% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(90:\dynkin@fold@radius) @@ -911,8 +973,8 @@ decoration= \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(-90:\dynkin@fold@radius) - arc [start angle=-90, end angle=-30, radius=\dynkin@fold@radius]; - \end{scope}% + arc [start angle=-90, end angle=-30, radius=\dynkin@fold@radius];% + \end{pgfonlayer}% }% %% \dynkinDefiniteDoubleRightDownArc{<p>}{<q>} @@ -927,10 +989,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:0:{\dynkin@fold@radius});% @@ -947,7 +1009,7 @@ decoration= arc (90:45:{\dynkin@fold@radius});% \fi% \fi% - \end{scope}% + \end{pgfonlayer}% }% @@ -963,10 +1025,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (180:90:{\dynkin@fold@radius});% @@ -981,7 +1043,7 @@ decoration= arc (180:135:{\dynkin@fold@radius});% \fi% \fi% - \end{scope}% + \end{pgfonlayer}% }% @@ -997,10 +1059,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (0:90:{\dynkin@fold@radius});% @@ -1017,7 +1079,7 @@ decoration= arc (0:45:{\dynkin@fold@radius});% \fi% \fi% - \end{scope}% + \end{pgfonlayer}% }% @@ -1035,10 +1097,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% -- @@ -1057,7 +1119,7 @@ decoration= arc (180:225:{\dynkin@fold@radius});% \fi% \fi% - \end{scope}% + \end{pgfonlayer}% }% @@ -1073,10 +1135,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (270:360:{\dynkin@fold@radius});% @@ -1093,7 +1155,7 @@ decoration= arc (270:315:\dynkin@fold@radius);% \fi% \fi% - \end{scope}% + \end{pgfonlayer}% }% %% \dynkinDefiniteDoubleLeftDownArc{<p>}{<q>} @@ -1108,10 +1170,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:180:{\dynkin@fold@radius});% @@ -1129,7 +1191,7 @@ decoration= arc (90:135:{\dynkin@fold@radius});% \fi% \fi% - \end{scope}% + \end{pgfonlayer}% }% @@ -1145,10 +1207,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (360:270:{\dynkin@fold@radius});% @@ -1167,7 +1229,7 @@ decoration= arc (360:315:{\dynkin@fold@radius});% \fi% \fi% - \end{scope}% + \end{pgfonlayer}% }% @@ -1184,10 +1246,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (-90:-180:{\dynkin@fold@radius});% @@ -1205,7 +1267,7 @@ decoration= arc (-90:-135:\dynkin@fold@radius);% \fi% \fi% - \end{scope}% + \end{pgfonlayer}% }% @@ -1221,10 +1283,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:-90:{\dynkin@fold@radius});% @@ -1243,7 +1305,7 @@ decoration= arc (90:0:\dynkin@fold@radius);% \fi% \fi% - \end{scope}% + \end{pgfonlayer}% }% @@ -1261,10 +1323,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram, edge, double, @@ -1292,7 +1354,7 @@ decoration= arc (90:0:\dynkin@fold@radius);% \fi% \fi% - \end{scope}% + \end{pgfonlayer}%% }% @@ -1310,10 +1372,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (-90:90:{\dynkin@fold@radius});% @@ -1332,7 +1394,7 @@ decoration= arc (-90:0:\dynkin@fold@radius);% \fi% \fi% - \end{scope}% + \end{pgfonlayer}%% }% @@ -1375,10 +1437,10 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \ifdynkin@reverse@arrows% \path[ -{Computer Modern Rightarrow[\dynkin@arrow@color]}, @@ -1394,14 +1456,14 @@ decoration= -- ($.3*(\dynkin@root@name \the\@fromRoot)+.7*(\dynkin@root@name \the\@toRoot)$);% \fi% - \end{scope}% + \end{pgfonlayer}%% \fi% }% \NewDocumentCommand\dynkinKacDoubleArrow{O{}mm}% {% \draw[arrows = {-{Triangle Cap[length=.8mm,fill=white]}},% - /Dynkin diagram,edge, double=white,fill=white,double distance=1.8pt,#1]% + /Dynkin diagram,edge,double=white,fill=white,double distance=1.8pt,#1]% (\dynkin@root@name \the#2)--(\dynkin@root@name \the#3);% \draw[arrows = {-{Classical TikZ Rightarrow[length=1mm]}},% /Dynkin diagram,edge,double distance=1.8pt,#1]% @@ -1448,27 +1510,27 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% \StrChar{\dynkin@roots}{\the\@fromRoot}[\my@root@marker]% \IfStrEq{\my@root@marker}{x}% {% - \global\onesbit=1% + \global\onesbit=1\relax% }% {% - \global\onesbit=0% + \global\onesbit=0\relax% }% \StrChar{\dynkin@roots}{\the\@toRoot}[\my@root@marker]% \IfStrEq{\my@root@marker}{x}% {% - \global\twosbit=1% + \global\twosbit=1\relax% }% {% - \global\twosbit=0% + \global\twosbit=0\relax% }% \ifdynkin@Kac@arrows - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \ifdynkin@arrows% \ifdynkin@reverse@arrows \ifdynkin@is@backwards @@ -1489,10 +1551,10 @@ decoration= --% (\dynkin@root@name \the\@toRoot);% \fi% - \end{scope}% + \end{pgfonlayer}%% \else \def\LL{.5*\dynkin@root@radius} - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% --% @@ -1507,7 +1569,7 @@ decoration= ($(\dynkin@root@name \the\@fromRoot)+(\the\onesbit*\LL,-\LL)$)% --% cycle;% - \end{scope}% + \end{pgfonlayer}%% \ifdynkin@arrows% \dynkinEdgeArrow[#2]{\the\@fromRoot}{\the\@toRoot}% \fi% @@ -1525,27 +1587,27 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% \StrChar{\dynkin@roots}{\the\@fromRoot}[\my@root@marker]% \IfStrEq{\my@root@marker}{x}% {% - \global\onesbit=1% + \global\onesbit=1\relax% }% {% - \global\onesbit=0% + \global\onesbit=0\relax% }% \StrChar{\dynkin@roots}{\the\@toRoot}[\my@root@marker]% \IfStrEq{\my@root@marker}{x}% {% - \global\twosbit=1% + \global\twosbit=1\relax% }% {% - \global\twosbit=0% + \global\twosbit=0\relax% }% \ifdynkin@Kac@arrows - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \ifdynkin@arrows% \ifdynkin@reverse@arrows \ifdynkin@is@backwards @@ -1570,9 +1632,9 @@ decoration= --% (\dynkin@root@name \the\@toRoot);% \fi% - \end{scope}% + \end{pgfonlayer}%% \else - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% --% @@ -1591,7 +1653,7 @@ decoration= ($(\dynkin@root@name \the\@fromRoot)$) -- ($(\dynkin@root@name \the\@toRoot)$);% - \end{scope}% + \end{pgfonlayer}%% \ifdynkin@arrows% \dynkinEdgeArrow[#2]{\the\@fromRoot}{\the\@toRoot}% \fi% @@ -1611,11 +1673,11 @@ decoration= \convertRootPair{#3}{#4}% }% {% - \@fromRoot=#3% - \@toRoot=#4% + \@fromRoot=#3\relax% + \@toRoot=#4\relax% }% \ifdynkin@Kac@arrows - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \ifdynkin@arrows% \ifdynkin@reverse@arrows \ifdynkin@is@backwards @@ -1640,9 +1702,9 @@ decoration= --% (\dynkin@root@name \the\@toRoot);% \fi% - \end{scope}% + \end{pgfonlayer}%% \else - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \draw[/Dynkin diagram,edge,#2]% ($(\dynkin@root@name \the\@fromRoot)+(0,\dynkin@root@radius)$)--% ($(\dynkin@root@name \the\@toRoot)+(0,\dynkin@root@radius)$)--% @@ -1655,7 +1717,7 @@ decoration= ($(\dynkin@root@name \the\@toRoot)+(0,-\dynkin@root@radius/3)$)--% ($(\dynkin@root@name \the\@fromRoot)+(0,-\dynkin@root@radius/3)$)--% cycle; - \end{scope}% + \end{pgfonlayer}%% \ifdynkin@arrows% \dynkinEdgeArrow[#2]{\the\@fromRoot}{\the\@toRoot}% \fi% @@ -1791,24 +1853,30 @@ decoration= \def\dynkin@arrow@color{} +\def\dynkin@horizontal@shift{0pt} +\def\dynkin@vertical@shift{.5ex} +% Shift applied to all Dynkin diagrams + \NewDocumentCommand\regurgitate{m}{#1} \pgfkeys{ /Dynkin diagram/.is family, /Dynkin diagram, affine mark/.estore in = \dynkin@affine@root@mark, + affinemark/.forward to = /Dynkin diagram/affine mark, affine-mark/.forward to = /Dynkin diagram/affine mark, affine-mark = o, arrow color/.estore in = \dynkin@arrow@color, arrow-color/.forward to=/Dynkin diagram/arrow color, + arrowcolor/.forward to=/Dynkin diagram/arrow color, arrows/.is if = dynkin@arrows, arrows = true, at/.estore in = \dynkin@current@location, + at/.default = {(0,0)}, backwards/.is if = dynkin@is@backwards, backwards = false, Coxeter/.is if = dynkin@Coxeter, Coxeter=false, - edge label/.style={text height=0,text depth=0,label distance=-4pt}, double edges/.style = { fold style/.style = { draw=black, @@ -1818,6 +1886,7 @@ decoration= line width=\defaultpgflinewidth} }, double-edges/.forward to=/Dynkin diagram/double edges/.style, + doubleedges/.forward to=/Dynkin diagram/double edges/.style, double fold/.style = { fold style/.style = { draw=black, @@ -1827,6 +1896,7 @@ decoration= line width=\defaultpgflinewidth} }, double-fold/.forward to=/Dynkin diagram/double fold/.style, + doublefold/.forward to=/Dynkin diagram/double fold/.style, double left/.style = { fold left style/.style = { draw=black, @@ -1836,6 +1906,7 @@ decoration= line width=\defaultpgflinewidth} }, double-left/.forward to=/Dynkin diagram/double left/.style, + doubleleft/.forward to=/Dynkin diagram/double left/.style, double fold left/.style = { fold left style/.style = { draw=black, @@ -1844,7 +1915,8 @@ decoration= double distance=\dynkin@root@radius, line width=\defaultpgflinewidth} }, - double-fold/.forward to=/Dynkin diagram/double fold/.style, + double-fold-left/.forward to=/Dynkin diagram/double fold left/.style, + doublefoldleft/.forward to=/Dynkin diagram/double fold left/.style, double right/.style = { fold right style/.style = { draw=black, @@ -1854,6 +1926,7 @@ decoration= line width=\defaultpgflinewidth} }, double-right/.forward to=/Dynkin diagram/double right/.style, + doubleright/.forward to=/Dynkin diagram/double right/.style, double fold right/.style = { fold right style/.style = { draw=black, @@ -1863,34 +1936,63 @@ decoration= line width=\defaultpgflinewidth} }, double-fold-right/.forward to=/Dynkin diagram/double fold right/.style, + doublefoldright/.forward to=/Dynkin diagram/double fold right/.style, + edge label/.style={text height=0,text depth=0,label distance=-4pt}, + edgelabel/.forward to=/Dynkin diagram/edge label/.style, edge length/.estore in = \dynkin@edge@length, edge-length/.forward to=/Dynkin diagram/edge length, + edgelength/.forward to=/Dynkin diagram/edge length, edge length = .35cm, edge/.style={solid,draw=black,fill=white,thin}, extended/.is if = dynkin@is@extended, extended = false, fold left/.is if = dynkin@left@fold, + fold-left/.forward to = /Dynkin diagram/fold left, + foldleft/.forward to = /Dynkin diagram/fold left, + fold left/.default = false, ply/.estore in = \dynkin@ply@value, ply/.default = 1, fold/.style={/Dynkin diagram/ply=2,fold style}, - fold style/.style = {/Dynkin diagram/ply=2,solid,draw=black!40,fill=none,line width=\dynkin@root@radius,{Triangle Cap[]}-{Triangle Cap[]}}, + fold style/.style = { + /Dynkin diagram/ply=2, + solid, + draw=black!40, + fill=none, + line width=\dynkin@root@radius, + {Triangle Cap[]}-{Triangle Cap[]} + }, fold-style/.forward to=/Dynkin diagram/fold style/.style, + foldstyle/.forward to=/Dynkin diagram/fold style/.style, fold left style/.style = {}, fold-left-style/.forward to=/Dynkin diagram/fold left style/.style, + foldleftstyle/.forward to=/Dynkin diagram/fold left style/.style, fold radius/.estore in = \dynkin@fold@radius, fold-radius/.forward to=/Dynkin diagram/fold radius, + foldradius/.forward to=/Dynkin diagram/fold radius, fold radius=.3cm, fold right/.is if = dynkin@right@fold, + fold-right/.forward to = fold right, + foldright/.forward to = fold right, + fold right/.default = false, fold right style/.style = {}, fold-right-style/.forward to=/Dynkin diagram/fold right style/.style, + foldrightstyle/.forward to=/Dynkin diagram/fold right style/.style, gonality/.estore in = \dynkin@gonality, + gonality/.default = 0, + horizontal shift/.estore in=\dynkin@horizontal@shift, + horizontal shift/.default=0pt, + horizontal-shift/.forward to=/Dynkin diagram/horizontal shift, + horizontalshift/.forward to=/Dynkin diagram/horizontal shift, indefinite edge ratio/.estore in = \dynkin@indefinite@edge@ratio, indefinite-edge-ratio/.forward to = /Dynkin diagram/indefinite edge ratio, + indefiniteedgeratio/.forward to = /Dynkin diagram/indefinite edge ratio, indefinite edge ratio = 1.6, indefinite edge/.style={solid,draw=black,fill=white,thin,densely dotted}, indefinite-edge/.forward to=/Dynkin diagram/indefinite edge/.style, + indefiniteedge/.forward to=/Dynkin diagram/indefinite edge/.style, Kac arrows/.is if = dynkin@Kac@arrows, Kac-arrows/.forward to = /Dynkin diagram/Kac arrows, + Kacarrows/.forward to = /Dynkin diagram/Kac arrows, Kac arrows=false, Kac/.style={ Kac arrows=true, @@ -1909,20 +2011,25 @@ decoration= label depth/.default=g, label depth, label-depth/.forward to = /Dynkin diagram/label depth, + labeldepth/.forward to = /Dynkin diagram/label depth, label height/.style={/tikz/every label/.append style={text height={height("#1"}}}, label height/.default=b, label height, label-height/.forward to = /Dynkin diagram/label height, + labelheight/.forward to = /Dynkin diagram/label height, labels/.default = {}, labels*/.default = {}, label macro/.code = {\regurgitate{#1}}, label-macro/.forward to=/Dynkin diagram/label macro, + labelmacro/.forward to=/Dynkin diagram/label macro, label macro*/.code = {\regurgitate{#1}}, label-macro*/.forward to=/Dynkin diagram/label macro*, + labelmacro*/.forward to=/Dynkin diagram/label macro*, labels/.store in = \dynkin@label@list, labels*/.store in = \dynkin@label@list@star, make indefinite edge/.code={\dynkin@set@edge@indefinite@pair{#1}}, make-indefinite-edge/.forward to=/Dynkin diagram/make indefinite edge, + makeindefiniteedge/.forward to=/Dynkin diagram/make indefinite edge, mark/.estore in = \dynkin@root@mark, mark = *, name/.estore in = \dynkin@diagram@name, @@ -1932,23 +2039,43 @@ decoration= ordering/.store in = \dynkin@ordering, ordering = Bourbaki, parabolic/.estore in = \dynkin@parabolic, + parabolic/.default = 0, reverse arrows/.is if = dynkin@reverse@arrows, reverse arrows = false, reverse-arrows/.forward to = /Dynkin diagram/reverse arrows, + reversearrows/.forward to = /Dynkin diagram/reverse arrows, upside down/.is if = dynkin@is@upsidedown, upside down = false, upside-down/.forward to = /Dynkin diagram/upside down, + upsidedown/.forward to = /Dynkin diagram/upside down, root radius/.estore in = \dynkin@root@radius, root-radius/.forward to=/Dynkin diagram/root radius, + rootradius/.forward to=/Dynkin diagram/root radius, root radius=.05cm, text style/.style={#1}, text style/.default={scale=.7}, - text-style/.forward to=/Dynkin diagram/text style/.style, + text-style/.forward to=text style/.style, + textstyle/.forward to=text style/.style, twisted/.is if = dynkin@is@twisted, twisted/.default = false, twisted series/.estore in = \dynkin@twisted@series, twisted-series/.forward to = /Dynkin diagram/twisted series, + twistedseries/.forward to = /Dynkin diagram/twisted series, twisted series/.default = 0, + vertical shift/.estore in=\dynkin@vertical@shift, + vertical shift/.default=.5ex, + vertical-shift/.forward to=/Dynkin diagram/vertical shift, + verticalshift/.forward to=/Dynkin diagram/vertical shift, + x shift in edge lengths/.code=% + {% + \pgfmathsetlengthmacro\dynkin@horizontal@shift% + {(#1*\dynkin@edge@length)+\dynkin@horizontal@shift}% + },% + y shift in edge lengths/.code=% + {% + \pgfmathsetlengthmacro\dynkin@vertical@shift% + {(#1*\dynkin@edge@length)+\dynkin@vertical@shift}% + },% */.style = { solid, draw=black, @@ -2027,13 +2154,6 @@ decoration= fill=white, }, }, - at/.default = {(0,0)}, - parabolic/.default = 0, - gonality/.default = 0, - fold-left/.forward to = /Dynkin diagram/fold left, - fold left/.default = false, - fold-right/.forward to = /Dynkin diagram/fold right, - fold right/.default = false, .search also={/tikz}, } @@ -2046,13 +2166,13 @@ decoration= %% Assigns to \dynkin@label@directions or \dynkin@label@directions@star the direction that the label of root <r> (in default ordering) should sit from the root node location, <d>=0,1,2,3,4,5,6,7 to indicate direction in multiples of 45 degrees \NewDocumentCommand\dynkin@put@direction{smm}% {% - \drpo=\the\dynkin@nodes% - \advance\drpo by 1% - \dynkin@where=#2% + \drpo=\the\dynkin@nodes\relax% + \advance\drpo by 1\relax% + \dynkin@where=#2\relax% \IfBooleanTF{#1}% {% \StrMid{\dynkin@label@directions@star}{1}{\the\dynkin@where}[\dynkin@start]% - \advance\dynkin@where by 2 + \advance\dynkin@where by 2\relax% \StrMid{\dynkin@label@directions@star}{\the\dynkin@where}{\the\drpo}[\dynkin@end]% \IfStrEqCase{#3}{% {right}{\xdef\dynkin@label@directions@star{\dynkin@start 0\dynkin@end}}% @@ -2069,7 +2189,7 @@ decoration= }% {% \StrMid{\dynkin@label@directions}{1}{\the\dynkin@where}[\dynkin@start]% - \advance\dynkin@where by 2 + \advance\dynkin@where by 2\relax% \StrMid{\dynkin@label@directions}{\the\dynkin@where}{\the\drpo}[\dynkin@end]% \IfStrEqCase{#3}{% {right}{\xdef\dynkin@label@directions{\dynkin@start 0\dynkin@end}}% @@ -2123,8 +2243,8 @@ decoration= % writes the given number <n> of copies of the default root mark into the string \dynkin@string. \NewDocumentCommand\dynkin@integer@rank{}% {% - \global\dynkin@rank=\dynkin@string% - \global\dynkin@nodes=\dynkin@string% + \global\dynkin@rank=\dynkin@string\relax% + \global\dynkin@nodes=\dynkin@string\relax% \ifdynkin@is@twisted% \IfStrEqCase{\dynkin@series}% {% @@ -2133,7 +2253,7 @@ decoration= \divide\dynkin@nodes by 2% \ifodd\dynkin@rank% \global\dynkin@oddtrue% - \advance\dynkin@nodes by 1% + \advance\dynkin@nodes by 1\relax% \else% \global\dynkin@oddfalse% \fi% @@ -2144,13 +2264,13 @@ decoration= {% {2}% {% - \global\advance\dynkin@nodes by -1% + \global\advance\dynkin@nodes by -1\relax% }% {3}% {% \IfStrEq{\dynkin@string}{4}% {% - \global\dynkin@nodes=2% + \global\dynkin@nodes=2\relax% }% {% \dynkin@error@series% @@ -2165,7 +2285,7 @@ decoration= {% \IfStrEq{\dynkin@string}{6}% {% - \global\dynkin@nodes=4% + \global\dynkin@nodes=4\relax% }% {% \dynkin@error@series% @@ -2202,7 +2322,7 @@ decoration= \NewDocumentCommand\dynkin@set@edge@indefinite@pair{>{\SplitArgument{1}{-}}m}% {% -\dynkin@set@edge@indefinite#1 +\dynkin@set@edge@indefinite#1% }% \newif\ifdynkin@is@indefinite@edge @@ -2224,8 +2344,8 @@ decoration= \convertRootPair{#2}{#3}% }% {% - \@fromRoot=#2% - \@toRoot=#3% + \@fromRoot=#2\relax% + \@toRoot=#3\relax% }% % Next we sort the order, since edges are stored as undirected edges. \global\first=\@fromRoot\relax% @@ -2251,30 +2371,28 @@ decoration= % interprets it to say which edges are indefinite edges. \NewDocumentCommand\dynkin@grok@indefinite@edges{}% {% - \rootnum=1 + \rootnum=1\relax \StrLen{\dynkin@string}[\temp]% - \dynkin@string@length=\temp + \dynkin@string@length=\temp\relax% \foreach \i in {2,...,\the\dynkin@string@length}% {% \StrChar{\dynkin@string}{\i}[\c]% \IfStrEq{\c}{.}% {% - \rootnumpo=\rootnum% + \rootnumpo=\rootnum\relax% \advance\rootnumpo by 1\relax% \ifnum\the\rootnum<\the\dynkin@nodes% \dynkin@set@edge@indefinite{\rootnum}{\rootnumpo}% \fi% }% {% - \global\advance\rootnum by 1% + \global\advance\rootnum by 1\relax% }% }% }% \xdef\spacy{ } -\xdef\questionMarks{} - \NewDocumentCommand\dynkin@clear@label@directions{}% {% \xdef\dynkin@label@directions{}% @@ -2285,7 +2403,7 @@ decoration= \NewDocumentCommand\dynkin@set@default@label@directions{}% {% % \newcount\drpo% - \drpo=\the\dynkin@nodes% + \drpo=\the\dynkin@nodes\relax% \advance\drpo by 1\relax% \xdef\dynkin@label@directions{\repeatCharacter{\the\drpo}{?}}% \xdef\dynkin@label@directions@star{\repeatCharacter{\the\drpo}{?}}% @@ -2309,10 +2427,10 @@ decoration= \xdef\dynkin@parabolic{0}% \pgfkeys{/Dynkin diagram, #1}% \ifdynkin@is@backwards% - \tikzset{xscale=-1}% + \tikzset{xscale=-1}% \fi% \ifdynkin@is@upsidedown% - \tikzset{yscale=-1}% + \tikzset{yscale=-1}% \fi% \IfStrEq{\dynkin@label@list\dynkin@label@list@star}{}% {% @@ -2324,7 +2442,7 @@ decoration= \xdef\dynkin@twisted@series{#3}% \xdef\dynkin@user@string{#4}% \global\dynkin@ply=\dynkin@ply@value\relax% - \xdef\dynkin@indefinite@edge@length{(\dynkin@edge@length*\dynkin@indefinite@edge@ratio)}\relax% +\xdef\dynkin@indefinite@edge@length{(\dynkin@edge@length*\dynkin@indefinite@edge@ratio)}\relax% \xdef\dynkin@series{#2}% \IfStrEq{\dynkin@diagram@name}{anonymous}% {% @@ -2335,7 +2453,7 @@ decoration= }% \dynkin@grok@series% \IfSubStr{ABCDEFGHI}{\dynkin@series}{}{\dynkin@error@series}% - \xdef\dynkin@string{#4} + \xdef\dynkin@string{#4}% \IfInteger{\dynkin@string}% {% \dynkin@integer@rank% @@ -2344,6 +2462,7 @@ decoration= % Turn Satake codes into Dynkin diagram expressions in \dynkin@string. \dynkin@grok@Satake@codes% }% + % Expand out any digits in \dynkin@string into multiples of the various root marks. \expand@Dynkin@Roots@Digits% % Assign to \dynkin@roots the input string \dynkin@string with all . symbols removed, @@ -2357,9 +2476,19 @@ decoration= \dynkin@cross@out@parabolics{}% \dynkin@set@default@label@directions{}% \check@Dynkin@diagram{}% - \node[anchor=base,inner sep=0pt,outer sep=0pt] (origin) at \dynkin@current@location {}; -% \node (Dynkin current) at (origin) {};% - \node (Dynkin current) at ($(origin)+(0,0.5ex)$){}; + \ifdefined\initialize@roots@as@sums@table% + \initialize@roots@as@sums@table% + \fi% + \node[anchor=base,inner sep=0pt,outer sep=0pt] + (origin) + at + \dynkin@current@location + {};% + \node + (Dynkin current) + at + ($(origin)+(\dynkin@horizontal@shift,\dynkin@vertical@shift)$)% + {};% \ifdynkin@is@twisted% \csname twisted\dynkin@series dynkin\endcsname% \else% @@ -2375,7 +2504,7 @@ decoration= %% We know the number of nodes; lets find the rank. \NewDocumentCommand\dynkin@find@rank{}% {% - \global\dynkin@rank=\the\dynkin@nodes% + \global\dynkin@rank=\the\dynkin@nodes\relax% \ifdynkin@is@twisted% \IfStrEqCase{\dynkin@series}% {% @@ -2383,7 +2512,7 @@ decoration= {% \multiply\dynkin@rank by 2% \ifdynkin@odd% - \advance\dynkin@rank by -1% + \advance\dynkin@rank by -1\relax% \fi% }% {D}% @@ -2392,33 +2521,33 @@ decoration= {% {2} {% - \advance\dynkin@rank by 1% + \advance\dynkin@rank by 1\relax% }% {3} {% - \advance\dynkin@rank by 2% + \advance\dynkin@rank by 2\relax% }% }% }% {E}% {% - \advance\dynkin@rank by 2% + \advance\dynkin@rank by 2\relax% }% }% \fi% }% -\newcount\lenny +\newcount\dynkin@lenny %% \dynkin@grok@series %% Interprets the dynkin@series, to see if it is extended, twisted, and what twisted series it is. \NewDocumentCommand\dynkin@grok@series{}% {% - \StrLen{\dynkin@series}[\lenny] - \ifnum\lenny>1% + \StrLen{\dynkin@series}[\dynkin@lenny] + \ifnum\dynkin@lenny>1% \dynkin@error@series% - \fi - \edef\series{\dynkin@series} + \fi% + \edef\series{\dynkin@series}% \IfStrEqCase{\dynkin@twisted@series}% {% {0}{}% @@ -2464,16 +2593,13 @@ decoration= \IfStrEqCase{\dynkin@string}% {% {even}{\gdef\dynkin@string{ddd.ddd}\global\dynkin@oddfalse\global\dynkin@Satake@diagramfalse}% -% {even}{\gdef\dynkin@string{***.***}\global\dynkin@oddfalse\global\dynkin@Satake@diagramfalse}% {odd}{\gdef\dynkin@string{dddd.ddd}\global\dynkin@oddtrue\global\dynkin@Satake@diagramfalse}% -% {odd}{\gdef\dynkin@string{****.***}\global\dynkin@oddtrue\global\dynkin@Satake@diagramfalse}% {}{\gdef\dynkin@string{dd.dd}\global\dynkin@Satake@diagramfalse}% -% {}{\gdef\dynkin@string{**.**}\global\dynkin@Satake@diagramfalse}% {I}{ \gdef\dynkin@string{oo.oo}}% {II}{\gdef\dynkin@string{*o*.o*}}% - {IIIa}{\global\dynkin@ply=2\gdef\dynkin@string{oo.o**.**o.oo}}% - {IIIb}{\global\dynkin@ply=2\gdef\dynkin@string{oo.ooo.oo}}% - {IV} {\global\dynkin@ply=2\gdef\dynkin@string{o*.*o}}% + {IIIa}{\global\dynkin@ply=2\relax\gdef\dynkin@string{oo.o**.**o.oo}}% + {IIIb}{\global\dynkin@ply=2\relax\gdef\dynkin@string{oo.ooo.oo}}% + {IV} {\global\dynkin@ply=2\relax\gdef\dynkin@string{o*.*o}}% }% [\global\dynkin@Satake@diagramfalse]% }% @@ -2525,33 +2651,28 @@ decoration= \ifdynkin@is@extended% \ifnum\dynkin@ply=4% \gdef\dynkin@string{dddd.d.ddddd} -% \gdef\dynkin@string{****.*.*****} \else% \gdef\dynkin@string{ddd.dddd}% -% \gdef\dynkin@string{***.****}% \fi% \else% \ifdynkin@is@twisted% \IfStrEqCase{\dynkin@twisted@series}% {% {2}{ \gdef\dynkin@string{dd.ddd}}% -% {2}{ \gdef\dynkin@string{**.***}}% {3}{\gdef\dynkin@string{ddd}}% -% {3}{\gdef\dynkin@string{***}}% }% [\dynkin@error@series]% \else% \gdef\dynkin@string{dd.dddd}% -% \gdef\dynkin@string{**.****}% \fi% \fi% }% {Ia}{\gdef\dynkin@string{oo.o*.***}}% - {Ib}{\global\dynkin@ply=2\gdef\dynkin@string{o.ooo}}% + {Ib}{\global\dynkin@ply=2\relax\gdef\dynkin@string{o.ooo}}% {Ic}{\gdef\dynkin@string{o.ooo}}% {II} {\gdef\dynkin@string{o*.***}}% {IIIa}{\gdef\dynkin@string{*o*.o*o}}% - {IIIb}{\global\dynkin@ply=2\gdef\dynkin@string{*o*.o*oo}}% + {IIIb}{\global\dynkin@ply=2\relax\gdef\dynkin@string{*o*.o*oo}}% }% [\global\dynkin@Satake@diagramfalse]% }% @@ -2565,15 +2686,14 @@ decoration= \IfStrEq{\dynkin@twisted@series}{2}% {% \gdef\dynkin@string{ddddd}% -% \gdef\dynkin@string{*****}% }% {% \dynkin@error@series% }% }% - {I}{ \global\dynkin@rank=6\gdef\dynkin@string{oooooo}}% - {II} {\global\dynkin@ply=2\gdef\dynkin@string{oooooo}}% - {III}{\global\dynkin@ply=2\gdef\dynkin@string{oo***o}}% + {I}{ \global\dynkin@rank=6\relax\gdef\dynkin@string{oooooo}}% + {II} {\global\dynkin@ply=2\relax\gdef\dynkin@string{oooooo}}% + {III}{\global\dynkin@ply=2\relax\gdef\dynkin@string{oo***o}}% {IV} {\gdef\dynkin@string{o****o}}% {V}{ \gdef\dynkin@string{ooooooo}}% {VI} {\gdef\dynkin@string{o*oo*o*} }% @@ -2585,7 +2705,7 @@ decoration= }% {F}% {% - \global\dynkin@rank=4% + \global\dynkin@rank=4\relax% \IfStrEqCase{\dynkin@string}% {% {I}{ \gdef\dynkin@string{oooo}}% @@ -2682,7 +2802,7 @@ decoration= \foreach \i in {1,...,\the\dynkin@nodes}% {% \StrChar{\dynkin@roots}{\i}[\cccc]% - \IfSubStr{*OXotx}{\cccc}% + \IfSubStr{*OXotx}{\cccc}% {% }% {%else @@ -2695,13 +2815,10 @@ decoration= }% }% -%% \check@Dynkin@diagram -%% Raises error messages for erroneous inputs. -\NewDocumentCommand\check@Dynkin@diagram{}% +%% \check@Dynkin@root@order +\NewDocumentCommand\check@Dynkin@root@order{m}% {% - \IfSubStr{1234}{\the\dynkin@ply}{}{\dynkin@error@ply}% - \check@Dynkin@Roots% - \IfStrEqCase{\dynkin@ordering}% + \IfStrEqCase{#1}% {% {Adams}{}% {Bourbaki}{}% @@ -2712,9 +2829,17 @@ decoration= }% [\ClassError% {Dynkin diagrams}% - {Unrecognized label ordering: ``\dynkin@ordering'' - in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}% + {Unrecognized label ordering: ``#1'' }% {}]% +}% + +%% \check@Dynkin@diagram +%% Raises error messages for erroneous inputs. +\NewDocumentCommand\check@Dynkin@diagram{}% +{% + \IfSubStr{1234}{\the\dynkin@ply}{}{\dynkin@error@ply}% + \check@Dynkin@Roots% + \check@Dynkin@root@order{\dynkin@ordering}% \IfStrEqCase{\dynkin@series}% {% {A}{}% @@ -2741,7 +2866,7 @@ decoration= \else% \ifnum\dynkin@rank=8% \else% - \dynkin@error@rank% + \IfStrEq{\dynkin@ordering}{Kac}{}{\dynkin@error@rank}% \fi% \fi% \fi% @@ -2775,6 +2900,7 @@ decoration= \newcount\RootNumber \newcount\@fromRoot \newcount\@toRoot +\newcount\drmo %% \swapRootIfInLastTwoRoots{<r>} %% If the input root <r> is one of the last two roots, then put the other in \RootNumber, otherwise @@ -2782,7 +2908,6 @@ decoration= \NewDocumentCommand\swapRootIfInLastTwoRoots{m}% {% \ifnum\dynkin@rank>1% - \newcount\drmo\relax% \drmo=\dynkin@rank\relax% \advance\drmo by -1\relax% \ifnum\dynkin@rank=#1% @@ -2799,13 +2924,291 @@ decoration= \fi% }% + +\newcount\dynkin@r +\NewDocumentCommand\swap@if@in@last@two{mm}% +{% + \global\dynkin@r=#2\relax% + \ifnum\dynkin@r=#1% + \global\advance \dynkin@r by -1\relax% + \else% + \global\advance \dynkin@r by 1\relax% + \ifnum\dynkin@r=#1% + \else% + \global\advance \dynkin@r by -1\relax% + \fi% + \fi% + \the\dynkin@r% +}% + +\newcount\dynkin@root@no + +\NewDocumentCommand\dynkinOrderToBourbaki{mmmmm}% +%% \dynkinOrderToBourbaki{series}{rank}{from order}{root}{counter to store result} +%% Stores the number of root in Bourbaki order which corresponds to +%% the root <number> in <from order>, for the series of simple Lie algebra +%% <series>, rank <rank>. +%% Example: \dynkinOrderToBourbaki{E}{8}{Carter}{7} +%% yields 3, because the 7th root in E8 according to Carter's ordering is the +%% 3rd in Bourbaki's. +{% +% \check@Dynkin@root@order{#3}% + \IfStrEq{#4}{0}% + {% + % The affine root is often labelled as root 0, and it is the same in all orderings. + \global#5=0% + }% + {% + \IfStrEqCase{#1}% + {% + {A}% + {% + \global#5=#4\relax% + }% + {D}% + {% + \IfStrEqCase{#3}% + {% + {Adams}{% + \global#5=% + \swap@if@in@last@two{#2}{#4}% + \relax% + }% + {Dynkin}{% + \global#5=% + \swap@if@in@last@two{#2}{#4}% + \relax% + }% + {Kac}{% + \global#5=% + \swap@if@in@last@two{#2}{#4}% + \relax% + }% + }% + [\global#5=#4\relax]% + }% + {E}% + {% + \ifnum#2=6% + \IfStrEqCase{#3}% + {% + {Adams}{\global#5=% + \stringCharacterInPosition{135426}{#4}% + \relax}% + {Carter}{\global#5=% + \stringCharacterInPosition{134256}{#4}% + \relax}% + {Dynkin}{\global#5=% + \stringCharacterInPosition{134562}{#4}% + \relax}% + {Kac}{\global#5=% + \stringCharacterInPosition{134562}{#4}% + \relax}% + }% + [\global#5=#4\relax]% + \else% + \ifnum#2=7% + \IfStrEqCase{#3}% + {% + {Adams}{\global#5=% + \stringCharacterInPosition{6524317}{#4}% + \relax}% + {Carter}{\global#5=% + \stringCharacterInPosition{7654231}{#4}% + \relax}% + {Dynkin}{\global#5=% + \stringCharacterInPosition{1345672}{#4}% + \relax}% + {Kac}{\global#5=% + \stringCharacterInPosition{1245672}{#4}% + \relax}% + }% + [\global#5=#4\relax]% + \else% + \ifnum#2=8% + \IfStrEqCase{#3}% + {% + {Adams}{\global#5=% + \stringCharacterInPosition{13245678}{#4}% + \relax}% + {Carter}{\global#5=% + \stringCharacterInPosition{87654231}{#4}% + \relax}% + {Dynkin}{\global#5=% + \stringCharacterInPosition{13456782}{#4}% + \relax}% + {Kac}{\global#5=% + \stringCharacterInPosition{87654312}{#4}% + \relax}% + }% + [\global#5=#4\relax]% + \else% + \global#5=#4\relax% + \fi% + \fi% + \fi% + }% + {F}% + {% + \IfStrEqCase{#3}% + {% + {Adams}{\global#5=% + \stringCharacterInPosition{4321}{#4}% + \relax}% + }% + [\global#5=#4\relax]% + }% + {G}% + {% + \IfStrEqCase{#3}% + {% + {Carter}{\global#5=% + \stringCharacterInPosition{21}{#4}% + \relax}% + {Dynkin}{\global#5=% + \stringCharacterInPosition{21}{#4}% + \relax}% + }% + [\global#5=#4\relax]% + }% + }% + [\global#5=#4\relax]% + }% +}% + + +\NewDocumentCommand\dynkinOrderFromBourbaki{mmmmm}% +%% \dynkinOrderFromBourbaki{series}{rank}{root}{to order}{count to store result} +%% Stores the number of root in <from order> which corresponds to +%% the root <number> in Bourbaki ordering, for the series of simple Lie algebra +%% <series>, rank <rank>. +%% Example: \dynkinOrderFromBourbaki{E}{8}{7}{Carter} +%% yields 2, because the 7th root in E8 according to Bourbaki's ordering is the +%% 2nd in Carter's. +{% +% \check@Dynkin@root@order{#4}% + \IfStrEq{#3}{0}% + {% + % The affine root is often labelled as root 0, and it is the same in all orderings. + \global#5=0\relax% + }% + {% + \IfStrEqCase{#1}% + {% + {A}% + {% + \global#5=#3\relax% + }% + {D}% + {% + \IfStrEqCase{#4}% + {% + {Adams}{% + \global#5=% + \swap@if@in@last@two{#2}{#3}% + \relax% + }% + {Dynkin}{% + \global#5=% + \swap@if@in@last@two{#2}{#3}% + \relax% + }% + {Kac}{% + \global#5=% + \swap@if@in@last@two{#2}{#3}% + \relax% + }% + }% + [\global#5=#3\relax]% + }% + {E}% + {% + \ifnum#2=6% + \IfStrEqCase{#4}% + {% + {Adams}{\global#5=\stringCharacterInPosition{152436}{#3}\relax}% + {Carter}{\global#5=\stringCharacterInPosition{142356}{#3}\relax}% + {Dynkin}{\global#5=\stringCharacterInPosition{162345}{#3}\relax}% + {Kac}{\global#5=\stringCharacterInPosition{162345}{#3}\relax}% + }% + [\global#5=#3\relax]% + \else% + \ifnum#2=7% + \IfStrEqCase{#4}% + {% + {Adams}{\global#5=\stringCharacterInPosition{6354217}{#3}\relax}% + {Carter}{\global#5=\stringCharacterInPosition{7564321}{#3}\relax}% + {Dynkin}{\global#5=\stringCharacterInPosition{1723456}{#3}\relax}% + {Kac}{\global#5=\stringCharacterInPosition{1723456}{#3}\relax}% + }% + [\global#5=#3\relax]% + \else% + \ifnum#2=8% + \IfStrEqCase{#4}% + {% + {Adams}{\global#5=\stringCharacterInPosition{13245678}{#3}\relax}% + {Carter}{\global#5=\stringCharacterInPosition{86754321}{#3}\relax}% + {Dynkin}{\global#5=\stringCharacterInPosition{18234567}{#3}\relax}% + {Kac}{\global#5=\stringCharacterInPosition{78654321}{#3}\relax}% + }% + [\global#5=#3\relax]% + \else% + \global#5=#3\relax% + \fi% + \fi% + \fi% + %\fi% + }% + {F}% + {% + \IfStrEqCase{#4}% + {% + {Adams}{\global#5=\stringCharacterInPosition{4321}{#3}\relax}% + }% + [\global#5=#3\relax]% + }% + {G}% + {% + \IfStrEqCase{#4}% + {% + {Carter}{\global#5=\stringCharacterInPosition{21}{#3}\relax}% + {Dynkin}{\global#5=\stringCharacterInPosition{21}{#3}\relax}% + }% + [\global#5=#3\relax]% + }% + }% + [\global#5=#3\relax]% + }% +}% + +\newcount\dynkin@order@temp +\newcount\dynkin@order@temp@b + +\NewDocumentCommand\dynkinOrder{mmD.:{Bourbaki}r:-D>.{Bourbaki}m}% +%% \dynkinOrder <series><rank>.<from order>::<from root number>-><to order>.<storage counter> +%% Example: \newcount\r\dynkinOrder D7.Carter::7->Bourbaki.{\r} +{% + \dynkinOrderToBourbaki{#1}{#2}{#3}{#4}{\dynkin@order@temp}% + \dynkinOrderFromBourbaki{#1}{#2}{\the\dynkin@order@temp}{#5}{#6}% +}% + + +%% \typeDynkinOrder <series><rank>.<from order>::<from root number>-><to order>. +%% Example: \typeDynkinOrder D7.Carter::7->Bourbaki. +\newcount\tempDynkinReorder +\NewDocumentCommand\typeDynkinOrder{mmD.:{Bourbaki}r:-D>.{Bourbaki}}% +{% +\dynkinOrder{#1}{#2}.#3::#4->#5.{\tempDynkinReorder}\the\tempDynkinReorder% +}% + + %% \convertRootNumber{<n>} %% Converts <n> from Bourbaki ordering to the current ordering, storing the result in a count called \RootNumber. \NewDocumentCommand\convertRootNumber{m}% {% \IfStrEq{#1}{0}% {% - \global\RootNumber=0% + \global\RootNumber=0\relax% }% {% \IfStrEqCase{\dynkin@series}% @@ -2816,14 +3219,14 @@ decoration= {% {TestOrder}% {% - \global\RootNumber=#1 - \global\advance\RootNumber by 1 + \global\RootNumber=#1\relax% + \global\advance\RootNumber by 1\relax% \ifnum\RootNumber>\the\dynkin@rank% - \global\RootNumber=1% + \global\RootNumber=1\relax% \fi% }% }% - [\global\RootNumber=#1]% + [\global\RootNumber=#1\relax]% }% {D}% {% @@ -2833,52 +3236,53 @@ decoration= {Dynkin}{\swapRootIfInLastTwoRoots{#1}}% {Kac}{% \ifdynkin@is@twisted - \global\RootNumber=#1 + \global\RootNumber=#1\relax% \else \ifdynkin@is@extended - \global\RootNumber=#1 + \global\RootNumber=#1\relax% \else \swapRootIfInLastTwoRoots{#1} \fi \fi}% }% - [\global\RootNumber=#1]% + [\global\RootNumber=#1\relax]% }% {E}% {% \ifdynkin@is@twisted% - \global\RootNumber=#1% + \global\RootNumber=#1\relax% \else% \ifnum\dynkin@rank=6% \IfStrEqCase{\dynkin@ordering}% {% - {Adams}{\global\RootNumber=\stringCharacterInPosition{152436}{#1}}% - {Carter}{\global\RootNumber=\stringCharacterInPosition{142356}{#1}}% - {Dynkin}{\global\RootNumber=\stringCharacterInPosition{162345}{#1}}% - {Kac}{\global\RootNumber=\stringCharacterInPosition{162345}{#1}}% + {Adams}{\global\RootNumber=\stringCharacterInPosition{152436}{#1}\relax}% + {Carter}{\global\RootNumber=\stringCharacterInPosition{142356}{#1}\relax}% + {Dynkin}{\global\RootNumber=\stringCharacterInPosition{162345}{#1}\relax}% + {Kac}{\global\RootNumber=\stringCharacterInPosition{162345}{#1}\relax}% }% - [\global\RootNumber=#1]% + [\global\RootNumber=#1\relax]% \else% \ifnum\dynkin@rank=7% \IfStrEqCase{\dynkin@ordering}% {% - {Adams}{\global\RootNumber=\stringCharacterInPosition{6354217}{#1}}% - {Carter}{\global\RootNumber=\stringCharacterInPosition{7564321}{#1}}% - {Dynkin}{\global\RootNumber=\stringCharacterInPosition{1723456}{#1}}% - {Kac}{\global\RootNumber=\stringCharacterInPosition{1723456}{#1}}% + {Adams}{\global\RootNumber=\stringCharacterInPosition{6354217}{#1}\relax}% + {Carter}{\global\RootNumber=\stringCharacterInPosition{7564321}{#1}\relax}% + {Dynkin}{\global\RootNumber=\stringCharacterInPosition{1723456}{#1}\relax}% + {Kac}{\global\RootNumber=\stringCharacterInPosition{1723456}{#1}\relax}% }% - [\global\RootNumber=#1]% + [\global\RootNumber=#1\relax]% \else% \ifnum\dynkin@rank=8% \IfStrEqCase{\dynkin@ordering}% {% - {Adams}{\global\RootNumber=\stringCharacterInPosition{13245678}{#1}}% - {Carter}{\global\RootNumber=\stringCharacterInPosition{86754321}{#1}}% - {Dynkin}{\global\RootNumber=\stringCharacterInPosition{18234567}{#1}}% - {Kac}{\global\RootNumber=\stringCharacterInPosition{78654321}{#1}}% + {Adams}{\global\RootNumber=\stringCharacterInPosition{13245678}{#1}\relax}% + {Carter}{\global\RootNumber=\stringCharacterInPosition{86754321}{#1}\relax}% + {Dynkin}{\global\RootNumber=\stringCharacterInPosition{18234567}{#1}\relax}% + {Kac}{\global\RootNumber=\stringCharacterInPosition{78654321}{#1}\relax}% }% - [\global\RootNumber=#1]% + [\global\RootNumber=#1\relax]% \else% + \global\RootNumber=#1\relax% \fi% \fi% \fi% @@ -2888,21 +3292,21 @@ decoration= {% \IfStrEqCase{\dynkin@ordering}% {% - {Adams}{\global\RootNumber=\stringCharacterInPosition{4321}{#1}}% + {Adams}{\global\RootNumber=\stringCharacterInPosition{4321}{#1}\relax}% }% - [\global\RootNumber=#1]% + [\global\RootNumber=#1\relax]% }% {G}% {% \IfStrEqCase{\dynkin@ordering}% {% - {Carter}{\global\RootNumber=\stringCharacterInPosition{21}{#1}}% - {Dynkin}{\global\RootNumber=\stringCharacterInPosition{21}{#1}}% + {Carter}{\global\RootNumber=\stringCharacterInPosition{21}{#1}\relax}% + {Dynkin}{\global\RootNumber=\stringCharacterInPosition{21}{#1}\relax}% }% - [\global\RootNumber=#1]% + [\global\RootNumber=#1\relax]% }% }% - [\global\RootNumber=#1]% + [\global\RootNumber=#1\relax]% }% }% @@ -2911,44 +3315,70 @@ decoration= \NewDocumentCommand\convertRootPair{mm} {% \convertRootNumber{#1}% - \global\@fromRoot=\RootNumber% + \global\@fromRoot=\RootNumber\relax% \convertRootNumber{#2}% - \global\@toRoot=\RootNumber% + \global\@toRoot=\RootNumber\relax% +}% +%% \testbit{<n>}{<b>} +%% If bit number <b> of <n> is 1 then set bittrue else set bitfalse +\newif\ifbit +\newcount\test@bit@a +\newcount\test@bit@b +\newif\iftest@bit@more +\NewDocumentCommand\testbit{mm}% +{% + \test@bit@a#1\relax% + \test@bit@b#2\relax% + \ifnum\test@bit@a=0% + \global\bitfalse% + \else% + \global\test@bit@moretrue% + \loop% + \ifnum\test@bit@b=0\relax% + \global\test@bit@morefalse% + \ifodd\test@bit@a\empty% + \global\bittrue% + \else% + \global\bitfalse% + \fi% + \else% + \divide\test@bit@a by 2\relax% + \advance\test@bit@b by -1\relax% + \fi% + \iftest@bit@more\repeat% + \fi% }% - -\ExplSyntaxOn -\NewDocumentCommand\moduloInt{mm}{\int_mod:nn{#1}{#2}} -\ExplSyntaxOff - -%% \testbit{<n>}{<b>}{<f>}{<g>} -%% If bit number <b> of <n> is 1 then expand <f> else expand <g>. -\NewDocumentCommand\testbit{mmmm}% +%% \replaceNthChar{<string>}{<N>}{<char>} +%% redefines the string <string>, a name of a macro returning a character string, +%% to be the same as its original output, but with character <N> replaced by <char>. +\newcount\replaceNthCounter +\newcount\replacementN +\xdef\replacementLeftString{} +\xdef\replacementRightString{} +\NewDocumentCommand\replaceNthChar{mmm}% {% - \newcount\x\relax% - \x=#1\relax% - \newcount\whichbit\relax% - \whichbit=#2\relax% - \ifnum\whichbit>0% - \foreach \i in {1,...,#2}% - {% - \global\divide \x by 2% - }% + \ifnum#2<1 + \else% + \StrLen{#1}[\thatreplaceNthCounter]% + \replaceNthCounter\thatreplaceNthCounter\relax% + \ifnum\replaceNthCounter<#2 + \else% + \replacementN#2\relax% + \advance\replacementN by -1\relax% + \StrLeft{#1}{\the\replacementN}[\replacementLeftString]% + \advance\replacementN by 1\relax% + \StrGobbleLeft{#1}{\the\replacementN}[\replacementRightString]% + \xdef#1{\replacementLeftString#3\replacementRightString}% + \fi% \fi% - \xdef\temp{\moduloInt{\the\x}{2}}% - \x=\temp\relax% - \ifnum\the\x=1 #3\else #4\fi% }% - +\newcount\dynkin@where% \NewDocumentCommand\dynkin@put@cross{m}% {% - \newcount\dynkin@where% - \dynkin@where=#1% - \StrMid{\dynkin@roots}{1}{#1}[\dynkin@start]% - \advance\dynkin@where by 1% - \StrMid{\dynkin@roots}{\the\dynkin@where}{\the\dynkin@nodes}[\dynkin@end]% - \xdef\dynkin@roots{\dynkin@start x\dynkin@end}% + \dynkin@where#1\relax% + \advance\dynkin@where by 1\relax% + \replaceNthChar{\dynkin@roots}{\the\dynkin@where}{x}% }% - \NewDocumentCommand\dynkin@cross@out@parabolics{}% {% \IfInteger{\dynkin@parabolic}% @@ -2957,17 +3387,18 @@ decoration= {% }% {% - \newcount\drmo\relax% \drmo=\the\dynkin@nodes\relax% \advance\drmo by -1\relax% \foreach \b in {0,...,\the\drmo}% {% - \testbit{\dynkin@parabolic}{\b}{\dynkin@put@cross{\b}}{}% + \testbit{\dynkin@parabolic}{\b}% + \ifbit\dynkin@put@cross{\b}\fi% }% }% }% + {% + }% }% - \NewDocumentCommand\dynkinMoveToRoot{sm}% {% \IfBooleanTF{#1}% @@ -2975,7 +3406,7 @@ decoration= \convertRootNumber{#2}% }% {% - \global\RootNumber=#2 + \global\RootNumber=#2\relax% }% \node (Dynkin current) at (\dynkin@root@name \the\RootNumber){};% }% @@ -2995,7 +3426,7 @@ decoration= \convertRootNumber{#2}% }% {% - \global\RootNumber=#2 + \global\RootNumber=#2\relax% }% \node (\dynkin@root@name \the\RootNumber) at (Dynkin current) {};% \dynkin@put@direction{\the\RootNumber}{#3}% @@ -3026,8 +3457,8 @@ decoration= \convertRootPair{#3}{#2}% }% {% - \global\@fromRoot=#3% - \global\@toRoot=#2% + \global\@fromRoot=#3\relax% + \global\@toRoot=#2\relax% }% \dynkin@is@edge@indefinite{\@fromRoot}{\@toRoot}% \ifdynkin@is@indefinite@edge% @@ -3089,7 +3520,6 @@ decoration= \xdef\yjj{#1*\dynkin@edge@length*sin(60)}% \node (Dynkin current) at ($(Dynkin current)+(0,{\yjj})$){};% }% - %% \dynkinEast %% Moves the TikZ cursor one edge to the right. %% Starred form for an indefinite edge. @@ -3098,93 +3528,82 @@ decoration= \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}} \node (Dynkin current) at ($(Dynkin current)+({\distance},0)$) {};% }% - %% \dynkinWest %% Moves the TikZ cursor one edge to the left. %% Starred form for an indefinite edge. \NewDocumentCommand\dynkinWest{s}% {% - \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}} + \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}% \node (Dynkin current) at ($(Dynkin current)+({-\distance},0)$) {};% }% - %% \dynkinNorth %% Moves the TikZ cursor one edge up. %% Starred form for an indefinite edge. \NewDocumentCommand\dynkinNorth{s}% {% - \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}} + \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}% \node (Dynkin current) at ($(Dynkin current)+(0,{\distance})$) {};% }% - %% \dynkinSouth %% Moves the TikZ cursor one edge to the left. %% Starred form for an indefinite edge. \NewDocumentCommand\dynkinSouth{s}% {% - \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}} + \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}% \node (Dynkin current) at ($(Dynkin current)+(0,{-\distance})$) {};% }% - %% \dynkinNorthEast %% Moves the TikZ cursor one edge to the north east. %% Starred form for an indefinite edge. \NewDocumentCommand\dynkinNorthEast{s}% {% - \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}} + \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}% \node (Dynkin current) at ($(Dynkin current)+ ({cos(60)*\distance},{sin(60)*\distance})$) {};% }% - %% \dynkinSouthEast %% Moves the TikZ cursor one edge to the south east. %% Starred form for an indefinite edge. \NewDocumentCommand\dynkinSouthEast{s}% {% - \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}} + \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}% \node (Dynkin current) at ($(Dynkin current)+ ({cos(-60)*\distance},{sin(-60)*\distance})$) {};% }% - %% \dynkinNorthWest %% Moves the TikZ cursor one edge to the north west. %% Starred form for an indefinite edge. \NewDocumentCommand\dynkinNorthWest{s}% {% - \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}} + \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}% \node (Dynkin current) at ($(Dynkin current)+ ({cos(120)*\distance},{sin(120)*\distance})$) {};% }% - %% \dynkinSouthWest %% Moves the TikZ cursor one edge to the south west. %% Starred form for an indefinite edge. \NewDocumentCommand\dynkinSouthWest{s}% {% - \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}} + \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}% \node (Dynkin current) at ($(Dynkin current)+ ({cos(240)*\distance},{sin(240)*\distance})$) {};% }% - - %% \dynkinSouthEastFold %% Moves the TikZ cursor one edge to the south east in the middle of a fold. \NewDocumentCommand\dynkinSouthEastFold{}% {% \node (Dynkin current) at ($(Dynkin current)+({\dynkin@fold@radius},{-\dynkin@fold@radius})$) {};% }% - %% \dynkinSouthWestFold %% Moves the TikZ cursor one edge to the south west in the middle of a fold. \NewDocumentCommand\dynkinSouthWestFold{}% {% \node (Dynkin current) at ($(Dynkin current)+({-\dynkin@fold@radius},{-\dynkin@fold@radius})$) {};% }% - %% \dynkinSouthFold %% Moves the TikZ cursor one edge to the south in the middle of a fold. \NewDocumentCommand\dynkinSouthFold{}% @@ -3197,7 +3616,6 @@ decoration= \StrChar{\dynkin@roots}{#1}[\my@root@marker]% \my@root@marker }% - \NewDocumentCommand\dynkin@draw@all@roots{}% {% \foreach \b in {1,...,\the\dynkin@nodes}% @@ -3213,7 +3631,6 @@ decoration= \fi% \fi% }% - %% \dynkin@fold@arrow@if@oo{<p>}{<q>} %% Inputs are roots (in Bourbaki ordering). %% If we are working on a Satake diagram, and both roots are @@ -3236,77 +3653,72 @@ decoration= \dynkinFold{\the\@fromRoot}{\the\@toRoot}% \fi% }% - \newcount\pipebmo \newcount\pipefpo \newcount\pipe@end \newcount\start@pipe - - %% \dynkin@pipe{<f>}{<t>}{<D>}{<L>}{<L*>} %% Layout the roots (as TikZ nodes) <f>, <f>+1, \dots, <t> in the Bourbaki ordering, in a straight line, %% starting at the current position (Dynkin current), moving in the direction <D>=east, west, north, south, with labels placed according to <L>=left,right,above,below. %% Assumes that the root <f> is already created as a node in TikZ, but the others are not. \NewDocumentCommand\dynkin@pipe{mmmmm}% {% - \start@pipe=#1 - \pipe@end=#2 + \start@pipe=#1\relax% + \pipe@end=#2\relax% \ifnum\start@pipe<\the\pipe@end% - \global\pipebmo=\the\start@pipe - \global\pipefpo=\the\start@pipe - \global\advance\pipefpo by 1 + \global\pipebmo=\the\start@pipe\relax% + \global\pipefpo=\the\start@pipe\relax% + \global\advance\pipefpo by 1\relax% \foreach \bpipe in {\the\pipefpo,...,\the\pipe@end}% {% \dynkinPlaceRootRelativeTo*{\bpipe}{\the\pipebmo}{#3}{#4}{#5}% \dynkinEdge*{SingleEdge}{\bpipe}{\the\pipebmo}% - \global\advance\pipebmo by 1% + \global\advance\pipebmo by 1\relax% }% \fi% }% - +\newcount\dynkin@h% +\newcount\dynkin@hpo% +\newcount\dynkin@afterfold% +\newcount\dynkin@nrts% +\newcount\dynkin@countdown% %% \dynkin@fold{<f>}{<t>} %% Layout the roots (as TikZ nodes) <f>, <f>+1, \dots, <t> in the Bourbaki ordering, in a folded arrangement, %% moving first east, then down, then west, starting at the current position (Dynkin current). %% Assumes that the root <f> is already created as a node in TikZ, but the others are not. \NewDocumentCommand\dynkin@fold{mm}% {% - \newcount\h% - \h=#1% - \advance\h by #2% - \advance\h by -1% - \divide\h by 2% - \dynkin@pipe{#1}{\the\h}{east}{above}{below right} - \newcount\hpo - \hpo=\the\h - \advance\hpo by 1 - \newcount\afterfold - \global\afterfold=\the\hpo - \newcount\nrts - \nrts=#2 - \advance\nrts by 1 - \advance\nrts by -#1 - \ifodd\nrts% - \global\advance\afterfold by 1 - \dynkinPlaceRootRelativeTo*{\the\hpo}{\the\h}{southeastfold}{right}{left} - \dynkinEdge*{RightDownArc}{\the\h}{\the\hpo}% - \dynkinPlaceRootRelativeTo*{\the\afterfold}{\the\hpo}{southwestfold}{below}{above right} - \dynkinEdge*{RightUpArc}{\the\afterfold}{\the\hpo}% + \dynkin@h=#1\relax% + \advance\dynkin@h by #2\relax% + \advance\dynkin@h by -1\relax% + \divide\dynkin@h by 2\relax% + \dynkin@pipe{#1}{\the\dynkin@h}{east}{above}{below right} + \dynkin@hpo=\the\dynkin@h\relax% + \advance\dynkin@hpo by 1\relax% + \global\dynkin@afterfold=\the\dynkin@hpo\relax% + \dynkin@nrts=#2\relax% + \advance\dynkin@nrts by 1\relax% + \advance\dynkin@nrts by -#1\relax% + \ifodd\dynkin@nrts% + \global\advance\dynkin@afterfold by 1\relax% + \dynkinPlaceRootRelativeTo*{\the\dynkin@hpo}{\the\dynkin@h}{southeastfold}{right}{left}% + \dynkinEdge*{RightDownArc}{\the\dynkin@h}{\the\dynkin@hpo}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@afterfold}{\the\dynkin@hpo}{southwestfold}{below}{above right}% + \dynkinEdge*{RightUpArc}{\the\dynkin@afterfold}{\the\dynkin@hpo}% \else - \dynkinPlaceRootRelativeTo*{\the\afterfold}{\the\h}{southfold}{below}{above right} - \dynkinEdge*{SemiCircle}{\the\h}{\the\afterfold}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@afterfold}{\the\dynkin@h}{southfold}{below}{above right}% + \dynkinEdge*{SemiCircle}{\the\dynkin@h}{\the\dynkin@afterfold}% \fi - \dynkin@pipe{\the\afterfold}{#2}{west}{below}{above right} + \dynkin@pipe{\the\dynkin@afterfold}{#2}{west}{below}{above right} \ifdynkin@arrows% - \newcount\countdown% - \countdown=#2% - \foreach \b in {#1,...,\the\h}% + \dynkin@countdown=#2\relax% + \foreach \dynkin@b in {#1,...,\the\dynkin@h}% {% - \dynkin@fold@arrow@if@oo{\b}{\the\countdown}% - \global\advance\countdown by -1% + \dynkin@fold@arrow@if@oo{\dynkin@b}{\the\dynkin@countdown}% + \global\advance\dynkin@countdown by -1\relax% }% \fi% }% - %% \Adynkin %% Draws an A series Dynkin diagram. \NewDocumentCommand\Adynkin{}% @@ -3328,8 +3740,6 @@ decoration= \fi% \fi% }% - - %% \Bdynkin %% Draw a B series Dynkin diagram. \NewDocumentCommand\Bdynkin{}% @@ -3337,11 +3747,11 @@ decoration= \ifnum\dynkin@rank<2 \Adynkin \else - \newcount\drmo - \drmo=\the\dynkin@rank - \advance\drmo by -1 - \ifdynkin@Coxeter - \Adynkin + \newcount\drmo% + \drmo=\the\dynkin@rank\relax% + \advance\drmo by -1\relax% + \ifdynkin@Coxeter% + \Adynkin% \dynkinEdgeLabel{\the\drmo}{\the\dynkin@rank}{4}% \else % Create the roots. @@ -3383,7 +3793,6 @@ decoration= \fi% \fi% } - %% \Cdynkin %% Draws a C series Dynkin diagram. \newcommand*{\Cdynkin} @@ -3400,7 +3809,6 @@ decoration= \global\dynkin@reverse@arrowstrue% \fi% } - %% \Ddynkin@roots %% Tell TikZ where to place the @roots for a D series Dynkin diagram. Draws nothing. \newcommand*{\Ddynkin@roots} @@ -3452,16 +3860,16 @@ decoration= \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}{above}% \fi% \fi - \newcount\rmo - \rmo=\dynkin@rank - \advance \rmo by -1 - \newcount\rmt - \rmt=\rmo - \advance\rmt by -1 - \newcount\rmth - \rmth=\rmt - \advance\rmth by -1 - \ifnum\dynkin@rank>2 + \newcount\rmo% + \rmo=\dynkin@rank\relax% + \advance \rmo by -1\relax% + \newcount\rmt% + \rmt=\rmo\relax% + \advance\rmt by -1\relax% + \newcount\rmth% + \rmth=\rmt\relax% + \advance\rmth by -1\relax% + \ifnum\dynkin@rank>2% \ifnum\dynkin@rank>5% \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}{above}% \else% @@ -3508,21 +3916,20 @@ decoration= \fi% \fi% }% - %% \Ddynkin@edges %% Draws edges on a D series Dynkin diagram. \NewDocumentCommand\Ddynkin@edges{}% {% % Draw the edges. - \newcount\rmo - \rmo=\dynkin@rank - \advance \rmo by -1 - \newcount\rmt - \rmt=\rmo - \advance\rmt by -1 - \newcount\rmtr - \rmtr=\rmt - \advance\rmtr by -1 + \newcount\rmo% + \rmo=\dynkin@rank\relax% + \advance \rmo by -1\relax% + \newcount\rmt% + \rmt=\rmo\relax% + \advance\rmt by -1\relax% + \newcount\rmtr% + \rmtr=\rmt\relax% + \advance\rmtr by -1\relax% \ifnum\dynkin@ply>1% \ifdynkin@is@extended% \dynkinEdge*{RightUpArc}{1}{2}% @@ -3569,13 +3976,11 @@ decoration= \fi% \fi% }% - \def\centerarc[#1](#2)(#3:#4:#5);% %Syntax: [draw options] (center) (initial angle:final angle:radius) { \draw[#1]([shift=(#3:#5)]#2) arc (#3:#4:#5); } - %% \DthreePly %% Draws a D series Dynkin diagram of rank 4, folded over a G2. \NewDocumentCommand\DthreePly{}% @@ -3603,14 +4008,13 @@ decoration= \dynkinEdge*{SingleEdge}{1}{2}% \dynkinEdge*{SingleEdge}{2}{3}% \dynkinEdge*{SingleEdge}{2}{4}% - \begin{scope}[on background layer]% + \begin{pgfonlayer}{Dynkin behind}%% \centerarc[/Dynkin diagram/fold style](\dynkin@root@name 2)(-60:60:\dynkin@edge@length); \centerarc[/Dynkin diagram/fold style](\dynkin@root@name 2)(60:180:\dynkin@edge@length); \centerarc[/Dynkin diagram/fold style](\dynkin@root@name 2)(180:300:\dynkin@edge@length); - \end{scope}% + \end{pgfonlayer}%% \fi% }% - %% \Ddynkin %% Draws a D series Dynkin diagram. \NewDocumentCommand\Ddynkin{}% @@ -3641,31 +4045,28 @@ decoration= \gdef\dynkin@series{D}% \fi% }% - -%% \Edynkin@unfolded -%% Draws an E series Dynkin diagram not folded. -\newcommand*{\Edynkin@unfolded}% -{ +\newcommand*{\Edynkin@unfolded@rank@up@to@eight}% +{% % Create the @roots. \dynkinPlaceRootHere*{1}{below}{above}% \dynkinPlaceRootRelativeTo*{3}{1}{east}{below}{above}% \dynkinPlaceRootRelativeTo*{4}{3}{east}{below}{above right}% - \ifdynkin@is@extended - \ifnum\dynkin@rank=6 + \ifdynkin@is@extended% + \ifnum\dynkin@rank=6% \dynkinPlaceRootRelativeTo*{2}{4}{north}{right}{above right}% \else \dynkinPlaceRootRelativeTo*{2}{4}{north}{right}{above}% - \fi - \else + \fi% + \else% \dynkinPlaceRootRelativeTo*{2}{4}{north}{right}{above}% - \fi + \fi% \newcount\bmo\relax% \bmo=4\relax% \foreach \b in {5,...,\dynkin@rank}% {% \dynkinPlaceRootRelativeTo*{\b}{\the\bmo}{east}{below}{above}% \dynkinEdge*{SingleEdge}{\the\bmo}{\b}% - \global\advance\bmo by 1% + \global\advance\bmo by 1\relax% }% % % Draw the remaining edges. \dynkinEdge*{SingleEdge}{1}{3} @@ -3686,8 +4087,26 @@ decoration= \fi% \fi% }% - - +%% \Edynkin@unfolded +%% Draws an E series Dynkin diagram not folded. +\newcommand*{\Edynkin@unfolded}% +{ + \ifnum\dynkin@rank>8% + % We have to work in Kac ordering directly. + \dynkinPlaceRootHere*{1}{below}{above}% + \ifnum\dynkin@rank>1% + \newcount\drmo% + \drmo=\the\dynkin@rank\relax% + \advance\drmo by -1\relax% + \dynkin@pipe{1}{\the\drmo}{east}{below}{above}% + \advance\drmo by -2\relax% + \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\drmo}{north}{right}{above}% + \dynkinEdge*{SingleEdge}{\the\dynkin@rank}{\drmo} + \fi% + \else% + \Edynkin@unfolded@rank@up@to@eight% + \fi +}% %% \Edynkin@folded %% Draws a folded E6, affine E6 or affine E7 Dynkin diagram. \NewDocumentCommand\Edynkin@folded{}% @@ -3698,7 +4117,6 @@ decoration= \extendedESevenFolded% \fi% }% - \NewDocumentCommand\ESixTwoPly{}% {% \dynkin@jump{1}% @@ -3724,8 +4142,6 @@ decoration= \dynkin@fold@arrow@if@oo{3}{5}% \fi% }% - - \NewDocumentCommand\ESixThreePly{}% {% \dynkin@is@extendedtrue @@ -3754,7 +4170,6 @@ decoration= \dynkin@fold@arrow@if@oo{2}{5}% \fi% }% - \NewDocumentCommand\extendedESevenFolded{}% {% \dynkin@jump{1}% @@ -3779,14 +4194,12 @@ decoration= \dynkin@fold@arrow@if@oo{3}{5}% \fi% }% - - %% \Edynkin %% Draws an E6 Dynkin diagram. \NewDocumentCommand\Edynkin{}% {% - \ifnum\dynkin@ply>1 - \ifnum\dynkin@rank=6% + \ifnum\dynkin@ply>1\relax% + \ifnum\dynkin@rank=6\relax% \Edynkin@folded% \else% \ifnum\dynkin@rank=7 @@ -3802,37 +4215,25 @@ decoration= \Edynkin@unfolded% \fi% }% - %% \Fdynkin %% Draws an F series Dynkin diagram. \newcommand*{\Fdynkin}% -{ +{% \dynkinPlaceRootHere*{1}{below}{above}% \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}{above}% \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}{above}% \dynkinPlaceRootRelativeTo*{4}{3}{east}{below}{above}% - \ifdynkin@Coxeter - \dynkinEdge*{SingleEdge}{1}{2} - \dynkinEdge*{SingleEdge}{2}{3} - \dynkinEdge*{SingleEdge}{3}{4} + \ifdynkin@Coxeter% + \dynkinEdge*{SingleEdge}{1}{2}% + \dynkinEdge*{SingleEdge}{2}{3}% + \dynkinEdge*{SingleEdge}{3}{4}% \dynkinEdgeLabel{2}{3}{4}% -% \convertRootPair{2}{3} -% \node[inner sep=\dynkin@root@radius,% -% label={% -% [/Dynkin diagram/text style,/Dynkin diagram/edge label]% -% above: -% \(\pgfkeys{/Dynkin diagram/label macro*=4}\)% -% }% -% ] -% at ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) -% {}; - \else - \dynkinEdge*{SingleEdge}{1}{2} - \dynkinEdge*{SingleEdge}{3}{4} - \dynkinEdge*{DoubleEdge}{2}{3} - \fi -} - + \else% + \dynkinEdge*{SingleEdge}{1}{2}% + \dynkinEdge*{SingleEdge}{3}{4}% + \dynkinEdge*{DoubleEdge}{2}{3}% + \fi% +}% %% \Gdynkin %% Draws a G series Dynkin diagram. \NewDocumentCommand\Gdynkin{}% @@ -3840,7 +4241,7 @@ decoration= \ifdynkin@Coxeter% \Idynkin% \else% - \ifnum\dynkin@ply>1% + \ifnum\dynkin@ply>1\relax% \dynkin@jump{1}% \dynkinPlaceRootHere*{1}{left}{above}% \dynkinPlaceRootRelativeTo*{2}{1}{southfold}{left}{below}% @@ -3862,48 +4263,27 @@ decoration= {% \Adynkin% \dynkinEdgeLabel{1}{2}{5}% -% \convertRootPair{1}{2}% -% \node[inner sep=\dynkin@root@radius,% -% label={% -% [/Dynkin diagram/text style,/Dynkin diagram/edge label]% -% above: -% \(\pgfkeys{/Dynkin diagram/label macro*=5}\)% -% }% -% ] -% at ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) -% {}; }% - +%%%\newcount\dynkin@I@n% %% \Idynkin %% Draws an I series Coxeter diagram. \newcommand*{\Idynkin}% {% - \newcount\In% - \In=\dynkin@rank% - \dynkin@rank=2% +%%% \dynkin@I@n\dynkin@rank\relax% + \dynkin@rank=2\relax% \Adynkin% \dynkinEdgeLabel{1}{2}{\dynkin@gonality}% -% \convertRootPair{1}{2}% -% \node[inner sep=\dynkin@root@radius,% -% label={% -% [/Dynkin diagram/text style,/Dynkin diagram/edge label]% -% above: -% \(\pgfkeys{/Dynkin diagram/label macro*=\dynkin@gonality}\)% -% }% -% ] -% at ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) -% {}; }% %% \extendedAdynkin %% Draws an A series affine Dynkin/Coxeter diagram. \NewDocumentCommand\extendedAdynkin{}% {% - \ifnum\dynkin@rank=1% + \ifnum\dynkin@rank=1\relax% \dynkinPlaceRootHere{0}{below}{above}% \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}{above}% \convertRootNumber{1}% - \begin{scope}{on background layer}% + \begin{pgfonlayer}{Dynkin behind}% \draw[/Dynkin diagram/t,double, {Classical TikZ Rightarrow[length={2*\dynkin@root@radius}]}% -{Classical TikZ Rightarrow[length={2*\dynkin@root@radius}]}% @@ -3911,7 +4291,7 @@ decoration= ($(\dynkin@root@name 0)+(\dynkin@root@radius,0)$) -- ($(\dynkin@root@name \the\RootNumber)-(\dynkin@root@radius,0)$);% - \end{scope}% + \end{pgfonlayer}%% \else% \ifnum\dynkin@ply=4% \node (Dynkin current) at ($(Dynkin current)+(0,\dynkin@edge@length)$){};% @@ -3932,7 +4312,11 @@ decoration= \dynkinEdge*{LeftDownArc}{1}{0}% \dynkinEdge*{LeftUpArc}{\the\dynkin@rank}{0}% \else% - \node (Dynkin current) at ($.5*(\dynkin@root@name 1)+.5*(\dynkin@root@name \the\dynkin@rank)$){};% + \node (Dynkin current) + at + ($.5*(\dynkin@root@name 1)% + +.5*(\dynkin@root@name \the\dynkin@rank)$)% + {};% \dynkinNorth% \dynkinPlaceRootHere*{0}{below}{above}% \dynkinEdge*{SingleEdge}{0}{1}% @@ -3945,10 +4329,12 @@ decoration= \NewDocumentCommand\extendedBthreePly{}% {% - \ifnum\dynkin@rank=3 - \else - \ClassError{Dynkin diagrams}{B series extended 3-ply diagrams must have rank 3, so cannot have rank \the\dynkin@rank}{}% - \fi + \ifnum\dynkin@rank=3% + \else% + \ClassError% + {Dynkin diagrams}% + {B series extended 3-ply diagrams must have rank 3, so cannot have rank \the\dynkin@rank}{}% + \fi% \dynkinPlaceRootHere*{1}{right}{above left}% \dynkinPlaceRootRelativeTo*{0}{1}{north}{above}{below left}% \dynkinPlaceRootRelativeTo*{3}{1}{south}{below}{above left}% @@ -3967,20 +4353,20 @@ decoration= %% Draws a B series affine Dynkin/Coxeter diagram. \newcommand*{\extendedBdynkin}% {% - \ifnum\the\dynkin@rank=1 + \ifnum\the\dynkin@rank=1\relax% \extendedAdynkin% \else% - \ifnum\the\dynkin@rank=2 + \ifnum\the\dynkin@rank=2\relax% \dynkinPlaceRootHere*{0}{below}{above}% \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}{above}% \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}{above}% \dynkinEdge*{SingleEdge}{0}{1}% \dynkinEdge*{DoubleEdge}{1}{2}% \else% - \ifnum\dynkin@ply=3% + \ifnum\dynkin@ply=3\relax% \extendedBthreePly% \else% - \ifnum\dynkin@ply=2% + \ifnum\dynkin@ply=2\relax% \dynkin@jump{1}% \dynkinPlaceRootHere*{0}{left}{above left}% \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below right}{above right}% @@ -4000,7 +4386,7 @@ decoration= \drmo=\the\dynkin@rank\relax% \advance\drmo by -1\relax% \newcount\bmo% - \bmo=2% + \bmo=2\relax% \ifnum\dynkin@rank>3% \foreach \b in {3,...,\the\drmo}% {% @@ -4015,16 +4401,6 @@ decoration= \ifdynkin@Coxeter% \dynkinEdge*{SingleEdge}{\the\drmo}{\the\dynkin@rank}% \dynkinEdgeLabel{\the\drmo}{\the\dynkin@rank}{4}% -% \convertRootPair{\the\drmo}{\the\dynkin@rank} -% \node[inner sep=\dynkin@root@radius,% -% label={% -% [/Dynkin diagram/text style,/Dynkin diagram/edge label]% -% above: -% \(\pgfkeys{/Dynkin diagram/label macro*=4}\)% -% }% -% ] -% at ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) -% {}; \else% \ifnum\dynkin@ply<3% \dynkinEdge*{DoubleEdge}{\the\drmo}{\the\dynkin@rank}% @@ -4047,21 +4423,10 @@ decoration= \ifdynkin@Coxeter% \dynkinEdge*{SingleEdge}{0}{1}% \dynkinEdgeLabel{0}{1}{4}% -% \convertRootPair{0}{1} -% \node[inner sep=\dynkin@root@radius,% -% label={% -% [/Dynkin diagram/text style,/Dynkin diagram/edge label]% -% above: -% \(\pgfkeys{/Dynkin diagram/label macro*=4}\)% -% }% -% ] -% at ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) -% {}; \else% \dynkinEdge*{DoubleEdge}{0}{1}% \fi% }% - %% \DOneFourFourPly %% Draws a D^1_4 series affine Dynkin diagram folded about an A^2_2. \NewDocumentCommand\DOneFourFourPly{}% @@ -4076,7 +4441,9 @@ decoration= \node (Dynkin current) at - ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$){};% + ($.5*(\dynkin@root@name \the\@fromRoot)% + +.5*(\dynkin@root@name \the\@toRoot)$)% + {};% \dynkinWest% \dynkinPlaceRootHere*{2}{right}{left}% \dynkinEdge*{SingleEdge}{0}{2}% @@ -4087,8 +4454,6 @@ decoration= \dynkinFold*{1}{3}% \dynkinFold*{3}{4}% }% - - %% \DfourPly %% Draws a D series affine Dynkin diagram folded about its middle. \NewDocumentCommand\DfourPly{}% @@ -4100,11 +4465,11 @@ decoration= \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}{above left}% \dynkinMoveToRoot*{2}% \newcount\drmo% - \drmo=\the\dynkin@rank% - \advance\drmo by -1% + \drmo=\the\dynkin@rank\relax% + \advance\drmo by -1\relax% \newcount\drmt% - \drmt=\the\drmo% - \advance\drmt by -1% + \drmt=\the\drmo\relax% + \advance\drmt by -1\relax% \xdef\old@fold{\dynkin@fold@radius}% \pgfmathparse{\dynkin@fold@radius+2*cos(60)*\dynkin@edge@length}% \xdef\dynkin@fold@radius{\pgfmathresult pt}% @@ -4112,8 +4477,18 @@ decoration= % We place the root number rank-2 once again (it is already placed in the \dynkin@fold): \dynkinPlaceRootHere*{\the\drmt}{below right}{above right}% \xdef\dynkin@fold@radius{\old@fold}% - \dynkinPlaceRootRelativeTo*{\the\drmo}{\the\drmt}{northwestfold}{left}{above left}% - \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\drmt}{southwestfold}{left}{above left}% + \dynkinPlaceRootRelativeTo*% + {\the\drmo}% + {\the\drmt}% + {northwestfold}% + {left}% + {above left}% + \dynkinPlaceRootRelativeTo*% + {\the\dynkin@rank}% + {\the\drmt}% + {southwestfold}% + {left}% + {above left}% \dynkinEdge*{RightDownArc}{0}{2}% \dynkinEdge*{RightUpArc}{1}{2}% \dynkinEdge*{RightDownArc}{\the\drmo}{\the\drmt}% @@ -4236,14 +4611,15 @@ decoration= \dynkinEast% \Adynkin% \dynkinEdge*{SingleEdge}{0}{1}% - \ifnum\dynkin@rank=3% + \ifnum\dynkin@rank=3\relax% \convertRootPair{1}{2}% \else% \convertRootPair{0}{1}% \fi% \node[/Dynkin diagram/text style,above] at - ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) + ($.5*(\dynkin@root@name \the\@fromRoot)% + +.5*(\dynkin@root@name \the\@toRoot)$)% {\(5\)};% }% @@ -4251,38 +4627,33 @@ decoration= %% \extendedIdynkin %% Draws an I series affine Coxeter diagram. \newcommand*{\extendedIdynkin}% -{ +{% \dynkinPlaceRootHere*{0}{below}{above}% \dynkinEast% - \dynkin@rank=1% + \dynkin@rank=1\relax% \Adynkin% \dynkinEdge*{SingleEdge}{0}{1}% \dynkinEdgeLabel{0}{1}{\infty}% -% \convertRootPair{0}{1}% -% \node[/Dynkin diagram/text style,/Dynkin diagram/edge label,above] -% at -% ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) -% {\(\infty\)};% -} +}% %% \twistedAdynkin %% Draws a twisted A series affine Dynkin diagram. \NewDocumentCommand\twistedAdynkin{}% {% - \ifnum\dynkin@rank=3 + \ifnum\dynkin@rank=3\relax% \ClassError{Dynkin diagrams}{A2 series twisted diagrams cannot have rank \the\dynkin@rank}{}% - \fi - \ifnum\dynkin@rank=2% + \fi% + \ifnum\dynkin@rank=2\relax% \dynkinPlaceRootHere*{0}{below}{above}% \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}{above}% \dynkinQuadrupleEdge*{1}{0}% \else% \newcount\hmo% - \hmo=\the\dynkin@nodes% - \advance\hmo by -1% + \hmo=\the\dynkin@nodes\relax% + \advance\hmo by -1\relax% \ifodd\dynkin@rank% - \ifnum\dynkin@ply>1% + \ifnum\dynkin@ply>1\relax% \dynkinPlaceRootHere*{2}{below right}{above right}% \dynkinPlaceRootRelativeTo*{0}{2}{northwestfold}{left}{above left}% \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}{above left}% @@ -4298,7 +4669,12 @@ decoration= \fi% \dynkinMoveToRoot*{2}% \dynkin@pipe{2}{\the\hmo}{east}{below}{above}% - \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\hmo}{east}{below}{above}% + \dynkinPlaceRootRelativeTo*% + {\the\dynkin@nodes}% + {\the\hmo}% + {east}% + {below}% + {above}% \dynkinEdge*{DoubleEdge}{\the\dynkin@nodes}{\the\hmo}% \ifnum\dynkin@ply>1% \dynkinLeftFold*{0}{1}% @@ -4315,7 +4691,12 @@ decoration= \ifnum\hmo>1% \dynkin@fold{1}{\the\hmo}% \fi% - \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\hmo}{west}{below}{above}% + \dynkinPlaceRootRelativeTo*% + {\the\dynkin@nodes}% + {\the\hmo}% + {west}% + {below}% + {above}% \else% \dynkinPlaceRootHere*{0}{below}{above}% \dynkinPlaceRootRelativeTo*{1}{0}{east}{below right}{above}% @@ -4323,7 +4704,12 @@ decoration= \ifnum\hmo>1% \dynkin@pipe{1}{\the\hmo}{east}{below}{above}% \fi% - \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\hmo}{east}{below}{above}% + \dynkinPlaceRootRelativeTo*% + {\the\dynkin@nodes}% + {\the\hmo}% + {east}% + {below}% + {above}% \fi% \dynkinEdge*{DoubleEdge}{\the\dynkin@nodes}{\the\hmo}% \else% @@ -4368,8 +4754,8 @@ decoration= \ClassError{Dynkin diagrams}{D2 series twisted diagrams cannot have rank \the\dynkin@rank}{}% \fi% \newcount\drmo% - \drmo=\the\dynkin@nodes% - \advance\drmo by -1% + \drmo=\the\dynkin@nodes\relax% + \advance\drmo by -1\relax% \ifnum\dynkin@ply=1% \dynkinPlaceRootHere*{0}{below}{above}% \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}{above}% @@ -4389,8 +4775,8 @@ decoration= \else \dynkinEdge*{DoubleEdge}{1}{0}% \fi% - \ifnum\dynkin@ply>1% - \ifnum\dynkin@rank>3% + \ifnum\dynkin@ply>1\relax% + \ifnum\dynkin@rank>3\relax% \dynkin@fold{1}{\the\drmo}% \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\drmo}{west}{below}{above}% \dynkinFold*{0}{\the\dynkin@nodes}% @@ -4403,14 +4789,12 @@ decoration= \fi% \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\drmo}{east}{below}{above}% \fi% - \ifnum\dynkin@ply=2% + \ifnum\dynkin@ply=2\relax% \dynkinEdge*{DoubleDownRightArc}{\the\drmo}{\the\dynkin@nodes}% \else \dynkinEdge*{DoubleEdge}{\the\drmo}{\the\dynkin@nodes}% \fi% }% - - %% \twistedEdynkin %% Draws a twisted E series affine Dynkin diagram. \NewDocumentCommand\twistedEdynkin{}% |