jianzhongli / MathView

A library for displaying math formula in Android apps.
Apache License 2.0
1.01k stars 188 forks source link

LaTeX not working on MathJax android 4.0 #6

Open grapevine2383 opened 8 years ago

grapevine2383 commented 8 years ago

LaTeX isn't working in MathJax MathView when using Android API 15 emulator with the sample app example.

jianzhongli commented 8 years ago

I am sorry but I haven't tested it in lower version API. Could you please provide screenshots and logcat information? I am not able to reproduce it.

grapevine2383 commented 8 years ago

2016-01-04_21-29-01 2016-01-04_21-29-11 2016-01-04_21-31-53

grapevine2383 commented 8 years ago

Using the simulator with the sample app (no changes at all)

jianzhongli commented 8 years ago
  1. Perhaps it has something to do with the mathjax configuration. Have you ever try lower version of MathView? (MathView 0.0.1 ~ 0.0.3 doesn't support the engine attribute, it renders tex code with mathjax by default.)
  2. Do you really need to use MathView(with MathJax) on Android 4.1 ? If KaTeX can meet your requirement, please just use KaTeX to render tex code.
grapevine2383 commented 8 years ago
  1. I just tried 0.0.1, 0.0.2, and 0.0.3 and found that 0.0.3 actually works but the other ones do not.
  2. KaTeX doesn't support many many things that MathJax does, I tried it out but got parsing errors pretty frequently.

What was changed in 0.0.3 from 0.0.2 and 0.04 that fixed then broke compatibility with android 4.0?

grapevine2383 commented 8 years ago

Looks like adding MathML support in MathJax is what broke it https://github.com/kexanie/MathView/commit/b35b0c07f2c77b8be64a32dbd6f5a4ffb0482c8f

jianzhongli commented 8 years ago

I was wrong.

KaTeX was added to MathView as the default engine since 0.0.3, so if it works on Android 4.0, I think that's because you were actualy using KaTeX to render the code. It seems that the distribution of MathJax shipped with MathView just doesn't work on Android 4.0. I found an sample app of MathJax on GitHub, which is perfectly functional on Android 4.0.

If we dig deeper it should be possible to make MathView works on lower android version. This issue will remain open until the bug is fixed. If you figure out how to fix it, pull requests are always welcomed.

grapevine2383 commented 8 years ago

What do you think needs to be changed in order to be compatible with android 4.0. Is it just a configuration issue?

makhloufabdelkader commented 7 years ago

Can you help me with this problem, I'm writing a math text in arabic, and there are some inline equations that need to be aligned to the right. I need the mathview to be displayed in RTL mode.