You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating HTML, PDF and DOCX formats from the same document which includes a SVG image, PDF generation fails. If generating only HTML and PDF, then all three outputs succeed.
Here is a minimal project which demonstrates the issue:
The archive contains three files: a simple _quarto.yml, a SVG image and a simple document which references the image. If you run quarto render in the directory where you extract this archive, PDF generation will fail with the following error:
ERROR:
compilation failed- error
Unable to load picture or PDF file 'quazz_files/mediabag/piechart.pdf'.
<to be read again>
}
l.169 ...eight]{quazz_files/mediabag/piechart.pdf}
see /Users/igor/Gliwa/tmp/quazz/quazz.log for more information.
ERROR: Error
at renderFiles (file:///Applications/quarto/bin/quarto.js:78081:29)
at eventLoopTick (ext:core/01_core.js:153:7)
at async renderProject (file:///Applications/quarto/bin/quarto.js:78479:25)
at async Command.actionHandler (file:///Applications/quarto/bin/quarto.js:83077:32)
at async Command.execute (file:///Applications/quarto/bin/quarto.js:8017:13)
at async Command.parseCommand (file:///Applications/quarto/bin/quarto.js:7907:20)
at async quarto (file:///Applications/quarto/bin/quarto.js:118224:9)
at async file:///Applications/quarto/bin/quarto.js:118244:9
at async mainRunner (file:///Applications/quarto/bin/quarto.js:118128:9)
at async file:///Applications/quarto/bin/quarto.js:118235:5
If you now modify _quarto.yml and remove DOCX from output formats (remove or comment out the docx: {} line), PDF generation will succeed. I haven't tested them all, but I think you can use any format instead of docx to demonstrate the issue.
What I believe happens here is that Quarto (or Pandoc) use rsvg-convert to convert the SVG image to PDF. This succeeds and the resulting image is placed in quazz_files/mediabag/piechart.pdf. Pandoc generates a Tex file referencing that image. Now Quarto manages to delete that file (in fact it deletes the entire mediabag subdirectory) before Latex processes Pandoc's output. Latex then fails to find the referenced PDF image.
This only happens with SVG images. PNG images for example go fine. It also only happens if more than HTML and PDF output formats are listed in _quarto.yml.
Rendering to PDF on its own with quarto render --to pdf will succeed even if extra formats are specified in _quarto.yml. Ony rendering them all together with quarto render fails.
Am I doing something wrong?
Steps to reproduce
To reproduce this without the archive attached above, follow these steps:
Create a Quarto project with default type using quarto create project default . quazz --no-open. This will generate two files in the current directory named _quarto.yml and quazz.qmd.
Find any SVG image and save it as piechart.svg.
Put this in quazz.qmd:
---title: "quazz"---
This is a symbol of a pie chart in SVG:
![Symbolic pie chart](/piechart.svg"A SVG Picture"){width=20%}
That is it.
Expected is generation of three output documents as specified in _quarto.yml.
Actual behavior
PDF generation fails with an error.
Your environment
IDE: VIM, but not relevant. Any text editor will do.
OS: macOS Sequoia 15.0
Quarto check output
Quarto 1.5.57
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.5.57
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: v2024.09
Chromium: 869685
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/igor/Library/TinyTeX/bin/universal-darwin
Version: 2024
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.12.6
Path: /usr/local/opt/[email protected]/bin/python3.12
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking R installation...........OK
Version: 4.4.1
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/library
knitr: (None)
rmarkdown: (None)
The knitr package is not available in this R installation.
Install with install.packages("knitr")
The rmarkdown package is not available in this R installation.
Install with install.packages("rmarkdown")
The text was updated successfully, but these errors were encountered:
Bug description
When generating HTML, PDF and DOCX formats from the same document which includes a SVG image, PDF generation fails. If generating only HTML and PDF, then all three outputs succeed.
Here is a minimal project which demonstrates the issue:
quazz.zip
The archive contains three files: a simple
_quarto.yml
, a SVG image and a simple document which references the image. If you runquarto render
in the directory where you extract this archive, PDF generation will fail with the following error:If you now modify
_quarto.yml
and remove DOCX from output formats (remove or comment out thedocx: {}
line), PDF generation will succeed. I haven't tested them all, but I think you can use any format instead ofdocx
to demonstrate the issue.What I believe happens here is that Quarto (or Pandoc) use
rsvg-convert
to convert the SVG image to PDF. This succeeds and the resulting image is placed inquazz_files/mediabag/piechart.pdf
. Pandoc generates a Tex file referencing that image. Now Quarto manages to delete that file (in fact it deletes the entiremediabag
subdirectory) before Latex processes Pandoc's output. Latex then fails to find the referenced PDF image.This only happens with SVG images. PNG images for example go fine. It also only happens if more than HTML and PDF output formats are listed in
_quarto.yml
.Rendering to PDF on its own with
quarto render --to pdf
will succeed even if extra formats are specified in_quarto.yml
. Ony rendering them all together withquarto render
fails.Am I doing something wrong?
Steps to reproduce
To reproduce this without the archive attached above, follow these steps:
quarto create project default . quazz --no-open
. This will generate two files in the current directory named_quarto.yml
andquazz.qmd
.piechart.svg
.quazz.qmd
:_quarto.yml
:quarto render
Expected behavior
Expected is generation of three output documents as specified in
_quarto.yml
.Actual behavior
PDF generation fails with an error.
Your environment
Quarto check output
The text was updated successfully, but these errors were encountered: