I am trying to add a caption for a graphic generated using tikZ. I tried to use
Code: Select all
\begin{figure}
% HERE the commands to generate my graphic
\caption{My caption}
\end{figure}
Where is my mistake? (I use Windows 7, WinEdt 6.0 and MiKTeX 2.8)
Code: Select all
\documentclass{minimal}
\usepackage[a4paper,margin=1cm,landscape]{geometry}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{caption}
\usetikzlibrary{positioning,shadows,arrows}
\begin{document}
\vspace*{\fill}
%\begin{figure}
\begin{tikzpicture}[
level 1/.style={sibling distance=90mm},
level 2/.style={sibling distance=28mm},
level 3/.style={sibling distance=20mm},
level 4/.style={sibling distance=12mm},
fact/.style={rectangle, draw=none, rounded corners=1mm, fill=blue, drop shadow,
text centered, anchor=north, text=white},
state/.style={circle, draw=none, fill=orange, circular drop shadow,
text centered, anchor=north, text=white},
leaf/.style={circle, draw=none, fill=red, circular drop shadow,
text centered, anchor=north, text=white},
level distance=3cm
]
\node {$\mathcal{O}$}
%
%
%
child { node {i }
%
child{ node {j}
%
%
child{ node {x(i,j)}
edge from parent
node[left] {$\alpha_j(i)$}
}
child{node { $\mathcal{O}$}
%
edge from parent
node[midway] {$\overline{\alpha}_j(i)$}
}
edge from parent
node[left] {$\alpha_i(j)$}
}
%
%
%
child{ node {k}
child{ node {x(i,k)}
edge from parent
node[] {$\alpha_k(i)$}
}
%
child{node { $\mathcal{O}$ }
%
edge from parent
node[] {$\overline\alpha_k(i)$}
%
}
edge from parent
node {$\alpha_i(k)$}
}
%
child{ node {j}
child{ node {k}
child{ node {x(ijk)}
edge from parent
node[left] {$\alpha_k(jk)$}
}
child{node { $\mathcal{O}$}
edge from parent
node {$\overline\alpha_k(jk)$}
}
edge from parent
node {$\alpha_j(jk)$}
}
child{node { k}
child{ node {$\mathcal{O}$}
edge from parent
node [] {{$\alpha_k'(jk)$}}
}
child{node { $\mathcal{O}$}
edge from parent
node [right] {$\overline\alpha'_k(jk)$}
}
edge from parent
node [right] {$\overline\alpha_j(jk)$}
}
edge from parent
node [right] {$\alpha_i(j,k)$}
}
edge from parent
node [left]{$\mu_{(i)}$}
}
%
%
%
%
%
%Here J
child { node {j }
%
child{ node {i}
%
%
child{ node {x(i,j)}
edge from parent
node[left] {$\alpha_i(j)$}
}
child{node { $\mathcal{O}$}
%
edge from parent
node[midway] {$\overline{\alpha}_i(j)$}
}
edge from parent
node[left] {$\alpha_j(i)$}
}
%
%
%
child{ node {k}
child{ node {x(j,k)}
edge from parent
node[] {$\alpha_k(j)$}
}
%
child{node { $\mathcal{O}$ }
%
edge from parent
node[] {$\overline\alpha_k(j)$}
%
}
edge from parent
node {$\alpha_j(k)$}
}
%
child{ node {i}
child{ node {k}
child{ node {x(ijk)}
edge from parent
node[left] {$\alpha_k(ik)$}
}
child{node { $\mathcal{O}$}
edge from parent
node {$\overline\alpha_k(ik)$}
}
edge from parent
node {$\alpha_j(ik)$}
}
child{node { k}
child{ node {$\mathcal{O}$}
edge from parent
node [] {{$\alpha_k'(ik)$}}
%edge from parent
%node[right] {YYYa31}
}
child{node { $\mathcal{O}$}
edge from parent
node [right] {$\overline\alpha'_k(ik)$}
}
edge from parent
node [right] {$\overline\alpha_j(ik)$}
}
edge from parent
node [right] {$\alpha_j(i,k)$}
}
edge from parent
node [right]{$\mu_{(j)}$}
}
%
%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
%
%
%
%
child { node {k }
%
child{ node {i}
%
%
child{ node {x(i,k)}
edge from parent
node[left] {$\alpha_i(k)$}
}
child{node { $\mathcal{O}$}
%
edge from parent
node[midway] {$\overline{\alpha}_i(k)$}
}
edge from parent
node[left] {$\alpha_k(i)$}
}
%
%
%
child{ node {j}
child{ node {x(j,k)}
edge from parent
node[] {$\alpha_j(k)$}
}
%
child{node { $\mathcal{O}$ }
%
edge from parent
node[] {$\overline\alpha_j(k)$}
%
}
edge from parent
node {$\alpha_k(j)$}
}
%
child{ node {i}
child{ node {j}
child{ node {x(ijk)}
edge from parent
node[left] {$\alpha_i(jk)$}
}
child{node { $\mathcal{O}$}
edge from parent
node {$\overline\alpha_i(jk)$}
}
edge from parent
node {$\alpha_i(ij)$}
}
child{node { j}
child{ node {$\mathcal{O}$}
edge from parent
node [] {{$\alpha_j'(ij)$}}
%edge from parent
%node[right] {YYYa31}
}
child{node { $\mathcal{O}$}
edge from parent
node [right] {$\overline\alpha'_j(ij)$}
}
edge from parent
node [right] {$\overline\alpha_i(ij)$}
}
edge from parent
node [right] {$\alpha_i(i,j)$}
}
edge from parent
node [right]{$\mu_{(k)}$}
}
;
\end{tikzpicture}
\vspace*{\fill}
%%\caption{A caption: THIS IS A SMALL TRY}
%%\end{figure}
\end{document}
Leo