Unable to use latex in button

I have a simple question - but for some reason I canโ€™t seem to figure it out.

The documentation from streamlit button suggests that I can use latex expressions inside button label: st.button - Streamlit Docs

So here is what I did:

st.write("$ a' \\beta $")
st.button("$ a' \\beta $")

And here is the output I get:

So in simple words - same latex expression is working in st.write but not in st.button.

Any help? Thank you

Works for me in Streamlit v1.28.2.

st.write("$ a' \\beta $")
st.button("$ a' \\beta $")


1 Like

As @Goyo has shown, it is working in the latest version, @Varshit_Dusad if deploying to Community Cloud, perhaps you can pin your Streamlit to the latest version either by leaving the version blank as in:


or you could assign the latest version to it:


or if itโ€™s a local version, update to the latest version:

pip install -U streamlit

Thanks - looks like it is a version issue. Unfortunately, I am stuck an older version due to some other legacy libraries.
But will verify it with latest version.

Thanks @dataprofessor and @Goyo for your help.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.