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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Wed Feb 12 16:02:30 CET 2025


Author: michal_h21
Date: 2025-02-12 15:02:29 +0000 (Wed, 12 Feb 2025)
New Revision: 1639

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-mathml.tex
Log:
fixed mathtools arrows

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2025-02-09 16:05:28 UTC (rev 1638)
+++ trunk/lit/ChangeLog	2025-02-12 15:02:29 UTC (rev 1639)
@@ -1,3 +1,8 @@
+2025-02-12  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-mathml.tex (mathml.4ht): fixed Mathtools arrows in MathML.
+	https://tex.stackexchange.com/q/736623/2891
+
 2025-02-09  Karl Berry  <karl at freefriends.org>
 
 	* tex4h5-options.tex (tex4ht.4ht): copyright 2025.

Modified: trunk/lit/tex4ht-mathml.tex
===================================================================
--- trunk/lit/tex4ht-mathml.tex	2025-02-09 16:05:28 UTC (rev 1638)
+++ trunk/lit/tex4ht-mathml.tex	2025-02-12 15:02:29 UTC (rev 1639)
@@ -2843,6 +2843,42 @@
     \HCode{</\a:mathml mtd>}}
 >>>
 
+Fix MathML arrows with MathTools.
+
+\<configure mathml mathtools\><<<
+% support bidirectional harpoons
+\def\:leftrightharpoons{\HCode{<\a:mathml mo stretchy="true">}\PauseMathClass\x:unicode{21CC}\EndPauseMathClass\HCode{</\a:mathml mo>}}
+\def\:righleftharpoons{\HCode{<\a:mathml mo stretchy="true">}\PauseMathClass\x:unicode{21CB}\EndPauseMathClass\HCode{</\a:mathml mo>}}
+
+\providecommand*\:xleftrightharpoons[2][]{%
+\ext at arrow 3095\:leftrightharpoons{#1}{#2}}
+
+\providecommand*\:xrightleftharpoons[2][]{%
+\ext at arrow 3095\:leftrightharpoons{#1}{#2}}
+
+\HLet\xleftrightharpoons\:xleftrightharpoons
+\HLet\xrightleftharpoons\:xrightleftharpoons
+
+% correctly place text under and over arrows
+\def\:tempa#1#2#3#4#5#6#7{%
+  \bgroup%
+  \def\relbar{}% remove relbar in arrow fills
+  \def\arrowfill@##1##2##3##4{##1##2##3##4}% remove arrowfill@, to prevent errors
+  \@ifempty{#7}{%
+    \HCode{<\a:mathml munder><\a:mathml mrow><\a:mathml mo stretchy="true">}\PauseMathClass#5{}\EndPauseMathClass\HCode{</\a:mathml mo></\a:mathml mrow><\a:mathml mrow>}#6\HCode{</\a:mathml mrow></\a:mathml munder>}%
+  }{%
+    \@ifempty{#6}{%
+      \HCode{<\a:mathml mover><\a:mathml mrow><\a:mathml mo stretchy="true">}\PauseMathClass#5{}\EndPauseMathClass\HCode{</\a:mathml mo></\a:mathml mrow><\a:mathml mrow>}#7\HCode{</\a:mathml mrow></\a:mathml mover>}%
+    }{%
+      \HCode{<\a:mathml munderover><\a:mathml mrow><\a:mathml mo stretchy="true">}\PauseMathClass#5{}\EndPauseMathClass\HCode{</\a:mathml mo></\a:mathml mrow><\a:mathml mrow>}#6\HCode{</\a:mathml mrow><\a:mathml mrow>}#7\HCode{</\a:mathml mrow></\a:mathml munderover>}%
+    }%
+  }%
+  \egroup
+}
+
+\HLet\ext at arrow\:tempa
+>>>
+
 %%%%%%%%%%%%%%%%%%
 \section{Gaus}
 %%%%%%%%%%%%%%%%%%



More information about the tex4ht-commits mailing list.