Skip to content
Advertisement

Display LaTex in Android

I’m trying to display a LaTex item in android in an ImageView. I’m using jlatexmath library. So far, I’ve got TexIcon object from formula. Now I’d like to display that content in ImageView (or anywhere, just need to display them in activity). One way would be to convert it to bitmap or png then display in ImageView, but I’m not able to convert TexIcon to any other format, here’s my java code so far:

JavaScript

Advertisement

Answer

EDIT : I tried using jlatexMath in Android but with the amount of dependency it requires (such as the awt and swing package from java) to port to Android, I had to leave it halfway.

This is the sample code available from the JLatex repo but BufferedImage and Insets are not available in Android.

JavaScript

I would recommend another library – https://github.com/kexanie/MathView which is a wrapper around webview and you can use either MathJax or KaTex library.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement