Monday, June 20, 2011

Equation editor for iPad - MathBot

Updated note:  The problem on launch with MathBot has now been fixed and the app is working again.  Among other changes, the new version allows landscape mode and an auto complete feature (last updated Feb. 23, 2012)

Pages is a nice word processor and page layout program, but one major omission is an equation editor. On the Mac scientists and mathematicians usually use either MathType, or write the entire document in LaTeX using TeXShop. Unfortunately MathType is not available for the iPad.

In this column I will show you how to place high quality mathematical equations into Pages (or Keynote) on the iPad using the MathBot app. While MathBot is free, you will need to purchase the $4.99 in-app upgrade to remove the watermark and to activate all necessary export options.

So what exactly is MathBot? It takes expressions in LaTeX, renders them into beautifully typeset equations, and then allows export as high quality scaleable PNG images into Pages, Keynote or indeed any other app that accepts images. This works best on the iPad, although MathBot will work on any iPad, iPhone or iPod Touch running iOS 4.0 or higher. I have only tried it on an iPad 2 for this review.  This figure shows a MathBot generated equation pasted into a Pages document on an iPad.

LaTeX is a math typesetting markup language developed by Lesley Lampert in the 1980's. It grew out of the TeX typesetting markup system developed by Donald E. Knuth in 1977.  LaTeX is the preferred way to create high quality math rich materials and many journals in the sciences require authors to provide LaTeX copies of papers.  A lengthy introduction to LaTeX is available here.  MathBot is not a full LaTeX typesetting system but only handles equations.

LaTeX is a markup language. For example "x^2" is how we write superscripts. Greek letters and special symbols are written with the special lead character \ followed by the name e.g. "\alpha". Curly brackets are nonprinting characters used to keep expressions together e.g. "{x+3}\over{2\pi}". Those used to WYSIWYG equation editors will at first find LaTeX slow and awkward, but it does become more natural with use, and it produces elegant output. There are various online introductions to LaTeX and listings of commands.



MathBot makes the writing of LaTeX somewhat easier through extra keyboard symbols for the most often used characters and expressions, grouped in logical ways. I show below a screen capture for MathBot. The top portion is the rendered equation (rendering is done automatically and it will update as you add to the equation markup expression).The middle portion is the corresponding LaTeX markup code. You can directly enter code from the normal iPad keyboard, but it is much easier to use the special extra line of characters which are the top line in the bottom panel. Just below that line is a series of buttons for different categories. For example one has all the Greek symbols.

You can edit the markup contents of the middle panel in all the normal ways such as copy and paste. If you hold down over a letter it will bring up the magnified view to allow precise positioning. MathBot comes with several example equations. Those learning LaTeX will find it helpful to use these as starting points.

To enter a new equation you first press the bookmark symbol at the top left, and then select Add New Equation at the bottom. You can attach name labels to each equation, and frequently used equations can be stored.

When your equation is ready for export to Pages (or other applications) you select the output button near the top right, and then Export Equation. It will present several options, including email and placing an image in your photo collection, but I prefer to use the pasteboard copy and paste process. Once you have pasted it in Pages (or other applications) you can then scale the equation (by default it will come out large and then you scale it down). I have found that the quality is excellent even after reasonable scaling. One slight irritation in the copy and paste process is that MathBot only works in portrait mode, so if your other application prefers landscape, you are constantly turning your iPad around.

Both Pages and Keynote support applying styles to the pasted equations, and this can be used to in one click provide nice features like boxes of various types around the inserted equations, or as shown below background shading.


MathBot is created by a small software company wiApps, based in Germany.  They have a Mac app as well as several iOS apps.  For those who want a complete LaTeX environment (for writing LaTeX entire documents and not just equations), they should consider TeX Touch. TeX Touch uses a unique approach of editing on the iPad, sending the code through Dropbox to your Mac where it is compiled and the pdf sent back to your Mac via Dropbox.  The limitation on executable code on iOS devices require such an approach. I may review TeX Touch in some future posting.

I hope that at some point Pages will include a built-in equation editor.  Until then, your best option is MathBot.  Those who already know LaTeX will find it an easy transition, and will appreciate that they can paste in, or copy out, LaTeX code for equations. I found that the scaling of equations in Pages maintained high quality equations after appropriate scaling.  There will be a learning curve for those who have not used LaTeX before, and I recommend starting with one of the many internet guides on LaTeX. The line of LaTeX symbols on the extended keyboard will ease the learning curve somewhat. I wish that the app supported landscape mode, as I like to work on Pages exclusively in landscape using the stand on my iPad case, and it is awkward having to turn the iPad as you go between modes as you develop and paste equations. My overall rating of MathBot is a 7 (out of 10).

8 comments:

  1. For those that want something closer to MathType, there's a new app out called "EQ Editor" that lets you set math using a graphical interface (i.e. no TeX) and export it as PNG or MathML. The link for that is here: http://itunes.apple.com/us/app/eq-editor/id468981237

    ReplyDelete
  2. Thank you for pointing out this new option for equations on the iPad.

    ReplyDelete
  3. Important note: An update to MathBot published in mid February 2012 has "broken" the app so it won't even launch from at least some hardware (including an iPad 2 with the most recent iOS). Do not download or update until the developer has fixed this. I have contacted the app developer, apparently a fix has been submitted, but not yet available, on the app store.

    ReplyDelete
  4. The MathBot app has now been fixed and the fail at launch has been fixed.

    ReplyDelete
  5. Another iPad app for science students and tutors is iVerbTeX which let's you create LaTeX projects and generate a PDF from your LaTeX code (by using the web service available at http://www.verbosus.com).

    It supports additional features like file upload (e.g. images, packages, etc.), project import/export, etc.

    ReplyDelete
  6. In addition to the apps listed here there exist apps like iVerbTeX that let you manage and create whole LaTeX projects and integrate the generated equations (as images for example) to the resulting PDF.

    For more details see: https://itunes.apple.com/us/app/iverbtex-latex-editor/id560869163?mt=8

    ReplyDelete
  7. Cymbol is the simplest one for students on the iPad to both input chemistry formula's and physics stuff with isotopes. It also lets you tweet those formula's out as a teacher that could add some interesting flavor perhaps.

    MathBot is good too, but more complex overall. It differs from Cymbol on the iPad that it creates an image file of the formula versus encoding in the information as extended character sets.

    Also Cymbol facilitates poly-valent molecules, with superscript plus and minus sign as well as it is very easy/quick/lightweight as to storage on your iPad device.

    Mathbot is probably nicer for fancier presentations, but his more complex and oriented towards a collegiate or perhaps AP level situation where the tool becomes even more a part of the learning versus the subject matter.

    Cymbol for iPad on the iTunes App Store
    https://itunes.apple.com/us/app/cymbol/id416714959

    TeX is cool, and these comparisons Robert, you can expand upon in a better narrative on this blog in the future.

    ReplyDelete
  8. Hi John Read is here, working in an ipad applications development... Highly informative post... good work

    ReplyDelete