diff options
author | Karl Berry <karl@freefriends.org> | 2024-02-07 22:01:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-02-07 22:01:28 +0000 |
commit | 1089c69891826a87037e86512de5dd3daeaf54e7 (patch) | |
tree | 61aa26a9861e0831fca50e589e26571a4e699f2a /Master | |
parent | a6dd69ed686318657b6d6f7b681f513b76c6e52c (diff) |
mhchem formatting, tex4ht r1459
git-svn-id: svn://tug.org/texlive/trunk@69739 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
7 files changed, 52 insertions, 39 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 diff --git a/Master/texmf-dist/tex/generic/tex4ht/html4.4ht b/Master/texmf-dist/tex/generic/tex4ht/html4.4ht index 2312388353e..78cff66f4a4 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/html4.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/html4.4ht @@ -1,4 +1,4 @@ -% html4.4ht (2024-01-30-13:46), generated from tex4ht-html4.tex +% html4.4ht (2024-02-07-13:12), generated from tex4ht-html4.tex % Copyright 2009-2024 TeX Users Group % Copyright 1997-2009 Eitan M. Gurari % @@ -17,7 +17,7 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2024-01-30-13:46} +\immediate\write-1{version 2024-02-07-13:12} \exit:ifnot{8859-6,% CJK,% @@ -40737,7 +40737,8 @@ y{\ht:special{t4ht@+\string&{35}x00FD{59}}y}% \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/tex/generic/tex4ht/mathml.4ht b/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht index 2752ab62072..e81eaefeb09 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht @@ -1,4 +1,4 @@ -% mathml.4ht (2024-01-30-13:46), generated from tex4ht-mathml.tex +% mathml.4ht (2024-02-07-13:12), generated from tex4ht-mathml.tex % Copyright 2009-2024 TeX Users Group % Copyright 1999-2009 Eitan M. Gurari % @@ -17,7 +17,7 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2024-01-30-13:46} +\immediate\write-1{version 2024-02-07-13:12} \exit:ifnot{Preamble,% accents,% @@ -4409,10 +4409,11 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% \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 diff --git a/Master/texmf-dist/tex/generic/tex4ht/mhchem.4ht b/Master/texmf-dist/tex/generic/tex4ht/mhchem.4ht index e9f8a55dce0..6c298dbbfa4 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/mhchem.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/mhchem.4ht @@ -1,4 +1,4 @@ -% mhchem.4ht (2024-01-29-13:27), generated from tex4ht-4ht.tex +% mhchem.4ht (2024-02-07-13:12), generated from tex4ht-4ht.tex % Copyright 2024 TeX Users Group % Copyright 2015-2021 Martin Hensel % @@ -17,7 +17,7 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2024-01-29-13:27} +\immediate\write-1{version 2024-02-07-13:12} \ExplSyntaxOn % basic mhchem containers @@ -119,23 +119,24 @@ \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_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} |