quarto-dev / quarto-cli

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

Inline reference with custom prefix expanded differently in LaTeX and HTML output #11092

Open raffaem opened 4 days ago

raffaem commented 4 days ago

Bug description

Consider the following MWE:

---
title: "My title"
format:
  pdf: default
  html: default
---

# Section 1

See [TABLE @tbl-letters]:

| Col1 | Col2 | Col3 |
|------|------|------|
| A    | B    | C    |
| E    | F    | G    |
| A    | G    | G    |

: My Caption {#tbl-letters}

If you render it to PDF, the TABLE in the inline reference does not contain a hyperlink: Image

But if you render it to HTML, it does: Image

Steps to reproduce

See above

Expected behavior

Both versions should contain a hyperlink

Actual behavior

HTML output contains a hyperlink, but PDF output does not

Your environment

Quarto check output

Quarto 1.5.57

[✓] 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.57
      Path: /opt/quarto/bin

(|) Checking tools....................
(/) Checking tools....................
[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

(|) Checking LaTeX....................
(/) Checking LaTeX....................
(-) Checking LaTeX....................
(\) Checking LaTeX....................
(|) Checking LaTeX....................
[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /usr/bin
      Version: undefined

(|) Checking basic markdown render....
(/) Checking basic markdown render....
(-) Checking basic markdown render....
(\) Checking basic markdown render....
[✓] Checking basic markdown render....OK

(|) Checking Python 3 installation....
[✓] Checking Python 3 installation....OK
      Version: 3.12.7
      Path: /usr/bin/python3
      Jupyter: 5.7.2
      Kernels: ir, python3

(|) Checking Jupyter engine render....
(/) Checking Jupyter engine render....Traceback (most recent call last):
  File "/opt/quarto/share/jupyter/jupyter.py", line 21, in <module>
    from notebook import notebook_execute, RestartKernel
  File "/opt/quarto/share/jupyter/notebook.py", line 18, in <module>
    import nbformat
ModuleNotFoundError: No module named 'nbformat'

[✓] Checking Jupyter engine render....OK
mcanouil commented 4 days ago

That's not a bug, that's $\LaTeX$ behaviour.

raffaem commented 4 days ago

I think we have to replace

See Table~\ref{tbl-letters}:

with

See \hyperref[tbl-letters]{Table 1}.

in the resulting LaTeX file.

See here

cscheid commented 4 days ago

Our formats are not intended to be exactly identical to each other. In PDF specifically, we choose the rendering that is most common for pdflatex documents. We'd like to support the ability to customize the behavior, but we don't consider it a bug.