docstr: 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.
  
  help : str
      An optional tooltip that gets displayed next to the LaTeX expression.
  
  
  Example
  -------
  >>> import streamlit as st
  >>>
  >>> 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)
  ...     ''')
code: def latex(
      self,
      body: Union[SupportsStr, "sympy.Expr"],
      *,  # keyword-only arguments:
      help: Optional[str] = None,
  ) -> "DeltaGenerator":
      # This docstring needs to be "raw" because of the backslashes in the
      # example below.
      r"""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.
  
      help : str
          An optional tooltip that gets displayed next to the LaTeX expression.
  
  
      Example
      -------
      >>> import streamlit as st
      >>>
      >>> 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)
      ...     ''')
  
      """
      if is_sympy_expession(body):
          import sympy
  
          body = sympy.latex(body)
  
      latex_proto = MarkdownProto()
      latex_proto.body = "$$\n%s\n$$" % clean_text(body)
      latex_proto.element_type = MarkdownProto.Type.LATEX
      if help:
          latex_proto.help = help
      return self.dg._enqueue("markdown", latex_proto)
  
file_path: streamlit/lib/streamlit/elements/markdown.py
imports: from typing import TYPE_CHECKING, Optional, Union, cast
  from streamlit.proto.Markdown_pb2 import Markdown
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.string_util import clean_text
  from streamlit.type_util import SupportsStr, is_sympy_expession
label_desc: Use image node_id 4 for calling the MarkdownMixin obj's underlying member method code with example usage: obj.latex(body) and returns: self