Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

include mathjax in android app

I am trying to include MathJax in my app. I removed files not needed for my app and brought down the size of the MathJax folder to 3Mb.

My mathjax folder is in the assests directory of my app. I tried to link mathjax using

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

This does not seem to work. Is my path to the mathjax wrong? Because my app worked fine when i gave my source as

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

Solution:

W.R.T Paul's solution, here are the changes that 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>
like image 893
peer Avatar asked Feb 19 '23 00:02

peer


1 Answers

In Android you have to reference a little different:

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

Notice that you can't add the config parameter, as it won't load correctly. You need to make configurations using:

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

More information on this post: http://cs.jsu.edu/wordpress/?p=498

Hope I could help

like image 181
christopher Avatar answered Mar 05 '23 02:03

christopher