我试图创建一个箭头,从单词底部向外延伸,然后绕到同一个单词的顶部。重点是说明“Operations”的输出也成为“Operations”的输入。
我最初的尝试只是使用edge[out = -90, in = 90]
,但这并不能使箭头围绕单词循环。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node at (0,0) (Operations) {Operations};
\draw [->] (Operations) edge[out = -90, in = 90] (Operations);
\end{tikzpicture}
\end{document}
编辑
在我的实际示例中,我有一个箭头从上方的节点指向“操作”,还有一个箭头从“操作”指向下方的节点。循环箭头的起点和终点最好与这两个现有箭头对齐。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node at (0,3) (Input) {Input};
\node at (0,1.5) (Operations) {Operations};
\node at (0,0) (Output) {Output};
\draw [->] (Input) -- (Operations);
\draw [->] (Operations.center) arc (-180:180:1);
\draw [->] (Operations) -- (Output);
\end{tikzpicture}
\end{document}
答案1
这里有一个非常棘手的解决方案,即添加第三个节点\node at (1,0) (here) {};
并修改箭头的大小looseness
。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node at (0,0) (Operations) {Operations};
\node at (1,0) (here) {};
\draw [->] (Operations) to[out=-80, in=-90,looseness=2] (here) to[out=90,in=80,looseness=2] (Operations);
\end{tikzpicture}
\end{document}
答案2
正如我在评论中所说,精确的数字
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node at (0,0) (Operations) {Operations};
\draw [->] (Operations.south)arc(-160:160:1);
\end{tikzpicture}
\end{document}
另一种方法
\draw[->,shorten <=5pt,shorten >=5pt](Operations.center)arc(-180:180:1);
第三种方法
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node at (0,3) (Input) {Input};
\node at (0,1.5) (Operations) {Operations};
\node at (0,0) (Output) {Output};
\draw [->] (Input) -- (Operations);
\draw [->] (Operations) -- (Output);
\draw[->](Operations.south)arc(-180:0:1)coordinate(X)
(Operations.north)+(2,0)--(X)
(Operations.north)+(2,0)arc(0:180:1);
\end{tikzpicture}
\end{document}