显示格式为 LaTeX 的数学表达式。
支持的 LaTeX 函数列在 https://katex.org/docs/supported.html 中。
函数签名
st.latex(body)
参数 | 说明 |
---|---|
body (str or SymPy expression) | 要显示为 LaTeX 的字符串或 SymPy 表达式。如果是 str,最好使用原始 Python 字符串,因为 LaTeX 经常使用反斜杠。 |
示例
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)
''')

相关用法
- Python Streamlit st.line_chart用法及代码示例
- Python Streamlit st.experimental_singleton.clear用法及代码示例
- Python Streamlit st.bokeh_chart用法及代码示例
- Python Streamlit st.caption用法及代码示例
- Python Streamlit st.text_input用法及代码示例
- Python Streamlit st.area_chart用法及代码示例
- Python Streamlit st.title用法及代码示例
- Python Streamlit st.cache用法及代码示例
- Python Streamlit st.experimental_singleton用法及代码示例
- Python Streamlit st.empty用法及代码示例
- Python Streamlit st.error用法及代码示例
- Python Streamlit st.video用法及代码示例
- Python Streamlit st.vega_lite_chart用法及代码示例
- Python Streamlit st.slider用法及代码示例
- Python Streamlit st.header用法及代码示例
- Python Streamlit st.container用法及代码示例
- Python Streamlit st.form_submit_button用法及代码示例
- Python Streamlit st.form用法及代码示例
- Python Streamlit st.plotly_chart用法及代码示例
- Python Streamlit st.bar_chart用法及代码示例
- Python Streamlit st.code用法及代码示例
- Python Streamlit st.experimental_memo.clear用法及代码示例
- Python Streamlit st.warning用法及代码示例
- Python Streamlit st.image用法及代码示例
- Python Streamlit st.markdown用法及代码示例
注:本文由纯净天空筛选整理自streamlit.io大神的英文原创作品 st.latex。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。