LaTeX Support for Google Wave

22 views
Skip to first unread message

Lazyrussian

unread,
Jun 4, 2009, 4:38:58 PM6/4/09
to Google Wave API
It would be nice to see some LaTeX support in Google Wave for us
scientists :)
Ideally, if a student has a problem, he coudl quickly copy the TeX and
send it to the professors, and the prof could edit the TeX and send it
back.

I know there's a python TeX package - QaTeX (I think that's what it's
called, and then there' also JavaTeX.

Just an idea, but I don't know if I could implement it.

Magnus

unread,
Jun 4, 2009, 5:02:46 PM6/4/09
to Google Wave API
I was planning to write a robot for this, good to know that others are
also interested.
The problem is that my programming skills are a bit rusty and I don't
have much time because I'm working on my bachelor thesis at the
moment.
But if I get invited to the sandbox I will try to get something to
work. My idea was to use a webservice that automatically generates
pictures from LaTeX-Mathcode. It can be found here:
http://www.forkosh.dreamhost.com/source_mathtex.html

How exactly would it be possible to use the packages mentioned by you?
Wouldn't they need be on the server the robot is running at?

Brian Kennish (Googler)

unread,
Jun 4, 2009, 5:20:35 PM6/4/09
to google-...@googlegroups.com
On Thu, Jun 4, 2009 at 1:38 PM, Lazyrussian <lazyr...@gmail.com> wrote:
> It would be nice to see some LaTeX support in Google Wave for us
> scientists :)
> Ideally, if a student has a problem, he coudl quickly copy the TeX and
> send it to the professors, and the prof could edit the TeX and send it
> back.

Hey, I think a Googler built something along these lines at one of our
internal hackathons. Maybe we can put it out as a sample soon, at
least as a jumping off point if it's not exactly what you're looking
for.

Lazyrussian

unread,
Jun 4, 2009, 6:50:58 PM6/4/09
to Google Wave API
Magnus,

I too have no idea if I can do it. My python is quite rust - I'm a JS
coder :)
Anyway, I submitted this idea + another one to the wave project. I too
hope I get an account.
If we both get an account, we should collab on this project.

I actually haven't given it to much thought, but you bring up a good
point. I'll do a bit more research in my free time and I'll get back
to you.

Lazyrussian

unread,
Jun 4, 2009, 6:52:41 PM6/4/09
to Google Wave API
Brian,

That would be great! I'd love to fiddle with it, give some feedback
and work on it if possible. I use LaTeX every day, so if I were to
incorporate wave into my daily life, I'd love to see LaTeX in Wave
too.

On Jun 4, 10:20 pm, "Brian Kennish (Googler)" <byoo...@google.com>
wrote:

Josh Cohen

unread,
Jun 5, 2009, 1:45:54 AM6/5/09
to Google Wave API
I'm thinking a bot that converts LaTeX commands live on the spot.

Magnus

unread,
Jun 5, 2009, 2:10:39 AM6/5/09
to Google Wave API
I've been thinking about this a lot lately and my idea is the
following:

Like in LaTeX you have two seperate markups for math code. Inline \(...
\) and seperate \[...\]. When using inline code the code gets replaced
as soon as the bracket is closed. This is mainly for short commands,
for example \(\epsilon\), that you use in your text.

When using a seperate equation the code doesn't get replaced but the
equation is posted below the code so you can easily correct any
mistakes you find. When you correct mistakes in the mathcode the
picture is replaced (perhaps when the cursor leaves the brackets, but
I don't know if there is an event for this).

What do you guys think?

PS: This could be the first really convenient way directly discuss
science on the internet! All the IM plugins to do this suck ;)

Harald Schilly

unread,
Jun 5, 2009, 4:44:08 AM6/5/09
to Google Wave API
On 4 Jun., 23:20, "Brian Kennish (Googler)" <byoo...@google.com>
wrote:
> Hey, I think a Googler built something along these lines at one of our
> internal hackathons. Maybe we can put it out as a sample soon,...

Sounds interesting, maybe also for google docs?
My vision is that it is used just for formulas. i.e. a robot looks for
an opening and closing "$" or double "$$" sign with some formula code
in between. It replaces the formula with an image of that formula and
some onclick-javascript that restores the latex formula back for
editing.
My guess is, the main concern for google is, that the majority of
users may not be familiar with latex and they also want something like
a formula builder or a recognition system for default maths syntax
(like, typing "1/(1-x)^2", selecting the formula, pressing the formula-
robot-button in wave and this input is replaced with $\frac{1}{(1-x)^
{2}}$ which in turn is the same as above).
In any case, would be really cool to have formula support.

H

