diff options
7 files changed, 71 insertions, 44 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog index ca3471184e5..a268359b249 100644 --- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog +++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog @@ -1,3 +1,9 @@ +2024-01-29 Michal Hoftich <michal.h21@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@gmail.com> * tex4ht-ooffice.tex (ooffice.4ht, ooffice-mml.4ht): start paragraph diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex index 98412b55064..bd81cb0db4b 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 1452 2024-01-24 14:50:53Z michal_h21 $ +% $Id: tex4ht-4ht.tex 1455 2024-01-29 13:45:00Z michal_h21 $ % tex tex4ht-4ht or ht tex tex4ht-4ht % % Copyright 2009-2024 TeX Users Group @@ -30898,35 +30898,35 @@ it come out as a complete mess. \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} % 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 @@ it come out as a complete mess. \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; } } diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex index f2eb4939bac..b5cc838ebd3 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 1453 2024-01-24 22:08:34Z karl $$ +% $Id: tex4ht-mathml.tex 1455 2024-01-29 13:45:00Z michal_h21 $$ % compile 3 times: latex tex4ht-mathltx % or xhlatex tex4ht-mathltx "html,3,sections+" % @@ -5558,9 +5558,9 @@ with small shifting. % \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>}} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex index 47c6c9ad1b6..65a79d3dcc9 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-ooffice.tex 1454 2024-01-25 14:13:32Z michal_h21 $ +% $Id: tex4ht-ooffice.tex 1455 2024-01-29 13:45:00Z michal_h21 $ % compile 3 times: latex tex4ht-ooffice % htlatex tex4ht-ooffice "xhtml,4,sections+" % @@ -12389,6 +12389,16 @@ OO doesn't seem to hono mfenced >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\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} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht b/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht index e7e8f69c2de..9c7f164fd08 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-24-14:08), generated from tex4ht-mathml.tex +% mathml.4ht (2024-01-29-13:27), 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-24-14:08} +\immediate\write-1{version 2024-01-29-13:27} \exit:ifnot{Preamble,% accents,% @@ -4432,9 +4432,9 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% % \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>}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/Master/texmf-dist/tex/generic/tex4ht/mhchem.4ht b/Master/texmf-dist/tex/generic/tex4ht/mhchem.4ht index ab7ac52d203..e9f8a55dce0 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-24-13:56), generated from tex4ht-4ht.tex +% mhchem.4ht (2024-01-29-13:27), 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-24-13:56} +\immediate\write-1{version 2024-01-29-13:27} \ExplSyntaxOn % basic mhchem containers @@ -107,35 +107,35 @@ \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} % 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} @@ -150,8 +150,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; } } diff --git a/Master/texmf-dist/tex/generic/tex4ht/ooffice-mml.4ht b/Master/texmf-dist/tex/generic/tex4ht/ooffice-mml.4ht index aaf186c4db7..15c6abddba7 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/ooffice-mml.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/ooffice-mml.4ht @@ -1,4 +1,4 @@ -% ooffice-mml.4ht (2024-01-25-13:42), generated from tex4ht-ooffice.tex +% ooffice-mml.4ht (2024-01-29-13:27), generated from tex4ht-ooffice.tex % Copyright 2009-2024 TeX Users Group % Copyright 2001-2009 Maarten Wisse, James Naughton, Eitan M. Gurari % @@ -17,12 +17,13 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2024-01-25-13:42} +\immediate\write-1{version 2024-01-29-13:27} \exit:ifnot{Preamble,% amsmath,% array,% latex,% +mhchem,% rlbabel,% tex4ht} @@ -112,7 +113,7 @@ tex4ht} <!-- \jobname-m\math:obj \space by TeX4ht from \jobname.tex line \the\inputlineno\space - 2024-01-25-13:42\Hnewline + 2024-01-29-13:27\Hnewline (http://www.cse.ohio-state.edu/\string ~gurari/TeX4ht/) -->\Hnewline }% @@ -1144,6 +1145,16 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \ConfigureHinput{mhchem} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % redefine this command to add the text: prefix for the text commands +\renewcommand\:mhmathmlorhtml[2]{\ifmathml\a:mathml #1\else text:#2\fi} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\endinput\empty\empty\empty\empty\empty\empty +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \endinput |