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}
''')
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.