How to use $ in text?


I have text with a $ sign that
is across several lines
so it looks like this.

st.write uses $ as formatting and I can’t figure out how to get the $ to show

st.text includes tabs in the st page because of the \

Steps to reproduce

Code snippet:

st.write("sdfgsdf dsfsdf $ sdfsdfsfds $ \
sdfsddfsdfsd \

st.text("sdfgsdf dsfsdf $ sdfsdfsfds $ \
sdfsddfsdfsd \

If applicable, please provide the steps we should take to reproduce the error or specified behavior.

Expected behavior:

I would like text that has no tabs in it and can show a $ without using it as formatting.

Actual behavior:

Explain the undesired behavior or error you see when you run the code above.
If you’re seeing an error message, share the full contents of the error message here.

Debug info

  • Streamlit version: (get it with $ streamlit version)
  • Python version: (get it with $ python --version)
  • Using Conda? PipEnv? PyEnv? Pex?
  • OS version:
  • Browser version:

Requirements file

Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.


  • Link to your GitHub repo:
  • Link to your deployed app:

Additional information

If needed, add any other context about the problem here.

Prepend a backslash to the “$” character.

st.write("sdfgsdf dsfsdf \$ sdfsdfsfds \$ \
sdfsddfsdfsd \
st.write("sdfgsdf dsfsdf \t sdfsdfsfds \t sdfsddfsdfsd ")

How to insert tab spacing \t does not seem to work.
Any suggestions please…

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