在绘制晶体图时,我遇到了麻烦:! \cmdGR@vertex@L 定义中的参数编号非法

在绘制晶体图时,我遇到了麻烦:! \cmdGR@vertex@L 定义中的参数编号非法

我正在尝试导出晶体的 sagemath 图表(参见以下命令)。

sage: crystals.Tableaux("A3", shape=[2,1]).latex_file("/tmp/a3-21.tex") 

我得到如下输出:

\documentclass{article}
        \usepackage[x11names, rgb]{xcolor}
        \usepackage[utf8]{inputenc}
        \usepackage{tikz}
        \usetikzlibrary{snakes,arrows,shapes}
        \usepackage{amsmath}
        \usepackage[active,tightpage]{preview}
        \newenvironment{bla}{}{}
        \PreviewEnvironment{bla}
        \usepackage{tkz-graph}

        \begin{document}
        \begin{bla}\begin{tikzpicture}
        \useasboundingbox (0,0) rectangle (5.0cm,5.0cm); 
        \definecolor{cv0}{rgb}{0.0,0.0,0.0}
        \definecolor{cfv0}{rgb}{1.0,1.0,1.0}
        \definecolor{clv0}{rgb}{0.0,0.0,0.0}
        \definecolor{cv1}{rgb}{0.0,0.0,0.0}
        \definecolor{cfv1}{rgb}{1.0,1.0,1.0}
        \definecolor{clv1}{rgb}{0.0,0.0,0.0}
        \definecolor{cv2}{rgb}{0.0,0.0,0.0}
        \definecolor{cfv2}{rgb}{1.0,1.0,1.0}
        \definecolor{clv2}{rgb}{0.0,0.0,0.0}
        \definecolor{cv3}{rgb}{0.0,0.0,0.0}
        \definecolor{cfv3}{rgb}{1.0,1.0,1.0}
        \definecolor{clv3}{rgb}{0.0,0.0,0.0}
        \definecolor{cv4}{rgb}{0.0,0.0,0.0}
        \definecolor{cfv4}{rgb}{1.0,1.0,1.0}
        \definecolor{clv4}{rgb}{0.0,0.0,0.0}
        \definecolor{cv5}{rgb}{0.0,0.0,0.0}
        \definecolor{cfv5}{rgb}{1.0,1.0,1.0}
        \definecolor{clv5}{rgb}{0.0,0.0,0.0}
        \definecolor{cv6}{rgb}{0.0,0.0,0.0}
        \definecolor{cfv6}{rgb}{1.0,1.0,1.0}
        \definecolor{clv6}{rgb}{0.0,0.0,0.0}
        \definecolor{cv7}{rgb}{0.0,0.0,0.0}
        \definecolor{cfv7}{rgb}{1.0,1.0,1.0}
        \definecolor{clv7}{rgb}{0.0,0.0,0.0}
        \definecolor{cv0v1}{rgb}{0.0,0.0,0.0}
        \definecolor{cv0v3}{rgb}{0.0,0.0,0.0}
        \definecolor{cv1v2}{rgb}{0.0,0.0,0.0}
        \definecolor{cv2v5}{rgb}{0.0,0.0,0.0}
        \definecolor{cv3v4}{rgb}{0.0,0.0,0.0}
        \definecolor{cv4v6}{rgb}{0.0,0.0,0.0} 
        \definecolor{cv5v7}{rgb}{0.0,0.0,0.0}
        \definecolor{cv6v7}{rgb}{0.0,0.0,0.0}
        \Vertex[style=    
       {minimumsize=1.0cm,draw=cv0,fill=cfv0,text=clv0,shape=circle},
       LabelOut=false,L=\hbox{${\def\lr#1{\multicolumn{1}
       {|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}} 
       \raisebox{-.6ex}{$\begin{array}[b]{*{2}c}\cline{1-2}
       \lr{1}&\lr{1}\\\cline{1-2}\lr{2}\\\cline{1-1}\end{array}$}}$},
       x=1.792cm,y=0.0cm]{v0}
       \Vertex[style={minimum
       size=1.0cm,draw=cv1,fill=cfv1,text=clv1,shape=circle},
       LabelOut=false,L=\hbox{${\def\lr#1{\multicolumn{1}
       {|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}
       \raisebox{-.6ex}{$\begin{array}[b]{*{2}c}\cline{1-2}
       \lr{1}&\lr{2}\\\cline{1-2}\lr{2}\\\cline{1-1}\end{array}$}}$},
       x=0.1894cm,y=1.2054cm]{v1}
       \Vertex[style={minimum size=1.0cm,draw=cv2,fill=cfv2,text=clv2,shape=circle},
       LabelOut=false,L=\hbox{${\def\lr#1{\multicolumn{1}
       {|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}
       \raisebox{-.6ex}{$\begin{array}[b]{*{2}c}\cline{1-2}
       \lr{1}&\lr{3}\\\cline{1-2}\lr{2}\\\cline{1-1}\end{array}$}}$},
       x=0.0cm,y=3.1607cm]{v2}
       \Vertex[style={minimum size=1.0cm,draw=cv3,fill=cfv3,text=clv3,shape=circle},
       LabelOut=false, 
       L=\hbox{${\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}
       \raisebox{-.6ex}{$\begin{array}[b]{*{2}c}\cline{1-2}
       \lr{1}&\lr{1}\\\cline{1-2}\lr{3}\\\cline{1-1}
       \end{array}$}}$},
       x=3.7751cm,y=0.2859cm]{v3}
       \Vertex[style={minimum size=1.0cm,draw=cv4,fill=cfv4,text=clv4,shape=circle},
       LabelOut=false,L=\hbox{${\def\lr#1{\multicolumn{1}
       {|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}} 
       \raisebox{-.6ex}{$\begin{array}[b]{*{2}c}\cline{1-2}
       \lr{1}&\lr{2}\\\cline{1-2}\lr{3}\\\cline{1-1}
       \end{array}$}}$},
       x=5.0cm,y=1.8124cm]{v4}
       \Vertex[style={minimum size=1.0cm,draw=cv5,fill=cfv5,text=clv5,shape=circle},
       LabelOut=false,L=\hbox{${\def\lr#1{\multicolumn{1}
       {|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}
       \raisebox{-.6ex}{$\begin{array}[b]{*{2}c}\cline{1-2}
       \lr{1}&\lr{3}\\\cline{1-2}\lr{3}\\\cline{1-1}
       \end{array}$}}$},x=1.1305cm,y=4.7124cm]{v5}
       \Vertex[style={minimum size=1.0cm,draw=cv6,fill=cfv6,text=clv6,shape=circle},
       LabelOut=false,L=\hbox{${\def\lr#1{\multicolumn{1}
       {|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}
       \raisebox{-.6ex}{$\begin{array}[b]{*{2}c}\cline{1-2}
       \lr{2}&\lr{2}\\\cline{1-2}\lr{3}\\\cline{1-1}
       \end{array}$}}$},
       x=4.6653cm,y=3.7847cm]{v6}
       \Vertex[style={minimum size=1.0cm,draw=cv7,fill=cfv7,text=clv7,shape=circle},
       LabelOut=false,L=\hbox{${\def\lr#1{\multicolumn{1}
       {|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}
       \raisebox{-.6ex}{$\begin{array}[b]{*{2}c}\cline{1-2}
       \lr{2}&\lr{3}\\\cline{1-2}\lr{3}\\\cline{1-1}
       \end{array}$}}$},
       x=3.114cm,y=5.0cm]{v7}
       %
       \Edge[lw=0.1cm,style={post, bend right,color=cv0v1,},](v0)(v1)
       \Edge[lw=0.1cm,style={post, bend right,color=cv0v3,},](v0)(v3)
       \Edge[lw=0.1cm,style={post, bend right,color=cv1v2,},](v1)(v2)
       \Edge[lw=0.1cm,style={post, bend right,color=cv2v5,},](v2)(v5)
       \Edge[lw=0.1cm,style={post, bend right,color=cv3v4,},](v3)(v4)
       \Edge[lw=0.1cm,style={post, bend right,color=cv4v6,},](v4)(v6)
       \Edge[lw=0.1cm,style={post, bend right,color=cv5v7,},](v5)(v7)
       \Edge[lw=0.1cm,style={post, bend right,color=cv6v7,},](v6)(v7)
       %
       \end{tikzpicture}\end{bla}
       \end{document} 

但有一个错误,就像

ABD: EveryShipout initializing macros
Preview: Fontsize 10pt
! Illegal parameter number in definition of \cmdGR@vertex@L.
<to be read again>
                    1
1.55 }$},x=1.792cm,y-0.0cm}{v0} 
?

事实上,当我第一次尝试编译时,控制台显示:

Undefined control sequence 
1.50 \Vertex

因此在搜索此评论后,我添加了代码

\usepackage{tkz-graph}.

但它仍然不起作用。我怎样才能获得晶体图?

答案1

一种可能性是安装可选的 Sagemath 包dot2tex,可以在 shell 提示符下执行以下操作: sage -i dot2tex 此包安装在 SageMathCloud(最近更名为 CoCalc)上。另请参阅最近的讨论这里- 简而言之,这是一个 Sagemath 错误。

相关内容