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

KaTeX parse error for newlines #2086

Closed
reesehopkins opened this issue Oct 3, 2020 · 2 comments
Closed

KaTeX parse error for newlines #2086

reesehopkins opened this issue Oct 3, 2020 · 2 comments
Labels
feature:st.markdown type:bug Something isn't working

Comments

@reesehopkins
Copy link

Summary

Unable to create newlines using st.latex. Tried to use \\ and \newline. Both do not work.

Steps to reproduce

What are the steps we should take to reproduce the bug:

st.latex(r"x=1 \\ y=2")
st.latex(r"x=1 \newline y=2")

Expected behavior:

image

Screenshot because GitHub doesn't render Latex

Actual behavior:

KaTeX parse error: Expected 'EOF', got '\\' at position 5: x=1 \̲\̲ y=2

and...
image

Is this a regression?

no

Debug info

  • Streamlit version: 0.63.1
  • Python version: 3.7.6
  • Using Conda
  • OS version: Windows 10
  • Browser version: Chrome
@reesehopkins reesehopkins added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels Oct 3, 2020
@akrolsmir
Copy link
Contributor

Can confirm this repros. Katex supports newlines normally (https://katex.org/), so we're probably doing something wrong. Guesses:

  1. In StreamlitMarkdown, we pull in both inlineMath and blockMath renderers; perhaps inlineMath is getting used which doesn't play nice with newlines?
  2. Some kind of markdown parsing or backslash escape issue where the double backslash is interpreted as an EOF somewhere else?

@akrolsmir akrolsmir added feature:st.markdown and removed status:needs-triage Has not been triaged by the Streamlit team labels Oct 5, 2020
@karriebear karriebear mentioned this issue Feb 3, 2021
2 tasks
@vdonato
Copy link
Collaborator

vdonato commented Feb 5, 2021

Looks like this was fixed by #2619, but the GitHub magic words that close associated issues wasn't included in that PR description

@vdonato vdonato closed this as completed Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.markdown type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants