\Hy@DisableOption in \PDF@FinishDoc is local, hence do nothing
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- latex, tex
- Área
- tooling
Línea de trabajo
Rastrea \PDF@FinishDoc, \Hy@DisableOption y las definiciones de claves de keyval y atbegshi para identificar dónde el ámbito local impide que se reemplace el controlador de opciones. Usa el documento mínimo del issue para comparar \KV@Hyp@pdftitle antes y después del primer salto de página; se considera terminado cuando el controlador está deshabilitado globalmente y posteriormente se activa \Hy@WarnOptionDisabled.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Currently, hyperref, at the time of first page break, uses \PDF@FinishDoc to set PDF info fields like pdftitle and make related options disable. After that, any key-val setting to options like pdftitle will not influence the corresponding field in the output PDF, and should raise warning \Hy@WarnOptionDisabled.
But, since
- the
\PDF@FinishDocis executed inside commands ofatbegshipackage, and - the
\define@key(provided bykeyvalpackage) used by\Hy@DisableOptiononly locally (re)defines key,
options like pdftitle are never disabled, hence usages after first page break won't raise any warning.
Following is a quick fix (with test by showing the meaning of \KV@Hyp@pdftitle) by providing global variant of \define@key and using it inside \PDF@FinishDoc.
- Without fix,
\KV@Hyp@pdftitleis not redefined after the first page break. - With the fix,
\KV@Hyp@pdftitleis redefined as desired and warning\Hy@WarnOptionDisabledis raised after the first page break.
\documentclass{article}
\usepackage{hyperref}
\hypersetup{pdftitle={preamble}}
\makeatletter
%% redifined to use \define@key@g
\def\Hy@DisableOption#1{%
\ltx@ifundefined{KV@Hyp@#1@default}{%
\define@key@g{Hyp}{#1}%
}{%
\define@key@g{Hyp}{#1}[]%
}%
{\Hy@WarnOptionDisabled{#1}}%
}
%% add \global version of \defin@key
\def\define@key@g#1#2{%
\@ifnextchar[{\KV@def@g{#1}{#2}}{\global\long\@namedef{KV@#1@#2}####1}}
%% add \global version of \KV@def
\def\KV@def@g#1#2[#3]{%
\global\long\@namedef{KV@#1@#2@default\expandafter}\expandafter
{\csname KV@#1@#2\endcsname{#3}}%
\global\long\@namedef{KV@#1@#2}##1}
\makeatother
\listfiles
\begin{document}
%% this one succeeds in changing the Title field
\hypersetup{pdftitle={before first newpage}}
a
\newpage
%% with fix, this one raises warning
\hypersetup{pdftitle={after first newpage}}
%% check meaing of \KV@Hyp@pdftitle
\makeatletter
\ttfamily
\meaning\KV@Hyp@pdftitle
\makeatother
\end{document}
This issue is first reported, in Chinese, in https://github.com/CTeX-org/forum/issues/42.
- Lenguaje dominante
- TeX
- Estrellas
- 210
- Forks
- 41
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de latex3/hyperref
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 44/100
Todos los issues de latex3/hyperref
Issues similares
-
ds-bot collides with dsh-argp: tool "recall" is already registered, Bot layer never activatesAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Fei2411/DeepSeek-Bot#703 ·
-
enhancement help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Git-Hospital/githealthcheck#61 ·
Los mantenedores suelen responder en 1 día
-
[Server Submission]: Wiro AIAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
cline/mcp-marketplace#3394 ·
-
Assembly "Go to in Memory Editor" does nothing for parallel port, scratchpad and BIOS addressesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
grumpycoders/pcsx-redux#2529 ·
-
语音扩展怎么让气泡和声音对上:之前的几种做法与建议Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Pal-AI-Lab/Coopanion#538 ·
Los mantenedores suelen responder en 1 día