Magnus

unread,
Jun 5, 2009, 4:55:24 AM6/5/09
to Google Wave API
I don't think it's a good idea to use $ as the markup. Firstly that
character is often used in conversations in the USA and secondly using
$$...$$ for seperated equations is deprecated and should not be used
in LaTeX-Documents, so we shouldn't encourage anyone to do so. \(...\)
and \[...\] are the correct LaTeX-Commands for inline and seperate
equation respectively ($...$ is not deprecated, but as I said it would
be harder to track in a document than \(...\)).

I was interested in your suggestion regarding the onclick-javascript.
Is that possible in a wave? That would definitely be the best way to
get back to the formula.

Harald Schilly

unread,
Jun 5, 2009, 5:07:27 AM6/5/09
to Google Wave API
On Jun 5, 10:55 am, Magnus <graf.mag...@googlemail.com> wrote:
> I don't think it's a good idea to use $ as the markup...

ok, however. if that's the only problem ;)
in any case, there needs to be a formula-button on top that makes the
ability to insert formulas obvious + some hints when you click on it
without anything selected.

> I was interested in your suggestion regarding the onclick-javascript.
> Is that possible in a wave? That would definitely be the best way to
> get back to the formula.

what i don't get until now is how the functionality of the client can
be extended. look at the spellchecker spelly. it has a js-dropdown
menu and afaik there is just an empty tag specifying where this
dropdown menu should be placed. where is the code behind?
following from what i know until now, a formula will be xml data
structure, embedded in a wave. let's say <f:f rendered="image">\frac{1}
{x}</f:f> and that's all. Then the client needs to be extended in some
way to provide the ability to show the image if available, access the
raw code on a click and request the rendered image if it isn't
available. The image rendering itself is easy, for example look here:
http://latex.univie.ac.at/?\sum_{n=1}^\infty1/{n^2}={\pi^2}/6 where
you can see the formula as a request parameter.

H

Bruce

unread,
Jun 5, 2009, 10:05:41 AM6/5/09
to Google Wave API


On Jun 4, 4:38 pm, Lazyrussian <lazyruss...@gmail.com> wrote:
> It would be nice to see some LaTeX support in Google Wave for us
> scientists :)
> Ideally, if a student has a problem, he coudl quickly copy the TeX and
> send it to the professors, and the prof could edit the TeX and send it
> back.

Am totally out of my element here, but what about something designed
for the web like asciimathml?

Bruce

Harald Schilly

unread,
Jun 5, 2009, 10:44:51 AM6/5/09
to Google Wave API
On Jun 5, 4:05 pm, Bruce <bdarcus.li...@gmail.com> wrote:
> Am totally out of my element here, but what about something designed
> for the web like asciimathml?
>

I don't know what you mean by asciimathml. mathml would be great, yes,
but how to enter it? everyone in maths is used to type in latex. but
you are right, if there would be a latex2mathml converter, it would be
even better since no images are involved and many browsers support
mathml out of the box.

h

Avital

unread,
Jun 5, 2009, 11:27:00 AM6/5/09
to Google Wave API
I have built a Firefox plug-in that replaces TeX in pages while you're
editing (for example in google docs). http://thewe.net/tex

Once I have a Wave account I will implement this same idea as a robot.
(Although perhaps \[ and \] are better delimiters than my [; ;])

RobertM

unread,
Jun 5, 2009, 11:48:30 AM6/5/09
to Google Wave API
Hi.

I've been thinking along the same lines, except I think there are
better choices than ASCIMathML.

There are a number of pure, client-side JavaScript rendering systems
for mathematics in web pages, and ASCIIMathML is just one of them. It
converts an ASCII input syntax into MathML, which is rendered natively
in the browser.

