diff options
author | Karl Berry <karl@freefriends.org> | 2020-03-16 21:04:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-03-16 21:04:53 +0000 |
commit | ce5ba87a3ebf3e7be87b156c6dd498c7b8e5bfbf (patch) | |
tree | 2148eeffd0f09fb98c9688ce2def361e8f649d25 /Master/texmf-dist/tex/latex | |
parent | 09f3fa991f1d6ead1a1fc5b0ec70570e22e61a64 (diff) |
dynkin-diagrams (16mar20)
git-svn-id: svn://tug.org/texlive/trunk@54360 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty | 218 |
1 files changed, 172 insertions, 46 deletions
diff --git a/Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty b/Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty index f408a1658e8..19b873760de 100644 --- a/Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty +++ b/Master/texmf-dist/tex/latex/dynkin-diagrams/dynkin-diagrams.sty @@ -1,6 +1,6 @@ % The Dynkin Diagrams package. % -% Version 3.14159265358 +% Version 3.141592653589 % % This package draws Dynkin diagrams in LaTeX % documents, using the TikZ package. @@ -13,7 +13,7 @@ % Released under the LaTeX Project Public License v1.3c or later, see % http://www.latex-project.org/lppl.txt \NeedsTeXFormat{LaTeX2e}[1994/06/01] -\ProvidesPackage{dynkin-diagrams}[2020/02/18 Dynkin diagrams] +\ProvidesPackage{dynkin-diagrams}[2020/03/16 Dynkin diagrams] \RequirePackage{etex} \RequirePackage{tikz} \RequirePackage{xstring} @@ -48,6 +48,7 @@ \newif\ifold@dynkin@is@upsidedown \newif\ifold@dynkin@is@extended \newif\ifold@dynkin@label@the@roots +\newif\ifold@dynkin@label@star@the@roots \NewDocumentCommand\dynkin@save{}% {% \xdef\dynkin@ply@value{1}% @@ -56,6 +57,7 @@ \ifdynkin@is@extended\global\old@dynkin@is@extendedtrue\else\global\old@dynkin@is@extendedfalse\fi% {\global\dynkin@is@twistedfalse}% \ifdynkin@label@the@roots\global\old@dynkin@label@the@rootstrue\else\global\old@dynkin@label@the@rootsfalse\fi% +\ifdynkin@label@star@the@roots\global\old@dynkin@label@star@the@rootstrue\else\global\old@dynkin@label@star@the@rootsfalse\fi% }% \NewDocumentCommand\dynkin@restore{}% {% @@ -63,6 +65,7 @@ \ifold@dynkin@is@upsidedown\global\dynkin@is@upsidedowntrue\else\global\dynkin@is@upsidedownfalse\fi% \ifold@dynkin@is@extended\global\dynkin@is@extendedtrue\else\global\dynkin@is@extendedfalse\fi% \ifold@dynkin@label@the@roots\global\dynkin@label@the@rootstrue\else\global\dynkin@label@the@rootsfalse\fi% +\ifold@dynkin@label@star@the@roots\global\dynkin@label@star@the@rootstrue\else\global\dynkin@label@star@the@rootsfalse\fi% }% \NewDocumentEnvironment{dynkinDiagram}{O{}mO{0}m}% {% @@ -168,11 +171,36 @@ \dynkin@ordering% }% +\newcount\dynkinOverrideRoot +\NewDocumentCommand\dynkin@override@label@directions{}% +{% + \dynkinOverrideRoot1\relax% + \ifdynkin@is@extended% + \global\dynkinOverrideRoot0\relax% + \fi% + \foreach \overRide in \dynkin@label@directions@override + {% + \IfStrEq{\overRide}{}% + {% + }% + {% + \dynkinPutLabelInDirection{\the\dynkinOverrideRoot}{\overRide}% + }% + \global\advance\dynkinOverrideRoot by 1\relax% + }% +}% + \NewDocumentCommand\dynkinRefreshRoots{}% {% \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% + \dynkin@override@label@directions{}% \dynkin@draw@all@roots{}% - \ifdynkin@label@the@roots\dynkinPrintLabels{}\fi% + \ifdynkin@label@the@roots% + \dynkinPrintLabels{}% + \fi% + \ifdynkin@label@star@the@roots% + \dynkinPrintLabelsStar{}% + \fi% }% @@ -298,34 +326,6 @@ \stepcounter{dynkinRootNo}% \dynkinLabelRoot*{\arabic{dynkinRootNo}}{#1}% }% -\NewDocumentCommand\dynkinLabelRoots{sm}% -{% - \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% - \setcounter{dynkinRootNo}{0}% - \ifdynkin@is@extended% - \setcounter{dynkinRootNo}{-1}% - \else% - \ifdynkin@is@twisted% - \setcounter{dynkinRootNo}{-1}% - \else% - \setcounter{dynkinRootNo}{0}% - \fi% - \fi% - \edef\dynkin@labelies{#2}% - \IfBooleanTF{#1}% - {% - \foreach \i in \dynkin@labelies% - {% - \@dynkinLabelThisRootStar{\i}% - }% - }% - {% - \foreach \i in \dynkin@labelies% - {% - \@dynkinLabelThisRoot{\i}% - }% - }% -}% \NewDocumentCommand\dynkinBrace{somm}%[text]{start}{end} {% @@ -366,13 +366,84 @@ {\IfValueT{#2}{\(#2\)}};% }% +\NewDocumentCommand\dynkin@involution{somD<>{}om}% +{% + \begin{pgfonlayer}{Dynkin behind}% + \IfValueTF{#2}% + {% + \IfValueTF{#5}% + {% + \draw[/Dynkin diagram/involution,#2] + (root #3) to + node[% + midway, + /Dynkin diagram/text style, + #4] + {$#5$} + (root #6);% + }% + {% + \draw[/Dynkin diagram/involution,#2] + (root #3) to (root #6);% + }% + }% + {% + \IfBooleanTF{#1} + {% + \IfValueTF{#5}% + {% + \draw[/Dynkin diagram/involution] + (root #3) + to + node[% + midway, + /Dynkin diagram/text style, + #4] + {$#5$} + (root #6);% + }% + {% + \draw[/Dynkin diagram/involution] + (root #3) to[bend left] (root #6);% + }% + }% + {% + \IfValueTF{#5}% + {% + \draw[/Dynkin diagram/involution] + (root #3) + to[bend right] + node[% + midway, + /Dynkin diagram/text style, + #4] + {$#5$} + (root #6);% + }% + {% + \draw[/Dynkin diagram/involution] + (root #3) to[bend right] (root #6);% + }% + }% + }% + \end{pgfonlayer}% +}% + +\DeclareListParser*{\forDynkinSemicolonsvlist}{;} +\def\dynkin@involution@input@splitter#1{\dynkin@involution#1} +\NewDocumentCommand\dynkin@draw@involutions{}% +{% + \expandafter\forDynkinSemicolonsvlist% + \expandafter\dynkin@involution@input@splitter% + \expandafter{\dynkin@involution@list}% +}% %% \dynkinPrintLabels %% Prints the labels on the Dynkin diagram,in the given ordering. Uses the default labels if ``label'' is set without a list of ``labels'' being set. \newcommand{\dynkinPrintLabels}% {% \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% - \IfStrEq{\dynkin@label@list\dynkin@label@list@star}{}{% + \IfStrEq{\dynkin@label@list}{}{% \foreach \i in {1,...,\the\dynkin@nodes}{\dynkinLabelRoot{\i}{\i}}% \ifdynkin@is@extended% \dynkinLabelRoot{0}{0}% @@ -406,11 +477,47 @@ \setcounter{dynkinRootNo}{0}% \fi% \fi% + }% +}% + +% Print alternate location labels. +\newcommand{\dynkinPrintLabelsStar}% +{% + \ifdefined\filldraw\else\dynkin@error@not@in@tikz\fi% + \IfStrEq{\dynkin@label@list@star}{}{% + \foreach \i in {1,...,\the\dynkin@nodes}{\dynkinLabelRoot*{\i}{\i}}% + \ifdynkin@is@extended% + \dynkinLabelRoot*{0}{0}% + \else% + \ifdynkin@is@twisted% + \dynkinLabelRoot*{0}{0}% + \fi% + \fi% + }% + {% + \ifdynkin@is@extended% + \setcounter{dynkinRootNo}{-1}% + \else% + \ifdynkin@is@twisted% + \setcounter{dynkinRootNo}{-1}% + \else% + \setcounter{dynkinRootNo}{0}% + \fi% + \fi% \edef\XXX{\dynkin@label@list@star}% \foreach \i in \XXX% {% \@dynkinLabelThisRootStar{\i}% }% + \ifdynkin@is@extended% + \setcounter{dynkinRootNo}{-1}% + \else% + \ifdynkin@is@twisted% + \setcounter{dynkinRootNo}{-1}% + \else% + \setcounter{dynkinRootNo}{0}% + \fi% + \fi% }% }% @@ -1837,16 +1944,12 @@ \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: @@ -1863,6 +1966,8 @@ % \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 +\def\dynkin@involution@list{} +% List of involutions among roots to draw. \def\dynkin@label@list{} % List of labels for the roots. \def\dynkin@label@list@star{} @@ -1886,6 +1991,8 @@ % 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@label@star@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 @@ -1906,6 +2013,8 @@ % 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. +\def\dynkin@label@directions@override{} +% List of directions in which to draw the labels attached to the roots, as overridden by the user. \def\dynkin@label@directions@star{} % List of directions in which to draw the labels attached to the roots, for alternate labels. \def\dynkin@current@location{(0,0)} @@ -2055,6 +2164,9 @@ }, indefinite-edge/.forward to=/Dynkin diagram/indefinite edge/.style, indefiniteedge/.forward to=/Dynkin diagram/indefinite edge/.style, + involution/.style={latex-latex,black}, + involutions/.default = {}, + involutions/.store in = \dynkin@involution@list, Kac arrows/.is if = dynkin@Kac@arrows, Kac-arrows/.forward to = /Dynkin diagram/Kac arrows, Kacarrows/.forward to = /Dynkin diagram/Kac arrows, @@ -2092,6 +2204,9 @@ }, label/.is if = dynkin@label@the@roots, label = false, + label*/.is if = dynkin@label@star@the@roots, + label*/.default=false, + label*=false, label depth/.style={ /tikz/every label/.append style={ text depth={depth("#1"} @@ -2101,20 +2216,24 @@ label depth, label-depth/.forward to = /Dynkin diagram/label depth, labeldepth/.forward to = /Dynkin diagram/label depth, + label directions/.default = {}, + label directions/.store in = \dynkin@label@directions@override, + label* directions/.default = {}, + label* directions/.store in = \dynkin@label@star@directions@override, label height/.style={/tikz/every label/.append style={text height={height("#1"}}}, label height/.default=b, label height, label-height/.forward to = /Dynkin diagram/label height, labelheight/.forward to = /Dynkin diagram/label height, - labels/.default = {}, - labels*/.default = {}, label macro/.code = {\regurgitate{#1}}, label-macro/.forward to=/Dynkin diagram/label macro, labelmacro/.forward to=/Dynkin diagram/label macro, label macro*/.code = {\regurgitate{#1}}, label-macro*/.forward to=/Dynkin diagram/label macro*, labelmacro*/.forward to=/Dynkin diagram/label macro*, + labels/.default = {}, labels/.store in = \dynkin@label@list, + labels*/.default = {}, labels*/.store in = \dynkin@label@list@star, make indefinite edge/.code={\dynkin@set@edge@indefinite@pair{#1}}, make-indefinite-edge/.forward to=/Dynkin diagram/make indefinite edge, @@ -2142,7 +2261,7 @@ rootradius/.forward to=/Dynkin diagram/root radius, root radius=.05cm, text style/.style={#1}, - text style/.default={scale=.7}, + text style/.default={black,scale=.7}, text-style/.forward to=text style/.style, textstyle/.forward to=text style/.style, twisted/.is if = dynkin@is@twisted, @@ -2268,9 +2387,9 @@ \ProcessPgfPackageOptions{/Dynkin diagram}\relax \newcount\dynkin@drpo% \newcount\dynkin@where% -%% \dynkin@put@direction{<r>}{<d>}{<d*>} +%% \dynkinPutLabelInDirection{<r>}{<d>} %% Assigns to \dynkin@label@directions or \dynkin@label@directions@star the direction that the label of root <r> (in default ordering) should sit from the root node location, <d>=0,1,2,3,4,5,6,7 to indicate direction in multiples of 45 degrees -\NewDocumentCommand\dynkin@put@direction{smm}% +\NewDocumentCommand\dynkinPutLabelInDirection{smm}% {% \dynkin@drpo=\the\dynkin@nodes\relax% \advance\dynkin@drpo by 1\relax% @@ -2587,12 +2706,18 @@ \ifdynkin@is@upsidedown% \tikzset{yscale=-1}% \fi% - \IfStrEq{\dynkin@label@list\dynkin@label@list@star}{}% + \IfStrEq{\dynkin@label@list}{}% {% }% {% \global\dynkin@label@the@rootstrue% }% + \IfStrEq{\dynkin@label@list@star}{}% + {% + }% + {% + \global\dynkin@label@star@the@rootstrue% + }% \xdef\dynkin@user@series{#2}% \xdef\dynkin@twisted@series{#3}% \xdef\dynkin@user@string{#4}% @@ -2653,6 +2778,7 @@ \csname\dynkin@series dynkin\endcsname% \fi% \fi% + \dynkin@draw@involutions% \dynkinRefreshRoots% }% % @@ -3724,8 +3850,8 @@ \global\dynkin@Root@Number=#2\relax% }% \node (\dynkin@root@name \the\dynkin@Root@Number) at (Dynkin current) {};% - \dynkin@put@direction{\the\dynkin@Root@Number}{#3}% - \dynkin@put@direction*{\the\dynkin@Root@Number}{#4}% + \dynkinPutLabelInDirection{\the\dynkin@Root@Number}{#3}% + \dynkinPutLabelInDirection*{\the\dynkin@Root@Number}{#4}% }% \newif\ifdynkin@hex@grid \dynkin@hex@gridtrue @@ -4052,7 +4178,7 @@ \foreach \bpipe in {\the\pipefpo,...,\the\pipe@end}% {% \dynkinPlaceRootRelativeTo*{\bpipe}{\the\pipebmo}{#3}{#4}{#5}% - \dynkinEdge*{SingleEdge}{\bpipe}{\the\pipebmo}% + \dynkinEdge*{SingleEdge}{\the\pipebmo}{\bpipe}% \global\advance\pipebmo by 1\relax% }% \fi% @@ -4876,7 +5002,7 @@ \dynkinNorth% \dynkinPlaceRootHere*{0}{below}{above}% \dynkinEdge*{SingleEdge}{0}{1}% - \dynkinEdge*{SingleEdge}{0}{\the\dynkin@rank}% + \dynkinEdge*{SingleEdge}{\the\dynkin@rank}{0}% \fi% \dynkinRootMark*{}{0}% \fi% |