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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Wed Feb 7 14:33:11 CET 2024


Author: michal_h21
Date: 2024-02-07 13:33:10 +0000 (Wed, 07 Feb 2024)
New Revision: 1459

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-html4.tex
   trunk/lit/tex4ht-mathml.tex
Log:
fixed more mhchem errors

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2024-02-06 16:07:33 UTC (rev 1458)
+++ trunk/lit/ChangeLog	2024-02-07 13:33:10 UTC (rev 1459)
@@ -1,3 +1,10 @@
+2024-02-07  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (mhchem.4ht),
+	* tex4ht-mathml.tex (mathml.4ht),
+	* tex4ht-html4.tex (html4.4ht): fixed more Mhchem formatting errors.
+	https://tex.stackexchange.com/q/654236/2891
+
 2024-02-06  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (mathtools-hooks.4ht): prevent multiple loading of

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2024-02-06 16:07:33 UTC (rev 1458)
+++ trunk/lit/tex4ht-4ht.tex	2024-02-07 13:33:10 UTC (rev 1459)
@@ -30914,29 +30914,30 @@
 
 \NewConfigure{mhchemoperator}{2}
 
-% ideally, the following commands should be redefined using \HLet, to support picture math. 
-% the current definition should work in MathML, I am not sure about normall HTML, as 
+% ideally, the following commands should be redefined using \HLet, to support picture math.
+% the current definition should work in MathML, I am not sure about normall HTML, as
 \cs_set_protected:Npn \__mhchem_output_skipAfterAmount: {\HCode { ~ } }  % space for copy & paste
 \cs_set_protected:Npn \__mhchem_output_skipBeforeStateOfAggregation: {}
 \cs_set_protected:Npn \__mhchem_output_minus: {\HCode{&\#x2212;}} % minus
 \cs_set_protected:Npn \__mhchem_output_operatorPlus:
-  { \a:mhchemoperator + \b:mhchemoperator  }
+  { \HCode {\a:mhchemoperator + \b:mhchemoperator  }}
 \cs_set_protected:Npn \__mhchem_output_operatorMinus:
-  { \a:mhchemoperator\HCode {&\#x2212;} \b:mhchemoperator } % minus
+  { \HCode {\a:mhchemoperator&\#x2212; \b:mhchemoperator }} % minus
 \cs_set_protected:Npn \__mhchem_output_operatorEquals:
-  { \a:mhchemoperator =  \b:mhchemoperator }
+  { \HCode {\a:mhchemoperator =  \b:mhchemoperator }}
 \cs_set_protected:Npn \__mhchem_output_operatorPlusMinus:
-  {\a:mhchemoperator \HCode {&\#xB1;} \b:mhchemoperator } % plusmn
-  \cs_set_protected:Npn \__mhchem_output_electronDot: { \HCode {&\#x2022;} } % bull
-  \cs_set_protected:Npn \__mhchem_output_additionCompound: { \HCode {&\#xB7;} } % middot
+  {\HCode {\a:mhchemoperator &\#xB1; \b:mhchemoperator }} % plusmn
+\cs_set_protected:Npn \__mhchem_output_electronDot: { \HCode {&\#x2022;} } % bull
+\cs_set_protected:Npn \__mhchem_output_additionCompound: { \HCode {&\#xB7;} } % middot
 \cs_set_protected:Npn \__mhchem_output_excited: { \HCode { &\#x2731; } }
 \cs_set_protected:Npn \__mhchem_output_commaDecimal: { , }
 \cs_set_protected:Npn \__mhchem_output_commaEnumeration: {,\HCode {&\#x2009;} } % thinsp
-\cs_set_protected:Npn \__mhchem_output_commaEnumerationSmall: {,\HCode{&\#x2009;} } % thinsp 
-  
-\cs_set_protected:Npn \__mhchem_output_bond_single: { \a:mhchemoperator{\HCode { &\#x2212; }}\b:mhchemoperator}
-\cs_set_protected:Npn \__mhchem_output_bond_double: { \a:mhchemoperator{\HCode { =}}\b:mhchemoperator}
-\cs_set_protected:Npn \__mhchem_output_bond_triple: { \a:mhchemoperator{\HCode { &\#x2261;}}\b:mhchemoperator}
+\cs_set_protected:Npn \__mhchem_output_commaEnumerationSmall: {,\HCode{&\#x2009;} } % thinsp
+
+\cs_set_protected:Npn \__mhchem_output_bond_single: { \HCode { \a:mhchemoperator&\#x2212;\b:mhchemoperator}}
+\cs_set_protected:Npn \__mhchem_output_bond_double: { \HCode { \a:mhchemoperator=\b:mhchemoperator}}
+\cs_set_protected:Npn \__mhchem_output_bond_triple: { \HCode { \a:mhchemoperator&\#x2261;\b:mhchemoperator}}
+            
 % todo: add MathML support for these
 \cs_set_protected:Npn \__mhchem_output_bond_half:  % todo: improve
   {\a:mhchembondhalf}

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2024-02-06 16:07:33 UTC (rev 1458)
+++ trunk/lit/tex4ht-html4.tex	2024-02-07 13:33:10 UTC (rev 1459)
@@ -21764,7 +21764,8 @@
 \Configure{mhchemisotope}{\HCode{<span class="mhchem-isotope">}}{\HCode{<br />&\#xfeff;}}{\HCode{</span>}}
 \Configure{mhchemsub}{\HCode {<sub class="mhchem-sub">}}{\HCode{</sub>} }
 \Configure{mhchemsup}{\HCode {<sup class="mhchem-sup">}}{\HCode{</sup>} }
-\Configure{mhchemoperator}{\HCode {<span class="mhchem-operator">}}{\HCode {</span>}}
+% mhchemoperator is always used inside \HCode, so we need not to use \HCode in it's configuration
+\Configure{mhchemoperator}{<span class="mhchem-operator">}{</span>} 
 \Configure{mhchemarrow}{\HCode {<span class="mhchem-arrow">}}{\HCode{</span>}}
 \Configure{mhchemarrowabove}{\HCode {<span class="mhchem-above">}}{\HCode{</span>}}
 \Configure{mhchemarrowyields}{\HCode{<span class="mhchem-arrow-normal">&\#x27F6;</span>}}

Modified: trunk/lit/tex4ht-mathml.tex
===================================================================
--- trunk/lit/tex4ht-mathml.tex	2024-02-06 16:07:33 UTC (rev 1458)
+++ trunk/lit/tex4ht-mathml.tex	2024-02-07 13:33:10 UTC (rev 1459)
@@ -5535,10 +5535,11 @@
   \HCode{<sup>}}%
 }{\:mhmathmlorhtml{\Tg</\a:mathml mrow>\TG</\a:mathml msup\Hnewline>}{\HCode{</sup>}}}
 
-\Configure{mhchemoperator}{\HCode{<\:mhmathmlorhtml{mo}{span} class="mhchem-operator">}\PauseMathClass}{\EndPauseMathClass\HCode {</\:mhmathmlorhtml{mo}{span}>}}
+% mhchemoperator is always used inside \HCode, so we need not to use \HCode in it's configuration
+\Configure{mhchemoperator}{<\:mhmathmlorhtml{mo}{span} class="mhchem-operator">}{</\:mhmathmlorhtml{mo}{span}>}
 
-\Configure{mhchemarrow}{\HCode {<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow">\:mhonlyinmathml{\a:mhchemoperator}}}{\HCode{\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}}
-\Configure{mhchemarrowabove}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-above">\:mhonlyinmathml{\a:mhchemoperator}}}{\HCode{\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}}
+\Configure{mhchemarrow}{\HCode {<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow">\:mhonlyinmathml{\a:mhchemoperator}}\PauseMathClass}{\EndPauseMathClass\HCode{\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}}
+\Configure{mhchemarrowabove}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-above">\:mhonlyinmathml{\a:mhchemoperator}}\PauseMathClass}{\EndPauseMathClass\HCode{\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}}
 \Configure{mhchemarrowyields}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x2192;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}}
 \Configure{mhchemarrowyieldsLeft}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x2190;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>} }
 \Configure{mhchemarrowyieldsLeftRight}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x21c4;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}}  % todo: improve



More information about the tex4ht-commits mailing list.