Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MathJax fails for this MML input #949

Closed
oliver---- opened this issue Nov 3, 2014 · 12 comments

Comments

Projects
None yet
2 participants
@oliver----
Copy link

commented Nov 3, 2014

Sorry, I am not a MathML expert and can't tell if there is something wrong with this input or MathJax having troubles.
The validator http://www.mathmlcentral.com/Tools/ValidateMathML.jsp tells me that the MML is fine, so I suppose it is MJ.

<math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mrow><mfrac><mrow><msub><mrow><mi>d</mi><mi>A</mi></mrow><mrow><mn>1</mn></mrow></msub></mrow><mrow><mi>d</mi><mi>t</mi></mrow></mfrac><mo>=</mo><msub><mrow><mi>A</mi></mrow><mrow><msub><mrow><mstyle mathvariant="normal"><mrow><mi>i</mi><mi>m</mi></mrow></mstyle></mrow><mrow><mn>1</mn></mrow></msub></mrow></msub><mo>×</mo></mrow><mo>&#8201;</mo><msub><mrow><mi>k</mi></mrow><mrow><msub><mrow><mstyle mathvariant="normal"><mrow><mi>i</mi><mi>m</mi></mrow></mstyle></mrow><mrow><mn>1</mn></mrow></msub></mrow></msub><mo>+</mo><msub><mrow><mi>A</mi></mrow><mrow><msub><mrow><mstyle mathvariant="normal"><mrow><mi>i</mi><mi>m</mi></mrow></mstyle></mrow><mrow><mn>2</mn></mrow></msub></mrow></msub><mo>×</mo><msub><mrow><mi>K</mi></mrow><mrow><msub><mrow><mstyle mathvariant="normal"><mrow><mi>i</mi><mi>m</mi></mrow></mstyle></mrow><mrow><mn>2</mn></mrow></msub></mrow></msub><mo>+</mo><msub><mrow><mi>A</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>s</mi><mi>c</mi></mrow></mstyle></mrow></msub><mo>×</mo><msub><mrow><mi>K</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>s</mi><mi>c</mi></mrow></mstyle></mrow></msub><mo>&#8722;</mo><mi mathvariant="normal">C</mi><mi mathvariant="normal">L</mi><mo>×</mo><mi>C</mi><mo>&#8722;</mo><mo stretchy="false">[</mo><msub><mrow><mi mathvariant="normal">C</mi><mi mathvariant="normal">L</mi></mrow><mrow><mn>2</mn></mrow></msub><mo>×</mo><mo stretchy="false">(</mo><mi>C</mi><mo>&#8722;</mo><msub><mrow><mi>C</mi></mrow><mrow><mn>2</mn></mrow></msub><mo stretchy="false">)</mo><mo stretchy="false">]</mo><mo>&#8722;</mo><mo stretchy="false">[</mo><msub><mrow><mi mathvariant="normal">C</mi><mi mathvariant="normal">L</mi></mrow><mrow><mn>3</mn></mrow></msub><mo>×</mo><mo stretchy="false">(</mo><mi>C</mi><mo>&#8722;</mo><msub><mrow><msub><mrow><mi>C</mi></mrow><mrow><mn>3</mn></mrow></msub><mo>&#8201;</mo><mo stretchy="false">)</mo><mo stretchy="false">]</mo><mo>&#8722;</mo><mo stretchy="false">[</mo><msub><mrow><mi>Q</mi></mrow><mrow><mi mathvariant="normal">L</mi></mrow></msub><mo>×</mo><mo stretchy="false">(</mo><mi>C</mi><mo>&#8722;</mo><msub><mrow><mi>C</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>L</mi></mrow></mstyle></mrow></msub><mo stretchy="false">)</mo><mo stretchy="false">]</mo><mo>&#8722;</mo><mo stretchy="false">[</mo><msub><mrow><mi>Q</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>K</mi></mrow></mstyle></mrow></msub><mo>×</mo><mo stretchy="false">(</mo><mi>C</mi><mo>&#8722;</mo><msub><mrow><mi>C</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>K</mi></mrow></mstyle></mrow></msub><mo stretchy="false">)</mo><mo stretchy="false">]</mo><mo>&#8722;</mo><mo stretchy="false">[</mo><msub><mrow><mi>Q</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>M</mi></mrow></mstyle></mrow></msub><mo>×</mo><mo stretchy="false">(</mo><mi>C</mi><mo>&#8722;</mo><msub><mrow><mi>C</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>M</mi></mrow></mstyle></mrow></msub><mo stretchy="false">)</mo><mo stretchy="false">]</mo></mrow><mrow></mrow></msub></mrow></math>

