nameref doesn't work for caption if hyperref + `\DocumentMetadata` is used

Aperta
#433 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
latex, tex
Ambito
tooling

Direzione di ricerca

Start with the minimal example in the issue: with \DocumentMetadata{} and hyperref loaded, \nameref{caption} gets no caption text, and the \newlabel line lacks the title. The issue says nameref only patches \@caption when hyperref is absent, and that hyperref skips the patch under \DocumentMetadata. Compile the example, then trace where \@caption is redefined in each path. Done means \nameref{caption} prints the caption text in this setup and the \newlabel entry carries the title.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

nameref patches \@caption only if hyperref is not used, and hyperref doesn't patch \@caption if \DocumentMetadata is used, and so nobody adds the code to store the title.

\DocumentMetadata{}
\documentclass{article}
\usepackage{hyperref}

\begin{document}
\section{section}
\begin{figure}
\caption{a caption content}\label{caption}
\end{figure}
\nameref{caption}
\end{document}

gives

\newlabel{caption}{{1}{1}{section}{figure.struct.1}{}}
Lingua principale
TeX
Stelle
210
Fork
41
Merge medio
18g 16h
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di latex3/hyperref

Tutte le issue di latex3/hyperref

Issue simili

Altre issue su DevTools

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.