Figure numbering for multiple figures not as subfigures
@cscheid is already working on this.
Since Feb 27, 2025.
Assessment
This issue has not been assessed yet.
Description
Bug description
The referencing for figures that are not subfigures but multiple figures defined via a single computation is not working as expected. The label always points to the last figure and extending the label with -1, -2 as for subfigures is not working.
Steps to reproduce
---
title: "foo"
---
Example form the [docs](https://quarto.org/docs/authoring/figures.html#layout):
```{python}
#| label: fig-test
#| layout-ncol: 2
#| fig-cap:
#| - "Line Plot 1"
#| - "Line Plot 2"
import matplotlib.pyplot as plt
plt.plot([1,23,2,4])
plt.show()
plt.plot([8,65,23,90])
plt.show()
```
Referencing the different Figures is not working correctly
- `@fig-test`: @fig-test
- `@fig-test-1`: @fig-test-1
- `@fig-test-1`: @fig-test-2
Actual behavior
I run:
quarto render file.qmd --to pdf
Starting python3 kernel...Done
Executing 'file.quarto_ipynb'
Cell 1/1: 'fig-test'...Done
pandoc
to: latex
output-file: file.tex
standalone: true
pdf-engine: xelatex
variables:
graphics: true
tables: true
default-image-extension: pdf
metadata
documentclass: scrartcl
classoption:
- DIV=11
- numbers=noendperiod
papersize: letter
header-includes:
- \KOMAoption{captions}{tableheading}
block-headings: true
title: foo
WARNING (/tmp/quartobug/.venv/lib/python3.12/site-packages/quarto_cli/share/filters/main.lua:13878) Unable to resolve crossref @fig-test-1
WARNING (/tmp/quartobug/.venv/lib/python3.12/site-packages/quarto_cli/share/filters/main.lua:13878) Unable to resolve crossref @fig-test-2
Rendering PDF
running xelatex - 1
This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
running xelatex - 2
This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
Output created: file.pdf
The label with no extension references the second figure, the two other labels do not exist.
Expected behavior
I expected a table with different labels. The first is ambiguous and (in my opinion) should not provide a result. The second and third line should reference the two figures.
If I do the same with html as output both figures have <div id="fig-test"
Your environment
- Ubuntu 24.04
- Quarto > 1.6.40 (tested also with latest build on github)
Quarto check output
quarto check
Quarto 1.7.3
[✓] Checking environment information...
Quarto cache location: ~/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.7.3
Path: /tmp/quartodebug/.venv/lib/python3.12/site-packages/quarto_cli/quarto-1.7.3/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /usr/bin
Version: 2023
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.12.3
Path: /tmp/quartodebug/.venv/bin/python3
Jupyter: 5.7.2
Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........(None)
Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quarto-dev/quarto-cli
-
binder bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
quarto-dev/quarto-cli#14907 · 3 comments ·
-
brand bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
quarto-dev/quarto-cli#14891 ·
-
brand bug html revealjs
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#14882 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
quarto-dev/quarto-cli#14875 ·
-
Percent scripts: accept raw-string (r""") and '''-delimited markdown cells, as jupytext writes them Openengines-jupyter enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#14850 · 2 comments ·
All issues in quarto-dev/quarto-cli
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy-website#2595 ·