I need to draw an arrow midway in a line.

        \draw(1,1) -- (1,17);
        \draw (12,12)--(1,1);

        \coordinate (start) at (6,6);
        \coordinate (reflection) at (1,11);
        \coordinate (end) at (7,17);
        \draw [red] (start)--(reflection)--(end); 
        \node (b) at (0.7,11) {b};
        \node (c) at (7,17.2) {c};
        \node (a) at (6.1,5.9) {a};

I need an arrow both between node (a) and (b) and between (b) and (c), and both arrows should be midway.
I tried something like

\draw [red] (start) edge [->] (reflection) (reflection) edge [->] (end)(end); 

but in this way the arrows are at the end of the segment.

Current: current


1 Answer 1


I guess that you looking for the following:

enter image description here

For arrows heads in the middle of line is used decorations.markings TikZ library:


->-/.style = {decoration={markings,
              mark=between positions 0.25 and 0.75 step 0.5 with {\arrow{Triangle[scale=1.2]}}},
              semithick, draw=red
\draw (1,1) |- (7,17)--(12,12) -- (1,1);

\draw [->-] (6,6)   coordinate[label=-45:a] (a) -- 
            (1,11)  coordinate[label=180:b] (b) -- 
            (7,17)  coordinate[label=c]     (c);

As you can see, I simplify drawing black lines. However, you can stick with your way of its drawing.

  • thank you that what i was looking for
    – john
    Commented May 31, 2023 at 16:13

You must log in to answer this question.

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