Links

Content Skeleton

This Page

Previous topic

dvisvgm : A DVI to SVG converter

Next topic

pstoedit

svgkitΒΆ

from subprocess import call
import sys, re

if not len(sys.argv) == 2:
    print "usage: tex2svg input_file.tex"
    exit(1)

tex_name = sys.argv[1]
svg_name = tex_name[:-4] + ".svg"
ps_name = tex_name[:-4] + ".ps"
dvi_name = tex_name[:-4] + ".dvi"

if call(["latex", tex_name]): exit(1)
if call(["dvips", "-q", "-f", "-e", "0", "-E", "-D", "10000", "-x", "1000", "-o", ps_name, dvi_name]): exit(1)
if call(["pstoedit", "-f", "plot-svg", "-dt", "-ssp", ps_name,  svg_name]): exit(1)