Is my MathJax minimal configuration for an Android app correct?

135 views
Skip to first unread message

42hr...@gmail.com

unread,
Jul 21, 2015, 3:01:48 AM7/21/15
to mathja...@googlegroups.com
Hi,

I am working on an Android application with a web view to display Mathematical equations using LaTeX and MathJax. I've managed to reduce the footprint of MathJax to 1.3MB using 

42hr...@gmail.com

unread,
Jul 21, 2015, 3:07:38 AM7/21/15
to mathja...@googlegroups.com, 42hr...@gmail.com
Hi,
I am working on an Android application with a web view to display Mathematical equations using LaTeX and MathJax. I've managed to reduce the footprint of MathJax to 1.3MB using MathJax-grunt-cleaner and manually deleting some files. Following is the Grunt task that I ran. Is this sufficient or will I encounter issues in the future? I'm only planning to use LaTeX as input and HTML-CSS to render the output. No SVG or MathML.



   grunt.registerTask('android', [ 
// **Notes** on the template. When instructions say "Pick one", this means commenting out one item (so that it's not cleaned).
//
//      Early choices.
        'clean:unpacked', 
        // 'clean:packed', // pick one -- packed for production, unpacked for development.
        'clean:allConfigs', // if you do not need any combined configuration files.
//      Fonts. Pick at least one! Check notes above on configurations.
        'clean:fontAsana', 
        'clean:fontGyrePagella', 
        'clean:fontGyreTermes', 
        'clean:fontLatinModern', 
        'clean:fontNeoEuler', 
        'clean:fontStix', 
        'clean:fontStixWeb', 
        // 'clean:fontTeX', 
//      Font formats. Pick at least one (unless you use SVG output; then clean all).
        // 'clean:dropFonts', // when using SVG output
        'clean:eot', 
        'clean:otf', 
        'clean:png', 
        'clean:svg', 
        // 'clean:woff',
//      Input. Pick at least one.
        'clean:asciimathInput', 
        'clean:mathmlInput', 
        // 'clean:texInput', 
//       Output
        // 'clean:htmlCssOutput', 
        'clean:mathmlOutput', 
        'clean:svgOutput', 
// Extensions. You probably want to leave the set matching your choices.
        'clean:extensionsAsciimath', 
        'clean:extensionsMathml', 
        // 'clean:extensionsTeX', 
        'clean:extensionHtmlCss', 
// Other items
        'clean:locales', 
        'clean:miscConfig', 
//        'clean:miscExtensions', // you probably want that
        'clean:images',
        'clean:notcode'
  ]);


Apart from running the Grunt task, I also went ahead and deleted node_modules directory. Is that fine?

Thank you

Peter Krautzberger

unread,
Jul 23, 2015, 4:40:24 AM7/23/15
to mathja...@googlegroups.com, 42hr...@gmail.com
Hi,

 Is this sufficient [...]

This looks good, generally speaking. 

or will I encounter issues in the future?

That's really hard to say without knowing the integration or the content. E.g., you drop the float extension for the HTML output; that's rarely needed but depends on your non-mathematical content.

Apart from running the Grunt task, I also went ahead and deleted node_modules directory. Is that fine?

Yes, that's fine. The node modules are only for Grunt itself.

Regards,
Peter

--
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.

42hrs in

unread,
Jul 23, 2015, 4:48:22 AM7/23/15
to Peter Krautzberger, mathja...@googlegroups.com
Thank you Peter. 

Following is my MathJax Config. Could you tell me if this is okay for  most common uses. 

MathJax.Hub.Config({
    jax: ["input/TeX","output/HTML-CSS", "output/CommonHTML"],
    extensions: ["tex2jax.js","MathMenu.js","MathZoom.js", "CHTML-preview.js"],
    TeX: {
        extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
    }
});

Are there any other popular extensions that I should be using to cover all bases?


Thanks

Peter Krautzberger

unread,
Jul 23, 2015, 4:58:23 AM7/23/15
to 42hrs in, mathja...@googlegroups.com
Hi,

In terms of extensions, maybe the TeX autoload extension is useulf, see http://docs.mathjax.org/en/latest/tex.html#autoload-all

You are not configuring any TeX delimiters which means you get the defaults. Personally, I'd set things up so you don't need tex2jax at all (i.e., prepare the content accordingly) and I prefer not having noErrors.js. But that depends on your requirements. 

Regards,
Peter.

42hrs in

unread,
Jul 23, 2015, 5:05:36 AM7/23/15
to Peter Krautzberger, mathja...@googlegroups.com
This is wonderful. Thank you so much Peter.
Reply all
Reply to author
Forward
0 new messages