Better Math Markdown using Typst

November 30th, 2025

“I want to start writing a blog” I thought. Quite some time passed until I finally took the matter into my hands (ran bunx sv create homepage) and copied the truly amazing flexoki colour palette to my stylesheet. Now — a day later — here I am with a functional (and I hope good looking?) webpage for me to broadcast just about any thoughts deep into the world wide void.

Not long after, I found myself chatting with the cool new LLM in town. I needed to figure out the best way to properly highlight code snippets. The agent figured it out for me. Apparently, shiki is preferred nowadays because it offloads any rendering from client to server.

printf("And it just works!");

Let’s Math

A couple of years ago I was introduced to Typst as a great alternative to LaTeX. Although I did not make the switch immediately, slowly more and more of my documents for university were created using Typst. Transitioning wasn’t nearly as hard as I had feared. Soon enough my Obsidian vault was the only place where I found myself still using latex.

Not thinking about this, I installed rehype-katex-svelte and pasted the <link> attribute to load the katex stylesheet into my new blog’s HTML template. Only after a habitual Lighthouse performance benchmark did I ask myself whether a fellow nerd might have hacked together a viable replacement using Typst. Turns out, the answer is yes and it’s creatively called rehype-typst (npm).