0

Possible Duplicate:
Aligning trees built with tikzpicture

Is it possible to draw the following figure using TikZ? enter image description here

It know how to draw simple tree diagrams using TikZ. But this is little bit trickier for me.

Upul
  • 359
  • 7
    Yes it is possible. But, it would be best if you show what you have tried and detail exactly you are having an issue with. Ideal would be if you composed a fully compilable MWE that illustrates the specific problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Jun 24 '12 at 06:28
  • 1
    The xypic package also provides an easy way to draw these diagrams. – bodo Jun 24 '12 at 06:31
  • pb-diagram might work here – leo Jun 24 '12 at 07:26
  • Please don't downvote further than -1. For the TeX.SX community, it's already a good indicator that this is an ill-posed question. – percusse Jun 24 '12 at 12:33

1 Answers1

5

Too low-level, maybe:

\documentclass[a5paper]{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[x=1em,y=-2em]

\tikzstyle{every node}=[anchor=mid,inner sep=1pt]

\path (0,0) node{id} ++(1,0) node{*} ++(1,0) node{id};

\begin{scope}[xshift=1.5cm]
\path (0,0) node(F){$F$} ++(1,0) node{*} ++(1,0) node{id};
\path (F) ++ (0,1) node(id){id};
\draw (F) -- (id);
\end{scope}

\begin{scope}[xshift=3cm]
\path (0,0) node(T){$T$} ++(1,0) node{*} ++(1,0) node{id};
\path (T) ++ (0,1) node(F2){$F$} ++ (0,1) node(id2){id};
\draw (T) -- (F2) -- (id2);
\end{scope}

\begin{scope}[xshift=4.5cm]
\path (0,0) node(T2){$T$} ++(1,0) node{*} ++(1,0) node(F3){$F$};
\path (T2) ++ (0,1) node(F4){$F$} ++ (0,1) node(id3){id};
\draw (T2) -- (F4) -- (id3);
\path (F3) ++ (0,1) node(id4){id};
\draw (F3) -- (id4);
\end{scope}

\begin{scope}[xshift=6cm]
\path (1,0) node(T3){$T$} +(-1,1) node(T4){$T$} +(0,1) node(star){*} +(1,1) node(F5){$F$};
\path (T4) ++ (0,1) node(F6){$F$} ++ (0,1) node(id5){id};
\draw (T3) -- (T4) -- (F6) -- (id5);
\path (F5) ++ (0,1) node(id6){id};
\draw (T3) -- (F5) -- (id6);
\draw (T3) -- (star);
\end{scope}

\begin{scope}[xshift=7.5cm]
\path (1,0) node(E){$E$} ++(0,1) node(T5){$T$} +(-1,1) node(T6){$T$} +(0,1) node(star2){*} +(1,1) node(F7){$F$};
\path (T6) ++ (0,1) node(F8){$F$} ++ (0,1) node(id7){id};
\draw (T5) -- (T6) -- (F8) -- (id7);
\path (F7) ++ (0,1) node(id8){id};
\draw (T5) -- (F7) -- (id8);
\draw (E) -- (T5) -- (star2);
\end{scope}

\end{tikzpicture}

\end{document}

enter image description here

Jellby
  • 3,323