quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.87k stars 317 forks source link

Mediabag directory is purged by pdf render, even if it is needed for other formats #11077

Closed fradav closed 3 days ago

fradav commented 3 days ago

Bug description

Hi,

When using a multiformat render like html + pdf, pandoc-ext/diagram calls pandoc.mediabag.insert which stores an image file into the mediabag directory. It is rendered absolutery fine if the target is only html. The problem is that, for whatever reason, pdf render remove this directory and so invalidates the link to the image inside it for html output. Workaround : Call pandoc.mediabag.insert with a path which lies outside mediabag dir to escape deletion by pdf render and make the pdf format the last in the list.

Suggestion: make an option to keep the mediabag dir alive in case it is needed ?

Steps to reproduce

Clone/fork the computorg/computo-quarto-extension. Remove the workaround (line 318)

quarto render

Expected behavior

The linked svg for the tikz figure should still be valid.

Actual behavior

As explained before, mediabag directory has been wiped out, so the link isn’t valid anymore.

Your environment

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: /opt/quarto/bin

[✓] Checking tools....................OK TinyTeX: v2024.10 Chromium: (not installed)

[✓] Checking LaTeX....................OK Using: TinyTex Path: /home/fradav/.TinyTeX/bin/x86_64-linux Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK Version: 3.12.7 (Conda) Path: /home/fradav/.micromamba/envs/computo-quarto-extension/bin/python Jupyter: 5.7.2 Kernels: python3, ir

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK Version: 4.4.1 Path: /usr/lib/R LibPaths:

[✓] Checking Knitr engine render......OK

mcanouil commented 3 days ago

Thanks!

Duplicate of https://github.com/quarto-dev/quarto-cli/issues/8373