HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/docutils/utils/math/__pycache__/latex2mathml.cpython-310.pyc
o

!5p`4D�@sdZddlmmmZddddddd	d
ddd
ddd�
Zdddddddddddd�ZejZej	Z
e
�ej�e
�ej
�e
�ej�e
�ej�e
�ej�e
�ej�d�dd�d D��Zgd!�Zid"d#�d$d%�d&d'�d(d)�d*d+�d,d-�d.d/�d0d1�d2d3�d4d5�d6d7�d8d9�d:d;�d<d=�d>d?�d@dA�dBdC�dDdEdFdGdHdIdJdKdLdM�	�Zid"dN�d$dO�d&dP�d(dQ�d*dR�d,dS�d.dT�d0dU�d2dV�d4dW�d6dX�d8dY�d:dZ�d<d[�d>d\�d@d]�dBd^�id_d`�dadb�dcdd�dedf�dgdh�didj�dkdl�dmdn�dodp�dqdr�dsdt�dudv�dwdx�dydz�d{d|�d}d~�dd���id�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d��d�d���d�d�i�Zd�d�d�d��ZGd�d��d�e�ZGd�d��d�e�ZGd�d��d�e�ZGd�d��d�e�ZGd�d��d�e�ZGd�d��d�e�ZGd�d��d�e�ZGd�d��d�e�ZGd�d��d�e�Z Gd�d��d�e�Z!Gd�d��d�e�Z"Gd�d��d�e�Z#Gd�d„d�e�Z$Gd�dĄd�e�Z%Gd�dƄd�e�Z&Gd�dȄd�e�Z'Gd�dʄd�e�Z(Gd�d̄d�e�Z)Gd�d΄d�e�Z*Gd�dЄd�e�Z+Gd�d҄d�e�Z,Gd�dԄd�e�Z-d�d�dׄZ.d�dلZ/d�d�dۄZ0dS)�z2Convert LaTex math code into presentational MathML�N�´�¯u˘uˇu˙�¨u⃛�`�^u˚u⃡u˜u⃗)
�acute�bar�breve�check�dot�ddot�dddot�grave�hat�mathring�overleftrightarrow�tilde�vecuΦuΞuΣuΨuΔuΘuϒuΠuΩuΓuΛ)�Phi�Xi�Sigma�Psi�Delta�Theta�Upsilon�Pi�Omega�Gamma�Lambda�cCsg|]}t|�qS�)�special)�.0�symbolr r �B/usr/lib/python3/dist-packages/docutils/utils/math/latex2mathml.py�
<listcomp>8�r%)�sum�int�oint�prod)&�arccos�arcsin�arctan�arg�cos�cosh�cot�coth�csc�deg�det�dim�exp�gcd�hom�inf�ker�lg�lim�liminf�limsup�ln�log�max�min�Pr�sec�sin�sinh�sup�tan�tanh�injlim�	varinjlim�	varlimsup�projlim�	varliminf�
varprojlim�Au𝔸�Bu𝔹�Cuℂ�Du𝔻�Eu𝔼�Fu𝔽�Gu𝔾�Huℍ�Iu𝕀�Ju𝕁�Ku𝕂�Lu𝕃�Mu𝕄�Nuℕ�Ou𝕆�Puℙ�Quℚuℝu𝕊u𝕋u𝕌u𝕍u𝕎u𝕏u𝕐uℤ)	�R�S�T�U�V�W�X�Y�Zu𝒜uℬu𝒞u𝒟uℰuℱu𝒢uℋuℐu𝒥u𝒦uℒuℳu𝒩u𝒪u𝒫u𝒬rbuℛrcu𝒮rdu𝒯reu𝒰rfu𝒱rgu𝒲rhu𝒳riu𝒴rju𝒵�au𝒶�bu𝒷�cu𝒸�du𝒹�euℯ�fu𝒻�guℊ�hu𝒽�iu𝒾�ju𝒿�ku𝓀�lu𝓁�mu𝓂�nu𝓃�ouℴ�pu𝓅�qu𝓆�ru𝓇�su𝓈�tu𝓉�uu𝓊�vu𝓋�wu𝓌�xu𝓍�yu𝓎�zu𝓏u≠u∉u≢)�=z\inz\equivc@sheZdZdZdZ	ddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�mathzBase class for MathML elements.i@BNcCsNg|_|durt|t�r|D]}|�|�qn|�|�|dur%||_dSdS)z\math([children]) -> MathML element

        children can be one child or a list of children.N)�children�
isinstance�list�append�inline)�selfr�r��childr r r$�__init__�s
�

�z
math.__init__cCs4t|d�r|jjdd�dd�|jD��S|jjS)Nr�z(%s)�,cSsg|]}t|��qSr )�repr)r"r�r r r$r%�r&z!math.__repr__.<locals>.<listcomp>)�hasattr�	__class__�__name__�joinr��r�r r r$�__repr__�s

�z
math.__repr__cCst|j�|jkS)zRoom for more children?)�lenr��	nchildrenr�r r r$�full�sz	math.fullcCs<|��rJ�|j�|�||_|}|��r|j}|��s|S)zvappend(child) -> element

        Appends child and returns self if self is not full or first
        non-full parent.)r�r�r��parent)r�r��noder r r$r��s�zmath.appendcCs|jd}|jd=|S)zAdelete_child() -> child

        Delete last child and return it.���)r�)r�r�r r r$�delete_child�s
zmath.delete_childcCs |j}|��r|j}|��s|S)zKclose() -> parent

        Close element and return first non-full element.)r�r�)r�r�r r r$�close�s
�z
math.closecCs|��|��|��S)zxml() -> xml-string)�	xml_start�xml_body�xml_endr�r r r$�xml�szmath.xmlcCs6t|d�sd|jjgSd}|jrd|gSd|gS)Nr�z<%s>z"http://www.w3.org/1998/Math/MathMLz<math xmlns="%s">z <math xmlns="%s" mode="display">)r�r�r�r�)r��xmlnsr r r$r��s


zmath.xml_startcC�d|jjgS)Nz</%s>�r�r�r�r r r$r���zmath.xml_endcCs"g}|jD]	}|�|���q|S�N)r��extendr�)r�r�r�r r r$r��s
z
math.xml_body�NN)r��
__module__�__qualname__�__doc__r�r�r�r�r�r�r�r�r�r�r�r r r r$r��s
	
	r�c@�eZdZdd�ZdS)�mrowcCr��Nz
<%s>r�r�r r r$r��r�zmrow.xml_startN�r�r�r�r�r r r r$r���r�c@r�)�mtablecCr�r�r�r�r r r$r��r�zmtable.xml_startNr�r r r r$r��r�r�c@�eZdZdS)�mtrN�r�r�r�r r r r$r��r�c@r�)�mtdNr�r r r r$r�r�r�c@s$eZdZdZdZdd�Zdd�ZdS)�mxzBase class for mo, mi, and mnrcC�
||_dSr���data)r�r�r r r$r��
zmx.__init__cC�|jgSr�r�r�r r r$r��zmx.xml_bodyN)r�r�r�r�r�r�r�r r r r$r�s
r�c@seZdZddd�Zdd�ZdS)�moz&lt;z&gt;)�<�>cCs|j�|j|j�gSr�)�translation�getr�r�r r r$r�szmo.xml_bodyN)r�r�r�r�r�r r r r$r�s
r�c@r�)�miNr�r r r r$r�r�r�c@r�)�mnNr�r r r r$r�r�r�c@�eZdZdZdS)�msub�N�r�r�r�r�r r r r$r��r�c@r�)�msupr�Nr�r r r r$r�r�r�c@r�)�msqrt�Nr�r r r r$r�r�r�c@r�)�mrootr�Nr�r r r r$r�r�r�c@r�)�mfracr�Nr�r r r r$r�"r�r�c@�"eZdZdZddd�Zdd�ZdS)	�msubsup�NFcC�||_t�||�dSr���reversedr�r��r�r�r�r r r$r�'�zmsubsup.__init__cCs4|jr|jd|jdg|jdd�<d|_t�|�S)Nr�r�r�F)r�r�r�r�r�r r r$r�+s
zmsubsup.xml�NF�r�r�r�r�r�r�r r r r$r�%�
r�c@s,eZdZdddddd�Zdd�Zd	d
�ZdS)�mfenced�{u〈�}u〉r)�\{�\langle�\}�\rangle�.cCs||_t�|�dSr�)�openparr�r�)r��parr r r$r�6szmfenced.__init__cCs2|j�|j|j�}|j�|j|j�}d||fgS)Nz<mfenced open="%s" close="%s">)r�r�r��closepar)r��openr�r r r$r�:szmfenced.xml_startN)r�r�r�r�r�r�r r r r$r�2s�r�c@r�)�mspacerNr�r r r r$r�?r�r�c@seZdZddd�Zdd�ZdS)�mstyleNcKs$|dur||_t�||�||_dSr�)r�r�r��attrs)r�r�r��kwargsr r r$r�Cs
zmstyle.__init__cCs dgdd�|j��D�dgS)Nz<mstyle cSsg|]}d|�qS)z%s="%s"r )r"�itemr r r$r%Js�z$mstyle.xml_start.<locals>.<listcomp>r�)r��itemsr�r r r$r�Is

��zmstyle.xml_startr�)r�r�r�r�r�r r r r$r�Bs
r�c@r�)	�moverr�NFcCr�r�r�r�r r r$r�Or�zmover.__init__cCs |jr|j��d|_t�|�Sr�)r�r��reverser�r�r�r r r$r�Ss

