Closed iandol closed 4 months ago
Thanks for the report. The inline syntax does produce a crash.
Alternatively, the fenced div syntax works.
---
title: "No Caption Figure Test"
author: Jane Doe
format: typst
---
Text.
:::{#fig-xkcd}
![](xkcd.png)
:::
Text.
Thanks for the report. (For our own sake, this is another side-effect of the Pandoc upstream fix that removed empty Plain nodes)
I'm experiencing this same issue when rendering to HTML. I get a similar Lua error...
Error running filter /Applications/quarto/share/filters/main.lua:
/Applications/quarto/share/filters/main.lua:11765: attempt to index a nil value (field 'caption_long')
stack traceback:
[C]: in ?
[C]: in method 'walk'
/Applications/quarto/share/filters/main.lua:557: in function </Applications/quarto/share/filters/main.lua:546>
(...tail calls...)
/Applications/quarto/share/filters/main.lua:11762: in local 'filter_fn'
/Applications/quarto/share/filters/main.lua:635: in function </Applications/quarto/share/filters/main.lua:625>
(...tail calls...)
[C]: in ?
[C]: in method 'walk'
/Applications/quarto/share/filters/main.lua:557: in function </Applications/quarto/share/filters/main.lua:546>
(...tail calls...)
/Applications/quarto/share/filters/main.lua:1334: in local 'callback'
/Applications/quarto/share/filters/main.lua:1352: in upvalue 'run_emulated_filter_chain'
/Applications/quarto/share/filters/main.lua:1388: in function </Applications/quarto/share/filters/main.lua:1385>
stack traceback:
/Applications/quarto/share/filters/main.lua:557: in function </Applications/quarto/share/filters/main.lua:546>
(...tail calls...)
/Applications/quarto/share/filters/main.lua:11762: in local 'filter_fn'
/Applications/quarto/share/filters/main.lua:635: in function </Applications/quarto/share/filters/main.lua:625>
(...tail calls...)
[C]: in ?
[C]: in method 'walk'
/Applications/quarto/share/filters/main.lua:557: in function </Applications/quarto/share/filters/main.lua:546>
(...tail calls...)
/Applications/quarto/share/filters/main.lua:1334: in local 'callback'
/Applications/quarto/share/filters/main.lua:1352: in upvalue 'run_emulated_filter_chain'
/Applications/quarto/share/filters/main.lua:1388: in function </Applications/quarto/share/filters/main.lua:1385>
stack traceback:
/Applications/quarto/share/filters/main.lua:557: in function </Applications/quarto/share/filters/main.lua:546>
(...tail calls...)
/Applications/quarto/share/filters/main.lua:1334: in local 'callback'
/Applications/quarto/share/filters/main.lua:1352: in upvalue 'run_emulated_filter_chain'
/Applications/quarto/share/filters/main.lua:1388: in function </Applications/quarto/share/filters/main.lua:1385>
Using...
knitr::knit_exit()
I was able to verify it was the images with no captions causing the issue. These are images that previously worked.
The fix offered by @mcanouil works.
This throws the error...
![ ](assets/STAT-415-SEC-1-15.svg){ #fig-STAT-415-SEC-1-15 .lightbox fig-alt="Natural logarithm graph" fig-align="center" width="50%"}
This fixes it...
:::{#fig-STAT-415-SEC-1-15}
![ ](assets/STAT-415-SEC-1-15.svg){.lightbox fig-alt="Natural logarithm graph" fig-align="center" width="50%"}
:::
So, my question is, do I need to fix every image in all documents so that I can render? I hope I provided enough information.
@jbrick55 This should have been fixed in 1.5. Are you using an older version? If so, please upgrade if you can.
@mcanouil , here's what I'm currently using...
Quarto 1.5.53
[✓] 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.53
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/jmh491/Library/TinyTeX/bin/universal-darwin
Version: 2023
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.12.3
Path: /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
Jupyter: 5.7.2
Kernels: sas, python3
(/) Checking Jupyter engine render....Traceback (most recent call last):
File "/Applications/quarto/share/jupyter/jupyter.py", line 21, in <module>
from notebook import notebook_execute, RestartKernel
File "/Applications/quarto/share/jupyter/notebook.py", line 15, in <module>
from yaml import safe_load as parse_string
ModuleNotFoundError: No module named 'yaml'
[✓] Checking Jupyter engine render....OK
Is there anything else I should try updating? Is there cache I should clear??
Could you open a new issue (linking to this one) with a small and fully reproducible example following the guidelines on the issue template?
Bug description
With this code:
I get this crashlog rendering to Typst:
I can stop the crash by removing the cross-ref label OR adding a caption text. Render to HTML or LaTeX and it works as is.
Steps to reproduce
No response
Expected behavior
Typst output doesn't crash main.lua
Actual behavior
No document is produced
Your environment
Quarto 1.5.35 on macOS 14.4.1
Quarto check output