![Tikz:绘制路径上所有边上的箭头](https://linux22.com/image/433311/Tikz%EF%BC%9A%E7%BB%98%E5%88%B6%E8%B7%AF%E5%BE%84%E4%B8%8A%E6%89%80%E6%9C%89%E8%BE%B9%E4%B8%8A%E7%9A%84%E7%AE%AD%E5%A4%B4.png)
答案1
将您的\draw
行更改为:
\draw [->] (1) edge (2) (2) edge (3);
arrows.meta
您还可以像这样使用 tikz 库:
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[thick, every edge/.style = {draw, -to}]
\node (1) {1};
\node (2) [right of=1] {2};
\node (3) [right of=2] {3};
\path (1) edge (2)
(2) edge (3);
\end{tikzpicture}
\end{document}