Closed baggepinnen closed 5 years ago
I can confirm this bug, but with using Gadfly
test.jmd:
```{julia; fig_ext=".png"}
using Gadfly
plot(x=[1,2,3], y=[1,2,3], Geom.line)
On Julia v0.6 with Weave 0.5.2
julia> weave("test.jmd", doctype="pandoc") INFO: Weaving chunk 1 from line 1 INFO: Report weaved to test.md
produces the expected result: `figures/test_1_1.png`
On Julia v1.0 with Weave#master, the same command gives a SVG file. This is problematic because embedding figures in PDFs fails on master since Weave attempts to embed a SVG instead of a PNG file like it used to.
I encountered this too, using Plots. I think the issue in my case is that display
ing a Report
uses the mimetypes
in the formatter, without looking at the fig_ext
parameter. So because image/png
is first in the mimetypes for pandoc (in my case), the method that gets called is display(report, ::mime"image/png", ::Plots.plot)
, and fig_ext
is never checked. When I change the :mimetypes
entry in the format dict for pandoc
to have "application/pdf" first, I get PDF figures like I want.
In
test.jl
produces an .svg figure instead of .png