quarto-dev / quarto-dev/quarto-cli

Cross reference figures inside `code-summary` error.

Open
#10,420 4 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Aug 15, 2024.

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

Description

Bug description

I am attempting to cite a cross reference inside a code fold summary, but the cross reference is not found.

My main project is a quarto book, but the below example should illustrate the problem.

Inspecting the html code once the project is rendered as an html provides a possible explanation:

data-original-href="http://localhost:7382/filename.html#ref-fig-rf-theory-demo". note that it seems to place ref before the reference. Thus, it cannot find #ref-fig-rf-theory-demo which should be #fig-rf-theory-demo. The bug is that it doesn't recognize the fig prefix so places ref infront. Although I am not an expert in HTML code so I may be misleading you.

Thank you very much in advance.

Steps to reproduce
---
title: "Bug Example"
format: html
---

## Quarto

```{r}
#| label: fig-testing
plot(mtcars)
```

working in text @fig-testing

```{r}
#| code-fold: true
#| code-summary: "Adding a title to @fig-testing"
plot(mtcars, main="add a title")
```


The file rendered to be an html in the preview window.

Expected behavior

I expect that the figure will be cross referenced. Note that I am able to reference other objects inside code-summary such as a paper using @paper2024 and that works fine. for example:
image

Actual behavior

An error is found as if the cross-reference is not found.
image

Your environment
  • Windows 11
    RStudio 2024.04.2+764 "Chocolate Cosmos" Release (e4392fc9ddc21961fd1d0efd47484b43f07a4177, 2024-06-05) for windows
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2024.04.2+764 Chrome/120.0.6099.291 Electron/28.3.1 Safari/537.36, Quarto 1.5.52

  • R: 4.4.1 patched

Quarto check output

Quarto 1.5.52
[>] 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.52
Path: C:\Users\mitch\AppData\Local\Programs\Quarto\bin
CodePage: 1252

[>] Checking tools....................OK
TinyTeX: v2024.07.03
Chromium: 869685

[>] Checking LaTeX....................OK
Using: TinyTex
Path: C:\Users\mitch\AppData\Roaming\TinyTeX\bin\windows
Version: 2024

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

[>] Checking Python 3 installation....OK
Version: 3.11.2
Path: C:/Users/mitch/AppData/Local/Programs/Python/Python311/python.exe
Jupyter: (None)

  Jupyter is not available in this Python installation.
  Install with py -m pip install jupyter

[>] Checking R installation...........OK
Version: 4.4.1
Path: C:/PROGRA1/R/R-441.1PA
LibPaths:
- C:/Users/mitch/AppData/Local/R/win-library/4.4
- C:/Program Files/R/R-4.4.1patched/library
knitr: 1.48.1
rmarkdown: 2.27

[>] 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.