Any Possible OCR options in Typst like Mathpix in Latex?

As a student working on Mathematics and some TCS, I had used Latex quite a while before I started to try Typst. I like the features of Typst. But in latex, I get used to utilize OCR tools like mathpix to copy and paste the online formats. I haven’t seen any reliable alternative in Typst that is easy for ordinary usage. Are there possible alternative ways besides using latex-ocr then translating them into typst?

3 Likes

Since the available training set (arXiv notably) is much larger in the TeX world, I imagine the best solution for now might be to rely on latex-ocr, but maybe augment it with a call to pandoc (via its Python library) to convert the output to typst automatically. I don’t know enough about Python packaging, but I would imagine it’s not too involved.

1 Like

There’s this: GitHub - detypstify/detypstify: Using OCR to convert images of formulas into Typst code. / Detypstify though I have not personally tried it yet.

For handwriting recognition of individual symbols, there’s: https://detypify.quarticcat.com/.

3 Likes

There is also typress with a demo on huggingface which can do full equations.

4 Likes

Typress allows you to use images to get math formulas written in Typst. Haven’t used it yet, but in case you want to test it, the people behind it also have a demo in HuggingFace

4 Likes

Truly Appriciate! I will try to use typress and detypstify. Just wish there can be a fast short-cut like control + command + m.

For Typress, I often use this web app

https://typress-web.vercel.app/

5 Likes

Hello, I am the developer of Typress. Currently, Typress has good support for printed formulas (such as textbook photos, screen captures, etc.), but support for handwritten formulas is still being improved.

Please note that Typress only supports mathematical formulas, unlike Mathpix, which also supports text mixed with formulas. Also, we do not have a mathematical formula recognition model, so if you use Typress, it is best to input images that contain only the formulas themselves, without any extraneous parts.

4 Likes

It’s so nice to hear from you! I’m glad to try it.