Question: I have lots of curves, each of which I would like to decorate with an arrow precisely at the centre. Here is a simple attempt to do this with TikZ:

```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\tikz{\draw [decoration={markings,
    mark=at position 0.5 with \arrow{>}},
    postaction=decorate] (0,0) to (0.3,0);}
\end{document}

```

This produces the following result:

![enter image description here](https://i.stack.imgur.com/ouuVu.jpg)

This looks bad: the arrow *tip* is at the half-way point, but I want the *midpoint* of the arrow at the half-way point.

**How can I do this automatically with TikZ?**

Of course in this example I could manually configure the position of the arrow. But that is not good enough, because I have arrows on lots of curves of different lengths. Also, in the real document I use the `arrows.meta` functionality of TikZ 3.0 to configure my arrows, so I would like the solution to be consistent with this.

The arrow length is a fixed quantity, so it would be ideal if there was a simple way to automatically 'nudge' the decoration by half the arrow length.

Answer: 
Something to start with... I am not able to measure the width of the arrow head. If you can, you might add that to my little macro:

```
% arara: pdflatex

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\newcommand*{\halfway}{0.5*\pgfdecoratedpathlength+.5*3pt}

\begin{document}
    \tikz{\draw [decoration={markings,
        mark=at position \halfway with \arrow{>}},
        postaction=decorate] (0,0) to [out=30, in=150] (1,0);}
\end{document}

```
The older solutions here have the problem that they either don't work on curves (the tip has to be adjusted tangentially, not along the curve) or that they don't work anymore because the code of the underlying library has changed. Fortunately, the library has become more flexible now by processing the option `xshift` of the `\arrow` command before positioning the arrow tip along the path.

By using `\arrow[xshift=2pt]` instead of `\arrow` the reference point of the arrow moves from the tip to the center of the arrow. `2pt` is half of the length of the arrow that is defined as `Latex[length=4pt]`.

```
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings,arrows.meta}
\tikzset
  {midarrow/.style={decoration={markings,mark=at position 0.5 with
     {\arrow[xshift=2pt]{Latex[length=4pt,#1]}}},postaction={decorate}}
  }
\begin{document}
\begin{tikzpicture}
  \draw[midarrow] (0,0) -- (1,0);
  \draw[midarrow={open,fill=white}] (0,0) arc(-90:180:10pt);
\end{tikzpicture}
\end{document}

```

[![enter image description here](https://i.stack.imgur.com/ImOLE.png)](https://i.stack.imgur.com/ImOLE.png)