Include mathjax in an Android app

I am trying to include MathJax in my application. I deleted the files that were not needed for my application and reduced the size of the MathJax folder to 3Mb.

My mathjax folder is in the assests directory of my application. I tried linking mathjax with

<script type="text/javascript" src="/mathjax/MathJax.js?config=default"></script> 

This does not work. Is my math path wrong? Since my application worked fine when I gave my source as

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

Decision:

WRT Paul solution, here are the changes I made

  <script type="text/x-mathjax-config"> MathJax.Hub.Config({ skipStartupTypeset: true, config: ['default.js'], jax: ["input/TeX","output/HTML-CSS"], extensions: ['tex2jax.js'] }); </script> <script type="text/javascript" src="file:///android_asset/antest_files/MathJax/MathJax.js"></script> 
+4
source share
2 answers

In Android, you need to reference a little different:

 <script type="text/javascript" src="file:///android_asset/js/MathJax/MathJax.js"></script> 

Please note that you cannot add a configuration parameter, as it will not load correctly. You need to create configurations using:

 <script type="text/x-mathjax-config"> ... </script> 

Additional information about this post: http://cs.jsu.edu/wordpress/?p=498

I hope I can help

+8
source

I know this is a long time, but I also had the same problem, and I realized that by installing the cordova crosswalk webview , there is no need to change the way MathJax script loads.

Just run:

ionic plugin add cordova-plugin-crosswalk-webview

And you are good to go !!!

0
source

All Articles