Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

\documentclass{article}
\usepackage{amsmath}

\begin{document}

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

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

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

\end{document}

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
.........
(/usr/local/texlive/2013/texmf-dist/tex/generic/tex4ht/html-mml.4ht)
(/usr/local/texlive/2013/texmf-dist/tex/generic/tex4ht/html4-uni.4ht))
(./foo.aux)
! Display math should end with $$.
<to be read again> 
                   \bgroup 
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

share|improve this question
1  
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 at 0:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.