Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typesetting math functions in LaTeX to render in Android Application

Does anyone know if it's possible to use LaTeX markup language to format text for display in an Android application?

For example the text for a TextView can be formatted with HTML to change the font size to small and superscript etc by using the Html.formHtml("String") method:

TextView aTextView=(TextView) findViewById(R.id.textview1);
aTextView.setText(Html.fromHtml("2<small><sup>5</sup></small>"));  

Will display 25 in the TextView.


However what I'd like to something more advanced and format text using perhaps LaTeX to represent Math Function and have that render as a correctly format Math Function in a TextView (or something else).

For example the LaTeX markup "Evaluate the sum $\displaystyle\sum\limits_{i=0}^n i^3" should be rendered to:


(source: artofproblemsolving.com)


If there's some other way to mark up Math Functions so they display correctly in an Android App other than using LaTeX I'm all open to suggestions!

like image 564
EraserheadIRL Avatar asked Apr 28 '11 15:04

EraserheadIRL


1 Answers

Latex is not written in java so may be hard to get running on the android JLaTexMath is a java port which you may be able to use, but probably not straight out of the box.

One other option maybe to run a service on a server that takes a formula and returns an image, if your formulas get really complex this might even be quicker then rendering the formula.

This will also reduce your reliance on the android platform so you are more likely to be able to port your application to IPhone and Html5.

like image 92
David Waters Avatar answered Sep 20 '22 20:09

David Waters