diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty | 1665 |
1 files changed, 1026 insertions, 639 deletions
diff --git a/Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty b/Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty index 870e2c5842f..1335db12cc6 100644 --- a/Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty +++ b/Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty @@ -2,7 +2,7 @@ % % The Dynkin Diagrams package. % -% Version 3.14 +% Version 3.141 % % % This package draws Dynkin diagrams in LaTeX documents, using the TikZ package. @@ -18,7 +18,7 @@ % % \NeedsTeXFormat{LaTeX2e}[1994/06/01] -\ProvidesPackage{dynkin-diagrams}[2018/07/24 Dynkin diagrams] +\ProvidesPackage{dynkin-diagrams}[2018/11/29 Dynkin diagrams] \RequirePackage{tikz} \RequirePackage{xstring} \RequirePackage{xparse} @@ -26,166 +26,188 @@ \RequirePackage{expl3} \RequirePackage{pgfkeys} \RequirePackage{pgfopts} -\usetikzlibrary{arrows,arrows.meta,backgrounds,calc,decorations.markings,fit,patterns,snakes} +\RequirePackage{amsmath} +\RequirePackage{amssymb} +\usetikzlibrary{ + arrows, + arrows.meta, + backgrounds, + calc, + decorations.markings, + decorations.pathreplacing, + decorations.pathmorphing, + fit, + patterns} -%% -%% Application programming interface: -%% See dynkin-diagrams.tex file for examples of use. -%% +%%% +%%% Application programming interface: +%%% See dynkin-diagrams.tex file for examples of use. +%%% \NewDocumentCommand\dynkin{O{}mO{0}m}% {% \ifdefined\filldraw% \@dynkin[#1]{#2}[#3]{#4}% \else% - \tikz[baseline=-0.5ex]{\@dynkin[#1]{#2}[#3]{#4}}% + \tikz[baseline=(origin.base)]{\@dynkin[#1]{#2}[#3]{#4}}% \fi% }% +\NewDocumentEnvironment{dynkinDiagram}{O{}mO{0}m}% +{% +\begin{tikzpicture}[baseline=(origin.base)]% +\dynkin[#1]{#2}[#3]{#4}% +}% +{% +\end{tikzpicture}% +}% + \NewDocumentCommand\dynkinRefreshRoots{}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \dynkin@draw@all@roots{}% \ifdynkin@label@the@roots\dynkinPrintLabels{}\fi% }% +\xdef\dynkin@label@direction{} + +\NewDocumentCommand\dynkin@translate@direction{m}% +{% + \xdef\Dir{#1} + \ifdynkin@is@backwards + \IfStrEqCase{\Dir}{% + {0}{\xdef\Dir{4}}% + {1}{\xdef\Dir{3}}% + {2}{\xdef\Dir{2}}% + {3}{\xdef\Dir{1}}% + {4}{\xdef\Dir{0}}% + {5}{\xdef\Dir{7}}% + {6}{\xdef\Dir{6}}% + {7}{\xdef\Dir{5}}% + }% + [\ClassError% + {Dynkin diagrams}% + {Unrecognized root label direction: + ``\temp'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}% + {}] + \fi + \ifdynkin@is@upsidedown + \IfStrEqCase{\Dir}{% + {1}{\xdef\Dir{7}}% + {2}{\xdef\Dir{6}}% + {3}{\xdef\Dir{5}}% + {5}{\xdef\Dir{3}}% + {6}{\xdef\Dir{2}}% + {7}{\xdef\Dir{1}}% + }% + \fi + \IfStrEqCase{\Dir}{% + {0}{\xdef\dynkin@label@direction{right}}% + {1}{\xdef\dynkin@label@direction{above right}}% + {2}{\xdef\dynkin@label@direction{above}}% + {3}{\xdef\dynkin@label@direction{above left}}% + {4}{\xdef\dynkin@label@direction{left}}% + {5}{\xdef\dynkin@label@direction{below left}}% + {6}{\xdef\dynkin@label@direction{below}}% + {7}{\xdef\dynkin@label@direction{below right}}% + }% +}% + +\newcount\rpo% + %% \dynkinLabelRoot{<r>}{<s>} or \dynkinLabelRoot*{<r>}{<s>} %% Prints the label string <s> on the Dynkin diagram at root number <r>, in the current ordering convention. -%% Starred form uses the opposite label location. +%% Starred form uses the alternate label location. \NewDocumentCommand\dynkinLabelRoot{smm}% {% + \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}{}% \fi% - \newcount\rpo% - \rpo=#2% - \advance\rpo by 1% - \StrMid{\dynkin@label@directions}{\the\rpo}{\the\rpo}[\temp]% - \IfBooleanTF{#1}% + \IfStrEq{#3}{}% {% - \IfStrEqCase{\temp}{% - {l}{% - \node[inner sep=\dynkin@root@radius,% - label={% - [/Dynkin diagram,/Dynkin diagram/text]% - right:% - \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)% - }% - ]% - at (\dynkin@root@name #2){};% - }% - {r}{% - \node[inner sep=\dynkin@root@radius,% - label={% - [/Dynkin diagram,/Dynkin diagram/text]% - left:% - \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)% - }% - ]% - at (\dynkin@root@name #2){};% - }% - {a}{% - \node[inner sep=\dynkin@root@radius,% - label={% - [/Dynkin diagram,/Dynkin diagram/text]% - below:% - \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)% - }% - ]% - at (\dynkin@root@name #2){};% - }% - {b}{% - \node[inner sep=\dynkin@root@radius,% - label={% - [/Dynkin diagram,/Dynkin diagram/text]% - above:% - \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)% - }% - ]% - at (\dynkin@root@name #2){};% - }% - {d}{% - \node[inner sep=\dynkin@root@radius,% - label={% - [/Dynkin diagram,/Dynkin diagram/text]% - above right:% - \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)% - }% - ]% - at (\dynkin@root@name #2){};% - }% - }% - [\ClassError% - {Dynkin diagrams}% - {Unrecognized root label direction: - ``\temp'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string} for root #2}% - {}] }% {% - \IfStrEqCase{\temp}{% - {l}{% - \node[inner sep=\dynkin@root@radius,% - label={% - [/Dynkin diagram,/Dynkin diagram/text]% - left:% - \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)% - }% - ]% - at (\dynkin@root@name #2){};% - }% - {r}{% - \node[inner sep=\dynkin@root@radius,% - label={% - [/Dynkin diagram,/Dynkin diagram/text]% - right:% - \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)% - }% - ]% - at (\dynkin@root@name #2){};% - }% - {a}{% - \node[inner sep=\dynkin@root@radius,% - label={% - [/Dynkin diagram,/Dynkin diagram/text]% - above:% - \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)% - }% - ]% - at (\dynkin@root@name #2){};% - }% - {b}{ % - \node[inner sep=\dynkin@root@radius,% - label={% - [/Dynkin diagram,/Dynkin diagram/text]% - below:% - \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)% - }% - ]% - at (\dynkin@root@name #2){};% - }% - {d}{% - \node[inner sep=\dynkin@root@radius,% - label={% - [/Dynkin diagram,/Dynkin diagram/text]% - below right:% - \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)% - }% - ]% - at (\dynkin@root@name #2){};% - }% + \rpo=#2% + \advance\rpo by 1% + \IfBooleanTF{#1}% + {% + \StrMid{\dynkin@label@directions@star}{\the\rpo}{\the\rpo}[\dynkin@direction@letter]% + }% + {% + \StrMid{\dynkin@label@directions}{\the\rpo}{\the\rpo}[\dynkin@direction@letter]% + }% + \dynkin@translate@direction{\dynkin@direction@letter}% + \IfBooleanTF{#1}% + {% + \node[inner sep=\dynkin@root@radius,% + label={% + [/Dynkin diagram/text]% + \dynkin@label@direction:% + \(\pgfkeys{/Dynkin diagram/label macro*=#3}\)% + }% + ]% + at (\dynkin@root@name #2){};% + }% + {% + \node[inner sep=\dynkin@root@radius,% + label={% + [/Dynkin diagram/text]% + \dynkin@label@direction:% + \(\pgfkeys{/Dynkin diagram/label macro=#3}\)% + }% + ]% + at (\dynkin@root@name #2){};% }% - [\ClassError% - {Dynkin diagrams}% - {Unrecognized root label direction: - ``\temp'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string} for root #2}% - {}] }% }% +\newcounter{dynkinRootNo} +\NewDocumentCommand\@dynkinLabelThisRoot{m}% +{% +\stepcounter{dynkinRootNo}% +\dynkinLabelRoot{\arabic{dynkinRootNo}}{#1}% +}% +\NewDocumentCommand\@dynkinLabelThisRootStar{m}% +{% +\stepcounter{dynkinRootNo}% +\dynkinLabelRoot*{\arabic{dynkinRootNo}}{#1}% +}% + + +\NewDocumentCommand\dynkinLabelRoots{sm}% +{% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% + \setcounter{dynkinRootNo}{0}% + \ifdynkin@is@extended% + \setcounter{dynkinRootNo}{-1}% + \else% + \ifdynkin@is@twisted% + \setcounter{dynkinRootNo}{-1}% + \else% + \setcounter{dynkinRootNo}{0}% + \fi% + \fi% + \edef\XXX{#2}% + \foreach \i in \XXX% + {% + \IfBooleanTF{#1}% + {% + \@dynkinLabelThisRootStar{\i}% + }% + {% + \@dynkinLabelThisRoot{\i}% + }% + }% +}% + \NewDocumentCommand\dynkinBrace{somm}%[text]{start}{end} {% -\draw[decoration= + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% +\draw[ +decoration= { brace, \IfBooleanF{#1}{mirror}, @@ -200,24 +222,56 @@ pos=0.5, anchor=\IfBooleanTF{#1}{south}{north}, yshift=\IfBooleanTF{#1}{1mm}{-1mm}, - /Dynkin diagram/text -] + /Dynkin diagram/text] {\IfValueT{#2}{\(#2\)}};% } %% \dynkinPrintLabels -%% Prints the default labels on the Dynkin diagram, in the given ordering. +%% Prints the labels on the Dynkin diagram,in the given ordering. Uses the default labels if ``label'' is set without a list of ``labels'' being set. \newcommand{\dynkinPrintLabels}% {% - \foreach \i in {1,...,\the\dynkin@nodes}{\dynkinLabelRoot{\i}{\i}}% - \ifdynkin@is@extended% - \dynkinLabelRoot{0}{0}% - \else% - \ifdynkin@is@twisted% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% + \IfStrEq{\dynkin@label@list\dynkin@label@list@star}{}{% + \foreach \i in {1,...,\the\dynkin@nodes}{\dynkinLabelRoot{\i}{\i}}% + \ifdynkin@is@extended% \dynkinLabelRoot{0}{0}% + \else% + \ifdynkin@is@twisted% + \dynkinLabelRoot{0}{0}% + \fi% \fi% - \fi% + }% + {% + \ifdynkin@is@extended% + \setcounter{dynkinRootNo}{-1}% + \else% + \ifdynkin@is@twisted% + \setcounter{dynkinRootNo}{-1}% + \else% + \setcounter{dynkinRootNo}{0}% + \fi% + \fi% + \edef\XXX{\dynkin@label@list}% + \foreach \i in \XXX% + {% + \@dynkinLabelThisRoot{\i}% + }% + \ifdynkin@is@extended% + \setcounter{dynkinRootNo}{-1}% + \else% + \ifdynkin@is@twisted% + \setcounter{dynkinRootNo}{-1}% + \else% + \setcounter{dynkinRootNo}{0}% + \fi% + \fi% + \edef\XXX{\dynkin@label@list@star}% + \foreach \i in \XXX% + {% + \@dynkinLabelThisRootStar{\i}% + }% + }% }% %% \dynkinCrossRootMark{<n>} @@ -225,6 +279,7 @@ %% The starred form accepts <n> in the Bourbaki ordering. \NewDocumentCommand\dynkinCrossRootMark{sO{}m}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootNumber{#3}% @@ -232,11 +287,11 @@ {% \RootNumber=#3% }% - \draw[/Dynkin diagram,/Dynkin diagram/x,#2]% + \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,/Dynkin diagram/x,#2]% + \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)$);% @@ -247,6 +302,7 @@ %% The starred form accepts <n> in the Bourbaki ordering. \NewDocumentCommand\dynkinHeavyCrossRootMark{sO{}m}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootNumber{#3}% @@ -254,11 +310,11 @@ {% \RootNumber=#3% }% - \draw[/Dynkin diagram,/Dynkin diagram/X,#2]% + \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,/Dynkin diagram/X,#2]% + \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)$);% @@ -270,6 +326,7 @@ %% The starred form accepts <n> in the Bourbaki ordering. \NewDocumentCommand\dynkinHollowRootMark{sO{}m}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootNumber{#3}% @@ -277,7 +334,7 @@ {% \RootNumber=#3% }% - \fill[/Dynkin diagram,/Dynkin diagram/o,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);% + \fill[/Dynkin diagram,o,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);% }% %% \dynkinDoubleHollowRootMark{<n>} @@ -285,6 +342,7 @@ %% The starred form accepts <n> in the Bourbaki ordering. \NewDocumentCommand\dynkinDoubleHollowRootMark{sO{}m}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootNumber{#3}% @@ -292,8 +350,8 @@ {% \RootNumber=#3% }% - \fill[/Dynkin diagram,/Dynkin diagram/o,#2] (\dynkin@root@name \the\RootNumber) circle (2*\dynkin@root@radius);% - \fill[/Dynkin diagram,/Dynkin diagram/o,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);% + \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);% }% %% \dynkinSolidRootMark{<n>} @@ -301,6 +359,7 @@ %% The starred form accepts <n> in the Bourbaki ordering. \NewDocumentCommand\dynkinSolidRootMark{sO{}m}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootNumber{#3}% @@ -308,7 +367,7 @@ {% \RootNumber=#3% }% - \fill[/Dynkin diagram,/Dynkin diagram/*,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);% + \fill[/Dynkin diagram,*,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);% }% %% \dynkinTensorRootMark{<n>} @@ -316,6 +375,7 @@ %% The starred form accepts <n> in the Bourbaki ordering. \NewDocumentCommand\dynkinTensorRootMark{sO{}m}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootNumber{#3}% @@ -323,23 +383,24 @@ {% \RootNumber=#3% }% - \fill[/Dynkin diagram,/Dynkin diagram/o,#2] (\dynkin@root@name \the\RootNumber) circle ({\dynkin@root@radius});% - \draw[/Dynkin diagram,/Dynkin diagram/x,#2]% + \fill[/Dynkin diagram,o,#2] (\dynkin@root@name \the\RootNumber) circle ({\dynkin@root@radius});% + \draw[/Dynkin diagram,edge,#2]% ($(\dynkin@root@name \the\RootNumber)+({\dynkin@root@radius/sqrt(2)},{\dynkin@root@radius/sqrt(2)})$)% --% ($(\dynkin@root@name \the\RootNumber)-({\dynkin@root@radius/sqrt(2)},{\dynkin@root@radius/sqrt(2)})$);% - \draw[/Dynkin diagram,/Dynkin diagram/x,#2]% + \draw[/Dynkin diagram,edge,#2]% ($(\dynkin@root@name \the\RootNumber)+({-\dynkin@root@radius/sqrt(2)},{\dynkin@root@radius/sqrt(2)})$)% --% ($(\dynkin@root@name \the\RootNumber)+({\dynkin@root@radius/sqrt(2)},{-\dynkin@root@radius/sqrt(2)})$);% }% -%% \dynkinRootMark{<s>}{<n>} -%% Prints a dot at root <n> on the current Dynkin diagram using mark style <s>. -%% Use <s> empty to get the default mark style. -%% The starred form accepts <n> in the Bourbaki ordering. +% \dynkinRootMark{<s>}{<n>} +% Prints a dot at root <n> on the current Dynkin diagram using mark style <s>. +% Use <s> empty to get the default mark style. +% The starred form accepts <n> in the Bourbaki ordering. \NewDocumentCommand\dynkinRootMark{smm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \IfStrEqCase{#2}% @@ -378,6 +439,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteSingleEdge{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -400,6 +462,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinIndefiniteSingleEdge{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -413,11 +476,11 @@ ($(\dynkin@root@name \the\@fromRoot)$) -- (${(2/3)}*(\dynkin@root@name \the\@fromRoot)+{(1/3)}*(\dynkin@root@name \the\@toRoot)$); - \draw[/Dynkin diagram,/Dynkin diagram/indefiniteEdge,#2] + \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)$); - \draw[/Dynkin diagram,/Dynkin diagram/edge,#2] + \draw[/Dynkin diagram,edge,#2] (${(1/3)}*(\dynkin@root@name \the\@fromRoot)+{(2/3)}*(\dynkin@root@name \the\@toRoot)$) -- ($(\dynkin@root@name \the\@toRoot)$); @@ -429,12 +492,13 @@ %%% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinRightFold{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% - \dynkinFold*[/Dynkin diagram/rightFold,#2]{#3}{#4}% + \dynkinFold*[/Dynkin diagram,fold right style,#2]{#3}{#4}% }% {% - \dynkinFold[/Dynkin diagram/rightFold,#2]{#3}{#4}% + \dynkinFold[/Dynkin diagram,fold right style,#2]{#3}{#4}% }% }% @@ -443,12 +507,13 @@ %%% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinLeftFold{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% - \dynkinFold*[/Dynkin diagram/leftFold,#2]{#3}{#4}% + \dynkinFold*[/Dynkin diagram,fold left style,#2]{#3}{#4}% }% {% - \dynkinFold[/Dynkin diagram/leftFold,#2]{#3}{#4}% + \dynkinFold[/Dynkin diagram,fold left style,#2]{#3}{#4}% }% }% @@ -457,6 +522,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinFold{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -467,8 +533,8 @@ }% \convertRootPair{\@fromRoot}{\@toRoot}% \begin{scope}[on background layer] - \draw - [/Dynkin diagram/foldStyle,#2] + \draw[/Dynkin diagram/fold style,#2,%/Dynkin diagram/fold left style + ] ($(\dynkin@root@name \the\@fromRoot)$) to ($(\dynkin@root@name \the\@toRoot)$); @@ -481,6 +547,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteRightDownArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -490,7 +557,7 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2]% + \draw[/Dynkin diagram,edge,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:0:\dynkin@fold@radius) -- ($(\dynkin@root@name \the\@toRoot)$);% \end{scope}% @@ -501,6 +568,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinIndefiniteRightDownArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -511,15 +579,15 @@ }% \node (center) at ($(\dynkin@root@name \the\@fromRoot)-(0,\dynkin@fold@radius)$) {};% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(90:\dynkin@fold@radius) arc [start angle=90, end angle=60, radius=\dynkin@fold@radius];% - \draw[/Dynkin diagram,/Dynkin diagram/indefiniteEdge,fill=none,#2] + \draw[/Dynkin diagram,indefinite edge,fill=none,#2] (center) ++(60:\dynkin@fold@radius) arc [start angle=60, end angle=30, radius=\dynkin@fold@radius];% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(30:\dynkin@fold@radius) arc [start angle=30, end angle=0, radius=\dynkin@fold@radius];% @@ -531,6 +599,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteRightUpArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -540,7 +609,7 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] ($(\dynkin@root@name \the\@fromRoot)$) arc (-90:0:\dynkin@fold@radius) -- ($(\dynkin@root@name \the\@toRoot)$);% \end{scope}% @@ -551,6 +620,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinIndefiniteRightUpArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -561,15 +631,15 @@ }% \node (center) at ($(\dynkin@root@name \the\@fromRoot)+(0,\dynkin@fold@radius)$) {};% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(-90:\dynkin@fold@radius) arc [start angle=-90, end angle=-60, radius=\dynkin@fold@radius];% - \draw[/Dynkin diagram,/Dynkin diagram/indefiniteEdge,fill=none,#2] + \draw[/Dynkin diagram,indefinite edge,fill=none,#2] (center) ++(-60:\dynkin@fold@radius) arc [start angle=-60, end angle=-30, radius=\dynkin@fold@radius];% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(-30:\dynkin@fold@radius) arc [start angle=-30, end angle=0, radius=\dynkin@fold@radius] -- ($(\dynkin@root@name \the\@toRoot)$);% @@ -582,6 +652,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteLeftDownArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -591,7 +662,7 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2]% + \draw[/Dynkin diagram,edge,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:180:\dynkin@fold@radius) -- ($(\dynkin@root@name \the\@toRoot)$);% \end{scope}% @@ -602,6 +673,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinIndefiniteLeftDownArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -612,15 +684,15 @@ }% \node (center) at ($(\dynkin@root@name \the\@fromRoot)-(0,\dynkin@fold@radius)$) {};% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(90:\dynkin@fold@radius) arc [start angle=90, end angle=120, radius=\dynkin@fold@radius];% - \draw[/Dynkin diagram,/Dynkin diagram/indefiniteEdge,fill=none,#2] + \draw[/Dynkin diagram,indefinite edge,fill=none,#2] (center) ++(120:\dynkin@fold@radius) arc [start angle=120, end angle=150, radius=\dynkin@fold@radius];% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(150:\dynkin@fold@radius) arc [start angle=150, end angle=180, radius=\dynkin@fold@radius] -- ($(\dynkin@root@name \the\@toRoot)$);% @@ -632,6 +704,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteLeftUpArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -641,7 +714,7 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] ($(\dynkin@root@name \the\@fromRoot)$) arc (-90:-180:\dynkin@fold@radius) -- ($(\dynkin@root@name \the\@toRoot)$);% \end{scope}% @@ -652,6 +725,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinIndefiniteLeftUpArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -662,15 +736,15 @@ }% \node (center) at ($(\dynkin@root@name \the\@fromRoot)+(0,\dynkin@fold@radius)$) {};% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(-90:\dynkin@fold@radius) arc [start angle=-90, end angle=-120, radius=\dynkin@fold@radius];% - \draw[/Dynkin diagram,/Dynkin diagram/indefiniteEdge,fill=none,#2] + \draw[/Dynkin diagram,indefinite edge,fill=none,#2] (center) ++(-120:\dynkin@fold@radius) arc [start angle=-120, end angle=-150, radius=\dynkin@fold@radius];% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(-150:\dynkin@fold@radius) arc [start angle=-150, end angle=-180, radius=\dynkin@fold@radius] -- ($(\dynkin@root@name \the\@toRoot)$);% @@ -683,6 +757,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteSemiCircle{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -692,7 +767,7 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] ($(\dynkin@root@name \the\@fromRoot)$) arc (90:-90:\dynkin@fold@radius) -- ($(\dynkin@root@name \the\@toRoot)$);% @@ -704,6 +779,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinIndefiniteSemiCircle{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -714,15 +790,15 @@ }% \node (center) at ($(\dynkin@root@name \the\@fromRoot)-(0,\dynkin@fold@radius)$) {};% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(90:\dynkin@fold@radius) arc [start angle=90, end angle=30, radius=\dynkin@fold@radius];% - \draw[/Dynkin diagram,/Dynkin diagram/indefiniteEdge,fill=none,#2] + \draw[/Dynkin diagram,indefinite edge,fill=none,#2] (center) ++(30:\dynkin@fold@radius) arc [start angle=30, end angle=-30, radius=\dynkin@fold@radius];% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2] + \draw[/Dynkin diagram,edge,fill=none,#2] (center) ++(-30:\dynkin@fold@radius) arc [start angle=-30, end angle=-90, radius=\dynkin@fold@radius] -- ($(\dynkin@root@name \the\@toRoot)$);% @@ -735,6 +811,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleRightDownArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -744,7 +821,7 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:0:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% @@ -752,10 +829,7 @@ \path[-{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@toRoot)$)% - arc (45:90:{\dynkin@fold@radius});% -% \path[/Dynkin diagram,edge,-<,tips] -% ($(\dynkin@root@name \the\@fromRoot)$)% -% arc (90:45:{\dynkin@fold@radius});% + arc (0:45:{\dynkin@fold@radius});% \else% \path[-{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] @@ -773,6 +847,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleUpRightArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -782,7 +857,7 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (180:90:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% @@ -793,7 +868,7 @@ ($(\dynkin@root@name \the\@toRoot)$)% arc (135:180:{\dynkin@fold@radius});% \else% - \path[ + \path[/Dynkin diagram,edge, -{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@fromRoot)$)% @@ -810,6 +885,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleUpLeftArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -819,21 +895,20 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% - arc (-90:0:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% + arc (0:90:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% \ifdynkin@reverse@arrows% - \path[/Dynkin diagram,edge, - -{Computer Modern Rightarrow[\dynkin@arrow@color]}, + \path[-{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@toRoot)$)% - arc (-45:-90:{\dynkin@fold@radius});% + arc (90:45:{\dynkin@fold@radius});% \else% \path[-{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@fromRoot)$)% - arc (-90:-45:{\dynkin@fold@radius});% + arc (0:45:{\dynkin@fold@radius});% \fi% \fi% \end{scope}% @@ -848,6 +923,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleDownRightArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -857,24 +933,22 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% -- ($(\dynkin@root@name \the\@toRoot)+(-\dynkin@fold@radius,\dynkin@fold@radius)$)% arc (-180:-90:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% \ifdynkin@reverse@arrows% - \path[ - -{Computer Modern Rightarrow[\dynkin@arrow@color]}, + \path[-{Computer Modern Rightarrow[\dynkin@arrow@color]}, tips] - ($(\dynkin@root@name \the\@fromRoot)+(-\dynkin@fold@radius,\dynkin@fold@radius)$)% - arc (-135:-180:{\dynkin@fold@radius});% + ($(\dynkin@root@name \the\@toRoot)$)% + arc (-90:-135:{\dynkin@fold@radius});% \else% - \path[ - -{Computer Modern Rightarrow[\dynkin@arrow@color]}, + \path[-{Computer Modern Rightarrow [\dynkin@arrow@color]}, ,tips] - ($(\dynkin@root@name \the\@toRoot)+(-\dynkin@fold@radius,\dynkin@fold@radius)$)% - arc (-180:-135:{\dynkin@fold@radius});% + ($(\dynkin@root@name \the\@fromRoot)$)% + arc (180:225:{\dynkin@fold@radius});% \fi% \fi% \end{scope}% @@ -887,6 +961,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleRightUpArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -896,15 +971,21 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (270:360:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% - \path[ - -{Computer Modern Rightarrow[\dynkin@arrow@color]}, + \ifdynkin@reverse@arrows% + \path[-{Computer Modern Rightarrow[\dynkin@arrow@color]}, + ,tips] + ($(\dynkin@root@name \the\@toRoot)$)% + arc (0:-45:\dynkin@fold@radius);% + \else% + \path[-{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@fromRoot)$)% arc (270:315:\dynkin@fold@radius);% + \fi% \fi% \end{scope}% }% @@ -915,6 +996,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleLeftDownArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -924,16 +1006,15 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:180:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% \ifdynkin@reverse@arrows% - \path[/Dynkin diagram,edge, - -{Computer Modern Rightarrow[\dynkin@arrow@color]}, + \path[-{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@toRoot)$)% - arc (135:90:{\dynkin@fold@radius});% + arc (180:{180-45}:{\dynkin@fold@radius});% \else% \path[ -{Computer Modern Rightarrow[\dynkin@arrow@color]}, @@ -952,6 +1033,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleDownLeftArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -961,7 +1043,7 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (360:270:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% @@ -970,7 +1052,7 @@ -{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@toRoot)$)% - arc (315:360:{\dynkin@fold@radius});% + arc (-90:-45:{\dynkin@fold@radius});% \else% \path[ -{Computer Modern Rightarrow[\dynkin@arrow@color]}, @@ -990,6 +1072,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleLeftUpArc{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -999,16 +1082,15 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (-90:-180:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% \ifdynkin@reverse@arrows% - \path[/Dynkin diagram,edge - -{Computer Modern Rightarrow[\dynkin@arrow@color]}, + \path[-{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@toRoot)$)% - arc (-135:-90:\dynkin@fold@radius);% + arc (-180:-135:\dynkin@fold@radius);% \else% \path[, -{Computer Modern Rightarrow[\dynkin@arrow@color]}, @@ -1027,6 +1109,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleDownRightSemiCircle{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -1036,7 +1119,7 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:-90:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% @@ -1045,7 +1128,7 @@ -{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@toRoot)$)% - arc (0:90:\dynkin@fold@radius);% + arc (-90:0:\dynkin@fold@radius);% \else% \path[ -{Computer Modern Rightarrow[\dynkin@arrow@color]}, @@ -1066,6 +1149,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteTripleDownRightSemiCircle{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -1075,10 +1159,10 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,double distance=\dynkin@root@radius,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,double distance=\dynkin@root@radius,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:-90:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% - \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2]% + \draw[/Dynkin diagram,edge,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (90:-90:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% @@ -1087,7 +1171,7 @@ -{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@toRoot)$)% - arc (0:90:\dynkin@fold@radius);% + arc (-90:0:\dynkin@fold@radius);% \else% \path[ -{Computer Modern Rightarrow[\dynkin@arrow@color]}, @@ -1108,6 +1192,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleUpRightSemiCircle{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -1117,7 +1202,7 @@ \@toRoot=#4% }% \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,double,fill=none,#2]% + \draw[/Dynkin diagram,edge,double,fill=none,#2]% ($(\dynkin@root@name \the\@fromRoot)$)% arc (-90:90:{\dynkin@fold@radius}) -- ($(\dynkin@root@name \the\@toRoot)$);% \ifdynkin@arrows% @@ -1126,7 +1211,7 @@ -{Computer Modern Rightarrow[\dynkin@arrow@color]}, ,tips] ($(\dynkin@root@name \the\@toRoot)$)% - arc (0:-90:\dynkin@fold@radius);% + arc (90:0:\dynkin@fold@radius);% \else% \path[ -{Computer Modern Rightarrow[\dynkin@arrow@color]}, @@ -1145,6 +1230,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinEdge{sO{}mmm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#4}{#5}% @@ -1170,6 +1256,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinEdgeArrow{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \ifdynkin@arrows% \IfBooleanTF{#1}% {% @@ -1199,11 +1286,51 @@ \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@root@name \the#2)--(\dynkin@root@name \the#3);% + \draw[arrows = {-{Classical TikZ Rightarrow[length=1mm]}},% + /Dynkin diagram,edge,double distance=1.8pt,#1]% + (\dynkin@root@name \the#2)--(\dynkin@root@name \the#3);% +}% + +\NewDocumentCommand\dynkinKacTripleArrow{O{}mm}% +{% + \draw[arrows = {-{Triangle Cap[length=.8mm,fill=white]}},% + /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]% + (\dynkin@root@name \the#2)--(\dynkin@root@name \the#3);% + \draw[/Dynkin diagram,edge,shorten >=1.1mm,#1]% + (\dynkin@root@name \the#2)--(\dynkin@root@name \the#3);% +}% + +\NewDocumentCommand\dynkinKacQuadrupleArrow{O{}mm}% +{% + \draw[arrows = {-{Triangle Cap[length=1.127mm,fill=white]}},% + /Dynkin diagram,edge,double=white,fill=white,shorten >=1mm,shorten <=1mm, double distance=3.6pt,#1]% + (\dynkin@root@name \the#2)--(\dynkin@root@name \the#3);% + \draw[arrows = {-{Classical TikZ Rightarrow[length=1.2mm]}},% + /Dynkin diagram,edge,double distance=3.6pt,shorten <=.83mm,#1]% + (\dynkin@root@name \the#2)--(\dynkin@root@name \the#3);% + \draw[arrows = {-{Classical TikZ Rightarrow[length=1.2mm]}},% + /Dynkin diagram,edge,double distance=1.2pt,shorten <= .83mm, + #1]% + (\dynkin@root@name \the#2)--(\dynkin@root@name \the#3);% +}% + +\newcount\onesbit% +\newcount\twosbit% + %% \dynkinDefiniteDoubleEdge{<p>}{<q>} %% Draws an oriented double line from root <p> to root <q> on the current Dynkin diagram. %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinDefiniteDoubleEdge{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -1212,8 +1339,6 @@ \@fromRoot=#3% \@toRoot=#4% }% - \newcount\onesbit% - \newcount\twosbit% \StrChar{\dynkin@roots}{\the\@fromRoot}[\my@root@marker]% \IfStrEq{\my@root@marker}{x}% {% @@ -1230,25 +1355,50 @@ {% \global\twosbit=0% }% - \def\LL{.5*\dynkin@root@radius} - \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,#2]% - ($(\dynkin@root@name \the\@fromRoot)$)% - --% - +({\the\onesbit*\LL},{\LL})% - --% - ($(\dynkin@root@name \the\@toRoot)+(-\the\twosbit*\LL,\LL)$)% - --% - ($(\dynkin@root@name \the\@toRoot)$)% - --% - ($(\dynkin@root@name \the\@toRoot)-(\the\twosbit*\LL,\LL)$)% - --% - ($(\dynkin@root@name \the\@fromRoot)+(\the\onesbit*\LL,-\LL)$)% - --% - cycle;% - \end{scope}% - \ifdynkin@arrows% - \dynkinEdgeArrow[#2]{\the\@fromRoot}{\the\@toRoot}% + \ifdynkin@Kac@arrows + \begin{scope}[on background layer]% + \ifdynkin@arrows% + \ifdynkin@reverse@arrows + \ifdynkin@is@backwards + \dynkinKacDoubleArrow[#2]{\@fromRoot}{\@toRoot} + \else% + \dynkinKacDoubleArrow[#2]{\@toRoot}{\@fromRoot} + \fi% + \else% + \ifdynkin@is@backwards + \dynkinKacDoubleArrow[#2]{\@toRoot}{\@fromRoot} + \else% + \dynkinKacDoubleArrow[#2]{\@fromRoot}{\@toRoot} + \fi% + \fi% + \else% + \draw[/Dynkin diagram,edge,double distance=3pt,#2]% + (\dynkin@root@name \the\@fromRoot)% + --% + (\dynkin@root@name \the\@toRoot);% + \fi% + \end{scope}% + \else + \def\LL{.5*\dynkin@root@radius} + \begin{scope}[on background layer]% + \draw[/Dynkin diagram,edge,#2]% + ($(\dynkin@root@name \the\@fromRoot)$)% + --% + +({\the\onesbit*\LL},{\LL})% + --% + ($(\dynkin@root@name \the\@toRoot)+(-\the\twosbit*\LL,\LL)$)% + --% + ($(\dynkin@root@name \the\@toRoot)$)% + --% + ($(\dynkin@root@name \the\@toRoot)-(\the\twosbit*\LL,\LL)$)% + --% + ($(\dynkin@root@name \the\@fromRoot)+(\the\onesbit*\LL,-\LL)$)% + --% + cycle;% + \end{scope}% + \ifdynkin@arrows% + \dynkinEdgeArrow[#2]{\the\@fromRoot}{\the\@toRoot}% + \fi% \fi% }% @@ -1257,6 +1407,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinTripleEdge{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -1265,8 +1416,6 @@ \@fromRoot=#3% \@toRoot=#4% }% - \newcount\onesbit - \newcount\twosbit \StrChar{\dynkin@roots}{\the\@fromRoot}[\my@root@marker]% \IfStrEq{\my@root@marker}{x}% {% @@ -1283,28 +1432,57 @@ {% \global\twosbit=0% }% - \begin{scope}[on background layer]% - \draw[/Dynkin diagram,/Dynkin diagram/edge,#2]% - ($(\dynkin@root@name \the\@fromRoot)$)% - --% - +({\the\onesbit*\dynkin@root@radius},{\dynkin@root@radius})% - --% - ($(\dynkin@root@name \the\@toRoot)+(-\twosbit*\dynkin@root@radius,\dynkin@root@radius)$)% - --% - ($(\dynkin@root@name \the\@toRoot)$)% - --% - ($(\dynkin@root@name \the\@toRoot)-(\twosbit*\dynkin@root@radius,\dynkin@root@radius)$)% - --% - ($(\dynkin@root@name \the\@fromRoot)+(\onesbit*\dynkin@root@radius,-\dynkin@root@radius)$)% - --% - cycle;% - \draw[/Dynkin diagram,/Dynkin diagram/edge,#2] - ($(\dynkin@root@name \the\@fromRoot)$) - -- - ($(\dynkin@root@name \the\@toRoot)$);% - \end{scope}% - \ifdynkin@arrows% - \dynkinEdgeArrow[#2]{\the\@fromRoot}{\the\@toRoot}% + \ifdynkin@Kac@arrows + \begin{scope}[on background layer]% + \ifdynkin@arrows% + \ifdynkin@reverse@arrows + \ifdynkin@is@backwards + \dynkinKacTripleArrow[#2]{\@fromRoot}{\@toRoot} + \else% + \dynkinKacTripleArrow[#2]{\@toRoot}{\@fromRoot} + \fi% + \else% + \ifdynkin@is@backwards + \dynkinKacTripleArrow[#2]{\@toRoot}{\@fromRoot} + \else% + \dynkinKacTripleArrow[#2]{\@fromRoot}{\@toRoot} + \fi% + \fi% + \else% + \draw[/Dynkin diagram,edge,double distance=3pt,#2]% + (\dynkin@root@name \the\@fromRoot)% + --% + (\dynkin@root@name \the\@toRoot);% + \draw[/Dynkin diagram,edge,#2]% + (\dynkin@root@name \the\@fromRoot)% + --% + (\dynkin@root@name \the\@toRoot);% + \fi% + \end{scope}% + \else + \begin{scope}[on background layer]% + \draw[/Dynkin diagram,edge,#2]% + ($(\dynkin@root@name \the\@fromRoot)$)% + --% + +({\the\onesbit*\dynkin@root@radius},{\dynkin@root@radius})% + --% + ($(\dynkin@root@name \the\@toRoot)+(-\twosbit*\dynkin@root@radius,\dynkin@root@radius)$)% + --% + ($(\dynkin@root@name \the\@toRoot)$)% + --% + ($(\dynkin@root@name \the\@toRoot)-(\twosbit*\dynkin@root@radius,\dynkin@root@radius)$)% + --% + ($(\dynkin@root@name \the\@fromRoot)+(\onesbit*\dynkin@root@radius,-\dynkin@root@radius)$)% + --% + cycle;% + \draw[/Dynkin diagram,edge,#2] + ($(\dynkin@root@name \the\@fromRoot)$) + -- + ($(\dynkin@root@name \the\@toRoot)$);% + \end{scope}% + \ifdynkin@arrows% + \dynkinEdgeArrow[#2]{\the\@fromRoot}{\the\@toRoot}% + \fi% \fi% }% @@ -1315,6 +1493,7 @@ %% The starred form accepts <p> and <q> in the Bourbaki ordering. \NewDocumentCommand\dynkinQuadrupleEdge{sO{}mm}% {% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% \IfBooleanTF{#1}% {% \convertRootPair{#3}{#4}% @@ -1323,29 +1502,51 @@ \@fromRoot=#3% \@toRoot=#4% }% - \begin{scope}[on background layer]% - \draw[% - /Dynkin diagram, - /Dynkin diagram/edge, - #2, - ]% - ($(\dynkin@root@name \the\@fromRoot)+(0,\dynkin@root@radius)$)--% - ($(\dynkin@root@name \the\@toRoot)+(0,\dynkin@root@radius)$)--% - ($(\dynkin@root@name \the\@toRoot)+(0,-\dynkin@root@radius)$)--% - ($(\dynkin@root@name \the\@fromRoot)+(0,-\dynkin@root@radius)$)--% - cycle; - \draw[% - /Dynkin diagram,/Dynkin diagram/edge, - #2, - ]% - ($(\dynkin@root@name \the\@fromRoot)+(0,\dynkin@root@radius/3)$)--% - ($(\dynkin@root@name \the\@toRoot)+(0,\dynkin@root@radius/3)$)--% - ($(\dynkin@root@name \the\@toRoot)+(0,-\dynkin@root@radius/3)$)--% - ($(\dynkin@root@name \the\@fromRoot)+(0,-\dynkin@root@radius/3)$)--% - cycle; - \end{scope}% - \ifdynkin@arrows% - \dynkinEdgeArrow[#2]{\the\@fromRoot}{\the\@toRoot}% + \ifdynkin@Kac@arrows + \begin{scope}[on background layer]% + \ifdynkin@arrows% + \ifdynkin@reverse@arrows + \ifdynkin@is@backwards + \dynkinKacQuadrupleArrow[#2]{\@fromRoot}{\@toRoot} + \else% + \dynkinKacQuadrupleArrow[#2]{\@toRoot}{\@fromRoot} + \fi% + \else% + \ifdynkin@is@backwards + \dynkinKacQuadrupleArrow[#2]{\@toRoot}{\@fromRoot} + \else% + \dynkinKacQuadrupleArrow[#2]{\@fromRoot}{\@toRoot} + \fi% + \fi% + \else% + \draw[/Dynkin diagram,edge,double distance=3pt,#2]% + (\dynkin@root@name \the\@fromRoot)% + --% + (\dynkin@root@name \the\@toRoot);% + \draw[/Dynkin diagram,edge,#2]% + (\dynkin@root@name \the\@fromRoot)% + --% + (\dynkin@root@name \the\@toRoot);% + \fi% + \end{scope}% + \else + \begin{scope}[on background layer]% + \draw[/Dynkin diagram,edge,#2]% + ($(\dynkin@root@name \the\@fromRoot)+(0,\dynkin@root@radius)$)--% + ($(\dynkin@root@name \the\@toRoot)+(0,\dynkin@root@radius)$)--% + ($(\dynkin@root@name \the\@toRoot)+(0,-\dynkin@root@radius)$)--% + ($(\dynkin@root@name \the\@fromRoot)+(0,-\dynkin@root@radius)$)--% + cycle; + \draw[/Dynkin diagram,edge,#2]% + ($(\dynkin@root@name \the\@fromRoot)+(0,\dynkin@root@radius/3)$)--% + ($(\dynkin@root@name \the\@toRoot)+(0,\dynkin@root@radius/3)$)--% + ($(\dynkin@root@name \the\@toRoot)+(0,-\dynkin@root@radius/3)$)--% + ($(\dynkin@root@name \the\@fromRoot)+(0,-\dynkin@root@radius/3)$)--% + cycle; + \end{scope}% + \ifdynkin@arrows% + \dynkinEdgeArrow[#2]{\the\@fromRoot}{\the\@toRoot}% + \fi% \fi% }% @@ -1411,12 +1612,24 @@ \def\dynkin@series{A} % Which series of root system: A,B,C,D,E,F,G +\def\dynkin@label@list{} +% List of labels for the roots. + +\def\dynkin@label@list@star{} +% List of alternate labels for the roots. + \newcount\dynkin@rank % Which rank of root system: 1,2,... \newcount\dynkin@nodes % How many nodes (besides the zero node for affine diagrams) are there? +\newif\ifdynkin@is@backwards +% Are we drawing this thing in a reverse direction? + +\newif\ifdynkin@is@upsidedown +% Are we drawing this thing in a reverse direction? + \newif\ifdynkin@is@extended % Is this an extended extended root system? @@ -1444,6 +1657,9 @@ \newif\ifdynkin@Coxeter % Should we draw Coxeter diagrams? +\newif\ifdynkin@Kac@arrows +% Should we draw arrows following Kac? + \newif\ifdynkin@odd % For twisted A series diagrams, is the rank odd? @@ -1454,7 +1670,10 @@ % Default maximum number of nodes arranged vertically in the folding of the Dynkin diagram \def\dynkin@label@directions{} -% List of directions in which to draw the labels attached to the roots: a=above, b=below, l=left, r=right. +% List of directions in which to draw the labels attached to the roots. + +\def\dynkin@label@directions@star{} +% List of directions in which to draw the labels attached to the roots, for alternate labels. \def\dynkin@current@location{(0,0)} @@ -1469,76 +1688,80 @@ name = anonymous, mark/.estore in = \dynkin@root@mark, mark = *, - affineMark/.estore in = \dynkin@affine@root@mark, - affineMark = o, - edgeLength/.estore in = \dynkin@edge@length, - edgeLength = .35cm, + affine mark/.estore in = \dynkin@affine@root@mark, + affine mark = o, + edge length/.estore in = \dynkin@edge@length, + edge length = .35cm, edge/.style={draw=black,fill=white,thin}, - makeIndefiniteEdge/.code={\dynkin@set@edge@indefinite@pair{#1}}, - indefiniteEdgeRatio/.estore in = \dynkin@indefinite@edge@ratio, - indefiniteEdgeRatio = 1.6, - indefiniteEdge/.style={draw=black,fill=white,thin,densely dotted}, + make indefinite edge/.code={\dynkin@set@edge@indefinite@pair{#1}}, + indefinite edge ratio/.estore in = \dynkin@indefinite@edge@ratio, + indefinite edge ratio = 1.6, + indefinite edge/.style={draw=black,fill=white,thin,densely dotted}, + backwards/.is if = dynkin@is@backwards, + backwards = false, + upside down/.is if = dynkin@is@upsidedown, + upside down = false, arrows/.is if = dynkin@arrows, arrows = true, - reverseArrows/.is if = dynkin@reverse@arrows, - reverseArrows = false, - foldStyle/.style = {draw=black!40,fill=none,line width=\dynkin@root@radius}, - leftFold/.style = {}, - rightFold/.style = {}, - arrowColor/.estore in = \dynkin@arrow@color, - arrowColor=black, - doubleEdges/.style = { - foldStyle/.style = { + reverse arrows/.is if = dynkin@reverse@arrows, + reverse arrows = false, + fold style/.style = {draw=black!40,fill=none,line width=\dynkin@root@radius}, + fold left style/.style = {}, + fold right style/.style = {}, + arrow color/.estore in = \dynkin@arrow@color, + arrow color = black, + double edges/.style = { + fold style/.style = { draw=black, double=white, fill=none, double distance=\dynkin@root@radius, line width=\defaultpgflinewidth} }, - doubleFold/.style = { - foldStyle/.style = { + double fold/.style = { + fold style/.style = { draw=black, double=black!40, fill=none, double distance=\dynkin@root@radius, line width=\defaultpgflinewidth} }, - doubleLeft/.style = { - leftFold/.style = { + double left/.style = { + fold left style/.style = { draw=black, double=white, fill=none, double distance=\dynkin@root@radius, line width=\defaultpgflinewidth} }, - doubleFoldLeft/.style = { - leftFold/.style = { + double fold left/.style = { + fold left style/.style = { draw=black, double=black!40, fill=none, double distance=\dynkin@root@radius, line width=\defaultpgflinewidth} }, - doubleRight/.style = { - rightFold/.style = { + double right/.style = { + fold right style/.style = { draw=black, double=white, fill=none, double distance=\dynkin@root@radius, line width=\defaultpgflinewidth} }, - doubleFoldRight/.style = { - rightFold/.style = { + double fold right/.style = { + fold right style/.style = { draw=black, double=black!40, fill=none, double distance=\dynkin@root@radius, line width=\defaultpgflinewidth} }, - radius/.estore in = \dynkin@root@radius, - radius=.05cm, - foldradius/.estore in = \dynkin@fold@radius, - foldradius=.3cm, + root radius/.estore in = \dynkin@root@radius, + root radius=.05cm, + fold radius/.estore in = \dynkin@fold@radius, + fold radius=.3cm, */.style = { draw=black, fill=black, @@ -1549,7 +1772,8 @@ }, X/.style = { draw=black, - thick + very thick, + line cap=round }, o/.style = { draw=black, @@ -1560,36 +1784,39 @@ fill=white, }, x/.style = { + thick, draw=black, + line cap=round }, Coxeter/.is if = dynkin@Coxeter, Coxeter=false, ordering/.store in = \dynkin@ordering, ordering = Bourbaki, text/.style={scale=.7}, - labelMacro/.code = {\regurgitate{#1}}, + label macro/.code = {\regurgitate{#1}}, + label macro*/.code = {\regurgitate{#1}}, + labels/.store in = \dynkin@label@list, + labels*/.store in = \dynkin@label@list@star, odd/.is if = dynkin@odd, odd=false, + Kac arrows/.is if = dynkin@Kac@arrows, + Kac arrows=false, Kac/.style={ + Kac arrows=true, ordering=Kac, - radius=.05cm, - edgeLength=.66cm, - indefiniteEdgeRatio = 3, - o/.style = - { - draw=black, - fill=white, - preaction={ - draw=white, - line width=.9mm - } - }, + root radius=.05cm, + edge length=.66cm, + indefinite edge ratio = 3, + edge/.style={draw=black,fill=white,thin,shorten <=1mm,shorten >=1mm}, + fold style/.style = {draw=black!40,fill=none,line width=\dynkin@root@radius,shorten <=1mm,shorten >=1mm}, mark=o, - indefiniteEdge/.style={draw=black,fill=white,thin,loosely dotted}, + indefinite edge/.style={draw=black,fill=none,thin,loosely dotted}, }, default/.style = { label/.is if = dynkin@label@the@roots, label = false, + labels = {}, + labels* = {}, at/.estore in = \dynkin@current@location, at = {(0,0)}, parabolic/.estore in = \dynkin@parabolic, @@ -1600,46 +1827,71 @@ extended = false, twisted/.is if = dynkin@is@twisted, twisted = false, - twistedSeries/.estore in = \dynkin@twisted@series, - twistedSeries = 0, + twisted series/.estore in = \dynkin@twisted@series, + twisted series = 0, ply/.estore in = \dynkin@ply@value, ply = 1, fold/.style = {ply=2}, - foldleft/.is if = dynkin@left@fold, - foldleft = false, - foldright/.is if = dynkin@right@fold, - foldright = false, + fold left/.is if = dynkin@left@fold, + fold left = false, + fold right/.is if = dynkin@right@fold, + fold right = false, }, .search also={/tikz}, } \ProcessPgfPackageOptions{/Dynkin diagram}\relax -%% \dynkin@put@direction{<r>}{<d>} -%% Assigns to \dynkin@label@directions the direction that the label of root <r> (in default ordering) should sit from the root node location, <d>=left, right, above, below or diagonal. -\NewDocumentCommand\dynkin@put@direction{mm}% +\newcount\drpo% +\newcount\dynkin@where% + +%% \dynkin@put@direction{<r>}{<d>}{<d*>} +%% 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}% {% - \newcount\drpo% \drpo=\the\dynkin@nodes% \advance\drpo by 1% - \newcount\dynkin@where% - \dynkin@where=#1% - \StrMid{\dynkin@label@directions}{1}{\the\dynkin@where}[\dynkin@start]% - \advance\dynkin@where by 2 - \StrMid{\dynkin@label@directions}{\the\dynkin@where}{\the\drpo}[\dynkin@end]% - \IfStrEqCase{#2}{% - {left}{\xdef\dynkin@label@directions{\dynkin@start l\dynkin@end}}% - {right}{\xdef\dynkin@label@directions{\dynkin@start r\dynkin@end}}% - {above}{\xdef\dynkin@label@directions{\dynkin@start a\dynkin@end}}% - {below}{\xdef\dynkin@label@directions{\dynkin@start b\dynkin@end}}% - {diagonal}{\xdef\dynkin@label@directions{\dynkin@start d\dynkin@end}}% + \dynkin@where=#2% + \IfBooleanTF{#1}% + {% + \StrMid{\dynkin@label@directions@star}{1}{\the\dynkin@where}[\dynkin@start]% + \advance\dynkin@where by 2 + \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}}% + {above right}{\xdef\dynkin@label@directions@star{\dynkin@start 1\dynkin@end}}% + {above}{\xdef\dynkin@label@directions@star{\dynkin@start 2\dynkin@end}}% + {above left}{\xdef\dynkin@label@directions@star{\dynkin@start 3\dynkin@end}}% + {left}{\xdef\dynkin@label@directions@star{\dynkin@start 4\dynkin@end}}% + {below left}{\xdef\dynkin@label@directions@star{\dynkin@start 5\dynkin@end}}% + {below}{\xdef\dynkin@label@directions@star{\dynkin@start 6\dynkin@end}}% + {below right}{\xdef\dynkin@label@directions@star{\dynkin@start 7\dynkin@end}}% + }% + [\ClassError{Dynkin diagrams}% + {Unrecognized direction: ``#2'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}{}]% + }% + {% + \StrMid{\dynkin@label@directions}{1}{\the\dynkin@where}[\dynkin@start]% + \advance\dynkin@where by 2 + \StrMid{\dynkin@label@directions}{\the\dynkin@where}{\the\drpo}[\dynkin@end]% + \IfStrEqCase{#3}{% + {right}{\xdef\dynkin@label@directions{\dynkin@start 0\dynkin@end}}% + {above right}{\xdef\dynkin@label@directions{\dynkin@start 1\dynkin@end}}% + {above}{\xdef\dynkin@label@directions{\dynkin@start 2\dynkin@end}}% + {above left}{\xdef\dynkin@label@directions{\dynkin@start 3\dynkin@end}}% + {left}{\xdef\dynkin@label@directions{\dynkin@start 4\dynkin@end}}% + {below left}{\xdef\dynkin@label@directions{\dynkin@start 5\dynkin@end}}% + {below}{\xdef\dynkin@label@directions{\dynkin@start 6\dynkin@end}}% + {below right}{\xdef\dynkin@label@directions{\dynkin@start 7\dynkin@end}}% + }% + [\ClassError{Dynkin diagrams}% + {Unrecognized direction: ``#2'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}{}]% }% - [\ClassError{Dynkin diagrams}{Unrecognized direction: ``#2'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}{}]% }% -\xdef\replace@DR{} - +%\xdef\replace@DR{} +% % \expand@Dynkin@Roots@By@Char{<c>}, % for example if <c> is the letter x, expands out any expression like % x7 in \dynkin@string into 7 copies of the letter x. @@ -1735,12 +1987,14 @@ {% \xdef\dynkin@indefinite@edge@list{}% }% +% + +\newcount\first% +\newcount\second% \NewDocumentCommand\dynkin@set@edge@indefinite{mm}% {% - \newcount\first% \first=#1\relax% - \newcount\second% \second=#2\relax% \ifnum\the\first<\the\second% \listxadd\dynkin@indefinite@edge@list{\the\first,\the\second}% @@ -1777,9 +2031,7 @@ \@toRoot=#3% }% % Next we sort the order, since edges are stored as undirected edges. - \newcount\first% \global\first=\@fromRoot\relax% - \newcount\second% \global\second=\@toRoot\relax% \ifnum\the\second<\the\first% \global\first=\@toRoot\relax% @@ -1793,13 +2045,16 @@ \dolistloop{\dynkin@indefinite@edge@list}% }% + +\newcount\rootnum +\newcount\dynkin@string@length +\newcount\rootnumpo% + % \dynkin@grok@indefinite@edges{} reads the input string <s> found when you write \dynkin{<c>}{<s>}, and % interprets it to say which edges are indefinite edges. \NewDocumentCommand\dynkin@grok@indefinite@edges{}% {% - \newcount\rootnum \rootnum=1 - \newcount\dynkin@string@length \StrLen{\dynkin@string}[\temp]% \dynkin@string@length=\temp \foreach \i in {2,...,\the\dynkin@string@length}% @@ -1807,7 +2062,6 @@ \StrChar{\dynkin@string}{\i}[\c]% \IfStrEq{\c}{.}% {% - \newcount\rootnumpo% \rootnumpo=\rootnum% \advance\rootnumpo by 1\relax% \ifnum\the\rootnum<\the\dynkin@nodes% @@ -1827,38 +2081,53 @@ \NewDocumentCommand\dynkin@clear@label@directions{}% {% \xdef\dynkin@label@directions{}% + \xdef\dynkin@label@directions@star{}% }% \NewDocumentCommand\dynkin@set@default@label@directions{}% {% - \newcount\drpo% +% \newcount\drpo% \drpo=\the\dynkin@nodes% \advance\drpo by 1\relax% \xdef\dynkin@label@directions{\repeatCharacter{\the\drpo}{?}}% + \xdef\dynkin@label@directions@star{\repeatCharacter{\the\drpo}{?}}% }% \newlength{\defaultpgflinewidth}% - - -% \@dynkin[<s>]{<X>}[<sb>]{<Y>} -% Draws a complete Dynkin diagram of -% series <X> and -% subseries <sb>, -% described by the string <Y> -% with TikZ options specified by <s>. +% +% +%% \@dynkin[<s>]{<X>}[<sb>]{<Y>} +%% Draws a complete Dynkin diagram of +%% series <X> and +%% subseries <sb>, +%% described by the string <Y> +%% with TikZ options specified by <s>. \NewDocumentCommand\@dynkin{O{}mO{0}m}% {% + \setcounter{dynkinRootNo}{0}% \setlength{\defaultpgflinewidth}{\pgflinewidth}% \global\defaultpgflinewidth=\defaultpgflinewidth\relax% \dynkin@clear@indefinite@edge@list% \xdef\dynkin@parabolic{0}% \pgfkeys{/Dynkin diagram, default, #1}% + \ifdynkin@is@backwards% + \tikzset{xscale=-1}% + \fi% + \ifdynkin@is@upsidedown% + \tikzset{yscale=-1}% + \fi% + \IfStrEq{\dynkin@label@list\dynkin@label@list@star}{}% + {% + }% + {% + \global\dynkin@label@the@rootstrue% + }% \xdef\dynkin@user@series{#2}% \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}% {% @@ -1891,7 +2160,9 @@ \dynkin@cross@out@parabolics{}% \dynkin@set@default@label@directions{}% \check@Dynkin@diagram{}% - \node (Dynkin current) at \dynkin@current@location{};% + \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)$){}; \ifdynkin@is@twisted% \csname twisted\dynkin@series dynkin\endcsname% \else% @@ -1903,7 +2174,7 @@ \fi% \dynkinRefreshRoots% }% - +% %% We know the number of nodes; lets find the rank. \NewDocumentCommand\dynkin@find@rank{}% {% @@ -1940,11 +2211,12 @@ \fi% }% +\newcount\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{}% {% - \newcount\lenny \StrLen{\dynkin@series}[\lenny] \ifnum\lenny>1% \dynkin@error@series% @@ -1953,7 +2225,7 @@ \IfStrEqCase{\dynkin@twisted@series}% {% {0}{}% - {1}{ \global\dynkin@is@extendedtrue}% + {1}{ \global\dynkin@is@extendedtrue}% {2}{% \IfSubStr{ADE}{\dynkin@series}% {% @@ -2150,6 +2422,15 @@ \fi% }% +\NewDocumentCommand\dynkin@error@not@in@tikz{} +{% + \ClassError% + {Dynkin diagrams}% + {Dynkin diagram macros called outside of tikz environment}% + {}% +}% + + \NewDocumentCommand\dynkin@error@root@ordering{} {% \ClassError% @@ -2281,10 +2562,10 @@ }% -% A slight headache: all of the routines that draw Dynkin diagrams are written -% in Bourbaki ordering. We store the roots in the current ordering. -% So when we draw edges, we need to convert from the Bourbaki ordering each time. -% We store the conversions here. +%% A slight headache: all of the routines that draw Dynkin diagrams are written +%% in Bourbaki ordering. We store the roots in the current ordering. +%% So when we draw edges, we need to convert from the Bourbaki ordering each time. +%% We store the conversions here. \newcount\RootNumber \newcount\@fromRoot \newcount\@toRoot @@ -2329,10 +2610,10 @@ {% {TestOrder}% {% - \RootNumber=#1 - \advance\RootNumber by 1 + \global\RootNumber=#1 + \global\advance\RootNumber by 1 \ifnum\RootNumber>\the\dynkin@rank% - \RootNumber=1% + \global\RootNumber=1% \fi% }% }% @@ -2344,7 +2625,16 @@ {% {Adams}{\swapRootIfInLastTwoRoots{#1}}% {Dynkin}{\swapRootIfInLastTwoRoots{#1}}% - {Kac}{\swapRootIfInLastTwoRoots{#1}}% + {Kac}{% + \ifdynkin@is@twisted + \global\RootNumber=#1 + \else + \ifdynkin@is@extended + \global\RootNumber=#1 + \else + \swapRootIfInLastTwoRoots{#1} + \fi + \fi}% }% [\global\RootNumber=#1]% }% @@ -2415,9 +2705,9 @@ \NewDocumentCommand\convertRootPair{mm} {% \convertRootNumber{#1}% - \@fromRoot=\RootNumber% + \global\@fromRoot=\RootNumber% \convertRootNumber{#2}% - \@toRoot=\RootNumber% + \global\@toRoot=\RootNumber% }% \ExplSyntaxOn @@ -2484,14 +2774,16 @@ \node (Dynkin current) at (\dynkin@root@name \the\RootNumber){};% }% -%% \dynkinPlaceRootHere{<n>}{<L>} -%% \dynkinPlaceRootHere*{<n>}{<L>} +%% \dynkinPlaceRootHere{<n>}{<L>}{<L*>} +%% \dynkinPlaceRootHere*{<n>}{<L>}{<L*>} %% Tell TikZ to place node <n> for a root of a Dynkin diagram at the current %% cursor location. Draws nothing. -%% <L>=label positioning: above, below, left, right +%% <L>=label positioning: above, below, left, right, above left, above right, below left, below right. +%% <L*> similarly, the alternate label position. %% Starred form converts <n> from Bourbaki ordering to default ordering. -\NewDocumentCommand\dynkinPlaceRootHere{smm}% +\NewDocumentCommand\dynkinPlaceRootHere{smmm}% {% +\xdef\yyyy{#2} \IfBooleanTF{#1}% {% \convertRootNumber{#2}% @@ -2501,21 +2793,28 @@ }% \node (\dynkin@root@name \the\RootNumber) at (Dynkin current) {};% \dynkin@put@direction{\the\RootNumber}{#3}% + \dynkin@put@direction*{\the\RootNumber}{#4}% }% -%% \dynkinPlaceRootRelativeTo{<p>}{<q>}{<d>}{<L>} -%% \dynkinPlaceRootRelativeTo*{<p>}{<q>}{<d>}{<L>} + +\newif\ifdynkin@hex@grid +\dynkin@hex@gridtrue + +%% \dynkinPlaceRootRelativeTo{<p>}{<q>}{<d>}{<L>}{<L*>} +%% \dynkinPlaceRootRelativeTo*{<p>}{<q>}{<d>}{<L>}{<L*>} %% Tell TikZ to place node <p> for a root of a Dynkin diagram at a location %% in direction <d> from root <q>. Draws nothing. -%% <L> is the label position: above, below, left, right. +%% <L> is the label position: above, below, left, right, above left, above right, below left, below right. +%% <L*> is the position of the alternate label similarly. %% <d> is the direction from <q>: %% west,east,south,north, %% northeast,northwest,southeast,southwest, %% southfold,northfold, %% southeastfold,southwestfold,northeastfold,northwestfold. %% Starred form is in Bourbaki root ordering; otherwise default ordering. -\NewDocumentCommand\dynkinPlaceRootRelativeTo{smmmm}% +\NewDocumentCommand\dynkinPlaceRootRelativeTo{smmmmm}% {% +\xdef\ssss{#2} \IfBooleanTF{#1}% {% \convertRootPair{#3}{#2}% @@ -2530,25 +2829,59 @@ \else \xdef\dynkin@distance{\dynkin@edge@length} \fi - \IfStrEqCase{#4}% - {% - {west}{\xdef\x{-\dynkin@distance}\xdef\y{0}}% - {east}{\xdef\x{\dynkin@distance}\xdef\y{0}}% - {south}{\xdef\x{0}\xdef\y{-\dynkin@distance}}% - {north}{\xdef\x{0}\xdef\y{\dynkin@distance}}% - {southeast}{\xdef\x{cos(-60)*\dynkin@distance}\xdef\y{sin(-60)*\dynkin@distance}}% - {southwest}{\xdef\x{cos(240)*\dynkin@distance}\xdef\y{sin(240)*\dynkin@distance}}% - {northeast}{\xdef\x{cos(60)*\dynkin@distance}\xdef\y{sin(60)*\dynkin@distance}}% - {northwest}{\xdef\x{cos(120)*\dynkin@distance}\xdef\y{sin(120)*\dynkin@distance}}% - {southeastfold}{\xdef\x{\dynkin@fold@radius}\xdef\y{-\dynkin@fold@radius}}% - {southwestfold}{\xdef\x{-\dynkin@fold@radius}\xdef\y{-\dynkin@fold@radius}}% - {northeastfold}{\xdef\x{\dynkin@fold@radius}\xdef\y{\dynkin@fold@radius}}% - {northwestfold}{\xdef\x{-\dynkin@fold@radius}\xdef\y{\dynkin@fold@radius}}% - {northfold}{\xdef\x{0}\xdef\y{2*\dynkin@fold@radius}}% - {southfold}{\xdef\x{0}\xdef\y{-2*\dynkin@fold@radius}}% - }% - \node (Dynkin current) at ($(\dynkin@root@name \the\@fromRoot)+({\x},{\y})$){}; - \dynkinPlaceRootHere{\@toRoot}{#5}% + \ifdynkin@hex@grid + \IfStrEqCase{#4}% + {% + {west}{\xdef\xd{-\dynkin@distance}\xdef\yd{0}}% + {east}{\xdef\xd{\dynkin@distance}\xdef\yd{0}}% + {south}{\xdef\xd{0}\xdef\yd{-\dynkin@distance}}% + {north}{\xdef\xd{0}\xdef\yd{\dynkin@distance}}% + {southeast}{\xdef\xd{cos(-60)*\dynkin@distance}\xdef\yd{sin(-60)*\dynkin@distance}}% + {southwest}{\xdef\xd{cos(240)*\dynkin@distance}\xdef\yd{sin(240)*\dynkin@distance}}% + {northeast}{\xdef\xd{cos(60)*\dynkin@distance}\xdef\yd{sin(60)*\dynkin@distance}}% + {northwest}{\xdef\xd{cos(120)*\dynkin@distance}\xdef\yd{sin(120)*\dynkin@distance}}% + {southeastfold}{\xdef\xd{\dynkin@fold@radius}\xdef\yd{-\dynkin@fold@radius}}% + {southwestfold}{\xdef\xd{-\dynkin@fold@radius}\xdef\yd{-\dynkin@fold@radius}}% + {northeastfold}{\xdef\xd{\dynkin@fold@radius}\xdef\yd{\dynkin@fold@radius}}% + {northwestfold}{\xdef\xd{-\dynkin@fold@radius}\xdef\yd{\dynkin@fold@radius}}% + {northfold}{\xdef\xd{0}\xdef\yd{2*\dynkin@fold@radius}}% + {southfold}{\xdef\xd{0}\xdef\yd{-2*\dynkin@fold@radius}}% + }% + \else% + \IfStrEqCase{#4}% + {% + {west}{\xdef\xd{-\dynkin@distance}\xdef\yd{0}}% + {east}{\xdef\xd{\dynkin@distance}\xdef\yd{0}}% + {south}{\xdef\xd{0}\xdef\yd{-\dynkin@distance}}% + {north}{\xdef\xd{0}\xdef\yd{\dynkin@distance}}% + {southeast}{\xdef\xd{cos(-45)*\dynkin@distance}\xdef\yd{sin(-45)*\dynkin@distance}}% + {southwest}{\xdef\xd{cos(225)*\dynkin@distance}\xdef\yd{sin(225)*\dynkin@distance}}% + {northeast}{\xdef\xd{cos(45)*\dynkin@distance}\xdef\yd{sin(45)*\dynkin@distance}}% + {northwest}{\xdef\xd{cos(135)*\dynkin@distance}\xdef\yd{sin(135)*\dynkin@distance}}% + {southeastfold}{\xdef\xd{\dynkin@fold@radius}\xdef\yd{-\dynkin@fold@radius}}% + {southwestfold}{\xdef\xd{-\dynkin@fold@radius}\xdef\yd{-\dynkin@fold@radius}}% + {northeastfold}{\xdef\xd{\dynkin@fold@radius}\xdef\yd{\dynkin@fold@radius}}% + {northwestfold}{\xdef\xd{-\dynkin@fold@radius}\xdef\yd{\dynkin@fold@radius}}% + {northfold}{\xdef\xd{0}\xdef\yd{2*\dynkin@fold@radius}}% + {southfold}{\xdef\xd{0}\xdef\yd{-2*\dynkin@fold@radius}}% + }% + \fi + \node (Dynkin current) at ($(\dynkin@root@name \the\@fromRoot)+({\xd},{\yd})$){}; + \dynkinPlaceRootHere{\the\@toRoot}{#5}{#6}% +}% + +% Jump the current location by a certain multiple of the fold radius. +\NewDocumentCommand\dynkin@jump{m}% +{% +\xdef\yj{#1*\dynkin@fold@radius}% +\node (Dynkin current) at ($(Dynkin current)+(0,{\yj})$){};% +}% + +% Jump the current location by a certain multiple of the edge radius multiplied by sin(60). +\NewDocumentCommand\dynkin@hop{m}% +{% +\xdef\yjj{#1*\dynkin@edge@length*sin(60)}% +\node (Dynkin current) at ($(Dynkin current)+(0,{\yjj})$){};% }% %% \dynkinEast @@ -2560,8 +2893,6 @@ \node (Dynkin current) at ($(Dynkin current)+({\distance},0)$) {};% }% - - %% \dynkinWest %% Moves the TikZ cursor one edge to the left. %% Starred form for an indefinite edge. @@ -2677,7 +3008,6 @@ \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 @@ -2701,25 +3031,29 @@ \fi% }% -%% \dynkin@pipe{<f>}{<t>}{<D>}{<L>} +\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{mmmm}% -{% - \newcount\start@root - \start@root=#1 - \ifnum\start@root<#2% - \newcount\bmo - \bmo=#1 - \newcount\fpo - \fpo=#1 - \advance\fpo by 1 - \foreach \b in {\the\fpo,...,#2}% +\NewDocumentCommand\dynkin@pipe{mmmmm}% +{% + \start@pipe=#1 + \pipe@end=#2 + \ifnum\start@pipe<\the\pipe@end% + \global\pipebmo=\the\start@pipe + \global\pipefpo=\the\start@pipe + \global\advance\pipefpo by 1 + \foreach \bpipe in {\the\pipefpo,...,\the\pipe@end}% {% - \dynkinPlaceRootRelativeTo*{\b}{\the\bmo}{#3}{#4}% - \dynkinEdge*{SingleEdge}{\b}{\the\bmo}% - \global\advance\bmo by 1% + \dynkinPlaceRootRelativeTo*{\bpipe}{\the\pipebmo}{#3}{#4}{#5}% + \dynkinEdge*{SingleEdge}{\bpipe}{\the\pipebmo}% + \global\advance\pipebmo by 1% }% \fi% }% @@ -2735,7 +3069,7 @@ \advance\h by #2% \advance\h by -1% \divide\h by 2% - \dynkin@pipe{#1}{\the\h}{east}{above} + \dynkin@pipe{#1}{\the\h}{east}{above}{below right} \newcount\hpo \hpo=\the\h \advance\hpo by 1 @@ -2747,15 +3081,15 @@ \advance\nrts by -#1 \ifodd\nrts% \global\advance\afterfold by 1 - \dynkinPlaceRootRelativeTo*{\the\hpo}{\the\h}{southeastfold}{right} + \dynkinPlaceRootRelativeTo*{\the\hpo}{\the\h}{southeastfold}{right}{left} \dynkinEdge*{RightDownArc}{\the\h}{\the\hpo}% - \dynkinPlaceRootRelativeTo*{\the\afterfold}{\the\hpo}{southwestfold}{below} + \dynkinPlaceRootRelativeTo*{\the\afterfold}{\the\hpo}{southwestfold}{below}{above right} \dynkinEdge*{RightUpArc}{\the\afterfold}{\the\hpo}% \else - \dynkinPlaceRootRelativeTo*{\the\afterfold}{\the\h}{southfold}{below} + \dynkinPlaceRootRelativeTo*{\the\afterfold}{\the\h}{southfold}{below}{above right} \dynkinEdge*{SemiCircle}{\the\h}{\the\afterfold}% \fi - \dynkin@pipe{\the\afterfold}{#2}{west}{below} + \dynkin@pipe{\the\afterfold}{#2}{west}{below}{above right} \ifdynkin@arrows% \newcount\countdown% \countdown=#2% @@ -2776,20 +3110,23 @@ \fi% % % Create the roots. \ifnum\dynkin@ply>1% - \dynkinPlaceRootHere*{1}{above}% + \ifnum\dynkin@ply=2% + \dynkin@jump{1}% + \fi% + \dynkinPlaceRootHere*{1}{above}{below right}% \dynkin@fold{1}{\the\dynkin@rank}% \else% - \dynkinPlaceRootHere*{1}{below}% + \dynkinPlaceRootHere*{1}{below}{above}% \ifnum\dynkin@rank>1% - \dynkin@pipe{1}{\the\dynkin@rank}{east}{below}% + \dynkin@pipe{1}{\the\dynkin@rank}{east}{below}{above}% \fi% \fi% }% %% \Bdynkin %% Draw a B series Dynkin diagram. -\newcommand*{\Bdynkin} -{ +\NewDocumentCommand\Bdynkin{}% +{% \ifnum\dynkin@rank<2 \Adynkin \else @@ -2804,31 +3141,34 @@ {\(4\)}; \else % Create the roots. - \ifnum\dynkin@ply>1% + \ifnum\dynkin@ply>1% \ifnum\dynkin@rank>3% - \dynkinPlaceRootHere*{1}{above}% - \dynkinPlaceRootRelativeTo*{2}{1}{east}{above}% + \dynkin@jump{1}% + \dynkinPlaceRootHere*{1}{above}{below right}% + \dynkinPlaceRootRelativeTo*{2}{1}{east}{above}{below right}% \dynkin@fold{2}{\the\drmo}% - \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\drmo}{west}{below}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\drmo}{west}{below}{above right}% \dynkinEdge*{DoubleEdge}{\the\drmo}{\the\dynkin@rank}% \dynkinEdge*{SingleEdge}{1}{2}% \else% \ifnum\dynkin@rank=2% - \dynkinPlaceRootHere*{1}{left}% - \dynkinPlaceRootRelativeTo*{2}{1}{southfold}{left}% + \dynkin@jump{1}% + \dynkinPlaceRootHere*{1}{above}{below right}% + \dynkinPlaceRootRelativeTo*{2}{1}{southfold}{below}{above right}% \dynkinEdge*{DoubleDownRightSemiCircle}{1}{2}% \else% - \dynkinPlaceRootHere*{1}{left}% - \dynkinPlaceRootRelativeTo*{2}{1}{southeastfold}{right}% - \dynkinPlaceRootRelativeTo*{3}{2}{southwestfold}{left}% + \dynkin@jump{1}% + \dynkinPlaceRootHere*{1}{above}{below right}% + \dynkinPlaceRootRelativeTo*{2}{1}{southeastfold}{right}{left}% + \dynkinPlaceRootRelativeTo*{3}{2}{southwestfold}{below}{above right}% \dynkinEdge*{RightDownArc}{1}{2}% \dynkinEdge*{DoubleDownLeftArc}{2}{3}% \fi% \fi% \else% - \dynkinPlaceRootHere*{1}{below} - \dynkin@pipe{1}{\the\drmo}{east}{below} - \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\drmo}{east}{below} + \dynkinPlaceRootHere*{1}{below}{above} + \dynkin@pipe{1}{\the\drmo}{east}{below}{above} + \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\drmo}{east}{below}{above} \dynkinEdge*{DoubleEdge}{\the\drmo}{\the\dynkin@rank}% \fi% \ifdynkin@arrows% @@ -2865,35 +3205,47 @@ \ifdynkin@is@extended% \ifnum\dynkin@ply>1% \ifnum\dynkin@rank=4% - \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{right}% + \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{left}{right}% \else% - \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below}% + \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below right}{above right}% \fi% - \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}% + \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}{above left}% \else% \ifdynkin@left@fold% - \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below}% - \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}% + \ifnum\dynkin@rank=4% + \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{left}{right}% + \else% + \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below right}{above right}% + \fi% + \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}{above left}% \else% - \dynkinPlaceRootRelativeTo*{2}{0}{southeast}{left}% - \dynkinPlaceRootRelativeTo*{1}{2}{southwest}{left}% + \ifnum\dynkin@rank=4% + \ifdynkin@right@fold% + \dynkinPlaceRootRelativeTo*{2}{0}{southeast}{left}{right}% + \else% + \dynkinPlaceRootRelativeTo*{2}{0}{southeast}{below}{above}% + \fi% + \else% + \dynkinPlaceRootRelativeTo*{2}{0}{southeast}{below right}{above right}% + \fi% + \dynkinPlaceRootRelativeTo*{1}{2}{southwest}{left}{above left}% \fi% \fi% \dynkinMoveToRoot*{2}% \else - \dynkinPlaceRootHere*{1}{below} + \dynkinPlaceRootHere*{1}{below}{above} \ifnum\dynkin@rank=4% \ifdynkin@right@fold% - \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}% + \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}{above}% \else% \ifnum\dynkin@ply>1% - \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}% + \dynkinPlaceRootRelativeTo*{2}{1}{east}{below left}{above left}% \else% - \dynkinPlaceRootRelativeTo*{2}{1}{east}{right}% + \dynkinPlaceRootRelativeTo*{2}{1}{east}{below left}{above left}% \fi% \fi% \else% - \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}% + \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}{above}% \fi% \fi \newcount\rmo @@ -2907,52 +3259,48 @@ \advance\rmth by -1 \ifnum\dynkin@rank>2 \ifnum\dynkin@rank>5% - \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}% + \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}{above}% \else% \ifnum\dynkin@ply>1% - \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}% + \dynkinPlaceRootRelativeTo*{3}{2}{east}{below left}{above left}% \else% -% \ifdynkin@left@fold% -% \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}% -% \else% \ifnum\dynkin@rank=5% \ifdynkin@right@fold% - \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}% + \dynkinPlaceRootRelativeTo*{3}{2}{east}{below left}{above left}% \else% - \dynkinPlaceRootRelativeTo*{3}{2}{east}{right}% + \dynkinPlaceRootRelativeTo*{3}{2}{east}{below left}{above left}% \fi% \else% - \dynkinPlaceRootRelativeTo*{3}{2}{east}{right}% + \dynkinPlaceRootRelativeTo*{3}{2}{east}{below right}{above left}% \fi% -% \fi% \fi% \fi% \ifnum\rmth>3% - \dynkin@pipe{3}{\the\rmth}{east}{below}% + \dynkin@pipe{3}{\the\rmth}{east}{below}{above}% \fi% \ifnum\rmt>3% \ifnum\dynkin@ply>1% - \dynkinPlaceRootRelativeTo*{\rmt}{\rmth}{east}{below}% + \dynkinPlaceRootRelativeTo*{\rmt}{\rmth}{east}{below left}{above left}% \else% \ifdynkin@right@fold% - \dynkinPlaceRootRelativeTo*{\rmt}{\rmth}{east}{below}% + \dynkinPlaceRootRelativeTo*{\rmt}{\rmth}{east}{below left}{above left}% \else% - \dynkinPlaceRootRelativeTo*{\rmt}{\rmth}{east}{right}% + \dynkinPlaceRootRelativeTo*{\rmt}{\rmth}{east}{below left}{above left}% \fi% \fi% \dynkinEdge*{SingleEdge}{\rmt}{\rmth}% \fi% \ifnum\dynkin@ply=1% \ifdynkin@right@fold% - \dynkinPlaceRootRelativeTo*{\the\rmo}{\the\rmt}{northeastfold}{right}% - \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\rmt}{southeastfold}{right}% + \dynkinPlaceRootRelativeTo*{\the\rmo}{\the\rmt}{northeastfold}{right}{above right}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\rmt}{southeastfold}{right}{above right}% \else% - \dynkinPlaceRootRelativeTo*{\the\rmo}{\the\rmt}{northeast}{right}% - \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\rmt}{southeast}{right}% + \dynkinPlaceRootRelativeTo*{\the\rmo}{\the\rmt}{northeast}{right}{above right}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\rmt}{southeast}{right}{above right}% \fi% \else% - \dynkinPlaceRootRelativeTo*{\the\rmo}{\the\rmt}{northeastfold}{right}% - \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\rmt}{southeastfold}{right}% + \dynkinPlaceRootRelativeTo*{\the\rmo}{\the\rmt}{northeastfold}{right}{above right}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\rmt}{southeastfold}{right}{above right}% \fi% \fi% }% @@ -3018,19 +3366,25 @@ \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{}% {% \ifdynkin@right@fold% - \dynkinPlaceRootHere*{2}{right}% + \dynkinPlaceRootHere*{1}{below left}{above right}% + \dynkinPlaceRootRelativeTo*{3}{1}{east}{below left}{above right}% \xdef\old@edge@length{\dynkin@edge@length}% \pgfmathparse{1.5*\dynkin@edge@length}% \xdef\dynkin@edge@length{\pgfmathresult pt}% - \dynkinPlaceRootRelativeTo*{3}{2}{south}{right}% - \dynkinPlaceRootRelativeTo*{4}{3}{south}{right}% + \dynkinPlaceRootRelativeTo*{2}{3}{north}{below left}{above right}% + \dynkinPlaceRootRelativeTo*{4}{3}{south}{below}{above right}% \xdef\dynkin@edge@length{\old@edge@length}% - \dynkinPlaceRootRelativeTo*{1}{3}{west}{left}% \edef\old@fold@radius{\dynkin@fold@radius}% \xdef\dynkin@fold@radius{\dynkin@edge@length}% \dynkinEdge*{SingleEdge}{1}{3}% @@ -3042,14 +3396,17 @@ \dynkin@fold@arrow@if@oo{3}{4}% \fi% \else% - \global\dynkin@ply=1\relax% - \Ddynkin{}% + \dynkinPlaceRootHere*{1}{left}{above right}% + \dynkinPlaceRootRelativeTo*{2}{1}{east}{below left}{above left}% + \dynkinPlaceRootRelativeTo*{3}{2}{northeast}{above right}{below}% + \dynkinPlaceRootRelativeTo*{4}{2}{southeast}{below right}{left}% + \dynkinEdge*{SingleEdge}{1}{2}% + \dynkinEdge*{SingleEdge}{2}{3}% + \dynkinEdge*{SingleEdge}{2}{4}% \begin{scope}[on background layer]% - \draw - [/Dynkin diagram/foldStyle] - ($(\dynkin@root@name 2)$) - circle - (\dynkin@edge@length);% + \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}% \fi% }% @@ -3081,6 +3438,7 @@ \fi% \fi% \fi% + \gdef\dynkin@series{D}% \fi% }% @@ -3089,23 +3447,23 @@ \newcommand*{\Edynkin@unfolded}% { % Create the @roots. - \dynkinPlaceRootHere*{1}{below}% - \dynkinPlaceRootRelativeTo*{3}{1}{east}{below}% - \dynkinPlaceRootRelativeTo*{4}{3}{east}{below}% + \dynkinPlaceRootHere*{1}{below}{above}% + \dynkinPlaceRootRelativeTo*{3}{1}{east}{below}{above}% + \dynkinPlaceRootRelativeTo*{4}{3}{east}{below}{above right}% \ifdynkin@is@extended \ifnum\dynkin@rank=6 - \dynkinPlaceRootRelativeTo*{2}{4}{north}{right}% + \dynkinPlaceRootRelativeTo*{2}{4}{north}{right}{above right}% \else - \dynkinPlaceRootRelativeTo*{2}{4}{north}{above}% + \dynkinPlaceRootRelativeTo*{2}{4}{north}{right}{above}% \fi \else - \dynkinPlaceRootRelativeTo*{2}{4}{north}{above}% + \dynkinPlaceRootRelativeTo*{2}{4}{north}{right}{above}% \fi \newcount\bmo\relax% \bmo=4\relax% \foreach \b in {5,...,\dynkin@rank}% {% - \dynkinPlaceRootRelativeTo*{\b}{\the\bmo}{east}{below}% + \dynkinPlaceRootRelativeTo*{\b}{\the\bmo}{east}{below}{above}% \dynkinEdge*{SingleEdge}{\the\bmo}{\b}% \global\advance\bmo by 1% }% @@ -3115,14 +3473,14 @@ \dynkinEdge*{SingleEdge}{4}{2} \ifdynkin@is@extended% \ifnum\dynkin@rank=6% - \dynkinPlaceRootRelativeTo*{0}{2}{north}{above}% + \dynkinPlaceRootRelativeTo*{0}{2}{north}{right}{above}% \dynkinEdge*{SingleEdge}{0}{2}% \else% \ifnum\dynkin@rank=7% - \dynkinPlaceRootRelativeTo*{0}{1}{west}{below}% + \dynkinPlaceRootRelativeTo*{0}{1}{west}{below}{above}% \dynkinEdge*{SingleEdge}{0}{1}% \else% - \dynkinPlaceRootRelativeTo*{0}{8}{east}{below}% + \dynkinPlaceRootRelativeTo*{0}{8}{east}{below}{above}% \dynkinEdge*{SingleEdge}{0}{8}% \fi% \fi% @@ -3143,17 +3501,18 @@ \NewDocumentCommand\ESixTwoPly{}% {% - \dynkinPlaceRootHere*{1}{above}% - \dynkinPlaceRootRelativeTo*{3}{1}{east}{above}% - \dynkinPlaceRootRelativeTo*{4}{3}{southeastfold}{below}% - \dynkinPlaceRootRelativeTo*{5}{4}{southwestfold}{below}% - \dynkinPlaceRootRelativeTo*{6}{5}{west}{below}% + \dynkin@jump{1}% + \dynkinPlaceRootHere*{1}{above}{below right}% + \dynkinPlaceRootRelativeTo*{3}{1}{east}{above}{below right}% + \dynkinPlaceRootRelativeTo*{4}{3}{southeastfold}{below right}{above right}% + \dynkinPlaceRootRelativeTo*{5}{4}{southwestfold}{below}{above right}% + \dynkinPlaceRootRelativeTo*{6}{5}{west}{below}{above right}% \ifdynkin@is@extended% - \dynkinPlaceRootRelativeTo*{2}{4}{east}{below}% - \dynkinPlaceRootRelativeTo*{0}{2}{east}{right}% + \dynkinPlaceRootRelativeTo*{2}{4}{east}{below}{above}% + \dynkinPlaceRootRelativeTo*{0}{2}{east}{below}{above}% \dynkinEdge*{SingleEdge}{0}{2}% \else% - \dynkinPlaceRootRelativeTo*{2}{4}{east}{right}% + \dynkinPlaceRootRelativeTo*{2}{4}{east}{below}{above}% \fi% \dynkinEdge*{SingleEdge}{1}{3}% \dynkinEdge*{SingleEdge}{2}{4}% @@ -3169,19 +3528,21 @@ \NewDocumentCommand\ESixThreePly{}% {% - \dynkinPlaceRootHere*{3}{above}% + \dynkin@is@extendedtrue + \node (Dynkin current) at ($(Dynkin current)+(0,1.5*\dynkin@edge@length)$){};% + \dynkinPlaceRootHere*{3}{below left}{above}% \edef\old@edge@length{\dynkin@edge@length}% \pgfmathparse{1.5*\dynkin@edge@length}% \xdef\dynkin@edge@length{\pgfmathresult pt}% - \dynkinPlaceRootRelativeTo*{2}{3}{south}{diagonal}% - \dynkinPlaceRootRelativeTo*{5}{2}{south}{below}% + \dynkinPlaceRootRelativeTo*{2}{3}{south}{below left}{above right}% + \dynkinPlaceRootRelativeTo*{5}{2}{south}{below}{above right}% \xdef\dynkin@edge@length{\old@edge@length}% - \dynkinPlaceRootRelativeTo*{1}{3}{west}{left}% - \dynkinPlaceRootRelativeTo*{0}{2}{west}{left}% - \dynkinPlaceRootRelativeTo*{6}{5}{west}{left}% + \dynkinPlaceRootRelativeTo*{1}{3}{west}{below left}{above right}% + \dynkinPlaceRootRelativeTo*{0}{2}{west}{below left}{above right}% + \dynkinPlaceRootRelativeTo*{6}{5}{west}{below}{above right}% \edef\old@fold@radius{\dynkin@fold@radius}% \xdef\dynkin@fold@radius{\dynkin@edge@length}% - \dynkinPlaceRootRelativeTo*{4}{2}{east}{right}% + \dynkinPlaceRootRelativeTo*{4}{2}{east}{below left}{above right}% \dynkinEdge*{SingleEdge}{4}{2}% \dynkinEdge*{SingleEdge}{3}{1}% \dynkinEdge*{SingleEdge}{2}{0}% @@ -3199,14 +3560,15 @@ \NewDocumentCommand\extendedESevenFolded{}% {% - \dynkinPlaceRootHere*{0}{above}% - \dynkinPlaceRootRelativeTo*{1}{0}{east}{above}% - \dynkinPlaceRootRelativeTo*{3}{1}{east}{above}% - \dynkinPlaceRootRelativeTo*{4}{3}{southeastfold}{left}% - \dynkinPlaceRootRelativeTo*{5}{4}{southwestfold}{below}% - \dynkinPlaceRootRelativeTo*{6}{5}{west}{below}% - \dynkinPlaceRootRelativeTo*{7}{6}{west}{below}% - \dynkinPlaceRootRelativeTo*{2}{4}{east}{below}% + \dynkin@jump{1}% + \dynkinPlaceRootHere*{0}{above}{below}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{above}{below}% + \dynkinPlaceRootRelativeTo*{3}{1}{east}{above}{below}% + \dynkinPlaceRootRelativeTo*{4}{3}{southeastfold}{left}{right}% + \dynkinPlaceRootRelativeTo*{5}{4}{southwestfold}{below}{above}% + \dynkinPlaceRootRelativeTo*{6}{5}{west}{below}{above}% + \dynkinPlaceRootRelativeTo*{7}{6}{west}{below}{above}% + \dynkinPlaceRootRelativeTo*{2}{4}{east}{below}{above}% \dynkinEdge*{SingleEdge}{0}{1}% \dynkinEdge*{SingleEdge}{1}{3}% \dynkinEdge*{SingleEdge}{2}{4}% @@ -3226,12 +3588,12 @@ %% Draws an E6 Dynkin diagram. \NewDocumentCommand\Edynkin{}% {% - \ifnum\dynkin@ply>1% + \ifnum\dynkin@ply>1 \ifnum\dynkin@rank=6% \Edynkin@folded% \else% - \ifnum\dynkin@rank=7% - \ifdynkin@is@extended% + \ifnum\dynkin@rank=7 + \ifdynkin@is@extended \Edynkin@folded% \else% \ClassError{Dynkin diagrams}% @@ -3248,10 +3610,10 @@ %% Draws an F series Dynkin diagram. \newcommand*{\Fdynkin}% { - \dynkinPlaceRootHere*{1}{below} - \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}% - \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}% - \dynkinPlaceRootRelativeTo*{4}{3}{east}{below}% + \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} @@ -3275,15 +3637,16 @@ \Idynkin% \else% \ifnum\dynkin@ply>1% - \dynkinPlaceRootHere*{1}{left}% - \dynkinPlaceRootRelativeTo*{2}{1}{southfold}{left}% + \dynkin@jump{1}% + \dynkinPlaceRootHere*{1}{left}{above}% + \dynkinPlaceRootRelativeTo*{2}{1}{southfold}{left}{below}% \dynkinEdge*{TripleDownRightSemiCircle}{1}{2}% \ifdynkin@arrows% \dynkinLeftFold*{1}{2}% \fi% \else% - \dynkinPlaceRootHere*{1}{below}% - \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}% + \dynkinPlaceRootHere*{1}{below}{above}% + \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}{above}% \dynkinTripleEdge*{1}{2}% \fi% \fi% @@ -3315,13 +3678,11 @@ \NewDocumentCommand\extendedAdynkin{}% {% \ifnum\dynkin@rank=1% - \dynkinPlaceRootHere{0}{below}% - \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}% + \dynkinPlaceRootHere{0}{below}{above}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}{above}% \convertRootNumber{1}% \begin{scope}{on background layer}% - \draw[% - /Dynkin diagram/edge, - double, + \draw[/Dynkin diagram/edge,double, {Classical TikZ Rightarrow[length={2*\dynkin@root@radius}]}% -{Classical TikZ Rightarrow[length={2*\dynkin@root@radius}]}% ]% @@ -3331,10 +3692,11 @@ \end{scope}% \else% \ifnum\dynkin@ply=4% - \dynkinPlaceRootHere*{0}{left}% - \dynkinPlaceRootRelativeTo*{1}{0}{east}{right}% - \dynkinPlaceRootRelativeTo*{2}{0}{south}{left}% - \dynkinPlaceRootRelativeTo*{3}{1}{south}{right}% + \node (Dynkin current) at ($(Dynkin current)+(0,\dynkin@edge@length)$){};% + \dynkinPlaceRootHere*{0}{left}{above}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{right}{above}% + \dynkinPlaceRootRelativeTo*{2}{0}{south}{below}{left}% + \dynkinPlaceRootRelativeTo*{3}{1}{south}{below}{right}% \dynkinEdge*{SingleEdge}{0}{1}% \dynkinEdge*{SingleEdge}{1}{2}% \dynkinEdge*{SingleEdge}{2}{3}% @@ -3344,13 +3706,13 @@ \else% \Adynkin{}% \ifnum\dynkin@ply>1% - \dynkinPlaceRootRelativeTo*{0}{1}{southwestfold}{right}% + \dynkinPlaceRootRelativeTo*{0}{1}{southwestfold}{left}{right}% \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)$){};% \dynkinNorth% - \dynkinPlaceRootHere*{0}{above}% + \dynkinPlaceRootHere*{0}{below}{above}% \dynkinEdge*{SingleEdge}{0}{1}% \dynkinEdge*{SingleEdge}{0}{\the\dynkin@rank}% \fi% @@ -3361,16 +3723,16 @@ \NewDocumentCommand\extendedBthreePly{}% {% - \dynkinPlaceRootHere*{0}{right}% - \edef\old@edge@length{\dynkin@edge@length}% - \pgfmathparse{1.5*\dynkin@edge@length}% - \xdef\dynkin@edge@length{\pgfmathresult pt}% - \dynkinPlaceRootRelativeTo*{1}{0}{south}{right}% - \dynkinPlaceRootRelativeTo*{3}{1}{south}{right}% - \xdef\dynkin@edge@length{\old@edge@length}% + \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}% \edef\old@fold@radius{\dynkin@fold@radius}% \xdef\dynkin@fold@radius{\dynkin@edge@length}% - \dynkinPlaceRootRelativeTo*{2}{1}{west}{left}% + \dynkinPlaceRootRelativeTo*{2}{1}{west}{left}{above right}% \dynkinEdge*{LeftDownArc}{0}{2}% \dynkinFold*{0}{1}% \dynkinFold*{1}{3}% @@ -3387,9 +3749,9 @@ \extendedAdynkin% \else% \ifnum\the\dynkin@rank=2 - \dynkinPlaceRootHere*{0}{left}% - \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}% - \dynkinPlaceRootRelativeTo*{2}{1}{east}{left}% + \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% @@ -3397,16 +3759,18 @@ \extendedBthreePly% \else% \ifnum\dynkin@ply=2% - \dynkinPlaceRootHere*{0}{left}% - \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below}% - \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}% + \dynkin@jump{1}% + \dynkinPlaceRootHere*{0}{left}{above left}% + \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below right}{above right}% + \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}{above left}% \dynkinLeftFold*{0}{1}% \dynkinEdge*{RightDownArc}{0}{2}% \dynkinEdge*{RightUpArc}{1}{2}% \else% - \dynkinPlaceRootHere*{0}{left}% - \dynkinPlaceRootRelativeTo*{2}{0}{southeast}{left}% - \dynkinPlaceRootRelativeTo*{1}{2}{southwest}{left}% + \dynkin@hop{1}% + \dynkinPlaceRootHere*{0}{left}{above left}% + \dynkinPlaceRootRelativeTo*{2}{0}{southeast}{below right}{above right}% + \dynkinPlaceRootRelativeTo*{1}{2}{southwest}{left}{above left}% \dynkinEdge*{SingleEdge}{0}{2}% \dynkinEdge*{SingleEdge}{1}{2}% \fi% @@ -3418,13 +3782,13 @@ \ifnum\dynkin@rank>3% \foreach \b in {3,...,\the\drmo}% {% - \dynkinPlaceRootRelativeTo*{\b}{\the\bmo}{east}{below}% + \dynkinPlaceRootRelativeTo*{\b}{\the\bmo}{east}{below}{above}% \dynkinEdge*{SingleEdge}{\b}{\the\bmo}% \global\advance\bmo by 1\relax% }% \fi% \ifnum\dynkin@ply<3% - \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\drmo}{east}{below}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\drmo}{east}{below}{above}% \fi% \ifdynkin@Coxeter% \dynkinEdge*{SingleEdge}{\the\drmo}{\the\dynkin@rank}% @@ -3447,7 +3811,7 @@ %% Draws an C series affine Dynkin/Coxeter diagram. \newcommand*{\extendedCdynkin}% {% - \dynkinPlaceRootHere*{0}{below}% + \dynkinPlaceRootHere*{0}{below}{above}% \dynkinEast% \Cdynkin{}% \ifdynkin@Coxeter% @@ -3464,13 +3828,14 @@ %% Draws a D^1_4 series affine Dynkin diagram folded about an A^2_2. \NewDocumentCommand\DOneFourFourPly{}% {% - \dynkinPlaceRootHere*{0}{right}% + \dynkin@hop{2.25}% + \dynkinPlaceRootHere*{0}{right}{left}% \edef\old@edge@length{\dynkin@edge@length}% \pgfmathparse{1.5*\dynkin@edge@length}% \xdef\dynkin@edge@length{\pgfmathresult pt}% - \dynkinPlaceRootRelativeTo*{1}{0}{south}{right}% - \dynkinPlaceRootRelativeTo*{3}{1}{south}{right}% - \dynkinPlaceRootRelativeTo*{4}{3}{south}{right}% + \dynkinPlaceRootRelativeTo*{1}{0}{south}{right}{left}% + \dynkinPlaceRootRelativeTo*{3}{1}{south}{right}{left}% + \dynkinPlaceRootRelativeTo*{4}{3}{south}{right}{left}% \xdef\dynkin@edge@length{\old@edge@length}% \convertRootPair{0}{4}% \node @@ -3478,7 +3843,7 @@ at ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$){};% \dynkinWest% - \dynkinPlaceRootHere*{2}{left}% + \dynkinPlaceRootHere*{2}{right}{left}% \dynkinEdge*{SingleEdge}{0}{2}% \dynkinEdge*{SingleEdge}{1}{2}% \dynkinEdge*{SingleEdge}{3}{2}% @@ -3493,9 +3858,11 @@ %% Draws a D series affine Dynkin diagram folded about its middle. \NewDocumentCommand\DfourPly{}% {% - \dynkinPlaceRootHere*{0}{left}% - \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{above}% - \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}% + \xdef\yfp{2*\dynkin@fold@radius+2*cos(60)*\dynkin@edge@length}% + \node (Dynkin current) at ($(Dynkin current)+(0,{\yfp})$){};% + \dynkinPlaceRootHere*{0}{left}{above left}% + \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{above right}{below right}% + \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}{above left}% \dynkinMoveToRoot*{2}% \newcount\drmo% \drmo=\the\dynkin@rank% @@ -3507,13 +3874,11 @@ \pgfmathparse{\dynkin@fold@radius+2*cos(60)*\dynkin@edge@length}% \xdef\dynkin@fold@radius{\pgfmathresult pt}% \dynkin@fold{2}{\the\drmt}% + % 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}% - \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\drmt}{southwestfold}{left}% -% \ifdynkin@arrows% -% \dynkinLeftFold*{0}{1}% -% \dynkinLeftFold*{\the\drmo}{\the\dynkin@rank}% -% \fi% + \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}% @@ -3524,15 +3889,15 @@ %% Draws a D^1_4 series Dynkin diagram, folded over a B^1_3. \NewDocumentCommand\extendedDthreePly{}% {% - \dynkinPlaceRootHere*{2}{right}% + \dynkinPlaceRootHere*{0}{below}{above}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{below left}{above right}% + \dynkinPlaceRootRelativeTo*{3}{1}{east}{below left}{above right}% \edef\old@edge@length{\dynkin@edge@length}% \pgfmathparse{1.5*\dynkin@edge@length}% \xdef\dynkin@edge@length{\pgfmathresult pt}% - \dynkinPlaceRootRelativeTo*{3}{2}{south}{right}% - \dynkinPlaceRootRelativeTo*{4}{3}{south}{right}% + \dynkinPlaceRootRelativeTo*{2}{3}{north}{below left}{above right}% + \dynkinPlaceRootRelativeTo*{4}{3}{south}{below}{above right}% \xdef\dynkin@edge@length{\old@edge@length}% - \dynkinPlaceRootRelativeTo*{1}{3}{west}{diagonal}% - \dynkinPlaceRootRelativeTo*{0}{1}{west}{left}% \dynkinEdge*{SingleEdge}{1}{3}% \edef\old@fold@radius{\dynkin@fold@radius}% \xdef\dynkin@fold@radius{\dynkin@edge@length}% @@ -3563,8 +3928,12 @@ \else% \ifnum\the\dynkin@rank=1% \extendedAdynkin% - \else - \dynkinPlaceRootHere*{0}{left}% + \else% + \ifnum\the\dynkin@rank=4% + \global\dynkin@hex@gridfalse + \fi + \dynkin@hop{1}% + \dynkinPlaceRootHere*{0}{left}{above left}% \Ddynkin% \ifnum\dynkin@ply=2% \dynkinEdge*{RightDownArc}{0}{2}% @@ -3575,6 +3944,9 @@ \dynkinEdge*{SingleEdge}{0}{2}% \fi% \fi% + \ifnum\the\dynkin@rank=4% + \global\dynkin@hex@gridtrue + \fi \fi% \fi% \fi% @@ -3592,19 +3964,20 @@ \newcommand*{\extendedFdynkin}% {% \ifnum\dynkin@ply=1% - \dynkinPlaceRootHere*{0}{below}% + \dynkinPlaceRootHere*{0}{below}{above}% \dynkinEast% \Fdynkin% \dynkinEdge*{SingleEdge}{0}{1}% \else% - \dynkinPlaceRootHere*{0}{above}% - \dynkinPlaceRootRelativeTo*{1}{0}{east}{above}% + \dynkin@jump{1}% + \dynkinPlaceRootHere*{0}{above}{below}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{above}{below}% \dynkinEdge*{SingleEdge}{0}{1}% - \dynkinPlaceRootRelativeTo*{2}{1}{southeastfold}{right}% + \dynkinPlaceRootRelativeTo*{2}{1}{southeastfold}{right}{left}% \dynkinDefiniteRightDownArc*{1}{2}% - \dynkinPlaceRootRelativeTo*{3}{2}{southwestfold}{below}% + \dynkinPlaceRootRelativeTo*{3}{2}{southwestfold}{below}{above}% \dynkinDefiniteDoubleDownLeftArc*{2}{3}% - \dynkinPlaceRootRelativeTo*{4}{3}{west}{below}% + \dynkinPlaceRootRelativeTo*{4}{3}{west}{below}{above}% \dynkinEdge*{SingleEdge}{3}{4}% \ifdynkin@arrows% \dynkinFold*{0}{4}% @@ -3618,7 +3991,7 @@ \newcommand*{\extendedGdynkin}% {% \xdef\dynkin@gonality{6}% - \dynkinPlaceRootHere*{0}{below}% + \dynkinPlaceRootHere*{0}{below}{above}% \dynkinEast% \Gdynkin% \dynkinEdge*{SingleEdge}{0}{1}% @@ -3628,7 +4001,7 @@ %% Draws an H series affine Coxeter diagram. \newcommand*{\extendedHdynkin}% {% - \dynkinPlaceRootHere*{0}{below}% + \dynkinPlaceRootHere*{0}{below}{above}% \dynkinEast% \Adynkin% \dynkinEdge*{SingleEdge}{0}{1}% @@ -3648,7 +4021,7 @@ %% Draws an I series affine Coxeter diagram. \newcommand*{\extendedIdynkin}% { - \dynkinPlaceRootHere*{0}{below}% + \dynkinPlaceRootHere*{0}{below}{above}% \dynkinEast% \dynkin@rank=1% \Adynkin% @@ -3669,51 +4042,64 @@ \ClassError{Dynkin diagrams}{A2 series twisted diagrams cannot have rank \the\dynkin@rank}{}% \fi \ifnum\dynkin@rank=2% - \dynkinPlaceRootHere*{0}{below}% - \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}% + \dynkinPlaceRootHere*{0}{below}{above}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}{above}% \dynkinQuadrupleEdge*{1}{0}% \else% \newcount\hmo% \hmo=\the\dynkin@nodes% \advance\hmo by -1% \ifodd\dynkin@rank% +\typeout{!!! odd dynkin rank} \ifnum\dynkin@ply>1% - \dynkinPlaceRootHere*{0}{above}% - \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below}% - \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{below}% +\typeout{!!! ply more than 1} + \dynkinPlaceRootHere*{2}{below right}{above right}% + \dynkinPlaceRootRelativeTo*{0}{2}{northwestfold}{left}{above left}% + \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}{above left}% \dynkinEdge*{RightDownArc}{0}{2}% \dynkinEdge*{RightUpArc}{1}{2}% \else% - \dynkinPlaceRootHere*{0}{left}% - \dynkinPlaceRootRelativeTo*{2}{0}{southeast}{left}% - \dynkinPlaceRootRelativeTo*{1}{2}{southwest}{left}% + \dynkin@hop{1}% + \dynkinPlaceRootHere*{0}{left}{right}% + \dynkinPlaceRootRelativeTo*{2}{0}{southeast}{left}{right}% + \dynkinPlaceRootRelativeTo*{1}{2}{southwest}{left}{right}% \dynkinEdge*{SingleEdge}{0}{2}% \dynkinEdge*{SingleEdge}{1}{2}% \fi% \dynkinMoveToRoot*{2}% - \dynkin@pipe{2}{\the\hmo}{east}{below}% - \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\hmo}{east}{below}% + \dynkin@pipe{2}{\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}% \fi% \else% - \dynkinPlaceRootHere*{0}{below}% - \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}% - \dynkinEdge*{DoubleEdge}{1}{0}% \ifnum\dynkin@nodes>1% \ifnum\dynkin@ply>1% \ifnum\hmo>1% + \dynkin@jump{1}% + \fi% + \dynkinPlaceRootHere*{0}{below}{above}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{below left}{above}% + \dynkinEdge*{DoubleEdge}{1}{0}% + \ifnum\hmo>1% \dynkin@fold{1}{\the\hmo}% \fi% - \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\hmo}{west}{below}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\hmo}{west}{below}{above}% \else% + \dynkinPlaceRootHere*{0}{below}{above}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{below right}{above}% + \dynkinEdge*{DoubleEdge}{1}{0}% \ifnum\hmo>1% - \dynkin@pipe{1}{\the\hmo}{east}{below}% + \dynkin@pipe{1}{\the\hmo}{east}{below}{above}% \fi% - \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\hmo}{east}{below}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\hmo}{east}{below}{above}% \fi% \dynkinEdge*{DoubleEdge}{\the\dynkin@nodes}{\the\hmo}% + \else% + \dynkinPlaceRootHere*{0}{below}{above}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{below right}{above}% + \dynkinEdge*{DoubleEdge}{1}{0}% \fi% \fi% \fi% @@ -3730,9 +4116,9 @@ {3}% {% \ifnum\dynkin@rank=4% - \dynkinPlaceRootHere*{0}{below}% - \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}% - \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}% + \dynkinPlaceRootHere*{0}{below}{above}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}{above}% + \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}{above}% \dynkinEdge*{SingleEdge}{0}{1}% \dynkinTripleEdge*{2}{1}% \else% @@ -3755,16 +4141,17 @@ \drmo=\the\dynkin@nodes% \advance\drmo by -1% \ifnum\dynkin@ply=1% - \dynkinPlaceRootHere*{0}{below}% - \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}% + \dynkinPlaceRootHere*{0}{below}{above}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}{above}% \else% \ifnum\dynkin@rank=3% - \dynkinPlaceRootHere*{0}{right}% - \dynkinPlaceRootRelativeTo*{1}{0}{southwestfold}{left}% - \dynkinPlaceRootRelativeTo*{2}{1}{southeastfold}{right}% + \dynkin@jump{1}% + \dynkinPlaceRootHere*{0}{above}{right}% + \dynkinPlaceRootRelativeTo*{1}{0}{southwestfold}{left}{right}% + \dynkinPlaceRootRelativeTo*{2}{1}{southeastfold}{below}{right}% \else% - \dynkinPlaceRootHere*{0}{above}% - \dynkinPlaceRootRelativeTo*{1}{0}{east}{above}% + \dynkinPlaceRootHere*{0}{above}{below}% + \dynkinPlaceRootRelativeTo*{1}{0}{east}{above}{below}% \fi% \fi% \ifnum\dynkin@ply=2% @@ -3775,16 +4162,16 @@ \ifnum\dynkin@ply>1% \ifnum\dynkin@rank>3% \dynkin@fold{1}{\the\drmo}% - \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\drmo}{west}{below}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\drmo}{west}{below}{above}% \dynkinFold*{0}{\the\dynkin@nodes}% \else% \dynkinFold*{0}{2}% \fi% \else% \ifnum\dynkin@rank>2% - \dynkin@pipe{1}{\the\drmo}{east}{below}% + \dynkin@pipe{1}{\the\drmo}{east}{below}{above}% \fi% - \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\drmo}{east}{below}% + \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\drmo}{east}{below}{above}% \fi% \ifnum\dynkin@ply=2% \dynkinEdge*{DoubleDownRightArc}{\the\drmo}{\the\dynkin@nodes}% @@ -3804,10 +4191,10 @@ {1}{\extendedEdynkin}% {2}% {% - \dynkinPlaceRootHere*{0}{below}% - \dynkin@pipe{0}{2}{east}{below}% - \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}% - \dynkinPlaceRootRelativeTo*{4}{3}{east}{below}% + \dynkinPlaceRootHere*{0}{below}{above}% + \dynkin@pipe{0}{2}{east}{below}{above}% + \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}{above}% + \dynkinPlaceRootRelativeTo*{4}{3}{east}{below}{above}% \dynkinEdge*{SingleEdge}{3}{4}% \dynkinEdge*{DoubleEdge}{3}{2}% }% |