Displaying Math Formulas

156 views
Skip to first unread message

Alexander Ferling

unread,
Oct 12, 2018, 4:30:26 PM10/12/18
to MIT App Inventor Forum
I would like to generate mathematical expressions and afterwards display them in my app

The problem is: n√(x*3) is not looking good!

I can format it as html, but as far as i can see, things like mathml are
not supported by app inventor.

-> Is there a possibility to format mathematical expressions in a nice way?


Juan Antonio

unread,
Oct 12, 2018, 4:40:43 PM10/12/18
to MIT App Inventor Forum
One possibility is to present the expression as an image.

SteveJG

unread,
Oct 12, 2018, 4:44:51 PM10/12/18
to MIT App Inventor Forum
Here is a way to deal with subscripts and superscripts https://groups.google.com/forum/#!searchin/mitappinventortest/subscript%7Csort:date/mitappinventortest/UZ1olWEzLS0/2H6g70DmDQAJ  

Other than using images, you are out of luck.  App Inventor 2 does not have a math font.

Regards,
Steve

Abraham Getzler

unread,
Oct 13, 2018, 10:55:16 PM10/13/18
to MIT App Inventor Forum
This article beats the topic to death ...

ABG

TimAI2

unread,
Oct 14, 2018, 6:43:26 AM10/14/18
to MIT App Inventor Forum
Message has been deleted
Message has been deleted
Message has been deleted

Juan Antonio

unread,
Oct 14, 2018, 9:04:29 AM10/14/18
to mitappinv...@googlegroups.com
Another way is with JavaScript and JqMath library:

formula4.png

<link rel="stylesheet" href="file:///mnt/sdcard/AppInventor/assets/jqmath-0.4.3.css">
<script src="file:///mnt/sdcard/AppInventor/assets/jquery-1.4.3.min.js"></script>
<script src="file:///mnt/sdcard/AppInventor/assets/jqmath-etc-0.4.6.min.js" charset="utf-8"></script>

formula5.png

Build:

<link rel="stylesheet" href="file:///android_asset/jqmath-0.4.3.css">
<script src="file:///android_asset/jquery-1.4.3.min.js"></script>
<script src="file:///android_asset/jqmath-etc-0.4.6.min.js" charset="utf-8"></script> 
 

Regards,
Juan Antonio Villalpando
p167Di_javascript_formulas.aia

Alexander Ferling

unread,
Oct 14, 2018, 9:27:28 AM10/14/18
to MIT App Inventor Forum
Thank you, Juan,

JqMath seems to fulfill my needs very well. I like, that it is lightweight!

Before, I was fighting with MathJax. There the problem is, that you have to use online resources.
If you want to build an offline-app, than you habe to implement a 33MB package, which is too much I think.

Even if the my problem is solved -> Are lightweight packages of MathJax available?


Juan Antonio

unread,
Oct 14, 2018, 1:04:13 PM10/14/18
to MIT App Inventor Forum

From https://mathscribe.com/author/jqmath.html:


jqMath is free, using the same open source license as jQuery, the world’s most popular JavaScript library. 

We also gratefully adopt jQuery’s “write less, do more” philosophy.

To use jqMath on your site, download jqMath, and open the included COPY-ME.html file as UTF-8 in a text editor.


I only use jqmath-0.4.3.css, jquery-1.4.3.min.js and jqmath-etc-0.4.6.min.js

Abraham Getzler

unread,
Oct 14, 2018, 5:17:12 PM10/14/18
to MIT App Inventor Forum
Reply all
Reply to author
Forward
0 new messages