summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-02-19 22:09:41 +0000
committerKarl Berry <karl@freefriends.org>2024-02-19 22:09:41 +0000
commit7e32c047743dde28feb2ca558c2b64a7b8d78c55 (patch)
treeee1638015d7eaca64ef2b24cc99b06ff83602d4a
parent1ee2f63fdc96139bcc368bb395e14d39e585f068 (diff)
fix mhchemarrowequilibriumLeft and mhchemarrowequilibriumRight, tex4ht r1463
git-svn-id: svn://tug.org/texlive/trunk@69997 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/ChangeLog5
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex20
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/mathml.4ht24
3 files changed, 30 insertions, 19 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
index 234d8cce80a..91699887044 100644
--- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog
+++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
@@ -1,3 +1,8 @@
+2024-02-19 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathml.tex (mathml.4ht): fixed rendering of
+ mhchemarrowequilibriumLeft and mhchemarrowequilibriumRight.
+
2024-02-15 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-fonts-noncjk.tex (
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex
index 2cbd51fe5ad..74132b6ac03 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 1459 2024-02-07 13:33:10Z michal_h21 $$
+% $Id: tex4ht-mathml.tex 1463 2024-02-19 13:33:57Z michal_h21 $$
% compile 3 times: latex tex4ht-mathltx
% or xhlatex tex4ht-mathltx "html,3,sections+"
%
@@ -5545,16 +5545,18 @@ with small shifting.
\Configure{mhchemarrowyieldsLeftRight}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x21c4;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}} % todo: improve
\Configure{mhchemarrowmesomerism}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x2194;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}} % todo: improve
\Configure{mhchemarrowequilibrium}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x21cc;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}} % todo: improve
-% this configuration leads to two arrows next to each other. but I cannot a
-% better configuration right now. this symbol doesn't have Unicode support
+% this configuration is inspired by the MathML code from MathJax. There is a problem with vertical positioning of arrows, so we need to use
+% the <mpadded> element to fix that. It is still not perfect, moreover, there is a difference in rendering between
+% vanilla Firefox and MathJax's MathML
\Configure{mhchemarrowequilibriumRight}
-{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-larger">\:mhonlyinmathml{\a:mhchemoperator}&\#x21c0;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>
-<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-complement">\:mhonlyinmathml{\a:mhchemoperator}&\#x21bd;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}
-} % todo: improve
+{\ensuremath{\HCode{<\a:mathml munder class="mhchem-arrow-larger"><\a:mathml mrow><\a:mathml mpadded height="0" depth="1" voffset="3px"><\a:mathml mo stretchy="true" >&\#x21c0;</\a:mathml mo></\a:mathml mpadded></\a:mathml mrow>
+ <\a:mathml mpadded height="0" depth="1" voffset="2px"><mspace width="0.167em"></mspace><\a:mathml mo stretchy="false">&\#x21bd;</\a:mathml mo><mspace width="0.167em"></mspace></\a:mathml mpadded></\a:mathml munder>}
+}} % todo: improve
\Configure{mhchemarrowequilibriumLeft}
-{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-complement">\:mhonlyinmathml{\a:mhchemoperator}&\#x21c0;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>
-<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-larger">\:mhonlyinmathml{\a:mhchemoperator}&\#x21bd;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}
-} % todo: improve
+{\ensuremath{\HCode{<\a:mathml munder class="mhchem-arrow-larger"><\a:mathml mrow><\a:mathml mpadded height="0" depth="1" voffset="4px"><mspace width="0.167em"></mspace><\a:mathml mo stretchy="false">&\#x21c0;</\a:mathml mo><mspace width="0.167em"></mspace></\a:mathml mpadded></\a:mathml mrow>
+ <\a:mathml mpadded height="0" depth="1" voffset="2px"><\a:mathml mo stretchy="true" >&\#x21bd;</\a:mathml mo></\a:mathml mpadded></\a:mathml munder>}
+}} % todo: improve
+
% this is not the right symbol
% \Configure{mhchemarrowequilibriumRight}{\a:mhchemoperator\HCode{&\#x2942;}\b:mhchemoperator } % todo: improve
% \Configure{mhchemarrowequilibriumLeft}{\a:mhchemoperator\HCode{&\#x2943;}\b:mhchemoperator} % todo: improve
diff --git a/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht b/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht
index e81eaefeb09..db1a567102f 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-02-07-13:12), generated from tex4ht-mathml.tex
+% mathml.4ht (2024-02-19-13:18), 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-02-07-13:12}
+\immediate\write-1{version 2024-02-19-13:18}
\exit:ifnot{Preamble,%
accents,%
@@ -4419,16 +4419,18 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}%
\Configure{mhchemarrowyieldsLeftRight}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x21c4;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}} % todo: improve
\Configure{mhchemarrowmesomerism}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x2194;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}} % todo: improve
\Configure{mhchemarrowequilibrium}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x21cc;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}} % todo: improve
-% this configuration leads to two arrows next to each other. but I cannot a
-% better configuration right now. this symbol doesn't have Unicode support
+% this configuration is inspired by the MathML code from MathJax. There is a problem with vertical positioning of arrows, so we need to use
+% the <mpadded> element to fix that. It is still not perfect, moreover, there is a difference in rendering between
+% vanilla Firefox and MathJax's MathML
\Configure{mhchemarrowequilibriumRight}
-{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-larger">\:mhonlyinmathml{\a:mhchemoperator}&\#x21c0;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>
-<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-complement">\:mhonlyinmathml{\a:mhchemoperator}&\#x21bd;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}
-} % todo: improve
+{\ensuremath{\HCode{<\a:mathml munder class="mhchem-arrow-larger"><\a:mathml mrow><\a:mathml mpadded height="0" depth="1" voffset="3px"><\a:mathml mo stretchy="true" >&\#x21c0;</\a:mathml mo></\a:mathml mpadded></\a:mathml mrow>
+ <\a:mathml mpadded height="0" depth="1" voffset="2px"><mspace width="0.167em"></mspace><\a:mathml mo stretchy="false">&\#x21bd;</\a:mathml mo><mspace width="0.167em"></mspace></\a:mathml mpadded></\a:mathml munder>}
+}} % todo: improve
\Configure{mhchemarrowequilibriumLeft}
-{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-complement">\:mhonlyinmathml{\a:mhchemoperator}&\#x21c0;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>
-<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-larger">\:mhonlyinmathml{\a:mhchemoperator}&\#x21bd;\:mhonlyinmathml{\b:mhchemoperator}</\:mhmathmlorhtml{mrow}{span}>}
-} % todo: improve
+{\ensuremath{\HCode{<\a:mathml munder class="mhchem-arrow-larger"><\a:mathml mrow><\a:mathml mpadded height="0" depth="1" voffset="4px"><mspace width="0.167em"></mspace><\a:mathml mo stretchy="false">&\#x21c0;</\a:mathml mo><mspace width="0.167em"></mspace></\a:mathml mpadded></\a:mathml mrow>
+ <\a:mathml mpadded height="0" depth="1" voffset="2px"><\a:mathml mo stretchy="true" >&\#x21bd;</\a:mathml mo></\a:mathml mpadded></\a:mathml munder>}
+}} % todo: improve
+
% this is not the right symbol
% \Configure{mhchemarrowequilibriumRight}{\a:mhchemoperator\HCode{&\#x2942;}\b:mhchemoperator } % todo: improve
% \Configure{mhchemarrowequilibriumLeft}{\a:mhchemoperator\HCode{&\#x2943;}\b:mhchemoperator} % todo: improve
@@ -4443,5 +4445,7 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
\endinput