HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/docutils/utils/math/__pycache__/tex2mathml_extern.cpython-36.pyc
3

{2�e�@sLddlZdZd
dd�Zddd�Zddd	�Zed
krHdZeee�jd��dS)�NzP\documentclass{article}
\usepackage{amsmath}
\begin{document}
%s
\end{document}
c
Cs4tjdddgtjtjtjdd�}|jjt|jd��|jj�|jj	�}|j
j	�jd�}|rl|jd�dksr|r||j
|�tjd	dd
ddgtjtjtjdd�}|jj|�|jj�|jj	�jd�}|j
j	�jd�}|r�|jd�dks�|r�|j
|�|jd
�|jd�d}}	|||	�}d|k�r0t|��|S)zhConvert LaTeX math code to MathML with LaTeXML_
    
    .. _LaTeXML: http://dlmf.nist.gov/LaTeXML/
    �latexml�-z--inputencoding=utf8T)�stdin�stdout�stderr�	close_fds�utf8�ErrorrZlatexmlpostz--nonumbersectionsz--format=xhtmlz--z<mathz</math>�zclass="ltx_ERROR)�
subprocess�Popen�PIPEr�write�document_template�encode�closer�readr�decode�find�error�SyntaxError)
�	math_code�reporter�pZlatexml_codeZlatexml_errZpost_p�resultZ
post_p_err�start�end�r�'/usr/lib/python3.6/tex2mathml_extern.pyrsB





rcCs�tjdddgtjtjtjdd�}|jjt|jd��|jj�|jj	�}|j
j	�jd�}|jd�dkr�d	j
d
d�|j�D��}td|��|r�|jd
�dks�|r�|j|�|jd�|jd�d}}|||�}|S)zkConvert LaTeX math code to MathML with TtM_
    
    .. _TtM: http://hutchinson.belmont.ma.us/tth/mml/
    �ttmz-uz-rT)rrrrrz**** Unknownr�
cSsg|]}|jd�r|�qS)z****)�
startswith)�.0�linerrr�
<listcomp>\szttm.<locals>.<listcomp>z&
Message from external converter TtM:
z
**** Errorz<mathz</math>r
)rrr
rrrrrrrrrr�join�
splitlinesrr)rrrr�err�msgrrrrrrIs&


rTc

Csdddddddddd	g
}|r"d
}nd}|jd�tjd
g|tjtjtjdd�}|jj|jd��|jj�|jj	�j
d�}|jj	�j
d�}t|�|j
d�dkr�td||j
d�d|j
d����|r�|j
d�dks�|r�|j|�|j
d�d|j
d�}}	d||||	�f}|S)zpConvert LaTeX math code to MathML with blahtexml_
    
    .. _blahtexml: http://gva.noekeon.org/blahtexml/
    z--mathmlz
--indentedz	--spacingZmoderatez--mathml-encoding�rawz--other-encodingz--doctype-xhtml+mathmlz--annotate-TeX�zmode="display"z
--displaymath�	blahtexmlT)rrrrrz<error>rz,
Message from external converter blahtexml:
z	<message>�	z
</message>z
**** Errorz<markup>z	</markup>z><math xmlns="http://www.w3.org/1998/Math/MathML"%s>
%s</math>
)�appendrrr
rrrrrrrr�printrrr)
rZinlinerZoptionsZmathmode_argrrr'rrrrrr+es<

 
r+�__main__uH\frac{\partial \sin^2(\alpha)}{\partial \vec r} \varpi \, \text{Grüße}r)N)N)TN)	rrrrr+�__name__Zexampler.rrrrr�<module>s
.

*