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

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Sat Feb 6 17:23:32 CET 2021


Author: michal_h21
Date: 2021-02-06 18:23:32 +0200 (Sat, 06 Feb 2021)
New Revision: 880

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-mathml.tex
   trunk/lit/tex4ht-unicode.tex
Log:
Use \protect in \:nbsp

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2021-02-03 22:19:14 UTC (rev 879)
+++ trunk/lit/ChangeLog	2021-02-06 16:23:32 UTC (rev 880)
@@ -1,3 +1,10 @@
+2021-02-06  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (latex.4ht),
+	tex4ht-unicode.tex (unicode.4ht),
+	tex4ht-mathml.tex (mathml.4ht): use \protect in \:nbsp and similar commands
+	that use \leavevmode internally.
+
 2021-02-03  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (nameref.4ht): fix for \autoref and the Caption package.

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2021-02-03 22:19:14 UTC (rev 879)
+++ trunk/lit/tex4ht-4ht.tex	2021-02-06 16:23:32 UTC (rev 880)
@@ -35020,11 +35020,15 @@
 
 \<config latex.ltx shared\><<<
 \let\sp:c|=\  |<latex,plain sp|>
+\def\:nbsp{\protect\leavevmode\special{t4ht at +\string&{35}x00A0{59}}x} 
+\def\:ensp{\protect\leavevmode\special{t4ht at +\string&{35}x2002{59}}x} 
 \let\nobreakspace\:nbsp
 >>>
 
 \<config plain shared\><<<
 \let\sp:c|=\space |<latex,plain sp|>%
+\def\:nbsp{\leavevmode\special{t4ht at +\string&{35}x00A0{59}}x} 
+\def\:ensp{\leavevmode\special{t4ht at +\string&{35}x2002{59}}x} 
 >>>
 
 \<latex,plain sp\><<<
@@ -35032,8 +35036,6 @@
              \else \sp:c\fi}
 \NewConfigure{ }[1]{\def\:temp{#1}%
    \ifx \:temp\empty \let\a:sp|=\sp:c\else\def\a:sp{#1}\fi}
-\def\:nbsp{\leavevmode\special{t4ht at +\string&{35}x00A0{59}}x} 
-\def\:ensp{\leavevmode\special{t4ht at +\string&{35}x2002{59}}x} 
 \Configure{ }{\:nbsp}
 >>>
 

Modified: trunk/lit/tex4ht-mathml.tex
===================================================================
--- trunk/lit/tex4ht-mathml.tex	2021-02-03 22:19:14 UTC (rev 879)
+++ trunk/lit/tex4ht-mathml.tex	2021-02-06 16:23:32 UTC (rev 880)
@@ -3958,8 +3958,16 @@
 \section{Space Characters}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+We must use \`'\protect' with LaTeX in order to support TOC etc.
 
 \<plain,latex mathml\><<<
+\ifdefined\protect%
+\def\:unicodespace{\protect\leavevmode\special{t4ht at +\string&{35}x00A0{59}}x}%
+\def\:unicodenspace{\protect\leavevmode\special{t4ht at +\string&{35}x2002{59}}x}%
+\else%
+\def\:unicodespace{\leavevmode\special{t4ht at +\string&{35}x00A0{59}}x}%
+\def\:unicodenspace{\leavevmode\special{t4ht at +\string&{35}x2002{59}}x}%
+\fi
 \def\:nbsp{\ifmtext |<unicode space|>\else\ifmathml
     \Tg<\a:mathml mspace />\else |<unicode space|>\fi\fi}
 \def\:ensp{\ifmtext |<unicode enspace|>\else\ifmathml
@@ -3967,11 +3975,11 @@
 >>>
 
 \<unicode space\><<<
-\leavevmode\special{t4ht at +\string&{35}x00A0{59}}x%
+\:unicodespace%
 >>>
 
 \<unicode enspace\><<<
-\leavevmode\special{t4ht at +\string&{35}x2002{59}}x%
+\:unicodenspace%
 >>>
 % \HCode{\string&}\HChar{-35}\HCode{x00A0;}%
 

Modified: trunk/lit/tex4ht-unicode.tex
===================================================================
--- trunk/lit/tex4ht-unicode.tex	2021-02-03 22:19:14 UTC (rev 879)
+++ trunk/lit/tex4ht-unicode.tex	2021-02-06 16:23:32 UTC (rev 880)
@@ -902,8 +902,16 @@
 \`'\def\x:unicode#1{\HCode{&}\HChar{-35}\HCode{x#1;}}' is not a slution
 because the mathml marking on it get confused.
 
+We use \`'\protect' with LaTeX, because compilation can fail in temporary files,
+especially in TOC like environments.
+
+
 \<configure unicode tex4ht\><<<
+\ifdefined\protect%
+\def\x:unicode#1{\protect\leavevmode\ht:special{t4ht at +\string&{35}x#1{59}}x}
+\else
 \def\x:unicode#1{\leavevmode\ht:special{t4ht at +\string&{35}x#1{59}}x}
+\fi
 
 \Configure{htf}{12}{+}
    {<!--span\Hnewline class="htf-calligraphy"-->}{}{}{}{}{}{<!--/span-->}



More information about the tex4ht-commits mailing list.