Sign in

Google Wave APIs (Labs)

WaveProtocol.org

Learn about the Google Wave Federation Protocol and get involved

Sample Details

LaTeXy

By: Kevin Allekotte - Oct 27, 2009

A simple robot that renders LaTeX code in a wave. I finds code beween $$ and $$ and replaces it with an image generated with the service http://sciencesoft.at/latex/

It features a simple robot written in python that searches text as you write (on document_changed) and uses the API to remove the code snippets and insert the appropiate image. It also features a very simple extension installer

Robot Address: la-texy@appspot.com

APIs: Robots, Installer

Languages: Python

Tags: latex latexy robot kevinalle kevin allekotte

*Live demos require Wave Sandbox access to view

Comments (9)

Title

Comments

Your name

 

Please make sure your comments are useful and informative.

Search/replace/update  

I've been hacking away at your code to see if I can get a search/replace put in. I've got a good start on it I think. The idea is this: I put the LaTeX code as a custom annotation for the image. I also set the latex code as the alt-tag for the image too. Then I wrote another search function for the robot. If you put in a matched set of =='s then anything in between them will have the latex code put back. The biggest problem is that there seems to be a bug in the python api so it is unable to delete images unless they are the first element on a line. So I can't remove the latex images, just put text next to them. Hopefully the bug will be fixed soon. If you want to try it out you can look at the robot trip11@appspot.com As for the source code, I don't have it up on the web, but I'd love to give you the changes. My username is trip11 on google wave too. Hit me up there and I'll send you the python files.

editable/searchable  

about the editable/searchable questions: I dont know how to replace the text with an image and still keep the text to be able to edit it or search for it afterwards. the code is here: http://code.google.com/p/latexy/source/browse/trunk/latex.py . If anyone knows how, help is appreciated :) thanks!

newlines fixed  

ok! it now suports multiline code, thanks!

+sign fixed :)  

the problem was i didnt URLencode the string correctly thanks!!

searchability?  

If the replacement is an image, can the original LaTeX code still be stored in some meta-data that is searchable by wave?