
    -Ph	                     :    d Z  G d de          Zd ZddZd ZdS )	a4  
This is the Docutils (Python Documentation Utilities) "math" sub-package.

It contains various modules for conversion between different math formats
(LaTeX, MathML, HTML).

:math2html:    LaTeX math -> HTML conversion from eLyXer
:latex2mathml: LaTeX math -> presentational MathML
:unichar2tex:  Unicode character to LaTeX math translation table
:tex2unichar:  LaTeX math to Unicode character translation dictionaries
:mathalphabet2unichar:  LaTeX math alphabets to Unicode character translation
:tex2mathml_extern: Wrapper for 3rd party TeX -> MathML converters
c                   &     e Zd ZdZg f fd	Z xZS )	MathErrorzException for math syntax and math conversion errors.

    The additional attribute `details` may hold a list of Docutils
    nodes suitable as children for a ``<system_message>``.
    c                 X    t                                          |           || _        d S )N)super__init__details)selfmsgr   	__class__s      \/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/docutils/utils/math/__init__.pyr   zMathError.__init__$   s&        )__name__
__module____qualname____doc__r   __classcell__)r
   s   @r   r   r      sL         
 %'          r   r   c                 j    |                      d          }d                    d |D                       S )zAReturn string (LaTeX math) `code` with environments stripped out.\begin{c              3   L   K   | ]}|                     d           d         V   dS )z\end{N)split).0chunks     r   	<genexpr>z toplevel_code.<locals>.<genexpr>,   sG       0 0$ !;;x004 0 0 0 0 0 0r   )r   join)codechunkss     r   toplevel_coder   )   sE    ZZ
##F?? 0 0(.0 0 0 0 0 0r   Fc                 j    t          |                               d          dk    rd}nd}|s|dz  }|S )a:  Return the right math environment to display `code`.

    The test simply looks for line-breaks (``\``) outside environments.
    Multi-line formulae are set with ``align``, one-liners with
    ``equation``.

    If `numbered` evaluates to ``False``, the "starred" versions are used
    to suppress numbering.
    z\\    alignequation*)r   find)r   numberedenvs      r   pick_math_environmentr&   0   sG     T&&!++ s
Jr   c                 F    |rt          |           }d|d| d|dS d| z  S )Nr   z}
z
\end{}z$%s$)r&   )r   as_blockr%   s      r   wrap_math_coder*   C   s>      ?#D))/2ssDDD###>>D=r   N)F)r   
ValueErrorr   r   r&   r*    r   r   <module>r-      su    $    
   0 0 0   &    r   