I installed MikTex on Windows 10 (basic-miktex-2.9.6520-x64.exe) and ghostscript (gs922w64.exe), and I am using "latex2svg.py." I'm wanting to generate SVG files from Python. This is the Python script I'm running:
from latex2svg import latex2svg
eqs = r"""
e^{i\pi}+1=0
\int_{-\infty}^{\infty}{\frac{e^{\frac{-x^2}{2}}}{\sqrt{2\pi}}}\ dx=1
""".split("\n")[1:-1]
for ii, eq in enumerate(eqs):
myeq = r'\( ' + eq + r' \)'
out = latex2svg(myeq)
with open('out{}.svg'.format(str(ii + 1).zfill(2)), 'w') as f:
f.write(out['svg'])
When I run it, I get:
PS Z:\latex2svg test> python .\testsvg.py
Warning: libgs not found
PS Z:\latex2svg test>
And these are the files it outputs (notice how they look incomplete):
If I install tex-live on Ubuntu and run the exact same Python code, I get these results:
These look correct. So for some reason they aren't rendering correctly on Windows (the file sizes on Windows are also smaller). Why? What do I need to do to get the equations to render correctly on Windows? I'm using Python 3.8. I have the problem even after restarting the computer.