Skip to content

Cross-references from unnumbered chapters lose "Chapter" prefix and ignore bracket syntax #14132

@wryfi

Description

@wryfi

Bug description

When using @sec- cross-references from within an unnumbered chapter ({.unnumbered}) to a numbered chapter, the reference renders as 1 My Chapter instead of Chapter 1. The same reference renders correctly as Chapter 1 when placed in a numbered chapter.

Additionally, the bracket syntax documented at Book Crossrefs does not work in this context:

  • [-@sec-chapter1] should produce just 1 but still produces 1 My Chapter
  • [Chapter -@sec-chapter1] should produce Chapter 1 but still produces 1 My Chapter

Minimal reproducible example

_quarto.yml:

project:
  type: book

book:
  title: "Test Book"
  chapters:
    - index.qmd
    - intro.qmd
    - chapter1.qmd

format:
  html:
    theme: cosmo

index.qmd:

# Preface {.unnumbered}

Some preface text.

intro.qmd:

# Introduction {.unnumbered}

See @sec-chapter1 for details.

chapter1.qmd:

# My Chapter {#sec-chapter1}

Chapter content.

Expected behavior

@sec-chapter1 in intro.qmd should render as Chapter 1, consistent with its behavior when placed in a numbered chapter.

Bracket syntax ([-@sec-chapter1], [Chapter -@sec-chapter1]) should also work as documented.

Actual behavior

@sec-chapter1 renders as 1 My Chapter regardless of syntax used.

Quarto version

1.8.27

Related discussions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions