Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Support for LaTeX in Streamlit markdown #296

Closed
treuille opened this issue Oct 7, 2019 · 3 comments
Closed

Request: Support for LaTeX in Streamlit markdown #296

treuille opened this issue Oct 7, 2019 · 3 comments
Assignees
Labels

Comments

@treuille
Copy link
Collaborator

@treuille treuille commented Oct 7, 2019

Problem

Some users community members have asked for Latex support:

Solution

According to veered support for Latex via MathJax really ought to be built into Streamlit. It’s super helpful!

This sounds right to me, and a little research suggests it's possible! :)

@treuille treuille added the enhancement label Oct 7, 2019
@kantuni kantuni self-assigned this Oct 10, 2019
@kantuni kantuni changed the title Request: Support for Latex in Streamlit markdown Request: Support for LaTeX in Streamlit markdown Oct 15, 2019
@kantuni kantuni mentioned this issue Oct 21, 2019
@kantuni kantuni closed this in #491 Oct 30, 2019
@lyqht

This comment has been minimized.

Copy link

@lyqht lyqht commented Dec 9, 2019

Hi, i'm not able to get latex to render even after upgrading to v 50.2!
[streamlit ver 48.2]
image

[streamlit ver 50.2]
image

with this code

st.write("""
              Given:
                - A document is a sequence of $N$ words denoted by $\textbf{w} = (w_1,w_2,... ,w_N)$, where $w_n$ is the nth word b in the sequence.
                - A corpus is a collection of $M$ documents denoted by $D = \textbf{w}_1, \textbf{w}_2,...\textbf{w}_m$
                - $\alpha$ is the Dirichlet prior on the per-document topic distributions
                - $\beta$ is the Dirichlet prior on the per-topic  word distributions
                - $\theta$ is the topic distribution for document $m$
                - $z_{mn}$ is the topic for $n^{\text{th}}$  word in document $m$
              """)
@arraydude

This comment has been minimized.

Copy link
Contributor

@arraydude arraydude commented Dec 9, 2019

Hey @lyqht ,

The string needs to be "raw" because of the backslashes, please try this:

st.write(r"""
Given:
- A document is a sequence of $N$ words denoted by $\textbf{w} = (w_1,w_2,... ,w_N)$, where $w_n$ is the nth word b in the sequence.
- A corpus is a collection of $M$ documents denoted by $D = \textbf{w}_1, \textbf{w}_2,...\textbf{w}_m$
- $\alpha$ is the Dirichlet prior on the per-document topic distributions
- $\beta$ is the Dirichlet prior on the per-topic  word distributions
- $\Theta$ is the topic distribution for document $m$
- $z_{mn}$ is the topic for $n^{\text{th}}$  word in document $m$
""")
@lyqht

This comment has been minimized.

Copy link

@lyqht lyqht commented Dec 10, 2019

@arraydude , yes it works now, thank you!!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.