A better package (in my view) is the jsMath package developed by
Davide Cevone (http://www.math.union.edu/~dpvc/jsMath/) which uses
the same idea, but converts a subset of true LaTeX into a mix of HTML
+ CSS code to do very high-quality in browser rendering. It uses
available fonts, or falls back to images of individual characters (at
many resolutions) so as to have nearly universal browser support.

A better option still is a next generation open source project called
MathJax (http://www.mathjax.org) funded by the American Mathematical
Society, Society for Industrial and Applied Math, and Design Science.
It is supporting Cervone to use the same ideas as jsMath, but add
support for MathML as well. This is important for interoperability
with CAS systems and accessibility, and it also fits in well with most
STEM publishers whose production workflows these days mostly are XML
+MathML based. With MathJax, the input can be either LaTeX or MathML,
and regardless of the input, one can programmatically fetch a MathML
representation. In addition, jsMath's font handling is being beefed
up to take advantage of new support for webfont technology.

The MathJax project is just getting off the ground, and the bulk of
the work will be done over the summer. I'm interested in taking a
look at what would be involved in integrating with Google Wave. Let me
know if any of you would also be interested in taking a look at
MathJax, and I'll notify you as soon as we getting something posted
that is far enough along to experiment with.

Robert Miner
W3C Math Working Group co-chair
Design Science, Inc.

Harald Schilly

unread,
Jun 5, 2009, 12:00:01 PM6/5/09
to Google Wave API
On Jun 5, 5:48 pm, RobertM <robe...@dessci.com> wrote:
> A better package (in my view) is the jsMath package ...
I know jsmath .. we use it over here at sagemath.org [implementing a
robot for interacting with sage to evaluate code would be my second
wish after formula rendering is solved ;) ]

> A better option still is a next generation open source project called
> MathJax (http://www.mathjax.org) ...

sounds really promising, hopefully something very useful will come
out. The point is, in my opinion, that this is a bit against the
google wave model! I mean, a robot is a participant of a wave
conversation like any other user that changes the wave once for _all_
users. Therefore, it is more like a server-side tool.
I think, the ideal solution would be if something like jsMath would
run on a server and some logic replaces formulas with jsMath output --
or in case of mathjax, optionally with mathml. Therefore, everyone
has the same view of the document and there is no need to run the same
js-code on all participants (despite that it doesn't need to be
installed on the client, too)

H

Magnus Graf

unread,
Jun 5, 2009, 12:06:48 PM6/5/09
to google-...@googlegroups.com
I agree, the idea is not to create something client-sided but a bot that does all the work and gives every participiant the same view without having to install something.

RobertM

unread,
Jun 5, 2009, 1:50:38 PM6/5/09
to Google Wave API
I take your main point. But just to clarify, no one has to install
anything with jsMath/MathJax. The JS script code, etc. would just
come with the page content.

Harald Schilly

unread,
Jun 5, 2009, 2:06:13 PM6/5/09
to Google Wave API


On Jun 5, 7:50 pm, RobertM <robe...@dessci.com> wrote:
> I take your main point.  But just to clarify, no one has to install
> anything with jsMath/MathJax.  The JS script code, etc. would just
> come with the page content.
>

yes, i know ;)

but

my experience is that you need additional fonts - otherwise you get a
big warning on top with jsmath. and secondly, i'm not sure if a google
wave client supports additional code insertions as part of an
extension. i can only think of a gadget (not sure what it does
esentially), but that needs to be inserted for each wave where you
need it. a robot is independent of the wave client and acts as a
participant! possibility three is a browser extension independent of
the whole thing, but we already have that.

maybe i'm wrong, but that's how i understand it so far and by
"installing" i mean "modifying the code base sent to you as part of
the wave client" ... and for example, if another client implementation
is not html/js based, but a "usual" c++ GUI application, you are lost
again... [since, by design, the wave document itself is some custom
xml independent of html, that gets translated to the html view on the
fly by the client (web browser), that's why it would be possible to
exchange the html client with something totally different. e.g. think
of a standalone twitter app]

h

WenChen Hol

unread,
Jun 7, 2009, 3:56:07 AM6/7/09
to google-...@googlegroups.com
Why not create a math plugin in wave richtext editor. Simple technology. Edit latex syntax in wave math plugin, when saved, the server generate the image according to the latex script and display the equation as an image.
 
This image has an attribute, longdesc, to store the latex script, when edit the image again in the math plugin, the latex script can then be retrived and edited again.
 
This way, the server run only once for each saved latex script, but not rendering the latex image every time a user viewed the page; no additional addons or java applet required on client side to view an equation image.
 
The gui can contain those mostly used latex symbols and combos , with some javascript script manipulation to assist the latex authoring, an author can easily write their equation without the need to remember these 300+ latex symbols/combos/mathML syntax etc...
 
I wrote one like this before. an old animation is here
http://cad.auckland.ac.nz/courses/12/publish/1/menu1/maths_equation_plugin.swf
To test the concept, use test as account and passxxd for the following link.
 http://cad.auckland.ac.nz/coursebuilder/start.pyg?cmd=edit_idevice&courseidentifier=1&menuidentifier=1&subunitidentifier=3&idevice_shortname=freetext

Let me know if anyone want the plugin.

Quite simple. Should be doable by googlers if is desired.  

Scott Morrison

unread,
Jun 7, 2009, 2:00:25 PM6/7/09
to Google Wave API
Terry Tao's blog has a link to a screenshot of "Latexy" in action.
Looks like someone in google is already on this.
Reply all
Reply to author
Forward
0 new messages