Removing Unnecessary Resources

已查看 47 次
跳至第一个未读帖子

jordan...@gmail.com

未读,
2016年4月29日 12:49:132016/4/29
收件人 MathJax Users
We just started using MathJax in our system and we're hosting everything ourselves.  Obviously there are quite a few files included in the MathJax project, but we're only using it to handle LaTeX equations.  I'm wondering if anybody can guide me on what files are required for LaTeX support and which ones aren't so we can scale back the project to only the necessary components.

Peter Krautzberger

未读,
2016年5月2日 11:47:012016/5/2
收件人 mathja...@googlegroups.com
Hi,


Regards,
Peter.

On Fri, Apr 29, 2016 at 6:49 PM, <jordan...@gmail.com> wrote:
We just started using MathJax in our system and we're hosting everything ourselves.  Obviously there are quite a few files included in the MathJax project, but we're only using it to handle LaTeX equations.  I'm wondering if anybody can guide me on what files are required for LaTeX support and which ones aren't so we can scale back the project to only the necessary components.

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jordan...@gmail.com

未读,
2016年5月2日 13:49:162016/5/2
收件人 MathJax Users
This looks like a great resource!  However I'm still not sure exactly what resources I want to keep for my specific configuration.  Specifically, we only handle LaTeX formulas, we'd like all output to be HTML-CSS, and we'd like to maintain accessibility components for screen readers.  While the grunt-cleaner looks like the tool to use as far as trimming the project down, I'm still unsure of what resources to keep/drop.

Peter Krautzberger

未读,
2016年5月3日 07:52:552016/5/3
收件人 mathja...@googlegroups.com
Hi,

You might want to follow the suggestion in the Readme and read the comments in the grunt file, in particular the template task. 

If you have any questions after that, raise them here or on the issue tracker.

Regards,
Peter.

bett...@gmail.com

未读,
2016年6月30日 11:31:122016/6/30
收件人 MathJax Users
Hi,

Our requirements on Mathjax are similar to those of Jordan.  We are planning to use LaTex as input and have the output in HTML-CSS and SVG.   I have read the suggestions in the Readme and comments in the grunt.js file but am still at a loss at what needs to be commented out for our needs.

1.  There does not seem to be any suitable combined configuration file  our intended use of Mathjax.  Is this correct?  If so, what do I need to do to create a suitable one?  Do I clean allConfigs?   
2.  Regarding fonts, do you recommend that I just keep fontTex and clean up the other fonts?
3.  Regarding the font format, I know that I do  not want image font.  Hence I shall clean up .png.  What other font formats can I clean up for our intended use of Mathjax?
4.  Regarding extensions, can you please recommend what I should keep?
5.  I just need the English language.  Can I clean up locales?
6.  I do not understand what "misconfig", "images" and "not code" do.   Can I clean these 3 items for our intended use of Mathjax?
7. After the resources are removed using grunt, I presume that the files are not minified, nor compressed.  How do we minify the files?  Using grunt-ugilfy?

Grateful if you could advise me on the above.    

Many thanks,
Betty

Peter Krautzberger

未读,
2016年7月1日 03:24:272016/7/1
收件人 mathja...@googlegroups.com
Hi Betty,

Thanks for re-posting this here. Answering these kinds of questions is rather difficult without knowing a lot of details about your requirements. But let me try anyway.

We are planning to use LaTex as input and have the output in HTML-CSS and SVG.  
1.  There does not seem to be any suitable combined configuration file  our intended use of Mathjax.  Is this correct?  

That's correct. See the documentation for combined configurations at http://docs.mathjax.org/en/latest/config-files.html

> If so, what do I need to do to create a suitable one?  Do I clean allConfigs?

The grunt-cleaner does not build combined configuration files; it only deletes files that a developer might not require.

To build a combined configuration file, you need to use the "combiner" from MathJax Developer tools, https://github.com/mathjax/MathJax-dev/tree/master/combiner. This is a somewhat old system and does not play well with modern build tools. FWIW, we plan to switch to a contemporary system in v3.0 in the long run. You might also want to check out https://github.com/pkra/MathJax-single-file

> 2.  Regarding fonts, do you recommend that I just keep fontTex and clean up the other fonts?

That's difficult to say. While the TeX fonts are the default, there are use cases where other fonts might be preferable. For example, if you were building an app for OSX only, then you can assume there are locally installed STIX fonts (since OSX includes them), in that case you could remove all web fonts and just keep the STIX font data (not the stix-web data).  Ultimately, fonts are a design consideration so it's hard to make a recommendation.

