我想在Android應用程序內呈現MathML離線。我使用MathJax使用leathrum的APK。下面是設置mathjax離線配置(http://cs.jsu.edu/~leathrum/mjapp-src/full/MainActivity.java)代碼:離線MathML在Android應用程序支持
webview.loadDataWithBaseURL("http://bar/", "<script type='text/x-mathjax-config'>"
+"MathJax.Hub.Config({ "
+"showMathMenu: false, "
+"jax: ['input/TeX','output/HTML-CSS'], " // output/SVG
+"extensions: ['tex2jax.js','toMathML.js'], "
+"TeX: { extensions: ['AMSmath.js','AMSsymbols.js',"
+"'noErrors.js','noUndefined.js'] }, "
//+"'SVG' : { blacker: 30, "
// +"styles: { path: { 'shape-rendering': 'crispEdges' } } } "
+"});</script>"
+"<script type='text/javascript' "
+"src='file:///android_asset/MathJax/MathJax.js'"
+"></script>"
+"<script type='text/javascript'>getLiteralMML = function() {"
+"math=MathJax.Hub.getAllJax('math')[0];"
// below, toMathML() rerurns literal MathML string
+"mml=math.root.toMathML(''); return mml;"
+"}; getEscapedMML = function() {"
+"math=MathJax.Hub.getAllJax('math')[0];"
// below, toMathMLquote() applies &-escaping to MathML string input
+"mml=math.root.toMathMLquote(getLiteralMML()); return mml;}"
+"</script>"
+"<span id='math'></span><pre><span id='mmlout'></span></pre>","text/html","utf-8","");
本地Mathjax是assets.It正常顯示,特克斯輸入,但我不能將其配置到需要MATHML作爲輸入和顯示結果下線。
您可能需要提供更多的背景庫。至少可以鏈接到你正在使用的任何東西。 –
我指的代碼在http://cs.jsu.edu/wordpress/index.php/2012/08/01/standalone-mathjax-app-for-android/它需要Tex輸入和呈現輸出。我想將Mathml作爲輸入並渲染輸出。 – Gaurav
Peter意味着你需要提供你正在使用的實際代碼,而不是你爲了你的目的而修改的代碼的鏈接(我們知道你必須修改它,因爲你鏈接的是輸入格式)。沒有這些,我們幾乎沒有辦法分析你的問題。 –