Open zlatkig opened 4 days ago
Where did you see the following?
format:
html: {}
pdf: {}
docx: {}
That is quite not pretty.
You should use default
which is clearer than {}
.
This being said, I can reproduce using a simpler example. Thanks for the report.
---
title: "Quazz"
format:
pdf: default
docx: default
---
![Symbolic pie chart](piechart.svg)
quarto render index.qmd --to all
leads to an error.docx: default
(or change the order) and quarto render index.qmd --to all
works.Somehow, the temporary files seems to be wrongly deleted or at least not at the right time.
The following with docx
as first format also works:
---
title: "Quazz"
format:
docx: default
pdf: default
---
![Symbolic pie chart](piechart.svg)
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
:This is a symbol of a pie chart in SVG:
{width=20%}
That is it.
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