Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there a way to set the location of the position of edge label when using the tikz graph package?

I attempted to look for samples of this being done in the manual, but was unable to find any (closest I got was in 19.6 where it shows how to set some options for individual edges).

Is this possible?

Edit: more specifically, I am looking for a way to put the label above or below the edge.

Edit to add MWE:

\usegdlibrary{layered, trees}
     {1->[edge label=hello]2};

share|improve this question
@cmhughes This is using the graph library which has a different syntax. –  soandos Feb 9 at 20:37
I suppose he thought that was what you meant by 'graph package'. Do you mean tkz-graph? (Which is not TikZ, but a package built on TikZ.) Edit: Could you create a minimal example perhaps? –  Torbjørn T. Feb 9 at 21:29
@TorbjørnT. no, I mean the graphs library, (used with \begin{graph}...\end{graph} in a tikzpicture environment). –  soandos Feb 9 at 21:32
A minimal example would have made this clearer. I haven't installed PGF 3.0 yet, so I can't really help I'm afraid, but there's probably someone else who can. –  Torbjørn T. Feb 9 at 21:55

Your Answer


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

Browse other questions tagged or ask your own question.