michal-h21 / make4ht

Build system for tex4ht
131 stars 15 forks source link

'mathml'-option giving wrong output for limsup and liminf #133

Closed yalguzaq closed 10 months ago

yalguzaq commented 10 months ago

LaTeX

Limit inferior and limit superior operators:

\documentclass[10pt]{article}
\usepackage{mathtools}

\begin{document}
\begin{equation*}
  \liminf_{n \to \infty} a_n \le \liminf_{n \to \infty} b_n.
\end{equation*}
\end{document}

make4ht

make4ht markup.tex 'mathml,mathjax'

Desired output

via make4ht markup.tex 'mathjax' image

Erroneous output

image

michal-h21 commented 10 months ago

Thanks for the report. Try this configuration file:

\Preamble{xhtml}
\catcode`\:=11
\def\:limspaces#1#2{\HCode{<\a:mathml mi>#1</\a:mathml mi><\a:mathml mspace class="thinspace"  width="0.17em"></\a:mathml mspace><\a:mathml mi>#2</\a:mathml mi><\a:mathml mspace class="thinspace" width="0.17em"></\a:mathml mspace>}}
\def\:tempc{\qopname\relax m{\:limspaces{lim}{inf}}}
\HLet\liminf=\:tempc
\def\:tempc{\qopname\relax m{\:limspaces{lim}{sup}}}
\HLet\limsup=\:tempc
\def\:tempc{\qopname\relax m{\:limspaces{proj}{lim}}}
\HLet\projlim=\:tempc
\def\:tempc{\qopname\relax m{\:limspaces{inj}{lim}}}
\HLet\injlim=\:tempc
\Configure{qopname}
   {\Configure{mathop}{*}
      {<\a:mathml mrow \mml:class="qopname">}
  {</\a:mathml mrow><mo> &\#x2061;<!--FUNCTION APPLICATION--> </mo>}
      {}}
\catcode`\:=12
\begin{document}
\EndPreamble
yalguzaq commented 10 months ago

Thanks, it worked.