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

Warning if configuration is set via MathJax.Hub.Config #163

Closed
stefanspringer opened this issue Aug 23, 2011 · 11 comments
Closed

Warning if configuration is set via MathJax.Hub.Config #163

stefanspringer opened this issue Aug 23, 2011 · 11 comments

Comments

@stefanspringer
Copy link

If the configuration not not set via URL param but via MathJax.Hub.Config (code: MathJax.Hub.Config({config: ["MML_HTMLorMML-full.js"]})), then the warning "MathJax no longer loads a default configuration file; you must specify such files explicitly..." appears nevertheless. It should not appear. This is important for HTML viewers which cannot load resources with URL params.

@dpvc
Copy link
Member

dpvc commented Aug 23, 2011

You're right, the test for no configuration comes before the loading of the config array. This is because the warning replaced the loading of the old default configuration file, which could include a config array, so needed to be done first. The check can be moved to after the loading of config files now.

In the meantime, if you include a non-empty jax array in your configuration, that will avoid the warning message. E.g.,

MathJax.Hub.Config({
  config: ["MML_HTMLorMML-full.js"],
  jax: ["input/MathML"]
});

should do it.

Can you tell me more about HTML viewers that cannot load resources with URL parameters?

Davide

@stefanspringer
Copy link
Author

One HTML viewer that cannot load resources with URL parameters is the HTML-Help viewer from Microsoft for *.chm files.

@dpvc
Copy link
Member

dpvc commented Aug 23, 2011

Have you been able to get MathJax to work in this setting? There was a recent question sent to the contact list on the MathJax site about this, and I haven't been able to check into it. If you have a working configuration for .CHM files, would you be willing to share it?

@sspringerb
Copy link

With jax:... (e.g.: jax: ["input/MathML","output/HTML-CSS","output/NativeMML"]) it was OK. MathJax then renders the formulas within .CHMs without warning (also tested under Windows XP with only IE 6 installed). The MathJax resources are included within the CHM file, but without the bitmap (image) files in the fonts directory because this would blow the CHM considerably. The formulas could even be printed from within the CHM (but not those in subtopics).

@dpvc
Copy link
Member

dpvc commented Aug 24, 2011

Thanks for the details. I'm glad you have gotten MathJax to work in CHM files.

It is possible to slim the MathJax directory down to reduce the size in this case. For example, since all versions of IE that MathJax supports can handle web-based fonts, there is no need for the image fonts (the largest part of the distribution), so you can remove the MathJax/fonts/HTML-CSS/TeX/png directory, as you have already done. In fact, you can remove the otf and svg directories as well, since IE will only use the EOT fonts. Then you can remove the MathJax/unpacked directory entirely, since you will be running the compressed versions of the files, and you can delete the MathJax/test and MathJax/docs directories completely. If you are only using TeX input (not MathML), then I would recommend using the TeX-AMS_HTML-full configuration file. In that case, you can remove the MathJax/jax/input/MathML and MathJax/jax/output/NativeMML directories, and the MathJax/extensions/mml2jax.js and MathJax/extensions/jsMath2jax.js extensions. You can remove the FontWarnings.js and v1.0-warnings,js extensions as well, and you can delete all the configuration files except the one you are using. If you want to remove every possible file, then you can open the configuration file that you are using and remove the files listed in the MathJax.Ajax.Preloading() call at the top of the file, as those will all be included in the configuration file itself. So you should be able to get things down to a pretty small footprint if you want to.

Davide

@sspringerb
Copy link

Thanks for the good support, very nice work!

dpvc added a commit to dpvc/MathJax that referenced this issue Aug 27, 2011
@dpvc
Copy link
Member

dpvc commented Aug 27, 2011

A fix for this is included in the hub-updates branch of my fork of MathJax. It should become part of the next release.

@fred-wang
Copy link
Contributor

I've prepared a test

Configuration/Hub/issue163.html

for this issue.

=> In testsuite

@fred-wang
Copy link
Contributor

@Rgray
Copy link

Rgray commented Feb 24, 2012

Stefan,

I am also building a .chm file. My TeX equations are rendered by MathJax in italics. Did you encounter this issue? How did you work around it? In a flat browser (no MSHelp), my equations look fine with the present config.

Thanks,

Reid

@Rgray
Copy link

Rgray commented Feb 24, 2012

This is what I am using:

MathJax.Hub.Config({tex2jax: { preJax: ["[math]"], inlineMath:
[ ['$','$'], ['(',')']], displayMath: [['[',']'], ['$$','$
$']]}});

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/ latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

@dpvc dpvc closed this as completed Feb 27, 2012
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

5 participants