Microtex supports a headless mode (no GUI) on Linux that converts LaTeX code into SVG images.
Batch Mode
Use this mode to process multiple LaTeX snippets from a file. Snippets in the file should be separated by a line containing only the % character.
./LaTeX -headless \
-samples=res/SAMPLES.tex \
-outputdir=samples \
-prefix=sample_ \
-textsize=14 \
-foreground=black \
-background=white \
-padding=0 \
-maxwidth=720
Single Mode
Use this mode to convert a single string of LaTeX code into an SVG.
./LaTeX -headless \
"-input=\sqrt[3]{(x-y)^3}=x-y" \
-output=an_example.svg
Note: If both -outputdir and -input are specified, the -input option takes precedence.