8

I'm trying to create an arrow that goes out from the bottom of a word, and then loops around to the top of that same word. The point is to illustrate that the output of "Operations" also becomes the input of "Operations".

My initial attempt was simply to use edge[out = -90, in = 90], but that doesn't make the arrow loop around the word.

\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}

enter image description here


EDIT

In my real example, I have an arrow pointing down to "Operations" from a node above, and an arrow pointing down from "Operations" to a node below. The start and end of the loop arrow should ideally align with these two existing arrows.

\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}

enter image description here

2
  • Usually, even if you can produce a loop arrow by a single command it would be pretty irregular. I suggest one draw the arc by hand. Such as \draw[->](Operations.south)arc(...);
    – Symbol 1
    Commented Apr 27, 2017 at 13:10
  • @Symbol1 Thanks for the suggestion. It would be great if you could provide an answer with an illustration of what you suggest.
    – Sverre
    Commented Apr 27, 2017 at 13:30

2 Answers 2

4

Here a very grob solution by adding a third node \node at (1,0) (here) {}; and modifiyng the arrow's size by 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}

enter image description here

14

As I said in comment, with precise number

\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}



Another approach

\draw[->,shorten <=5pt,shorten >=5pt](Operations.center)arc(-180:180:1);



Third approach

\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}

5
  • So there is no way to tell it that it should end at Operations.north?
    – Sverre
    Commented Apr 27, 2017 at 14:43
  • If you are willing to break this path into two paths, yes. But either it is not going to be a perfect arc, or you need to do some tedious calculation to determine what 160 should be replaced by. (Wait... I have a good idea.)
    – Symbol 1
    Commented Apr 27, 2017 at 14:46
  • The reason I'm asking is because I have another straight arrow pointing down to Operations (for what provides the initial input to "Operations"), and I would like the arrow of this loop to end up exactly where that straight arrow ends up.
    – Sverre
    Commented Apr 27, 2017 at 14:50
  • Please see the updated question.
    – Sverre
    Commented Apr 27, 2017 at 14:59
  • 1
    @Sverre I add the third approach
    – Symbol 1
    Commented Apr 27, 2017 at 15:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .