eqtexsvg.py revision a27cb2795cc2f021efb9a5e0a1f615b86b155139
# -*- coding: cp1252 -*-
"""
functions for converting LaTeX equation string into SVG path
This extension need, to work properly:
- pstoedit software: <http://www.pstoedit.net/pstoedit>
Copyright (C) 2006 Julien Vitard <julienvitard@gmail.com>
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
\\documentclass{article}
\\usepackage{amsmath}
\\usepackage{amssymb}
\\usepackage{amsfonts}
\\thispagestyle{empty}
\\begin{document}
""")
if in_tag != 'svg':
else:
for c in node_in.iterchildren():
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)+')')
return node_out
help="LaTeX formula")
def clean():
try:
except OSError:
# cd to base_dir is necessary, because pstoedit writes
# temporary files to cwd and needs write permissions
separator = ';'
separator = '&&'
# forward errors to stderr but skip pstoedit header
for line in err_stream:
clean()
e = EQTEXSVG()
e.affect()