带有节点和箭头的 Tikz 图片

带有节点和箭头的 Tikz 图片

我有这个代码:

\documentclass[11]{article} 

\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{color}
\usepackage{etoolbox}
\usepackage{pgfplots}
\usepackage{amssymb}
\usetikzlibrary{arrows, automata}
\usepackage{tikz}
\usepackage{changepage} 
\usepackage{anyfontsize}
\usetikzlibrary{fadings,patterns}
\renewcommand{\baselinestretch}{2.0}
\usepackage[margin=1.25in]{geometry}
\usepackage{pgfplots}
\begin{document}
    \newcount\tmpnum
\def\storedata#1#2{\tmpnum=0 \edef\tmp{\string#1}\storedataA#2\end}
\def\storedataA#1{\advance\tmpnum by1
   \ifx\end#1\else
      \expandafter\def\csname data:\tmp:\the\tmpnum\endcsname{#1}%
      \expandafter\storedataA\fi
}
\def\getdata[#1]#2{\csname data:\string#2:#1\endcsname}

\storedata\moredata{{A}{B}{C}{D}{E}{F}{G}{H}{I}{J}}
\begin{center}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1cm,
                semithick]
  \tikzstyle{every state}=[draw=none,text=black]

  \def \n {4}
  \def \radius {1.3cm}
  \def \margin {5} % margin in angles, depends on the radius

  \foreach \s in {1,...,\n}
  {
    \node[state] (\getdata[\s]\moredata) at ({360/\n * (\s - 1)+45}:\radius) {$\getdata[\s]\moredata$};
  }

  \path (A) edge              node {} (B);
  \path (B) edge              node {} (A);
  \path (A) edge              node {} (C);
  \path (D) edge              node {} (B);
  \path (D) edge              node {} (C);
  \path (C) edge              node {} (A);
  \path (C) edge              node {} (B);
  \path (C) edge              node {} (D);
  \path (C) edge[loop right]  node {} (C);
\end{tikzpicture}
\end{center}
\end{document}

我有几个问题:

  1. 做什么shorten >= 1 pt
  2. 做什么node distance
  3. 做什么margin
  4. 做什么stealth
  5. 当我编辑文档时,箭头尖端和字母之间似乎有很大空隙。我该如何更改?

相关内容