TeXbrain: A LaTeX editor that runs pdfTeX in the browser via WebAssembly
A master's student built TeXbrain, an in-browser LaTeX editor that runs pdfTeX via WebAssembly with no backend. It keeps files in a local folder, supports git, and works offline.
The developer said he built TeXbrain because he used LaTeX for his thesis and research articles and liked Overleaf but did not want to pay for git syncing. TeXbrain is a static site with no backend. The pdfTeX engine is compiled to WebAssembly using SwiftLaTeX and runs in the browser. The editor can read and write a project folder through the File System Access API, so users can use git, a local TeX installation, local AI agents, or other editors on the same files. Git is built in through isomorphic-git for cloning, branching, committing, pushing, or pulling without touching a terminal. No account is needed, there is no analytics, and everything works offline after the first load. Chromium browsers get direct folder access, while Firefox and Safari fall back to a virtual filesystem.
According to the post, the most difficult part to get working was package loading. The engine itself is only 1.8 MB. When the engine asks for a file it does not have, a service worker intercepts the request and resolves it first through Cache Storage, then a small bundled subset, then a TeX Live tree mirrored on jsDelivr, then a SwiftLaTeX-style server as a last resort. Every file is fetched once at most, and after the first successful compilation, the core subset is prefetched in the background so that offline use actually works. Only file names go over the network, never any document content.
The current version supports pdfTeX only; XeTeX and LuaTeX are not included, so fontspec and polyglossia will not work. Packages are pinned to the TeX Live 2020 era to stay coherent with the engine's format file, and there is no bibtex or biber in the engine yet, which the developer called the roughest edge.
The developer said TeXbrain should be a good solution for people on work laptops, Chromebooks, or university lab PCs where installing TeX Live is not always an option, and for people who do not want to maintain a TeX installation at all. For those who already have a local setup they like, the project is not necessarily meant as a replacement. Some people have already used it for theses in recent months, and their bug reports made up most of the summer's work. The first outside pull request also landed recently. The editor is available at tex.swimmingbrain.dev, and the project is on GitHub under an MIT license; the pdfTeX engine is EPL 2.0 / GPL 2.0 and is listed in the THIRD_PARTY_LICENSES file.