@_with_element
def latex(self, element, body):
    "Display mathematical expressions formatted as LaTeX.\n\n        Supported LaTeX functions are listed at\n        https://katex.org/docs/supported.html.\n\n        Parameters\n        ----------\n        body : str or SymPy expression\n            The string or SymPy expression to display as LaTeX. If str, it's\n            a good idea to use raw Python strings since LaTeX uses backslashes\n            a lot.\n\n\n        Example\n        -------\n        >>> st.latex(r'''\n        ...     a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n        ...     \\sum_{k=0}^{n-1} ar^k =\n        ...     a \\left(\\frac{1-r^{n}}{1-r}\\right)\n        ...     ''')\n\n        .. output::\n           https://share.streamlit.io/0.50.0-td2L/index.html?id=NJFsy6NbGTsH2RF9W6ioQ4\n           height: 75px\n\n        "
    if type_util.is_sympy_expession(body):
        import sympy
        body = sympy.latex(body)
    element.markdown.body = ('$$\n%s\n$$' % _clean_text(body))
Display mathematical expressions formatted as LaTeX.

Supported LaTeX functions are listed at
https://katex.org/docs/supported.html.

Parameters
----------
body : str or SymPy expression
    The string or SymPy expression to display as LaTeX. If str, it's
    a good idea to use raw Python strings since LaTeX uses backslashes
    a lot.


Example
-------
>>> st.latex(r'''
...     a + ar + a r^2 + a r^3 + \cdots + a r^{n-1} =
...     \sum_{k=0}^{n-1} ar^k =
...     a \left(\frac{1-r^{n}}{1-r}\right)
...     ''')

.. output::
   https://share.streamlit.io/0.50.0-td2L/index.html?id=NJFsy6NbGTsH2RF9W6ioQ4
   height: 75px
@_with_element
def latex(self, element, body):
    "Display mathematical expressions formatted as LaTeX.\n\n        Supported LaTeX functions are listed at\n        https://katex.org/docs/supported.html.\n\n        Parameters\n        ----------\n        body : str or SymPy expression\n            The string or SymPy expression to display as LaTeX. If str, it's\n            a good idea to use raw Python strings since LaTeX uses backslashes\n            a lot.\n\n\n        Example\n        -------\n        >>> st.latex(r'\n        ...     a + ar + a r^2 + a r^3 + \\cdots + a r^{n-1} =\n        ...     \\sum_{k=0}^{n-1} ar^k =\n        ...     a \\left(\\frac{1-r^{n}}{1-r}\\right)\n        ...     ')\n\n        .. output::\n           https://share.streamlit.io/0.50.0-td2L/index.html?id=NJFsy6NbGTsH2RF9W6ioQ4\n           height: 75px\n\n        "
    if type_util.is_sympy_expession(body):
        import sympy
        body = sympy.latex(body)
    element.markdown.body = ('$$\n%s\n$$' % _clean_text(body))