Thursday, September 19, 2013

Speed Blogging. How to type pretty math: Google Charts API to render LaTeX items

Did you know you can still use LaTeX in Google?

Google used to allow LaTeX directly into their Insert->Equation in Google Docs. Now that has been depricated. But, the fuctionality still exists (albeit in a limited scope) in the Google Chart API!

Just enter the URL: 
http://chart.googleapis.com/chart?cht=tx&chl=

and finish it off with the URLencoded LaTeX you want to use.

Don't know LaTeX? You can use the snippets from the CodeCogs LaTeX Equation Editor.

I have my math problems hosted in a Google Spreadsheet. (I create them using Wolfram's Mathematica, but again that process is for a future blog post) I use LaTeX form and push them through the Google Chart API so they have nice math type. For example if I wanted to have them simplify the expression 3x-2y, I use the URL:


which yields:  

This is helpful when I use exponents or fractions, because 
 and 

looks much better than 3x/2 and 2^((3x)/2).