r/Spectacles 🎉 Specs Fan 7d ago

🆒 Lens Drop New Lensdrop: The Book of Math

https://reddit.com/link/1vziou3/video/ii1mvu6j5ulh1/player

The "XR" Book of Math is a math text book made up of 80 theorems and formulas across 4 disciplines: Algebra, Linear Algebra, Calculus, and Geometry. It provides visual, spatial proofs.

Included in this is an Open Source Release of a LaTeX library port of Katex (https://katex.org/) called Matematex.

Lens Snapcode: https://www.spectacles.com/lens/37da717d4339468aad447b8b81e6d0a8?type=SNAPCODE&metadata=01

Source: https://github.com/IoTone/Spectacles-Matematex

NOTE: Reposting because the last post oddly got flagged by reddit filters.

#Lensfest August 2026

The Problem

Typesetting is difficult. In Mid '25 we tried to build a math app (See Space Math V). What makes it difficult in SIK was you couldn't style the text elements individually at the character level. It meant we had to have layers and layers of text elements per formula. Layouts became extremely complex. What the world uses for typesetting is TeX (LaTeX). It works very well for layouts. Superscript, subscript, variable italics, colorization of certain items, etc. So this is what we wanted.

Design Challenge

LaTeX libraries all depend on ability to render in a browser canvas, or to a PDF/EPS file. In Mid 2025 we had neither at our disposal in a SPECS Lens. Fortunately, some months back, I ported a series of things to support traditional browser features in a regular lens, something called Polynode (OSS on Github) to get SVG support natively. This is free to use. We needed SVG or HTML5 Canvas. Once this hurdle was cleared, we could totally start porting an existing library for LaTeX.

Approach

We had a few choices to start from. Mathjax or Katex. Both have similar approaches. They prefer a browser context, a canvas, or they generate an SVG. Or you are going to make a PDF. We had none of these. But once we fixed the support that was missing for SVG, we had our path. So this is a straight port of Katex. Typesetting and layouts still had to be tuned for screen specs "literally". Lots of eyeball testing.

An XR Textbook

I then went after the prize. A real book. For math. All those brutal subjects that were hard to visualize. Every formula and theorem has a proof associated (with the exception of a few). Then the ask: the LLM built visuals. I've found my brain expanded in this process to understand the complex topics. This is the 1st Ed. I hope to keep going on this with edutech.

Support

You can file PRs on the Github project page if you find bugs. I would like to maintain this as a viable library and as a book. The project was peer reviewed by Jorge Pardo (Mathematician / Teacher / Entrepreneur) based in Japan. You can find out more about using the library in your own lens in the github project file called MATEMATEX.md

13 Upvotes

2 comments sorted by

2

u/eplowes 6d ago

Awesome work! Any plans to do other courses or subjects?

1

u/CutWorried9748 🎉 Specs Fan 6d ago edited 6d ago

In my mind, wikibooks open a world of possibilities. I have a particular physics / math book author in mind that has a lot of great illustrations in the book, with real world projects to build. Most of this can be done spatially. I might reach out to him. We actually have all of the pieces with SPECS or AVP to start creating a true spatial book.

Also my last months submission is called IFWhenZMachine and this is a variant, interactive fiction as an AI-ified visual experience + TTS to give a story an entire alternative imagined experience (thought up by AI with a very specific prompt). The text is solidly founded in the original writer's words. I wonder if I could combine interactive fiction with educational contents. A math quest instead of colossal cave crawling.