z	mover.xmlr�r�r r r r$r�Mr�r�c@r�)�munderr�Nr�r r r r$r�Yr�r�c@seZdZdZddd�ZdS)�
munderoverr�NcCst�||�dSr�)r�r�)r�r�r r r$r�^szmunderover.__init__r�)r�r�r�r�r�r r r r$r�\sr�c@s eZdZdZdd�Zdd�ZdS)�mtextrcCr�r���text)r�r�r r r$r�cr�zmtext.__init__cCr�r�r�r�r r r$r�fr�zmtext.xml_bodyN)r�r�r�r�r�r�r r r r$r�asr�TcCsLd�|���}|rt�}t|dd�}n
t�}ttt|��dd�}t|�dk�r�t|�}|d}d}|dkr:|d}nd}|dkrB�nV|dkr�|d	vrU|�t	|��}d
}�nC|dkrc|�t
��}d
}�n5|dkrq|�t
��}d
}�n'|��r�d
}||kr�||��r�|d7}||kr�||��s�|d|�}	t|	|||d��\}}||7}n�|dkr�t�}
t|
�}|�
��
��|�|
}d
}n�td
||f��|��r�|�t|��}n�|��r�|�t|��}n�|dvr�|�t	|��}n�|dk�r|��}t|t��rt|jdd�}
nt|t	��r|jtv�rt|�}
nt|�}
|�|
�|
}ny|dk�rf|��}t|t��r4t|j�}n*t|t	��rE|jtv�rEt|�}nt|t��rZ|jdjtv�rZt|j�}nt|�}|�|�|}n2|dk�rvt�}|�|�|}n"|dk�r�|�
�}n|dk�r�t�}
|�
��|
�|
}ntd|��||d�}t|�dks'|S)z�parse_latex_math(string [,inline]) -> MathML-tree

    Returns a MathML-tree parsed from string.  inline=True is for
    inline math and inline=False is for displayed math.

    tree is the whole tree and node is the current element.� T�r�Frr�r�\z{}r�r�NzSyntax error: "%s%s"z+-*/=()[]|<>,.!?':;@�_�r�rr�r��&zIllegal character: "%s")r��splitr�r�r�r�r�r�r�r�r��isalpha�handle_keywordr��SyntaxErrorr��isdigitr�r�r�r�r�r�r��
sumintprodr�r�r�r�)�stringr�r��treerxrm�skip�c2rs�name�entry�rowr��subrHr r r$�parse_latex_mathis�	
�











�OrcCs0d}t|�dkr|ddkr|dd�}d}|dkr;|�d�s#td��|d7}t�}tt|��}|�|�|}||fS|dkrX|�d�sHtd	��|d7}|������}||fS|d
vr�|ddkrftd��|�d
�}|dkrstd��|�t	|d|���}||d7}||fS|dkr�t
�}|�|�|}||fS|dkr�t�}|�|�|}||fS|dkr�dD]	}	|�|	�r�nq�td��t|	�}
|�|
�t
�}|
�|�|}|t|	�7}||fS|dk�rdD]	}	|�|	�r�nq�td��|��}|	|_|��}|t|	�7}||fS|dk�r1tD]}|�|��rn�qtd��|�tt|��}|t|�7}||fS|dk�rGtddd�}
|�|
�|
}||fS|dk�rx|ddk�sa|d���ra|dd
k�retd��|�tt|d��}|d7}||fS|d v�r�|ddk�s�|dd
k�r�td!��|�tt|d��}|d7}||fS|d"k�r�|�td#��}||fS|tv�r�|�tt|��}||fS|tv�r�|�tt|��}||fS|tv�r�|�tt|��}||fS|tv�r�|�t|��}||fS|tv�rttt|�d$d%�}|�|�|}||fStd&|��)'Nrr�r��beginz{matrix}z;Environment not supported! Supported environment: "matrix".��endzExpected "\end{matrix}"!)r��mathrmr�zExpected "\text{...}"!r�r��sqrt�frac�left)�(�[�|r�r�r�zMissing left-brace!�right)�)�]rr�r�r�zMissing right-brace!�notz)Expected something to negate: "\not ..."!�mathbf�bold)r��mathvariant�mathbbr�z%Expected something like "\mathbb{A}"!r�)�mathscr�mathcalz&Expected something like "\mathscr{A}"!�colon�:Tr�zUnknown LaTeX command: )r��
startswithr�r�r�r�r�r��findr�r�r�r�r�r��
negatablesr�r��isupperr�rr�Greek�lettersr!�	functions�overr�)rr�rrr�tablersr
rr��fencedr�operator�style�ovrr r r$r��s�

U�
P�
H�
D�
@�
�

4
�
�*
��"
�

�*
�
�
�
�
�

�
�
�r�cCst||d�}d�|���S)z�Return string with MathML code corresponding to `tex_math`.

    `inline`=True is for inline math and `inline`=False for displayed math.
    r�r)rr�r�)�tex_mathr��mathml_treer r r$�
tex2mathml1sr.)T)1r��docutils.utils.math.tex2unichar�utilsr��tex2unicharr&r#�	mathalphar$�mathbinr!�update�mathrel�mathord�mathop�mathopen�	mathclose�	mathfencer�r�r%rrr!�objectr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r.r r r r$�<module>s���
�
��������	�
���
��������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�7�[



dd