quarto-dev / quarto-dev/quarto-cli

Custom crossref cannot be resolved

Open
#8,956 4 comments 1 reaction 1 assignee View on GitHub

@cscheid is already working on this.

Since Mar 2, 2024.

bug crossref triaged-to
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

I wanted to cross reference supplementary figures in my manuscript so I included a custom crossref for suppfig.
Unfortunately, after rendering quarto gives a warning:

WARNING (/opt/quarto/share/filters/main.lua:12315) Unable to resolve crossref @suppfig-demo-plot

I tested multiple possibilities to check if I am doing something wrong, but I think that is a bug.

Steps to reproduce

Render the following qmd:

---
title: "Title Goes Here"
author:
  - Jane Doe:
crossref:
  custom:
    - kind: float
      key: suppfig
      latex-env: suppfig
      reference-prefix: Figure S
      space-before-numbering: false
      latex-list-of-description: Supplementary Figure
---

# Results

```{r}
#| label: fig-demo-plot
#| fig-cap: "A plot of random numbers"
plot(rnorm(10))
```

```{r}
#| label: suppfig-demo-plot
#| fig-cap: "A plot of random numbers"
plot(rnorm(20))
```

@fig-demo-plot shows how we can have a caption and cross-reference for a plot. 

@suppfig-demo-plot shows how we can't have a caption and cross-reference for supplementary figures.


Expected behavior

I expect to get a rendered crossreference for a supplementary figure

Actual behavior

Now I get a warning that the reference could not be resolved, and the figure is not labeled.

Your environment
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.2 (2023-10-31)
 os       Ubuntu 22.04.3 LTS
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/Berlin
 date     2024-03-02
 pandoc   3.1.1 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
Quarto check output
Quarto 1.5.22
[✓] 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.5.22
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /home/wolass/.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/wolass/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.45
      rmarkdown: 2.25

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.