Math in Telegram

Intro

Change of subject. I’m feeling, probably, like Knuth felt 50 years ago. I started typing a Telegram post, and when it felt appropriate to add a simple mathematical expression, I hit a brick wall. As my friend and I discussed ten years ago, there’s still no easy way to type math expressions in Telegram.

This post is a new style for me—maybe a “struggle story.” Everyone can tell a success story, and we’re all a bit fed up with that. My friend, who runs the channel, told me the struggle itself could be interesting. Let’s test this hypothesis.

Recap

Brief recap: I fixed a nasty issue in my gradient-boosted decision trees repository, started improving it and writing about the process in this channel, and realized I can’t write math expressions in Telegram posts. So instead of improving GBDT-E, I’m trying to figure out this math hiccup.

Math in Telegram, SOTA

First, I decided to diagnose the problem. I asked our “iron” friend, ChatGPT, about a convenient way to include math in Telegram posts. It gave a long explanation about making links and sharing PDFs. None of that satisfied me. I just want to type text and have inline inserts—like when I’m writing with a pen.

Next, I checked several math-heavy channels—contest problems, ML and DS lectures. Almost all of them use the same ugly approach: copy-pasted PDFs and pictures.

Instant View

During these attempts I noticed “Instant View” and started digging into this technology. The Telegram documentation
says it can parse a blog article or site, cache it on Telegram’s servers, and show it instantly inside the app. Sounds promising. I put the beginning of my article in Markdown, asked a Codex agent to convert it to HTML and publish on GitHub Pages. The first results were quite satisfying: the HTML looked close to what I wanted, and a nice Instant View was generated. I’ll show those results. But then the struggle began.