summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-02-07 22:01:28 +0000
committerKarl Berry <karl@freefriends.org>2024-02-07 22:01:28 +0000
commit1089c69891826a87037e86512de5dd3daeaf54e7 (patch)
tree61aa26a9861e0831fca50e589e26571a4e699f2a /Master/texmf-dist/source
parenta6dd69ed686318657b6d6f7b681f513b76c6e52c (diff)
mhchem formatting, tex4ht r1459
git-svn-id: svn://tug.org/texlive/trunk@69739 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/ChangeLog7
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex29
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex5
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex9
4 files changed, 30 insertions, 20 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
index 1809a813460..adb567263a3 100644
--- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog
+++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
@@ -1,3 +1,10 @@
+2024-02-07 Michal Hoftich <michal.h21@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@gmail.com>
* tex4ht-4ht.tex (mathtools-hooks.4ht): prevent multiple loading of
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
index 14ee0a16e97..d18a1123c82 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1458 2024-02-06 16:07:33Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1459 2024-02-07 13:33:10Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2024 TeX Users Group
@@ -30914,29 +30914,30 @@ it come out as a complete mess.
\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}
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
index 38ac28f4d89..b11bd85bd8f 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html4.tex 1457 2024-01-30 20:48:28Z michal_h21 $
+% $Id: tex4ht-html4.tex 1459 2024-02-07 13:33:10Z michal_h21 $
% Compile 4 times: latex tex4ht-html4
% Copy html4.4ht into the work directory before all but the last compilation.
%
@@ -21764,7 +21764,8 @@ users redefine the latter macro.
\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>}}
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex
index acdc463ecb6..2cbd51fe5ad 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-mathml.tex 1456 2024-01-30 16:31:58Z michal_h21 $$
+% $Id: tex4ht-mathml.tex 1459 2024-02-07 13:33:10Z michal_h21 $$
% compile 3 times: latex tex4ht-mathltx
% or xhlatex tex4ht-mathltx "html,3,sections+"
%
@@ -5535,10 +5535,11 @@ with small shifting.
\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