I just like to get an understanding on why I get this error, only when I use MathML and not in other configurations. pdflatex work fine with this MWE. Only when there is an \fox{}, will tex4ht gives an error.

The MWE is below, showing 3 cases. The case with the \fbox fails only with tex4ht, and only when using mathml.

Here is the MWE



\fbox{$\sin(x)=0$}   % OK 

\sin(x)=0   \tag{1}   % OK

\fbox{$\sin(x)=0$} \tag{1}    %fails only with mathml


now, pdflatex compiles the above with no problem, here is the pdf

Mathematica graphics

now, tex4ht compiles it ok, with default html setting:

  htlatex foo.tex "htm"

no error. HTML is generated ok. Now with I use mathml (which I wanted to do for mathjax use), I get an error

>htlatex foo.tex "htm,mathml"
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
 restricted \write18 enabled.
entering extended mode
! Display math should end with $$.
<to be read again> 
l.16 \end{equation}


The error is due to using \fbox{}

Any idea what is going on? Is this an tex4ht issue, or mathml or something else? The above is small example from autogenerated code by Scientific word. It is generated when I put a box around an equation in display mode.

texlive 2013, linux mint

  • 2
    I get no error if I use the correct command, that is, \boxed{\sin(x)=0}. If SWP doesn't know about \boxed, which has been around for more than 20 years, I don't know what to do. – egreg Jan 6 '14 at 0:00
  • I've added this to tex4ht issue tracker puszcza.gnu.org.ua/bugs/?244 – michal.h21 Feb 8 '15 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.