diff options
author | Karl Berry <karl@freefriends.org> | 2024-03-21 21:23:54 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-03-21 21:23:54 +0000 |
commit | df676063d423da36857f1eb951b368de5a9661a0 (patch) | |
tree | 4d67d942012506c7f39853e7f598b219a20a6e9a | |
parent | 768ba27c31115158e235ddf56da0fab90e236dcf (diff) |
<mi> for qopname operators, tex4ht r1492; mathop* cleanup, tex4ht r1493; \a:mathml prefix for <mo>, tex4ht r1494; \log formatting, tex4ht r1495
git-svn-id: svn://tug.org/texlive/trunk@70719 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/source/generic/tex4ht/ChangeLog | 12 | ||||
-rw-r--r-- | Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex | 52 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/tex4ht/mathml.4ht | 50 |
3 files changed, 100 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog index 974a103033a..471e695d8d6 100644 --- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog +++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog @@ -1,3 +1,15 @@ +2024-03-21 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-mathml.tex (mathml.4ht): redefine \log and similar LaTeX + functions to provide a correct formatting. + + * tex4ht-mathml.tex (mathml.4ht): added \a:mathml prefix to <mo> + tags in function applications. + + * tex4ht-mathml.tex (mathml.4ht): use <mi> instead of <mtext> for + math operators configured in \Configure{qopname}, to get a correct + spacing in function application. + 2024-03-10 Karl Berry <karl@freefriends.org> * tex4ht-4ht.tex (multibib-hooks.4ht): version. diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathml.tex index 89ea3749729..e7f496d6bf0 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 1490 2024-03-08 11:45:26Z michal_h21 $$ +% $Id: tex4ht-mathml.tex 1495 2024-03-21 16:39:31Z michal_h21 $$ % compile 3 times: latex tex4ht-mathltx % or xhlatex tex4ht-mathltx "html,3,sections+" % @@ -422,6 +422,47 @@ xmlns="http://www.w3.org/1999/xhtml" |<lim inf/sup|> >>> +This should provide correct formatting for built-in log function. By default, it is printed +in italic and without space that would separate it from the following element. + +\<mathml latex\><<< +\def\:tempa#1#2{% + \def\:tempb{\mathop{\PauseMathClass% + \HCode{<\a:mathml mi \mml:class="loglike">} #2\HCode{</\a:mathml mi>% + <\a:mathml mo>&\#x2061;<!--FUNCTION APPLICATION--></\a:mathml mo>}\EndPauseMathClass% + }\nolimits + } + \HLet#1\:tempb + \MakeRobust#1 +} + +\:tempa\log{log} +% it seems that the other functions work correctly, +% so we don't need to redefine them, but I will keep +% them here if we want to do that in the future. +% \:tempa\lg{lg} +% \:tempa\ln{ln} +% \:tempa\sin{sin} +% \:tempa\arcsin{arcsin} +% \:tempa\sinh{sinh} +% \:tempa\cos{cos} +% \:tempa\arccos{arccos} +% \:tempa\cosh{cosh} +% \:tempa\tan{tan} +% \:tempa\arctan{arctan} +% \:tempa\tanh{tanh} +% \:tempa\cot{cot} +% \:tempa\coth{coth} +% \:tempa\sec{sec} +% \:tempa\csc{csc} +% \:tempa\arg{arg} +% \:tempa\ker{ker} +% \:tempa\dim{dim} +% \:tempa\hom{hom} +% \:tempa\exp{exp} +% \:tempa\deg{deg} +>>> + \<limit functionsNO\><<< \def\:tempb#1{% \def\:tempc##11->##2///{\if :##2:% @@ -2500,8 +2541,8 @@ for more details. \<configure mathml amsopn\><<< \Configure{qopname} {\Configure{mathop}{*} - {<\a:mathml mtext \mml:class="qopname">} - {</\a:mathml mtext><mo> &\#x2061;<!--FUNCTION APPLICATION--> </mo>} + {<\a:mathml mi \mml:class="qopname">} + {</\a:mathml mi><\a:mathml mo> &\#x2061;<!--FUNCTION APPLICATION--> </\a:mathml mo>} {}} >>> @@ -3234,7 +3275,7 @@ Accent versus underscript: \verb=\underbrace{x+y+z}= \<mathml plain,fontmath\><<< \Configure{MathClass}{0}{*}{<\a:mathml mi\Hnewline>}{</\a:mathml mi>}{} \Configure{MathClass}{1}{*}{<\a:mathml mi\Hnewline - \mml:class="MathClass-op">}{</\a:mathml mi><mo> &\#x2061;<!--FUNCTION APPLICATION--></mo>}{} + \mml:class="MathClass-op">}{</\a:mathml mi><\a:mathml mo> &\#x2061;<!--FUNCTION APPLICATION--></\a:mathml mo>}{} \Configure{MathClass}{2}{*}{<\a:mathml mo\Hnewline \mml:class="MathClass-bin" \a:mathml stretchy="false">}{</\a:mathml mo>}{} \Configure{MathClass}{3}{*}{<\a:mathml mo\Hnewline @@ -3567,8 +3608,7 @@ from tex4ht-info.tex. \<configure mathml latex\><<< \AtBeginDocument{% -\Configure{mathop*}{*}{}{} - { \Configure{mathop}{*}{<mo>}{</mo>}{} } +\Configure{mathop*}{*}{}{}{\Configure{mathop}{*}{<\a:mathml mo>}{</\a:mathml mo>}{}} } >>> diff --git a/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht b/Master/texmf-dist/tex/generic/tex4ht/mathml.4ht index 06f8a0974a4..3de1fdb2fe2 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-03-08-15:31), generated from tex4ht-mathml.tex +% mathml.4ht (2024-03-21-13:48), 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-03-08-15:31} +\immediate\write-1{version 2024-03-21-13:48} \exit:ifnot{Preamble,% accents,% @@ -532,6 +532,41 @@ vanilla} {\DisplayMathtrue}% } {\B:equation}{\C:equation} +\def\:tempa#1#2{% + \def\:tempb{\mathop{\PauseMathClass% + \HCode{<\a:mathml mi \mml:class="loglike">} #2\HCode{</\a:mathml mi>% + <\a:mathml mo>&\#x2061;<!--FUNCTION APPLICATION--></\a:mathml mo>}\EndPauseMathClass% + }\nolimits + } + \HLet#1\:tempb + \MakeRobust#1 +} + +\:tempa\log{log} +% it seems that the other functions work correctly, +% so we don't need to redefine them, but I will keep +% them here if we want to do that in the future. +% \:tempa\lg{lg} +% \:tempa\ln{ln} +% \:tempa\sin{sin} +% \:tempa\arcsin{arcsin} +% \:tempa\sinh{sinh} +% \:tempa\cos{cos} +% \:tempa\arccos{arccos} +% \:tempa\cosh{cosh} +% \:tempa\tan{tan} +% \:tempa\arctan{arctan} +% \:tempa\tanh{tanh} +% \:tempa\cot{cot} +% \:tempa\coth{coth} +% \:tempa\sec{sec} +% \:tempa\csc{csc} +% \:tempa\arg{arg} +% \:tempa\ker{ker} +% \:tempa\dim{dim} +% \:tempa\hom{hom} +% \:tempa\exp{exp} +% \:tempa\deg{deg} \Configure{hspace} {\ifmathml\ifmtext\else \Tg<\a:mathml mspace width="\the\tmp:dim"/>\fi\fi}{}{ } \Configure{romannumeral} @@ -1386,8 +1421,7 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% \:temp\Upsilon{03A5} \:temp\Omega{03A9} \AtBeginDocument{% -\Configure{mathop*}{*}{}{} - { \Configure{mathop}{*}{<mo>}{</mo>}{} } +\Configure{mathop*}{*}{}{}{\Configure{mathop}{*}{<\a:mathml mo>}{</\a:mathml mo>}{}} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1636,7 +1670,7 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% {} \Configure{MathClass}{0}{*}{<\a:mathml mi\Hnewline>}{</\a:mathml mi>}{} \Configure{MathClass}{1}{*}{<\a:mathml mi\Hnewline - \mml:class="MathClass-op">}{</\a:mathml mi><mo> &\#x2061;<!--FUNCTION APPLICATION--></mo>}{} + \mml:class="MathClass-op">}{</\a:mathml mi><\a:mathml mo> &\#x2061;<!--FUNCTION APPLICATION--></\a:mathml mo>}{} \Configure{MathClass}{2}{*}{<\a:mathml mo\Hnewline \mml:class="MathClass-bin" \a:mathml stretchy="false">}{</\a:mathml mo>}{} \Configure{MathClass}{3}{*}{<\a:mathml mo\Hnewline @@ -2652,7 +2686,7 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% {} \Configure{MathClass}{0}{*}{<\a:mathml mi\Hnewline>}{</\a:mathml mi>}{} \Configure{MathClass}{1}{*}{<\a:mathml mi\Hnewline - \mml:class="MathClass-op">}{</\a:mathml mi><mo> &\#x2061;<!--FUNCTION APPLICATION--></mo>}{} + \mml:class="MathClass-op">}{</\a:mathml mi><\a:mathml mo> &\#x2061;<!--FUNCTION APPLICATION--></\a:mathml mo>}{} \Configure{MathClass}{2}{*}{<\a:mathml mo\Hnewline \mml:class="MathClass-bin" \a:mathml stretchy="false">}{</\a:mathml mo>}{} \Configure{MathClass}{3}{*}{<\a:mathml mo\Hnewline @@ -3269,8 +3303,8 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% \HLet\injlim=\:tempc \Configure{qopname} {\Configure{mathop}{*} - {<\a:mathml mtext \mml:class="qopname">} - {</\a:mathml mtext><mo> &\#x2061;<!--FUNCTION APPLICATION--> </mo>} + {<\a:mathml mi \mml:class="qopname">} + {</\a:mathml mi><\a:mathml mo> &\#x2061;<!--FUNCTION APPLICATION--> </\a:mathml mo>} {}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |