
    k7iQ
                    H    S r SSKJr  Sr " S S\5      rS rS
S jrSS jrg	)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
    )annotationsreStructuredTextc                  6   ^  \ rS rSrSr/ 4SU 4S jjjrSrU =r$ )	MathError"   zException 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                0   > [         TU ]  U5        X l        g )N)super__init__details)selfmsgr   	__class__s      V/home/james-whalen/.local/lib/python3.13/site-packages/docutils/utils/math/__init__.pyr
   MathError.__init__(   s        )r   )returnNone)__name__
__module____qualname____firstlineno____doc__r
   __static_attributes____classcell__)r   s   @r   r   r   "   s    
 %'  r   r   c                T    U R                  S5      nSR                  S U 5       5      $ )zAReturn string (LaTeX math) `code` with environments stripped out.\begin{c              3  J   #    U  H  nUR                  S 5      S   v   M     g7f)z\end{N)split).0chunks     r   	<genexpr> toplevel_code.<locals>.<genexpr>0   s%      0(.u !;;x04(.s   !#)r   join)codechunkss     r   toplevel_coder'   -   s.    ZZ
#F?? 0(.0 0 0r   c                d    [        U 5      R                  S5      S:  a  SnOSnU(       d  US-  nU$ )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\\r   alignequation*)r'   find)r%   numberedenvs      r   pick_math_environmentr/   4   s7     T&!+s
Jr   c                N    U(       a  [        U 5      nSU< SU < SU< S3$ SU -  $ )Nr   z}
z
\end{}z$%s$)r/   )r%   as_blockr.   s      r   wrap_math_coder3   G   s(     #D)/2D#>>D=r   N)F)r   str)	r   
__future__r   __docformat__
ValueErrorr   r'   r/   r3    r   r   <module>r9      s/    #"
 0&r   