관리-도구
편집 파일: tex2mathml_extern.cpython-311.pyc
� P�Dgh � �r � d Z ddlZdZdd�Zdd�Zdd�Zdd�Zed k rd Z e ee� � � � dS dS ) z�Wrappers for TeX->MathML conversion by external tools This module is provisional: the API is not settled and may change with any minor Docutils version. � NzP\documentclass{article} \usepackage{amsmath} \begin{document} %s \end{document} c � � t j g d�t j t j t j d�� � }|j � t | z � d� � � � |j � � � |j � � � }|j � � � � d� � }|r0|� d� � dk s|s|� |� � t j g d�t j t j t j d�� � }|j � |� � |j � � � |j � � � � d� � }|j � � � � d� � }|r0|� d� � dk s|s|� |� � |� d� � |� d � � d z } }||| � }d|v rt |� � �|S )zdConvert LaTeX math code to MathML with LaTeXML_ .. _LaTeXML: http://dlmf.nist.gov/LaTeXML/ )�latexml�-z--preload=amsfontsz--preload=amsmathz--inputencoding=utf8T��stdin�stdout�stderr� close_fds�utf-8�Errorr )�latexmlpostr z--nonumbersectionsz--format=xhtmlz--�<math�</math>� zclass="ltx_ERROR)� subprocess�Popen�PIPEr �write�document_template�encode�closer �readr �decode�find�error�SyntaxError) � math_code�reporter�p�latexml_code�latexml_err�post_p�result� post_p_err�start�ends ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/docutils/utils/math/tex2mathml_extern.pyr r s � � �� � � � *�� *�� *��#'� )� )� )�A� �G�M�M�$�y�0�8�8��A�A�B�B�B��G�M�M�O�O�O��8�=�=�?�?�L��(�-�-�/�/�(�(��1�1�K�� $�[�%�%�g�.�.�!�3�3�<�3����{�#�#�#� � � !� !� !� %/�O�%/�_�%/�_�(,� .� .� .�F� �L���|�$�$�$� �L������ �]� � � !� !� (� (�� 1� 1�F���#�#�%�%�,�,�W�5�5�J�� #�Z�_�_�W�-�-��2�2�&�2����z�"�"�"� ���W�%�%�v�{�{�9�'=�'=�a�'?�3�E� �E�#�I� �F��V�#�#��&�!�!�!��M� c �$ � t j g d�t j t j t j d�� � }|j � t | z � d� � � � |j � � � |j � � � }|j � � � � d� � }|� d� � dk rCd� d� |� � � D � � � � }t d |z � � �|r|� d � � dk s|s|� |� � |� d� � |� d� � d z }}|||� S )zgConvert LaTeX math code to MathML with TtM_ .. _TtM: http://hutchinson.belmont.ma.us/tth/mml/ )�ttmz-uz-rTr r z**** Unknownr � c 3 �D K � | ]}|� d � � �|V � �dS )z****N)� startswith)�.0�lines r'