U
    [ªSh!  ã                   @   s   d Z dd„ Zddd„ZdS )aæ  
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
:tex2mathml_extern: Wrapper for 3rd party TeX -> MathML converters
c                 C   s   |   d¡}d dd„ |D ƒ¡S )zAReturn string (LaTeX math) `code` with environments stripped out.z\begin{c                 s   s   | ]}|  d ¡d V  qdS )z\end{éÿÿÿÿN)Úsplit)Ú.0Úchunk© r   úO/root/rtd-docs/venv/lib/python3.8/site-packages/docutils/utils/math/__init__.pyÚ	<genexpr>    s   ÿz toplevel_code.<locals>.<genexpr>)r   Újoin)ÚcodeÚchunksr   r   r   Útoplevel_code   s    

ÿr   Fc                 C   s,   t | ƒ d¡dkrd}nd}|s(|d7 }|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\\é    ÚalignZequationÚ*)r   Úfind)r	   ZnumberedÚenvr   r   r   Úpick_math_environment$   s    
r   N)F)Ú__doc__r   r   r   r   r   r   Ú<module>   s   