-
Notifications
You must be signed in to change notification settings - Fork 28
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
Provide multiple lazy-loaded backends for SVGs #57
Conversation
Update: I also checked
|
An alternative to this PR could be to set up a |
This looks great! Thank you for your contribution! |
Sure, you're welcome! Still, I think extending the |
I don't. I wanted to be able to do this for a while, but hadn't had luck. Fortunately, my PhD students use a mixture of Windows/Mac/Linux, and so they should be able to identify a potential issue---but it would be nice to have this part of travis. |
Beautiful, feel free to mark me in any such issue. In the meantime, I found out that my other suggestion, to spin up a If |
I'm so looking forward to 1.6. ;-) |
You mean this bit fast?
|
That looks pretty fast to me! ;-) |
SVGs can now be produced with multiple backends:
Poppler_jll
lately was the default. It works on all platforms, but requiresjulia-1.3
and is slow to load.pdf2svg
was the former default. The user has to have this library installed.dvisvgm
always was the fall-back solution iftikzUsePoppler()
ortikzusePDF2SVG()
was explicitly set tofalse
by the user.The original code for the
dvisvgm
fallback was somehow broken; I fixed it when implementing this PR.Providing different backends has the advantage of (potentially) faster loading times that do not loose compatibility across platforms. We have already discussed the slow loading times and potential solutions: JuliaTeX/PGFPlots.jl#130
using TikzPictures
now checks whetherpdf2svg
is installed. If so, it uses the corresponding backend and the package loads quickly. Ifpdf2svg
is not installed, the package usesPoppler_jll
instead, which results in a longer loading time. Thedvisvgm
backend is only used if explicitly set by the user. An open point of discussion is whetherPoppler_jll
should have precedence overdvisvgm
in this sense.Loading times
pdf2svg
is already installed on my local machine, so loadingTikzPictures.jl
will be fast there. I can set the backend to poppler manually, afterwards, to see what loadingPoppler_jll
does. I tried this with julia v1.3 and v1.5, the last of which has improved loading*_jll
packages a lot.@time using TikzPictures
@time svgBackend(PopplerBackend())
Testing
Travis CI is testing PR currently on julia v1.0 (yes, it works again), v1.3, and v1.5. The only platform, however, is Linux.
Poppler_jll
should work everywhere, but I have not yet figured out how to tell Travis to install texlive etc on Mac OS and Windows. Any improvement of the.travis.yml
in this direction is warmly welcome!