Problem converting Jupyter notebook file to PDF - "...-svg-tex.pdf" files not found #14621
DescriptionI wanted to convert an existing Jupyter notebook file to PDF using Quarto. The error I get suggests that PDF versions of the plots need to be generated and that they are missing. The command and its output are below. I looked at the log file and apart from some missing symbols in the fonts I don't see anything related except maybe for this: What is 'shell escape' or 'write18'? |
Replies: 4 comments 6 replies
SVG is not a supported image format for PDF files. When your ipynb has them, Quarto tries to convert them to svg, using an external tool. I believe this warning is coming from |
|
Without have full access to your Jupyter Notebook, I can only give you some explanation of the error. LaTeX by default does not supports SVG. Authors should use PDF, EPS, PNG or JPG as format for images. Some LaTeX packages provides support to SVG by using Inkscape to convert the SVG to PDF. For the package to work, user must allow LaTeX to escape the sandbox and call other programs. The explicit permission is required because run third-party instructions is dangerous given that they could remove your files by running Quarto runs LaTeX in the safe mode and this creates the error that you see. When working with Quarto and R, some packages like ggplot know what output you are producing and create the figures in the correct format. You should be able to manually change the output format in the code cell of your Jupyter Notebook to PDF, EPS, PNG or JPG and you will solve the problem you reported. |
This comment was marked as spam.
This comment was marked as spam.
|
Thanks for posting the fix, @stefkuypers. Since the space in the filename seems to be the trigger, here's my guess at why it happens, plus some options. Likely cause: Quarto normally converts SVG figures to PDF itself before LaTeX runs (e.g. with rsvg-convert), so LaTeX never sees SVGs. The Package svg error in your log means the raw .svg files reached LaTeX, which then tried to call Inkscape. That needs shell escape, and Quarto doesn't enable it. The Package svg Warning about write18 was only a symptom. The real issue was that the SVG-to-PDF step didn't happen. My guess is that a path containing a space (AMS inequality files/figure-pdf/...) broke that conversion step somewhere, but I haven't confirmed this. Workarounds if you hit it again: Avoid spaces in filenames, as you did (AMS_inequality.qmd). Suggestion: This looks reproducible with a small example (a .qmd with one plot, filename containing a space, rendered --to pdf), so it may be worth opening an issue in quarto-cli. Include the Quarto version, OS, and whether the Julia engine is involved. Maintainers can then decide whether this is a Quarto bug or an engine-specific one. |
I solved it! Apparently the problem was the space in the filename.
When I run this command:
I get a .aux, .log and .tex file and an "AMS inequality_files" folder with a "figure-pdf" subfolder containing only .svg files and the error mentioned before.
When I rename the file and run this command:
everything works just fine. I'm guessing this is some bizarre bug.