-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Math Processing Error]s with MathJax 2.5 => can't typeset detached #33
Comments
confirmed that MJ |
menu -> Show math as -> Error message => |
The obvious |
Same error also accissible in console as In firefox it gives different error: |
I'm having the same trouble in a different project. Did you ever solve this? |
Not yet, I stayed on 2.4 so far. I'll try to attack it today.
|
We reverted back to 2.4 as well for now. The problem for us lies in using iframes to host the previews, but loading mathjax in the outer document. Due to some legacy issues we can't just switch to divs, though that would solve it. Good luck! |
Reported with minimal case at mathjax/MathJax#1185 All errors I saw were from CHTML code new in 2.5. They go away if I disable Fast Preview (and don't choose Fast HTML as the renderer). |
@mull [Issue very specific to my project: once it's typeset I can give the element to CodeMirror but then I won't be able to optimize with MathJax's |
I now tried the simplest possible fix, which is to markText immediately instead of after typesetting. |
For kicks I wrote a jsFiddle with this issue. We will have to stay with 2.4 for now. With 2.4: http://jsfiddle.net/35L1pegp/ Things rendered properly with 2.5 if Fast Preview was turned off, but it was still 4 times slower than 2.4 out of attached DOM rendering. CommonHTML rendering method in 2.6 was just as slow as HTML-CSS. |
(this is actually reordered history: I first wrote a solution to #33 but it seems it slowed things down => this will help me measure before and after.)
Made no effort to mimic CodeMirror class hierarchy for exact styling. Full render slowed down from 51sec to 46sec - unclear if significant.
I implemented in-DOM rendering but now that I can run 2.5 and 2.6 I'm also seeing dramatic slowdown: 7.5sec with 2.4.0, 50sec with 2.5.3, 50sec with 2.6.0-beta.1. BTW, out-of-DOM with 2.4 was slower: 15sec vs 7.5sec for in-DOM. So 2.4 with in-DOM is so far fastest. Firefox with 2.6: It's so damn slow I'm seeing 1-2 formulas at a time getting replaced...
I'll try to dig deeper (and produce simpler tests, with permalinks per version/config; ideally jsperf?) and report on MathJax mailing list. Oh, and I should try KaTeX. |
I implemented batched typesetting in 7e1851e: This may explain how come there was a big 2.4->2.5 slowdown that went unnotticed: it only happens when you dynamically queue many Typeset calls, which is a rare use case (most people have MathJax process existing content once when it loads). The original issue here is fixed, leaving it open until I:
|
Use case: I've discovered MJ measuring & rendering from the typesetting div (commit d77f0fc, #33) somehow made math small in Mathdown, due to mathdown.css having: .CodeMirror { font-family: "lining_numerals_charter", "Georgia", ... } If I drop out the (nearly empty) first font "lining_numerals_charter", it works out. => I'm just gonna style the typesetting div without this font, so I want it to have a better "public class name".
Finally solves MathJax 2.4 showing a vertical line after each formula (in Chrome?). MathJax 25+ was blocked on 2 things: (cben/CodeMirror-MathJax#33) - many Typeset calls are way slower than 2.4, *mostly* solved by newer CM-MJ batching them - typesetting out of DOM no longer works, fixed by CM-MJ now typesetting in invisible div, But the new CM-MJ made math tiny in mathdown :-( => Turns out "lining_numerals_charter" font was confusing MJ, found a workaround, now I can finally update :-)
MJ 2.5 is out and the demo page now points to it (it uses
latest/
).It consistently gives [Math Processing Error] on about half the math — same formulas every time:
AMScd: $ \begin{CD} A @<<< B @>>> C\\ @. @| @AAA\\ @. D @= E \end{CD}$
\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}
\begin{equation}x+1\over\sqrt{1-x^2}\label{ref2}\end{equation}
\begin{align} x& = y_1-y_2+y_3-y_5+y_8-\dots && \text{by \eqref{ref1}}\\ & = y'\circ y^* && \text{(by \eqref{ref3})}\\ & = y(0) y' && \text {by Axiom 1.} \end{align}
=> Yep, it happens with environments - I changed a
$$..$$
to\begin{equation}..\end{equation}
and it broke.No errors in log; the only suspicious thing is repeating " Fallaback flushMarkTextQueue: 2" (used to be 1).
The text was updated successfully, but these errors were encountered: