答案1
一个例子pgf/tikZ只是为了给你灵感。
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.geometric}
\begin{document}
\begin{tikzpicture}[%
->,
shorten >=2pt,
>=stealth,
node distance=1cm,
noname/.style={%
ellipse,
minimum width=5em,
minimum height=3em,
draw
}
]
\node[noname] (1) {1};
\node[noname] (2) [below=of 1] {2};
\node[noname] (4) [node distance=1cm and 3mm,below left=of 2] {4};
\node[noname] (3) [left=of 4] {3};
\node[noname] (5) [below=of 4] {5};
\node[noname] (6) [node distance=2cm,right=of 5] {6};
\path (1) edge node {} (2)
(2) edge node {} (3)
(2) edge node {} (4)
(2) edge node {} (6)
(3) edge node {} (5)
(4) edge node {} (5)
(5) edge [bend right=20pt] node {} (2);
\end{tikzpicture}
\end{document}
更多示例请参见tikZ 示例库。
答案2
这个不需要 TeX。你只需要使用graphviz
它就可以画出这样的图形。当然,很多 LaTeX 包也喜欢pstricks
并且tikz
可以画出这样的图形,但我认为graphviz
还是用起来比较方便。
似乎是从主页将会graphviz
很有用。graphviz
我们不必告诉计算机节点在哪里,只需要边。
digraph finite_state_machine {
rankdir=LR;
size="8,5"
node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
node [shape = circle];
LR_0 -> LR_2 [ label = "SS(B)" ];
LR_0 -> LR_1 [ label = "SS(S)" ];
LR_1 -> LR_3 [ label = "S($end)" ];
LR_2 -> LR_6 [ label = "SS(b)" ];
LR_2 -> LR_5 [ label = "SS(a)" ];
LR_2 -> LR_4 [ label = "S(A)" ];
LR_5 -> LR_7 [ label = "S(b)" ];
LR_5 -> LR_5 [ label = "S(a)" ];
LR_6 -> LR_6 [ label = "S(b)" ];
LR_6 -> LR_5 [ label = "S(a)" ];
LR_7 -> LR_8 [ label = "S(b)" ];
LR_7 -> LR_5 [ label = "S(a)" ];
LR_8 -> LR_6 [ label = "S(b)" ];
LR_8 -> LR_5 [ label = "S(a)" ];
}
答案3
如果您想绘制图形(图论)图,那么 PSTricks 可以轻松做到这一点。
看到这个教程。