diagram icon indicating copy to clipboard operation
diagram copied to clipboard

Inkscape Alternatives

Open BrendonChau opened this issue 6 months ago • 0 comments

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).

BrendonChau avatar Sep 05 '24 01:09 BrendonChau