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

LaTeX pretty printing breaks for (negative) exponents #569

Closed
b-reinke opened this issue Apr 25, 2024 · 2 comments
Closed

LaTeX pretty printing breaks for (negative) exponents #569

b-reinke opened this issue Apr 25, 2024 · 2 comments

Comments

@b-reinke
Copy link

The LaTeX pretty printing of expressions works badly with superscripts that are more than one letter long:

Using jupyter,

using HomotopyContinuation
@var x
x^-1

produces the latex output $$x^(-1)$$
as the string x^(-1) is passed to the latex output more or less directly.

I think there are proper LaTeX printers in SymEngine, see for example https://symengine.org/symengine/classSymEngine_1_1LatexPrinter.html
I don't know how to call them from Julia though.

@b-reinke
Copy link
Author

My hotfix (using Latexify) is the following:

using Latexify
Base.show(io::IO, ::MIME"text/latex", z::Expression) = println(io, latexify(string(z)))

This is good enough for me at the moment, but I guess you can avoid using Latexify by using the LaTeX printer of SymEngine.

@PBrdng
Copy link
Collaborator

PBrdng commented May 3, 2024

Okay, thanks for noticing. I will keep it in mind for the next update.

@PBrdng PBrdng closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants