jqMath: how to improve the display of vectors and super/subscripts on an android app's webview

StackOverflow https://stackoverflow.com/questions/20459202

  •  30-08-2022
  •  | 
  •  

Question

I have jqMath up and running within an android app. The output of jqMath is shown within an android's webview. It works really well and it is really fast. I have noticed, however, that when typesetting

(1) a vector,e.g. {AB}↖{→}. The baseline of the created vector is lower than that of the surrounding text, like this: "Text before vector text after". I would like to adjust the baseline of the created vector.

(2) a chemical isotope e.g. {}_6^{12}C the superscript and subscript are not aligned with each other. I would like to have them right-justified instead.

Which part of the code or the css style sheet could be modified to improve these issues?

Thank you in advance,

Marco

Was it helpful?

Solution

jqMath cannot be as pretty as you want on Android currently, sigh, because Android's webview doesn't implement MathML. These examples look fine on iOS 7, Safari 6.1+, or Firefox. They also look good in Chrome 24 FWIW, because I volunteered for a year and got MathML working ok there, but Google turned it off in Chrome 25 because I couldn't afford to keep maintaining it for free. (Yes, grumble. Donate your nickels to Google.) You might try MathJax, which is a lot slower and bigger than jqMath but produces beautiful output, if you need perfect typesetting. jqMath's goal is to produce readable output quickly in all cases, and rely on the underlying MathML implementation to make it pretty in modern browsers. I thought Google and Microsoft would prioritize MathML in their web browsers for e.g. digital textbooks soon, but so far they haven't. Maybe if all math and science and education apps switch to iOS they'll change their minds. Hope this helps. (I am the jqMath author.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top