peer peer - 1 year ago 131
Android Question

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=""></script>


W.R.T Paul's solution, here are the changes that i made

<script type="text/x-mathjax-config">
skipStartupTypeset: true,
config: ['default.js'],
jax: ["input/TeX","output/HTML-CSS"],
extensions: ['tex2jax.js']
<script type="text/javascript" src="file:///android_asset/antest_files/MathJax/MathJax.js"></script>

Answer Source

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

More information on this post:

Hope I could help