LaTeX

TikZ: Binary tree with Trianglular Subtree

알 수 없는 사용자 2009. 4. 18. 17:07
이거저거 컨닝해서 조합해 내었다.


:D

주의:

! Missing number, treated as zero.
<to be read again>
                   \pgfk@/pgf/isosceles triangle apex angle
l.26     };

이런 게 뜨면... \usetikzlibrary{shapes}를 다른 곳에 두어야 한다...
\usepackage 가 있는 곳에 함께 두길 바란다.


\begin{tikzpicture}[

every node/.style={c},

level distance=15mm,

level 1/.style={sibling distance=30mm},

level 2/.style={sibling distance=15mm},

level 3/.style={sibling distance=15mm}

]

\usetikzlibrary{shapes}

\tikzstyle{c} = [draw, shape=circle]

\tikzstyle{tr} = [draw,isosceles triangle, shape border rotate=90, anchor=north]

\node{$n_1$}[edge from parent]

child[child anchor=north] {

node[tr] {$T_1$}

}

child {

node {$n_2$}

child[child anchor=north] {

node[tr] {$T_2$}

}

child {

%node{$d_7$}

}

};

\end{tikzpicture}

이런 코드