-
Notifications
You must be signed in to change notification settings - Fork 201
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 that matplotlib fails on should fallback to the next renderer #63
Comments
I am willing to send a fix for this if someone can indicate what the correct fix should be. My thinking is:
|
I didn't see those. Thanks for the reference. I think this boils down to the fact that there is no way for frontends to change the printer precedence (in the qtconsole or the notebook). This is something that SymPy would like to have as well (we basically work around it by having options to That PR looks extreme, and would probably break things for people. For SymPy, it would actually work, because our printing isn't enabled without calling I'm not clear if the fix I'm suggesting would fix @flying-sheep's issue, unless it is also coming from LaTeX that matplotlib cannot render. |
Currently it just prints an error and gives an empty png. However, there is a lot of LaTeX that matplotlib cannot parse, e.g., matrices. This gives a better user experience for SymPy, which has a text printer that it can fallback to. SymPy cannot just disable the LaTeX printer because it is desired for the notebook, and there is no way for it to enable LaTeX just in the notebook, or change the printer precedence order. I have left in the debug logging of the error (to the terminal). Fixes jupyter#63. This supersedes jupyter#57, although I don't know if it fixes the issue there.
Here is a fix #65. It's maybe not the cleanest thing, but it works. |
There is a lot of advanced LaTeX that the matplotlib renderer cannot handle. If an object defines a LaTeX repr that it can't handle, it just shows the error message. It should fallback to the next renderer.
This is causing an issue for us with SymPy (see sympy/sympy#9962). SymPy is able to print expressions using Unicode, but when the renderer fails (in this case, for matrices), it just shows the error
To reproduce:
latex
installed in your PATH (or else it will just use that and not matplotlib)The text was updated successfully, but these errors were encountered: