quarto-dev / quarto-dev/quarto-cli

Cross-reference and link to book parts

Open
#2,571 9 comments 5 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Oct 2, 2022.

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

Description

Bug description

I see some unexpected behavior when it comes to cross-referencing and linking to chapters and sections in book parts.

  • When I have a cross-reference to a chapter / level 1 header in a book part, it does not work for html or pdf.
  • When I have a level 2 header in a book part, it does not appear to work at all for pdf output, but a cross-reference to a level 2 header works for html output.
  • When I have a hyperlink to a chapter / level 1 header in a book part, the link appears in the pdf output but it does not link anywhere. In html it works fine.
  • When I have a hyperlink to a level 2 header in a book part, it works in html and pdf.

part_x.qmd:

# Part X {#sec-part-x}

## section x.1 {#sec-part-x-section-1}

chapter_y.qmd:

# Chapter y

Cross-ref to a level 1 header in a part: @sec-part-x

Cross-ref to a level 2 header in a part: @sec-part-x-section-1

Hyperlink to a level 1 header in a part: [part x](part_x.qmd) (The link appears in pdf, but does not work. in html it works)

Hyperlink to a level 2 header in a part: [part x section x.1](part_x.qmd#sec-part-x-section-1)

html output for chapter y:
image

pdf output for chapter y:
image

quarto_1.2
Rstudio daily: 2022.11.0 Build 202 (also used build 83)
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Checklist
  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

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.