当有数学时,dot2tex 不起作用

当有数学时,dot2tex 不起作用

我无法重现 dot2tex 文档中的示例。我的安装有问题吗?有错误吗?我该如何解决这个问题?

这直接来自 dot2tex 文档。文件保存为 try.dot :

digraph G {
node [shape=rectangle];
a_1 [texlbl="$x^2+\frac{\sin y}{y^2+\cos \beta}+\gamma_3$"];
a_1 -> a_2 [label=" ", texlbl="$x_1+x_3^2+z+c+v~~$"];
a_2 -> a_1;
}

这是我生成 tex 文件的命令:

dot2tex -tmath --autosize try.dot > example.tex

这是生成的 tex 文件

\documentclass{article}
\usepackage[x11names, rgb]{xcolor}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{snakes,arrows,shapes}
\usepackage{amsmath}
%
%

%

%

\begin{document}
\pagestyle{empty}
%
%
%

\enlargethispage{100cm}
% Start of code
% \begin{tikzpicture}[anchor=mid,>=latex',line join=bevel,]
\begin{tikzpicture}[>=latex',line join=bevel,]
  \pgfsetlinewidth{1bp}
%%
\pgfsetcolor{black}
  % Edge: a_2 -> a_1
  \draw [->] (89.221bp,33.97bp) .. controls (96.296bp,39.297bp) and (103.02bp,45.998bp)  .. (106.93bp,54bp) .. controls (111.62bp,63.582bp) and (111.62bp,68.418bp)  .. (106.93bp,78bp) .. controls (105.02bp,81.901bp) and (102.45bp,85.493bp)  .. (92.026bp,95.826bp);
  % Edge: a_1 -> a_2
  \draw [->] (21.273bp,95.975bp) .. controls (14.327bp,91.202bp) and (8.0377bp,85.272bp)  .. (3.9328bp,78bp) .. controls (-1.3109bp,68.711bp) and (-1.3109bp,63.289bp)  .. (3.9328bp,54bp) .. controls (8.9103bp,45.183bp) and (17.1bp,38.337bp)  .. (34.884bp,28.295bp);
  \definecolor{strokecol}{rgb}{0.0,0.0,0.0};
  \pgfsetstrokecolor{strokecol}
  \draw (55.433bp,66bp) node {$x_1+x_3^2+z+c+v~~$};
  % Node: a_2
\begin{scope}
  \definecolor{strokecol}{rgb}{0.0,0.0,0.0};
  \pgfsetstrokecolor{strokecol}
  \draw (61.933bp,18bp) node {$a_2$};
\end{scope}
  % Node: a_1
\begin{scope}
  \definecolor{strokecol}{rgb}{0.0,0.0,0.0};
  \pgfsetstrokecolor{strokecol}
  \draw (61.933bp,114bp) node {$x^2+\frac{\sin y}{y^2+\cos \beta}+\gamma_3$};
\end{scope}
%
\end{tikzpicture}
% End of code

%
\end{document}
%

这是我编译 tex 文件后绘制的图。请注意,边还在,但缺少节点。

上一页

相关内容