\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{matrix}

\begin{document}
\begin{preview}
  \begin{tikzpicture}[auto]
    $body$
  \end{tikzpicture}
\end{preview}
\end{document}
