\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usetikzlibrary{calc}
\usetikzlibrary{arrows.meta}
\usepackage{xcolor}
\usepackage{tgpagella}
\definecolor{red}{RGB}{235, 77, 75}
\definecolor{blue}{RGB}{9, 123, 227}

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