@oliver---- oliver---- changed the title MathJax fails for the attached MML input MathJax fails for this MML input Nov 3, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Nov 4, 2014

The MathML displays for me. Can you be more specific about the problem you are experiencing? Also, what your MathJax configuration is, and what browser and OS (and their versions) you are using?

@oliver----

This comment has been minimized.

Copy link
Author

commented Nov 4, 2014

Sorry, I found out that I have probably two simultanous issues, which I was not aware of.

This doesn't work in FF 33:

<html>
  <head>
    <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      "HTML-CSS": { linebreaks: { automatic: true } },
             SVG: { linebreaks: { automatic: true } }
    });
    </script>
    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  </head>
  <body>
    <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mrow><mfrac><mrow><msub><mrow><mi>d</mi><mi>A</mi></mrow><mrow><mn>1</mn></mrow></msub></mrow><mrow><mi>d</mi><mi>t</mi></mrow></mfrac><mo>=</mo><msub><mrow><mi>A</mi></mrow><mrow><msub><mrow><mstyle mathvariant="normal"><mrow><mi>i</mi><mi>m</mi></mrow></mstyle></mrow><mrow><mn>1</mn></mrow></msub></mrow></msub><mo>×</mo></mrow><mo> </mo><msub><mrow><mi>k</mi></mrow><mrow><msub><mrow><mstyle mathvariant="normal"><mrow><mi>i</mi><mi>m</mi></mrow></mstyle></mrow><mrow><mn>1</mn></mrow></msub></mrow></msub><mo>+</mo><msub><mrow><mi>A</mi></mrow><mrow><msub><mrow><mstyle mathvariant="normal"><mrow><mi>i</mi><mi>m</mi></mrow></mstyle></mrow><mrow><mn>2</mn></mrow></msub></mrow></msub><mo>×</mo><msub><mrow><mi>K</mi></mrow><mrow><msub><mrow><mstyle mathvariant="normal"><mrow><mi>i</mi><mi>m</mi></mrow></mstyle></mrow><mrow><mn>2</mn></mrow></msub></mrow></msub><mo>+</mo><msub><mrow><mi>A</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>s</mi><mi>c</mi></mrow></mstyle></mrow></msub><mo>×</mo><msub><mrow><mi>K</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>s</mi><mi>c</mi></mrow></mstyle></mrow></msub><mo>−</mo><mi mathvariant="normal">C</mi><mi mathvariant="normal">L</mi><mo>×</mo><mi>C</mi><mo>−</mo><mo stretchy="false">[</mo><msub><mrow><mi mathvariant="normal">C</mi><mi mathvariant="normal">L</mi></mrow><mrow><mn>2</mn></mrow></msub><mo>×</mo><mo stretchy="false">(</mo><mi>C</mi><mo>−</mo><msub><mrow><mi>C</mi></mrow><mrow><mn>2</mn></mrow></msub><mo stretchy="false">)</mo><mo stretchy="false">]</mo><mo>−</mo><mo stretchy="false">[</mo><msub><mrow><mi mathvariant="normal">C</mi><mi mathvariant="normal">L</mi></mrow><mrow><mn>3</mn></mrow></msub><mo>×</mo><mo stretchy="false">(</mo><mi>C</mi><mo>−</mo><msub><mrow><msub><mrow><mi>C</mi></mrow><mrow><mn>3</mn></mrow></msub><mo> </mo><mo stretchy="false">)</mo><mo stretchy="false">]</mo><mo>−</mo><mo stretchy="false">[</mo><msub><mrow><mi>Q</mi></mrow><mrow><mi mathvariant="normal">L</mi></mrow></msub><mo>×</mo><mo stretchy="false">(</mo><mi>C</mi><mo>−</mo><msub><mrow><mi>C</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>L</mi></mrow></mstyle></mrow></msub><mo stretchy="false">)</mo><mo stretchy="false">]</mo><mo>−</mo><mo stretchy="false">[</mo><msub><mrow><mi>Q</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>K</mi></mrow></mstyle></mrow></msub><mo>×</mo><mo stretchy="false">(</mo><mi>C</mi><mo>−</mo><msub><mrow><mi>C</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>K</mi></mrow></mstyle></mrow></msub><mo stretchy="false">)</mo><mo stretchy="false">]</mo><mo>−</mo><mo stretchy="false">[</mo><msub><mrow><mi>Q</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>M</mi></mrow></mstyle></mrow></msub><mo>×</mo><mo stretchy="false">(</mo><mi>C</mi><mo>−</mo><msub><mrow><mi>C</mi></mrow><mrow><mstyle mathvariant="normal"><mrow><mi>M</mi></mrow></mstyle></mrow></msub><mo stretchy="false">)</mo><mo stretchy="false">]</mo></mrow><mrow></mrow></msub></mrow></math>
  </body>
