繁体   English   中英

jqmath不能渲染矩阵?

[英]jqmath can not render matrix?

我想用jqmath编写table(matrix)但输出不正确。
我复制jqmath示例
有我的代码:

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);    

输出是线性矩阵,如下所示:

在此处输入图片说明

我建议在“ var s ='$( \\ table \\ cosθ,-\\ sinθ; \\ sinθ,\\ cosθ)”中合并斜杠和t(\\ t)会导致此问题,因为t字符消失了线移到右边。

我该如何解决这个问题?

解决了,如果我用4个斜杠替换每个斜杠,结果是正确的....

我认为最好替换该行:

        + "<script>var s = '$(\\table \\ cos θ, - \\sin θ; \\sin θ, \\cos θ)$ gives a rotation by $θ$';M.parseMath(s);document.write(s);</script>" +

与:

        + "$(\\table \\cos θ, - \\sin θ; \\sin θ, \\cos θ)$ gives a rotation by $θ$" +

要么:

        + "$(`table `cos θ, - `sin θ; `sin θ, `cos θ)$ gives a rotation by $θ$" +

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM