TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to draw an arrow tip to every node/coordinate in a path. But tikz draws them only to the first and last point. Is there an option for that purpose? Or have I to splitt the path into its single parts?

Here is an example:

enter image description here



    % What should I add to this:
    \draw  [|<->|] (0.4,2.4) to node[right] {$L$} ++(0,-1.5)
            to node[right] {$d$} ++(0,-1)
            to node[right] {$h$} ++(0,-1);
    % To get:
    \draw  [|<->|] (0.8,2.4) to node[right] {$L$} (0.8,0.9);
    \draw  [|<->|] (0.8,0.9) to node[right] {$d$} (0.8,-0.1);
    \draw  [|<->|] (0.8,-0.1) to node[right] {$h$} (0.8,-1.1);

share|improve this question
I am pretty sure you have to split the path in separate parts. You can of course use a for loop to draw the separate paths, minimizing the amount of repetitive code. – Roelof Spijker Nov 15 '11 at 17:36
up vote 7 down vote accepted

Your first command only creates one path and TikZ will apply the arrowheads to the end of that path. So you need to create separate paths for the individual bits. One relatively quick way to insert subpaths into a statement is the edge command:


             (0.4,2.4) edge node[right] {$L$} +(0,-1.5)
            ++(0,-1.5) edge node[right] {$d$} +(0,-1)
            ++(0,-1)   edge node[right] {$h$} +(0,-1);

The only drawback is that edge doesn't advance the current position, so that you have to repeat the coordinates. Also you need to use \path instead of \draw to avoid the drawing of an empty path with arrowheads.

share|improve this answer
Fair enough, I hoped there is a way with out repeating the values. But is at least better then to calculate the coordinates by hand. Thanks! – quinmars Nov 16 '11 at 11:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.