In Arrowhead angle in tikz a solution for the bad angling of arrowheads is given using the bending library.
My problem: in the "keyhole circuit" drawing
produced with the code
\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings,bending}
\begin{document}
\begin{tikzpicture}
[decoration={markings,mark=at position 1.2cm with {\arrow[line width=1pt]{stealth}},mark=at position 8cm with {\arrow[line width=1pt]{stealth}},mark=at position 18.7cm with {\arrow[line width=1pt]{stealth}},mark=at position 20.65cm with {\arrow[line width=1pt]{stealth[flex=1]}}}]
\path[draw,line width=0.8pt,postaction=decorate] (10:0.5) -- +(2,0) arc (2:358:2.5) -- +(-2,0) arc (-9.5:-350.5:0.5);
\end{tikzpicture}
\end{document}
the flex=1 is ignored. Why? Where the flex=... is required? I've tried several positions. Almost all give errors.


flexwith an effect you need to usearrows.metaand thenStealth[flex=1]. You do not loadarrows.metaso the option does not even get parsed. The answer you are referring to is unfortunately not too accurate either. – Sep 29 '19 at 14:51arrows.metaand changed[flex=1]toStealth[flex=1]. The effect is a greater arrowhead and no angling correction. Do you want the new code and drawing? – Martín-Blas Pérez Pinilla Sep 29 '19 at 14:59decorations.markingsin the usual way, the only thing that is known at the point you draw the arrow is the tangent and nothing beyond. In particular, the curvature is set to zero. So you need to make the arrow aware of the shape of the curve around this location, which is what the answer below does. – Sep 29 '19 at 15:03