diff -ur inkscape-0.46.orig/share/extensions/eqtexsvg.py inkscape-0.46/share/extensions/eqtexsvg.py --- inkscape-0.46.orig/share/extensions/eqtexsvg.py 2008-03-11 05:21:07.000000000 +0100 +++ inkscape-0.46/share/extensions/eqtexsvg.py 2008-04-12 22:49:11.000000000 +0200 @@ -49,16 +49,18 @@ doc_sizeW = max(doc_width,doc_height) def clone_and_rewrite(self, node_in): - if node_in.tag != 'svg': - node_out = inkex.etree.Element(inkex.addNS(node_in.tag,'svg')) + in_tag = node_in.tag.rsplit('}',1)[-1] + if in_tag != 'svg': + node_out = inkex.etree.Element(inkex.addNS(in_tag,'svg')) for name in node_in.attrib: node_out.set(name, node_in.attrib[name]) else: node_out = inkex.etree.Element(inkex.addNS('g','svg')) for c in node_in.iterchildren(): - if c.tag in ('g', 'path', 'polyline', 'polygon'): + c_tag = c.tag.rsplit('}',1)[-1] + if c_tag in ('g', 'path', 'polyline', 'polygon'): child = clone_and_rewrite(self, c) - if c.tag == 'g': + if c_tag == 'g': child.set('transform','matrix('+str(doc_sizeH/700.)+',0,0,'+str(-doc_sizeH/700.)+','+str(-doc_sizeH*0.25)+','+str(doc_sizeW*0.75)+')') node_out.append(child) @@ -86,6 +88,7 @@ dvi_file = os.path.join(base_dir, "eq.dvi") svg_file = os.path.join(base_dir, "eq.svg") out_file = os.path.join(base_dir, "eq.out") + err_file = os.path.join(base_dir, "eq.err") def clean(): os.remove(latex_file) @@ -95,6 +98,8 @@ os.remove(dvi_file) os.remove(svg_file) os.remove(out_file) + if os.path.exists(err_file): + os.remove(err_file) os.rmdir(base_dir) create_equation_tex(latex_file, self.options.formula) @@ -110,9 +115,17 @@ os.system('dvips -q -f -E -D 600 -y 5000 -o ' + ps_file + ' ' + dvi_file) #os.system('cd ' + base_dir) - os.system('pstoedit -f plot-svg -dt -ssp ' + ps_file + ' ' + svg_file + '> ' + out_file) + os.system('pstoedit -f plot-svg -dt -ssp ' + ps_file + ' ' + svg_file + '> ' + out_file + ' 2> ' + err_file) svg_open(self, svg_file) + # forward errors to stderr but skip pstoedit header + if os.path.exists(err_file): + err_stream = open(err_file, 'r') + for line in err_stream: + if not line.startswith('pstoedit: version'): + sys.stderr.write(line) + err_stream.close() + clean() e = EQTEXSVG()