</html>

I started in a complex environment using Chrome. However, Chrome is ok for that simplistic sample.
I will try to figure out what the difference is with the complex setup.

@oliver----

This comment has been minimized.

Copy link
Author

commented Nov 4, 2014

I am currently on Ubuntu 14.04 LTS.

@oliver----

This comment has been minimized.

Copy link
Author

commented Nov 4, 2014

MJ renders 'Math Processing Error'.

@dpvc

This comment has been minimized.

Copy link
Member

commented Nov 4, 2014

OK, thanks. Looks like it is something in the line breaking code. Always a nightmare to track down.

@dpvc dpvc added the Accepted label Nov 4, 2014

@oliver----

This comment has been minimized.

Copy link
Author

commented Nov 4, 2014

Would be great if you could look at the setup, where Chrome 38 fails too.
I have published it at http://cdn.substance.io/mj949/
In the debugger open lens.js and set a breakpoint at line 17130. ATM I add the mml as is into the DOM. With other MML this usually works.

@oliver----

This comment has been minimized.

Copy link
Author

commented Nov 4, 2014

You are absolutely right with the line-break assumption. It gets rendered when deactivating that configuration (in my complex setup, in FF + Chrome).

@dpvc dpvc added the Investigate label Dec 22, 2014

dpvc pushed a commit to dpvc/MathJax that referenced this issue Dec 27, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Dec 27, 2014

This turns out to be caused by the empty subscript at the very end of the expression. The HTML-CSS jax doesn't produce any output for that, but the line breaking was trying to move the subscript anyway. Since it didn't exist in the output, that caused the error.

I have fixed this in the issue949 branch of my fork of MathJax.

@dpvc dpvc added this to the MathJax 2.5 milestone Dec 27, 2014

dpvc pushed a commit to dpvc/MathJax that referenced this issue Dec 27, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Dec 27, 2014

=> Merged.

@dpvc dpvc added Merged and removed Ready for Review labels Dec 27, 2014

@dpvc dpvc closed this Dec 27, 2014

dpvc pushed a commit to dpvc/MathJax that referenced this issue Jan 14, 2015

@dpvc

This comment has been minimized.

Copy link
Member

commented Jan 14, 2015

==> In Testsuite

MathMLToDisplay/Topics/LineBreak/issue949.html

@dpvc

This comment has been minimized.

Copy link
Member

commented Jan 14, 2015

It turns out that the test file showed up a similar error in SVG output, which is fixed in the issue949 branch of my fork of MathJax.

dpvc pushed a commit to dpvc/MathJax that referenced this issue Jan 14, 2015

@dpvc

This comment has been minimized.

Copy link
Member

commented Jan 14, 2015

==> Merged (SVG fix)

@dpvc dpvc removed the Merged label Jan 30, 2015

@dpvc dpvc added Fixed v2.5 labels Jan 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.