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

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Mon Jan 29 14:45:00 CET 2024


Author: michal_h21
Date: 2024-01-29 13:45:00 +0000 (Mon, 29 Jan 2024)
New Revision: 1455

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-mathml.tex
   trunk/lit/tex4ht-ooffice.tex
Log:
Added mhchem support for the odt format

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2024-01-25 14:13:32 UTC (rev 1454)
+++ trunk/lit/ChangeLog	2024-01-29 13:45:00 UTC (rev 1455)
@@ -1,3 +1,9 @@
+2024-01-29  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-ooffice.tex (ooffice-mml.4ht),
+	* tex4ht-mathml.tex (mathml.4ht),
+	* tex4ht-4ht.tex (mhchem.4ht): added Mhchem support for the ODT format.
+
 2024-01-25  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-ooffice.tex (ooffice.4ht, ooffice-mml.4ht): start paragraph

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2024-01-25 14:13:32 UTC (rev 1454)
+++ trunk/lit/tex4ht-4ht.tex	2024-01-29 13:45:00 UTC (rev 1455)
@@ -30898,8 +30898,8 @@
 \cs_set_protected:Npn \__mhchem_output_withFont:n #1  %. output #1 as math or text
   {
     \bool_if:NTF \l__mhchem_output_isMathMode_bool
-      { \mathrm {#1} }
-      { \text {#1} }
+      { \begingroup\mathrm {#1}\endgroup }
+      { \begingroup\text {#1}\endgroup }
   }
 
 \NewConfigure{mhchemoperator}{2}
@@ -30906,27 +30906,27 @@
 
 % 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_skipAfterAmount: {\HCode { ~ } }  % space for copy & paste
 \cs_set_protected:Npn \__mhchem_output_skipBeforeStateOfAggregation: {}
-\cs_set_protected:Npn \__mhchem_output_minus: { \HCode { − } }
+\cs_set_protected:Npn \__mhchem_output_minus: {\HCode{&\#x2212;}} % minus
 \cs_set_protected:Npn \__mhchem_output_operatorPlus:
   { \a:mhchemoperator + \b:mhchemoperator  }
 \cs_set_protected:Npn \__mhchem_output_operatorMinus:
-  { \a:mhchemoperator\HCode {−} \b:mhchemoperator }
+  { \a:mhchemoperator\HCode {&\#x2212;} \b:mhchemoperator } % minus
 \cs_set_protected:Npn \__mhchem_output_operatorEquals:
   { \a:mhchemoperator =  \b:mhchemoperator }
 \cs_set_protected:Npn \__mhchem_output_operatorPlusMinus:
-  {\a:mhchemoperator \HCode {± } \b:mhchemoperator }
-\cs_set_protected:Npn \__mhchem_output_electronDot: { \HCode { • } }
-\cs_set_protected:Npn \__mhchem_output_additionCompound: { \HCode { · } }
+  {\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
 \cs_set_protected:Npn \__mhchem_output_excited: { \HCode { &\#x2731; } }
 \cs_set_protected:Npn \__mhchem_output_commaDecimal: { , }
-\cs_set_protected:Npn \__mhchem_output_commaEnumeration: {,\HCode {   } }
-\cs_set_protected:Npn \__mhchem_output_commaEnumerationSmall: {,\HCode{   } }
+\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 { − }}\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 { ≡ }}\b:mhchemoperator}
+\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}
 % todo: add MathML support for these
 \cs_set_protected:Npn \__mhchem_output_bond_half:  % todo: improve
   {\a:mhchembondhalf}
@@ -30941,8 +30941,8 @@
 \NewConfigure{mhchembondoneandhalf}{1}
 \NewConfigure{mhchembondtwoandhalf}{1}
 \NewConfigure{mhchembondtwoandhalff}{1}
-\cs_set_protected:Npn \__mhchem_output_bond_dotdotdot: { \HCode { ··· } }
-\cs_set_protected:Npn \__mhchem_output_bond_dotdotdotdot: { \HCode { ···· } }
+\cs_set_protected:Npn \__mhchem_output_bond_dotdotdot: { \HCode { &\#xB7;&\#xB7;&\#xB7;} } % ··· 
+\cs_set_protected:Npn \__mhchem_output_bond_dotdotdotdot: { \HCode { &\#xB7;&\#xB7;&\#xB7;&\#xB7;} } %  ···· 
 \cs_set_protected:Npn \__mhchem_output_bond_rightArrow: { \HCode { &\#xffeb; } }
 \cs_set_protected:Npn \__mhchem_output_bond_leftArrow: { \HCode { &\#xffe9; } }
 

Modified: trunk/lit/tex4ht-mathml.tex
===================================================================
--- trunk/lit/tex4ht-mathml.tex	2024-01-25 14:13:32 UTC (rev 1454)
+++ trunk/lit/tex4ht-mathml.tex	2024-01-29 13:45:00 UTC (rev 1455)
@@ -5558,9 +5558,9 @@
 % \Configure{mhchemarrowequilibriumRight}{\a:mhchemoperator\HCode{&\#x2942;}\b:mhchemoperator }  % todo: improve
 % \Configure{mhchemarrowequilibriumLeft}{\a:mhchemoperator\HCode{&\#x2943;}\b:mhchemoperator}  % todo: improve
 \Configure{mhchembondhalf}{\HCode{<span class="mhchem-bond-half-middle">&\#xfe4d;</span>}}
-\Configure{mhchembondoneandhalf}{\HCode{<span class="mhchem-rlap">−</span><span class="mhchem-bond-half-top">&\#xfe4d;</span>}}
+\Configure{mhchembondoneandhalf}{\HCode{<span class="mhchem-rlap">&\#x2212;</span><span class="mhchem-bond-half-top">&\#xfe4d;</span>}}
 \Configure{mhchembondtwoandhalf}{\HCode{<span class="mhchem-rlap">=</span><span class="mhchem-bond-half-top">&\#xfe4d;</span>}}
-\Configure{mhchembondtwoandhalff}{\HCode{<span class="mhchem-rlap mhchem-bond-top">−</span><span class="mhchem-rlap mhchem-bond-bottom">−</span><span class="mhchem-bond-half-middle">&\#xfe4d;</span>}}
+\Configure{mhchembondtwoandhalff}{\HCode{<span class="mhchem-rlap mhchem-bond-top">&\#x2212;</span><span class="mhchem-rlap mhchem-bond-bottom">&\#x2212;</span><span class="mhchem-bond-half-middle">&\#xfe4d;</span>}}
 >>>
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Modified: trunk/lit/tex4ht-ooffice.tex
===================================================================
--- trunk/lit/tex4ht-ooffice.tex	2024-01-25 14:13:32 UTC (rev 1454)
+++ trunk/lit/tex4ht-ooffice.tex	2024-01-29 13:45:00 UTC (rev 1455)
@@ -12389,6 +12389,16 @@
 >>>
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{mhchem}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\<configure ooffice-mml mhchem\><<<
+% redefine this command to add the text: prefix for the text commands
+\renewcommand\:mhmathmlorhtml[2]{\ifmathml\a:mathml #1\else text:#2\fi}
+>>>
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Notes}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 



More information about the tex4ht-commits mailing list.