summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/tex4ht
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-10-19 22:05:02 +0000
committerKarl Berry <karl@freefriends.org>2022-10-19 22:05:02 +0000
commitd50eddfda771de9d5f457ce54a337755ab66c875 (patch)
tree44ed7f23bca20a757ba4f635f47accab79fbdd66 /Master/texmf-dist/source/generic/tex4ht
parentfb8ea0360371bc0f606780cb854a7cba6b706788 (diff)
vertical alignment for inline math, tex4ht r1217-1218
git-svn-id: svn://tug.org/texlive/trunk@64758 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic/tex4ht')
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/ChangeLog6
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex17
2 files changed, 22 insertions, 1 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
+>>>
%%%%%%%%%%%%%%%%%%