diagram
diagram copied to clipboard
Inkscape Alternatives
I mostly use diagram
to generate TikZ figures and embed them into a web page on the fly, Inkscape is a pretty heavy dependency for this and generates these (ignorable) warning messages when I render a Quarto website using a GitHub Action,
** (inkscape:4065): WARNING **: 21:41:21.937: No pages selected, getting first page only.
** (inkscape:4065): WARNING **: 21:41:22.079: Failed to wrap object of type 'GtkRecentManager'.
Hint: this error is commonly caused by failing to call a library init() function.
Both of these warnings seem to be upstream to Inkscape and are unrelated to Quarto or pandoc.
For conversion from PDF to SVG, a good alternative seems to be dvisvgm
. It is fairly light in comparison to Inkscape and only depends on having Ghostscript and mupdf-tools
available. dvisvgm
is also available on CTAN so it should be simple to embed into a CI workflow. Alternatively, the poppler
library provides pdftocairo
which can also generate SVG files from PDF or you could use mupdf-tools
directly.
However, dvisvgm
can also convert from LaTeX DVI output to SVG which is a nice feature. Benchmarks here (not mine).