quarto-dev / quarto-dev/quarto-cli

Heading with cross-reference only causes problem in various formats

Open
#12,105 10 comments 0 reactions 1 assignee View on GitHub

@cderv is already working on this.

Since Feb 18, 2025.

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

Description

Bug description

When a section heading consists only of a cross-reference, a duplicate \label{} is created, leading to an incorrect number and hyperlink displaying in the PDF.

Steps to reproduce
---
format: 
    pdf:
        number-sections: true
---

## Section 1

::: {#prp-one}
It is the case that $1+1=2$.
:::

## Proofs of propositions

### @prp-one
Actual behavior
Image
Expected behavior
Image

Produced by replacing final line with ### [Proposition @prp-one]

Your environment

MacOS Sonoma 14.5

Quarto check output
Quarto 1.6.40
[✓] Checking environment information...
      Quarto cache location: /Users/cmccartan/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: (external install)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/cmccartan/Library/TinyTeX/bin/universal-darwin
      Version: 2024

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

[✓] Checking Python 3 installation....OK
      Version: 3.9.6
      Path: /Library/Developer/CommandLineTools/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.4.0
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
      knitr: 1.49
      rmarkdown: 2.29

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