Quarto: how to cross-reference unnumbered book chapter

I woud like to cross-reference an unnumbered section in a quarto book. The quarto docs say this is possible, but I cannot figure out how.

If I want an unnumbered chapter, I'd use this:

# Setup {.unnumbered}

If I want a label I can refer to later with [Chapter -@sec-setup], I'd use this:

# Setup {#sec-setup}

However, combining these in any way I can think of doesn't seem to work. Neither of these work:

# Setup {#sec-setup} {.unnumbered}
# Setup {#sec-setup, .unnumbered}

I don't think cross reference are working for unnumbered section. Referencing use the number as reference in text in all case https://quarto.org/docs/authoring/cross-references.html#references so you need numbering.
The doc here mention that number-sections: true is required https://quarto.org/docs/authoring/cross-references.html#sections

The doc you linked too says

Quarto book chapters and sections are automatically numbered (for cross-referencing), however you can also specify that some parts of the book should remain unnumbered.

Meaning that, you can reference any section by default in books as they are numbered by default, but you can create unnumbered section that won't be referencable using @id syntax.

If the section you want to link too is in the same document, you could probably use section linking using [text](#id-of-section). This should work from within the same doc.

Cross referencing works across all documents but it requires numbering.

Hope it helps

Thanks! Helpful, and it's obvious now why I can't refer to "Chapter #" when the chapter is unnumbered. I think I'll solve this problem by putting it an appendix in the quarto yml and referencing as [Appendix -@sec-setup].

1 Like