Closed mmcky closed 1 year ago
It looks like Julia
Plots defaults to image/svg+xml
mime types which will need to be converted to png
for sphinx-jupyterbook-latex
.
@AakashGfude we did something similar for the interactive figures right? Do we have a transform
for converting images to a format latex
can use. Hopefully it can be kernel
agnostic by just treating mime
types
I thought we converted svg
but not sure about svg+xml
@jlperla in the short term we could output png
https://docs.juliaplots.org/latest/output/
but I can't see a way to do this globally when loading Plots
gif
conversions? https://sphinx-jupyterbook-latex.readthedocs.io/en/latest/features.html#features-png-gifThanks. Yeah we can't change it to png globally. The notebooks can become massive (and everything is pretty ugly) if it goes raster instead of vector based.
I have tested the other sphinx image converters to see if they worked in https://github.com/QuantEcon/lecture-julia.myst/pull/232 but this doesn't appear to solve our problem.
sphinxcontrib-imageconverter
sphinx-jupyterbook-latex
@jlperla neither of these options will be a quick fix on the software stack. The "best" solution to support pdf
for now is to see if we can set the backend Plots
to render to png
files rather than svg+xml
Thanks. Yeah we can't change it to png globally. The notebooks can become massive (and everything is pretty ugly) if it goes raster instead of vector based.
ah just saw this -- this is true. I am wondering if we can set to png just for the pdf
builds. 🤔
One thing to try is that you could add in a default(fmt = :png)
after the initial using Plots
or using StatsPlots
?
If you have preprocessing before the pdf build you could just find all instances of using
and Plots
in the same block (to consider the using LinearAlgebra, AnotherPackages, Plots, EvenMorePackages
And then add in the default(fmt = :png)
?
Not positive this fixes the problem, though.
Keep in mind, though, that the PDF may end up enormous unless you also do some sort of compression with the pngs as a substep itself. There are a lot of figures in the paper and many of them are the sorts of simulations/ensembles that make especially large png files.
The book PDF that was introduced yesterday is missing
plots
mime
types for Julia notebooks