0

I have used jqMath for displaying Math equations using a WebView.

Here's the code for Math equation

$(\table \cos θ, - \sin θ; \sin θ, \cos θ)$

Expected output:

But the output is this:

Here's the code:

 String js = Constants.JQ_MATH_BEGIN +string+Constants.JQ_MATH_END;
 holder.webView.loadDataWithBaseURL(Constants.PATH,js,  "text/html",  "UTF-8",null);

I could solve it by changing the string code to

$(\\table \cos θ, - \sin θ; \sin θ, \cos θ)$

and the equation is shown properly. But, I also want to display equations on a website from the same database, but this code doesn't work with the double slash on browsers. So keeping two columns is not a good solution.

Please help.

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
BinaryGuy
  • 1
  • 2

1 Answers1

0

I solved it by using the replace function.

String escaped = str.replace("\\t","\\\\t");

Don't know why that was happening, though.

BinaryGuy
  • 1
  • 2