-
Notifications
You must be signed in to change notification settings - Fork 578
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
Long equations from sympy do not wrap #2208
Comments
This is definitely a duplicate of #275. NBconvert simply takes the latex that sympy outputs (which struggles with large subexpressions), and I'm not sure there is a way to fix this given the differences between XeLaTeX and MathJax. |
@gabemorris12 For reproducibility, can you please provide a full example of (copyable) code that produces the problematic equations? |
I made edits to reproduce this issue. |
Thanks!
There are definitely limits, but I think it can still be improved by what I suggested back then in #275 (comment). @gabemorris12 You can try it with https://github.com/spatialaudio/nbsphinx, which does a slightly better job at breaking equations (but it also has its limits!): |
That output is better. I like that it breaks up terms, but I'm wondering how it should handle the case where a single term can be longer than the width of the page. Thanks, and I'll look into using this. |
As I mentioned in #275 (comment), it looks like There might be ways to change the line breaking behavior, but this is beyond my TeX/LaTeX skills. Maybe you can ask at a place like https://tex.stackexchange.com/? I've gotten very helpful answers there in the past. |
When converting to a PDF, long equations from cell outputs do not wrap correctly:
It does wrap the equation but it still gets clipped off and extends into the margins. This also happens for big matrices:
A similar issue is seen in #275, but I don't think this is quite the same thing.
Steps to Reproduce
Make a notebook that contains the following cells and run it.
Run
jupyter nbconvert --to pdf <notebook_name.ipynb>
Then you will see this:
It wraps ok with the long equation that has shorter terms, but in that first cell, there is a really long term that should be brought to the next line. The same is true for the large matrix term in the last output.
The text was updated successfully, but these errors were encountered: