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

The Tikz manual gives "edge from parent" construct.
But it is peculiar (it changes all the edges in subtree and some nodes).
How to color and thicken exactly one edge?

share|improve this question
up vote 11 down vote accepted

As Mikael mentioned in his answer to your previous question, I don't think this is actually a bug, but simply how TikZ works. So the solution to the problem is to change a specific branch, and then change it back on its daughters. As you ask in your comment, you can define two styles for plain and emphasized edges respectively, to save you some typing:

\begin{tikzpicture} [
    level 1/.style={sibling distance = 2cm, level distance = 1cm},
    level 2/.style={sibling distance = 1cm},
    level 3/.style={sibling distance = 1cm},
    every node/.style={circle, draw=black,thin, minimum size = 0.5cm},
    emph/.style={edge from parent/.style={red,very thick,draw}},
    norm/.style={edge from parent/.style={black,thin,draw}}

    child[emph] { node {}
      child[norm] { node {} }
      child[norm] { node {}
        child[emph] { node {} }
        child { node {} }
    child { node {}
      child { node {} }
      child { node {} }
    child { node {} }

share|improve this answer
Can I save a whole style to a variable and use it like that: child[SAVED_STYLE] ? – Łukasz Lew Jan 18 '11 at 19:59
Yes. I've updated my answer to reflect that. – Alan Munn Jan 18 '11 at 20:13
Can I replace: "emph/.style={edge from parent/.style={red,very thick,draw}}" with "emph/.style={red,very thick,draw}" ? – Łukasz Lew Jan 18 '11 at 22:07
@Lukasz Why not try it and experiment? (You can't, though.) – Alan Munn Jan 18 '11 at 22:25
I did, it worked, that's why I asked :) – Łukasz Lew Jan 20 '11 at 4:10

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.