2

enter image description here

I want an optic like this, but without the crossed out branch.
What do I have to do?

\documentclass[border=10pt, tikz]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[sibling distance=10em,
  every node/.style = {shape=rectangle, rounded corners,
    draw, align=center,
    top color=white, bottom color=blue!20}]
\node {A0}
child { node {A1} 
        child{ node{A1.1}               
              child{ node{X} }               
              child[draw=none]{  }% no effect, problem here .............................
              }
        child{ node{A1.2} 
               }
        };
\end{tikzpicture}
\end{document}

1 Answer 1

3

The style of the edge is controlled by edge from parent, which is draw by default. Hence,

\documentclass[border=10pt, tikz]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[sibling distance=10em,
  every node/.style = {shape=rectangle, rounded corners,
    draw, align=center,
    top color=white, bottom color=blue!20}]
\node {A0}
child { node {A1} 
        child{ node{A1.1}               
              child{ node{X} }               
              child[draw=none, edge from parent/.style={}]{  }% no effect, problem here .............................
              }
        child{ node{A1.2} 
               }
        };
\end{tikzpicture}
\end{document}

omits the edge:

tree with missing edge

[I would use forest, but your kilometres may vary.]

You must log in to answer this question.

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