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

Fix text/latex output in HTMLWriter #1283

Closed
wants to merge 1 commit into from
Closed

Fix text/latex output in HTMLWriter #1283

wants to merge 1 commit into from

Conversation

mortenpi
Copy link
Member

@mortenpi mortenpi commented Apr 9, 2020

Aiming to fix #1278.

@mortenpi mortenpi added this to the 0.24.8 milestone Apr 9, 2020
# If the show(io, ::MIME"text/latex", x) output is already wrapped in \[ ... \], we
# unwrap it first, since when we output Markdown.LaTeX objects we put the correct
# delimiters around it anyway.
m = match(r"\s*\\\[(.*)\\\]\s*", d[MIME"text/latex"()])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stripping of \[ and \] is directly motivated by SymPy. I am wondering if we should also strip $ .. $,$$ .. $$, \( .. \) etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me to be consistent here and just strip them all.

@fredrikekre
Copy link
Member

Thanks, I had a similar fix on some machine.

The tricky thing here is what should happen with something like

This is $x$.

where not everything is math.

@mortenpi
Copy link
Member Author

Fair point, this may need a little bit more thought. It looks like it might end up being slightly breaking though, so let's leave this for 0.25.0.

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

Successfully merging this pull request may close these issues.

"text/latex" output not rendered
3 participants