When I'm drawing a contour, I want to know how to make the arrow bend along the curve in decoration. Please see the example below.
Here is my MWE:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{calc}
\usetikzlibrary{bending} % Bend the arrow
\begin{document}
\begin{tikzpicture}[>={Stealth[length=0.3cm,bend]},
decoration={markings,
mark= at position .1 with {\arrow{>}},
mark= at position .32 with {\arrow{>}},
mark= at position .55 with {\arrow{>}},
mark= at position 0.88 with {\arrow{>}}, % <----
}
]
\def\gap{0.3}
\def\bigradius{3.4}
\def\littleradius{0.5}
\filldraw[postaction = {decorate}, thick ,fill=gray!40]
let
\n1 = {asin(\gap/2/\bigradius)},
\n2 = {asin(\gap/2/\littleradius)}
in
(0+\n1:\bigradius) node[above right]{$R$} arc (0+\n1:360-\n1:\bigradius) node[below left]{$C_{R}$} -- (0-\n2:\littleradius) arc (360-\n2:0+\n2:\littleradius) node[above right]{$\delta$} -- cycle;
\fill (-1.2,0) circle (3pt) ;
\draw[->] (-1.2,-1) node[right]{pole} --(-1.2,-0.15);
% axis
\draw[-Latex] (-1.5*\bigradius,0) -- (1.5*\bigradius,0) node[below]{$\Re$} ;
\draw[-Latex] (0,-1.2*\bigradius) -- (0,1.2*\bigradius) node[right]{$\Im$};
\end{tikzpicture}
\end{document}
As you can see, the fourth arrow on the contour looks strange. I want it to bend along the curve, that's why I want to use \usetikzlibrary{bending}.
But in the decoration, it seems that the arrow cannot be bent, and the bend command cannot take effect.
I would like to ask is there any solution?
One of my solutions:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{physics}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{calc}
\usetikzlibrary{bending}% Bend the arrow
\begin{document}
\begin{tikzpicture}[>={Stealth[length=0.3cm,bend]},
decoration={markings,
mark= at position .1 with {\arrow{>}},
mark= at position .32 with {\arrow{>}},
mark= at position .55 with {\arrow{>}},
% mark= at position 0.88 with {\arrow{>}},
}
]
\def\gap{0.3}
\def\bigradius{3.4}
\def\littleradius{0.5}
\filldraw[postaction = {decorate}, thick ,fill=gray!40]
let
\n1 = {asin(\gap/2/\bigradius)},
\n2 = {asin(\gap/2/\littleradius)}
in
(0+\n1:\bigradius) node[above right]{$R$} arc (0+\n1:360-\n1:\bigradius) node[below left]{$C_{R}$} -- (0-\n2:\littleradius) arc (360-\n2:0+\n2:\littleradius) node[above right]{$\delta$} -- cycle;
% draw an arrow alone
\draw[thick,->] (300:\littleradius) arc (300:130:\littleradius) node[above]{$C_{\delta}$};
\fill (-1.2,0) circle (3pt) ;
\draw[->] (-1.2,-1) node[right]{pole} --(-1.2,-0.15);
% axis
\draw[-Latex] (-1.5*\bigradius,0) -- (1.5*\bigradius,0) node[below]{$\Re$} ;
\draw[-Latex] (0,-1.2*\bigradius) -- (0,1.2*\bigradius) node[right]{$\Im$};
\end{tikzpicture}
\end{document}



mark= at position 0.875 with {\arrow[xshift=2pt]{>}}(see this answer to Position arrow decoration by center, not by tip). – dexteritas Feb 24 '23 at 14:08flex=1.1orflex'like\draw[thick,-{>[flex=1.1]}] (300:\littleradius) arc (300:130:\littleradius) node[above]{$C_{\delta}$}– AndréC Feb 26 '23 at 07:53bendoption can automatically fit the curve without requiring me to manually adjust. – Huanyu Shi Feb 27 '23 at 10:37