New Streamlit Release: 0.50.2


  • :woman_student: SymPy support and ability to draw mathematical expressions using LaTeX! See st.latex, st.markdown, and st.write.
  • :sunrise_over_mountains: You can now set config options using environment variables. For example,
    export STREAMLIT_SERVER_PORT=9876.
  • :cat: Ability to call streamlit run directly with Github and Gist URLs. No
    need to grab the β€œraw” URL first!
  • :page_with_curl: Cleaner exception stack traces. We now remove all Streamlit-specific code
    from stack traces originating from the user’s app.

More info

Math support

WIth this release you can draw mathematical expressions in your Streamlit apps in 3 different ways:

  1. You can pass SymPy expressions to st.write and st.latex:

    a, b, c, x = sympy.symbols('a b c x')
    st.write(a * x ** 2 + b * x + c)
  2. You can pass LaTeX strings to st.latex:

    st.latex('ax^2 + bx + c')
  3. You can pass LaTeX strings in st.write, st.markdown, and magic by wrapping them in $ or $$ (to print it large in a new line):

    This is a polynomial: $x^2$
    And so is this:
    ax^2 + bx + c

Environment variables

Streamlit supports all sorts of config options (run streamlit config show to see all of them), and you can pass them to Streamlit in different ways:

  • Via ~/.streamlit/config.toml
  • Via ./.streamlit/config.toml
  • Via command-line flags, such as in
    $ streamlit run --server.port=9876
  • And now via environment variables, like this:
    $ export STREAMLIT_SERVER_PORT=9876
    $ streamlit run

That is, just add STREAMLIT_ before any config option and turn it to uppercase snake case and it’s a valid environment variable :smiley:

:pray: :100: Many thanks to Streamlit user @kinghuang for the contribution!!!

Github/Gist URLs:

Prior to this release, you could already call streamlit run [some_url], but that URL had to resolve to a Python file or it would be an error. Now, with the help of Streamlit user @aritropaul (:pray: :100:) we also support Github and Gist URLs.

Try it out with:

$ streamlit run

Hmmm, there is a bug with the st.write function and centered/one-line latex.

I have this running at the moment, but only the first latex line is centered, and not the two others?

Hey @peterstorm! Thanks for the heads up.

Can you share a code snippet? I can’t reproduce the bug on my machine

Also, just to clarify: the bug is that the equations below aren’t centering, right?

Correct, and I figured it out :slight_smile:

In other frameworks you are fine to enclose your latex code with $$latex_term$$ but it seems you have to make newlines in streamlit, which is completely fint, but like this:

1 Like