Allow Latex and Markdown formatting in widget options
See original GitHub issueProblem
It would be cool if users could format options for multiselect boxes and the like using LaTeX and/or Markdown. For example:
st.selectbox('', ['$k_A$', '$k_B$', '$k_D$', 'k<sub>C</sub>'])
Solution
MVP: What’s the smallest possible solution that would get 80% of the problem out of the way?
Possible additions: What are other things that could be added to the MVP over time to make it better?
Preferred solution: If you don’t like the MVP above, tell us why, and what you’d like done instead.
Additional context
HT Emmanual_Pean on the Streamlit forum: https://discuss.streamlit.io/t/html-or-latex-in-selectbox/2002
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Writing content with Markdown, LaTeX, and Shortcodes
Learn how to format content with Markdown, write math with LaTeX, add citations, and embed rich media such as image galleries, videos, ...
Read more >Markdown Widget - Create Courses Using ... - Educative.io
The Markdown widget is super easy to use, let's have a look at it. ... To check out more formatting options available in...
Read more >9.2 Display HTML widgets | R Markdown Cookbook
Then if you knit an Rmd document with HTML widgets to a non-HTML format, the HTML widgets will be displayed as static screenshots....
Read more >Markdown syntax for files, widgets, and wikis - Azure DevOps
Markdown files or widgets ... In a Markdown file or widget, enter two spaces before the line break, and then select Enter to...
Read more >Markdown and LaTeX introduction - Ashkan Mirzaee
Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This would also be useful to have for labels inside of widgets. This is a screen shot of my use case, with the code, showing what should be if it was done in just text, vs it not rendering within the widget.
Out of curiosity I just looked at the simple widgets: ✘
st.text('$\phi$')
✘st.text(r'$\phi$')
✓st.markdown('$\phi$')
✓st.latex('\phi')
✓st.write('$\phi$')
✓st.title('$\phi$')
✓st.header('$\phi$')
✓st.subheader('$\phi$')
Looking into these, it seems like the difference is if it gets treated like text or markdown. Markdown goes through a process of getting rendered by Katex.
Would it be possible to just have any string that goes through a widget get processed the same way as the markdown?
I am also waiting for this feature to add LaTeX inside
st.checkbox()
andst.markdown()
.