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

update default fontURL #323

Closed
pkra opened this issue Apr 21, 2017 · 4 comments
Closed

update default fontURL #323

pkra opened this issue Apr 21, 2017 · 4 comments

Comments

@pkra
Copy link
Contributor

pkra commented Apr 21, 2017

https://github.com/mathjax/MathJax-node/blob/master/lib/main.js#L41

@pkra pkra added the Accepted label Apr 21, 2017
@pkra
Copy link
Contributor Author

pkra commented Apr 22, 2017

While writing a test, I realized the fontURL cannot be reconfigured. I'll add that to a PR.

@dpvc
Copy link
Member

dpvc commented Apr 22, 2017

There are many things that can't be reconfigured. The configuration must be done before any typesetting is done, and can't be changed. If you need to change configurations, you must call mjAPI.start() again in order to restart MathJax.

@pkra
Copy link
Contributor Author

pkra commented Apr 22, 2017

I'm fine moving this to start() but it currently won't re-configure this either since CHTMLSTYLES is generated at the first startup.

@dpvc
Copy link
Member

dpvc commented Apr 22, 2017

It is set within the AuthorInit function so should be reset when the new MathJax starts up. Unfortunately, calling start() with the callback of a previous typeset() call messes up the synchronization, and the new MathJax hasn't started up yet when the next typeset() is run, so you get the old one again.

You can get around this in one of two ways: either enclose your start() and typeset() calls in a setTimeout() call, so that they will run after the callback completes; or modify main.js as follows:

That will allow you to call start() from within a typeset() callback.

I've made a branch (issue323) that includes these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants