Repository navigation
Description
Bug description
Quarto produces an error when attempting to render or preview a document with a thm- cross reference.
Other cross references suggest as rem- and .proof cross references do not cause this error.
Steps to reproduce
Render or preview this Quarto file:
---
title: Theorems don't work here
format:
html:
code-fold: true
---
::: {#thm-line}
## Line
The equation of any straight line, called a linear equation, can be written as:
$$
y = mx + b
$$
:::
See @thm-line.
Expected behavior
No error and document renders.
Actual behavior
Quarto produces the indicated error and the document does not render.
Error running filter /opt/quarto/share/filters/main.lua:
/opt/quarto/share/filters/main.lua:12347: attempt to index a nil value (local 'order')
stack traceback:
/opt/quarto/share/filters/main.lua:11793: in function 'captionPrefix'
/opt/quarto/share/filters/main.lua:20686: in field 'render'
/opt/quarto/share/filters/main.lua:835: in local 'filter_fn'
/opt/quarto/share/filters/main.lua:302: in function </opt/quarto/share/filters/main.lua:292>
(...tail calls...)
[C]: in ?
[C]: in method 'walk'
/opt/quarto/share/filters/main.lua:224: in function </opt/quarto/share/filters/main.lua:214>
(...tail calls...)
/opt/quarto/share/filters/main.lua:936: in local 'callback'
/opt/quarto/share/filters/main.lua:951: in upvalue 'run_emulated_filter_chain'
/opt/quarto/share/filters/main.lua:987: in function </opt/quarto/share/filters/main.lua:984>
stack traceback:
/opt/quarto/share/filters/main.lua:224: in function </opt/quarto/share/filters/main.lua:214>
(...tail calls...)
/opt/quarto/share/filters/main.lua:936: in local 'callback'
/opt/quarto/share/filters/main.lua:951: in upvalue 'run_emulated_filter_chain'
/opt/quarto/share/filters/main.lua:987: in function </opt/quarto/share/filters/main.lua:984>
Your environment
- IDE: VS Code V
Version: 1.86.0
Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937
Date: 2024-01-31T10:27:46.147Z
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Linux x64 6.6.10-76060610-generic - Quarto Version: 1.4.529
- OS: Pop!_OS 22.04 LTS
GNOME Version 42.9
Windowing System X11
Quarto check output
Quarto 1.4.529
[✓] 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.529
Path: /opt/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /home/robert/.TinyTeX/bin/x86_64-linux
Version: 2023
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.10.12
Path: /usr/bin/python3
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking R installation...........OK
Version: 4.3.2
Path: /usr/lib/R
LibPaths:
- /home/robert/R/x86_64-pc-linux-gnu-library/4.3
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.44
rmarkdown: 2.23
[✓] Checking Knitr engine render......OK
Activity
cderv commentedon Feb 6, 2024
Can you try latest released version which is 1.4.549 ?
I can't reproduce this issue on my side with latest 1.4 or current dev 1.5 version.
rpchastain commentedon Feb 6, 2024
I've updated to 1.4.549 and the error is still occurring.
cderv commentedon Feb 6, 2024
I copy pasted the above document in index.qmd
Run
quarto render index.qmdwithout errorSo I can't reproduce really. 🤔
mcanouil commentedon Feb 7, 2024
FWIW, no issues either on MacOS.
cscheid commentedon Feb 7, 2024
Is it possible that you are working inside a bigger website project? In that case, it's possible that you have a stale crossref index file. Does your project have a
.quartosubdirectory? If so, that subdirectory should be safe to delete and then a new render should remove the problem.(If this is the underlying cause of the issue, then that's a bug on our side, but sadly one for which we don't currently have a good workaround for.)
rpchastain commentedon Feb 7, 2024
@cscheid I was working in a larger project. Deleting the
.quartodirectory fixed the issue for me and I'm now able to render the document as expected. Thank you!cderv commentedon Feb 7, 2024
It seems this was indeed the problem.
@cscheid do we want to keep this open to track this issue ?
cscheid commentedon Feb 7, 2024
@cderv yes - something like ".quarto directory should have quarto's version information in it"
[-]Error rendering Quarto file with a thm cross reference[/-][+].quarto directory should have quarto's version information in it to remove stale crossref index and prevent unexplicit errors[/+]