texlive[63781] Master/texmf-dist: \hyperref undefined ref, tex4ht
commits+karl at tug.org
commits+karl at tug.org
Fri Jul 1 23:55:39 CEST 2022
Revision: 63781
http://tug.org/svn/texlive?view=revision&revision=63781
Author: karl
Date: 2022-07-01 23:55:38 +0200 (Fri, 01 Jul 2022)
Log Message:
-----------
\hyperref undefined ref, tex4ht r1164
Revision Links:
--------------
http://tug.org/svn/texlive?view=revision&revision=1164
Modified Paths:
--------------
trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
trunk/Master/texmf-dist/tex/generic/tex4ht/hyperref.4ht
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2022-07-01 20:48:32 UTC (rev 63780)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2022-07-01 21:55:38 UTC (rev 63781)
@@ -1,3 +1,9 @@
+2022-07-01 Michal Hoftich <michal.h21 at gmail.com>
+
+ * tex4ht-4ht.tex (hyperref.4ht): fixed handling of undefined
+ references in the \hyperref command.
+ https://tex.stackexchange.com/a/649552/2891
+
2022-06-30 Michal Hoftich <michal.h21 at gmail.com>
* tex4ht-mathml.tex (mathml.4ht): retain text formatting inside
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex 2022-07-01 20:48:32 UTC (rev 63780)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex 2022-07-01 21:55:38 UTC (rev 63781)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1161 2022-06-27 10:03:53Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1164 2022-07-01 14:16:09Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2022 TeX Users Group
@@ -5321,10 +5321,7 @@
% \Configure{ref}{}{}{}\ref{#1}}}
\<config hyperref\><<<
-\def\label at hyperref[#1]#2{{%
- \def\hyperrefLabel{#2}%
- \Configure{ref}
- {\Link}{\EndLink}{\Configure{ref}{}{}{}#2}\ref{#1}}}
+|<label@@hyperref|>
|<autoref references|>
|<restore pre hyperref|>
|<nameref.sty NOT HERE|>
@@ -5331,6 +5328,35 @@
\csname ReadBookmarks\endcsname
>>>
+% We don't use this code anymore
+% \def\label at hyperref[#1]#2{{%
+% \def\hyperrefLabel{#2}%
+% \Configure{ref}
+% {\Link}{\EndLink}{\Configure{ref}{}{}{}#2}\ref{#1}}}
+
+The \Verb+\hyperref[label]{title}+ command should print the
+title when label is undefined. The older configuration printed
+?? instead. This should fix this issue.
+\Link{https://tex.stackexchange.com/a/649552/2891}{}More info\EndLink.
+
+\<label@@hyperref\><<<
+\def\label@@hyperref#1#2#3{%
+ \ifx#1\relax
+ \protect\G at refundefinedtrue
+ \@latex at warning{%
+ Hyper reference `#2' on page \thepage \space undefined%
+ }%
+ \begingroup
+ \hyperrefundefinedlink{#3}%
+ \endgroup
+ \else%
+ \def\hyperrefLabel{#3}%
+ \Configure{ref}%
+ {\Link}{\EndLink}{\Configure{ref}{}{}{}#3}\ref{#2}%
+ \fi
+}
+>>>
+
A \Verb+\def\@@hyperref#1#2#3{\Link[#2]{}{}#1\EndLink}+
got removed since it fails the second case below.
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/hyperref.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/hyperref.4ht 2022-07-01 20:48:32 UTC (rev 63780)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/hyperref.4ht 2022-07-01 21:55:38 UTC (rev 63781)
@@ -1,4 +1,4 @@
-% hyperref.4ht (2022-04-14-13:38), generated from tex4ht-4ht.tex
+% hyperref.4ht (2022-07-01-14:27), generated from tex4ht-4ht.tex
% Copyright 1999-2009 Eitan M. Gurari
% Copyright 2009-2022 TeX Users Group
%
@@ -17,7 +17,7 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2022-04-14-13:38}
+\immediate\write-1{version 2022-07-01-14:27}
\csname end:hyperref\endcsname
@@ -361,10 +361,22 @@
\endcsname{\let\hyper:normalise\def}%
\expandafter\pend:def\csname href \endcsname{\let\hyper:normalise\def}%
\pend:defI\T at ref{\edef\RefArg{##1}}}
-\def\label at hyperref[#1]#2{{%
- \def\hyperrefLabel{#2}%
- \Configure{ref}
- {\Link}{\EndLink}{\Configure{ref}{}{}{}#2}\ref{#1}}}
+\def\label@@hyperref#1#2#3{%
+ \ifx#1\relax
+ \protect\G at refundefinedtrue
+ \@latex at warning{%
+ Hyper reference `#2' on page \thepage \space undefined%
+ }%
+ \begingroup
+ \hyperrefundefinedlink{#3}%
+ \endgroup
+ \else%
+ \def\hyperrefLabel{#3}%
+ \Configure{ref}%
+ {\Link}{\EndLink}{\Configure{ref}{}{}{}#3}\ref{#2}%
+ \fi
+}
+
\Configure{@newlabel}{\@onelevel at sanitize\@currentlabelname}
\append:def\protect:wrtoc{\def\ref{\protect\o:ref}}
More information about the tex-live-commits
mailing list.