2

As shown in the pic, I already have three nodes and arrows connecting each other. The arrows form a loop and I want to add a circle with arrow on it(perhaps with text in it) inside the triangle area to indicate that a loop is formed. How can I do that?

The code I already have:

\documentclass[border={10pt 10pt 10pt 10pt}]{standalone}

\usepackage{tikz}
\usetikzlibrary{shapes, positioning, arrows.meta, decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}[
    node distance = 3.0cm and 1.5cm,
    sa/.style = {->, thick},
    sb/.style = {->, thick, dashed, red},
    sc/.style = {->, thick, dotted, blue},
    n/.style = {draw, inner sep = 3pt, align = center}]

  \node[n] (ta)
  {Content};
  \node[n, left = of ta] (tb)
  {Content};
  \node[n, below right = of tb] (tc)
  {Content};
  \draw[sa, sloped] (ta) to (tb);
  \draw[sb] (tb) to (tc);
  \draw[sc] (tc) to (ta);

\end{tikzpicture}
\end{document}

enter image description here

1
  • It is more simple using tikz-cd package.
    – Sebastiano
    Jan 4 at 13:11

1 Answer 1

1

As a quick hack you could manually add an arc and the text:

\documentclass[border={10pt 10pt 10pt 10pt}]{standalone}

\usepackage{tikz}
\usetikzlibrary{shapes, positioning, arrows.meta, decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}[
    node distance = 3.0cm and 1.5cm,
    sa/.style = {->, thick},
    sb/.style = {->, thick, dashed, red},
    sc/.style = {->, thick, dotted, blue},
    n/.style = {draw, inner sep = 3pt, align = center}]

  \node[n] (ta)
  {Content};
  \node[n, left = of ta] (tb)
  {Content};
  \node[n, below right = of tb] (tc)
  {Content};
  \draw[sa, sloped] (ta) to (tb);
  \draw[sb] (tb) to (tc);
  \draw[sc] (tc) to (ta);
  \draw[->,red] (-0.4,-1) arc [radius=0.5cm,start angle=0,end angle=340];
  \node at (-0.4-0.5,-1) {Text};
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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