diff options
4 files changed, 46 insertions, 11 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog index f291004937d..b88a67a074c 100644 --- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog +++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog @@ -1,3 +1,9 @@ +2022-10-19 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-html4.tex (html4-math.4ht): calculate vertical alignment + for inline math. + https://tex.stackexchange.com/a/662257/2891 + 2022-10-17 Michal Hoftich <michal.h21@gmail.com> * tex4ht-4ht.tex (latex.4ht): declare \Configure{MathJaxSource} as diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex index 145cb1ae28e..d72179ac89d 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 1203 2022-09-29 13:51:29Z michal_h21 $ +% $Id: tex4ht-html4.tex 1218 2022-10-19 12:57:24Z michal_h21 $ % Compile 4 times: latex tex4ht-html4 % Copy html4.4ht into the work directory before all but the last compilation. % @@ -6557,7 +6557,22 @@ The above should be sensitive to cases like the following one. \special{t4ht*=}% >>> +This version of PicMath tries to set the correct vertical alignment for inline math. +It typessets the math inside a box, measures depth and height, calculates +the alignment, and outputs it using CSS. It uses Expl3 features, so we need +to use it in LaTeX configuration. +\<configure html4 latex\><<< +\ExplSyntaxOn +\Configure{PicMath} +{\setbox0=} +{\Css{img[src="\PictureFile"]{% + vertical-align:-\fp_eval:n{ \dim_to_fp:n{\dp0}/(\dim_to_fp:n{\ht0}+\dim_to_fp:n{\dp0}) * 100}\% +}}\box0} +{} +{ class="math" } +\ExplSyntaxOff +>>> %%%%%%%%%%%%%%%%%% diff --git a/Master/texmf-dist/tex/generic/tex4ht/html4-math.4ht b/Master/texmf-dist/tex/generic/tex4ht/html4-math.4ht index 0e70af8fa23..0bfb552ab52 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/html4-math.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/html4-math.4ht @@ -1,4 +1,4 @@ -% html4-math.4ht (2022-08-29-13:30), generated from tex4ht-html4.tex +% html4-math.4ht (2022-10-19-13:47), generated from tex4ht-html4.tex % Copyright 2009-2022 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 2022-08-29-13:30} +\immediate\write-1{version 2022-10-19-13:47} \exit:ifnot{accents,% amsfonts,% @@ -468,6 +468,7 @@ ushort} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{amsmath} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -676,7 +677,6 @@ ushort} \endinput\empty\empty\empty\empty\empty\empty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{amsfonts} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -693,6 +693,7 @@ ushort} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{amstex1} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -731,7 +732,6 @@ ushort} \endinput\empty\empty\empty\empty\empty\empty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{amstex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -844,6 +844,7 @@ ushort} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{plain} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1004,7 +1005,6 @@ ushort} - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{array} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1116,7 +1116,6 @@ ushort} - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{fleqn} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1147,6 +1146,7 @@ ushort} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{gauss} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1165,6 +1165,7 @@ ushort} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{rlbabel} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1342,6 +1343,7 @@ ushort} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{accents} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1375,7 +1377,6 @@ ushort} - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{ushort} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1436,7 +1437,6 @@ ushort} - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{cancel} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1482,6 +1482,7 @@ ushort} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{th4} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1584,5 +1585,8 @@ ushort} + + + \endinput diff --git a/Master/texmf-dist/tex/generic/tex4ht/html4.4ht b/Master/texmf-dist/tex/generic/tex4ht/html4.4ht index ec0f0ac8639..ac26edf0eaa 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 (2022-09-29-14:24), generated from tex4ht-html4.tex +% html4.4ht (2022-10-19-13:47), generated from tex4ht-html4.tex % Copyright 2009-2022 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 2022-09-29-14:24} +\immediate\write-1{version 2022-10-19-13:47} \exit:ifnot{8859-6,% CJK,% @@ -1561,6 +1561,15 @@ switches of tex4ht.c) \HCode{\the\tmp:toks}% \special{t4ht*=}% ]{}\the\tmp:toks\EndPicture} +\ExplSyntaxOn +\Configure{PicMath} +{\setbox0=} +{\Css{img[src="\PictureFile"]{% + vertical-align:-\fp_eval:n{ \dim_to_fp:n{\dp0}/(\dim_to_fp:n{\ht0}+\dim_to_fp:n{\dp0}) * 100}\% +}}\box0} +{} +{ class="math" } +\ExplSyntaxOff \Configure{pageref} {\HCode{<span class="pageref">}} {\HCode{</span>}} @@ -40439,5 +40448,6 @@ y{\ht:special{t4ht@+\string&{35}x00FD{59}}y}% + \endinput |