Show HN: TeXbrain, a LaTeX editor that runs pdfTeX in the browser via WASM
A new open-source LaTeX editor called TeXbrain allows users to write and compile LaTeX documents directly in their web browsers. No accounts, installations, or servers are required – just open a tab and start writing. The editor is built on CodeMirror 6 with a custom LaTeX grammar and offers autocomplete features. It supports multiple open files and syncs content between the local filesystem and an in-memory git working tree.
The compilation engine uses SwiftLaTeX's pdfTeX, running in a memory filesystem (MEMFS) to handle file requests. Resolved files are cached in the browser's storage to ensure efficient downloads. Git operations are handled by isomorphic-git, a JavaScript implementation of git, with remote operations going through a CORS proxy. The PDF viewer is powered by Mozilla's pdf.js, supporting multi-page rendering with selectable text.
The app utilizes the File System Access API to read/write files locally on Chromium-based browsers, while other browsers use an Origin Private File System fallback. TeXbrain is a full client-side LaTeX editor that compiles .tex files to PDFs right in the browser, requiring no backend or server processing. It can be accessed at http://localhost:5173 in supported browsers, with full functionality requiring the File System Access API.
Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.