HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/inkscape/extensions/eqtexsvg.pyo
�
��Yc@s�dZddlZddlZddlZddlZddlZd�Zdd�Zd�Z	dej
fd��YZed	kr�e�Z
e
j�ndS(
s%
eqtexsvg.py
functions for converting LaTeX equation string into SVG path
This extension need, to work properly:
    - a TeX/LaTeX distribution (MiKTeX ...)
    - 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>

This program is free software; you can redistribute it and/or modify
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

i����NcCsD|jdd�jd�}d}x|D]}|d|7}q(W|S(Ns ts,s\usepackage{%s}
(treplacetsplit(t	pkgstringtpkglisttheadertpkg((s*/usr/share/inkscape/extensions/eqtexsvg.pyt
parse_pkgs!s

RcCs^t|d�}|jd�|j|�|jd�|j|�|jd�|j�dS(Ntwsv%% processed with eqtexsvg.py
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
s'\thispagestyle{empty}
\begin{document}
s
\end{document}
(topentwritetclose(tfilenametequationt
add_headerttex((s*/usr/share/inkscape/extensions/eqtexsvg.pytcreate_equation_tex)s


cs�|j|jj�jd��}|j|jj�jd��}t||��t||�����fd��tjj|�}|j�}�||�}|j	j
|�dS(NtwidththeightcsW|jjdd�d}|dkrqtjjtj|d��}xI|jD]}|j||j|�qMWntjjtjdd��}x�|j�D]�}|jjdd�d}|dkr��||�}|dkr?|jd	d
t	�d�dt	�d�d
t	�d�d
t	�d�d�n|j
|�q�q�W|S(Ns}ii����tsvgtgtpathtpolylinetpolygont	transformsmatrix(g�@s,0,0,s,g�?g�?s)(sgspathRR(ttagtrsplittinkextetreetElementtaddNStattribtsettiterchildrentstrtappend(tselftnode_intin_tagtnode_outtnametctc_tagtchild(tclone_and_rewritet	doc_sizeHt	doc_sizeW(s*/usr/share/inkscape/extensions/eqtexsvg.pyR,?s](tunittouutdocumenttgetroottgettmintmaxRRtparset
current_layerR#(R$Rt	doc_widtht
doc_heighttdocRtgroup((R,R-R.s*/usr/share/inkscape/extensions/eqtexsvg.pytsvg_open9s!!tEQTEXSVGcBseZd�Zd�ZRS(c
Csvtjj|�|jjddddddddd	d
dd�|jjd
dddddddd	d
dd�dS(Ns-fs	--formuletactiontstorettypetstringtdesttformulatdefaultRthelps
LaTeX formulas-ps
--packagestpackagessAdditional packages(RtEffectt__init__tOptionParsert
add_option(R$((s*/usr/share/inkscape/extensions/eqtexsvg.pyRGWsc	s�tjdd��tjj�d��tjj�d��tjj�d��tjj�d��tjj�d��tjj�d��tjj�d	��tjj�d
�����������f	d�}|jjdkrtjdIJdSt	|jj
�}t�|jj|�tjd
���f�ytj
��WnQtk
r�tjdIJtj|jjIJtjdI�IJtjd�nXtjd��f�d}tjdkr�d}ntjd�|����f�tjj��rht�d�}x4|D],}|jd�s+tjj|d�q+q+W|j�nt|��|�dS(NRs	inkscape-seq.texseq.auxseq.logseq.psseq.dviseq.svgseq.outseq.errcs�tj��tj��tj��tj��tj��tj��tj��tjj��r}tj��ntj��dS(N(tostremoveRtexiststrmdir((	taux_filetbase_dirtdvi_fileterr_filet
latex_filetlog_filetout_filetps_filetsvg_file(s*/usr/share/inkscape/extensions/eqtexsvg.pytcleanms






s&empty LaTeX input.  Nothing to be dones7latex "-output-directory=%s" -halt-on-error "%s" > "%s"sinvalid LaTeX input:stemporary files were left in:is*dvips -q -f -E -D 600 -y 5000 -o "%s" "%s"s;tnts&&sAcd "%s" %s pstoedit -f plot-svg -dt -ssp "%s" "%s" > "%s" 2> "%s"trspstoedit: versions
(ttempfiletmkdtempRJRtjointoptionsRBtsyststderrRRERtsystemtstattOSErrortexitR(RLR	t
startswithR
RR;(R$RWRt	separatort
err_streamtline((	RNRORPRQRRRSRTRURVs*/usr/share/inkscape/extensions/eqtexsvg.pyteffectasL'
	

		


(t__name__t
__module__RGRh(((s*/usr/share/inkscape/extensions/eqtexsvg.pyR<Vs	
t__main__(t__doc__RRJRZR^txml.dom.minidomtxmlRRR;RFR<Ritetaffect(((s*/usr/share/inkscape/extensions/eqtexsvg.pyt<module>s<		H