I want to draw something like this:
This is my tikz code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{trees}
\tikzstyle{bag} = [text width=8em,
text centered]
\tikzstyle{bag_mod} = [text width=2em,
text centered]
\tikzstyle{bag_rect} = [draw=black,rectangle, black,text width=8em,
text centered]
\tikzstyle{bag1} = [draw=black,rectangle, black,text width=4em,
text centered]
\begin{document}
\begin{tikzpicture}[-,>=stealth',level/.style={sibling distance = 2.5cm/#1,
level distance = 1cm}]
\node [bag] {$||$}
child{node[bag] {$\&\&$}
child{node[bag] {$enabled$}}
child{node[bag] {$\&\&$}
child{node[bag1,left] {$tcas\_eq$}}
child{node[bag_rect,right] {$intent\_not\_known$}}
}
}
child{node[bag] (A) {$!$}
child{node[bag] (B) {$tcas\_eq$}}
}
;
%\node [draw=red, fit= (A) (B)] {};
\end{tikzpicture}
\end{document}
And this is the output:
I have two questions:
- How to put tick and cross mark as shown in the first figure?
- How to draw a rectangle containing two node? Example: I want to draw a single rectangle enclosing
!
andtcas_eq
(right side of the root). How to do that?