Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG->PDF conversion fails when there is more than one image #282

Closed
alcrene opened this issue Mar 1, 2023 · 4 comments
Closed

SVG->PDF conversion fails when there is more than one image #282

alcrene opened this issue Mar 1, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@alcrene
Copy link

alcrene commented Mar 1, 2023

What version of mystjs are you using?

0.1.17

How did you install myst?

npm

What operating system are you using?

Linux

Which area is this feature request for?

Command Line Interface, Export: LaTeX or PDF

Describe the Bug

When compiling a document with SVG images, myst build --tex will attempt to convert them to PDF with Inkscape. However, if there is more than one image, the call fails with

Converting 6 SVG images to PDF using inkscape
ConcreteInkscapeApplication<Gtk::Application>::on_open:
Can't use '--export-filename' with multiple input files (output file would be overwritten for each input file).
Please use '--export-type' instead and rename manually.

Expected Behavior

Presumably this line is actually making a single batch call, rather than looping over file names and calling Inkscape separately on each ?

To Reproduce

Inkscape version:

  • Inkscape 1.2.2 (b0a8486541, 2022-12-01)
@alcrene alcrene added the bug Something isn't working label Mar 1, 2023
@rowanc1
Copy link
Collaborator

rowanc1 commented Mar 1, 2023

How strange, thank you for the bug report -- could you confirm that a single image does actually works? (e.g. commenting out all but one figure and trying a build?)

I don't believe that the code batches the images with inkscape, and instead loops over calls in Javascript, but that message certainly suggests that it does. If a single image does not work, it could be the version of inkscape installed.

Maybe @fwkoch you have other ideas?

@alcrene
Copy link
Author

alcrene commented Mar 1, 2023

Curious: This happens when I build the sources for the paper I am currently porting to MySTJS, but it doesn't happen when I build an empty document with just the figures.
So there must be an interaction with another part of the build process.
The paper doesn't build yet, so it's a bit hard to debug directly on that – I will finish that first, then I'll see if I can pare it down to a MWE for this issue.

@alcrene
Copy link
Author

alcrene commented Mar 2, 2023

To answer the question: Yes, this also occurs when there is only one figure.

Converting 1 SVG image to PDF using inkscape
ConcreteInkscapeApplication<Gtk::Application>::on_open:
Can't use '--export-filename' with multiple input files (output file would be overwritten for each input file).
Please use '--export-type' instead and rename manually.

So the issue title is incorrect. Rather, it seems to occur when the figures are inside another environment, in this case images in the {tab-set} or {margin} directives are causing the issue.
I also have an SVG image in a {sidebar} directives which does not trigger the error.
(From this you may surmise that I am porting a document that was originally written for Jupyter Book)

I think it could be that the first two environments are not actually supported by mystjs, so that may be related ?
(On a tangential note, a list of incompatibilities between Jupyter Book and mystjs would be useful. I will try to keep track of those I notice.)

For the record though, it is actually difficult to trim down to a minimal example. Even just copying to a different folder, or working on a different machine (with an earlier Inkscape version) can make the error go away.

So given the challenge of reproducing this, and that it might be limited to using unsupported directives, I would propose to close the issue. If I can make a small breaking example I will reopen it.

@alcrene alcrene closed this as completed Mar 2, 2023
@rowanc1
Copy link
Collaborator

rowanc1 commented Mar 2, 2023

Hi @alcrene, we are attempting to keep a list of the incompatibilities here: #189 if you notice things that are not on that list, please raise them!! We will get to them as fast as we can! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants