\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\draw [-{Straight Barb[left]}] (0,0)--(0.5,0);
\end{tikzpicture}
\end{document}
答案1
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\draw [-{Straight Barb[left]}] (0,0)--node[above]{text}(0.5,0);
\draw [-{Straight Barb[left]}] (3,0)--(3.5,0) node[midway,above]{text};
\end{tikzpicture}
\end{document}
恕我直言,没有圆形节点(但可能存在误解)。
至于你的在下面评论: 你有
\tikzstyle{every node}=[draw,shape=circle];
指示绘制每个节点并使其具有圆形。(此语法已弃用,应改用\tikzset{node={draw,shape=circle}}
。)为了不绘制圆形并具有标准矩形形状的节点,请使用
\draw [-{Latex[left]}]
(v0.10)--(v4.170)node[midway,above,shape=rectangle,draw=none]{text};
完整 MWE:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[nodes={draw,shape=circle}]
\node (v0) at (0:0) {c};
\node (v1) at (90:2) {...};
\node (v2) at (90+1*90:2) {1};
\node (v3) at (90+2*90:2) {o};
\node (v4) at (90+3*90:2) {$n$};
\draw [-{Latex[left]}] (v0.100) -- (v1.260);
\draw [-{Latex[left]}] (v1.280)--(v0.80);
\draw [-{Latex[left]}] (v2.10)-- (v0.170);
\draw [-{Latex[left]}]
(v0.10)--(v4.170)node[midway,above,shape=rectangle,draw=none]{text};
\end{tikzpicture}
\end{document}