假设我想在图表中使用“裤子”形状,就像这样
生成的 TikZ 代码是
\begin{tikzpicture}
\begin{pgfonlayer}{nodelayer}
\node [style=pants] (0) at (0, 0) {};
\node [style=none] (1) at (1, -1) {};
\node [style=none] (2) at (-1, -1) {};
\node [style=none] (3) at (0, 1) {};
\end{pgfonlayer}
\begin{pgfonlayer}{edgelayer}
\draw [bend right, looseness=4.75] (2.center) to (0);
\draw [bend right, looseness=0.75] (1.center) to (0);
\draw (3.center) to (0);
\end{pgfonlayer}
\end{tikzpicture}
我的裤子节点只是用 调用的style=pants
。这行不通,所以我需要在我的文档的前言部分中加入这种风格。TikZiT 提供了前言,但当我单击 时Insert node styles to selected preamble
,没有出现裤子样式的声明。
但是,裤子样式有一个生成的定义,即 tikzpicture:
\begin{tikzpicture}
\path [use as bounding box] (-2,-2) rectangle (2,2);
\begin{pgfonlayer}{nodelayer}
\node [style=none] (0) at (-0.5, 1) {};
\node [style=none] (1) at (0.5, 1) {};
\node [style=none] (2) at (-1.5, -1) {};
\node [style=none] (3) at (-0.5, -1) {};
\node [style=none] (4) at (0.5, -1) {};
\node [style=none] (5) at (1.5, -1) {};
\end{pgfonlayer}
\begin{pgfonlayer}{edgelayer}
\draw [in=90, out=90, looseness=1.75] (4.center) to (3.center);
\draw [in=-90, out=90, looseness=0.75] (2.center) to (0.center);
\draw [in=-90, out=-90, looseness=0.75] (0.center) to (1.center);
\draw [in=90, out=-90, looseness=0.75] (1.center) to (5.center);
\draw [in=90, out=90, looseness=0.75] (5.center) to (4.center);
\draw [in=90, out=90, looseness=0.75] (3.center) to (2.center);
\end{pgfonlayer}
\end{tikzpicture}
理想情况下,我希望 TikZiT 本身能够将正确的定义插入到我的序言中。但这似乎没有发生。我还能使用可用的代码来使此图表正常工作吗?