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 v2.5 not working with PhantomJS #1029

Closed
utzc opened this issue Jan 30, 2015 · 9 comments
Closed

MathJax v2.5 not working with PhantomJS #1029

utzc opened this issue Jan 30, 2015 · 9 comments
Labels
Abandoned Accepted Issue has been reproduced by MathJax team

Comments

@utzc
Copy link

utzc commented Jan 30, 2015

I use MathJax with PhantomJS to render PDFs with math equations. I started seeing this error coming from my phantomjs process now that http://cdn.mathjax.org/mathjax/latest points to v2.5:

TypeError: '[object NodeList]' is not a valid argument for 'Function.prototype.apply' (evaluating 'this.elementScripts(e[d])')

  http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_HTMLorMML-full:19

When I changed my code to point to 2.4-latest, the error went away and my phantomjs process started working again. I am using phantomjs 1.9.7.

@dpvc
Copy link
Member

dpvc commented Jan 30, 2015

Try adding

<script type="test/x-mathjax-config">
MathJax.Hub.msieHTMLCollectionBug = true;
</script>

to your page just before the script that loads MathJax.js itself, and see if that helps. If so, let me know, and I'll see about fixing it more generally.

@utzc
Copy link
Author

utzc commented Jan 31, 2015

Adding this line prevents the error from appearing, but the equations no longer render correctly (the equations show up weirdly as a bunch of blue lines).

Here is an example of what the phantomjs rendering looks like using v2.4:
http://imgur.com/pWWtTXb,hhI8IzI#0

Here is what it looks like using v2.5 (with the additional line setting you mentioned):
http://imgur.com/pWWtTXb,hhI8IzI#1

@dpvc
Copy link
Member

dpvc commented Jan 31, 2015

Thanks for trying that out. The lines are what MathJax used to measure the widths available for the various expressions, and the fact that you are seeing them suggests that MathJax is crashing somewhere during its processing of the output, since you normally would never see these. Are you getting any further console messages?

@dpvc
Copy link
Member

dpvc commented Jan 31, 2015

I'm not sure if this is practical, but can you send me an example file and the PhantomJS code that you are using?

@utzc
Copy link
Author

utzc commented Feb 1, 2015

When I add the configuration option I do not see any additional errors in the console.

I put together this example HTML page and phantomjs script which might help in figuring out what's going on ... its not the exact code I am using but it shows the same problem.

http://c.utz.cc/mathjax/index.html
http://c.utz.cc/mathjax/render.js

The script render.js when run using phantomjs renders the index.html script to a PDF. The index.html includes mathjax 2.5 and sets msieHTMLCollectionBug to true.

Also, I noticed that even when running the index.html page from chrome, I see the blue lines and not the rendered equations. Without the msieHTMLCollectionBug flag set to true, the equations render properly in chrome.

@pkra
Copy link
Contributor

pkra commented Mar 4, 2015

@baron314159 I'm not sure how to go along reproducing this. Is there as specific tool chain you use?

@pkra
Copy link
Contributor

pkra commented Mar 4, 2015

Oh nevermind. I somehow missed your links.

@pkra
Copy link
Contributor

pkra commented Mar 4, 2015

If you remove 'mathSandbox' (which does not occur in the page) from the elements configuration, then it seems to work fine.

Perhaps there's a connection with #1061.

@pkra pkra added the Accepted Issue has been reproduced by MathJax team label Mar 4, 2015
@pkra pkra removed the Investigate label Apr 15, 2015
@pkra pkra added the Abandoned label Aug 31, 2017
@pkra
Copy link
Contributor

pkra commented Aug 31, 2017

Marked as abandoned since PhantomJS is dead.

@dpvc dpvc closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Abandoned Accepted Issue has been reproduced by MathJax team
Projects
None yet
Development

No branches or pull requests

3 participants