Mathml with Mathjax not displaying in chrome and IE11

455 views
Skip to first unread message

sriva...@gmail.com

unread,
Oct 3, 2016, 5:31:20 AM10/3/16
to MathJax Users
Hi Team,

i have one jsp to display Mathdata along with others. in our project we are using xslt translations to render input from xml data source.

my sample xsl file

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
extension-element-prefixes=" mml"
>

<xsl:output method="xml" indent="yes"/>
<xsl:template match="mml:math">
  <div>
    <pre class="mathmldata" style="">
    <math mode="display" display="inline" xmlns:mml="http://www.w3.org/1998/Math/MathML"> 
      <xsl:apply-templates />
     </math>
    </pre>
  </div>
</xsl:template>

  <xsl:template match="mml:*">
    <xsl:element name="{local-name(.)}">
      <xsl:apply-templates select="@* | node()" />
    </xsl:element>
  </xsl:template>
  <xsl:template match="@*">
    <xsl:attribute name="{local-name(.)}">
      <xsl:value-of select="." />
    </xsl:attribute>
  </xsl:template>

</xsl:stylesheet>

In this file if i am getting input math ml with mml prefix i am removing and dispalying as html5 does not support name space prefix to render math ml
after that it started displaying math ml formulas in firefox browser

sample output of that:
<div>
<pre style="" class="mathmldata">
<math mode="display" display="block">


<mrow>


<mrow>


<msub>

<mi>ß</mi>

<mi>t</mi>

</msub>

<mo>=</mo>


<mfrac>


<msub>

<mi>?</mi>

<mi>t</mi>

</msub>


<mrow>

<mn>1</mn>

<mo/>


<msub>

<mi>?</mi>

<mi>t</mi>

</msub>

</mrow>

</mfrac>

</mrow>

<mo>,</mo>

</mrow>

</math>
</pre>
</div>

but same thing not working for IE and chrome browsers and from internet i got to know that mathjax will do that rending for these.
so i included as below in my project main-tiles.xml for the view as i downloaded mathjax to my local and used the same

 <put-list-attribute name="prejs">   
    <add-attribute value="lib/MathJax-2.6-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" />
    </put-list-attribute>

but still formulas are not rending 

i checked by clicking on page-view source and laoded as below.along with below we are loading many other js files required for our project.

point here is

1) when i try with sample html with mathML and the above script working fine in chrome but in our project its not

i tried many options from different sites but i could not get resolution 

Could you please help me to solve this issue?

Thanks in advance.


Peter Krautzberger

unread,
Oct 4, 2016, 8:40:55 AM10/4/16
to mathja...@googlegroups.com
Hi,

It's hard to make any suggestion without a live page with a minimal example that exhibits the problem. You might want to use jsbin or codepen to share an example.

Kind regards,
Peter.

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sri Valli

unread,
Oct 7, 2016, 6:10:51 AM10/7/16
to mathja...@googlegroups.com
HI peter,

Thanks for the response.
i tried to convey my problem with the below sample html file.
In our project , while loading recorddetails jsp we are making RPC call and get the data and attach to the DOM element and display. But some part of data ,when we click on particular  show button then we are making another RPC call and displaying data.

i was using MAthJax below feature in my recorddetails.jsp
<script type="text/javascript"


and at the end of attaching data to DOM element i am calling 
function loadMathJaxafterPageLoad(){
  setTimeout(function(){
    MathJax.Hub.Configured();
  },1000);
}

This is working for formulas while page loading time and displays properly but when i click on show button for different set of data that time formula not rendering properly.

My observation is "MathJax.Hub.Configured();" can be called only once ????

same scenario i was able to replicate by a sample html- math.html

 steps :
1) if we just refresh page - formula displaying correctly
2) click on "Add" button then its not displaying formula


Please let me know if you need more info.

Thanks.

  


Regards,
Srivalli

--
You received this message because you are subscribed to a topic in the Google Groups "MathJax Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathjax-users/P66qsA-iBkg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathjax-users+unsubscribe@googlegroups.com.
Math.html

David Farmer

unread,
Oct 7, 2016, 7:46:58 AM10/7/16
to mathja...@googlegroups.com

Dear Srivalli,

One of the reasons Peter asked for a live example, and not just your
description of the symptoms, is that your setup may not be the same as
mine or Peter's. There have been many cases where the sample HTML
works just fine when I try it. The problems turns out to be some
configuration on the server, or interference with some other package.

If you have a live website exhibiting this problem, then providing a
link to that is your best chance of having the problem solved.

Regards,

David
> mathjax-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "MathJax Users"
> group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mathjax-users/P66qsA-iBkg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mathjax-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "MathJax Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> mathjax-user...@googlegroups.com.

Peter Krautzberger

unread,
Oct 7, 2016, 8:18:55 AM10/7/16
to mathja...@googlegroups.com
Hi Srivalli,

In addition to David's comment, it sounds like you should to take a look at http://docs.mathjax.org/en/latest/advanced/typeset.html to start off.

Regards,
Peter.



For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to a topic in the Google Groups "MathJax Users"
group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mathjax-users/P66qsA-iBkg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to

For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-users+unsubscribe@googlegroups.com.

Sri Valli

unread,
Oct 12, 2016, 3:09:53 AM10/12/16
to mathja...@googlegroups.com
HI Peter,

Thanks for pointing me to the right api.

MathJax.Hub.Queue(["Typeset",MathJax.Hub]); helped to resolve my issue
after my asynchronus call i put above line then its working in chrome and IE11 as well


Regards,
Srivalli
Reply all
Reply to author
Forward
0 new messages