我正在尝试使用 tikz 绘制算法图。假设我们有节点 A、B 和 C,它们通过箭头连接,如下所示:A-->B-->C
如何绕着整个图绘制一个从 C 底部到 A 顶部的箭头。这是我用以下代码得到的:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\begin{document}
\tikzstyle{process} = [rectangle, text centered,
draw=black, fill=orange!30]
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{tikzpicture}[node distance=1cm]
\node (A) [process] {A};
\node (B) [process, below of=A] {B};
\node (C) [process, below of=B] {C};
\draw [arrow] (A) -- (B);
\draw [arrow] (B) -- (C);
\draw [arrow] (C) -- (A);
\end{tikzpicture}
\end{document}
这是我得到的:
这就是我想要得到的:
答案1
一种可能性
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\begin{document}
\tikzstyle{process} = [rectangle, text centered,
draw=black, fill=orange!30]
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{tikzpicture}[node distance=1cm]
\node (A) [process] {A};
\node (B) [process, below of=A] {B};
\node (C) [process, below of=B] {C};
\draw [arrow] (A) -- (B);
\draw [arrow] (B) -- (C);
\draw [arrow] (C) |-([shift={(3mm,-3mm)}]C.south east)-- ([shift={(3mm,3mm)}]A.north east)-|(A);
\end{tikzpicture}
\end{document}