# -*- 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>
2010-04-04: Added support for custom packages
Christoph Schmidt-Hieber <christsc@gmx.de>
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
"""
header = ""
return header
\\documentclass{article}
\\usepackage{amsmath}
\\usepackage{amssymb}
\\usepackage{amsfonts}
""")
\\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")
help="Additional packages")
def clean():
return
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()
if __name__ == '__main__':
e = EQTEXSVG()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99