Repository navigation
Description
Bug description
An mwe can be found in the github repo
https://github.com/Sciemon/issue_figures_folder
Somehow latex assumes the figures are in a 'mediabag' folder that does not exist.
Steps to reproduce
It is only possible to render (with quarto render ...) the file 'model_requirements.qmd' if 'docx: default' is deleted from the yaml.
Expected behavior
if 'docx: default' is deleted, the pdf is rendered
Actual behavior
Otherwise latex throws the following error:
ERROR:
compilation failed- error
Unable to load picture or PDF file 'model_requirements_files/mediabag/figs/SVS_droop.pdf'.
}
l.373 ...ements_files/mediabag/figs/SVS_droop.pdf}###
Your environment
- IDE: VSCode 1.85.2
- OS: Windows 10
Quarto check output
Quarto 1.4.545
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.1.11: OK
Dart Sass version 1.69.5: OK
Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.4.545
Path: C:\Program Files\Quarto\bin
CodePage: 1252
[>] Checking tools....................OK
TinyTeX: v2024.01
Chromium: (not installed)
[>] Checking LaTeX....................OK
Using: TinyTex
Path: C:\Users\seberlein\AppData\Roaming\TinyTeX\bin\windows
Version: 2023
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....OK
Version: 3.11.7
Path: C:/Users/seberlein/AppData/Local/Programs/Python/Python311/python.exe
Jupyter: 5.7.1
Kernels: python3
(-) Checking Jupyter engine render....Traceback (most recent call last):
File "C:\Program Files\Quarto\share\jupyter\jupyter.py", line 21, in
from notebook import notebook_execute, RestartKernel
File "C:\Program Files\Quarto\share\jupyter\notebook.py", line 14, in
from yaml import safe_load
ModuleNotFoundError: No module named 'yaml'
[>] Checking Jupyter engine render....OK
Activity
cderv commentedon Mar 5, 2024
Some context about the issue.
This is similar to this one
gfmoutput gets overwritten if other formats are also generated #6705but happens with mediabag supporting files and with output file name conflict.
Overall issue is order of cleanup for supporting files
I am putting back what I shared there at #6705 (comment) by adapting to this use case.
Cleanup code is in
renderCleanup()quarto-cli/src/command/render/cleanup.ts
Lines 48 to 55 in 248a3a4
we are cleanup supporting file in some situations and this happens with docx format.
We cleanup the whole directory and not just the file associated to the format
quarto-cli/src/command/render/cleanup.ts
Lines 83 to 88 in 248a3a4
When rendering to
--to allwe pass through this 3 times, and not in the order I though.docxcleanup will happen before PDF rendering.quarto-cli/src/command/render/render-files.ts
Lines 717 to 724 in e831190
If
docxis called first, the cleaning step happens last. So PDF rendering can work ok.Try just putting
docxfirst as a workaroundSetting
keep-md: truein the YAML as global, or just underdocxformat will also prevent the cleaning before PDF Rendering and should avoid the issueThis is a topic we can deal with
It will happen with any combination of formats mixing
embed-resources) or PDF that needs supporting file for tex rendering.This would probably be the better options. @cscheid do you agree ?
[-]pdf rendering works only if docx format is not specified[/-][+]Supporting file are cleanup to soon when using multiformat[/+]cderv commentedon Sep 11, 2024
New use case I found:
Adding
keep-typsolves itSo it is not possibly to use the variant format with Typst right now because of our rendering and cleaning process.
cderv commentedon Oct 1, 2024
#10883 is another report involving docx cleaning before LaTeX rendering happens.
With this svg to reproduce: piechart.svg
Doing reverse order solves it
andrewheiss commentedon May 11, 2026
Hi! Running into this again. I normally address this with the +variant trick and keeping the intermediate markdown file (following this #8373 (comment)), and it works:
↑ this creates two different PDFs with different names, one with a TOC and one without, as expected
But with typst, it doesn't work (as noted here #8373 (comment))
This with
keep-md…… causes this error:
Using
keep-typinstead does allow both formats to render, but they're identical—in this case both PDFs have a TOC:Is there a different way to render two different typst formats like this?
mcanouil commentedon May 13, 2026
The error moved to the new Skylighting post-processor but the underlying ordering is the same as described before.
Trace on
issue.qmdwithformat: { typst: default, typst+toc: { toc: true } }:issue.typ(shared intermediate, no modifier-aware suffix).typst+toccompletes first: compilesissue.pdf, thensafeRemoveSync(issue.typ).typstcompletion then runs its generic post-processors, which now try to read the already-removedissue.typ.Disambiguating
output-fileper format key when modifiers are present would also be needed to make the variant useful, in addition to the broader cleanup-ordering fix tracked in #6518.Relevant codes:
quarto-cli/src/command/render/render-files.ts
Lines 725 to 738 in 57705c3
quarto-cli/src/command/render/render.ts
Lines 260 to 302 in 57705c3
quarto-cli/src/command/render/output-typst.ts
Lines 218 to 220 in 57705c3
quarto-cli/src/command/render/output-typst.ts
Lines 286 to 289 in 57705c3
quarto-cli/src/format/typst/format-typst.ts
Lines 190 to 225 in 57705c3
quarto-cli/src/command/render/render-contexts.ts
Lines 331 to 334 in 57705c3
quarto-cli/src/core/pandoc/pandoc-formats.ts
Lines 204 to 249 in 57705c3