[latex3-commits] [git/LaTeX3-latex3-hyperref] cleanup-patches: Revert "remove check for old toc, contentsline has now the right number of arguments" (a9c6de8)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Jul 15 09:33:30 CEST 2021


Repository : https://github.com/latex3/hyperref
On branch  : cleanup-patches
Link       : https://github.com/latex3/hyperref/commit/a9c6de8802bf5e6477eaf290aac0f4a53e755f8e

>---------------------------------------------------------------

commit a9c6de8802bf5e6477eaf290aac0f4a53e755f8e
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Jul 14 23:47:21 2021 +0200

    Revert "remove check for old toc, contentsline has now the right number of arguments"
    
    This reverts commit c53634e916ea11fa8cc13dce657162010a87bcaf.


>---------------------------------------------------------------

a9c6de8802bf5e6477eaf290aac0f4a53e755f8e
 hyperref.dtx | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/hyperref.dtx b/hyperref.dtx
index b88ba7d..81544bc 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -9646,9 +9646,27 @@
 % with aux and toc written the standard way.
 %
 % If hyperref was used last time, do nothing. If it was not used,
-% redefine newlabel to cope with it.
+% or an old version of hyperref was used, don't use that TOC at all
+% but generate a warning. Not ideal, but better than failing
+% with pre-5.0 hyperref TOCs.
 %    \begin{macrocode}
   \ifx\hyper at last\@undefined
+    \def\@starttoc#1{%
+      \begingroup
+        \makeatletter
+        \ltx at ifpackageloaded{parskip}{\parskip\z@}{}%
+        \IfFileExists{\jobname.#1}{%
+          \Hy at WarningNoLine{%
+            old #1 file detected, not used; run LaTeX again%
+          }%
+        }{}%
+        \if at filesw
+          \expandafter\newwrite\csname tf@#1\endcsname
+          \immediate\openout\csname tf@#1\endcsname \jobname.#1\relax
+        \fi
+        \@nobreakfalse
+      \endgroup
+    }%
     \def\newlabel#1#2{\@newl at bel r{#1}{#2{}{}{}{}}}%
   \fi
 }





More information about the latex3-commits mailing list.