Draw an arrow in the middle of a TikZ line or curve.
Standard options like -> place arrowheads at the ends of a path. To put an arrowhead in the middle or at any specific position, use the TikZ decorations.markings library or place a node along the path.
The short answer: load \usetikzlibrary{decorations.markings} and define a custom style using mark=at position 0.5 with {\arrow{>}} combined with postaction={decorate}.
The markings library method
The most flexible way to place arrowheads on straight lines or complex curves is the decorations.markings library.
| Method | Best for | Works on curves | Requires library |
|---|---|---|---|
| decorations.markings | General paths and curves | Yes | decorations.markings |
| Node placement (pos=0.5) |
Creating a reusable style
If you need middle arrows often, define a shortcut in your preamble with \tikzset. This lets you write \draw[->-=.5] (0,0) to [bend left] (2,4) without repeating the full decoration syntax every time.
Step-by-step implementation
Questions
How do I reverse the direction of the middle arrow?
Use \arrowreversed{>} instead of \arrow{>}, or change the path endpoints so the drawing direction flows the other way.
Can I put multiple arrows along the same line?
Yes. You can declare multiple mark keys inside the decoration block at different positions, such as mark=at position 0.25 with {\arrow{>}} and mark=at position 0.75 with {\arrow{>}}.
Why does my arrowhead point sideways on a curved path?
Make sure you include the sloped option inside your node or ensure your decoration handles path tangents correctly. The standard markings library handles path rotation automatically for arrowheads.
Try your own paper in Texeno.
Start free, upload a project as a .zip and press Recompile. Upgrade when you need longer compiles.
Start writing