quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.96k stars 326 forks source link

Section cross-references do not work in PDF when using number-sections: false #9879

Open benibargera opened 5 months ago

benibargera commented 5 months ago

Bug description

Section cross-references do not work in PDF when using number-sections: false

_quarto.yml:

project:
  type: book

book:
  title: "Quarto_Example"
  author: "Norah Jones"
  date: "5.6.2024"
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd

bibliography: references.bib

number-sections: false

format:
  html:
    theme: cosmo
  pdf:
    documentclass: scrreprt

editor: visual

intro.qmd:

Introduction {#sec-newer}

This is a book created from markdown and executable code.

See @knuth84 for additional discussion of literate programming.

{r}
1 + 1

And now have a look at the newer part @sec-newer.

This works in the .html file just fine. But in the PDF, I only see the prefix ("Chapter") without the name of the chapter to read / click on. Any idea why?

HTML:

image

PDF:

image

I have experienced this with different quarto versions. Interestingly, when not using number-sections: false, the cross-references work fine both in the PDF and html file.

Steps to reproduce

No response

Expected behavior

I expect the chapter name to appear both in the html file and the PDF.

Actual behavior

The chapter name only appears in the html file. It remains empty with only the prefix in the PDF.

Your environment

Quarto check output

$ quarto check Quarto 1.5.41 [>] Checking versions of quarto binary dependencies... Pandoc version 3.2.0: OK Dart Sass version 1.70.0: OK Deno version 1.41.0: OK Typst version 0.11.0: OK [>] Checking versions of quarto dependencies......OK [>] Checking Quarto installation......OK Version: 1.5.41 Path: C:\Users\user\AppData\Local\Programs\Quarto\bin CodePage: 1252

[>] Checking tools....................OK TinyTeX: v2024.05 Chromium: (not installed)

[>] Checking LaTeX....................OK Using: TinyTex Path: C:\Users\user\AppData\Roaming\TinyTeX\bin\windows\ Version: 2024

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

[>] Checking Python 3 installation....OK Version: 3.10.5 Path: C:/Program Files/Python310/python.exe Jupyter: (None)

  Jupyter is not available in this Python installation.
  Install with py -m pip install jupyter

[>] Checking R installation...........OK Version: 4.2.3 Path: C:/Users/user/AppData/Local/Programs/R/R-4.2.3 LibPaths:

[>] Checking Knitr engine render......OK

mcanouil commented 5 months ago

Thanks for the report! Could you remove all the > in your code block for the YAML? This makes your YAML not usable. Also, please provide the output of quarto check inside a code block. We don't need the output of quarto render.

benibargera commented 5 months ago

Thanks for the report! Could you remove all the > in your code block for the YAML? This makes your YAML not usable. Also, please provide the output of quarto check inside a code block. We don't need the output of quarto render.

Thank you for your reply! Done :)

benibargera commented 5 months ago

@cscheid - Regarding the assignment of this issue to the v1.5 milestone: does this indicate a general bug, or could there be something specific about my code/setup that is causing the failure?

cscheid commented 5 months ago

I'm not sure I understand your question.

We assign issues to milestone when we want to fix them before that milestone ships. All that means is we plan (though don't promise) to fix this by the time 1.5 becomes the stable release.

benibargera commented 5 months ago

Thanks @cscheid. You answered my question. I was trying to understand if I was doing something wrong or if it was a bug. Thank you :)