actually it's an easy question, but I could find an answer with Google or the included search on StackExchange ;)

How do I add in the middle of the line a node with Tikz? I want somethink like this:


Normally I did it with an additional node at command. If I will resize the the arrow then I need to change the position of the node also.


Which is not the best way for big things. I try to find something in the manual and didn't find an answer yet.


Best regards.


2 Answers 2


You could also use the midway-option

    \draw [->] (0,0) -- (5,0) node [midway, below] {Text};
    \draw [->] (0,1) -- (5,1) node [near end, below] {Text};
    \draw [->] (0,2) -- (5,2) node [pos=0.62, below] {Text};
    \draw [->] (0,3) -- (5,3) node [pos=0.2, below] {Text};


result of the given example

See the tikz manual section 16.8 “Placing Nodes on a Line or Curve Explicitly”

  • 4
    Note that if you use curved arrows, this solution will not work (the text does not end up in the middle of the arrow). You will have to use something like \draw[->,>=stealth,out=90,in=90] (A) to node[midway,above] {Text} (B) ; Mar 14, 2015 at 8:21
  • Thanks a lot @AnthonyLabarre
    – gallais
    Jul 19, 2022 at 15:57

You can use the node construct without the at specifier:



  \draw[->] (0,0) --  node[label= below:text] {} (2,0);
  \draw[->] (0,1) --  node[label= below:text] {} (3,1);


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .