I need to place mid-arrows on curved lines. The basic style works fine, but Latex and Stealth styles are not aligned properly. Is it possible to align arrow tip placement/direction with a curve? I also used a tikz block from TikZ: How to draw an arrow in the middle of the line? Below is my Latex code
\documentclass[12pt]{article} \usepackage[headings]{fullpage} \usepackage{tikz,tikz-cd} \usetikzlibrary{positioning} \usetikzlibrary{calc} \usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{decorations.markings} \tikzset{ % style to apply some styles to each segment of a path on each segment/.style={ decorate, decoration={ show path construction, moveto code={}, lineto code={ \path [#1] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast); }, curveto code={ \path [#1] (\tikzinputsegmentfirst) .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) .. (\tikzinputsegmentlast); }, closepath code={ \path [#1] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast); }, }, }, % style to add an arrow in the middle of a path mid arrow/.style={postaction={decorate,decoration={ markings, mark=at position .5 with {\arrow[#1]{>}} }}}, mid stealth arrow/.style={postaction={decorate,decoration={ markings, mark=at position .5 with {\arrow[#1]{Stealth[]}} }}}, mid latex arrow/.style={postaction={decorate,decoration={ markings, mark=at position .5 with {\arrow[#1]{Latex[]}} }}} } \begin{document} $$ \begin{tikzpicture}[scale=1,baseline=20,x=5pt,y=5pt] \coordinate (t2) at (-5,-5); \coordinate (t3) at (0,6); \coordinate (t4) at (-4.5,-1); \coordinate (t5) at (-2.2,3.5); \path [draw,thick,postaction={on each segment={mid arrow}}] (t4) to[out=130,in=170] (t5) (t4) to [out=10, in=-60] (t5) (t2) to [out=90, in=-100] (t4) (t5) to [out=60, in=-135] (t3); \end{tikzpicture} \qquad,\qquad \begin{tikzpicture}[scale=1,baseline=20,x=5pt,y=5pt] \coordinate (t2) at (-5,-5); \coordinate (t3) at (0,6); \coordinate (t4) at (-4.5,-1); \coordinate (t5) at (-2.2,3.5); \path [draw,thick,postaction={on each segment={mid stealth arrow}}] (t4) to[out=130,in=170] (t5) (t4) to [out=10, in=-60] (t5) (t2) to [out=90, in=-100] (t4) (t5) to [out=60, in=-135] (t3); \end{tikzpicture} \qquad,\qquad \begin{tikzpicture}[scale=1,baseline=20,x=5pt,y=5pt] \coordinate (t2) at (-5,-5); \coordinate (t3) at (0,6); \coordinate (t4) at (-4.5,-1); \coordinate (t5) at (-2.2,3.5); \path [draw,thick,postaction={on each segment={mid latex arrow}}] (t4) to[out=130,in=170] (t5) (t4) to [out=10, in=-60] (t5) (t2) to [out=90, in=-100] (t4) (t5) to [out=60, in=-135] (t3); \end{tikzpicture} $$ \end{document} This code gives the output below. As you see, tips in the second and third picture are not aligned properly.



\pgfarrowtotallengthand the transformation also with\arrowin amarkingdecoration. I've also adapted a solution for bended arrow tips in myext.arrows-pluslibrary of my TikZ-Ext package. You should be able to just replace\arrowfor\arrow*(only shifting) or\arrow**(also bending).