sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

Add handwritten (or stylus/mouse written) to latex conversion via AI (e.g., Gemini Vision) #7263

Open williamstein opened 8 months ago

williamstein commented 8 months ago

There's a feature I've always wanted to add to CoCalc, which is the ability to take hand written math and turn it into latex. This would be handy for people writing latex or markdown, since often it's easiest to just write out math the first time instead of tediously typesetting it, especially for some people. The Gemini Vision model from Google actually seems pretty good at this now! I just tried writing a little math on some paper and it had no problem. The selected output math at the bottom of this screenshot was produced by the model:

image

It looks like this:

Consider $$y^2 = x^3 + \alpha x + \beta \quad \text{and} \quad \int_0^\infty \frac{dx}{x^{2+1}}$$

The exponent isn't exactly right. But it's still impressive, and we should add this.

williamstein commented 8 months ago

Another silly test:

image

And it gets

A group is:

So it's good at markdown with math formulas. I can't get it to actually generate latex at all (e.g., an itemize environment). But I think this is still useful.

williamstein commented 8 months ago

Regarding "or stylus/mouse written", we have a whiteboard in cocalc, so can use that sketchpad to draw something, then feed it to a model.