Skip to content

Emit better error message in the presence of incorrect -labels specs #4938

@daniel1noble

Description

@daniel1noble

Bug description

Hi,

I've just started getting what appears to be an error with table crossref.lua. This appeared all of a sudden (within the last two weeks). I'm on Mac OS 13.2.1 (22D68), with Quarto v1.78.0 through VSCode 1.76.2. I think everything is updated (R ver 4.2.3) and it worked just a couple of weeks ago and now the render to .docx fails with:

Error running filter /Applications/quarto/share/filters/crossref/crossref.lua:
table expected, got Inline

I'm using the gt() (very. ‘0.6.0’) package for the table I am rendering. Any help would be appreciated. Quarto check below

Thanks

quarto check

[✓] Checking Quarto installation......OK
Version: 1.2.313
Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
Version: 3.9.6
Path: /Applications/Xcode.app/Contents/Developer/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.2.3
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Users/noble/Library/R/arm64/4.2/library
- /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
rmarkdown: 2.20.1

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

Reproducible Example. .qmd file:

---
title: "test"
crossref:
  fig-title: 'Figure'
  fig-labels: arabic
  title-delim: "-"
  fig-prefix: "Figure"
  tbl-labels: "Table"
---
@tbl-tabs1

```{r}
#| label: tbl-tabs1
#| tbl-cap: Test

install.packages("tidyverse"); library(tidyverse)
install.packages("gt"); library(gt)

tabs1 <- data.frame(matrix(rnorm(5*11, 0, 2), ncol = 5, nrow = 11))

gt(tabs1) %>%  
    fmt_number(columns = 2:5, decimals = 2) %>% 
    tab_row_group(label = "Fixed Effects", rows = 1:7) %>% 
    tab_row_group(label = "Random Effects", rows = 8:11) %>%  
    tab_style(style = list(cell_text(weight = "bold")),
          locations = list(cells_column_labels(), cells_row_groups())) %>% 
    opt_table_lines(extent = "none")  %>% 
    tab_style(style = cell_borders(sides = c("top", "bottom")),
          locations = list(cells_column_labels()))  %>% 
    tab_style(style = cell_borders(sides = "bottom", weight = px(2)),
          locations =  cells_body(rows = 7))

```

Which results in a VSCode error:

Error running filter /Applications/quarto/share/filters/crossref/crossref.lua:
table expected, got Inline

as well as an Error in RStudio (2023.03.0+386 (2023.03.0+386)).

Error running filter /Applications/quarto/share/filters/crossref/crossref.lua:
PandocLuaError "all choices failed\n\twhile retrieving stringifyable element"
stack traceback:
	/Applications/quarto/share/filters/crossref/crossref.lua:2660: in function 'processRawTable'
	/Applications/quarto/share/filters/crossref/crossref.lua:2484: in local 'fn'
	/Applications/quarto/share/filters/crossref/crossref.lua:1239: in function </Applications/quarto/share/filters/crossref/crossref.lua:1233>

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
  • Please provide the output of quarto check so we know which version of quarto and its dependencies you're running.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions