While TikZ has the option of bending arrows that appear at the tip of an edge (library bending
), and has the option of placing arrows in the middle of edges (library decorations
), I did not manage to combine the two. In the code below I use the library decorations
to place an arrow near the middle of a loop, but the arrow is oriented according to the tangent to the curve at the tip. Is it possible to bend the arrow or even just to rotate it by a hard-coded angle?
\pdfoutput=1
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\tikzset{->-/.style={decoration={markings, mark=at position #1 with {\arrow{stealth}}},postaction={decorate}}}
\node[draw,circle] (n) {$n$};
\draw [->-=.5] (n) to [distance=5ex, in=60, out=120, loop] ();
\end{tikzpicture}
\end{document}
Best Answer
At the time of decoration,
\pgfdecoratedangle
holds the path tangent angle to adjust the transformation. You can use that or any hard coded value offset with this amount