[Tex/LaTex] Tikz: Arrowheads in the center

arrowspositioningtikz-pgf

For arrows I have gone through options like ->, ->>, <-, <<- but havent found one for making the arrowhead appear in the center of the line of the curve (something like ->-) How do I do it in TIkz?

Best Answer

Perhaps you prefer this kind of syntax :

\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}
\tikzset{->-/.style={decoration={
  markings,
  mark=at position #1 with {\arrow{>}}},postaction={decorate}}}

\begin{tikzpicture}
 \draw[->-=.5] (0,0) to [bend left] (2,4);
 \draw[->-=.8] (0,0) to [bend right] (2,4);
\end{tikzpicture}

\end{document} 

If you only want an arrow in the middle of a path, you can write

\tikzset{->-/.style={decoration={
  markings,
  mark=at position .5 with {\arrow{>}}},postaction={decorate}}}

And the you just need to write :

 \draw[->-] (0,0) to [bend left] (2,4);

enter image description here

Related Question