[tex4ht-commits] [SCM] tex4ht updated: r1082 - trunk/lit
Michal Hoftich
INVALID.NOREPLY at gnu.org.ua
Sat Feb 19 22:28:26 CET 2022
Author: michal_h21
Date: 2022-02-19 21:28:26 +0000 (Sat, 19 Feb 2022)
New Revision: 1082
Modified:
trunk/lit/ChangeLog
trunk/lit/tex4ht-4ht.tex
Log:
define hyperref captions
Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog 2022-02-19 21:07:02 UTC (rev 1081)
+++ trunk/lit/ChangeLog 2022-02-19 21:28:26 UTC (rev 1082)
@@ -1,5 +1,9 @@
2022-02-19 Michal Hoftich <michal.h21 at gmail.com>
+ * tex4ht-4ht.tex (hyperref-hooks.4ht): define autoref captions, so
+ they are available in the preamble.
+ https://tex.stackexchange.com/q/634043/2891
+
* tex4ht-4ht.tex (usepackage.4ht, pdfx-hooks.4ht): disable loading
of the Pdfx package.
https://tex.stackexchange.com/q/634043/2891
Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex 2022-02-19 21:07:02 UTC (rev 1081)
+++ trunk/lit/tex4ht-4ht.tex 2022-02-19 21:28:26 UTC (rev 1082)
@@ -5181,8 +5181,10 @@
% hyperref-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
-% we don't have any code here for now
+\:AtEndOfPackage{%
|<load nameref in hyperref hooks|>
+|<define autoref captions|>
+}
>>> \AddFile{9}{hyperref-hooks}
We need to load Nameref here, otherwise lot of documents
@@ -5194,7 +5196,6 @@
TeX4ht hooks.
\<load nameref in hyperref hooks\><<<
-\:AtEndOfPackage{%
\@ifpackageloaded{nameref}{}
{%
\RequirePackage{ifthen}%
@@ -5202,11 +5203,40 @@
\RequirePackage{nameref}%
\let\label\sv:label
%\input nameref.4ht
-}}
+}
>>>
+Hyperref defines following captions at the end of the package.
+The problem is that Hyperref detects TeX4ht, and stops its
+loading too early, before the captions are declared.
+They are available in the document, but not in the preamble.
+This can result in compilation errors if user tries to redefine
+one of these captions in the preamble.
+\<define autoref captions\><<<
+\providecommand*\AMSautorefname{\equationautorefname}
+\providecommand*\Hfootnoteautorefname{\footnoteautorefname}
+\providecommand*\Itemautorefname{\itemautorefname}
+\providecommand*\itemautorefname{item}
+\providecommand*\equationautorefname{Equation}
+\providecommand*\footnoteautorefname{footnote}
+\providecommand*\itemautorefname{item}
+\providecommand*\figureautorefname{Figure}
+\providecommand*\tableautorefname{Table}
+\providecommand*\partautorefname{Part}
+\providecommand*\appendixautorefname{Appendix}
+\providecommand*\chapterautorefname{chapter}
+\providecommand*\sectionautorefname{section}
+\providecommand*\subsectionautorefname{subsection}
+\providecommand*\subsubsectionautorefname{subsubsection}
+\providecommand*\paragraphautorefname{paragraph}
+\providecommand*\subparagraphautorefname{subparagraph}
+\providecommand*\FancyVerbLineautorefname{line}
+\providecommand*\theoremautorefname{Theorem}
+\providecommand*\pageautorefname{page}
+>>>
+
\<nameref moved from old hyperref\><<<
\def\tht:label#1{%
\@bsphack
More information about the tex4ht-commits
mailing list.