-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Added SVG LaTeX rendering #17290
Added SVG LaTeX rendering #17290
Conversation
✅ Hi, I am the SymPy bot (v147). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.5. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
Codecov Report
@@ Coverage Diff @@
## master #17290 +/- ##
=============================================
- Coverage 74.595% 74.565% -0.031%
=============================================
Files 624 624
Lines 162208 162239 +31
Branches 38071 38078 +7
=============================================
- Hits 121000 120974 -26
- Misses 35848 35898 +50
- Partials 5360 5367 +7 |
SVG should be preferable to PNG for frontends that support it, since it has infinite DPI. Does the qtconsole support it? We've generally avoided rendering PNG by default because in the notebook it saves it to the file, even though it isn't used by anything, making the file size unnecessarily large. I don't know how large the SVG renders are. |
Yes, qtconsole supports it. It doesn't take any benefit of the vector format though, but converts it to Qimage(?) rather directly that is displayed. However, one can access the SVG through a right-click menu for copying or saving. The, sort of, drawback that made me a bit reluctant to always render it (just changing (Btw, I should probably try to see if one can only generate the dvi once and then do dvipng and/or dvisvgm. I haven't considered exactly how it is done now. And avoid running latex, up to, three times...) |
References to other Issues or PRs
Brief description of what is fixed or changed
Turns out that there was an easily enabled SVG backend for LaTeX rendering as well. Probably quite limited practical benefits, but I guess that there may be IPython consoles that has some benefit with an SVG instead of an PNG. In Spyder, one can copy the SVG if one is available.
Note that the SVG is not rendered by default (
use_latex=True
). One may render all options (pretty printing, png, svg, and latex) and just send it, but it seems a bit overkill to do that.Other comments
forecolor
andscale
works.(I was actually trying to figure out a way to be able to copy the latex code from the image in Spyder, but ended up with this...)
Release Notes
init_printing(use_latex='svg')
renders an svg which can be useful for some shells.