如何在 tikzpicture 中将一个节点的标签包装成两个?

如何在 tikzpicture 中将一个节点的标签包装成两个?

我想要得到下图,但不知何故我无法划分节点的标签。我使用的代码如下。

数字

代码:

\documentclass[12pt,english]{article}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{patterns, arrows.meta}
\usetikzlibrary{patterns,math}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{arrows,decorations.markings}

\begin{document}

\begin{figure}[H]
\begin{center}
\begin{tikzpicture}
\begin{scope}[every node/.style={draw, circle, inner sep=0pt, minimum size=.15cm, fill=black}]
  \node[label=right:\text{$v_{1}=i=w_{1}$}] (A) at (0,0) {};
  \node[label=above:\text{$a=w_{2}$}]       (B) at (1.5,1.5) {};
  \node[label=above:\text{$w_{3}$}]         (C) at (3,1.5) {};
  \node[label=below:\text{$k=w_{p}$}]       (D) at (1.5,-1.5) {};
  \node[label=below:\text{$w_{p-1}$}]       (E) at (3,-1.5) {};
  \node[label=above:\text{$b=v_{2}$}]       (F) at (-1.5,1.5) {};
  \node[label=above:\text{$v_{3}$}]         (G) at (-3,1.5) {};
  \node[label=below:\text{$j=v_{m}$}]       (H) at (-1.5,-1.5) {};
  \node[label=below:\text{$v_{m-1}$}]       (I) at (-3,-1.5) {};
  \node[fill,circle,inner sep=0pt,minimum size=1pt] (J) at (4.5,-0.5) {};
  \node[fill,circle,inner sep=0pt,minimum size=1pt] (K) at (-4.5,-0.5) {};
  \node[fill,circle,inner sep=0pt,minimum size=1pt] (L) at (-4.5,0.5) {};
  \node[fill,circle,inner sep=0pt,minimum size=1pt] (M) at (4.5,0.5) {};

  \draw[-{Stealth[scale=2]}] (A) edge[bend left=15] (B);
  \draw[-{Stealth[scale=2]}] (B) edge[bend left=15] (C);
  \draw[-{Stealth[scale=2]}] (C) edge[bend left=15] (M);
  \draw[-{Stealth[scale=2]}] (E) edge[bend left=15] (D);
  \draw[-{Stealth[scale=2]}] (D) edge[bend left=15] (A);
  \draw[-{Stealth[scale=2]}] (J) edge[bend left=15] (E);

  \draw[-{Stealth[scale=2]}] (A) edge[bend right=15] (F);
  \draw[-{Stealth[scale=2]}] (F) edge[bend right=15] (G);
  \draw[-{Stealth[scale=2]}] (G) edge[bend right=15] (L);
  \draw[-{Stealth[scale=2]}] (I) edge[bend right=15] (H);
  \draw[-{Stealth[scale=2]}] (H) edge[bend right=15] (A);
  \draw[-{Stealth[scale=2]}] (K) edge[bend right=15] (I);

  \draw[thick,dashed] (-4.5,0.5) edge[bend right=15] (-4.5,-0.5);
  \draw[thick,dashed] (4.5,0.5) edge[bend left=15] (4.5,-0.5);
\end{scope}

\end{tikzpicture}
\end{center}
\end{figure}

\end{document}

相关内容