docmux: LaTeX, Typst and Word, Right in Your Browser

I'm releasing docmux, an open source document converter written in Rust. It runs in the browser through WebAssembly: LaTeX papers to Typst that compiles, Word with native equations, and a playground to try it with your own documents.

Today I’m releasing docmux, a document converter I’ve been building on the side. LaTeX, Markdown, Typst, Word and HTML go in, any of them comes out. It’s written in Rust and compiled to WebAssembly, so the whole conversion happens in your browser: your files never leave your machine.

🧪 Try it

The playground opens with a paper already converted. On the left is the LaTeX, on the right the result: rendered, or as Typst, HTML, Markdown or Word. Edit the source and the output follows as you type. You can also open a .docx or drop in your own .tex, .md or .typ file.

📄 What this version does

LaTeX papers to Typst that compiles

A paper is more than its text. It defines its own commands, splits itself across files, and keeps its references in a .bbl that BibTeX generated. docmux expands \newcommand, \def and \DeclareMathOperator, follows \input and \include, and resolves each citation in the paper’s own style, numeric, alphabetic or author-year, with a link to the reference.

Math needs the most care. In LaTeX, xy is x times y; in Typst, xy is a variable called xy. A converter that copies letters across produces something that looks right and doesn’t compile:

LaTeX:   D_{KL}(q \| p) = \sum_x q(x) \log \frac{q(x)}{p(x)}
naive:   D_(KL) (q||p) = ...        -> error: unknown variable: KL
docmux:  D_(K L) (q||p) = sum_x q(x) log (q(x))/(p(x))

I check all of this against the LaTeX sources of real arXiv papers. So far there are 397, written between 1998 and 2025. Some are well known: machine learning, but also Perelman’s Ricci flow, Viazovska’s sphere packing, the CMS Higgs observation and Planck 2018. Most are a random sample from across arXiv, since famous papers tend to have tidy LaTeX. The Typst output of all of them compiles, with no raw LaTeX left in the text, and the list keeps growing.

Word with real equations

In the .docx, math is written as OMML, Word’s native equation format: fractions, sums, growing parentheses, matrices, aligned rows. You can click an equation and edit it in Word. Across those 397 papers that’s 178,132 equations, read back with pandoc, which parses OMML independently.

Wherever you need it

The same converter runs in the browser, in Node and on the command line:

npm install @docmux/wasm     # browser and Node
cargo install docmux-cli     # command line
docmux paper.tex -t typst -o paper.typ
import { convert } from "@docmux/wasm";

const result = await convert(latexSource, "latex", "typst");

Each format is its own Rust crate, so a WebAssembly build only carries the formats it uses. Everything is MIT licensed.

🧭 What it is not

pandoc is the reference for document conversion, and docmux covers a part of what it does. pandoc handles many more formats and edge cases, and if it already works for you, there is no reason to switch. docmux is for when you need conversion inside a web app, under the MIT license, or with a focus on LaTeX, Typst and math in Word.

What comes next is compatibility with pandoc, measured instead of estimated: a harness that runs the same inputs through both tools and compares the results, pandoc’s own flavor of Markdown, and the formats pandoc users reach for, like EPUB and ODT. The roadmap has the details.

🤝 Help me make it better

docmux is young, and real documents still find gaps. If you try it and something doesn’t convert well, an issue with the file, or a piece of it, helps a lot. So does a format you’d like to see, or a pull request.

The code is at github.com/aguschirico/docmux.

📋 TL;DR

WhatAn open source document converter: LaTeX, Markdown, Typst, Word, HTML and MyST
WhereIn the browser, in Node (@docmux/wasm) and on the command line (docmux-cli)
LaTeX to TypstCompiles on the 397 arXiv papers checked so far, from 1998 to 2025
WordNative, editable equations
Try itdocmux.pages.dev/playground, nothing leaves your browser
Codegithub.com/aguschirico/docmux, MIT

Every document someone else writes finds something I didn’t think of. That’s the part I’m looking forward to.