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
Ubuntu 24.04
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
Bug description
Hi,
When using a multiformat render like html + pdf,
pandoc-ext/diagram
callspandoc.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 : Callpandoc.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)
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