-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
\Hy@DisableOption in \PDF@FinishDoc is local, hence do nothing #97
Comments
Thank you for the report. That's clearly a bug. But I don't think that a global \define@key is the solution. One shouldn't assign commands sometimes locally and sometimes globally. We will look for a solution with |
I add to revert the change to resolve issue #103 and so reopen this one. |
Rather than re-defining
to current Lines 10125 to 10128 in e3c8305
the effect of
as encountered in (I thought about Side note, these duplicated lines look weird: Lines 14845 to 14846 in e3c8305
and Lines 15351 to 15352 in e3c8305
and Lines 16280 to 16281 in e3c8305
and Lines 16619 to 16620 in e3c8305
and Lines 17761 to 17762 in e3c8305
(but not at the first encountered definition of |
by the way, the definition could be simply: \def\Hy@GloballyDisableOption#1{%
\DisableKeyvalOption[package={hyperref},action={warning}]{Hyp}{#1}%
} because this acts by default globally. The warning message looks like this:
which differs slightly from current warning message, but conveys same meaning. Current code of \def\Hy@DisableOption#1{%
\DisableKeyvalOption[local,package={hyperref},action={warning}]{Hyp}{#1}%
} which (untested) promises to be an equivalent replacement of current code. And the advantage now is that both cases are handled the same. But this obsoletes (naturally such a higher level definition of |
Alternative to all of the above (after checking at how \def\Hy@FirstPageHook{%
\PDF@FinishDoc
\Hy@GlobalizeOption{pdfauthor}%
\Hy@GlobalizeOption{pdftitle}%
\Hy@GlobalizeOption{pdfsubject}%
\Hy@GlobalizeOption{pdfcreator}%
\Hy@GlobalizeOption{addtopdfcreator}%
\Hy@GlobalizeOption{pdfcreationdate}%
\Hy@GlobalizeOption{pdfmoddate}%
\Hy@GlobalizeOption{pdfproducer}%
\Hy@GlobalizeOption{pdfkeywords}%
\Hy@GlobalizeOption{pdftrapped}%
\Hy@GlobalizeOption{pdfinfo}%
\global\let\PDF@FinishDoc\ltx@empty
}%
\def\Hy@GlobalizeOption#1{%
\global\expandafter\let\csname KV@Hyp@#1\expandafter\endcsname
\csname KV@Hyp@#1\endcsname
\global\expandafter\let\csname KV@Hyp@#1@default\expandafter\endcsname
\csname KV@Hyp@#1@default\endcsname
} |
Currently,
hyperref
, at the time of first page break, uses\PDF@FinishDoc
to set PDF info fields likepdftitle
and make related options disable. After that, any key-val setting to options likepdftitle
will not influence the corresponding field in the output PDF, and should raise warning\Hy@WarnOptionDisabled
.But, since
\PDF@FinishDoc
is executed inside commands ofatbegshi
package, and\define@key
(provided bykeyval
package) used by\Hy@DisableOption
only 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
.\KV@Hyp@pdftitle
is not redefined after the first page break.\KV@Hyp@pdftitle
is redefined as desired and warning\Hy@WarnOptionDisabled
is raised after the first page break.This issue is first reported, in Chinese, in CTeX-org/forum#42.
The text was updated successfully, but these errors were encountered: