jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
215 stars 64 forks source link

LaTeX: `svg` conversion issue #976

Open LecrisUT opened 8 months ago

LecrisUT commented 8 months ago

Description

There is some issue with the dbus handling and I am not sure on which side this issue originates

$ myst build --all
...
🌠 Converting 3 images with extensions .svg to supported formats .pdf, .png, .jpg, .jpeg
terminate called after throwing an instance of 'Gio::DBus::Error'

terminate called after throwing an instance of 'Gio::DBus::Error'

Successfully converted /.../_build/exports/test_pdf_tex/files/spread-bc04d88ca240f3b280d2ecabed2048aa.svg -> files/spread-bc04d88ca240f3b280d2ecabed2048aa.pdf
⛔️ _build/exports/test_pdf_tex/files/bandstructure-86e773631a86cd9845215fee30911084.svg Could not convert from SVG to PDF - Error: Command failed: inkscape _build/exports/test_pdf_tex/files/bandstructure-86e773631a86cd9845215fee30911084.svg --export-area-drawing --export-type=pdf --export-filename=_build/exports/test_pdf_tex/files/bandstructure-86e773631a86cd9845215fee30911084.pdf

Workaround

Adding DBUS_SESSION_BUS_ADDRESS="" seems to work around this issue

$ DBUS_SESSION_BUS_ADDRESS="" myst build --all

Proposed solution

Probably we need more debugging

rowanc1 commented 8 months ago

These logs/conversions are coming from inkscape, but if there are more environment variables, etc. that we should be setting to ensure that things work that is certainly on MyST. I haven't come across this particular error before, so we might need help reproducing.

agoose77 commented 8 months ago

Has anyone previously looked at whether PDFKit a viable alternative to inkscape?