[tex4ht] another mathml/mathjax issue, \operatorname{} problem with mathjax

Nasser M. Abbasi nma at 12000.org
Wed Aug 6 21:51:06 CEST 2014


fyi,

This might be known issue. This MWE generate mathml that mathjax does not like.

--------------------------------
     \documentclass[12pt]{article}
     \usepackage{amsmath}
     \begin{document}
     \[
        \operatorname{I_{\frac{4}{3}}}
     \]
     \end{document}
-----------------------

compile with:

htlatex foo.tex "nma,htm,pic-align,charset=utf-8,notoc*" " -cunihtf -utf8"

The foo.htm file, on firefox shows an error

          Unexpected text node: 'I'

the file nma.cfg just loads the mathjax. Here it is in case someone
wants to reproduce the above:

-------------------------------
>cat  nma.cfg

\Preamble{xhtml,mathml,ext=htm,charset="utf-8",p-width,pic-align}  %does mathml, not png !
\Configure{VERSION}{}
   \Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}
   \Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
   \Configure{@HEAD}{}
   \Configure{@HEAD}{\HCode{<meta charset="UTF-8" />\Hnewline}}
   \Configure{@HEAD}{\HCode{<link
            rel="stylesheet" type="text/css"
            href="\expandafter\csname aa:CssFile\endcsname" />\Hnewline}}
            
   \Configure{@HEAD}{\HCode{%
      <script type="text/x-mathjax-config">\Hnewline
        MathJax.Hub.Config({\Hnewline
          extensions: ["tex2jax.js"],
          jax: ["input/TeX", "output/HTML-CSS"],
          tex2jax: {
            \unexpanded{inlineMath: [ ['$','$'], ["\\(","\\)"] ],}\Hnewline
            \unexpanded{displayMath: [ ['$$','$$'], ["\\[","\\]"] ],}\Hnewline
            ignoreClass: "fancyvrb|verbatim",\Hnewline
            processEscapes: true
          },
          "HTML-CSS": { availableFonts: ["TeX"] }
        });\Hnewline
      </script>
   }}
            
   \Configure{@HEAD}{\HCode{<script type="text/javascript"\Hnewline
   src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"\Hnewline
   ></script>\Hnewline}}
   \Configure{@HEAD}{\HCode{<style type="text/css">\Hnewline
     .MathJax_MathML {text-indent: 0;}\Hnewline
   </style>\Hnewline}}

\begin{document}

\EndPreamble
------------------------------------------------

Here is the HTML source for the above:

---------------------------------------------
<div class="par-math-display"><!--l. 8--><math
  xmlns="http://www.w3.org/1998/Math/MathML"
display="block" ><mrow
>
      <mo class="qopname"><msub><mrow
>I</mrow><mrow
><mfrac><mrow
>4</mrow>
<mrow
>3</mrow></mfrac> </mrow></msub
></mo><!--nolimits-->
</mrow></math></div>
<!--l. 10--><p class="nopar" >
</p>
---------------------------------

texlive 2014 on Linux

thank you,
--Nasser



More information about the tex4ht mailing list