[tex4ht] another mathml/mathjax issue, \operatorname{} problem with mathjax
Michal Hoftich
michal.h21 at gmail.com
Thu Aug 7 13:33:06 CEST 2014
Hi Nasser,
I don't think this is related to mathjax, your code generates mathml
which is invalid according to w3c html validator. What about this?:
\[
\operatorname{I}_{\frac{4}{3}}
\]
output from pdflatex is same as in your version, but mathml produced
by tex4ht is valid and looks same as pdf version.
Regards,
Michal
2014-08-06 21:51 GMT+02:00 Nasser M. Abbasi <nma at 12000.org>:
> 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