请问,我该如何更改节点名称?我想将节点从 a、b、c、d、e 更改为 v1、v2、v3、v4 和 v5(请注意,V 旁边的数字必须是下标)。这是我的 latex Tikz
\documentclass[10pt]{amsart}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}
\begin{document}
\begin{figure}[!htb]
\centering
\begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=2.5cm,
thick,main node/.style={circle,draw,font=\sffamily\Large\bfseries}]
\node[main node] (a) {a};
\node[main node] (b) [below left of=a] {b};
\node[main node] (c) [below right of=a] {c};
\node[main node] (d) [below of=b]{d};
\node[main node] (e) [below of=c]{e};
\path
(a) [-]edge [loop above] node {} (a)
[-]edge node[below] {} (b)
[->]edge node [below]{} (c)
[->] edge node [right]{} (d)
[-] edge node [right]{} (e)
(b) [-]edge [loop left] node {} (b)
[-]edge node[below] {} (a)
[->] edge node [right]{} (c)
[-] edge node [right]{} (d)
(c) [-]edge [loop right] node {} (c)
(d) [-]edge [loop below] node {} (d)
[->]edge node[below] {} (c)
[-]edge node[right] {} (b)
(e) [-]edge [loop below] node {} (e)
[-]edge node[below] {} (a)
[->]edge node[right] {} (b)
[->]edge node[below] {} (c)
[->] edge node [right]{} (d);
\end{tikzpicture}
\end{figure}
\end{document}
谢谢
答案1
只需改为\node[main node] (a) {a};
等等\node[main node] (a) {$v_1$};
即可。