I copied the solution from this link to a file try.tex under Emacs:
\documentclass{article}
\usepackage{pst-tree}
\begin{document}
Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem ipsum. Lorem
ipsum.
\begin{figure}
\centering
\begin{pspicture}(5,-5)
\psgrid
\pstree{\Tcircle{ }}
{
\pstree{\Tr{ }}{\Tfan}
\pstree{\Tr{ }}{\Tfan}
}
\end{pspicture}
\caption{}
\end{figure}
Lorem ipsum. Lorem ipsum. Lorem ipsum.
\end{document}
Then I try to compile it with C-c C-c which is LaTeX, but it returns to me ERROR: Undefined control sequence. at the place of \pstree. Could anyone tell me how to compile and preview this picture from Emacs?