1

I am using htlatex to convert a LaTeX to HTML.

I am writing the simple equation in latex document. This equation is converted my required MathML coding output 1.

Mathml Output 1:

<mml:math 
 xmlns="http://www.w3.org/1998/Math/MathML"  
display="block" mml:class="equation">
                    <mml:mi>&#x03B2;</mml:mi><mml:mrow><mml:mo mmlclass="MathClass-open">(</mml:mo><mml:mrow><mml:mi>G</mml:mi></mml:mrow><mml:mo mmlclass="MathClass-close">)</mml:mo></mml:mrow> <mml:mo mmlclass="MathClass-rel">&#x2265;</mml:mo> <mml:mi>&#x03B3;</mml:mi><mml:mrow><mml:mo mmlclass="MathClass-open">(</mml:mo><mml:mrow><mml:mi>F</mml:mi> <mml:mo mmlclass="MathClass-bin">&#x2229;</mml:mo> <mml:mi>L</mml:mi></mml:mrow><mml:mo mmlclass="MathClass-close">)</mml:mo></mml:mrow> <mml:mo mmlclass="MathClass-bin">+</mml:mo> <mml:mi>&#x03B3;</mml:mi><mml:mrow><mml:mo mmlclass="MathClass-open">(</mml:mo><mml:mrow><mml:msup><mml:mrow 
><mml:mi>F</mml:mi></mml:mrow><mml:mrow 
><mml:mi>c</mml:mi></mml:mrow></mml:msup 
> <mml:mo mmlclass="MathClass-bin">&#x2229;</mml:mo> <mml:mi>L</mml:mi></mml:mrow><mml:mo mmlclass="MathClass-close">)</mml:mo></mml:mrow><mml:mo mmlclass="MathClass-punc">.</mml:mo>
</mml:math>

The same equation is inserted plenty of math equation available and same configuration file is used. But the MathML coding is not converted properly. some of the tags are not implemented. The MathML coding output 2 below mentioned here

MathML coding output 2:

<mml:math 
 xmlns="http://www.w3.org/1998/Math/MathML"  
display="block" mml:class="equation">
                    &#x03B2;(G) &#x2265; &#x03B3;(F &#x2229; L) + &#x03B3;(<mml:msup><mml:mrow>F</mml:mrow><mml:mrow>c</mml:mrow></mml:msup> &#x2229; L).
</mml:math>

I compare the two MathML coding output 1 and 2 lot of coding are loss in my MathML output 2. For EX: (G) code convert O/P 1 is "<mml:mrow><mml:mo mmlclass="MathClass-open">(</mml:mo><mml:mrow><mml:mi>G</mml:mi></mml:mrow><mml:mo mmlclass="MathClass-close">)</mml:mo></mml:mrow>" But O/P two is converted just as (G). Lot of MathML coding missing.

I am using the same config file. But I don't understand the problem why the MathML code is Loss.

I can't load the full math version of the TeX file. So i load only MWE and CFG file for your reviews.

MWE:

\documentclass{book}

\usepackage[utf8]{inputenc}
\usepackage[numbers,compress]{natbib}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{upgreek}
\usepackage{hyperref}
\usepackage{graphics}
\usepackage{enumerate}

\begin{document}

\begin{equation*}
\beta(G)\geq \gamma(F\cap L)+ \gamma(F^{c}\cap L).
\end{equation*}

\end{document}

my cfg:

\Preamble{xhtml,mathml,NLM,-xtpipes,NoFonts,refcaption,DocBook}

\Configure{mathml}{mml:}
\Configure{MathClass}{0}{*}{<mml:mi>}{</mml:mi>}{}
\Configure{MathClass}{1}{*}{<mml:mo mmlclass="MathClass-op">}{</mml:mo>}{}
\Configure{MathClass}{2}{*}{<mml:mo mmlclass="MathClass-bin">}{</mml:mo>}{}
\Configure{MathClass}{3}{*}{<mml:mo mmlclass="MathClass-rel">}{</mml:mo>}{}
\Configure{MathClass}{4}{*}{<mml:mrow><mml:mo mmlclass="MathClass-open">}
                           {</mml:mo><mml:mrow>}{}
\Configure{MathClass}{5}{*}{</mml:mrow><mml:mo mmlclass="MathClass-close">}
                           {</mml:mo></mml:mrow>}{}
\Configure{MathClass}{6}{*}{<mml:mo mmlclass="MathClass-punc">}{</mml:mo>}{}
\Configure{MathClass}{7}{*}{<mml:mn>}{</mml:mn>}
                           {0123456789}     
% \Configure{MathClass}{2}{*}{<mml:mo>}{</mml:mo>}{}
% \Configure{MathClass}{3}{*}{<mml:mn>}{</mml:mn>}{}

\begin{document}
\EndPreamble

How to get the full MathML code for the Heavy Math TeX files. Please advise.

  • I have no problem with your MWE and CFG. Could you please explain what syntax you have given to generate the HTML. – Jagath Jun 24 '16 at 12:40
  • @JagathAR Sorry for the delay reply. I upload the heavy math TeX file follow this link [Sam.tex] (filehosting.org/file/details/580010/sam.tex) . I commented the word %MWE Equation in this tex file. This equation coding is not converted properly when using the same cfg file. Please check this tex file and share your throughts – Vetri Jun 25 '16 at 6:40

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.