> 3.  Regarding the font format, I know that I do  not want image font.  Hence I shall clean up .png.  What other font formats can I clean up for our intended use of Mathjax?

That depends on your requirements for browser support. This might be helpful: http://webmasters.stackexchange.com/a/27008

> 4.  Regarding extensions, can you please recommend what I should keep?

Again, that's not possible to say without knowing your requirements. For example, since you indicated that you use LaTeX input only, you can remove the components listed under extensionsMathml etc.

> 5.  I just need the English language.  Can I clean up locales?

Yes. The English locale is hardcoded as a fallback.

> 6.  I do not understand what "misconfig", "images" and "not code" do.   Can I clean these 3 items for our intended use of Mathjax?

Both "images" and "not code" do not affect the functionality of any MathJax component, so they can safely be removed.

If you don't use a configuration file listed in the "miscConfigs" then you can remove them. 

I'd suggest to leave anything in that you are not sure about. The grunt-cleaner is an advanced tool and does require a good understanding of how MathJax works and how it is customized in your setup.

> 7. After the resources are removed using grunt, I presume that the files are not minified, nor compressed.  How do we minify the files?  Using grunt-ugilfy?

The MathJax distribution ships both minified and un-compressed copies. The uncompressed copies are in the /unpacked folder.

Regards,
Peter.


bett...@gmail.com

未读,
2016年7月1日 06:41:252016/7/1
收件人 MathJax Users
Hi Peter,

Many thanks for your detailed and helpful advice.

1.  Configuration file:   The combined configurations at http://docs.mathjax.org/en/latest/config-files.html that are relevant to our use case are: Tex-AMS_CHTML, Tex-AMS_SVG and Tex-AMS_HTML.  

I have looked at the combiner  https://github.com/mathjax/MathJax-dev/tree/master/combiner that you suggested.  It is unclear to me how I should use the combiner.  Do I need to have Perl (I do not know Perl)?  

It seems from the CombineMJ file that the program is going through items in "lists".  Hence it appears that I need to remove all other items in "lists" except for those related to Tex-AMS_CHTML, Tex-AMS_SVG and Tex-AMS_HTML.    Is this guess correct?  

Even if the aforementioned guess is correct, I am not confident that I know what I am doing and can produce a correct combined configuration file.   I have also checked out https://github.com/pkra/MathJax-single-file too.  I do not know enough details of Mathjax to produce a relevant Gruntfile.js file.  Given this situation, grateful if you could also advise me on the following.

a. Can I put the three configuration files Tex_AMS_CHTML, Tex_AMS_SVG and Tex_AMS_HTML in a single script line in the <head> of the page (something like the following)?

<script type="text/javascript" src="path-to-MathJax/MathJax.js?config=Tex-AMS_CHTML, Tex-AMS_HTML, Tex_AMS_SVG"></script>
If yes, what implications are there (if any) on the loading of Mathjax scripts on the performance of Mathjax?
b.  If the loading of three configuration files via a single script tag in (a) above is not a valid approach, would you be able to create a combined configuration file for Tex-AMS_CHTML, Tex-AMS_HTML and Tex-AMS_SVG and make it available for use by the MathJax community?
c. If both (a) and (b) are not feasible, which one out of the three configuration files (Tex-AMS_CHTML, Tex-AMS_HTML and Tex-AMS_SVG) would you consider to cover most use cases and be the recommended option when one have to select one out of the three?
Many thanks for your answers to my previous questions (2) to (7).   I will err on the cautious side and do not remove components that I do not understand and am not sure about.  Grateful if you could give me further directions in relation to the configuration files.
Best regards,
Betty

Peter Krautzberger

未读,
2016年7月4日 03:39:162016/7/4
收件人 mathja...@googlegroups.com
Hi Betty,

Re 1) Your assessment of the combiner is essentially.

a. Can I put the three configuration files [...] in a single script line in the <head> of the page (something like the following)?

Yes (though without spaces after the commas). However, that it is most likely not what you want; it's essentially equivalent to loading the last one.  You might want to read the documentation for the combined configuration files in detail to understand which components are pre-loaded and which ones are not, e.g., http://docs.mathjax.org/en/latest/config-files.html#the-tex-ams-chtml-configuration-file

It might help if you tried to describe what you are trying to achieve with your configuration and generally tell the community more about your setup and requirements.

Regards,
Peter.



回复全部
回复作者
转发
0 个新帖子