eqtexsvg.py revision da9b71ab364276761c817a400ff656304d432f42
# -*- 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():
#os.system('cd ' + base_dir)
os.system('latex -output-directory=' + base_dir + ' -halt-on-error ' + latex_file + ' > ' + out_file)
try:
except OSError:
#os.system('cd ' + base_dir)
clean()
e = EQTEXSVG()
e.affect()