简体   繁体   English

jqmath在webView android中左对齐

[英]jqmath align left in webView android

How can i left aline my equation using jqmath in android by default all the equation is shown in center allign.默认情况下,我如何在 android 中使用 jqmath 保留我的方程,所有方程都显示在居中对齐中。 i want to show the equation startup from left side.althought webview is left align but jqmath is always start written from center.我想从左侧显示方程启动。虽然 webview 是左对齐但 jqmath 总是从中心开始写入。 if any text is written other than jqmath then it is left align but any text written with like $$ 5x=4 $$ then it is center align how can i fix it.如果除 jqmath 之外的任何文本都是左对齐的,但任何用 $$ 5x=4 $$ 书写的文本则是居中对齐,我该如何修复它。

    stepStrHtml = "<html><head>"
            + "<link rel='stylesheet' href='file:///android_asset   /mathscribe/jqmath-0.4.3.css'>"
            + "<script src = 'file:///android_asset/mathscribe/jquery-1.4.3.min.js'></script>"
            + "<script src = 'file:///android_asset/mathscribe/jqmath-etc-0.4.3.min.js'></script>"
            + "</head><body><FONT COLOR=\"#800080\">";

     step = "$$" + getIntent().getExtras().getString("equation");
     step = step + "$$"+"</FONT>" ;

    stepStrHtml=stepStrHtml+ step;

     stepStrHtml=stepStrHtml+"$$3x=5/9$$"

         stepStrHtml = stepStrHtml + "</body></html>";
    stepWebView.loadDataWithBaseURL("", stepStrHtml, "text/html", "UTF-8", "");

There are a few ways.有几种方法。

  1. Change $$ to $: $3x=5/9$ instead of $$3x=5/9$$ .将 $$ 更改为 $: $3x=5/9$而不是$$3x=5/9$$ This will also make the fraction smaller though.不过,这也会使分数变小。

  2. Wrap $$3x=5/9$$ in an inline-block:$$3x=5/9$$包裹在一个内联块中:

     "<span style='display: inline-block; color: #800080'>$$3x=5/9$$</span>"

You can also use css to style parts of the mathematics.您还可以使用 css 为数学的某些部分设置样式。 See jqMath highlight box like bbox in MathJax/MathJs and How to left align elements in a jqmath table .请参阅jqMath 高亮框,如 MathJax/MathJs 中的 bbox如何在 jqmath 表中左对齐元素

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

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