In principal this is possible by the
standalone class. With the
convert option (and some others) the output will directly be converted to PNG (with transparency). For the requirements (e.g.
ImageMagick) and more details please refer to the class manual.
- Code: Select all • Open in writeLaTeX
\documentclass[
11pt,
border=1pt,
convert
]{standalone}
\begin{document}
$E=mc^2$
\end{document}
The output is attached.
But perhaps something like
MathJax is more suitable for HTML.