[tex4ht-commits] [SCM] tex4ht updated: r1090 - trunk/lit

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Wed Mar 16 15:38:50 CET 2022


Author: michal_h21
Date: 2022-03-16 14:38:50 +0000 (Wed, 16 Mar 2022)
New Revision: 1090

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
Log:
reset sectioning commands after titlesec, and reset catcodes in unicode-math

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2022-03-15 15:14:50 UTC (rev 1089)
+++ trunk/lit/ChangeLog	2022-03-16 14:38:50 UTC (rev 1090)
@@ -1,3 +1,12 @@
+2022-03-16  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (unicode-math-hooks.4ht): reset catcodes after
+	\RequirePackage.
+
+	* tex4ht-4ht.tex (titlesec-hooks.4ht, usepackage.4ht): revert
+	patching of sectioning commands by Titlesec.
+	https://tex.stackexchange.com/q/637314/2891
+
 2022-03-15  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (unicode-math-hooks.4ht): don't load Fontspec if it

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2022-03-15 15:14:50 UTC (rev 1089)
+++ trunk/lit/tex4ht-4ht.tex	2022-03-16 14:38:50 UTC (rev 1090)
@@ -924,6 +924,38 @@
 \def\ttl at addcontentsline#1#2{\nobreak}
 >>>
 
+I've found that it is probably best to save definitions of sectioning commands before Titlesec
+is loaded, and then load the saved versions back to the original commands. 
+
+\<add to usepackage\><<<
+\Configure{PackageHooks}{titlesec.sty}{titlesec-hooks.4ht}
+>>>
+
+\<titlesec-hooks.4ht\><<<
+% titlesec-hooks.4ht (|version), generated from |jobname.tex
+% Copyright 2022 TeX Users Group
+|<TeX4ht license text|>
+|<titlesec-packagehooks|>
+\endinput
+>>> \AddFile{9}{titlesec-hooks}
+
+\<titlesec-packagehooks\><<<
+\let\ttl:chapter\chapter
+\let\ttl:section\section
+\let\ttl:subsection\subsection
+\let\ttl:subsubsection\subsubsection
+\let\ttl:paragraph\paragraph
+\let\ttl:subparagraph\subparagraph
+\:AtEndOfPackage{
+  \let\chapter\ttl:chapter
+  \let\section\ttl:section
+  \let\subsection\ttl:subsection
+  \let\subsubsection\ttl:subsubsection
+  \let\paragraph\ttl:paragraph
+  \let\subparagraph\ttl:subparagraph
+}
+>>>
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%
 \Section{Scientific Word}
 
@@ -4169,9 +4201,11 @@
 % Copyright 2021-2022 TeX Users Group
 |<TeX4ht license text|>
 \:dontusepackage{unicode-math}
+\TivhTcats% we need to reset catcodes for : and @ before \RequirePackage
 \@ifpackageloaded{fontspec}{}
 {\RequirePackage{fontspec}} % it is loaded by unicode-math
 \NewDocumentCommand \setmathfont { O{} m O{} }{}
+\catcode`\:=11\makeatletter
 \endinput
 >>> \AddFile{9}{unicode-math-hooks}
 



More information about the tex4ht-commits mailing list.