michal-h21 / make4ht

Build system for tex4ht
132 stars 15 forks source link

'mathml'-option cannot parse \boxed command #94

Closed yalguzaq closed 1 year ago

yalguzaq commented 1 year ago

As the title already says, running $$ a = \boxed{b^2 + 2}.$$ in a minimal LaTeX environment via pdflatex or via make4ht file.tex results in the desired output, whereas turning on MathML removes the border make4ht file.tex 'mathml,mathjax'

michal-h21 commented 1 year ago

I think it does, but it produces <mrow class="boxed"> instead of <menclose notation="box">. I will fix that in TeX4ht sources.

In the meantime, you can use this configuration file:

\Preamble{xhtml}

\catcode`\:=11
\Configure{boxed}
   {\ifmathml \Tg<\a:mathml menclose \a:mathml notation="box">\Tg<\a:mathml mrow>%
    \else     \HCode{<span class="boxed">}\IgnorePar\fi}
   {\ifmathml \Tg</\a:mathml mrow>\Tg</\a:mathml menclose>%
    \else \HCode{</span>}\fi}
\catcode`\:=12
\begin{document}
\EndPreamble