有人能帮忙用 tikz 编写代码吗?我想要更自动化、更简单的东西。
\begin{tikzpicture}[->,>=latex]
\node (a) {$1$};
\node (b) [below right of=a] {$2$};
\node (c) [below of=b] {$3$};
\node (d) [left of=c] {4};
\node (e) [above of=d] {5};
\draw (a) -- (b);
\draw (b) -- (c);
\draw (c) -- (d);
\draw (d) -- (e);
\draw (e) -- (a);
\end{tikzpicture}
答案1
欢迎来到 TeX.SX!也许可以看看 Ti钾Z 的graphs
图书馆:
\documentclass[border=1mm, tikz]{standalone}
\usetikzlibrary{graphs.standard}
\begin{document}
\begin{tikzpicture}
\graph {
subgraph C_n [n=5, clockwise, ->];
};
\end{tikzpicture}
\end{document}
当然,用“latex
箭头”画出来也是可以的:
\documentclass[border=1mm, tikz]{standalone}
\usetikzlibrary{graphs.standard}
\begin{document}
\begin{tikzpicture}[>=latex]
\graph {
subgraph C_n [n=5, clockwise, ->];
};
\end{tikzpicture}
\end{document}