quarto-dev / quarto-dev/quarto-cli
Citation order within brackets affects citation grouping
@cderv is already working on this.
Since Jan 30, 2025.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
This issue is triggered under very specific conditions. I tried to reduce the problem as much as possible, and a reproducible example is available in this repository: https://github.com/apcamargo/quarto-citations-bug
In certain cases, multiple citations within square brackets fail to group correctly in the resulting HTML (see the first line of the screenshot below). Through testing, I identified that this issue is triggered, in this specific example, when the following conditions are met:
- The text preceding the citations is highlighted using
quarto-highlight-text. - The text preceding the citations is enclosed in parentheses
(). - The word
Figuresis used instead ofFigure. - The citations within the square brackets are in a specific order. In this case:
[@soto_perez_crispr_cas_2019; @gregory_gut_2020; @nayfach_metagenomic_2021]or[@soto_perez_crispr_cas_2019; @nayfach_metagenomic_2021; @gregory_gut_2020].
Steps to reproduce
git clone git@github.com:apcamargo/quarto-citations-bug.git
cd quarto-citations-bug.git
quarto preview
Expected behavior
Citations within square brackets should be grouped regardless of the order of the citations or the text preceding the opening of the brackets.
Actual behavior
The text preceding the citations as well as the order of citations within the square brackets can prevent citations from being grouped.
Your environment
- IDE: Positron Version: 2025.01.0 (Universal) build 39
- OS: macOS 15.2 (24C101)
Quarto check output
Quarto 1.6.40
[✓] Checking environment information...
Quarto cache location: /Users/APCamargo-M55/Library/Caches/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.6.40
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Tex: (not detected)
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.9.20 (Conda)
Path: /Users/APCamargo-M55/.mambaforge/bin/python
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with conda install jupyter
[✓] Checking R installation...........(None)
Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/
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.
Assessment
This issue has not been assessed yet.