summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-11 22:49:52 +0000
committerKarl Berry <karl@freefriends.org>2018-02-11 22:49:52 +0000
commit4f8d8a303ae1f3c7a2a6b1eb4624a4c6a3b31d07 (patch)
tree56b5144f0c924f54113eb22f3ac0321ea1cecedf
parent0809c1dc616f1408e77f3ba4d87205a20cc98154 (diff)
dynkin-diagrams (11feb18)
git-svn-id: svn://tug.org/texlive/trunk@46600 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/dynkin-diagrams/README8
-rw-r--r--Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.bib171
-rw-r--r--Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.pdfbin233754 -> 516988 bytes
-rw-r--r--Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.tex1711
-rw-r--r--Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty4315
5 files changed, 4585 insertions, 1620 deletions
diff --git a/Master/texmf-dist/doc/latex/dynkin-diagrams/README b/Master/texmf-dist/doc/latex/dynkin-diagrams/README
index 26cba041b7c..e7c2e42116b 100644
--- a/Master/texmf-dist/doc/latex/dynkin-diagrams/README
+++ b/Master/texmf-dist/doc/latex/dynkin-diagrams/README
@@ -2,9 +2,9 @@ ___________________________________
Dynkin diagrams
- v2.0
+ v3.1
- 18 November 2017
+ 11 February 2018
___________________________________
Authors : Ben McKay
@@ -15,5 +15,5 @@ Licence : Released under the LaTeX Project Public License v1.3c or
----------------------------------------------------------------------
-Provides Dynkin diagrams drawn in TikZ.
-
+Draws Dynkin di­a­grams in LaTeX doc­u­ments, us­ing the TikZ pack­age.
+Version 3.1 improves the documentation to give code for all examples. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.bib b/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.bib
index a72cb1dade1..30fc8b08f5c 100644
--- a/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.bib
+++ b/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.bib
@@ -2,6 +2,25 @@
% Encoding: ISO8859_1
+@Article{Baba:2009,
+ Title = {Satake diagrams and restricted root systems of semisimple pseudo-{R}iemannian symmetric spaces},
+ Author = {Baba, Kurando},
+ Journal = {Tokyo J. Math.},
+ Year = {2009},
+ Number = {1},
+ Pages = {127--158},
+ Volume = {32},
+
+ Fjournal = {Tokyo Journal of Mathematics},
+ ISSN = {0387-3870},
+ Mrclass = {17B20 (17B22 53C35)},
+ Mrnumber = {2541161},
+ Mrreviewer = {Oksana S. Yakimova},
+ Owner = {user},
+ Timestamp = {2017.12.04},
+ Url = {https://doi.org/10.3836/tjm/1249648414}
+}
+
@Book{Bourbaki:2002,
Title = {Lie groups and {L}ie algebras. {C}hapters 4--6},
Author = {Bourbaki, Nicolas},
@@ -37,20 +56,23 @@
Url = {https://doi.org/10.1017/CBO9780511614910}
}
-@Book{Dynkin:2000,
- Title = {Selected papers of {E}. {B}. {D}ynkin with commentary},
- Author = {Dynkin, E. B.},
- Publisher = {American Mathematical Society, Providence, RI; International Press, Cambridge, MA},
- Year = {2000},
- Note = {Edited by A. A. Yushkevich, G. M. Seitz and A. L. Onishchik},
+@Article{Chuah:2013,
+ Title = {Cartan automorphisms and {V}ogan superdiagrams},
+ Author = {Chuah, Meng-Kiat},
+ Journal = {Math. Z.},
+ Year = {2013},
+ Number = {3-4},
+ Pages = {793--800},
+ Volume = {273},
- ISBN = {0-8218-1065-0},
- Mrclass = {01A75 (60Jxx)},
- Mrnumber = {1757976},
- Mrreviewer = {William M. McGovern},
+ Fjournal = {Mathematische Zeitschrift},
+ ISSN = {0025-5874},
+ Mrclass = {17B20 (17B40)},
+ Mrnumber = {3030677},
+ Mrreviewer = {Zi-Xin Hou},
Owner = {user},
- Pages = {xxviii+796},
- Timestamp = {2017.11.15}
+ Timestamp = {2017.12.04},
+ Url = {https://doi.org/10.1007/s00209-012-1030-z}
}
@Article{Dynkin:1952,
@@ -69,6 +91,41 @@
Timestamp = {2017.11.15}
}
+@Book{Dynkin:2000,
+ Title = {Selected papers of {E}. {B}. {D}ynkin with commentary},
+ Author = {Dynkin, E. B.},
+ Publisher = {American Mathematical Society, Providence, RI; International Press, Cambridge, MA},
+ Year = {2000},
+ Note = {Edited by A. A. Yushkevich, G. M. Seitz and A. L. Onishchik},
+
+ ISBN = {0-8218-1065-0},
+ Mrclass = {01A75 (60Jxx)},
+ Mrnumber = {1757976},
+ Mrreviewer = {William M. McGovern},
+ Owner = {user},
+ Pages = {xxviii+796},
+ Timestamp = {2017.11.15}
+}
+
+@Article{Frappat/Sciarrino/Sorba:1989,
+ Title = {Structure of basic {L}ie superalgebras and of their affine extensions},
+ Author = {Frappat, L. and Sciarrino, A. and Sorba, P.},
+ Journal = {Comm. Math. Phys.},
+ Year = {1989},
+ Number = {3},
+ Pages = {457--500},
+ Volume = {121},
+
+ Fjournal = {Communications in Mathematical Physics},
+ ISSN = {0010-3616},
+ Mrclass = {17B70 (17A70 17B40)},
+ Mrnumber = {990776},
+ Mrreviewer = {A. Pianzola},
+ Owner = {user},
+ Timestamp = {2017.12.18},
+ Url = {http://0-projecteuclid.org.library.ucc.ie/euclid.cmp/1104178142}
+}
+
@Book{Grove/Benson:1985,
Title = {Finite reflection groups},
Author = {Grove, L. C. and Benson, C. T.},
@@ -139,6 +196,25 @@
Url = {https://doi.org/10.1017/CBO9780511626234}
}
+@Article{Khastgir/Sasaki:1996,
+ Title = {Non-canonical folding of {D}ynkin diagrams and reduction of affine {T}oda theories},
+ Author = {Khastgir, S. Pratik and Sasaki, Ryu},
+ Journal = {Progr. Theoret. Phys.},
+ Year = {1996},
+ Number = {3},
+ Pages = {503--518},
+ Volume = {95},
+
+ Fjournal = {Progress of Theoretical Physics},
+ ISSN = {0033-068X},
+ Mrclass = {81T10 (17B81 58F07 81R10)},
+ Mrnumber = {1388245},
+ Mrreviewer = {Mehmet Koca},
+ Owner = {user},
+ Timestamp = {2017.12.18},
+ Url = {https://doi.org/10.1143/PTP.95.503}
+}
+
@Book{OnishchikVinberg:1990,
Title = {Lie groups and algebraic groups},
Author = {Onishchik, A. L. and Vinberg, {\`E}. B.},
@@ -176,6 +252,60 @@
Url = {https://doi.org/10.1007/978-3-642-74334-4}
}
+@Article{Ransingh:2013,
+ Title = {Vogan diagrams of untwisted affine {K}ac-{M}oody superalgebras},
+ Author = {Ransingh, Biswajit},
+ Journal = {Asian-Eur. J. Math.},
+ Year = {2013},
+ Number = {4},
+ Pages = {1350062, 10},
+ Volume = {6},
+
+ Fjournal = {Asian-European Journal of Mathematics},
+ ISSN = {1793-5571},
+ Mrclass = {17B67 (17B05 17B22 17B40)},
+ Mrnumber = {3149279},
+ Mrreviewer = {Xiangqian Guo},
+ Owner = {user},
+ Timestamp = {2018.01.11}
+}
+
+@Article{Ransingh:unpub,
+ Title = {{Vogan diagrams of affine twisted Lie superalgebras}},
+ Author = {Ransingh, B.},
+ Journal = {ArXiv e-prints},
+ Year = {2013},
+
+ Month = mar,
+
+ Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
+ Adsurl = {http://adsabs.harvard.edu/abs/2013arXiv1303.0092R},
+ Archiveprefix = {arXiv},
+ Eprint = {1303.0092},
+ Keywords = {Mathematical Physics, Mathematics - Representation Theory},
+ Owner = {user},
+ Primaryclass = {math-ph},
+ Timestamp = {2018.01.11}
+}
+
+@Article{Regelskis/Vlaar:2016,
+ Title = {{Reflection matrices, coideal subalgebras and generalized Satake diagrams of affine type}},
+ Author = {{Regelskis}, V. and {Vlaar}, B.},
+ Journal = {ArXiv e-prints},
+ Year = {2016},
+
+ Month = feb,
+
+ Adsnote = {Provided by the SAO/NASA Astrophysics Data System},
+ Adsurl = {http://adsabs.harvard.edu/abs/2016arXiv160208471R},
+ Archiveprefix = {arXiv},
+ Eprint = {1602.08471},
+ Keywords = {Mathematical Physics, Mathematics - Quantum Algebra, Mathematics - Representation Theory, Nonlinear Sciences - Exactly Solvable and Integrable Systems},
+ Owner = {user},
+ Primaryclass = {math-ph},
+ Timestamp = {2017.12.04}
+}
+
@Book{Satake:1980,
Title = {Algebraic structures of symmetric domains},
Author = {Satake, Ichir\^o},
@@ -192,6 +322,23 @@
Timestamp = {2017.11.15}
}
+@InCollection{Zuber:1998,
+ Title = {Generalized {D}ynkin diagrams and root systems and their folding},
+ Author = {Zuber, Jean-Bernard},
+ Booktitle = {Topological field theory, primitive forms and related topics ({K}yoto, 1996)},
+ Publisher = {Birkh\"auser Boston, Boston, MA},
+ Year = {1998},
+ Pages = {453--493},
+ Series = {Progr. Math.},
+ Volume = {160},
+
+ Mrclass = {17B20 (05C25 20F55)},
+ Mrnumber = {1653035},
+ Mrreviewer = {Saeid Azam},
+ Owner = {user},
+ Timestamp = {2017.12.18}
+}
+
@Book{Vinberg:1994,
Title = {Lie groups and {L}ie algebras, {III}},
Editor = {Vinberg, \`E. B.},
diff --git a/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.pdf b/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.pdf
index 851c6ae2200..90af26049f5 100644
--- a/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.pdf
+++ b/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.tex b/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.tex
index f6566c0be0e..afe3a99eea5 100644
--- a/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.tex
+++ b/Master/texmf-dist/doc/latex/dynkin-diagrams/dynkin-diagrams.tex
@@ -1,688 +1,1303 @@
\documentclass{amsart}
-\title{The Dynkin diagrams package}
+\title{The Dynkin diagrams package \\ Version 3.1}
\author{Ben McKay}
-\date{\today}
+\date{11 February 2018}
+\usepackage{etex}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenx}
+\usepackage{etoolbox}
+\usepackage{lmodern}
+\usepackage[kerning=true,tracking=true]{microtype}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{array}
\usepackage{xstring}
-\usepackage{etoolbox}
\usepackage{longtable}
-\usepackage{showexpl}
+\usepackage[listings]{tcolorbox}
+\tcbuselibrary{breakable}
+\tcbuselibrary{skins}
+\usepackage[pdftex]{hyperref}
+\hypersetup{
+ colorlinks = true, %Colours links instead of ugly boxes
+ urlcolor = black, %Colour for external hyperlinks
+ linkcolor = black, %Colour of internal links
+ citecolor = black %Colour of citations
+}
\usepackage{booktabs}
+\usepackage{colortbl}
+\usepackage{varwidth}
\usepackage{dynkin-diagrams}
+\usepackage{fancyvrb}
+\usepackage{xspace}
+\newcommand{\TikZ}{Ti\textit{k}Z\xspace}
+\usepackage{filecontents}
\usetikzlibrary{backgrounds}
\usetikzlibrary{decorations.markings}
+\arrayrulecolor{white}
+\makeatletter
+ \def\rulecolor#1#{\CT@arc{#1}}
+ \def\CT@arc#1#2{%
+ \ifdim\baselineskip=\z@\noalign\fi
+ {\gdef\CT@arc@{\color#1{#2}}}}
+ \let\CT@arc@\relax
+\rulecolor{white}
+\makeatother
\newcommand{\C}[1]{\mathbb{C}^{#1}}
\renewcommand*{\arraystretch}{1.5}
-\renewcommand\ResultBox{\fcolorbox{gray!50}{gray!30}}
+\NewDocumentCommand\wdtA{}{.7cm}
+\NewDocumentCommand\wdtD{}{3cm}
+\NewDocumentCommand\wdtL{}{3cm}
+\newcolumntype{A}{@{}>{\columncolor[gray]{.9}$}m{\wdtA}<{$}}
+\newcolumntype{D}{>{\columncolor[gray]{.9}}m{\wdtD}}
+\newcolumntype{L}{>{\columncolor[gray]{.9}}p{\wdtL}}
+\newcolumntype{P}{>{\columncolor[gray]{.9}}p{10cm}}
+\NewDocumentCommand\textleftcurly{}{\texttt{\char'173}}%
+\NewDocumentCommand\textrightcurly{}{\texttt{\char'175}}%
+\NewDocumentCommand\csDynkin{omom}%
+{%
+ \texttt{\detokenize{\dynkin}\!\!\!%
+ \IfNoValueTF{#1}{}{[#1]}%
+ \textleftcurly#2\textrightcurly%
+ \IfNoValueTF{#3}{}{[#3]}%
+ \textleftcurly#4\textrightcurly%
+ }%
+}%
+
+\NewDocumentCommand\dynk{omom}%
+{%
+ \dynkin[#1]{#2}[#3]{#4}&\csDynkin[#1]{#2}[#3]{#4}\\
+}%
+
+\NewDocumentCommand\typesetSubseries{m}%
+{%
+ \IfInteger{#1}{#1}{\IfStrEq{#1}{}{n}{#1}}
+}%
+
+\NewDocumentCommand\dyn{omom}%
+{%
+ {#2}_{\typesetSubseries{#4}}^{\IfInteger{#3}{#3}{}} & \dynk[#1]{#2}[#3]{#4}%
+}%
+
+\NewDocumentEnvironment{dynkinTable}{mmm}%
+{%
+\RenewDocumentCommand\wdtD{}{#2}
+\RenewDocumentCommand\wdtL{}{#3}
+\begin{longtable}{ADL}
+\caption{#1}\\
+\endfirsthead
+\caption{\dots continued}\\
+\endhead
+\multicolumn{2}{c}{continued \dots}\\
+\endfoot
+\endlastfoot
+}%
+{%
+\end{longtable}
+}%
+
+
+\definecolor{example-color}{gray}{1}
+\definecolor{example-border-color}{gray}{.7}
+
+\tcbset{coltitle=black,colback=example-color,colframe=example-border-color,enhanced,breakable,pad at break*=1mm,
+toprule=1.2mm,bottomrule=1.2mm,leftrule=1mm,rightrule=1mm,toprule at break=-1mm,bottomrule at break=-1mm,
+before upper={\widowpenalties=3 10000 10000 150}}
+
+\makeatletter
+\def\@tocline#1#2#3#4#5#6#7{\relax
+ \ifnum #1>\c@tocdepth%
+ \else
+ \par \addpenalty\@secpenalty\addvspace{#2}%
+ \begingroup \hyphenpenalty\@M
+ \@ifempty{#4}{%
+ \@tempdima\csname r@tocindent\number#1\endcsname\relax
+ }{%
+ \@tempdima#4\relax
+ }%
+ \parindent\z@ \leftskip#3\relax \advance\leftskip\@tempdima\relax
+ #5\leavevmode\hskip-\@tempdima #6\nobreak\relax
+ ,~#7\par
+ \endgroup
+ \fi}
+\makeatother
\begin{document}
\maketitle
+\begin{center}
+\begin{varwidth}{\textwidth}
\tableofcontents
+\end{varwidth}
+\end{center}
+
+
+\setlength{\arrayrulewidth}{1.5pt}
+
\section{Quick introduction}
-This is a test of the Dynkin diagram package.
-Load the package via
+
+
+\begin{tcolorbox}[title={Load the Dynkin diagram package (see options below)}]
\begin{verbatim}
\usepackage{dynkin-diagrams}
\end{verbatim}
-(see below for options) and invoke it directly:
+\end{tcolorbox}
+\begin{tcblisting}{title={Invoke it}}
+The Dynkin diagram of \(B_3\) is \dynkin{B}{3}.
+\end{tcblisting}
+\begin{tcblisting}{title={Inside a \TikZ statement}}
+\tikz \dynkin{B}{3};
+\end{tcblisting}
+\begin{tcblisting}{title={Inside a \TikZ environment}}
+\begin{tikzpicture}
+ \dynkin{B}{3}
+\end{tikzpicture}
+\end{tcblisting}
+\begin{tcblisting}{title={Indefinite rank Dynkin diagrams}}
+\dynkin{B}{}
+\end{tcblisting}
+
+\begin{dynkinTable}{The Dynkin diagrams of the reduced simple root systems \cite{Bourbaki:2002} pp. 265--290, plates I--IX}{2.25cm}{2.5cm}
+\dyn{A}{}
+\dyn{C}{}
+\dyn{D}{}
+\dyn{E}{6}
+\dyn{E}{7}
+\dyn{E}{8}
+\dyn{F}{4}
+\dyn{G}{2}
+\end{dynkinTable}
+
+
+\section{Set options globally}
+
+\begin{tcolorbox}[title={Most options set globally \dots}]
+\begin{verbatim}
+\pgfkeys{/Dynkin diagram,edgeLength=.5cm,foldradius=.5cm}
+\end{verbatim}
+\end{tcolorbox}
+\begin{tcolorbox}[title={\dots or pass to the package}]
+\begin{verbatim}
+\usepackage[
+ ordering=Kac,
+ edge/.style=blue,
+ mark=o,
+ radius=.06cm]
+ {dynkin-diagrams}
+\end{verbatim}
+\end{tcolorbox}
-\begin{LTXexample}
-The flag variety of pointed lines in
-projective 3-space is associated to
-the Dynkin diagram \dynkin[parabolic=3]{A}{3}.
-\end{LTXexample}
-or use the long form inside a \verb!\tikz! statement:
-\begin{LTXexample}
-\tikz \dynkin[parabolic=3]{A}{3};
-\end{LTXexample}
+\section{Coxeter diagrams}
-or a TikZ environment:
-\begin{LTXexample}
-\begin{tikzpicture}
-\dynkin[parabolic=3,label]{A}{3}
-\end{tikzpicture}
-\end{LTXexample}
-With labels for the roots:
-\begin{LTXexample}
-\dynkin[parabolic=3,label]{A}{3}
-\end{LTXexample}
-\newpage\noindent%
-Make up your own labels for the roots:
-\begin{LTXexample}
-\begin{tikzpicture}
-\dynkin[parabolic=3]{A}{3}
-\rootlabel{2}{\alpha_2}
-\end{tikzpicture}
-\end{LTXexample}
-Use any text scale you like:
-\begin{LTXexample}
+\begin{tcblisting}{title={Coxeter diagram option}}
+\dynkin[Coxeter]{F}{4}
+\end{tcblisting}
+
+\begin{tcblisting}{title={gonality option for \(G_2\) and \(I_n\) Coxeter diagrams}}
+\(G_2=\dynkin[Coxeter,gonality=n]{G}{2}\), \
+\(I_n=\dynkin[Coxeter,gonality=n]{I}{}\)
+\end{tcblisting}
+
+\begin{dynkinTable}{The Coxeter diagrams of the simple reflection groups}{2.25cm}{6cm}
+\dyn[Coxeter]{A}{}
+\dyn[Coxeter]{B}{}
+\dyn[Coxeter]{C}{}
+\dyn[Coxeter]{E}{6}
+\dyn[Coxeter]{E}{7}
+\dyn[Coxeter]{E}{8}
+\dyn[Coxeter]{F}{4}
+\dyn[Coxeter,gonality=n]{G}{2}
+\dyn[Coxeter]{H}{3}
+\dyn[Coxeter]{H}{4}
+\dyn[Coxeter,gonality=n]{I}{}
+\end{dynkinTable}
+
+\section{Satake diagrams}\label{section:Satake}
+
+\begin{tcblisting}{title={Satake diagrams use the standard name instead of a rank}}
+\(A_{IIIb}=\dynkin{A}{IIIb}\)
+\end{tcblisting}
+
+We use a solid gray bar to denote the folding of a Dynkin diagram, rather than the usual double arrow, since the diagrams turn out simpler and easier to read.
+
+\begin{dynkinTable}{The Satake diagrams of the real simple Lie algebras \cite{Helgason:2001} p. 532--534}{2.75cm}{3cm}
+\dyn{A}{I}
+\dyn{A}{II}
+\dyn{A}{IIIa}
+\dyn{A}{IIIb}
+\dyn{A}{IV}
+\dyn{B}{I}
+\dyn{B}{II}
+\dyn{C}{I}
+\dyn{C}{IIa}
+\dyn{C}{IIb}
+\dyn{D}{Ia}
+\dyn{D}{Ib}
+\dyn{D}{Ic}
+\dyn{D}{II}
+\dyn{D}{IIIa}
+\dyn{D}{IIIb}
+\dyn{E}{I}
+\dyn{E}{II}
+\dyn{E}{III}
+\dyn{E}{IV}
+\dyn{E}{V}
+\dyn{E}{VI}
+\dyn{E}{VII}
+\dyn{E}{VIII}
+\dyn{E}{IX}
+\dyn{F}{I}
+\dyn{F}{II}
+\dyn{G}{I}
+\end{dynkinTable}
+
+\section{Labels for the roots}
+
+\begin{tcblisting}{title={Label the roots by root number}}
+\dynkin[label]{B}{3}
+\end{tcblisting}
+\begin{tcblisting}{title={Make a macro to assign labels to roots}}
+\dynkin[label,labelMacro/.code={\alpha_{#1}}]{D}{5}
+\end{tcblisting}
+\begin{tcblisting}{title={Label a single root}}
\begin{tikzpicture}
-\dynkin[parabolic=3,textscale=1.2]{A}{3};
-\rootlabel{2}{\alpha_2}
+ \dynkin{B}{3}
+ \dynkinLabelRoot{2}{\alpha_2}
\end{tikzpicture}
-\end{LTXexample}
-and access root labels via TikZ:
-\begin{LTXexample}
+\end{tcblisting}
+\begin{tcblisting}{title={Use a text style}}
\begin{tikzpicture}
-\dynkin[parabolic=3]{A}{3};
-\node at (root label 2) {\(\alpha_2\)};
+ \dynkin[text/.style={scale=1.2}]{B}{3};
+ \dynkinLabelRoot{2}{\alpha_2}
\end{tikzpicture}
-\end{LTXexample}
-The labels have default locations:
-\begin{LTXexample}
+\end{tcblisting}
+\begin{tcblisting}{title={Access root labels via TikZ}}
\begin{tikzpicture}
-\dynkin{E}{8};
-\rootlabel{1}{\alpha_1}
-\rootlabel{2}{\alpha_2}
-\rootlabel{3}{\alpha_3}
+ \dynkin{B}{3};
+ \node[below] at (root 2) {\(\alpha_2\)};
\end{tikzpicture}
-\end{LTXexample}
-You can use a starred form to flip labels to alternate locations:
-\begin{LTXexample}
+\end{tcblisting}
+\begin{tcblisting}{title={The labels have default locations}}
\begin{tikzpicture}
-\dynkin{E}{8};
-\rootlabel*{1}{\alpha_1}
-\rootlabel*{2}{\alpha_2}
-\rootlabel*{3}{\alpha_3}
+ \dynkin{E}{8};
+ \dynkinLabelRoot{1}{\alpha_1}
+ \dynkinLabelRoot{2}{\alpha_2}
+ \dynkinLabelRoot{3}{\alpha_3}
\end{tikzpicture}
-\end{LTXexample}
-TikZ can access the roots themselves:
-\typeout{AAAAAAA}
-\begin{LTXexample}
+\end{tcblisting}
+\begin{tcblisting}{title={The starred form flips labels to alternate locations}}
\begin{tikzpicture}
-\dynkin{A}{4};
-\fill[white,draw=black] (root 2) circle (.1cm);
-\draw[black] (root 2) circle (.05cm);
+ \dynkin{E}{8};
+ \dynkinLabelRoot*{1}{\alpha_1}
+ \dynkinLabelRoot*{2}{\alpha_2}
+ \dynkinLabelRoot*{3}{\alpha_3}
\end{tikzpicture}
-\end{LTXexample}
-Some diagrams will have double edges:
-\begin{LTXexample}
+\end{tcblisting}
+
+\section{Style}
+
+\begin{tcblisting}{title={Colours}}
+\dynkin[edge/.style={blue!50,thick},*/.style=blue!50!red]{F}{4}
+\end{tcblisting}
+\begin{tcblisting}{title={Edge lengths}}
+\dynkin[edgeLength=1.2,parabolic=3]{A}{3}
+\end{tcblisting}
+\begin{tcblisting}{title={Root marks}}
+\dynkin{E}{8}
+\dynkin[mark=*]{E}{8}
+\dynkin[mark=o]{E}{8}
+\dynkin[mark=O]{E}{8}
+\dynkin[mark=t]{E}{8}
+\dynkin[mark=x]{E}{8}
+\dynkin[mark=X]{E}{8}
+\end{tcblisting}
+At the moment, you can only use:
+\par\noindent\begin{tabular}{>{\ttfamily}cl}
+* & solid dot \\
+o & hollow circle \\
+O & double hollow circle \\
+t & tensor root \\
+x & crossed root \\
+X & thickly crossed root
+\end{tabular}
+\begin{tcblisting}{title={Mark styles}}
+\dynkin[parabolic=124,x/.style={brown,very thick}]{E}{8}
+\end{tcblisting}
+\begin{tcblisting}{title={Sizes of root marks}}
+\dynkin[radius=.08cm,parabolic=3]{A}{3}
+\end{tcblisting}
+
+
+\section{Suppress or reverse arrows}
+
+\begin{tcblisting}{title={Some diagrams have double or triple edges}}
\dynkin{F}{4}
-\end{LTXexample}
-or triple edges:
-\begin{LTXexample}
\dynkin{G}{2}
-\end{LTXexample}
-\newpage\noindent%
-Draw curves between the roots:
-\begin{LTXexample}
+\end{tcblisting}
+\begin{tcblisting}{title={Suppress arrows}}
+\dynkin[arrows=false]{F}{4}
+\dynkin[arrows=false]{G}{2}
+\end{tcblisting}
+\begin{tcblisting}{title={Reverse arrows}}
+\dynkin[reverseArrows]{F}{4}
+\dynkin[reverseArrows]{G}{2}
+\end{tcblisting}
+
+
+\section{Drawing on top of a Dynkin diagram}
+
+\begin{tcblisting}{title={TikZ can access the roots themselves}}
\begin{tikzpicture}
-\dynkin[parabolic=429]{E}{8}
-\draw[very thick, black!50,-latex] (root 3.south) to [out=-45, in=-135] (root 6.south);
+ \dynkin{A}{4};
+ \fill[white,draw=black] (root 2) circle (.15cm);
+ \fill[white,draw=black] (root 2) circle (.1cm);
+ \draw[black] (root 2) circle (.05cm);
\end{tikzpicture}
-\end{LTXexample}
-Draw dots on the roots:
-\begin{LTXexample}
+\end{tcblisting}
+\begin{tcblisting}{title={Draw curves between the roots}}
\begin{tikzpicture}
-\dynkin[label]{C}{8}
-\dynkinopendot{3}
-\dynkinopendot{7}
+ \dynkin[label]{E}{8}
+ \draw[very thick, black!50,-latex]
+ (root 3.south) to [out=-45, in=-135] (root 6.south);
\end{tikzpicture}
-\end{LTXexample}
-Colours:
-\begin{LTXexample}
-\dynkin[color=blue!50,backgroundcolor=red!20]{G}{2}
-\end{LTXexample}
-Edge lengths:
-\begin{LTXexample}
-\dynkin[edgelength=1.2,parabolic=3]{A}{3}
-\end{LTXexample}
-Sizes of dots and crosses:
-\begin{LTXexample}
-\dynkin[dotradius=.08cm,parabolic=3]{A}{3}
-\end{LTXexample}
-Edge styles:
-\begin{LTXexample}
-\dynkin[edge=very thick,parabolic=3]{A}{3}
-\end{LTXexample}
-Open circles instead of closed dots:
-\begin{LTXexample}
-\dynkin[open]{E}{8}
-\end{LTXexample}
-Add closed dots to the open circles, at roots in the current ordering:
-\begin{LTXexample}
+\end{tcblisting}
+\begin{tcblisting}{title={Change marks}}
\begin{tikzpicture}
-\dynkin[open]{E}{8};
-\dynkincloseddot{5}
-\dynkincloseddot{8}
-\end{tikzpicture}
-\end{LTXexample}
-More colouring:
-\begin{LTXexample}
-\begin{tikzpicture}[show background rectangle,
- background rectangle/.style={fill=red!10}]
-\dynkin[parabolic=1,backgroundcolor=blue!20]{G}{2}
+ \dynkin[mark=o,label]{E}{8};
+ \dynkinRootMark{*}{5}
+ \dynkinRootMark{*}{8}
\end{tikzpicture}
-\end{LTXexample}
-Cross styles:
-\begin{LTXexample}
-\dynkin[parabolic=124,cross=thin]{E}{8}
-\end{LTXexample}
-\newpage\noindent{}
-Suppress arrows:
-\begin{LTXexample}
-\dynkin[arrows=false]{F}{4}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[arrows=false]{G}{2}
-\end{LTXexample}
-
-\section{Syntax}
-
-The syntax is \verb!\dynkin[<options>]{<letter>}{<rank>}! where \verb!<letter>! is \(A,B,C,D,E,F\) or \(G\), the family of root system for the Dynkin diagram, and \verb!<rank>! is an integer representing the rank, or is the symbol \verb!*! to represent an indefinite rank:
-\begin{LTXexample}
-\dynkin[edge=thick,edgelength=.5cm]{A}{*}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[edge=thick,edgelength=.5cm]{B}{*}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[edge=thick,edgelength=.5cm]{C}{*}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[edge=thick,edgelength=.5cm]{D}{*}
-\end{LTXexample}
-Outside a TikZ environment, the command builds its own TikZ environment.
-
+\end{tcblisting}
-\newcommand*{\typ}[1]{\(\left<\texttt{#1}\right>\)}
-\newcommand*{\optionLabel}[3]{%%
-\multicolumn{2}{l}{\(\texttt{#1}=\texttt{#2}, \texttt{default}=\texttt{#3}\)} \\
-}%%
-\section{Options}
-\par\noindent{}All \verb!\dynkin! options (except \texttt{affine}, \texttt{folded}, \texttt{label} and \texttt{parabolic} ) can also be passed to the package to force a global default option:
-\par\noindent%
-\begin{verbatim}
-\usepackage[
- ordering=Kac,
- color=blue,
- open,
- dotradius=.06cm,
- backgroundcolor=red]
- {dynkin-diagrams}
-\end{verbatim}
-\par\noindent%
-\begin{tabular}{p{1cm}p{10cm}}
-\optionLabel{parabolic}{\typ{integer}}{0}
-& A parabolic subgroup with specified integer, where the integer
-is computed as \(n=\sum 2^i a_i\), \(a_i=0\) or \(1\), to say that root \(i\) is crossed, i.e. a noncompact root. \\
-\optionLabel{color}{\typ{color name}}{black} \\
-\optionLabel{backgroundcolor}{\typ{color name}}{white}
-& This only says what color you have already set for the background rectangle. It is needed precisely for the \(G_2\) root system, to draw the triple line correctly, and only when your background color is not white. \\
-\optionLabel{dotradius}{\typ{number}cm}{.05cm}
-& size of the dots and of the crosses in the Dynkin diagram \\
-\optionLabel{edgelength}{\typ{number}cm}{.35cm}
-& distance between nodes in the Dynkin diagram \\
-\optionLabel{edge}{\typ{TikZ style data}}{thin}
-& style of edges in the Dynkin diagram \\
-\optionLabel{open}{\typ{true or false}}{false}
-& use open circles rather than solid dots as default \\
-\optionLabel{label}{true or false}{false}
-& whether to label the roots by their root numbers. \\
-\optionLabel{arrows}{\typ{true or false}}{true}
-& whether to draw the arrows that arise along the edges. \\
-\optionLabel{folded}{\typ{true or false}}{true}
-& whether, when drawing \(A\), \(D\) or \(E_6\) diagrams, to draw them folded. \\
-\optionLabel{foldarrowstyle}{\typ{TikZ style}}{stealth-stealth}
-& when drawing folded diagrams, style for the fold arrows. \\
-\optionLabel{foldarrowcolor}{\typ{colour}}{black!50}
-& when drawing folded diagrams, colour for the fold arrows. \\
-\optionLabel{Coxeter}{\typ{true or false}}{false}
-& whether to draw a Coxeter diagram, rather than a Dynkin diagram. \\
+\section{Mark lists}
-\optionLabel{ordering}{\typ{Adams, Bourbaki, Carter, Dynkin, Kac}}{Bourbaki}
-& which ordering of the roots to use in exceptional root systems as follows:
-\end{tabular}
+The package allows a list of root marks instead of a rank:
-\newpage
+\begin{tcblisting}{title={A mark list}}
+\dynkin{E}{oo**ttxx}
+\end{tcblisting}
+The mark list \verb!oo**ttxx! has one mark for each root: \verb!o!, \verb!o!, \dots, \verb!x!.
+Roots are listed in the current default ordering.
+(Careful: in an affine root system, a mark list will \emph{not} contain a mark for root zero.)
-\NewDocumentCommand\tablerow{mm}%
+\NewDocumentCommand\ClassicalLieSuperalgebras{m}%
{%
-\(#1_{#2}\)
-&
-\dynkin[label,ordering=Adams]{#1}{#2}
-&
-\dynkin[label]{#1}{#2}
-&
-\dynkin[label,ordering=Carter]{#1}{#2}
-&
-\dynkin[label,ordering=Dynkin]{#1}{#2}
-&
-\dynkin[label,ordering=Kac]{#1}{#2}
-\\
+\begin{dynkinTable}{Classical Lie superalgebras \cite{Frappat/Sciarrino/Sorba:1989}. #1}{3.5cm}{6.5cm}
+A_{mn} & \dynk{A}{ooo.oto.oo}
+B_{mn} & \dynk{B}{ooo.oto.oo}
+B_{0n} & \dynk{B}{ooo.ooo.o*}
+C_{n} & \dynk{C}{too.oto.oo}
+D_{mn} & \dynk{D}{ooo.oto.oooo}
+D_{21\alpha} & \dynk{A}{oto}
+F_4 & \dynk{F}{ooot}
+G_3 & \dynk[extended,affineMark=t]{G}{2}
+\end{dynkinTable}
}%
-\begin{center}
-\begin{longtable}{@{}llllll@{}}
-\toprule
-& Adams & Bourbaki & Carter & Dynkin & Kac \\ \midrule
-\endfirsthead
-\toprule
-Adams & Bourbaki & Carter & Dynkin & Kac \\ \midrule
-\endhead
-\bottomrule
-\endfoot
-\bottomrule
-\endlastfoot
-\tablerow{E}{6}
-\tablerow{E}{7}
-\tablerow{E}{8}
-\tablerow{F}{4}
-\tablerow{G}{2}
-\end{longtable}
-\end{center}
+\begingroup
+\tikzset{/Dynkin diagram,radius=.07cm}
+\ClassicalLieSuperalgebras{We need a slightly larger radius parameter to distinguish the tensor product symbols from the solid dots.}
+\endgroup
+\ClassicalLieSuperalgebras{Here we see the problem with using the default radius parameter, which is too small for tensor product symbols.}
-\par\noindent{}All other options are passed to TikZ.
-\section{Finding the roots}
-The roots are labelled from \(1\) to \(r\), where \(r\) is the rank.
-The command sets up TikZ nodes \texttt{(root 1)}, \texttt{(root 2)}, and so on.
-Affine extended Dynkin diagrams have affine root are at \texttt{(root 0)}.
-Use these tikz nodes to draw on the Dynkin diagram, as above.
-It also sets up TikZ nodes \texttt{(root label 0)}, \texttt{(root label 1)}, and so on for the labels, and TikZ nodes \texttt{(root label swap 0)}, \texttt{(root label swap 1)}, and so on as alternative label locations, in case you want two labels on the same root, or the default choice doesn't look the way you like.
-\begin{LTXexample}
-\begin{tikzpicture}
-\dynkin{E}{6};
-\rootlabel{2}{\alpha_2}
-\rootlabel{5}{\alpha_5}
-\end{tikzpicture}
-\end{LTXexample}
+\section{Indefinite edges}
-\section{Example: some parabolic subgroups}
+An \emph{indefinite edge} is a dashed edge between two roots, \dynkin{A}{*.*} indicating that an indefinite number of roots have been omitted from the Dynkin diagram.
+In between any two entries in a mark list, place a period to indicate an indefinite edge:
+\begin{tcblisting}{title={Indefinite edges}}
+\dynkin{D}{o.o*.*.t.to.t}
+\end{tcblisting}
-\newcommand{\drawparabolic}[3]{#1_{#2,#3} & \tikz \dynkin[parabolic=#3]{#1}{#2}; \\}
+In certain diagrams, roots may have an edge between them even though they are not subsequent in the ordering.
+For such rare situations, there is an option:
+\begin{tcblisting}{title={Indefinite edge option}}
+\dynkin[makeIndefiniteEdge={3-5},label]{D}{5}
+\end{tcblisting}
+\begin{tcblisting}{title={Give a list of edges to become indefinite}}
+\dynkin[makeIndefiniteEdge/.list={1-2,3-5},label]{D}{5}
+\end{tcblisting}
-\begin{center}
-\begin{longtable}{@{}>{$}r<{$}m{2cm}m{2cm}@{}}
-\endfirsthead
-\endhead
-\endfoot
-\endlastfoot
-\drawparabolic{A}{1}{0}
-\drawparabolic{A}{1}{2}
-\drawparabolic{A}{2}{0}
-\drawparabolic{A}{2}{2}
-\drawparabolic{A}{2}{4}
-\drawparabolic{A}{2}{6}
-\drawparabolic{B}{2}{6}
-\drawparabolic{C}{3}{10}
-\drawparabolic{D}{5}{8}
-\drawparabolic{E}{6}{10}
-\drawparabolic{E}{7}{202}
-\drawparabolic{E}{8}{246}
-\drawparabolic{F}{4}{26}
-\drawparabolic{G}{2}{0}
-\drawparabolic{G}{2}{2}
-\drawparabolic{G}{2}{4}
-\drawparabolic{G}{2}{6}
-\end{longtable}
-\end{center}
+\begin{tcblisting}{title={Indefinite edge style}}
+\dynkin[indefiniteEdge/.style={draw=black,fill=white,thin,densely dashed},%
+ edgeLength=1cm,%
+ makeIndefiniteEdge={3-5}]
+ {D}{5}
+\end{tcblisting}
+\begin{tcblisting}{title={The ratio of the lengths of indefinite edges to those of other edges}}
+\dynkin[edgeLength = .5cm,%
+ indefiniteEdgeRatio=3,%
+ makeIndefiniteEdge={3-5}]
+ {D}{5}
+\end{tcblisting}
-\section{Example: the Hermitian symmetric spaces}
+\section{Parabolic subgroups}
- \renewcommand*{\arraystretch}{1.5}
-\begin{center}
-\begin{longtable}{@{}>{$}r<{$}m{2.2cm}m{5cm}@{}}
+Each set of roots is assigned a number, with each binary digit zero or one to say whether the corresponding root is crossed or not:
+\begin{tcblisting}{}
+The flag variety of pointed lines in
+projective 3-space is associated to
+the Dynkin diagram \dynkin[parabolic=3]{A}{3}.
+\end{tcblisting}
+
+\NewDocumentCommand\HSS{mommm}%
+{%
+ \begingroup
+ \renewcommand*{\arraystretch}{1.2}
+ \begin{tabular}{@{}>{$}r<{$}@{}m{6cm}@{}}
+ \\
+ \IfNoValueTF{#2}%
+ {%
+ #1 & \dynkin{#3}{#4} \\
+ & \csDynkin{#3}{#4} \\
+ }%
+ {%
+ #1 & \dynkin[#2]{#3}{#4} \\
+ & \csDynkin[#2]{#3}{#4} \\
+ }%
+ & #5%
+ \\[.75em]
+ \end{tabular}
+ \endgroup
+ \\
+}%
+
+\renewcommand*{\arraystretch}{1}
+\begin{longtable}{>{\columncolor[gray]{.9}}p{7cm}}
+\caption{The Hermitian symmetric spaces}
\endfirsthead
+\caption{\dots continued}\\
\endhead
+\caption{continued \dots}\\
\endfoot
\endlastfoot
- A_n &
- \dynkin[parabolic=16]{A}{*} &
- Grassmannian of $k$-planes in $\C{n+1}$
- \\
- B_n &
- \dynkin[parabolic=2]{B}{*} &
- $(2n-1)$-dimensional hyperquadric, i.e. the variety of null lines in $\C{2n+1}$
- \\
- C_n &
- \dynkin[parabolic=32]{C}{*} &
- space of Lagrangian $n$-planes in $\C{2n}$
- \\
- D_n &
- \dynkin[parabolic=2]{D}{*} &
- $(2n-2)$-dimensional hyperquadric, i.e. the variety of null lines in $\C{2n}$
- \\
- D_n &
- \dynkin[parabolic=64]{D}{*} &
- one component of the variety of maximal dimension null subspaces of $\C{2n}$ \\
- D_n &
- \dynkin[parabolic=32]{D}{*} &
- the other component\\
- E_6 &
- \dynkin[parabolic=2]{E}{6} &
- complexified octave projective plane\\
- E_6 &
- \dynkin[parabolic=64]{E}{6}&its dual plane\\
- E_7 &
- \dynkin[parabolic=128]{E}{7}& the space of null octave 3-planes in octave 6-space
+\HSS{A_n}{A}{**.*x*.**}{Grassmannian of $k$-planes in $\C{n+1}$}
+\HSS{B_n}[parabolic=1]{B}{}{$(2n-1)$-dimensional hyperquadric, i.e. the variety of null lines in $\C{2n+1}$}
+\HSS{C_n}[parabolic=16]{C}{}{space of Lagrangian $n$-planes in $\C{2n}$}
+\HSS{D_n}[parabolic=1]{D}{}{$(2n-2)$-dimensional hyperquadric, i.e. the variety of null lines in $\C{2n}$}
+\HSS{D_n}[parabolic=32]{D}{}{one component of the variety of maximal dimension null subspaces of $\C{2n}$}
+\HSS{D_n}[parabolic=16]{D}{}{the other component}
+\HSS{E_6}[parabolic=1]{E}{6}{complexified octave projective plane}
+\HSS{E_6}[parabolic=32]{E}{6}{its dual plane}
+\HSS{E_7}[parabolic=64]{E}{7}{the space of null octave 3-planes in octave 6-space}
\end{longtable}
-\end{center}
-
-
-\section{Affine extended Dynkin diagrams}
-
-\begin{LTXexample}
-\dynkin[affine,edge=thick]{A}{*}
-\end{LTXexample}
-
-\begin{LTXexample}
-\dynkin[edgelength=1cm,edge=thick,affine]{A}{*}
-\end{LTXexample}
-
-\begin{LTXexample}
-\dynkin[scale=1.5,edge=thick,affine]{A}{*}
-\end{LTXexample}
-
-
-\begin{LTXexample}
-\begin{tikzpicture}
-\dynkin[affine,label]{A}{8};
-\end{tikzpicture}
-\end{LTXexample}
-
-
-\begin{LTXexample}
-\begin{tikzpicture}
-\dynkin[affine]{A}{*};
-\node at (root label 0) {\(\alpha_0\)};
-\end{tikzpicture}
-\end{LTXexample}
-\begin{LTXexample}
-\begin{tikzpicture}
-\dynkin[affine]{A}{9}
-\node at (root label 0) {\(\alpha_0\)};
-\end{tikzpicture}
-\end{LTXexample}
-You can use TikZ to put in labels:
-\begin{LTXexample}
-\begin{tikzpicture}
-\dynkin[affine]{A}{9};
-\node at (root label 0) {\(\alpha_0\)};
-\node at (root label 1) {\(\alpha_1\)};
-\node at (root label 2) {\(\alpha_2\)};
-\node at (root label 3) {\(\alpha_3\)};
-\end{tikzpicture}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[affine,label]{A}{1}
-\end{LTXexample}
+\section{Extended Dynkin diagrams}
-\begin{LTXexample}
-\dynkin[affine,label]{B}{8}
-\end{LTXexample}
+\begin{tcblisting}{title={Extended Dynkin diagrams}}
+\dynkin[extended]{A}{7}
+\end{tcblisting}
-\begin{LTXexample}
-\dynkin[affine,label]{B}{*}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[affine,label]{C}{8}
-\end{LTXexample}
+The extended Dynkin diagrams are also described in the notation of Kac \cite{Kac:1990} p. 55 as affine untwisted Dynkin diagrams: we extend \verb!\dynkin{A}{7}! to become \verb!\dynkin{A}[1]{7}!:
+\begin{tcblisting}{title={Extended Dynkin diagrams}}
+\dynkin{A}[1]{7}
+\end{tcblisting}
-\begin{LTXexample}
-\dynkin[affine,label]{C}{*}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[affine,label]{D}{8}
-\end{LTXexample}
+\renewcommand*{\arraystretch}{1.5}
+\begin{dynkinTable}{The Dynkin diagrams of the extended simple root systems}{3cm}{5cm}
+\dyn[extended]{A}{1}
+\dyn[extended]{A}{}
+\dyn[extended]{B}{}
+\dyn[extended]{C}{}
+\dyn[extended]{D}{}
+\dyn[extended]{E}{6}
+\dyn[extended]{E}{7}
+\dyn[extended]{E}{8}
+\dyn[extended]{F}{4}
+\dyn[extended]{G}{2}
+\end{dynkinTable}
+
+
+\section{Affine twisted and untwisted Dynkin diagrams}
+
+The affine Dynkin diagrams are described in the notation of Kac \cite{Kac:1990} p. 55:
+\begin{tcblisting}{title={Affine Dynkin diagrams}}
+\(A^{(1)}_7=\dynkin{A}[1]{7}, \
+E^{(2)}_6=\dynkin{E}[2]{6}, \
+D^{(3)}_4=\dynkin{D}[3]{4}\)
+\end{tcblisting}
+
+
+
+\begin{dynkinTable}{The affine Dynkin diagrams}{3cm}{3.75cm}
+\dyn{A}[1]{1}
+\dyn{A}[1]{}
+\dyn{B}[1]{}
+\dyn{C}[1]{}
+\dyn{D}[1]{}
+\dyn{E}[1]{6}
+\dyn{E}[1]{7}
+\dyn{E}[1]{8}
+\dyn{F}[1]{4}
+\dyn{G}[1]{2}
+\dyn{A}[2]{2}
+\dyn{A}[2]{even}
+\dyn{A}[2]{odd}
+\dyn{D}[2]{}
+\dyn{E}[2]{6}
+\dyn{D}[3]{4}
+\end{dynkinTable}
+
+\begin{dynkinTable}{Some more affine Dynkin diagrams}{3cm}{3.25cm}
+\dyn{A}[2]{4}
+\dyn{A}[2]{5}
+\dyn{A}[2]{6}
+\dyn{A}[2]{7}
+\dyn{A}[2]{8}
+\dyn{D}[2]{3}
+\dyn{D}[2]{4}
+\dyn{D}[2]{5}
+\dyn{D}[2]{6}
+\dyn{D}[2]{7}
+\dyn{D}[2]{8}
+\dyn{D}[3]{4}
+\dyn{E}[2]{6}
+\end{dynkinTable}
+
+
+
+
+\section{Extended Coxeter diagrams}
+
+\begin{tcblisting}{title={Extended and Coxeter options together}}
+\dynkin[extended,Coxeter]{F}{4}
+\end{tcblisting}
+
+
+\begin{dynkinTable}{The extended (affine) Coxeter diagrams}{3cm}{6cm}
+\dyn[extended,Coxeter]{A}{}
+\dyn[extended,Coxeter]{B}{}
+\dyn[extended,Coxeter]{C}{}
+\dyn[extended,Coxeter]{D}{}
+\dyn[extended,Coxeter]{E}{6}
+\dyn[extended,Coxeter]{E}{7}
+\dyn[extended,Coxeter]{E}{8}
+\dyn[extended,Coxeter]{F}{4}
+\dyn[extended,Coxeter]{G}{2}
+\dyn[extended,Coxeter]{H}{3}
+\dyn[extended,Coxeter]{H}{4}
+\dyn[extended,Coxeter]{I}{1}
+\end{dynkinTable}
+
+
+\section{Kac style}
+
+We include a style called \verb!Kac! which tries to imitate the style of \cite{Kac:1990}.
+
+\begin{tcblisting}{title={Kac style}}
+\dynkin[Kac]{F}{4}
+\end{tcblisting}
+
+
+
+\begingroup
+\pgfkeys{/Dynkin diagram,Kac}
+\newcolumntype{D}{>{\columncolor[gray]{1}}m{\wdtD}}
+\begin{dynkinTable}{The Dynkin diagrams of the extended simple root systems in Kac style. At the moment, it only works on a white background.}{5cm}{4.5cm}
+\dyn[extended]{A}{1}
+\dyn[extended]{A}{}
+\dyn[extended]{B}{}
+\dyn[extended]{C}{}
+\dyn[extended]{D}{}
+\dyn[extended]{E}{6}
+\dyn[extended]{E}{7}
+\dyn[extended]{E}{8}
+\dyn[extended]{F}{4}
+\dyn[extended]{G}{2}
+\end{dynkinTable}
+\endgroup
-\begin{LTXexample}
-\dynkin[affine,label]{D}{*}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[affine,label]{E}{6}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[affine,label]{E}{7}
-\end{LTXexample}
+\section{Folded Dynkin diagrams}
-\begin{LTXexample}
-\dynkin[affine,label]{E}{8}
-\end{LTXexample}
+The Dynkin diagrams package has limited support for folding Dynkin diagrams.
-Open circles instead of closed dots:
-\begin{LTXexample}
-\dynkin[affine,open,label]{E}{8}
-\end{LTXexample}
+\begin{tcblisting}{title={Folding}}
+\dynkin[fold]{A}{13}
+\end{tcblisting}
-\begin{LTXexample}
-\dynkin[affine,label]{F}{4}
-\end{LTXexample}
+\begin{tcblisting}{title={Big fold radius}}
+\dynkin[fold,foldradius=1cm]{A}{13}
+\end{tcblisting}
-\begin{LTXexample}
-\dynkin[affine,label]{G}{2}
-\end{LTXexample}
+\begin{tcblisting}{title={Small fold radius}}
+\dynkin[fold,foldradius=.2cm]{A}{13}
+\end{tcblisting}
+Some Dynkin diagrams have multiple foldings, which we attempt to distinguish (not entirely successfully) by their \emph{ply}: the maximum number of roots folded together.
+Most diagrams can only allow a 2-ply folding, so \verb!fold! is a synonym form \verb!ply=2!.
-\section{Coxeter diagrams}
+\begin{tcblisting}{title={3-ply}}
+\dynkin[ply=3]{D}{4}
+\dynkin[ply=3]{D}[1]{4}
+\end{tcblisting}
-\begin{LTXexample}
-\dynkin[Coxeter]{B}{7}
-\end{LTXexample}
+\begin{tcblisting}{title={4-ply}}
+\dynkin[ply=4]{D}[1]{4}
+\end{tcblisting}
-\begin{LTXexample}
-\dynkin[Coxeter]{F}{4}
-\end{LTXexample}
+The \(D^{(1)}_{\ell}\) diagrams can be folded on their left end and separately on their right end:
+\begin{tcblisting}{title={Left, right and both}}
+\dynkin{D}[1]{} \
+\dynkin[foldleft]{D}[1]{} \
+\dynkin[foldright]{D}[1]{} \
+\dynkin[fold]{D}[1]{}
+\end{tcblisting}
-\begin{LTXexample}
-\dynkin[Coxeter]{G}{2}
-\end{LTXexample}
+We have to be careful about the 4-ply foldings of \(D^{(1)}_{2\ell}\), for which we can have two different patterns, so by default, the package only draws as much as it can without distinguishing the two:
+\begin{tcblisting}{title={Default \(D^{(1)}_{2\ell}\) and the two ways to finish it}}
+\begin{tikzpicture}
+ \dynkin[ply=4]{D}[1]{****.*****.*****}%
+\end{tikzpicture} \
+\begin{tikzpicture}
+ \dynkin[ply=4]{D}[1]{****.*****.*****}%
+ \dynkinFold[bend right=65]{1}{13}%
+ \dynkinFold[bend right=65]{0}{14}%
+\end{tikzpicture} \
+\begin{tikzpicture}
+ \dynkin[ply=4]{D}[1]{****.*****.*****}%
+ \dynkinFold{0}{1}%
+ \dynkinFold{1}{13}%
+ \dynkinFold{13}{14}%
+\end{tikzpicture}
+\end{tcblisting}
-\begin{LTXexample}
-\dynkin[Coxeter]{H}{7}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[Coxeter]{I}{7}
-\end{LTXexample}
+\begingroup
+\RenewDocumentCommand\wdtD{}{3.5cm}
+\RenewDocumentCommand\wdtL{}{7cm}
+\NewDocumentCommand\seriesName{mmm}%
+{%
+ \IfStrEq{#2}{0}{#1_{#3}}{#1^{#2}_{#3}}%
+}%
-\section{Folded Dynkin diagrams}
+\NewDocumentCommand\foldingTable{smmmmmmmm}%
+{%
+\begin{tabular}{ADL}%
+\seriesName{#2}{#3}{#4}&#5
+\seriesName{#6}{#7}{#8}&\IfBooleanTF{#1}{\reflectbox{#9}}{#9}%
+\end{tabular}%
+\\ \hline
+}%
-\begin{LTXexample}
-\dynkin[folded]{E}{6}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[folded,label]{E}{6}
-\end{LTXexample}
+\NewDocumentCommand\fold{smmmmmm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \foldingTable%
+ {#2}{#3}{#4}{\dynk[fold]{#2}[#3]{#4}}%
+ {#5}{#6}{#7}{\dynk[reverseArrows]{#5}[#6]{#7}}%
+ }%
+ {%
+ \foldingTable%
+ {#2}{#3}{#4}{\dynk[fold]{#2}[#3]{#4}}%
+ {#5}{#6}{#7}{\dynk{#5}[#6]{#7}}%
+ }%
+}%
-\begin{LTXexample}
-\dynkin[folded]{A}{*}
-\end{LTXexample}
+\begin{filecontents*}{DoneTwoElBendy.tex}
+\begin{tikzpicture}
+ \dynkin[ply=4]{D}[1]{****.*****.*****}
+ \dynkinFold[bend right=65]{1}{13}
+ \dynkinFold[bend right=65]{0}{14}
+\end{tikzpicture}
+\end{filecontents*}
-\begin{LTXexample}
-\dynkin[folded,label]{A}{1}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[folded,label]{A}{2}
-\end{LTXexample}
+\begin{filecontents*}{DoneTwoElStraight.tex}
+\begin{tikzpicture}
+ \dynkin[ply=4]{D}[1]{****.*****.*****}
+ \dynkinFold{0}{1}
+ \dynkinFold{1}{13}
+ \dynkinFold{13}{14}
+\end{tikzpicture}
+\end{filecontents*}
-\begin{LTXexample}
-\dynkin[folded,label]{A}{3}
-\end{LTXexample}
+\pgfkeys{/Dynkin diagram,foldradius=.35cm}
+\begin{longtable}{@{}p{15cm}@{}}
+\caption{Some foldings of Dynkin diagrams}\\
+\endfirsthead
+\caption{\dots continued}\\
+\endhead
+\multicolumn{1}{c}{continued \dots}\\
+\endfoot
+\endlastfoot
+\fold{A}{0}{3}{C}{0}{2}
+\foldingTable{A}{0}{2\ell-1}{\dynk[fold]{A}{**.*****.**}}%
+{C}{0}{\ell}{\dynk{C}{}}
+\fold*{B}{0}{3}{G}{0}{2}
+\foldingTable{D}{0}{4}{\dynk[ply=3]{D}{4}}%
+{G}{0}{2}{\dynk{G}{2}}
+\foldingTable{D}{0}{\ell+1}{\dynk[fold]{D}{}}%
+{B}{0}{\ell}{\dynk{B}{}}
+\fold*{E}{0}{6}{F}{0}{4}
+\foldingTable{A}{1}{3}{\dynk[ply=4]{A}[1]{3}}%
+{A}{1}{1}{\dynk{A}[1]{1}}
+\foldingTable{A}{1}{2\ell-1}{\dynk[fold]{A}[1]{**.*****.**}}%
+{C}{1}{\ell}{\dynk{C}[1]{}}
+\foldingTable{B}{1}{3}{\dynk[ply=3]{B}[1]{3}}%
+{A}{2}{2}{\dynk{A}[2]{2}}
+\foldingTable{B}{1}{3}{\dynk[ply=2]{B}[1]{3}}%
+{G}{1}{2}{\dynk{G}[1]{2}}
+\foldingTable{B}{1}{\ell}{\dynk[fold]{B}[1]{}}{D}{2}{\ell}{\dynk{D}[2]{}}
+\foldingTable{D}{1}{4}{\dynk[ply=3]{D}[1]{4}}%
+{B}{1}{3}{\dynk{B}[1]{3}}
+\foldingTable{D}{1}{4}{\dynk[ply=3]{D}[1]{4}}%
+{G}{1}{2}{\dynk{G}[1]{2}}
+\foldingTable{D}{1}{\ell+1}{\dynk[fold]{D}[1]{}}%
+{D}{2}{\ell}{\dynk{D}[2]{}}
+\foldingTable{D}{1}{\ell+1}{%
+\dynk[foldright]{D}[1]{}}%
+{B}{1}{\ell}{\dynk{B}[1]{}}
+\foldingTable{D}{1}{2\ell}{%
+\input{DoneTwoElStraight.tex}
+&
+\VerbatimInput{DoneTwoElStraight.tex} \\
+}%
+{A}{2}{\text{odd}}{\dynk{A}[2]{odd}}
+\foldingTable{D}{1}{2\ell}{%
+\input{DoneTwoElBendy.tex}
+&
+\VerbatimInput{DoneTwoElBendy.tex} \\
+}%
+{A}{2}{\text{even}}{\dynk{A}[2]{even}}
+\fold*{E}{1}{6}{F}{1}{4}
+\foldingTable{E}{1}{6}{\dynk[ply=3]{E}[1]{6}}%
+{D}{3}{4}{\dynk{D}[3]{4}}
+\fold{E}{1}{7}{E}{2}{6}
+\fold{F}{1}{4}{G}{1}{2}
+\foldingTable{A}{2}{\text{odd}}{%
+\dynk[odd,fold]{A}[2]{****.***}
+}%
+{A}{2}{\text{even}}{\dynk{A}[2]{even}}
+\foldingTable{D}{2}{3}{\dynk[fold]{D}[2]{3}}%
+{A}{2}{2}{\dynk{A}[2]{2}}
+\end{longtable}
+\endgroup
-\begin{LTXexample}
-\dynkin[folded,label]{A}{4}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[folded,label]{A}{10}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[folded,label]{A}{11}
-\end{LTXexample}
+\section{Root ordering}\label{section:order}
-\begin{LTXexample}
-\dynkin[folded,label,arrows=false]{A}{11}
-\end{LTXexample}
+\begin{tcblisting}{title={Root ordering}}
+\dynkin[label,ordering=Adams]{E}{6}
+\dynkin[label,ordering=Bourbaki]{E}{6}
+\dynkin[label,ordering=Carter]{E}{6}
+\dynkin[label,ordering=Dynkin]{E}{6}
+\dynkin[label,ordering=Kac]{E}{6}
+\end{tcblisting}
+Default is Bourbaki.
-\begin{LTXexample}
-\dynkin[folded]{D}{*}
-\end{LTXexample}
+\NewDocumentCommand\tablerow{mm}%
+{%
+#1_{#2}
+&
+\dynkin[label,ordering=Adams]{#1}{#2}
+&
+\dynkin[label]{#1}{#2}
+&
+\dynkin[label,ordering=Carter]{#1}{#2}
+&
+\dynkin[label,ordering=Dynkin]{#1}{#2}
+&
+\dynkin[label,ordering=Kac]{#1}{#2}
+\\
+}%
-\begin{LTXexample}
-\dynkin[folded,label]{D}{1}
-\end{LTXexample}
+\begin{center}
+\RenewDocumentCommand\wdtA{}{.7cm}
+\RenewDocumentCommand\wdtL{}{2.2cm}
+\begin{longtable}{@{}ALLLLL@{}}
+\toprule
+& Adams & Bourbaki & Carter & Dynkin & Kac \\ \midrule
+\endfirsthead
+\toprule
+Adams & Bourbaki & Carter & Dynkin & Kac \\ \midrule
+\endhead
+\bottomrule
+\endfoot
+\bottomrule
+\endlastfoot
+\tablerow{E}{6}
+\tablerow{E}{7}
+\tablerow{E}{8}
+\tablerow{F}{4}
+\tablerow{G}{2}
+\end{longtable}
+\end{center}
-\begin{LTXexample}
-\dynkin[folded,label]{D}{2}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin[folded,label]{D}{3}
-\end{LTXexample}
+\section{Connecting Dynkin diagrams}\label{section:name}
-\begin{LTXexample}
-\dynkin[folded,label]{D}{4}
-\end{LTXexample}
+We can make some sophisticated folded diagrams by drawing multiple diagrams, each with a name:
+\begin{tcblisting}{title={Name a diagram}}
+\dynkin[name=Bob]{D}{6}
+\end{tcblisting}
+We can then connect the two with folding edges:
+\begin{tcblisting}{title={Connect diagrams}}
+\begin{tikzpicture}
+ \dynkin[name=upper]{A}{3}
+ \node (current) at ($(upper root 1)+(0,-.3cm)$) {};
+ \dynkin[at=(current),name=lower]{A}{3}
+ \begin{scope}[on background layer]
+ \foreach \i in {1,...,3}%
+ {%
+ \draw[/Dynkin diagram/foldStyle]
+ ($(upper root \i)$) -- ($(lower root \i)$);%
+ }%
+ \end{scope}
+\end{tikzpicture}
+\end{tcblisting}
-\begin{LTXexample}
-\dynkin[folded,label]{D}{10}
-\end{LTXexample}
+The following diagrams arise in the Satake diagrams of the pseudo-Riemannian symmetric spaces \cite{Baba:2009}.
-\begin{LTXexample}
-\dynkin[folded,label]{D}{11}
-\end{LTXexample}
+\begin{tcblisting}{}
+\pgfkeys{/Dynkin diagram,edgeLength=.5cm,foldradius=.5cm}
+\begin{tikzpicture}
+ \dynkin[name=1]{A}{IIIb}
+ \node (a) at (.3,.4){};
+ \dynkin[name=2,at=(a)]{A}{IIIb}
+ \begin{scope}[on background layer]
+ \foreach \i in {1,...,7}%
+ {%
+ \draw[/Dynkin diagram/foldStyle]
+ ($(1 root \i)$)
+ --
+ ($(2 root \i)$);%
+ }%
+ \end{scope}
+\end{tikzpicture}
+\end{tcblisting}
+\begin{tcblisting}{}
+\pgfkeys{/Dynkin diagram/edgeLength=.75cm,/Dynkin diagram/edge/.style={draw=white,double=black,very thick},
+}
+\begin{tikzpicture}
+ \foreach \d in {1,...,4}
+ {
+ \node (current) at ($(\d*.05,\d*.3)$){};
+ \dynkin[name=\d,at=(current)]{D}{oo.oooo}
+ }
+ \begin{scope}[on background layer]
+ \foreach \i in {1,...,6}%
+ {%
+ \draw[/Dynkin diagram/foldStyle] ($(1 root \i)$) -- ($(2 root \i)$);%
+ \draw[/Dynkin diagram/foldStyle] ($(2 root \i)$) -- ($(3 root \i)$);%
+ \draw[/Dynkin diagram/foldStyle] ($(3 root \i)$) -- ($(4 root \i)$);%
+ }%
+ \end{scope}
+\end{tikzpicture}
+\end{tcblisting}
-\section{Satake diagrams}
+\section{Other examples}
-We have incomplete support for Satake diagrams as yet, following the conventions of \cite{Helgason:2001}.
+Below we draw the Vogan diagrams of some affine Lie superalgebras \cite{Ransingh:2013,Ransingh:unpub}.
-\begin{LTXexample}
-\dynkin{A}{I}
-\end{LTXexample}
+\begingroup
-\begin{LTXexample}
-\dynkin{A}{II}
-\end{LTXexample}
+\NewDocumentCommand\labls{m}%
+{%
+ \ifcase#1%
+ {1}\or%
+ {1}\or%
+ {2}\or%
+ {2}\or%
+ {2}\or%
+ {2}\or%
+ {2}\or%
+ {1}\or%
+ {1}\or%
+ \else\typeout{What?}%
+ \fi%
+}%
+\NewDocumentCommand\lablIt{m}%
+{%
+ \ifnum#1=0\relax%
+ 1%
+ \else
+ 2%
+ \fi%
+}%
-\begin{LTXexample}
-\dynkin{E}{I}
-\end{LTXexample}
+\tikzset{/Dynkin diagram,labelMacro/.code=\labls{#1},label,radius=.06cm}
-\begin{LTXexample}
-\dynkin{E}{II}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin{E}{III}
-\end{LTXexample}
+\tcbset{text width=10cm}
+\RenewDocumentCommand\wdtA{}{2cm}
-\begin{LTXexample}
-\dynkin{E}{IV}
-\end{LTXexample}
+\NewDocumentEnvironment{Category}{m}%
+{%
+\begin{tcolorbox}[title={\(#1\)},breakable]{}
+}%
+{%
+\end{tcolorbox}
+}%
-\begin{LTXexample}
-\dynkin{E}{V}
-\end{LTXexample}
+\begin{Category}{\mathfrak{sl}\left(2m|2n\right)^{(2)}}
+\begin{tcblisting}{}
+\begin{tikzpicture}
+ \dynkin[ply=2,label]{B}[1]{oo.oto.oo}
+ \dynkinLabelRoot*{7}{1}
+\end{tikzpicture}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label]{B}[1]{oo.oto.oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[ply=2,label]{B}[1]{oo.Oto.Oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label]{B}[1]{oo.Oto.Oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label]{D}[1]{oo.oto.ooo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label]{D}[1]{oO.otO.ooo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label,fold]{D}[1]{oo.oto.ooo}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{\mathfrak{sl}\left(2m+1|2n\right)^2}
+\begin{tcblisting}{}
+\dynkin[label]{B}[1]{oo.oto.oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label]{B}[1]{oO.oto.oO}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label,fold]{B}[1]{oo.oto.oo}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{\mathfrak{sl}\left(2m+1|2n+1\right)^2}
+\begin{tcblisting}{}
+\dynkin[label]{D}[2]{o.oto.oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label]{D}[2]{o.OtO.oo}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{\mathfrak{sl}\left(2|2n+1\right)^{(2)}}
+\begin{tcblisting}{}
+\dynkin[ply=2,label,doubleEdges]{B}[1]{oo.Oto.Oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[ply=2,label,doubleFold]{B}[1]{oo.Oto.Oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[ply=2,label,doubleEdges]{B}[1]{oo.OtO.oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[ply=2,label,doubleFold]{B}[1]{oo.OtO.oo}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{\mathfrak{sl}\left(2|2n\right)^{(2)}}
+\begin{tcblisting}{}
+\dynkin[ply=2,label,doubleEdges]{D}[1]{oo.oto.ooo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[ply=2,label,doubleFoldLeft]{D}[1]{oo.oto.ooo}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{\mathfrak{osp}\left(2m|2n\right)^{(2)}}
+\begin{tcblisting}{}
+\dynkin[label,labelMacro/.code={1}]{D}[2]{o.oto.oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label,labelMacro/.code={1}]{D}[2]{o.Oto.Oo}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{\mathfrak{osp}\left(2|2n\right)^{(2)}}
+\begin{tcblisting}{}
+\dynkin[label,labelMacro/.code=\lablIt{#1},
+ affineMark=*]
+ {D}[2]{o.o.o.o*}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label,labelMacro/.code=\lablIt{#1},
+ affineMark=*]
+ {D}[2]{o.O.o.o*}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{\mathfrak{sl}\left(1|2n+1\right)^{4}}
+\begin{tcblisting}{}
+\dynkin[label,labelMacro/.code={1}]{D}[2]{o.o.o.o*}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[label,labelMacro/.code={1}]{D}[2]{o.o.O.o*}
+\end{tcblisting}
+\end{Category}
+
+
+\begin{Category}{A^1}
+\begin{tcblisting}{}
+\begin{tikzpicture}
+ \dynkin[name=upper]{A}{oo.t.oo}
+ \node (Dynkin current) at (upper root 1){};
+ \dynkinSouth
+ \dynkin[at=(Dynkin current),name=lower]{A}{oo.t.oo}
+ \begin{scope}[on background layer]
+ \foreach \i in {1,...,5}{
+ \draw[/Dynkin diagram/foldStyle]
+ ($(upper root \i)$) -- ($(lower root \i)$);
+ }
+ \end{scope}
+\end{tikzpicture}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[fold]{A}[1]{oo.t.ooooo.t.oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[fold,affineMark=t]{A}[1]{oo.o.ootoo.o.oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[affineMark=t]{A}[1]{o*.t.*o}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{B^1}
+\begin{tcblisting}{}
+\dynkin[affineMark=*]{A}[2]{o.oto.o*}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[affineMark=*]{A}[2]{o.oto.o*}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[affineMark=*]{A}[2]{o.ooo.oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[odd]{A}[2]{oo.*to.*o}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[odd,fold]{A}[2]{oo.oto.oo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[odd,fold]{A}[2]{o*.oto.o*}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{D^1}
+\begin{tcblisting}{}
+\dynkin{D}{otoo}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin{D}{ot*o}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[fold]{D}{otoo}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{C^1}
+\begin{tcblisting}{}
+\dynkin[doubleEdges,fold,affineMark=t,odd]{A}[2]{to.o*}
+\end{tcblisting}
+\begin{tcblisting}{}
+\dynkin[doubleEdges,fold,affineMark=t,odd]{A}[2]{t*.oo}
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{F^1}
+\begin{tcblisting}{}
+\begin{tikzpicture}%
+ \dynkin{A}{oto*}%
+ \dynkinQuadrupleEdge{1}{2}%
+ \dynkinTripleEdge{4}{3}%
+\end{tikzpicture}%
+\end{tcblisting}
+\begin{tcblisting}{}
+\begin{tikzpicture}%
+ \dynkin{A}{*too}%
+ \dynkinQuadrupleEdge{1}{2}%
+ \dynkinTripleEdge{4}{3}%
+\end{tikzpicture}%
+\end{tcblisting}
+\end{Category}
+
+\begin{Category}{G^1}
+\begin{tcblisting}{}
+\begin{tikzpicture}%
+ \dynkin{A}{ot*oo}%
+ \dynkinQuadrupleEdge{1}{2}%
+ \dynkinDefiniteDoubleEdge{4}{3}%
+\end{tikzpicture}%
+\end{tcblisting}
+\begin{tcblisting}{}
+\begin{tikzpicture}%
+ \dynkin{A}{oto*o}%
+ \dynkinQuadrupleEdge{1}{2}%
+ \dynkinDefiniteDoubleEdge{4}{3}%
+\end{tikzpicture}%
+\end{tcblisting}
+\begin{tcblisting}{}
+\begin{tikzpicture}%
+ \dynkin{A}{*too*}%
+ \dynkinQuadrupleEdge{1}{2}%
+ \dynkinDefiniteDoubleEdge{4}{3}%
+\end{tikzpicture}%
+\end{tcblisting}
+\begin{tcblisting}{}
+\begin{tikzpicture}%
+ \dynkin{A}{*tooo}%
+ \dynkinQuadrupleEdge{1}{2}%
+ \dynkinDefiniteDoubleEdge{4}{3}%
+\end{tikzpicture}%
+\end{tcblisting}
+\end{Category}
-\begin{LTXexample}
-\dynkin{E}{VI}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin{E}{VII}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin{E}{VIII}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin{E}{XI}
-\end{LTXexample}
-\begin{LTXexample}
-\dynkin{F}{I}
-\end{LTXexample}
+\section{Syntax}
-\begin{LTXexample}
-\dynkin{F}{II}
-\end{LTXexample}
+The syntax is \verb!\dynkin[<options>]{<letter>}[<twisted rank>]{<rank>}! where \verb!<letter>! is \verb!A!, \verb!B!, \verb!C!, \verb!D!, \verb!E!, \verb!F! or \verb!G!, the family of root system for the Dynkin diagram, \verb!<twisted rank>! is \verb!0!, \verb!1!, \verb!2!, \verb!3! (default is \verb!0!) representing:
+\[
+\renewcommand*{\arraystretch}{1}
+\begin{array}{rp{8cm}}
+0 & finite root system \\ \hline
+1 & affine extended root system, i.e. of type \({}^{(1)}\) \\
+2 & affine twisted root system of type \({}^{(2)}\) \\
+3 & affine twisted root system of type \({}^{(3)}\) \\
+\end{array}
+\]
+and \verb!<rank>! is
+\begin{enumerate}
+\item
+an integer representing the rank or
+\item
+blank to represent an indefinite rank or
+\item
+the name of a Satake diagram as in section~\ref{section:Satake}.
+\end{enumerate}
-\begin{LTXexample}
-\dynkin{G}{I}
-\end{LTXexample}
-\begin{LTXexample}
-\begin{tikzpicture}
-\dynkin[open]{E}{6}
-\draw[\dynkinfoldarrowstyle,\dynkinfoldarrowcolor]
- (root 1.south) to [out=-45, in=-135] (root 6.south);
-\draw[\dynkinfoldarrowstyle,\dynkinfoldarrowcolor]
- (root 3.south) to [out=-45, in=-135] (root 5.south);
-\end{tikzpicture}
-\end{LTXexample}
-\begin{LTXexample}
-\begin{tikzpicture}
-\dynkin[open]{E}{6}
-\dynkincloseddot{3}
-\dynkincloseddot{4}
-\dynkincloseddot{5}
-\draw[\dynkinfoldarrowstyle,\dynkinfoldarrowcolor]
- (root 1.south) to [out=-45, in=-135] (root 6.south);
-\end{tikzpicture}
-\end{LTXexample}
+\section{Options}
-\section{Other stuff}
+\newcommand*{\typ}[1]{\(\left<\texttt{#1}\right>\)}
+\newcommand*{\optionLabel}[3]{%%
+\multicolumn{2}{l}{\(\texttt{#1}=\texttt{#2}\),} \\
+\multicolumn{2}{l}{\(\textrm{default}: \texttt{#3}\)} \\
+}%%
-Some sophisticated diagrams:
-\begin{center}
-\begin{tikzpicture}
-\dynkin[folded]{D}{9}
-\foreach \i in {2,6,8,9} {
- \dynkinopendot{\i}
-}
-\dynkinline[white]{4}{5}
-\dynkindots{4}{5}
-\dynkinopendot{4}
-\dynkincloseddot{5}
-\end{tikzpicture}
-\end{center}
-can be drawn using sending TikZ options to \verb!\dynkinline! to erase the old edge, \verb!\dynkindots! to make indefinite edges, and then redrawing the roots next to any edge we draw:
-\begin{LTXexample}
-\begin{tikzpicture}[show background rectangle,
- background rectangle/.style={fill=red!10}]
-\dynkin[folded]{D}{9};
-\foreach \i in {2,6,8,9} {
- \dynkinopendot{\i}
-}
-\dynkinline[red!10]{4}{5}
-\dynkindots{4}{5}
-\dynkinopendot{4}
-\dynkincloseddot{5}
-\end{tikzpicture}
-\end{LTXexample}
+\renewcommand*{\arraystretch}{1}
+\par\noindent%
+\begin{longtable}{p{1cm}p{10cm}}
+\endfirsthead
+\caption{\dots continued}\\
+\endhead
+\multicolumn{2}{c}{continued \dots}\\
+\endfoot
+\endlastfoot
+\optionLabel{text/.style}{\typ{TikZ style data}}{scale=.7}
+& Style for any labels on the roots. \\
+\optionLabel{name}{\typ{string}}{anonymous}
+& A name for the Dynkin diagram, with \texttt{anonymous} treated as a blank; see section~\ref{section:name}. \\
+\optionLabel{parabolic}{\typ{integer}}{0}
+& A parabolic subgroup with specified integer, where the integer
+is computed as \(n=\sum 2^{i-1} a_i\), \(a_i=0\) or \(1\), to say that root \(i\) is crossed, i.e. a noncompact root. \\
+\optionLabel{radius}{\typ{number}cm}{.05cm}
+& size of the dots and of the crosses in the Dynkin diagram \\
+\optionLabel{edgeLength}{\typ{number}cm}{.35cm}
+& distance between nodes in the Dynkin diagram \\
+\optionLabel{edge/.style}{TikZ style data}{thin}
+& style of edges in the Dynkin diagram \\
+\optionLabel{mark}{\typ{o,O,t,x,X,*}}{*}
+& default root mark \\
+\optionLabel{affineMark}{o,O,t,x,X,*}{*}
+& default root mark for root zero in an affine Dynkin diagram \\
+\optionLabel{label}{true or false}{false}
+& whether to label the roots according to the current labelling scheme. \\
+\optionLabel{labelMacro}{\typ{1-parameter \TeX{} macro}}{\texttt{\#1}}
+& the current labelling scheme. \\
+\optionLabel{makeIndefiniteEdge}{\typ{edge pair \(i\)-\(j\) or list of such}}{\{\}}
+& edge pair or list of edge pairs to treat as having indefinitely many roots on them. \\
+\optionLabel{indefiniteEdgeRatio}{\typ{float}}{1.6}
+& ratio of indefinite edge lengths to other edge lengths. \\
+\optionLabel{indefiniteEdge/.style}{\typ{TikZ style data}}{draw=black,fill=white,thin,densely dotted}
+& style of the dotted or dashed middle third of each indefinite edge. \\
+\optionLabel{arrows}{\typ{true or false}}{true}
+& whether to draw the arrows that arise along the edges. \\
+\optionLabel{reverseArrows}{\typ{true or false}}{true}
+& whether to reverse the direction of the arrows that arise along the edges. \\
+\optionLabel{fold}{\typ{true or false}}{true}
+& whether, when drawing Dynkin diagrams, to draw them 2-ply. \\
+\optionLabel{ply}{\typ{0,1,2,3,4}}{0}
+& how many roots get folded together, at most. \\
+\optionLabel{foldleft}{\typ{true or false}}{true}
+& whether to fold the roots on the left side of a Dynkin diagram. \\
+\optionLabel{foldright}{\typ{true or false}}{true}
+& whether to fold the roots on the right side of a Dynkin diagram. \\
+\optionLabel{foldradius}{\typ{length}}{.3cm}
+& the radius of circular arcs used in curved edges of folded Dynkin diagrams. \\
+\optionLabel{foldStyle}{\typ{TikZ style data}}{draw=black!40,fill=none,line width=radius}
+& when drawing folded diagrams, style for the fold indicators. \\
+\optionLabel{*/.style}{\typ{TikZ style data}}{draw=black,fill=black}
+& style for roots like \dynkin{A}{*} \\
+\optionLabel{o/.style}{\typ{TikZ style data}}{draw=black,fill=black}
+& style for roots like \dynkin{A}{o} \\
+\optionLabel{O/.style}{\typ{TikZ style data}}{draw=black,fill=black}
+& style for roots like \dynkin{A}{O} \\
+\optionLabel{t/.style}{\typ{TikZ style data}}{draw=black,fill=black}
+& style for roots like \dynkin{A}{t} \\
+\optionLabel{x/.style}{\typ{TikZ style data}}{draw=black}
+& style for roots like \dynkin{A}{x} \\
+\optionLabel{X/.style}{\typ{TikZ style data}}{draw=black,thick}
+& style for roots like \dynkin{A}{X} \\
+\optionLabel{leftFold/.style}{\typ{TikZ style data}}{}
+& style to override the \texttt{fold} style when folding roots together on the left half of a Dynkin diagram \\
+\optionLabel{rightFold/.style}{\typ{TikZ style data}}{}
+& style to override the \texttt{fold} style when folding roots together on the right half of a Dynkin diagram \\
+\optionLabel{doubleEdges}{\typ{}}{not set}
+& set to override the \texttt{fold} style when folding roots together in a Dynkin diagram, so that the foldings
+are indicated with double edges (like those of an \(F_4\) Dynkin diagram without arrows). \\
+\optionLabel{doubleFold}{\typ{}}{not set}
+& set to override the \texttt{fold} style when folding roots together in a Dynkin diagram, so that the foldings
+are indicated with double edges (like those of an \(F_4\) Dynkin diagram without arrows), but filled in solidly. \\
+\optionLabel{doubleLeft}{\typ{}}{not set}
+& set to override the \texttt{fold} style when folding roots together at the left side of a Dynkin diagram, so that the foldings are indicated with double edges (like those of an \(F_4\) Dynkin diagram without arrows). \\
+\optionLabel{doubleFoldLeft}{\typ{}}{not set}
+& set to override the \texttt{fold} style when folding roots together at the left side of a Dynkin diagram, so that the foldings are indicated with double edges (like those of an \(F_4\) Dynkin diagram without arrows), but filled in solidly. \\
+\optionLabel{doubleRight}{\typ{}}{not set}
+& set to override the \texttt{fold} style when folding roots together at the right side of a Dynkin diagram, so that the foldings are indicated with double edges (like those of an \(F_4\) Dynkin diagram without arrows). \\
+\optionLabel{doubleFoldRight}{\typ{}}{not set}
+& set to override the \texttt{fold} style when folding roots together at the right side of a Dynkin diagram, so that the foldings are indicated with double edges (like those of an \(F_4\) Dynkin diagram without arrows), but filled in solidly.
+\\
+\optionLabel{Coxeter}{\typ{true or false}}{false}
+& whether to draw a Coxeter diagram, rather than a Dynkin diagram. \\
+\optionLabel{ordering}{\typ{Adams, Bourbaki, Carter, Dynkin, Kac}}{Bourbaki}
+& which ordering of the roots to use in exceptional root systems as in section~\ref{section:order}. \\
+\end{longtable}
+\par\noindent{}All other options are passed to TikZ.
-Always draw roots after edges.
\nocite{*}
\bibliographystyle{amsplain}
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 8ed53464f8f..aec4b70689c 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 2
+% Version 3.1
%
%
% This package draws Dynkin diagrams in LaTeX documents, using the TikZ package.
@@ -18,7 +18,7 @@
%
%
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
-\ProvidesPackage{dynkin-diagrams}[2017/11/14 Dynkin diagrams]
+\ProvidesPackage{dynkin-diagrams}[2018/02/11 Dynkin diagrams]
\RequirePackage{tikz}
\RequirePackage{xstring}
\RequirePackage{xparse}
@@ -29,122 +29,225 @@
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows,arrows.meta}
\usetikzlibrary{calc}
+\usetikzlibrary{fit}
%%
%% Application programming interface:
%% See dynkin-diagrams.tex file for examples of use.
%%
-\NewDocumentCommand\dynkin{O{}mm}%
+\NewDocumentCommand\dynkin{O{}mO{0}m}%
{%
\ifdefined\filldraw%
- \@dynkin[#1]{#2}{#3}%
+ \@dynkin[#1]{#2}[#3]{#4}%
\else%
- \tikz[baseline=-\the\dimexpr\fontdimen22\textfont2\relax ]{\@dynkin[#1]{#2}{#3}}%
+ \tikz[baseline=-0.5ex]{\@dynkin[#1]{#2}[#3]{#4}}%
\fi%
}%
-%% \convertRootNumber{<n>}
-%% ->
-%% Converts <n> from Bourbaki ordering to the current ordering, storing the result in a count called \RootNumber.
-\NewDocumentCommand\convertRootNumber{m}%
+\NewDocumentCommand\dynkinRefreshRoots{}%
{%
- \IfStrEq{#1}{0}
- {
- \global\RootNumber=0
- }
- {
- \IfStrEqCase{\dynkinseries}%
+ \dynkin@draw@all@roots{}%
+ \ifdynkin@label@the@roots\dynkinPrintLabels{}\fi%
+}%
+
+
+%% \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.
+\NewDocumentCommand\dynkinLabelRoot{smm}%
+{%
+ \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}%
{%
- {E}%
- {%
- \ifnum\dynkinrank=6%
- \IfStrEqCase{\dynkinordering}%
- {%
- {Adams}{\RootNumber=\stringcharacterinposition{152436}{#1}}%
- {Carter}{\RootNumber=\stringcharacterinposition{142356}{#1}}%
- {Dynkin}{\RootNumber=\stringcharacterinposition{162345}{#1}}%
- {Kac}{\RootNumber=\stringcharacterinposition{162345}{#1}}%
+ \IfStrEqCase{\temp}{%
+ {l}{%
+ \node[inner sep=\dynkin@root@radius,%
+ label={%
+ [/Dynkin diagram,/Dynkin diagram/text]%
+ right:%
+ \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)%
}%
- [\RootNumber=#1]%
- \else%
- \ifnum\dynkinrank=7%
- \IfStrEqCase{\dynkinordering}%
- {%
- {Adams}{\RootNumber=\stringcharacterinposition{6354217}{#1}}%
- {Carter}{\RootNumber=\stringcharacterinposition{7564321}{#1}}%
- {Dynkin}{\RootNumber=\stringcharacterinposition{1723456}{#1}}%
- {Kac}{\RootNumber=\stringcharacterinposition{1723456}{#1}}%
+ ]%
+ at (\dynkin@root@name #2){};%
+ }%
+ {r}{%
+ \node[inner sep=\dynkin@root@radius,%
+ label={%
+ [/Dynkin diagram,/Dynkin diagram/text]%
+ left:%
+ \(\pgfkeys{/Dynkin diagram/labelMacro=#3}\)%
}%
- [\RootNumber=#1]%
- \else%
- \ifnum\dynkinrank=8%
- \IfStrEqCase{\dynkinordering}%
- {%
- {Adams}{\RootNumber=\stringcharacterinposition{13245678}{#1}}%
- {Carter}{\RootNumber=\stringcharacterinposition{86754321}{#1}}%
- {Dynkin}{\RootNumber=\stringcharacterinposition{18234567}{#1}}%
- {Kac}{\RootNumber=\stringcharacterinposition{78654321}{#1}}%
- }%
- [\RootNumber=#1]%
- \else%
- \fi%
- \fi%
- \fi%
- }%
- {F}%
- {%
- \IfStrEqCase{\dynkinordering}%
- {%
- {Adams}{\RootNumber=\stringcharacterinposition{4321}{#1}}%
+ ]%
+ 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){};%
}%
- [\RootNumber=#1]%
}%
- {G}%
- {%
- \IfStrEqCase{\dynkinordering}%
- {%
- {Carter}{\RootNumber=\stringcharacterinposition{21}{#1}}%
- {Dynkin}{\RootNumber=\stringcharacterinposition{21}{#1}}%
- {Kac}{\RootNumber=\stringcharacterinposition{21}{#1}}%
+ [\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){};%
}%
- [\RootNumber=#1]%
}%
+ [\ClassError%
+ {Dynkin diagrams}%
+ {Unrecognized root label direction:
+ ``\temp'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string} for root #2}%
+ {}]
}%
- [\RootNumber=#1]%
- }
}%
-\NewDocumentCommand\dynkinprint{m}%
+%% \dynkinPrintLabels
+%% Prints the default labels on the Dynkin diagram, in the given ordering.
+\newcommand{\dynkinPrintLabels}%
{%
- \scalebox{\dynkintextscale}{\(#1\)}%
+ \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%
}%
-%% \rootlabel{<n>}{<s>} or \rootlabel*{<n>}{<s>}
-%% ->
-%% Prints the label string <s> on the Dynkin diagram at root number <n>, in the current ordering convention.
-\NewDocumentCommand\rootlabel{smm}%
+%% \dynkinCrossRootMark{<n>}
+%% Prints a cross at root <n> on the current Dynkin diagram.
+%% The starred form accepts <n> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinCrossRootMark{sO{}m}%
{%
\IfBooleanTF{#1}%
- {\node at (root label swap #2) {\dynkinprint{#3}};}%
- {\node at (root label #2) {\dynkinprint{#3}};}%
+ {%
+ \convertRootNumber{#3}%
+ }%
+ {%
+ \RootNumber=#3%
+ }%
+ \draw[/Dynkin diagram,/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]%
+ ($(\dynkin@root@name \the\RootNumber)+(-\dynkin@root@radius,\dynkin@root@radius)$)%
+ --%
+ ($(\dynkin@root@name \the\RootNumber)+(\dynkin@root@radius,-\dynkin@root@radius)$);%
}%
-%% \dynkinprintlabels
-%% ->
-%% Prints the default labels on the Dynkin diagram, in the given ordering.
-\newcommand{\dynkinprintlabels}%
+%% \dynkinHeavyCrossRootMark{<n>}
+%% Prints a heavy cross at root <n> on the current Dynkin diagram.
+%% The starred form accepts <n> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinHeavyCrossRootMark{sO{}m}%
{%
- \foreach \i in {1,...,\the\dynkinrank}%
- {\rootlabel{\i}{\i}}%
- \ifisaffine\rootlabel{0}{0}\fi%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootNumber{#3}%
+ }%
+ {%
+ \RootNumber=#3%
+ }%
+ \draw[/Dynkin diagram,/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]%
+ ($(\dynkin@root@name \the\RootNumber)+(-\dynkin@root@radius,\dynkin@root@radius)$)%
+ --%
+ ($(\dynkin@root@name \the\RootNumber)+(\dynkin@root@radius,-\dynkin@root@radius)$);%
}%
-%% \dynkincross{<n>}
-%% ->
-%% Prints a cross at root <n> on the current Dynkin diagram.
+
+%% \dynkinHollowRootMark{<n>}
+%% Prints an hollow dot at root <n> on the current Dynkin diagram.
%% The starred form accepts <n> in the Bourbaki ordering.
-\NewDocumentCommand\dynkincross{sO{}m}%
+\NewDocumentCommand\dynkinHollowRootMark{sO{}m}%
{%
\IfBooleanTF{#1}%
{%
@@ -153,21 +256,13 @@
{%
\RootNumber=#3%
}%
- \draw[\dynkincrossstyle,\dynkincolor,#2]%
- ($(root \the\RootNumber)+(\dynkinradius,\dynkinradius)$)%
- --%
- ($(root \the\RootNumber)-(\dynkinradius,\dynkinradius)$);%
- \draw[\dynkincrossstyle,\dynkincolor]%
- ($(root \the\RootNumber)+(-\dynkinradius,\dynkinradius)$)%
- --%
- ($(root \the\RootNumber)+(\dynkinradius,-\dynkinradius)$);%
+ \fill[/Dynkin diagram,/Dynkin diagram/o,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);%
}%
-%% \dynkinopendot{<n>}
-%% ->
-%% Prints an open dot at root <n> on the current Dynkin diagram.
+%% \dynkinDoubleHollowRootMark{<n>}
+%% Prints a double hollow dot at root <n> on the current Dynkin diagram.
%% The starred form accepts <n> in the Bourbaki ordering.
-\NewDocumentCommand\dynkinopendot{sO{}m}%
+\NewDocumentCommand\dynkinDoubleHollowRootMark{sO{}m}%
{%
\IfBooleanTF{#1}%
{%
@@ -176,14 +271,14 @@
{%
\RootNumber=#3%
}%
- \fill[\dynkinbackcolor,draw=\dynkincolor,#2] (root \the\RootNumber) circle (\dynkinradius);%
+ \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);%
}%
-%% \dynkincloseddot{<n>}
-%% ->
-%% Prints a closed dot at root <n> on the current Dynkin diagram.
+%% \dynkinSolidRootMark{<n>}
+%% Prints a solid dot at root <n> on the current Dynkin diagram.
%% The starred form accepts <n> in the Bourbaki ordering.
-\NewDocumentCommand\dynkincloseddot{sO{}m}%
+\NewDocumentCommand\dynkinSolidRootMark{sO{}m}%
{%
\IfBooleanTF{#1}%
{%
@@ -192,53 +287,154 @@
{%
\RootNumber=#3%
}%
- \fill[\dynkincolor,draw=\dynkincolor,#2] (root \the\RootNumber) circle (\dynkinradius);%
+ \fill[/Dynkin diagram,/Dynkin diagram/*,#2] (\dynkin@root@name \the\RootNumber) circle (\dynkin@root@radius);%
}%
-%% \dynkindot{<n>}
-%% ->
-%% Prints a dot at root <n> on the current Dynkin diagram in the default style.
+%% \dynkinTensorRootMark{<n>}
+%% Prints a tensor product symbol at root <n> on the current Dynkin diagram.
%% The starred form accepts <n> in the Bourbaki ordering.
-\NewDocumentCommand\dynkindot{sO{}m}%
+\NewDocumentCommand\dynkinTensorRootMark{sO{}m}%
{%
\IfBooleanTF{#1}%
{%
- \ifnum#3=0%
- \ifdynkinopendots%
- \dynkincloseddot*[#2]{0}%
- \else%
- \dynkinopendot*[#2]{0}%
- \fi%
- \else%
- \ifdynkinopendots%
- \dynkinopendot*[#2]{#3}%
- \else%
- \dynkincloseddot*[#2]{#3}%
- \fi%
- \fi%
+ \convertRootNumber{#3}%
}%
{%
- \ifnum#3=0%
- \ifdynkinopendots%
- \dynkincloseddot[#2]{0}%
- \else%
- \dynkinopendot[#2]{0}%
- \fi%
- \else%
- \ifdynkinopendots%
- \dynkinopendot[#2]{#3}%
- \else%
- \dynkincloseddot[#2]{#3}%
- \fi%
- \fi%
+ \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]%
+ ($(\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]%
+ ($(\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)})$);%
}%
-%% \dynkinline{<p>}{<q>}
-%% ->
+%% \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}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEqCase{#2}%
+ {%
+ {}{\dynkinRootMark*{\dynkin@root@mark}{#3}}%
+ {*}{\dynkinSolidRootMark*{#3}}%
+ {O}{\dynkinDoubleHollowRootMark*{#3}}%
+ {X}{\dynkinHeavyCrossRootMark*{#3}}%
+ {o}{\dynkinHollowRootMark*{#3}}%
+ {t}{\dynkinTensorRootMark*{#3}}%
+ {x}{\dynkinCrossRootMark*{#3}}%
+ }%
+ [\ClassError%
+ {Dynkin diagrams}%
+ {Unrecognized root mark: ``#2'' in Dynkin diagram%
+ \dynkin@user@series{\dynkin@user@string}}%
+ {}]
+ }%
+ {%
+ \IfStrEqCase{#2}%
+ {%
+ {}{\dynkinRootMark{\dynkin@root@mark}{#3}}%
+ {*}{\dynkinSolidRootMark{#3}}%
+ {O}{\dynkinDoubleHollowRootMark{#3}}%
+ {X}{\dynkinHeavyCrossRootMark{#3}}%
+ {o}{\dynkinHollowRootMark{#3}}%
+ {t}{\dynkinTensorRootMark{#3}}%
+ {x}{\dynkinCrossRootMark{#3}}%
+ }%
+ [\ClassError{Dynkin diagrams}{Unrecognized root mark: ``#2'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}{}]
+ }%
+}%
+
+%% \dynkinDefiniteSingleEdge{<p>}{<q>}
%% Draws a single line from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
%% The starred form accepts <p> and <q> in the Bourbaki ordering.
-\NewDocumentCommand\dynkinline{sO{}mm}%
+\NewDocumentCommand\dynkinDefiniteSingleEdge{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,edge,#2]
+ ($(\dynkin@root@name \the\@fromRoot)$)
+ --
+ ($(\dynkin@root@name \the\@toRoot)$);%
+ \end{scope}%
+}%
+
+%% \dynkinIndefiniteSingleEdge{<p>}{<q>}
+%% Draws a single line from root <p> to root <q> on the current Dynkin diagram in the current label ordering,
+%% drawn as dashed to indicate an edge containing an indefinite number of roots.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinIndefiniteSingleEdge{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,edge,#2]
+ ($(\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]
+ (${(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]
+ (${(1/3)}*(\dynkin@root@name \the\@fromRoot)+{(2/3)}*(\dynkin@root@name \the\@toRoot)$)
+ --
+ ($(\dynkin@root@name \the\@toRoot)$);
+ \end{scope}%
+}%
+
+%%% \dynkinRightFold{<p>}{<q>}
+%%% Draws an arrow to represent folding from root <p> to root <q> on the current Dynkin diagram in the current label ordering, curving to the right.
+%%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinRightFold{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \dynkinFold*[/Dynkin diagram/rightFold,#2]{#3}{#4}%
+ }%
+ {%
+ \dynkinFold[/Dynkin diagram/rightFold,#2]{#3}{#4}%
+ }%
+}%
+
+%%% \dynkinLeftFold{<p>}{<q>}
+%%% Draws an arrow to represent folding from root <p> to root <q> on the current Dynkin diagram in the current label ordering, curving to the left.
+%%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinLeftFold{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \dynkinFold*[/Dynkin diagram/leftFold,#2]{#3}{#4}%
+ }%
+ {%
+ \dynkinFold[/Dynkin diagram/leftFold,#2]{#3}{#4}%
+ }%
+}%
+
+%% \dynkinFold{<p>}{<q>}
+%% Draws some colouring to indicate which roots are being folded together, including roots <p> and <q>.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinFold{sO{}mm}%
{%
\IfBooleanTF{#1}%
{%
@@ -248,14 +444,41 @@
\@fromRoot=#3%
\@toRoot=#4%
}%
- \draw[\dynkincolor,\dynkinedgestyle,#2] ($(root \the\@fromRoot)$) -- ($(root \the\@toRoot)$);%
+ \convertRootPair{\@fromRoot}{\@toRoot}%
+ \begin{scope}[on background layer]
+ \draw
+ [/Dynkin diagram/foldStyle,#2]
+ ($(\dynkin@root@name \the\@fromRoot)$)
+ to
+ ($(\dynkin@root@name \the\@toRoot)$);
+ \end{scope}%
}%
-%% \dynkinfoldarrow{<p>}{<q>}
-%% ->
-%% Draws an arrow to represent folding from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
+
+%% \dynkinDefiniteRightDownArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteRightDownArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2]%
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (90:0:\dynkin@fold@radius) -- ($(\dynkin@root@name \the\@toRoot)$);%
+ \end{scope}%
+}%
+
+%% \dynkinIndefiniteRightDownArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
%% The starred form accepts <p> and <q> in the Bourbaki ordering.
-\NewDocumentCommand\dynkinfoldarrow{sO{}mm}%
+\NewDocumentCommand\dynkinIndefiniteRightDownArc{sO{}mm}%
{%
\IfBooleanTF{#1}%
{%
@@ -265,14 +488,27 @@
\@fromRoot=#3%
\@toRoot=#4%
}%
- \draw[\dynkinfoldarrowstyle,\dynkinfoldarrowcolor,#2] (root \the\@fromRoot) -- (root \the\@toRoot);%
+ \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]
+ (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]
+ (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]
+ (center)
+ ++(30:\dynkin@fold@radius)
+ arc [start angle=30, end angle=0, radius=\dynkin@fold@radius];%
+ \end{scope}%
}%
-%% \dynkindownarc{<p>}{<q>}
-%% ->
+%% \dynkinDefiniteRightUpArc{<p>}{<q>}
%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
%% The starred form accepts <p> and <q> in the Bourbaki ordering.
-\NewDocumentCommand\dynkindownarc{sO{}mm}%
+\NewDocumentCommand\dynkinDefiniteRightUpArc{sO{}mm}%
{%
\IfBooleanTF{#1}%
{%
@@ -282,14 +518,17 @@
\@fromRoot=#3%
\@toRoot=#4%
}%
- \draw[\dynkincolor,\dynkinedgestyle,#2] ($(root \the\@fromRoot)$) arc (90:0:\dynkinedgelength);%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2]
+ ($(\dynkin@root@name \the\@fromRoot)$)
+ arc (-90:0:\dynkin@fold@radius) -- ($(\dynkin@root@name \the\@toRoot)$);%
+ \end{scope}%
}%
-%% \dynkinuparc{<p>}{<q>}
-%% ->
+%% \dynkinIndefiniteRightUpArc{<p>}{<q>}
%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
%% The starred form accepts <p> and <q> in the Bourbaki ordering.
-\NewDocumentCommand\dynkinuparc{sO{}mm}%
+\NewDocumentCommand\dynkinIndefiniteRightUpArc{sO{}mm}%
{%
\IfBooleanTF{#1}%
{%
@@ -299,14 +538,282 @@
\@fromRoot=#3%
\@toRoot=#4%
}%
- \draw[\dynkincolor,\dynkinedgestyle,#2] ($(root \the\@fromRoot)$) arc (0:-90:\dynkinedgelength);%
+ \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]
+ (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]
+ (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]
+ (center)
+ ++(-30:\dynkin@fold@radius)
+ arc [start angle=-30, end angle=0, radius=\dynkin@fold@radius] -- ($(\dynkin@root@name \the\@toRoot)$);%
+ \end{scope}%
}%
-%% \dynkinsemicircle{<p>}{<q>}
-%% ->
+
+%% \dynkinDefiniteLeftDownArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteLeftDownArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2]%
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (90:180:\dynkin@fold@radius) -- ($(\dynkin@root@name \the\@toRoot)$);%
+ \end{scope}%
+}%
+
+%% \dynkinIndefiniteLeftDownArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinIndefiniteLeftDownArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \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]
+ (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]
+ (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]
+ (center)
+ ++(150:\dynkin@fold@radius)
+ arc [start angle=150, end angle=180, radius=\dynkin@fold@radius] -- ($(\dynkin@root@name \the\@toRoot)$);%
+ \end{scope}%
+}%
+
+%% \dynkinDefiniteLeftUpArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteLeftUpArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2]
+ ($(\dynkin@root@name \the\@fromRoot)$)
+ arc (-90:-180:\dynkin@fold@radius) -- ($(\dynkin@root@name \the\@toRoot)$);%
+ \end{scope}%
+}%
+
+%% \dynkinIndefiniteLeftUpArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinIndefiniteLeftUpArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \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]
+ (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]
+ (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]
+ (center)
+ ++(-150:\dynkin@fold@radius)
+ arc [start angle=-150, end angle=-180, radius=\dynkin@fold@radius] -- ($(\dynkin@root@name \the\@toRoot)$);%
+ \end{scope}%
+}%
+
+
+%% \dynkinDefiniteSemiCircle{<p>}{<q>}
+%% Draws a half circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteSemiCircle{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/Dynkin diagram/edge,fill=none,#2]
+ ($(\dynkin@root@name \the\@fromRoot)$)
+ arc (90:-90:\dynkin@fold@radius)
+ -- ($(\dynkin@root@name \the\@toRoot)$);%
+ \end{scope}%
+}%
+
+%% \dynkinIndefiniteSemiCircle{<p>}{<q>}
%% Draws a half circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering.
%% The starred form accepts <p> and <q> in the Bourbaki ordering.
-\NewDocumentCommand\dynkinsemicircle{sO{}mm}%
+\NewDocumentCommand\dynkinIndefiniteSemiCircle{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \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]
+ (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]
+ (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]
+ (center)
+ ++(-30:\dynkin@fold@radius)
+ arc [start angle=-30, end angle=-90, radius=\dynkin@fold@radius] -- ($(\dynkin@root@name \the\@toRoot)$);%
+ \end{scope}%
+}%
+
+%% \dynkinDefiniteDoubleRightDownArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering
+%% as a double path.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteDoubleRightDownArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/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%
+ \ifdynkin@reverse@arrows%
+ \path[-<,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (90:45:{\dynkin@fold@radius});%
+ \else%
+ \path[->,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (90:45:{\dynkin@fold@radius});%
+ \fi%
+ \fi%
+ \end{scope}%
+}%
+
+
+%% \dynkinDefiniteDoubleUpRightArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering
+%% as a double path.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteDoubleUpRightArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/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%
+ \ifdynkin@reverse@arrows%
+ \path[-<,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (180:135:{\dynkin@fold@radius});%
+ \else%
+ \path[->,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (180:135:{\dynkin@fold@radius});%
+ \fi%
+ \fi%
+ \end{scope}%
+}%
+
+
+%% \dynkinDefiniteDoubleUpLeftArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering
+%% as a double path.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteDoubleUpLeftArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/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%
+ \ifdynkin@reverse@arrows%
+ \path[-<,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (-90:-45:{\dynkin@fold@radius});%
+ \else%
+ \path[->,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (-90:-45:{\dynkin@fold@radius});%
+ \fi%
+ \fi%
+ \end{scope}%
+}%
+
+
+
+
+%% \dynkinDefiniteDoubleDownRightArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering
+%% as a double path.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteDoubleDownRightArc{sO{}mm}%
{%
\IfBooleanTF{#1}%
{%
@@ -316,14 +823,32 @@
\@fromRoot=#3%
\@toRoot=#4%
}%
- \draw[\dynkincolor,\dynkinedgestyle,#2] ($(root \the\@fromRoot)$) arc (90:-90:\dynkinedgelength);%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/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[-<,tips]
+ ($(\dynkin@root@name \the\@toRoot)+(-\dynkin@fold@radius,\dynkin@fold@radius)$)%
+ arc (-180:-135:{\dynkin@fold@radius});%
+ \else%
+ \path[->,tips]
+ ($(\dynkin@root@name \the\@toRoot)+(-\dynkin@fold@radius,\dynkin@fold@radius)$)%
+ arc (-180:-135:{\dynkin@fold@radius});%
+ \fi%
+ \fi%
+ \end{scope}%
}%
-%% \dynkindots{<p>}{s<q>}
-%% ->
-%% Draws a dotted line from root <p> to root <q> on the current Dynkin diagram.
+
+%% \dynkinDefiniteDoubleRightUpArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering
+%% as a double path.
%% The starred form accepts <p> and <q> in the Bourbaki ordering.
-\NewDocumentCommand\dynkindots{sO{}mm}%
+\NewDocumentCommand\dynkinDefiniteDoubleRightUpArc{sO{}mm}%
{%
\IfBooleanTF{#1}%
{%
@@ -333,14 +858,245 @@
\@fromRoot=#3%
\@toRoot=#4%
}%
- \draw[densely dotted,\dynkincolor,#2] ($(root \the\@fromRoot)$) -- ($(root \the\@toRoot)$);%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/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[->,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (270:315:\dynkin@fold@radius);%
+ \fi%
+ \end{scope}%
+}%
+
+%% \dynkinDefiniteDoubleLeftDownArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering
+%% as a double path.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteDoubleLeftDownArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/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[-<,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (90:135:{\dynkin@fold@radius});%
+ \else%
+ \path[->,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (90:135:{\dynkin@fold@radius});%
+ \fi%
+ \fi%
+ \end{scope}%
}%
-%% \dynkindoubleline{<p>}{<q>}
-%% ->
+
+%% \dynkinDefiniteDoubleDownLeftArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering
+%% as a double path.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteDoubleDownLeftArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/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%
+ \ifdynkin@reverse@arrows%
+ \path[-<,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (360:315:{\dynkin@fold@radius});%
+ \else%
+ \path[->,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (360:315:{\dynkin@fold@radius});%
+ \fi%
+ \fi%
+ \end{scope}%
+}%
+
+
+
+%% \dynkinDefiniteDoubleLeftUpArc{<p>}{<q>}
+%% Draws a quarter circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering
+%% as a double path.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteDoubleLeftUpArc{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/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[-<,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (-90:-135:\dynkin@fold@radius);%
+ \else%
+ \path[->,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (-90:-135:\dynkin@fold@radius);%
+ \fi%
+ \fi%
+ \end{scope}%
+}%
+
+
+%% \dynkinDefiniteDoubleDownRightSemiCircle{<p>}{<q>}
+%% Draws a semi circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering
+%% as a double path.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteDoubleDownRightSemiCircle{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/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%
+ \ifdynkin@reverse@arrows%
+ \path[-<,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (90:0:\dynkin@fold@radius);%
+ \else%
+ \path[->,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (90:0:\dynkin@fold@radius);%
+ \fi%
+ \fi%
+ \end{scope}%
+}%
+
+
+
+%% \dynkinDefiniteDoubleUpRightSemiCircle{<p>}{<q>}
+%% Draws a semi circle from root <p> to root <q> on the current Dynkin diagram in the current label ordering
+%% as a double path.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinDefiniteDoubleUpRightSemiCircle{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[/Dynkin diagram,/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%
+ \ifdynkin@reverse@arrows%
+ \path[-<,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (-90:0:\dynkin@fold@radius);%
+ \else%
+ \path[->,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)%
+ arc (-90:0:\dynkin@fold@radius);%
+ \fi%
+ \fi%
+ \end{scope}%
+}%
+
+
+%% \dynkinEdge[<o>]{<f>}{<p>}{<q>}
+%% Applies \dynkinDefinite<f>[<o>]{<p>}{<q>} if the edge <p><q> is definite,
+%% otherwise applies \dynkinIndefinite<f>[<o>]{<p>}{<q>}
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinEdge{sO{}mmm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#4}{#5}%
+ \dynkin@is@edge@indefinite{\@fromRoot}{\@toRoot}%
+ \ifdynkin@is@indefinite@edge%
+ \csname dynkinIndefinite#3\endcsname[#2]{\@fromRoot}{\@toRoot}%
+ \else%
+ \csname dynkinDefinite#3\endcsname[#2]{\@fromRoot}{\@toRoot}%
+ \fi%
+ }%
+ {%
+ \dynkin@is@edge@indefinite{#4}{#5}%
+ \ifdynkin@is@indefinite@edge%
+ \csname dynkinIndefinite#3\endcsname[#2]{#4}{#5}%
+ \else%
+ \csname dynkinDefinite#3\endcsname[#2]{#4}{#5}%
+ \fi%
+ }%
+}%
+
+%% \dynkinEdgeArrow{<p>}{<q>}
+%% Draws an arrow head on the edge from root <p> to root <q>.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinEdgeArrow{sO{}mm}%
+{%
+ \ifdynkin@arrows%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \ifdynkin@reverse@arrows%
+ \path[-<,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)
+ --
+ ($.3*(\dynkin@root@name \the\@fromRoot)+.7*(\dynkin@root@name \the\@toRoot)$);%
+ \else%
+ \path[->,tips]
+ ($(\dynkin@root@name \the\@fromRoot)$)
+ --
+ ($.3*(\dynkin@root@name \the\@fromRoot)+.7*(\dynkin@root@name \the\@toRoot)$);%
+ \fi%
+ \end{scope}%
+ \fi%
+}%
+
+%% \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\dynkindoubleline{sO{}mm}%
+\NewDocumentCommand\dynkinDefiniteDoubleEdge{sO{}mm}%
{%
\IfBooleanTF{#1}%
{%
@@ -350,20 +1106,50 @@
\@fromRoot=#3%
\@toRoot=#4%
}%
- \ifdynkinarrows%
- \draw[double,postaction={decorate},\dynkincolor,\dynkinedgestyle,#2]%
- ($(root \the\@fromRoot)$) -- ($(root \the\@toRoot)$);%
- \else%
- \draw[double,\dynkincolor,\dynkinedgestyle,#2]%
- ($(root \the\@fromRoot)$) -- ($(root \the\@toRoot)$);%
+ \newcount\onesbit%
+ \newcount\twosbit%
+ \StrChar{\dynkin@roots}{\the\@fromRoot}[\my@root@marker]%
+ \IfStrEq{\my@root@marker}{x}%
+ {%
+ \global\onesbit=1%
+ }%
+ {%
+ \global\onesbit=0%
+ }%
+ \StrChar{\dynkin@roots}{\the\@toRoot}[\my@root@marker]%
+ \IfStrEq{\my@root@marker}{x}%
+ {%
+ \global\twosbit=1%
+ }%
+ {%
+ \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}%
\fi%
}%
-%% \dynkintripleline{<p><q>}
-%% ->
+%% \dynkinTripleEdge{<p><q>}
%% Draws an oriented triple line from root <p> to root <q> on the current Dynkin diagram.
%% The starred form accepts <p> and <q> in the Bourbaki ordering.
-\NewDocumentCommand\dynkintripleline{sO{}mm}%
+\NewDocumentCommand\dynkinTripleEdge{sO{}mm}%
{%
\IfBooleanTF{#1}%
{%
@@ -373,351 +1159,1148 @@
\@fromRoot=#3%
\@toRoot=#4%
}%
- \pgfmathparse{mod(div(\dynkinparabolic,2),2)}%
- \let\onesbit\pgfmathresult%
- \pgfmathparse{mod(div(\dynkinparabolic,4),2)}%
- \let\twosbit\pgfmathresult%
- \draw[\dynkincolor,fill=\dynkinbackcolor,\dynkinedgestyle,#2] %
- ($(root \the\@fromRoot)$)%
- --%
- +(\onesbit*\dynkinradius,\dynkinradius)%
- --%
- ($(root \the\@toRoot)+(-\twosbit*\dynkinradius,\dynkinradius)$)%
- --%
- ($(root \the\@toRoot)$)%
- --%
- ($(root \the\@toRoot)-(\twosbit*\dynkinradius,\dynkinradius)$)%
- --%
- ($(root \the\@fromRoot)+(\onesbit*\dynkinradius,-\dynkinradius)$)%
- --%
- cycle;%
- \ifdynkinarrows%
- \draw[%
- \dynkincolor,%
- \dynkinedgestyle,%
- -{Classical TikZ Rightarrow[length={3*\dynkinradius}]},%
- #2%
+ \newcount\onesbit
+ \newcount\twosbit
+ \StrChar{\dynkin@roots}{\the\@fromRoot}[\my@root@marker]%
+ \IfStrEq{\my@root@marker}{x}%
+ {%
+ \global\onesbit=1%
+ }%
+ {%
+ \global\onesbit=0%
+ }%
+ \StrChar{\dynkin@roots}{\the\@toRoot}[\my@root@marker]%
+ \IfStrEq{\my@root@marker}{x}%
+ {%
+ \global\twosbit=1%
+ }%
+ {%
+ \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}%
+ \fi%
+}%
+
+
+%% \dynkinQuadrupleEdge{<p>}{<q>}
+%% \dynkinQuadrupleEdge*{<p>}{<q>}
+%% Draws an oriented edge of valence 4 from root <p> to root <q> on the current Dynkin diagram.
+%% The starred form accepts <p> and <q> in the Bourbaki ordering.
+\NewDocumentCommand\dynkinQuadrupleEdge{sO{}mm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#4}%
+ }%
+ {%
+ \@fromRoot=#3%
+ \@toRoot=#4%
+ }%
+ \begin{scope}[on background layer]%
+ \draw[%
+ /Dynkin diagram,
+ /Dynkin diagram/edge,
+ #2,
]%
- ($(root \the\@toRoot)$) --%
- ($.65*(root \the\@fromRoot)+.35*(root \the\@toRoot)$);%
+ ($(\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}%
\fi%
- \draw[\dynkincolor,#2] ($(root \the\@fromRoot)$) -- ($(root \the\@toRoot)$);%
}%
+%% \repeatCharacter{<n>}{<s>}
+%% Outputs <n> copies of the string <s>
+\ExplSyntaxOn
+\DeclareExpandableDocumentCommand{\repeatCharacter}{O{}mm}
+ {
+ \int_compare:nT { #2 > 0 }
+ {
+ #3 \prg_replicate:nn { #2 - 1 } { #1#3 }
+ }
+ }
+\ExplSyntaxOff
+
+%% \stringCharacterInPosition{<s>}{<n>}
+%% Outputs the element of string <s> in position <n>.
+\ExplSyntaxOn
+\cs_new:Npn \stringCharacterInPosition #1 #2
+{
+\str_item:fn { #1 } { #2 }
+}
+\cs_generate_variant:Nn \str_item:nn {f}
+\ExplSyntaxOff
+
+
+
+
%%%
%%% Implementation:
%%%
-\def\dynkinseries{A} % Which series of root system: A,B,C,D,E,F,G
-\newcount\dynkinrank % Which rank of root system: 1,2,...
-\newif\ifisaffine % Is this an affine extended root system?
-\newif\iflabeltheroots % Should we label the roots by the current root ordering convention?
-\newif\ifdynkinopendots % Should we draw the roots using open circles or closed dots?
-\newif\ifdynkinarrows % Should we draw arrows on Dynkin diagrams?
-\newif\ifdynkincoxeter % Should we draw Coxeter diagrams?
-\newif\ifdynkinfolded % Should we fold our Dynkin diagrams?
-
-\pgfkeys{%
- /dynkin/.is family,%
- /tikz/decoration={markings,mark=at position 0.7 with {\arrow{>}}},%
- /dynkin,%
- open/.is if = dynkinopendots,%
- open=false,%
- Coxeter/.is if = dynkincoxeter,%
- Coxeter=false,%
- arrows/.is if = dynkinarrows,%
- arrows=true,%
- dotradius/.estore in = \dynkinradius,%
- dotradius=.05cm,%
- color/.store in =\dynkincolor,%
- backgroundcolor/.store in =\dynkinbackcolor,%
- color = black,%
- backgroundcolor = white,%
- edge/.store in = \dynkinedgestyle,%
- edge = thin,%
- cross/.store in = \dynkincrossstyle,%
- cross = thick,%
- edgelength/.estore in = \dynkinedgelength,%
- edgelength = .35cm,%
- ordering/.store in = \dynkinordering,%
- ordering = Bourbaki,%
- textscale/.estore in = \dynkintextscale,%
- textscale = 0.7,%
- foldarrowstyle/.estore in = \dynkinfoldarrowstyle,%
- foldarrowstyle = stealth-stealth,%
- foldarrowcolor/.estore in = \dynkinfoldarrowcolor,%
- foldarrowcolor = black!50,%
- default/.style = {%
- label/.is if = labeltheroots,%
- label = false,%
- parabolic = 0,%
- affine/.is if = isaffine,%
- affine = false,%
- folded/.is if = dynkinfolded,%
- folded=false,%
- },%
- parabolic/.estore in = \dynkinparabolic,%
- .search also={/tikz},%
-}%
-
-\ProcessPgfPackageOptions{/dynkin}\relax
-
-% *=not a Satake diagram
-% Anything else is the Roman numeral of the diagram, i.e. EVIII diagrams have numeral VIII.
-\gdef\dynkinSatake{*}
-
-\NewDocumentCommand\@dynkin{O{}mm}{%
- \pgfkeys{/dynkin, default, #1}%
- \xdef\dynkinseries{#2}%
- \IfSubStr{ABCDEFGHI}{#2}{}{\errorSeries}%
- \global\dynkinrank=0%
- \xdef\dynkinSatake{#3}%
- \newif\ifwerefolded
- \ifdynkinfolded
- \global\werefoldedtrue
- \else
- \global\werefoldedfalse
- \fi
- \IfInteger{#3}%
+\def\dynkin@diagram@name{anonymous}
+% Default diagram name
+
+\def\dynkin@root@mark{*}
+% Default mark
+
+\def\dynkin@affine@root@mark{o}
+% Default affine root mark
+
+\def\dynkin@roots{}
+% List of marks for each root.
+
+\def\dynkin@user@series{}
+% Series string passed from user.
+% For example:
+% \dynkin{A}{3} passes the string A,
+% \dynkin{A2}{*o*} passes the string A2,
+% \dynkin{E2}{} passes the string E2.
+
+\def\dynkin@user@string{}
+% Control string passed from user.
+% For example:
+% \dynkin{A}{3} passes the string 3,
+% \dynkin{A}{*o*} passes the string *o*,
+% \dynkin{A}{III} passes the string III.
+
+\def\dynkin@string{}
+% \dynkin@user@string{} with some modifications to it to expand it out.
+
+\def\dynkin@series{A}
+% Which series of root system: A,B,C,D,E,F,G
+
+\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@extended
+% Is this an extended extended root system?
+
+\newif\ifdynkin@is@twisted
+% Is this a twisted extended root system?
+
+\def\dynkin@twisted@series{0}
+% Which Kac series? 0=finite, 1,2,3->infinite
+
+\newif\ifdynkin@label@the@roots
+% Should we label the roots by the current root ordering convention?
+
+\newif\ifdynkin@reverse@arrows
+% Should we reverse the directions of all arrows?
+
+\newif\ifdynkin@arrows
+% Should we draw arrows on Dynkin diagrams?
+
+\newif\ifdynkin@left@fold
+% Is the left side of the Dynkin diagram folded?
+
+\newif\ifdynkin@right@fold
+% Is the right side of the Dynkin diagram folded?
+
+\newif\ifdynkin@Coxeter
+% Should we draw Coxeter diagrams?
+
+\newif\ifdynkin@odd
+% For twisted A series diagrams, is the rank odd?
+
+\newcount\dynkin@ply
+% Maximum number of nodes arranged vertically in the folding of the Dynkin diagram
+
+\def\dynkin@ply@value{1}
+% 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.
+
+\def\dynkin@current@location{(0,0)}
+
+\NewDocumentCommand\regurgitate{m}{#1}
+
+\pgfkeys{
+ /Dynkin diagram/.is family,
+ /Dynkin diagram,
+ name/.estore in = \dynkin@diagram@name,
+ 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,
+ 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},
+ 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 = {},
+ doubleEdges/.style = {
+ foldStyle/.style = {
+ draw=black,
+ double=white,
+ fill=none,
+ double distance=\dynkin@root@radius,
+ line width=\defaultpgflinewidth}
+ },
+ doubleFold/.style = {
+ foldStyle/.style = {
+ draw=black,
+ double=black!40,
+ fill=none,
+ double distance=\dynkin@root@radius,
+ line width=\defaultpgflinewidth}
+ },
+ doubleLeft/.style = {
+ leftFold/.style = {
+ draw=black,
+ double=white,
+ fill=none,
+ double distance=\dynkin@root@radius,
+ line width=\defaultpgflinewidth}
+ },
+ doubleFoldLeft/.style = {
+ leftFold/.style = {
+ draw=black,
+ double=black!40,
+ fill=none,
+ double distance=\dynkin@root@radius,
+ line width=\defaultpgflinewidth}
+ },
+ doubleRight/.style = {
+ rightFold/.style = {
+ draw=black,
+ double=white,
+ fill=none,
+ double distance=\dynkin@root@radius,
+ line width=\defaultpgflinewidth}
+ },
+ doubleFoldRight/.style = {
+ rightFold/.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,
+ */.style = {
+ draw=black,
+ fill=black,
+ },
+ O/.style = {
+ draw=black,
+ fill=white,
+ },
+ X/.style = {
+ draw=black,
+ thick
+ },
+ o/.style = {
+ draw=black,
+ fill=white,
+ },
+ t/.style = {
+ draw=black,
+ fill=white,
+ },
+ x/.style = {
+ draw=black,
+ },
+ Coxeter/.is if = dynkin@Coxeter,
+ Coxeter=false,
+ ordering/.store in = \dynkin@ordering,
+ ordering = Bourbaki,
+ text/.style={scale=.7},
+ labelMacro/.code = {\regurgitate{#1}},
+ odd/.is if = dynkin@odd,
+ odd=false,
+ Kac/.style={
+ ordering=Kac,
+ radius=.05cm,
+ edgeLength=.66cm,
+ indefiniteEdgeRatio = 3,
+ o/.style =
+ {
+ draw=black,
+ fill=white,
+ preaction={
+ draw=white,
+ line width=.9mm
+ }
+ },
+ mark=o,
+ indefiniteEdge/.style={draw=black,fill=white,thin,loosely dotted},
+ },
+ default/.style = {
+ label/.is if = dynkin@label@the@roots,
+ label = false,
+ at/.estore in = \dynkin@current@location,
+ at = {(0,0)},
+ parabolic/.estore in = \dynkin@parabolic,
+ parabolic = 0,
+ gonality/.estore in = \dynkin@gonality,
+ gonality = 0,
+ extended/.is if = dynkin@is@extended,
+ extended = false,
+ twisted/.is if = dynkin@is@twisted,
+ twisted = false,
+ twistedSeries/.estore in = \dynkin@twisted@series,
+ twistedSeries = 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,
+ },
+ .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%
+ \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}}%
+ }%
+ [\ClassError{Dynkin diagrams}{Unrecognized direction: ``#2'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}{}]%
+}%
+
+
+\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.
+\NewDocumentCommand\expand@Dynkin@Roots@By@Char{m}%
+{%
+ \xdef\replace@DR{}
+ \foreach \i in {0,...,9}%
{%
- \global\dynkinrank=#3%
- \gdef\dynkinSatake{*}%
+ \StrSubstitute[0]{\dynkin@string}{#1\i}{\replace@DR}[\temp@DR]%
+ \xdef\dynkin@string{\temp@DR}%
+ \xdef\replace@DR{\replace@DR #1}%
}%
+}%
+
+% \expand@Dynkin@Roots@Digits{} expands out any expression like x7 in \dynkin@roots into 7 copies of the letter x, and so on for any letter which is not a digit.
+\NewDocumentCommand\expand@Dynkin@Roots@Digits{}%
+{%
+ \edef\current@string{\dynkin@string}
+ \StrLen{\current@string}[\string@len]
+ \foreach \j in {1,...,\string@len}%
{%
- \IfStrEqCase{#2}%
+ \StrChar{\current@string}{\j}[\cccc]%
+ \IfInteger{\cccc}%
+ {}%
+ {%
+ \expand@Dynkin@Roots@By@Char{\cccc}%
+ }%
+ }%
+}%
+
+% \dynkin@integer@rank{} expands a \dynkin@string 3 into ***, i.e.
+% writes the given number <n> of copies of the default root mark into the string \dynkin@string.
+\NewDocumentCommand\dynkin@integer@rank{}%
+{%
+ \global\dynkin@rank=\dynkin@string%
+ \global\dynkin@nodes=\dynkin@string%
+ \ifdynkin@is@twisted%
+ \IfStrEqCase{\dynkin@series}%
{%
{A}%
{%
- \IfStrEqCase{#3}%
- {%
- {*}{ }%
- {I}{ }%
- {II}{}%
- {III}{}%
- {IV} {}%
- }%
- [\errorRank]%
- }%
- {B}%
- {%
- \IfStrEqCase{#3}%
- {%
- {*}{ }%
- {I}{}%
- {II} {}%
- }%
- [\errorRank]%
- }%
- {C}%
- {%
- \IfStrEqCase{#3}%
- {%
- {*}{ }%
- {I}{}%
- {II} {}%
- }%
- [\errorRank]%
+ \divide\dynkin@nodes by 2%
+ \ifodd\dynkin@rank%
+ \global\dynkin@oddtrue%
+ \advance\dynkin@nodes by 1%
+ \else%
+ \global\dynkin@oddfalse%
+ \fi%
}%
{D}%
{%
- \IfStrEqCase{#3}%
+ \IfStrEqCase{\dynkin@twisted@series}%
{%
- {*}{ }%
- {I}{ }%
- {II} {}%
- {III}{}%
+ {2}%
+ {%
+ \global\advance\dynkin@nodes by -1%
+ }%
+ {3}%
+ {%
+ \IfStrEq{\dynkin@string}{4}%
+ {%
+ \global\dynkin@nodes=2%
+ }%
+ {%
+ \dynkin@error@series%
+ }%
+ }%
}%
- [\errorRank]%
+ [\dynkin@error@series]%
}%
{E}%
{%
- \IfStrEqCase{#3}%
+ \IfStrEq{\dynkin@twisted@series}{2}%
{%
- {I}{ \global\dynkinrank=6}%
- {II}%
+ \IfStrEq{\dynkin@string}{6}%
{%
- \global\dynkinfoldedtrue%
- \global\dynkinrank=6%
+ \global\dynkin@nodes=4%
}%
- {III}%
{%
- \global\dynkinfoldedtrue%
- \global\dynkinrank=6%
+ \dynkin@error@series%
}%
- {IV}%
+ }%
+ {%
+ \dynkin@error@series%
+ }%
+ }%
+ }%
+ \fi%
+ \xdef\dynkin@string{\repeatCharacter{\the\dynkin@nodes}{\dynkin@root@mark}}%
+}%
+
+\NewDocumentCommand\dynkin@clear@indefinite@edge@list{}%
+{%
+ \xdef\dynkin@indefinite@edge@list{}%
+}%
+
+\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}%
+ \else%
+ \listxadd\dynkin@indefinite@edge@list{\the\second,\the\first}%
+ \fi%
+}%
+
+\NewDocumentCommand\dynkin@set@edge@indefinite@pair{>{\SplitArgument{1}{-}}m}%
+{%
+\dynkin@set@edge@indefinite#1
+}%
+
+\newif\ifdynkin@is@indefinite@edge
+
+\NewDocumentCommand\dynkin@typeout@indefinite@edge@list{}%
+{%
+ \renewcommand*{\do}[1]{\typeout{##1}}%
+ \typeout{Indefinite edges: [}\dolistloop{\dynkin@indefinite@edge@list}\typeout{]}%
+}%
+
+
+%% \dynkin@is@edge@indefinite{<p>}{<q>} sets the global if \ifdynkin@is@indefinite@edge to true or false
+%% depending on whether there is an indefinite edge between roots <p> and <q>.
+%% The starred form uses Bourbaki ordering.
+\NewDocumentCommand\dynkin@is@edge@indefinite{smm}%
+{%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#2}{#3}%
+ }%
+ {%
+ \@fromRoot=#2%
+ \@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%
+ \global\second=\@fromRoot\relax%
+ \fi%
+ \global\dynkin@is@indefinite@edgefalse\relax%
+ \renewcommand*{\do}[1]{%
+ \IfStrEq{##1}{\the\first,\the\second}%
+ {\global\dynkin@is@indefinite@edgetrue\listbreak}%
+ {}}%
+ \dolistloop{\dynkin@indefinite@edge@list}%
+}%
+
+% \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}%
+ {%
+ \StrChar{\dynkin@string}{\i}[\c]%
+ \IfStrEq{\c}{.}%
+ {%
+ \newcount\rootnumpo%
+ \rootnumpo=\rootnum%
+ \advance\rootnumpo by 1\relax%
+ \ifnum\the\rootnum<\the\dynkin@nodes%
+ \dynkin@set@edge@indefinite{\rootnum}{\rootnumpo}%
+ \fi%
+ }%
+ {%
+ \global\advance\rootnum by 1%
+ }%
+ }%
+}%
+
+\xdef\spacy{ }
+
+\xdef\questionMarks{}
+
+\NewDocumentCommand\dynkin@clear@label@directions{}%
+{%
+ \xdef\dynkin@label@directions{}%
+}%
+
+
+\NewDocumentCommand\dynkin@set@default@label@directions{}%
+{%
+ \newcount\drpo%
+ \drpo=\the\dynkin@nodes%
+ \advance\drpo by 1\relax%
+ \xdef\dynkin@label@directions{\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>.
+\NewDocumentCommand\@dynkin{O{}mO{0}m}%
+{%
+ \setlength{\defaultpgflinewidth}{\pgflinewidth}%
+ \global\defaultpgflinewidth=\defaultpgflinewidth\relax%
+ \dynkin@clear@indefinite@edge@list%
+ \xdef\dynkin@parabolic{0}%
+ \pgfkeys{/Dynkin diagram, default, #1}%
+ \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@series{#2}%
+ \IfStrEq{\dynkin@diagram@name}{anonymous}%
+ {%
+ \xdef\dynkin@root@name{root\spacy}%
+ }%
+ {%
+ \xdef\dynkin@root@name{\dynkin@diagram@name\spacy root\spacy}%
+ }%
+ \dynkin@grok@series%
+ \IfSubStr{ABCDEFGHI}{\dynkin@series}{}{\dynkin@error@series}%
+ \xdef\dynkin@string{#4}
+ \IfInteger{\dynkin@string}%
+ {%
+ \dynkin@integer@rank%
+ }%
+ {%
+ % Turn Satake codes into Dynkin diagram expressions in \dynkin@string.
+ \dynkin@grok@Satake@codes%
+ }%
+ % Expand out any digits in \dynkin@string into multiples of the various root marks.
+ \expand@Dynkin@Roots@Digits%
+ % Assign to \dynkin@roots the input string \dynkin@string with all . symbols removed,
+ % so we only get the symbols representing the marks for the various roots.
+ \StrDel{\dynkin@string}{.}[\temp]%
+ \xdef\dynkin@roots{\temp}%
+ \StrLen{\dynkin@roots}[\temp]%
+ \global\dynkin@nodes=\temp\relax%
+ \dynkin@grok@indefinite@edges%
+ \dynkin@find@rank{}%
+ \dynkin@cross@out@parabolics{}%
+ \dynkin@set@default@label@directions{}%
+ \check@Dynkin@diagram{}%
+ \node (Dynkin current) at \dynkin@current@location{};%
+ \ifdynkin@is@twisted%
+ \csname twisted\dynkin@series dynkin\endcsname%
+ \else%
+ \ifdynkin@is@extended%
+ \csname extended\dynkin@series dynkin\endcsname%
+ \else%
+ \csname\dynkin@series dynkin\endcsname%
+ \fi%
+ \fi%
+ \dynkinRefreshRoots%
+}%
+
+%% We know the number of nodes; lets find the rank.
+\NewDocumentCommand\dynkin@find@rank{}%
+{%
+ \global\dynkin@rank=\the\dynkin@nodes%
+ \ifdynkin@is@twisted%
+ \IfStrEqCase{\dynkin@series}%
+ {%
+ {A}%
+ {%
+ \multiply\dynkin@rank by 2%
+ \ifdynkin@odd%
+ \advance\dynkin@rank by -1%
+ \fi%
+ }%
+ {D}%
+ {%
+ \IfStrEqCase{\dynkin@twisted@series}%
+ {%
+ {2}
{%
- \global\dynkinrank=6%
+ \advance\dynkin@rank by 1%
}%
- {V}%
+ {3}
{%
- \global\dynkinrank=7%
+ \advance\dynkin@rank by 2%
}%
- {VI}%
- {%
- \global\dynkinrank=7%
+ }%
+ }%
+ {E}%
+ {%
+ \advance\dynkin@rank by 2%
+ }%
+ }%
+ \fi%
+}%
+
+%% \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%
+ \fi
+ \edef\series{\dynkin@series}
+ \IfStrEqCase{\dynkin@twisted@series}%
+ {%
+ {0}{}%
+ {1}{ \global\dynkin@is@extendedtrue}%
+ {2}{%
+ \IfSubStr{ADE}{\dynkin@series}%
+ {%
+ \global\dynkin@is@twistedtrue%
+ }%
+ {%
+ \dynkin@error@series%
+ }%
+ }%
+ {3}{%
+ \IfStrEq{\dynkin@series}{D}%
+ {%
+ \global\dynkin@is@twistedtrue%
+ }%
+ {%
+ \dynkin@error@series%
+ }%
+ }%
+ }%
+ [\dynkin@error@series]%
+}%
+
+
+\newif\ifdynkin@Satake@diagram
+
+\NewDocumentCommand\dynkin@grok@Satake@codes{}%
+{%
+ \ifdynkin@is@extended%
+ \else%
+ \ifdynkin@is@twisted%
+ \else%
+ \global\dynkin@Satake@diagramtrue%
+ \fi%
+ \fi%
+ \IfStrEqCase{\dynkin@series}%
+ {%
+ {A}%
+ {%
+ \IfStrEqCase{\dynkin@string}%
+ {%
+ {even}{\gdef\dynkin@string{***.***}\global\dynkin@oddfalse\global\dynkin@Satake@diagramfalse}%
+ {odd}{\gdef\dynkin@string{****.***}\global\dynkin@oddtrue\global\dynkin@Satake@diagramfalse}%
+ {}{\gdef\dynkin@string{**.**}\global\dynkin@Satake@diagramfalse}%
+ {I}{ \gdef\dynkin@string{oo.oo}}%
+ {II}{\gdef\dynkin@string{*o*.o*}}%
+ {IIIa}{\global\dynkin@ply=2\gdef\dynkin@string{oo.o**.**o.oo}}%
+ {IIIb}{\global\dynkin@ply=2\gdef\dynkin@string{oo.ooo.oo}}%
+ {IV} {\global\dynkin@ply=2\gdef\dynkin@string{o*.*o}}%
+ }%
+ [\global\dynkin@Satake@diagramfalse]%
+ }%
+ {B}%
+ {%
+ \IfStrEqCase{\dynkin@string}%
+ {%
+ {}{%
+ \global\dynkin@Satake@diagramfalse%
+ \ifdynkin@Coxeter%
+ \gdef\dynkin@string{***.***}%
+ \else%
+ \ifdynkin@is@extended%
+ \gdef\dynkin@string{***.***}%
+ \else%
+ \gdef\dynkin@string{**.***}%
+ \fi%
+ \fi%
}%
- {VII}%
- {%
- \global\dynkinrank=7%
+ {I}{\gdef\dynkin@string{oo.o*.**}}%
+ {II}{\gdef\dynkin@string{o*.**}}%
+ }%
+ [\global\dynkin@Satake@diagramfalse]%
+ }%
+ {C}%
+ {%
+ \IfStrEqCase{\dynkin@string}%
+ {%
+ {}{%
+ \global\dynkin@Satake@diagramfalse%
+ \ifdynkin@Coxeter%
+ \gdef\dynkin@string{***.***}%
+ \else%
+ \gdef\dynkin@string{**.***}%
+ \fi%
}%
- {VIII}%
+ {I}{\gdef\dynkin@string{oo.oo}}%
+ {IIa}{\gdef\dynkin@string{*o*.o*.**}}%
+ {IIb}{\gdef\dynkin@string{*o*.o*o}}%
+ }%
+ [\global\dynkin@Satake@diagramfalse]%
+ }%
+ {D}%
+ {%
+ \IfStrEqCase{\dynkin@string}%
+ {%
+ {}{%
+ \global\dynkin@Satake@diagramfalse%
+ \ifdynkin@is@extended%
+ \ifnum\dynkin@ply=4%
+ \gdef\dynkin@string{****.*.*****}
+ \else%
+ \gdef\dynkin@string{***.****}%
+ \fi%
+ \else%
+ \ifdynkin@is@twisted%
+ \IfStrEqCase{\dynkin@twisted@series}%
+ {%
+ {2}{ \gdef\dynkin@string{**.***}}%
+ {3}{\gdef\dynkin@string{***}}%
+ }%
+ [\dynkin@error@series]%
+ \else%
+ \gdef\dynkin@string{**.****}%
+ \fi%
+ \fi%
+ }%
+ {Ia}{\gdef\dynkin@string{oo.o*.***}}%
+ {Ib}{\global\dynkin@ply=2\gdef\dynkin@string{o.ooo}}%
+ {Ic}{\gdef\dynkin@string{o.ooo}}%
+ {II} {\gdef\dynkin@string{o*.***}}%
+ {IIIa}{\gdef\dynkin@string{*o*.o*o}}%
+ {IIIb}{\global\dynkin@ply=2\gdef\dynkin@string{*o*.o*oo}}%
+ }%
+ [\global\dynkin@Satake@diagramfalse]%
+ }%
+ {E}%
+ {%
+ \IfStrEqCase{\dynkin@string}%
+ {%
+ {}%
+ {%
+ \global\dynkin@Satake@diagramfalse%
+ \IfStrEq{\dynkin@twisted@series}{2}%
{%
- \global\dynkinrank=8%
+ \gdef\dynkin@string{*****}%
}%
- {XI}%
{%
- \global\dynkinrank=8%
+ \dynkin@error@series%
}%
}%
- [\errorRank]%
+ {I}{ \global\dynkin@rank=6\gdef\dynkin@string{oooooo}}%
+ {II} {\global\dynkin@ply=2\gdef\dynkin@string{oooooo}}%
+ {III}{\global\dynkin@ply=2\gdef\dynkin@string{oo***o}}%
+ {IV} {\gdef\dynkin@string{oo***o}}%
+ {V}{ \gdef\dynkin@string{ooooooo}}%
+ {VI} {\gdef\dynkin@string{o*oo*o*} }%
+ {VII}{\gdef\dynkin@string{o****oo}}%
+ {VIII}{\gdef\dynkin@string{oooooooo}}%
+ {IX} {\gdef\dynkin@string{o****ooo}}%
}%
- {F}%
+ [\global\dynkin@Satake@diagramfalse]%
+ }%
+ {F}%
+ {%
+ \global\dynkin@rank=4%
+ \IfStrEqCase{\dynkin@string}%
{%
- \global\dynkinrank=4%
- \IfStrEqCase{#3}%
- {%
- {I}{ }%
- {II} {}%
- }%
- [\errorRank]%
+ {I}{ \gdef\dynkin@string{oooo}}%
+ {II} {\gdef\dynkin@string{***o}}%
}%
- {G}%
+ [\global\dynkin@Satake@diagramfalse]%
+ }%
+ {G}%
+ {%
+ \IfStrEqCase{\dynkin@string}%
{%
- \global\dynkinrank=2%
- \IfStrEqCase{#3}%
- {%
- {I}{ }%
- }%
- [\errorRank]%
+ {I}{\gdef\dynkin@string{oo}}%
}%
- {H}%
+ [\global\dynkin@Satake@diagramfalse]%
+ }%
+ {H}%
+ {%
+ \IfStrEqCase{\dynkin@string}%
{%
- \IfStrEqCase{#3}%
- {%
- {*}%
- {%
- }%
- }%
- [\errorRank]%
+ {}{\gdef\dynkin@string{**}}%
}%
- {I}%
+ [\global\dynkin@Satake@diagramfalse]%
+ }%
+ {I}%
+ {%
+ \IfStrEqCase{\dynkin@string}%
{%
- \IfStrEqCase{#3}%
+ {}{\gdef\dynkin@string{**}}%
{%
- {*}%
- {%
- }%
}%
- [\errorRank]%
}%
+ [\global\dynkin@Satake@diagramfalse]%
}%
- [\errorSeries]%
}%
- \checkDynkinDiagram%
- \ifisaffine%
- \csname affine#2dynkin\endcsname%
+ [\dynkin@error@series]%
+ \ifdynkin@Satake@diagram%
\else%
- \csname#2dynkin\endcsname%
+ \StrSubstitute{\dynkin@string}{*}{\dynkin@root@mark}[\temp]%
+ \xdef\dynkin@string{\temp}%
\fi%
- \iflabeltheroots\dynkinprintlabels\fi%
- \ifwerefolded
- \global\dynkinfoldedtrue
- \else
- \global\dynkinfoldedfalse
- \fi
}%
-%% \stringcharacterinposition{<s>}{<n>}
-%% -> the element of string <s> in position <n>.
-\ExplSyntaxOn
-\cs_new:Npn \stringcharacterinposition #1 #2
-{
-\str_item:fn { #1 } { #2 }
-}
-\cs_generate_variant:Nn \str_item:nn {f}
-\ExplSyntaxOff
+\NewDocumentCommand\dynkin@error@root@ordering{}
+{%
+ \ClassError%
+ {Dynkin diagrams}%
+ {Unrecognized root ordering: ``\dynkin@ordering''
+ in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}%
+ {}%
+}%
+
+\NewDocumentCommand\dynkin@error@rank{}%
+{%
+ \ClassError%
+ {Dynkin diagrams}%
+ {Unrecognized \dynkin@user@series\spacy series rank:
+ ``\the\dynkin@rank'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}%
+ {}%
+}%
-\NewDocumentCommand\errorRootOrdering{}
+\NewDocumentCommand\dynkin@error@series{}%
{%
- \ClassWarning{Unrecognized root ordering: ``\dynkinordering'' in Dynkin diagram}%
+ \ClassError%
+ {Dynkin diagrams}%
+ {Unrecognized series ``\dynkin@user@series''
+ in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}%
+ {}%
}%
-\NewDocumentCommand\errorRank{}%
+
+\NewDocumentCommand\dynkin@error@ply{}
{%
- \ClassWarning{Unrecognized \dynkinseries{} series rank: ``\the\dynkinrank'' in Dynkin diagram}%
+ \ClassError%
+ {Dynkin diagrams}%
+ {Unrecognized ply: ``\the\dynkin@ply''
+ in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}%
+ {}%
}%
-\NewDocumentCommand\errorSeries{}%
+
+%% \check@Dynkin@Roots
+%% Raises error messages for erroneous input in the list of Dynkin roots.
+\NewDocumentCommand\check@Dynkin@Roots{}%
{%
- \ClassWarning{Unrecognized series ``\dynkinseries{}'' in Dynkin diagram}%
+ \foreach \i in {1,...,\the\dynkin@nodes}%
+ {%
+ \StrChar{\dynkin@roots}{\i}[\cccc]%
+ \IfSubStr{*OXotx}{\cccc}%
+ {%
+ }%
+ {%else
+ \ClassError%
+ {Dynkin diagrams}%
+ {Unrecognized Dynkin diagram root mark:
+ ``\cccc'' in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}%
+ {}%
+ }%
+ }%
}%
-%% \checkDynkinDiagram
-%% ->
+%% \check@Dynkin@diagram
%% Raises error messages for erroneous inputs.
-\NewDocumentCommand\checkDynkinDiagram{}%
+\NewDocumentCommand\check@Dynkin@diagram{}%
{%
- \IfStrEqCase{\dynkinordering}%
+ \IfSubStr{1234}{\the\dynkin@ply}{}{\dynkin@error@ply}%
+ \check@Dynkin@Roots%
+ \IfStrEqCase{\dynkin@ordering}%
{%
{Adams}{}%
{Bourbaki}{}%
{Carter}{}%
{Dynkin}{}%
{Kac}{}%
+ {TestOrder}{}%
}%
- [\ClassWarning{Unrecognized label ordering: ``\dynkinordering'' in Dynkin diagram}]%
- \IfStrEqCase{\dynkinseries}%
+ [\ClassError%
+ {Dynkin diagrams}%
+ {Unrecognized label ordering: ``\dynkin@ordering''
+ in Dynkin diagram \dynkin@user@series{\dynkin@user@string}}%
+ {}]%
+ \IfStrEqCase{\dynkin@series}%
{%
{A}{}%
{B}{}%
{C}{}%
- {D}{}%
+ {D}{}%
{E}%
{%
- \ifnum\dynkinrank=6%
- \else%
- \ifnum\dynkinrank=7%
+ \ifnum\dynkin@nodes=5%
+ \ifnum\dynkin@rank=6%
+ \IfStrEq{\dynkin@twisted@series}{2}%
+ {%
+ }%
+ {%
+ \dynkin@error@rank%
+ }%
+ \else%
+ \dynkin@error@rank%
+ \fi%
+ \else
+ \ifnum\dynkin@rank=6%
\else%
- \ifnum\dynkinrank=8%
+ \ifnum\dynkin@rank=7%
\else%
- \errorRank%
+ \ifnum\dynkin@rank=8%
+ \else%
+ \dynkin@error@rank%
+ \fi%
\fi%
\fi%
\fi%
}%
{F}%
{%
- \ifnum\dynkinrank=4%
+ \ifnum\dynkin@rank=4%
\else%
- \errorRank%
+ \dynkin@error@rank%
\fi%
}%
{G}%
{%
- \ifnum\dynkinrank=2%
+ \ifnum\dynkin@rank=2%
\else%
- \errorRank%
+ \dynkin@error@rank%
\fi%
}%
{H}{}%
{I}{}%
}%
- [\errorSeries]%
+ [\dynkin@error@series]%
}%
-% We store the number of a root, converted to the current root ordering convention, here.
-\newcount\RootNumber
% 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
+%% \swapRootIfInLastTwoRoots{<r>}
+%% If the input root <r> is one of the last two roots, then put the other in \RootNumber, otherwise
+%% let \RootNumber be <r>.
+\NewDocumentCommand\swapRootIfInLastTwoRoots{m}%
+{%
+ \ifnum\dynkin@rank>1%
+ \newcount\drmo\relax%
+ \drmo=\dynkin@rank\relax%
+ \advance\drmo by -1\relax%
+ \ifnum\dynkin@rank=#1%
+ \global\RootNumber=\the\drmo\relax%
+ \else%
+ \ifnum\drmo=#1%
+ \global\RootNumber=\the\dynkin@rank\relax%
+ \else%
+ \global\RootNumber=#1\relax%
+ \fi%
+ \fi%
+ \else%
+ \global\RootNumber=#1\relax%
+ \fi%
+}%
+
+%% \convertRootNumber{<n>}
+%% Converts <n> from Bourbaki ordering to the current ordering, storing the result in a count called \RootNumber.
+\NewDocumentCommand\convertRootNumber{m}%
+{%
+ \IfStrEq{#1}{0}%
+ {%
+ \global\RootNumber=0%
+ }%
+ {%
+ \IfStrEqCase{\dynkin@series}%
+ {%
+ {A}%
+ {%
+ \IfStrEqCase{\dynkin@ordering}%
+ {%
+ {TestOrder}%
+ {%
+ \RootNumber=#1
+ \advance\RootNumber by 1
+ \ifnum\RootNumber>\the\dynkin@rank%
+ \RootNumber=1%
+ \fi%
+ }%
+ }%
+ [\global\RootNumber=#1]%
+ }%
+ {D}%
+ {%
+ \IfStrEqCase{\dynkin@ordering}%
+ {%
+ {Adams}{\swapRootIfInLastTwoRoots{#1}}%
+ {Dynkin}{\swapRootIfInLastTwoRoots{#1}}%
+ {Kac}{\swapRootIfInLastTwoRoots{#1}}%
+ }%
+ [\global\RootNumber=#1]%
+ }%
+ {E}%
+ {%
+ \ifdynkin@is@twisted%
+ \global\RootNumber=#1%
+ \else%
+ \ifnum\dynkin@rank=6%
+ \IfStrEqCase{\dynkin@ordering}%
+ {%
+ {Adams}{\global\RootNumber=\stringCharacterInPosition{152436}{#1}}%
+ {Carter}{\global\RootNumber=\stringCharacterInPosition{142356}{#1}}%
+ {Dynkin}{\global\RootNumber=\stringCharacterInPosition{162345}{#1}}%
+ {Kac}{\global\RootNumber=\stringCharacterInPosition{162345}{#1}}%
+ }%
+ [\global\RootNumber=#1]%
+ \else%
+ \ifnum\dynkin@rank=7%
+ \IfStrEqCase{\dynkin@ordering}%
+ {%
+ {Adams}{\global\RootNumber=\stringCharacterInPosition{6354217}{#1}}%
+ {Carter}{\global\RootNumber=\stringCharacterInPosition{7564321}{#1}}%
+ {Dynkin}{\global\RootNumber=\stringCharacterInPosition{1723456}{#1}}%
+ {Kac}{\global\RootNumber=\stringCharacterInPosition{1723456}{#1}}%
+ }%
+ [\global\RootNumber=#1]%
+ \else%
+ \ifnum\dynkin@rank=8%
+ \IfStrEqCase{\dynkin@ordering}%
+ {%
+ {Adams}{\global\RootNumber=\stringCharacterInPosition{13245678}{#1}}%
+ {Carter}{\global\RootNumber=\stringCharacterInPosition{86754321}{#1}}%
+ {Dynkin}{\global\RootNumber=\stringCharacterInPosition{18234567}{#1}}%
+ {Kac}{\global\RootNumber=\stringCharacterInPosition{78654321}{#1}}%
+ }%
+ [\global\RootNumber=#1]%
+ \else%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ }%
+ {F}%
+ {%
+ \IfStrEqCase{\dynkin@ordering}%
+ {%
+ {Adams}{\global\RootNumber=\stringCharacterInPosition{4321}{#1}}%
+ }%
+ [\global\RootNumber=#1]%
+ }%
+ {G}%
+ {%
+ \IfStrEqCase{\dynkin@ordering}%
+ {%
+ {Carter}{\global\RootNumber=\stringCharacterInPosition{21}{#1}}%
+ {Dynkin}{\global\RootNumber=\stringCharacterInPosition{21}{#1}}%
+ }%
+ [\global\RootNumber=#1]%
+ }%
+ }%
+ [\global\RootNumber=#1]%
+ }%
+}%
+
%% \convertRootPair{<p>}{<q>}
-%% ->
%% Stores conversions in \@fromRoot and \@toRoot.
\NewDocumentCommand\convertRootPair{mm}
{%
@@ -727,759 +2310,1379 @@
\@toRoot=\RootNumber%
}%
+\ExplSyntaxOn
+\NewDocumentCommand\moduloInt{mm}{\int_mod:nn{#1}{#2}}
+\ExplSyntaxOff
+
%% \testbit{<n>}{<b>}{<f>}{<g>}
%% If bit number <b> of <n> is 1 then expand <f> else expand <g>.
-\newcommand*{\testbit}[4]%
+\NewDocumentCommand\testbit{mmmm}%
+{%
+ \newcount\x\relax%
+ \x=#1\relax%
+ \newcount\whichbit\relax%
+ \whichbit=#2\relax%
+ \ifnum\whichbit>0%
+ \foreach \i in {1,...,#2}%
+ {%
+ \global\divide \x by 2%
+ }%
+ \fi%
+ \xdef\temp{\moduloInt{\the\x}{2}}%
+ \x=\temp\relax%
+ \ifnum\the\x=1 #3\else #4\fi%
+}%
+
+\NewDocumentCommand\dynkin@put@cross{m}%
{%
- \pgfmathparse{int(mod(div(#1,2^(#2)),2))}%
- \let\tf\pgfmathresult%
- \IfStrEq{\tf}{1}{#3}{#4}%
+ \newcount\dynkin@where%
+ \dynkin@where=#1%
+ \StrMid{\dynkin@roots}{1}{#1}[\dynkin@start]%
+ \advance\dynkin@where by 1%
+ \StrMid{\dynkin@roots}{\the\dynkin@where}{\the\dynkin@nodes}[\dynkin@end]%
+ \xdef\dynkin@roots{\dynkin@start x\dynkin@end}%
}%
-%% \placeRoot{<n>}{<x>}{<y>}
-%% ->
-%% Tell TikZ where to place node <n> (in Bourbaki ordering) for a root of a Dynkin diagram. Draws nothing.
-%% Starred form swaps label positions.
-\NewDocumentCommand\placeRoot{smmm}%
+\NewDocumentCommand\dynkin@cross@out@parabolics{}%
+{%
+ \IfInteger{\dynkin@parabolic}%
+ {%
+ \IfStrEq{\dynkin@parabolic}{0}%
+ {%
+ }%
+ {%
+ \newcount\drmo\relax%
+ \drmo=\the\dynkin@nodes\relax%
+ \advance\drmo by -1\relax%
+ \foreach \b in {0,...,\the\drmo}%
+ {%
+ \testbit{\dynkin@parabolic}{\b}{\dynkin@put@cross{\b}}{}%
+ }%
+ }%
+ }%
+}%
+
+\NewDocumentCommand\dynkinMoveToRoot{sm}%
{%
- \convertRootNumber{#2}%
- \node (root \the\RootNumber) at ({(#3)*\dynkinedgelength},{(#4)*\dynkinedgelength}) {};%
\IfBooleanTF{#1}%
{%
- \node[above] (root label \the\RootNumber)%
- at ({(#3)*\dynkinedgelength},{((#4)*\dynkinedgelength)+2*\dynkinradius}) {};%
- \node[below] (root label swap \the\RootNumber)%
- at ({(#3)*\dynkinedgelength},{((#4)*\dynkinedgelength)-2*\dynkinradius}) {};%
+ \convertRootNumber{#2}%
}%
{%
- \node[above] (root label swap \the\RootNumber)%
- at ({(#3)*\dynkinedgelength},{((#4)*\dynkinedgelength)+2*\dynkinradius}) {};%
- \node[below] (root label \the\RootNumber)%
- at ({(#3)*\dynkinedgelength},{((#4)*\dynkinedgelength)-2*\dynkinradius}) {};%
+ \global\RootNumber=#2
}%
+ \node (Dynkin current) at (\dynkin@root@name \the\RootNumber){};%
}%
-%% \placeRootHorizontalLabels{<n>}{<x>}{<y>}
-%% ->
-%% Tell TikZ where to place node <n> (in Bourbaki ordering) for a root of a Dynkin diagram. Draws nothing.
-%% Places labels to the left or right of the root.
-%% Starred form swaps label positions.
-\NewDocumentCommand\placeRootHorizontalLabels{smmm}%
+%% \dynkinPlaceRootHere{<n>}{<L>}
+%% \dynkinPlaceRootHere*{<n>}{<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
+%% Starred form converts <n> from Bourbaki ordering to default ordering.
+\NewDocumentCommand\dynkinPlaceRootHere{smm}%
{%
- \convertRootNumber{#2}%
- \node (root \the\RootNumber) at ({(#3)*\dynkinedgelength},{(#4)*\dynkinedgelength}) {};%
\IfBooleanTF{#1}%
{%
- \node[left] (root label \the\RootNumber)%
- at ({((#3)*\dynkinedgelength)-\dynkinradius},{(#4)*\dynkinedgelength}) {};%
- \node[right] (root label swap \the\RootNumber)%
- at ({((#3)*\dynkinedgelength)+\dynkinradius},{(#4)*\dynkinedgelength}) {};%
+ \convertRootNumber{#2}%
}%
{%
- \node[left] (root label swap \the\RootNumber)%
- at ({((#3)*\dynkinedgelength)-\dynkinradius},{(#4)*\dynkinedgelength}) {};%
- \node[right] (root label \the\RootNumber)%
- at ({((#3)*\dynkinedgelength)+\dynkinradius},{(#4)*\dynkinedgelength}) {};%
+ \global\RootNumber=#2
}%
+ \node (\dynkin@root@name \the\RootNumber) at (Dynkin current) {};%
+ \dynkin@put@direction{\the\RootNumber}{#3}%
}%
-%% \Adynkinnodes
-%% ->
-%% Tell TikZ where to place the nodes for an A series Dynkin diagram. Draws nothing.
-\newcommand*{\Adynkinnodes}%
+%% \dynkinPlaceRootRelativeTo{<p>}{<q>}{<d>}{<L>}
+%% \dynkinPlaceRootRelativeTo*{<p>}{<q>}{<d>}{<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.
+%% <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}%
{%
- \ifdynkinfolded%
- \newcount\halfrank%
- \halfrank=\dynkinrank%
- \divide\halfrank by 2%
- \newcount\countdown%
- \countdown=\dynkinrank%
- \ifodd\dynkinrank%
- \foreach \b in {1,...,\the\halfrank}%
- {%
- \placeRoot*{\b}{\b}{1}%
- \placeRoot{\the\countdown}{\b}{-1}%
- \ifdynkinarrows%
- \ifnum\dynkinrank>1%
- \dynkinfoldarrow*{\b}{\the\countdown}%
- \fi%
- \fi%
- \global\advance\countdown by -1%
- }%
- \advance\halfrank by 1%
- \placeRootHorizontalLabels{\the\halfrank}{\the\halfrank}{0}%
- \else%
- \foreach \b in {1,...,\the\halfrank}%
- {%
- \placeRoot*{\b}{\b}{1}%
- \placeRoot{\the\countdown}{\b}{-1}%
- \ifdynkinarrows%
- \dynkinfoldarrow*{\b}{\the\countdown} %
- \fi%
- \global\advance\countdown by -1%
- }%
+ \IfBooleanTF{#1}%
+ {%
+ \convertRootPair{#3}{#2}%
+ }%
+ {%
+ \global\@fromRoot=#3%
+ \global\@toRoot=#2%
+ }%
+ \dynkin@is@edge@indefinite{\@fromRoot}{\@toRoot}%
+ \ifdynkin@is@indefinite@edge%
+ \xdef\dynkin@distance{\dynkin@indefinite@edge@length}
+ \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}%
+}%
+
+%% \dynkinEast
+%% Moves the TikZ cursor one edge to the right.
+%% Starred form for an indefinite edge.
+\NewDocumentCommand\dynkinEast{s}%
+{%
+ \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}
+ \node (Dynkin current) at ($(Dynkin current)+({\distance},0)$) {};%
+}%
+
+
+
+%% \dynkinWest
+%% Moves the TikZ cursor one edge to the left.
+%% Starred form for an indefinite edge.
+\NewDocumentCommand\dynkinWest{s}%
+{%
+ \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}
+ \node (Dynkin current) at ($(Dynkin current)+({-\distance},0)$) {};%
+}%
+
+%% \dynkinNorth
+%% Moves the TikZ cursor one edge up.
+%% Starred form for an indefinite edge.
+\NewDocumentCommand\dynkinNorth{s}%
+{%
+ \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}
+ \node (Dynkin current) at ($(Dynkin current)+(0,{\distance})$) {};%
+}%
+
+%% \dynkinSouth
+%% Moves the TikZ cursor one edge to the left.
+%% Starred form for an indefinite edge.
+\NewDocumentCommand\dynkinSouth{s}%
+{%
+ \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}
+ \node (Dynkin current) at ($(Dynkin current)+(0,{-\distance})$) {};%
+}%
+
+%% \dynkinNorthEast
+%% Moves the TikZ cursor one edge to the north east.
+%% Starred form for an indefinite edge.
+\NewDocumentCommand\dynkinNorthEast{s}%
+{%
+ \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}
+ \node (Dynkin current) at
+ ($(Dynkin current)+
+ ({cos(60)*\distance},{sin(60)*\distance})$) {};%
+}%
+
+%% \dynkinSouthEast
+%% Moves the TikZ cursor one edge to the south east.
+%% Starred form for an indefinite edge.
+\NewDocumentCommand\dynkinSouthEast{s}%
+{%
+ \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}
+ \node (Dynkin current) at
+ ($(Dynkin current)+
+ ({cos(-60)*\distance},{sin(-60)*\distance})$) {};%
+}%
+
+%% \dynkinNorthWest
+%% Moves the TikZ cursor one edge to the north west.
+%% Starred form for an indefinite edge.
+\NewDocumentCommand\dynkinNorthWest{s}%
+{%
+ \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}
+ \node (Dynkin current) at
+ ($(Dynkin current)+
+ ({cos(120)*\distance},{sin(120)*\distance})$) {};%
+}%
+
+%% \dynkinSouthWest
+%% Moves the TikZ cursor one edge to the south west.
+%% Starred form for an indefinite edge.
+\NewDocumentCommand\dynkinSouthWest{s}%
+{%
+ \xdef\distance{\IfBooleanTF{#1}{\dynkin@indefinite@edge@length}{\dynkin@edge@length}}
+ \node (Dynkin current) at
+ ($(Dynkin current)+
+ ({cos(240)*\distance},{sin(240)*\distance})$) {};%
+}%
+
+
+%% \dynkinSouthEastFold
+%% Moves the TikZ cursor one edge to the south east in the middle of a fold.
+\NewDocumentCommand\dynkinSouthEastFold{}%
+{%
+ \node (Dynkin current) at ($(Dynkin current)+({\dynkin@fold@radius},{-\dynkin@fold@radius})$) {};%
+}%
+
+%% \dynkinSouthWestFold
+%% Moves the TikZ cursor one edge to the south west in the middle of a fold.
+\NewDocumentCommand\dynkinSouthWestFold{}%
+{%
+ \node (Dynkin current) at ($(Dynkin current)+({-\dynkin@fold@radius},{-\dynkin@fold@radius})$) {};%
+}%
+
+%% \dynkinSouthFold
+%% Moves the TikZ cursor one edge to the south in the middle of a fold.
+\NewDocumentCommand\dynkinSouthFold{}%
+{%
+ \node (Dynkin current) at ($(Dynkin current)+(0,{-2*\dynkin@fold@radius})$) {};%
+}%
+
+\NewDocumentCommand\find@mark@of@root{m}%
+{%
+ \StrChar{\dynkin@roots}{#1}[\my@root@marker]%
+ \my@root@marker
+}%
+
+\NewDocumentCommand\dynkin@draw@all@roots{}%
+{%
+ \foreach \b in {1,...,\the\dynkin@nodes}%
+ {%
+ \StrChar{\dynkin@roots}{\b}[\c]%
+ \dynkinRootMark*{\c}{\b}%
+ }%
+ \ifdynkin@is@extended%
+ \dynkinRootMark*{\dynkin@affine@root@mark}{0}%
+ \else%
+ \ifdynkin@is@twisted%
+ \dynkinRootMark*{\dynkin@affine@root@mark}{0}%
\fi%
+ \fi%
+}%
+
+
+%% \dynkin@fold@arrow@if@oo{<p>}{<q>}
+%% Inputs are roots (in Bourbaki ordering).
+%% If we are working on a Satake diagram, and both roots are
+%% marked with hollow circles o, then draws a fold arrow between them.
+\NewDocumentCommand\dynkin@fold@arrow@if@oo{mm}%
+{%
+ \convertRootPair{#1}{#2}%
+ \ifdynkin@Satake@diagram%
+ \StrChar{\dynkin@roots}{\the\@fromRoot}[\my@root@marker]%
+ \IfStrEq{\my@root@marker}{o}%
+ {%
+ \StrChar{\dynkin@roots}{\the\@toRoot}[\my@other@root@marker]%
+ \IfStrEq{\my@other@root@marker}{o}%
+ {%
+ \dynkinFold{\the\@fromRoot}{\the\@toRoot}%
+ }%
+ {}%
+ }{}%
\else%
- \foreach \b in {1,...,\the\dynkinrank}%
+ \dynkinFold{\the\@fromRoot}{\the\@toRoot}%
+ \fi%
+}%
+
+%% \dynkin@pipe{<f>}{<t>}{<D>}{<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}%
{%
- \placeRoot{\b}{\b}{0}%
+ \dynkinPlaceRootRelativeTo*{\b}{\the\bmo}{#3}{#4}%
+ \dynkinEdge*{SingleEdge}{\b}{\the\bmo}%
+ \global\advance\bmo by 1%
}%
\fi%
}%
-%% \Adynkin
-%% ->
-%% Draws an A series Dynkin diagram.
-\newcommand*{\Adynkin}
-{
- \newif\ifwasfolded
- \ifdynkinfolded
- \global\wasfoldedtrue
+%% \dynkin@fold{<f>}{<t>}
+%% Layout the roots (as TikZ nodes) <f>, <f>+1, \dots, <t> in the Bourbaki ordering, in a folded arrangement,
+%% moving first east, then down, then west, starting at the current position (Dynkin current).
+%% Assumes that the root <f> is already created as a node in TikZ, but the others are not.
+\NewDocumentCommand\dynkin@fold{mm}%
+{%
+ \newcount\h%
+ \h=#1%
+ \advance\h by #2%
+ \advance\h by -1%
+ \divide\h by 2%
+ \dynkin@pipe{#1}{\the\h}{east}{above}
+ \newcount\hpo
+ \hpo=\the\h
+ \advance\hpo by 1
+ \newcount\afterfold
+ \global\afterfold=\the\hpo
+ \newcount\nrts
+ \nrts=#2
+ \advance\nrts by 1
+ \advance\nrts by -#1
+ \ifodd\nrts%
+ \global\advance\afterfold by 1
+ \dynkinPlaceRootRelativeTo*{\the\hpo}{\the\h}{southeastfold}{right}
+ \dynkinEdge*{RightDownArc}{\the\h}{\the\hpo}%
+ \dynkinPlaceRootRelativeTo*{\the\afterfold}{\the\hpo}{southwestfold}{below}
+ \dynkinEdge*{RightUpArc}{\the\afterfold}{\the\hpo}%
\else
- \global\wasfoldedfalse
+ \dynkinPlaceRootRelativeTo*{\the\afterfold}{\the\h}{southfold}{below}
+ \dynkinEdge*{SemiCircle}{\the\h}{\the\afterfold}%
\fi
- \ifnum\dynkinrank=0%
- \global\dynkinrank=7%
- % Create the nodes.
- \Adynkinnodes%
- % Draw the edges.
- \dynkinline*{1}{2}%
- \dynkindots*{2}{3}%
- \ifdynkinfolded%
- \dynkindownarc*{3}{4}%
- \dynkinuparc*{4}{5}%
- \else%
- \dynkinline*{3}{4}%
- \dynkinline*{4}{5}%
- \fi%
- \dynkindots*{5}{6}%
- \dynkinline*{6}{7}%
+ \dynkin@pipe{\the\afterfold}{#2}{west}{below}
+ \ifdynkin@arrows%
+ \newcount\countdown%
+ \countdown=#2%
+ \foreach \b in {#1,...,\the\h}%
+ {%
+ \dynkin@fold@arrow@if@oo{\b}{\the\countdown}%
+ \global\advance\countdown by -1%
+ }%
+ \fi%
+}%
+
+%% \Adynkin
+%% Draws an A series Dynkin diagram.
+\NewDocumentCommand\Adynkin{}%
+{%
+ \ifnum\dynkin@rank=1%
+ \global\dynkin@ply=1\relax%
+ \fi%
+% % Create the roots.
+ \ifnum\dynkin@ply>1%
+ \dynkinPlaceRootHere*{1}{above}%
+ \dynkin@fold{1}{\the\dynkin@rank}%
\else%
- \ifnum\dynkinrank=1%
- \global\dynkinfoldedfalse%
- \fi%
- % Create the nodes.
- \Adynkinnodes%
- % Draw the edges.
- \ifnum\dynkinrank>1%
- \ifnum\dynkinrank=2%
- \ifdynkinfolded%
- \dynkinsemicircle*{1}{2}%
- \else%
- \dynkinline*{1}{2}%
- \fi%
- \else%
- \newcount\bpo%
- \bpo=2%
- \newcount\drmo%
- \drmo=\dynkinrank%
- \advance \drmo by -1%
- \ifdynkinfolded%
- \newcount\halfrank%
- \halfrank=\dynkinrank%
- \divide\halfrank by 2%
- \newcount\hrmo%
- \hrmo=\halfrank%
- \advance\hrmo by -1%
- \ifnum\halfrank>1%
- \foreach \b in {1,...,\the\hrmo}%
- {%
- \dynkinline*{\b}{\bpo}%
- \global\advance\bpo by 1%
- }%
- \fi%
- \newcount\hrpo%
- \hrpo=\halfrank%
- \advance\hrpo by 1%
- \ifodd\dynkinrank%
- \newcount\hrpt%
- \hrpt=\hrpo%
- \advance\hrpt by 1%
- \dynkindownarc*{\the\halfrank}{\the\hrpo}%
- \dynkinuparc*{\the\hrpo}{\the\hrpt}%
- \ifdynkinarrows%
- \dynkinfoldarrow*{\the\halfrank}{\the\hrpt}%
- \fi%
- \global\advance\bpo by 2%
- \ifnum\hrpt<\dynkinrank%
- \foreach \b in {\the\hrpt,...,\the\drmo}%
- {%
- \dynkinline*{\b}{\bpo}%
- \global\advance\bpo by 1%
- }%
- \fi%
- \else%
- \dynkinsemicircle*{\the\halfrank}{\the\hrpo}%
- \global\advance\bpo by 1%
- \ifnum\halfrank<\drmo%
- \foreach \b in {\the\hrpo,...,\the\drmo}%
- {%
- \dynkinline*{\b}{\bpo}%
- \global\advance\bpo by 1%
- }%
- \fi%
- \fi%
- \else%
- \foreach \b in {1,...,\the\drmo}%
- {%
- \dynkinline*{\b}{\bpo}%
- \global\advance\bpo by 1%
- }%
- \fi%
- \fi%
+ \dynkinPlaceRootHere*{1}{below}%
+ \ifnum\dynkin@rank>1%
+ \dynkin@pipe{1}{\the\dynkin@rank}{east}{below}%
\fi%
\fi%
- \ifisaffine%
- \dynkinline*{0}{1}%
- \dynkinline*{0}{\the\dynkinrank}%
- \dynkindot*{0}%
- \fi%
- % Draw the nodes.
- \IfStrEqCase{\dynkinSatake}%
- {%
- {*}%
- {%
- \foreach \b in {1,...,\the\dynkinrank}%
- {%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkindot{\b}}%
- }%
- }%
- {I}%
- {%
- \ifisaffine%
- \dynkinline*{0}{1}%
- \dynkinline*{0}{\the\dynkinrank}%
- \dynkindot*{0}%
- \fi%
- \foreach \b in {1,...,\the\dynkinrank}%
- {%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkinopendot{\b}}%
- }%
- }%
- {II}%
- {%
- \newcount\bb%
- \bb=1%
- \foreach \b in {1,...,\the\dynkinrank}%
- {%
- \ifodd\bb%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkincloseddot{\b}}%
- \else%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkinopendot{\b}}%
- \fi%
- \global\advance \bb by 1%
- }%
- }%
- }%
- \ifwasfolded
- \global\dynkinfoldedtrue
- \else
- \global\dynkinfoldedfalse
- \fi
-}
+}%
%% \Bdynkin
-%% ->
%% Draw a B series Dynkin diagram.
\newcommand*{\Bdynkin}
{
- \ifdynkincoxeter
+ \ifnum\dynkin@rank<2
\Adynkin
- \convertRootPair{1}{2}
- \node[above] at ($.5*(root \the\@fromRoot)+.5*(root \the\@toRoot)$) {\dynkinprint{4}};
\else
- \ifnum\dynkinrank=0
- \dynkinrank=5
- % Create the nodes.
- \Adynkinnodes
- % Draw the edges.
- \dynkinline*{1}{2}
- \dynkindots*{2}{3}
- \dynkinline*{3}{4}
- \dynkindoubleline*{4}{5}
+ \newcount\drmo
+ \drmo=\the\dynkin@rank
+ \advance\drmo by -1
+ \ifdynkin@Coxeter
+ \Adynkin
+ \convertRootPair{\the\drmo}{\the\dynkin@rank}
+ \node[/Dynkin diagram/text,above]
+ at ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$)
+ {\(4\)};
\else
- % Create the nodes.
- \Adynkinnodes
- % Draw the edges.
- \dynkinline*{1}{\the\dynkinrank}%
- \newcount\rmo
- \rmo=\dynkinrank
- \advance \rmo by -1
- \dynkindoubleline*{\the\rmo}{\the\dynkinrank}
- \fi
- % Draw the nodes.
- \ifisaffine
- \dynkinline*{0}{2}
- \dynkindot*{0}
- \fi
- \foreach \b in {1,...,\the\dynkinrank}
- {
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkindot{\b}}
- }
- \fi
+ % Create the roots.
+ \ifnum\dynkin@ply>1%
+ \ifnum\dynkin@rank>3%
+ \dynkinPlaceRootHere*{1}{above}%
+ \dynkinPlaceRootRelativeTo*{2}{1}{east}{above}%
+ \dynkin@fold{2}{\the\drmo}%
+ \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\drmo}{west}{below}%
+ \dynkinEdge*{DoubleEdge}{\the\drmo}{\the\dynkin@rank}%
+ \dynkinEdge*{SingleEdge}{1}{2}%
+ \else%
+ \ifnum\dynkin@rank=2%
+ \dynkinPlaceRootHere*{1}{left}%
+ \dynkinPlaceRootRelativeTo*{2}{1}{southfold}{left}%
+ \dynkinEdge*{DoubleDownRightSemiCircle}{1}{2}%
+ \else%
+ \dynkinPlaceRootHere*{1}{left}%
+ \dynkinPlaceRootRelativeTo*{2}{1}{southeastfold}{right}%
+ \dynkinPlaceRootRelativeTo*{3}{2}{southwestfold}{left}%
+ \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}
+ \dynkinEdge*{DoubleEdge}{\the\drmo}{\the\dynkin@rank}%
+ \fi%
+ \ifdynkin@arrows%
+ \ifnum\dynkin@ply>1%
+ \dynkinLeftFold*{1}{\the\dynkin@rank}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
}
%% \Cdynkin
-%% ->
%% Draws a C series Dynkin diagram.
\newcommand*{\Cdynkin}
{
- \ifdynkincoxeter
- \Bdynkin
- \else
- \ifnum\dynkinrank=0
- \dynkinrank=5
- % Create the nodes.
- \Adynkinnodes
- % Draw the edges.
- \dynkinline*{1}{2}
- \dynkindots*{2}{3}
- \dynkinline*{3}{4}
- \dynkindoubleline*{5}{4}
- \else
- % Create the nodes.
- \Adynkinnodes
- % Draw the edges.
- \newcount\rmo
- \rmo=\dynkinrank
- \advance\rmo by -1
- \dynkinline*{1}{\the\rmo}%
- \dynkindoubleline*{\the\dynkinrank}{\the\rmo}
- \fi
- % Draw the nodes.
- \ifisaffine
- \dynkindoubleline*{0}{1}
- \dynkindot*{0}
- \fi
- \foreach \b in {1,...,\the\dynkinrank}
- {
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkindot{\b}}
- }
- \fi
+ \ifdynkin@reverse@arrows%
+ \global\dynkin@reverse@arrowsfalse%
+ \else%
+ \global\dynkin@reverse@arrowstrue%
+ \fi%
+ \Bdynkin%
+ \ifdynkin@reverse@arrows%
+ \global\dynkin@reverse@arrowsfalse%
+ \else%
+ \global\dynkin@reverse@arrowstrue%
+ \fi%
}
-%% \Ddynkinnodes
-%% ->
-%% Tell TikZ where to place the nodes for a D series Dynkin diagram. Draws nothing.
-\newcommand*{\Ddynkinnodes}
+%% \Ddynkin@roots
+%% Tell TikZ where to place the @roots for a D series Dynkin diagram. Draws nothing.
+\newcommand*{\Ddynkin@roots}
{
+ % Create the roots.
+ \ifdynkin@is@extended%
+ \ifnum\dynkin@ply>1%
+ \ifnum\dynkin@rank=4%
+ \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{right}%
+ \else%
+ \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below}%
+ \fi%
+ \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}%
+ \else%
+ \ifdynkin@left@fold%
+ \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below}%
+ \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{left}%
+ \else%
+ \dynkinPlaceRootRelativeTo*{2}{0}{southeast}{left}%
+ \dynkinPlaceRootRelativeTo*{1}{2}{southwest}{left}%
+ \fi%
+ \fi%
+ \dynkinMoveToRoot*{2}%
+ \else
+ \dynkinPlaceRootHere*{1}{below}
+ \ifnum\dynkin@rank=4%
+ \ifdynkin@right@fold%
+ \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}%
+ \else%
+ \ifnum\dynkin@ply>1%
+ \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}%
+ \else%
+ \dynkinPlaceRootRelativeTo*{2}{1}{east}{right}%
+ \fi%
+ \fi%
+ \else%
+ \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}%
+ \fi%
+ \fi
\newcount\rmo
- \rmo=\dynkinrank
+ \rmo=\dynkin@rank
\advance \rmo by -1
\newcount\rmt
\rmt=\rmo
\advance\rmt by -1
- % Create the nodes.
- \foreach \b in {1,...,\the\rmt}
- {
- \placeRoot{\b}{\b}{0}
- }
- \pgfmathparse{subtract(\the\rmo,.5)}
- \let\rmh\pgfmathresult
- \ifdynkinfolded
- \placeRoot{\the\rmo}{\rmh}{-.9}
- \placeRoot*{\the\dynkinrank}{\rmh}{.9}
- \else
- \placeRootHorizontalLabels{\the\rmo}{\rmh}{-.9}
- \placeRootHorizontalLabels{\the\dynkinrank}{\rmh}{.9}
- \fi
-}
+ \newcount\rmth
+ \rmth=\rmt
+ \advance\rmth by -1
+ \ifnum\dynkin@rank>2
+ \ifnum\dynkin@rank>5%
+ \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}%
+ \else%
+ \ifnum\dynkin@ply>1%
+ \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}%
+ \else%
+% \ifdynkin@left@fold%
+% \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}%
+% \else%
+ \ifnum\dynkin@rank=5%
+ \ifdynkin@right@fold%
+ \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}%
+ \else%
+ \dynkinPlaceRootRelativeTo*{3}{2}{east}{right}%
+ \fi%
+ \else%
+ \dynkinPlaceRootRelativeTo*{3}{2}{east}{right}%
+ \fi%
+% \fi%
+ \fi%
+ \fi%
+ \ifnum\rmth>3%
+ \dynkin@pipe{3}{\the\rmth}{east}{below}%
+ \fi%
+ \ifnum\rmt>3%
+ \ifnum\dynkin@ply>1%
+ \dynkinPlaceRootRelativeTo*{\rmt}{\rmth}{east}{below}%
+ \else%
+ \ifdynkin@right@fold%
+ \dynkinPlaceRootRelativeTo*{\rmt}{\rmth}{east}{below}%
+ \else%
+ \dynkinPlaceRootRelativeTo*{\rmt}{\rmth}{east}{right}%
+ \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}%
+ \else%
+ \dynkinPlaceRootRelativeTo*{\the\rmo}{\the\rmt}{northeast}{right}%
+ \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\rmt}{southeast}{right}%
+ \fi%
+ \else%
+ \dynkinPlaceRootRelativeTo*{\the\rmo}{\the\rmt}{northeastfold}{right}%
+ \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\rmt}{southeastfold}{right}%
+ \fi%
+ \fi%
+}%
+
+%% \Ddynkin@edges
+%% Draws edges on a D series Dynkin diagram.
+\NewDocumentCommand\Ddynkin@edges{}%
+{%
+ % Draw the edges.
+ \newcount\rmo
+ \rmo=\dynkin@rank
+ \advance \rmo by -1
+ \newcount\rmt
+ \rmt=\rmo
+ \advance\rmt by -1
+ \newcount\rmtr
+ \rmtr=\rmt
+ \advance\rmtr by -1
+ \ifnum\dynkin@ply>1%
+ \ifdynkin@is@extended%
+ \dynkinEdge*{RightUpArc}{1}{2}%
+ \else%
+ \dynkinEdge*{SingleEdge}{1}{2}%
+ \fi%
+ \ifnum\dynkin@rank>4%
+ \dynkinEdge*{SingleEdge}{2}{3}%
+ \fi%
+ \dynkinEdge*{LeftDownArc}{\the\rmo}{\the\rmt}%
+ \dynkinEdge*{LeftUpArc}{\the\dynkin@rank}{\the\rmt}%
+ \ifdynkin@arrows%
+ \dynkinRightFold*{\the\rmo}{\the\dynkin@rank}%
+ \ifdynkin@is@extended%
+ \dynkinLeftFold*{0}{1}%
+ \fi%
+ \fi%
+ \else%
+ \ifnum\dynkin@rank=4%
+ \else%
+ \dynkinEdge*{SingleEdge}{2}{3}%
+ \fi%
+ \ifdynkin@is@extended%
+ \ifdynkin@left@fold%
+ \dynkinEdge*{RightUpArc}{1}{2}%
+ \ifdynkin@arrows%
+ \ifdynkin@is@extended%
+ \dynkinLeftFold*{0}{1}%
+ \fi%
+ \fi%
+ \else%
+ \dynkinEdge*{SingleEdge}{1}{2}%
+ \fi%
+ \else%
+ \dynkinEdge*{SingleEdge}{1}{2}%
+ \fi%
+ \ifdynkin@right@fold%
+ \dynkinEdge*{LeftDownArc}{\the\rmo}{\the\rmt}%
+ \dynkinEdge*{LeftUpArc}{\the\dynkin@rank}{\the\rmt}%
+ \dynkinRightFold*{\the\rmo}{\the\dynkin@rank}%
+ \else%
+ \dynkinEdge*{SingleEdge}{\the\rmt}{\the\rmo}%
+ \dynkinEdge*{SingleEdge}{\the\rmt}{\the\dynkin@rank}%
+ \fi%
+ \fi%
+}%
+
+%% \DthreePly
+%% Draws a D series Dynkin diagram of rank 4, folded over a G2.
+\NewDocumentCommand\DthreePly{}%
+{%
+ \dynkinPlaceRootHere*{2}{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}%
+ \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}%
+ \dynkinEdge*{LeftDownArc}{2}{1}%
+ \dynkinEdge*{LeftUpArc}{4}{1}%
+ \xdef\dynkin@fold@radius{\old@fold@radius}%
+ \ifdynkin@arrows%
+ \dynkin@fold@arrow@if@oo{2}{3}%
+ \dynkin@fold@arrow@if@oo{3}{4}%
+ \fi%
+}%
%% \Ddynkin
-%% ->
%% Draws a D series Dynkin diagram.
-\newcommand*{\Ddynkin}%
-{
- \ifnum\dynkinrank=1
- \gdef\dynkinseries{A}
- \Adynkin
- \else
- \ifnum\dynkinrank=0
- \dynkinrank=6
- \Ddynkinnodes
- % Draw the edges.
- \dynkinline*{1}{2}
- \dynkindots*{2}{3}
- \dynkinline*{3}{4}
- \dynkinline*{4}{5}
- \dynkinline*{4}{6}
- \else
- \Ddynkinnodes
- % Draw the edges.
- \dynkinline*{1}{\the\rmt}
- \dynkinline*{\the\rmt}{\the\rmo}
- \dynkinline*{\the\rmt}{\the\dynkinrank}
- \fi
- \ifdynkinfolded
- \ifdynkinarrows
- \draw[\dynkinfoldarrowstyle,\dynkinfoldarrowcolor]
- (root \the\rmo.east)
- to [out=45, in=-45]
- (root \the\dynkinrank.east);
- \fi
- \fi
- % Draw the nodes.
- \ifisaffine
- \dynkinline*{0}{2}
- \dynkindot*{0}
- \fi
- \foreach \b in {1,...,\the\dynkinrank}
- {
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkindot{\b}}
- }
- \fi
-}
+\NewDocumentCommand\Ddynkin{}%
+{%
+ \ifnum\dynkin@rank>3%
+ \ifnum\dynkin@rank=4%
+ \ifnum\dynkin@ply=3%
+ \DthreePly%
+ \else%
+ \Ddynkin@roots%
+ \Ddynkin@edges%
+ \fi%
+ \else%
+ \Ddynkin@roots%
+ \Ddynkin@edges%
+ \fi%
+ \else%
+ \gdef\dynkin@series{A}%
+ \Adynkin%
+ \ifnum\dynkin@ply>1%
+ \ifdynkin@arrows%
+ \ifnum\dynkin@rank=1%
+ \else%
+ \dynkinLeftFold*{1}{\the\dynkin@rank}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}%
-%% \Edynkinunfolded
-%% ->
+%% \Edynkin@unfolded
%% Draws an E series Dynkin diagram not folded.
-\newcommand*{\Edynkinunfolded}%
+\newcommand*{\Edynkin@unfolded}%
{
- % Create the nodes.
- \placeRoot{1}{1}{0}
- \ifisaffine
- \ifnum\dynkinrank=6
- \placeRootHorizontalLabels{2}{3}{1}
+ % Create the @roots.
+ \dynkinPlaceRootHere*{1}{below}%
+ \dynkinPlaceRootRelativeTo*{3}{1}{east}{below}%
+ \dynkinPlaceRootRelativeTo*{4}{3}{east}{below}%
+ \ifdynkin@is@extended
+ \ifnum\dynkin@rank=6
+ \dynkinPlaceRootRelativeTo*{2}{4}{north}{right}%
\else
- \placeRoot*{2}{3}{1}
+ \dynkinPlaceRootRelativeTo*{2}{4}{north}{above}%
\fi
\else
- \placeRoot*{2}{3}{1}
+ \dynkinPlaceRootRelativeTo*{2}{4}{north}{above}%
\fi
- \foreach \b in {3,...,\dynkinrank}
- {
- \newcount\bmo
- \bmo=\b
- \advance\bmo by -1
- \placeRoot{\b}{\the\bmo}{0}
- }
-% % Draw the edges.
- \dynkinline*{1}{\the\dynkinrank}
- \dynkinline*{2}{4}
-}
+ \newcount\bmo\relax%
+ \bmo=4\relax%
+ \foreach \b in {5,...,\dynkin@rank}%
+ {%
+ \dynkinPlaceRootRelativeTo*{\b}{\the\bmo}{east}{below}%
+ \dynkinEdge*{SingleEdge}{\the\bmo}{\b}%
+ \global\advance\bmo by 1%
+ }%
+% % Draw the remaining edges.
+ \dynkinEdge*{SingleEdge}{1}{3}
+ \dynkinEdge*{SingleEdge}{3}{4}
+ \dynkinEdge*{SingleEdge}{4}{2}
+ \ifdynkin@is@extended%
+ \ifnum\dynkin@rank=6%
+ \dynkinPlaceRootRelativeTo*{0}{2}{north}{above}%
+ \dynkinEdge*{SingleEdge}{0}{2}%
+ \else%
+ \ifnum\dynkin@rank=7%
+ \dynkinPlaceRootRelativeTo*{0}{1}{west}{below}%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \else%
+ \dynkinPlaceRootRelativeTo*{0}{8}{east}{below}%
+ \dynkinEdge*{SingleEdge}{0}{8}%
+ \fi%
+ \fi%
+ \fi%
+}%
-%% \Edynkinfolded
-%% ->
-%% Draws a folded E6 Dynkin diagram.
-\newcommand*{\Edynkinfolded}%
-{
- \placeRoot*{1}{0}{1}
- \placeRoot*{3}{1}{1}
- \placeRootHorizontalLabels*{4}{2}{0}
- \placeRootHorizontalLabels{2}{3}{0}
- \placeRoot{5}{1}{-1}
- \placeRoot{6}{0}{-1}
- \dynkinline*{1}{3}
- \dynkinline*{2}{4}
- \dynkinline*{5}{6}
- \dynkindownarc*{3}{4}
- \dynkinuparc*{4}{5}
-}
+%% \Edynkin@folded
+%% Draws a folded E6, affine E6 or affine E7 Dynkin diagram.
+\NewDocumentCommand\Edynkin@folded{}%
+{%
+ \ifnum\dynkin@rank=6%
+ \ifnum\dynkin@ply=2\ESixTwoPly\else\ESixThreePly\fi%
+ \else%
+ \extendedESevenFolded%
+ \fi%
+}%
+
+\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}%
+ \ifdynkin@is@extended%
+ \dynkinPlaceRootRelativeTo*{2}{4}{east}{below}%
+ \dynkinPlaceRootRelativeTo*{0}{2}{east}{right}%
+ \dynkinEdge*{SingleEdge}{0}{2}%
+ \else%
+ \dynkinPlaceRootRelativeTo*{2}{4}{east}{right}%
+ \fi%
+ \dynkinEdge*{SingleEdge}{1}{3}%
+ \dynkinEdge*{SingleEdge}{2}{4}%
+ \dynkinEdge*{SingleEdge}{5}{6}%
+ \dynkinEdge*{RightDownArc}{3}{4}%
+ \dynkinEdge*{RightUpArc}{5}{4}%
+ \ifdynkin@arrows%
+ \dynkin@fold@arrow@if@oo{1}{6}%
+ \dynkin@fold@arrow@if@oo{3}{5}%
+ \fi%
+}%
+
+
+\NewDocumentCommand\ESixThreePly{}%
+{%
+ \dynkinPlaceRootHere*{3}{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}%
+ \xdef\dynkin@edge@length{\old@edge@length}%
+ \dynkinPlaceRootRelativeTo*{1}{3}{west}{left}%
+ \dynkinPlaceRootRelativeTo*{0}{2}{west}{left}%
+ \dynkinPlaceRootRelativeTo*{6}{5}{west}{left}%
+ \edef\old@fold@radius{\dynkin@fold@radius}%
+ \xdef\dynkin@fold@radius{\dynkin@edge@length}%
+ \dynkinPlaceRootRelativeTo*{4}{2}{east}{right}%
+ \dynkinEdge*{SingleEdge}{4}{2}%
+ \dynkinEdge*{SingleEdge}{3}{1}%
+ \dynkinEdge*{SingleEdge}{2}{0}%
+ \dynkinEdge*{SingleEdge}{5}{6}%
+ \dynkinEdge*{RightDownArc}{3}{4}%
+ \dynkinEdge*{RightUpArc}{5}{4}%
+ \xdef\dynkin@fold@radius{\old@fold@radius}%
+ \ifdynkin@arrows%
+ \dynkin@fold@arrow@if@oo{1}{0}%
+ \dynkin@fold@arrow@if@oo{6}{0}%
+ \dynkin@fold@arrow@if@oo{3}{2}%
+ \dynkin@fold@arrow@if@oo{2}{5}%
+ \fi%
+}%
+
+\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}%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \dynkinEdge*{SingleEdge}{1}{3}%
+ \dynkinEdge*{SingleEdge}{2}{4}%
+ \dynkinEdge*{SingleEdge}{5}{6}%
+ \dynkinEdge*{SingleEdge}{6}{7}%
+ \dynkinEdge*{RightDownArc}{3}{4}%
+ \dynkinEdge*{RightUpArc}{5}{4}%
+ \ifdynkin@arrows%
+ \dynkin@fold@arrow@if@oo{0}{7}%
+ \dynkin@fold@arrow@if@oo{1}{6}%
+ \dynkin@fold@arrow@if@oo{3}{5}%
+ \fi%
+}%
+
%% \Edynkin
-%% ->
%% Draws an E6 Dynkin diagram.
-\newcommand*{\Edynkin}%
-{
- \ifdynkinfolded
- \ifnum\dynkinrank=6
- \Edynkinfolded
- \else
- \ClassWarning{Can not fold a diagram of type \dynkinseries\the\dynkinrank.}
- \fi
- \else
- \Edynkinunfolded
- \fi
- % Draw the nodes.
- \ifisaffine
- \ifnum\dynkinrank=6
- \dynkinline*{0}{2}
- \else
- \dynkinline*{0}{1}
- \fi
- \dynkindot{0}
- \fi
- \IfStrEqCase{\dynkinSatake}%
- {%
- {*}%
- {%
- \foreach \b in {1,...,\the\dynkinrank}%
- {%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkindot{\b}}%
- }%
- \ifdynkinfolded
- \ifdynkinarrows
- \dynkinfoldarrow*{1}{6}
- \dynkinfoldarrow*{3}{5}
- \fi
- \fi
- }%
- {I}%
- {%
- \foreach \b in {1,...,6}%
- {%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkinopendot{\b}}%
- }%
- }%
- {II}%
- {%
- \ifdynkinarrows
- \dynkinfoldarrow*{1}{6}%
- \dynkinfoldarrow*{3}{5}%
- \fi
- \foreach \b in {1,...,6}%
- {%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkinopendot{\b}}%
- }%
- }%
- {III}%
- {%
- \dynkinfoldarrow*{1}{6}%
- \foreach \b in {1,2,6}%
- {%
- \dynkinopendot*{\b}%
- }%
- \foreach \b in {3,4,5}%
- {%
- \dynkincloseddot*{\b}%
- }%
- }%
- {IV}%
- {%
- \foreach \b in {1,6}%
- {%
- \dynkinopendot*{\b}%
- }%
- \foreach \b in {2,3,4,5}%
- {%
- \dynkincloseddot*{\b}%
- }%
- }%
- {V}%
- {%
- \foreach \b in {1,...,7}%
- {%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkinopendot{\b}}%
- }%
- }%
- {VI}%
- {%
- \foreach \b in {1,3,4,6}%
- {%
- \dynkinopendot*{\b}%
- }%
- \foreach \b in {2,5,7}%
- {%
- \dynkincloseddot*{\b}%
- }%
- }%
- {VII}%
- {%
- \foreach \b in {1,6,7}%
- {%
- \dynkinopendot*{\b}%
- }%
- \foreach \b in {2,3,4,5}%
- {%
- \dynkincloseddot*{\b}%
- }%
- }%
- {VIII}%
- {%
- \foreach \b in {1,...,8}%
- {%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkinopendot{\b}}%
- }%
- }%
- {XI}%
- {%
- \foreach \b in {1,6,7,8}%
- {%
- \dynkinopendot*{\b}%
- }%
- \foreach \b in {2,3,4,5}%
- {%
- \dynkincloseddot*{\b}%
- }%
- }%
- }%
-}
+\NewDocumentCommand\Edynkin{}%
+{%
+ \ifnum\dynkin@ply>1%
+ \ifnum\dynkin@rank=6%
+ \Edynkin@folded%
+ \else%
+ \ifnum\dynkin@rank=7%
+ \ifdynkin@is@extended%
+ \Edynkin@folded%
+ \else%
+ \ClassError{Dynkin diagrams}%
+ {Can not fold a diagram of type \dynkin@user@series{} \the\dynkin@rank.}{}%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \Edynkin@unfolded%
+ \fi%
+}%
%% \Fdynkin
-%% ->
%% Draws an F series Dynkin diagram.
\newcommand*{\Fdynkin}%
{
- \Adynkinnodes
- \ifdynkincoxeter
- \dynkinline*{1}{4}
+ \dynkinPlaceRootHere*{1}{below}
+ \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}%
+ \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}%
+ \dynkinPlaceRootRelativeTo*{4}{3}{east}{below}%
+ \ifdynkin@Coxeter
+ \dynkinEdge*{SingleEdge}{1}{2}
+ \dynkinEdge*{SingleEdge}{2}{3}
+ \dynkinEdge*{SingleEdge}{3}{4}
\convertRootPair{2}{3}
- \node[above] at ($.5*(root \the\@fromRoot)+.5*(root \the\@toRoot)$) {\dynkinprint{4}};
- \foreach \b in {1,...,4}%
- {%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkindot{\b}}%
- }%
+ \node[/Dynkin diagram/text,above]
+ at ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$)
+ {\(4\)};
\else
- \dynkinline*{1}{2}
- \dynkinline*{3}{4}
- \dynkindoubleline*{2}{3}
- \ifisaffine
- \dynkinline*{0}{1}
- \dynkindot{0}
- \fi
- \IfStrEqCase{\dynkinSatake}
- {%
- {*}%
- {%
- \foreach \b in {1,...,4}%
- {%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkindot{\b}}%
- }%
- }%
- {I}%
- {%
- \foreach \b in {1,...,4}%
- {%
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkinopendot{\b}}%
- }%
- }%
- {II}%
- {%
- \dynkincloseddot*{1}%
- \dynkincloseddot*{2}%
- \dynkincloseddot*{3}%
- \dynkinopendot*{4}%
- }%
- }%
+ \dynkinEdge*{SingleEdge}{1}{2}
+ \dynkinEdge*{SingleEdge}{3}{4}
+ \dynkinEdge*{DoubleEdge}{2}{3}
\fi
}
%% \Gdynkin
-%% ->
%% Draws a G series Dynkin diagram.
-\newcommand*{\Gdynkin}%
-{
- \newif\ifwasopen
- \ifdynkinopendots
- \global\wasopentrue
- \else
- \global\wasopenfalse
- \fi
- \Adynkinnodes
- \ifisaffine
- \dynkinline*{0}{2}
- \fi
- \ifdynkincoxeter
- \convertRootPair{1}{2}
- \node[above] at ($.5*(root \the\@fromRoot)+.5*(root \the\@toRoot)$) {\dynkinprint{6}};
- \dynkinline*{1}{2}
- \else
- \dynkintripleline*{1}{2}
- \IfStrEq{\dynkinSatake}{I}{\global\dynkinopendotstrue}{}
- \ifisaffine
- \dynkindot{0}
- \fi
- \fi
- \foreach \b in {1,...,2}
- {
- \testbit{\dynkinparabolic}{\b}{\dynkincross{\b}}{\dynkindot{\b}}
- }
- \ifwasopen
- \global\dynkinopendotstrue
- \else
- \global\dynkinopendotsfalse
- \fi
-}
+\NewDocumentCommand\Gdynkin{}%
+{%
+ \ifdynkin@Coxeter%
+ \Idynkin%
+ \else%
+ \dynkinPlaceRootHere*{1}{below}%
+ \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}%
+ \dynkinTripleEdge*{1}{2}%
+ \fi%
+}%
%% \Hdynkin
-%% ->
%% Draws an H series Coxeter diagram.
\newcommand*{\Hdynkin}%
-{
- \newcount\Hn
- \Hn=\dynkinrank
- \dynkinrank=2
- \Adynkin
- \convertRootPair{1}{2}
- \node[above] at ($.5*(root \the\@fromRoot)+.5*(root \the\@toRoot)$) {\dynkinprint{\the\Hn}};
-}
+{%
+ \Adynkin%
+ \convertRootPair{1}{2}%
+ \node[/Dynkin diagram/text,above] at ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) {\(5\)};%
+}%
%% \Idynkin
-%% ->
%% Draws an I series Coxeter diagram.
\newcommand*{\Idynkin}%
-{
- \Adynkin
- \convertRootPair{1}{2}
- \node[above] at ($.5*(root \the\@fromRoot)+.5*(root \the\@toRoot)$) {\dynkinprint{5}};
-}
+{%
+ \newcount\In%
+ \In=\dynkin@rank%
+ \dynkin@rank=2%
+ \Adynkin%
+ \convertRootPair{1}{2}%
+ \node[/Dynkin diagram/text,above] at ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) {\(\dynkin@gonality\)};%
+}%
-\newcommand*{\affineAdynkin}%
-{
-\ifnum\dynkinrank=0
- \placeRoot*{0}{4}{1}
- \Adynkin
-\else
- \ifnum\dynkinrank=1
- \placeRoot{0}{0}{0}
- \placeRoot{1}{2}{0}
- \convertRootNumber{1}
- \draw[
- double,
- \dynkincolor,
- {Classical TikZ Rightarrow[length={3*\dynkinradius}]}-{Classical TikZ Rightarrow[length={3*\dynkinradius}]}
- ]
- ($(root 0)+(\dynkinradius,0)$) -- ($(root \the\RootNumber)-(\dynkinradius,0)$);
- \else
- \pgfmathparse{(.5+.5*\the\dynkinrank)}%
- \let\halfway\pgfmathresult%
- \placeRoot*{0}{\halfway}{1}
- \Adynkin
- \fi
-\fi
-}
+%% \extendedAdynkin
+%% Draws an A series affine Dynkin/Coxeter diagram.
+\NewDocumentCommand\extendedAdynkin{}%
+{%
+ \ifnum\dynkin@rank=1%
+ \dynkinPlaceRootHere{0}{below}%
+ \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}%
+ \convertRootNumber{1}%
+ \begin{scope}{on background layer}%
+ \draw[%
+ /Dynkin diagram/edge,
+ double,
+ {Classical TikZ Rightarrow[length={2*\dynkin@root@radius}]}%
+ -{Classical TikZ Rightarrow[length={2*\dynkin@root@radius}]}%
+ ]%
+ ($(\dynkin@root@name 0)+(\dynkin@root@radius,0)$)
+ --
+ ($(\dynkin@root@name \the\RootNumber)-(\dynkin@root@radius,0)$);%
+ \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}%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \dynkinEdge*{SingleEdge}{1}{2}%
+ \dynkinEdge*{SingleEdge}{2}{3}%
+ \dynkinEdge*{SingleEdge}{3}{0}%
+ \dynkinFold*{0}{2}%
+ \dynkinFold*{1}{3}%
+ \else%
+ \Adynkin{}%
+ \ifnum\dynkin@ply>1%
+ \dynkinPlaceRootRelativeTo*{0}{1}{southwestfold}{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}%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \dynkinEdge*{SingleEdge}{0}{\the\dynkin@rank}%
+ \fi%
+ \dynkinRootMark*{}{0}%
+ \fi%
+ \fi%
+}%
-\newcommand*{\affineBdynkin}%
-{
- \placeRoot*{0}{2}{1}
- \Bdynkin
-}
+\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}%
+ \edef\old@fold@radius{\dynkin@fold@radius}%
+ \xdef\dynkin@fold@radius{\dynkin@edge@length}%
+ \dynkinPlaceRootRelativeTo*{2}{1}{west}{left}%
+ \dynkinEdge*{LeftDownArc}{0}{2}%
+ \dynkinFold*{0}{1}%
+ \dynkinFold*{1}{3}%
+ \dynkinEdge*{SingleEdge}{1}{2}%
+ \dynkinEdge*{DoubleDownRightArc}{2}{3}%
+ \xdef\dynkin@fold@radius{\old@fold@radius}%
+}%
-\newcommand*{\affineCdynkin}
-{
- \placeRoot{0}{0}{0}
- \Cdynkin
-}
+%% \extendedBdynkin
+%% Draws a B series affine Dynkin/Coxeter diagram.
+\newcommand*{\extendedBdynkin}%
+{%
+ \ifnum\the\dynkin@rank=1
+ \extendedAdynkin%
+ \else%
+ \ifnum\the\dynkin@rank=2
+ \dynkinPlaceRootHere*{0}{left}%
+ \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}%
+ \dynkinPlaceRootRelativeTo*{2}{1}{east}{left}%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \dynkinEdge*{DoubleEdge}{1}{2}%
+ \else%
+ \ifnum\dynkin@ply=3%
+ \extendedBthreePly%
+ \else%
+ \ifnum\dynkin@ply=2%
+ \dynkinPlaceRootHere*{0}{left}%
+ \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below}%
+ \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{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}%
+ \dynkinEdge*{SingleEdge}{0}{2}%
+ \dynkinEdge*{SingleEdge}{1}{2}%
+ \fi%
+ \newcount\drmo%
+ \drmo=\the\dynkin@rank\relax%
+ \advance\drmo by -1\relax%
+ \newcount\bmo%
+ \bmo=2%
+ \ifnum\dynkin@rank>3%
+ \foreach \b in {3,...,\the\drmo}%
+ {%
+ \dynkinPlaceRootRelativeTo*{\b}{\the\bmo}{east}{below}%
+ \dynkinEdge*{SingleEdge}{\b}{\the\bmo}%
+ \global\advance\bmo by 1\relax%
+ }%
+ \fi%
+ \ifnum\dynkin@ply<3%
+ \dynkinPlaceRootRelativeTo*{\the\dynkin@rank}{\the\drmo}{east}{below}%
+ \fi%
+ \ifdynkin@Coxeter%
+ \dynkinEdge*{SingleEdge}{\the\drmo}{\the\dynkin@rank}%
+ \convertRootPair{\the\drmo}{\the\dynkin@rank}
+ \node[/Dynkin diagram/text,above] at
+ ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) {\(4\)};
+ \else%
+ \ifnum\dynkin@ply<3%
+ \dynkinEdge*{DoubleEdge}{\the\drmo}{\the\dynkin@rank}%
+ \else%
+ \dynkinEdge*{DoubleDownRightArc}{\the\drmo}{\the\dynkin@rank}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}%
+
+%% \extendedCdynkin
+%% Draws an C series affine Dynkin/Coxeter diagram.
+\newcommand*{\extendedCdynkin}%
+{%
+ \dynkinPlaceRootHere*{0}{below}%
+ \dynkinEast%
+ \Cdynkin{}%
+ \ifdynkin@Coxeter%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \convertRootPair{0}{1}
+ \node[/Dynkin diagram/text,above] at
+ ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$) {\(4\)};
+ \else%
+ \dynkinEdge*{DoubleEdge}{0}{1}%
+ \fi%
+}%
+
+%% \DOneFourFourPly
+%% Draws a D^1_4 series affine Dynkin diagram folded about an A^2_2.
+\NewDocumentCommand\DOneFourFourPly{}%
+{%
+ \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}%
+ \dynkinPlaceRootRelativeTo*{4}{3}{south}{right}%
+ \xdef\dynkin@edge@length{\old@edge@length}%
+ \convertRootPair{0}{4}%
+ \node
+ (Dynkin current)
+ at
+ ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$){};%
+ \dynkinWest%
+ \dynkinPlaceRootHere*{2}{left}%
+ \dynkinEdge*{SingleEdge}{0}{2}%
+ \dynkinEdge*{SingleEdge}{1}{2}%
+ \dynkinEdge*{SingleEdge}{3}{2}%
+ \dynkinEdge*{SingleEdge}{4}{2}%
+ \dynkinFold*{0}{1}%
+ \dynkinFold*{1}{3}%
+ \dynkinFold*{3}{4}%
+}%
+
+
+%% \DfourPly
+%% 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}%
+ \dynkinMoveToRoot*{2}%
+ \newcount\drmo%
+ \drmo=\the\dynkin@rank%
+ \advance\drmo by -1%
+ \newcount\drmt%
+ \drmt=\the\drmo%
+ \advance\drmt by -1%
+ \xdef\old@fold{\dynkin@fold@radius}%
+ \pgfmathparse{\dynkin@fold@radius+2*cos(60)*\dynkin@edge@length}%
+ \xdef\dynkin@fold@radius{\pgfmathresult pt}%
+ \dynkin@fold{2}{\the\drmt}%
+ \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%
+ \dynkinEdge*{RightDownArc}{0}{2}%
+ \dynkinEdge*{RightUpArc}{1}{2}%
+ \dynkinEdge*{RightDownArc}{\the\drmo}{\the\drmt}%
+ \dynkinEdge*{RightUpArc}{\the\dynkin@rank}{\the\drmt}%
+}%
+
+%% \extendedDthreePly
+%% Draws a D^1_4 series Dynkin diagram, folded over a B^1_3.
+\NewDocumentCommand\extendedDthreePly{}%
+{%
+ \dynkinPlaceRootHere*{2}{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}%
+ \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}%
+ \dynkinEdge*{LeftDownArc}{2}{1}%
+ \dynkinEdge*{LeftUpArc}{4}{1}%
+ \xdef\dynkin@fold@radius{\old@fold@radius}%
+ \ifdynkin@arrows%
+ \dynkin@fold@arrow@if@oo{2}{3}%
+ \dynkin@fold@arrow@if@oo{3}{4}%
+ \fi%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+}%
+
+
+%% \extendedDdynkin
+%% Draws an D series affine Dynkin/Coxeter diagram.
+\NewDocumentCommand\extendedDdynkin{}%
+{%
+ \ifnum\dynkin@ply=4%
+ \ifnum\dynkin@rank=4%
+ \DOneFourFourPly%
+ \else%
+ \DfourPly%
+ \fi%
+ \else%
+ \ifnum\dynkin@ply=3%
+ \extendedDthreePly%
+ \else%
+ \ifnum\the\dynkin@rank=1%
+ \extendedAdynkin%
+ \else
+ \dynkinPlaceRootHere*{0}{left}%
+ \Ddynkin%
+ \ifnum\dynkin@ply=2%
+ \dynkinEdge*{RightDownArc}{0}{2}%
+ \else%
+ \ifdynkin@left@fold%
+ \dynkinEdge*{RightDownArc}{0}{2}%
+ \else%
+ \dynkinEdge*{SingleEdge}{0}{2}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}%
-\newcommand*{\affineDdynkin}
+%% \extendedEdynkin
+%% Draws an E series affine Dynkin/Coxeter diagram.
+\newcommand*{\extendedEdynkin}%
+{%
+ \Edynkin%
+}%
+
+%% \extendedFdynkin
+%% Draws an F series affine Dynkin/Coxeter diagram.
+\newcommand*{\extendedFdynkin}%
+{%
+ \ifnum\dynkin@ply=1%
+ \dynkinPlaceRootHere*{0}{below}%
+ \dynkinEast%
+ \Fdynkin%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \else%
+ \dynkinPlaceRootHere*{0}{above}%
+ \dynkinPlaceRootRelativeTo*{1}{0}{east}{above}%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \dynkinPlaceRootRelativeTo*{2}{1}{southeastfold}{right}%
+ \dynkinDefiniteRightDownArc*{1}{2}%
+ \dynkinPlaceRootRelativeTo*{3}{2}{southwestfold}{below}%
+ \dynkinDefiniteDoubleDownLeftArc*{2}{3}%
+ \dynkinPlaceRootRelativeTo*{4}{3}{west}{below}%
+ \dynkinEdge*{SingleEdge}{3}{4}%
+ \ifdynkin@arrows%
+ \dynkinFold*{0}{4}%
+ \dynkinFold*{1}{3}%
+ \fi%
+ \fi%
+}%
+
+%% \extendedGdynkin
+%% Draws an G series affine Dynkin/Coxeter diagram.
+\newcommand*{\extendedGdynkin}%
+{%
+ \xdef\dynkin@gonality{6}%
+ \dynkinPlaceRootHere*{0}{below}%
+ \dynkinEast%
+ \Gdynkin%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+}%
+
+%% \extendedHdynkin
+%% Draws an H series affine Coxeter diagram.
+\newcommand*{\extendedHdynkin}%
+{%
+ \dynkinPlaceRootHere*{0}{below}%
+ \dynkinEast%
+ \Adynkin%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \ifnum\dynkin@rank=3%
+ \convertRootPair{1}{2}%
+ \else%
+ \convertRootPair{0}{1}%
+ \fi%
+ \node[/Dynkin diagram/text,above]
+ at
+ ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$)
+ {\(5\)};%
+}%
+
+
+%% \extendedIdynkin
+%% Draws an I series affine Coxeter diagram.
+\newcommand*{\extendedIdynkin}%
{
- \placeRoot*{0}{2}{1}
- \Ddynkin
+ \dynkinPlaceRootHere*{0}{below}%
+ \dynkinEast%
+ \dynkin@rank=1%
+ \Adynkin%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \convertRootPair{0}{1}%
+ \node[/Dynkin diagram/text,above]
+ at
+ ($.5*(\dynkin@root@name \the\@fromRoot)+.5*(\dynkin@root@name \the\@toRoot)$)
+ {\(\infty\)};%
}
-\newcommand*{\affineEdynkin}
-{
- \ifnum\dynkinrank=6
- \placeRoot*{0}{3}{2}
- \Edynkin
- \else
- \placeRoot{0}{0}{0}
- \Edynkin
+
+%% \twistedAdynkin
+%% Draws a twisted A series affine Dynkin diagram.
+\NewDocumentCommand\twistedAdynkin{}%
+{%
+ \ifnum\dynkin@rank=3
+ \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}%
+ \dynkinQuadrupleEdge*{1}{0}%
+ \else%
+ \newcount\hmo%
+ \hmo=\the\dynkin@nodes%
+ \advance\hmo by -1%
+ \ifodd\dynkin@rank%
+ \ifnum\dynkin@ply>1%
+ \dynkinPlaceRootHere*{0}{above}%
+ \dynkinPlaceRootRelativeTo*{2}{0}{southeastfold}{below}%
+ \dynkinPlaceRootRelativeTo*{1}{2}{southwestfold}{below}%
+ \dynkinEdge*{RightDownArc}{0}{2}%
+ \dynkinEdge*{RightUpArc}{1}{2}%
+ \else%
+ \dynkinPlaceRootHere*{0}{left}%
+ \dynkinPlaceRootRelativeTo*{2}{0}{southeast}{left}%
+ \dynkinPlaceRootRelativeTo*{1}{2}{southwest}{left}%
+ \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}%
+ \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@fold{1}{\the\hmo}%
+ \fi%
+ \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\hmo}{west}{below}%
+ \else%
+ \ifnum\hmo>1%
+ \dynkin@pipe{1}{\the\hmo}{east}{below}%
+ \fi%
+ \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\hmo}{east}{below}%
+ \fi%
+ \dynkinEdge*{DoubleEdge}{\the\dynkin@nodes}{\the\hmo}%
+ \fi%
+ \fi%
+ \fi%
+}%
-\newcommand*{\affineFdynkin}
-{
- \placeRoot{0}{0}{0}
- \Fdynkin
-}
+%% \twistedDdynkin
+%% Draws a twisted D series affine Dynkin diagram.
+\NewDocumentCommand\twistedDdynkin{}%
+{%
+ \IfStrEqCase{\dynkin@twisted@series}%
+ {%
+ {1}{\extendedDdynkin}%
+ {2}{\twistedDTwo}%
+ {3}%
+ {%
+ \ifnum\dynkin@rank=4%
+ \dynkinPlaceRootHere*{0}{below}%
+ \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}%
+ \dynkinPlaceRootRelativeTo*{2}{1}{east}{below}%
+ \dynkinEdge*{SingleEdge}{0}{1}%
+ \dynkinTripleEdge*{2}{1}%
+ \else%
+ \ClassError%
+ {Dynkin diagrams}%
+ {D3 series twisted diagrams must have rank 2 and cannot have rank \the\dynkin@rank}%
+ {}%
+ \fi%
+ }%
+ }%
+}%
-\newcommand*{\affineGdynkin}
-{
- \placeRoot{0}{3}{0}
- \Gdynkin
-}
+\NewDocumentCommand\twistedDTwo{}%
+{%
+ \ifnum\dynkin@rank<3%
+ \ClassError{Dynkin diagrams}{D2 series twisted diagrams cannot have rank \the\dynkin@rank}{}%
+ \fi%
+ \newcount\drmo%
+ \drmo=\the\dynkin@nodes%
+ \advance\drmo by -1%
+ \ifnum\dynkin@ply=1%
+ \dynkinPlaceRootHere*{0}{below}%
+ \dynkinPlaceRootRelativeTo*{1}{0}{east}{below}%
+ \else%
+ \ifnum\dynkin@rank=3%
+ \dynkinPlaceRootHere*{0}{right}%
+ \dynkinPlaceRootRelativeTo*{1}{0}{southwestfold}{left}%
+ \dynkinPlaceRootRelativeTo*{2}{1}{southeastfold}{right}%
+ \else%
+ \dynkinPlaceRootHere*{0}{above}%
+ \dynkinPlaceRootRelativeTo*{1}{0}{east}{above}%
+ \fi%
+ \fi%
+ \ifnum\dynkin@ply=2%
+ \dynkinEdge*{DoubleUpRightArc}{1}{0}%
+ \else
+ \dynkinEdge*{DoubleEdge}{1}{0}%
+ \fi%
+ \ifnum\dynkin@ply>1%
+ \ifnum\dynkin@rank>3%
+ \dynkin@fold{1}{\the\drmo}%
+ \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\drmo}{west}{below}%
+ \dynkinFold*{0}{\the\dynkin@nodes}%
+ \else%
+ \dynkinFold*{0}{2}%
+ \fi%
+ \else%
+ \ifnum\dynkin@rank>2%
+ \dynkin@pipe{1}{\the\drmo}{east}{below}%
+ \fi%
+ \dynkinPlaceRootRelativeTo*{\the\dynkin@nodes}{\the\drmo}{east}{below}%
+ \fi%
+ \ifnum\dynkin@ply=2%
+ \dynkinEdge*{DoubleDownRightArc}{\the\drmo}{\the\dynkin@nodes}%
+ \else
+ \dynkinEdge*{DoubleEdge}{\the\drmo}{\the\dynkin@nodes}%
+ \fi%
+}%
+
+
+%% \twistedEdynkin
+%% Draws a twisted E series affine Dynkin diagram.
+\NewDocumentCommand\twistedEdynkin{}%
+{%
+ \IfStrEqCase{\dynkin@twisted@series}%
+ {%
+ {0}{\Edynkin}%
+ {1}{\extendedEdynkin}%
+ {2}%
+ {%
+ \dynkinPlaceRootHere*{0}{below}%
+ \dynkin@pipe{0}{2}{east}{below}%
+ \dynkinPlaceRootRelativeTo*{3}{2}{east}{below}%
+ \dynkinPlaceRootRelativeTo*{4}{3}{east}{below}%
+ \dynkinEdge*{SingleEdge}{3}{4}%
+ \dynkinEdge*{DoubleEdge}{3}{2}%
+ }%
+ }%
+ [\dynkin@error@series]%
+}%
+
\endinput