MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

LaTeX to MathML ignore comments in Mathml

Open sarankup opened this issue 11 years ago • 1 comments

First of all thank you so much for such a great MathJax invention. This is the brilliant work.

I use MathJax to convert LaTeX equations to MathML. The generated MathML has comments and having the UTF-8 character into it. For example as below:

...<mml:munderover><mml:mo>∏<!-- ∠--></mml:mo><mml:mrow class="MJX-TeXAtom-ORD">....

Are there any way, can I configure to not produce comments (eg., <!-- ∠-->) in the MathML?

Thanks in advance.

sarankup avatar Feb 05 '15 11:02 sarankup

Thanks for posting here, too. As I wrote on the User Group, there's no configuration option right now -- it's hard coded into the treatment of entities. I've tagged it as a feature request.

You can override it on the fly using the configuration below.

    <script type="text/x-mathjax-config">
    MathJax.Hub.Register.StartupHook("toMathML Ready",function () {
      MathJax.ElementJax.mml.entity.Augment({
        toMathML: function (space) {return (space||"") + "&"+this.data[0]+";"}
      });
    });
    </script>

pkra avatar Feb 05 '15 20:02 pkra