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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Thu Aug 4 19:27:58 CEST 2022


Author: michal_h21
Date: 2022-08-04 17:27:58 +0000 (Thu, 04 Aug 2022)
New Revision: 1181

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-sty.tex
Log:
revert to the original definition of \%

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2022-07-26 08:09:24 UTC (rev 1180)
+++ trunk/lit/ChangeLog	2022-08-04 17:27:58 UTC (rev 1181)
@@ -1,3 +1,9 @@
+2022-08-04  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (latex.4ht): revert to the original definition of
+	\% when TeX4ht doesn't compile literate sources.
+	https://tex.stackexchange.com/a/652950/2891
+
 2022-07-26  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-mathml.tex (mathml.4ht): protect \sum etc., in order to

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2022-07-26 08:09:24 UTC (rev 1180)
+++ trunk/lit/tex4ht-4ht.tex	2022-08-04 17:27:58 UTC (rev 1181)
@@ -1142,6 +1142,7 @@
 
 \<latex ltplain\><<<
 |<plain,ltplain obeylines,oalign|>
+|<ltplain percent|>
 >>>
 
 plain.tex and latex.
@@ -1192,6 +1193,23 @@
 
 \EndVerbatim\EndHPage{}]\fi
 
+
+
+The \''\%' command needs to be redefined for TeX4ht source files,
+but this redefinition causes compilation errors when it is used in
+titles or captions. So we redefine it to the original LaTeX
+definition. We can detect if we are in the literate sources by checking 
+if the \''\MAKETITLE' command is defined.
+
+See \Link[https://tex.stackexchange.com/q/652848/2891]{}{}
+this question on TeX.sx for more details\EndLink.
+
+\<ltplain percent\><<<
+\ifdefined\MAKETITLE\else
+\chardef\%=`\%
+\fi
+>>>
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \Chapter{ltspace (Horizontal Spaces)}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Modified: trunk/lit/tex4ht-sty.tex
===================================================================
--- trunk/lit/tex4ht-sty.tex	2022-07-26 08:09:24 UTC (rev 1180)
+++ trunk/lit/tex4ht-sty.tex	2022-08-04 17:27:58 UTC (rev 1181)
@@ -2224,6 +2224,15 @@
 \catcode`\%|=12 \def\prcnt:ch{%} \catcode`\%|=14
 >>>
 
+I don't know what this code is supposed to do, but it can produce
+fatal errors when \''\%' is used inside of title, captions or sections.
+See \Link[https://tex.stackexchange.com/q/652848/2891]{}{}
+this question on TeX.sx for an example\EndLink.
+
+But when I remove it, the compilation process of TeX4ht sources fails,
+so we will need to revert to the original version of the percent command
+probably in latex.4ht.
+
 \<html utilities\><<<
 \catcode`\%|=12 \def\%{%} \catcode`\%|=14
 >>>



More information about the tex4ht-commits mailing list.