android/ jqmath
I want to write table(matrix) with jqmath but the output is not correct .
I copy jqmath example .
there is my code :
webView = (WebView) findViewById(R.id.wv);
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
String path="file:///android_asset/mathscribe/";
String js = "<html><head>"
+ "<link rel='stylesheet' href='"+path+"jqmath-0.4.3.css'>"
+ "<script src='"+path+"jquery-1.4.3.min.js'></script>"
+ "<script src='"+path+"jqmath-etc-0.4.3.min.js' charset=\"utf-8\"></script>"
+ "</head><body>"
+ "<script>var s = '$(\\table \\ cos θ, - \\sin θ; \\sin θ, \\cos θ)$ gives a rotation by $θ$';M.parseMath(s);document.write(s);</script>"
+ "</body>";
webView.loadDataWithBaseURL("file:///android_asset/mathscribe/", js, "text/html", "UTF-8", null);
the output is linear matrix like below :
I suggest that combine slash and t (\\t)in " var s = '$( \\table \\ cos θ, - \\sin θ; \\sin θ, \\cos θ) " cause this problem because the t character is gone and first line moved to right.
How I can solve this problem?
SOlVED if I replace every slash with 4 slash the result is correct ....
I think it's best to replace the line:
+ "<script>var s = '$(\\table \\ cos θ, - \\sin θ; \\sin θ, \\cos θ)$ gives a rotation by $θ$';M.parseMath(s);document.write(s);</script>" +
with:
+ "$(\\table \\cos θ, - \\sin θ; \\sin θ, \\cos θ)$ gives a rotation by $θ$" +
or:
+ "$(`table `cos θ, - `sin θ; `sin θ, `cos θ)$ gives a rotation by $θ$" +
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.