When you change the formula it won’t refresh without a manual page refresh.
I can’t vouch for this Chrome extension, so I highly recommend limiting the webpages this plugin has access to. You can do this by going to the “Details” page for the Chrome extension and restricting site access to http://127.0.0.1:8501 or whatever the url is for where you are hosting Streamlit. If you are hosting it locally, then you must use 127.0.0.1 rather than localhost. Chrome doesn’t allow you to restrict access to http://localhost:8501. By default, running Streamlit opens a browser tab to localhost so you’ll have to manually navigate to 127.0.0.1:8501
The rendered formulas will only display for people with this Chrome extension installed.
I think that support for Latex via MathJax really ought to be built into Streamlit. It’s super helpful!
I started playing around with Streamlit last night and I’m super impressed. The live code reloading is extremely well done and seems like some crazy black magic. And having free-floating strings get written to Streamlit is a really nice touch. It materially improves the readability of the code.
I’ve started working on a project in Streamlit that might end up needing to do some weird things, so I’m sure I’ll have more ideas
However, the following seems to work. So, although the Streamlit docs claim that KaTeX supported expressions work with st.latex, it seems that there is a possible bug here.
st.latex(r'''
\begin{aligned}
v_{avg} &= \frac{\left( v_{i} + v_{f} \right)}{2} \\
\Delta x &= v_{avg} t \\
a &= \frac{\left( v_{f} - v_{i} \right)}{t} \\
\end{aligned}
''')