\documentclass{standalone}
\usepackage{amsmath}
\begin{document}
\begin{math}
    E=mc^2
\end{math}
\end{document}

