A free, open-source LaTeX editor that runs wholly successful your browser.
No accounts. No installs. No servers. Just unfastened a tab and write.
Try it now → tex.swimmingbrain.dev
I built this because I was tired of paying for features that should beryllium free. I wrote my thesis past twelvemonth successful LaTeX and spent much clip fighting tooling than really writing. Online solutions fastener git sync down a paywall. Local setups break betwixt machines. I wanted thing that conscionable works. Open a browser, constitute LaTeX, get a PDF.
So I built it.
texbrain is simply a afloat LaTeX editor that compiles your .tex files to PDF straight successful the browser. There is nary backend. No server processing your files. Everything (the editor, the compiler, the git client) runs client-side.
You tin unfastened a section task folder, edit your files, spot the PDF update, perpetrate your changes, and push to GitHub. All from 1 tab.
- LaTeX compilation successful the browser. Uses a WebAssembly larboard of pdfTeX (SwiftLaTeX). Your .tex files are compiled to PDF without ever leaving your machine. Packages are loaded connected request and cached locally, truthful the first compile only downloads what your archive really uses. Recompilations return 1 to 5 seconds depending connected task complexity.
- Most of CTAN, loaded connected demand. Common packages vessel pinch the app. Anything other (memoir, abntex2, KOMA-Script, you sanction it) is resolved automatically from a TeX Live reflector the first clip a archive needs it, past cached locally for offline use.
- Live PDF preview. Rendered pinch pdf.js. Multi-page, zoomable, pinch matter selection.
- Full git integration. Clone repos, create branches, shape files, commit, push, pull, merge. All powered by isomorphic-git moving successful the browser. No CLI needed.
- Local record strategy access. Uses the File System Access API to publication and constitute straight to your task files connected disk (Chrome/Edge).
- Multi-file projects. File tree, tabs, drag-and-drop. Supports .tex, .bib, .sty, .cls and more.
- CodeMirror 6 editor. Syntax highlighting, autocomplete for 70+ LaTeX commands, bracket matching, codification folding, snippets, dark/light theme.
- Command palette. Quick entree to actions via keyboard shortcut.
- Snippet picker. Math environments, archive structures, Greek letters, communal commands. Searchable and categorized.
- Works offline. Once loaded, the app useful without an net connection. Compilation is local, editing is local. Packages you've compiled pinch earlier are cached; only a package you've ne'er utilized needs the web once.
- Project templates. Start from scratch aliases prime a template (article, thesis, beamer, report, CV, letter, minimal).
How it useful nether the hood
There's nary magic and nary backend.
Editor. Built connected CodeMirror 6 pinch a civilization LaTeX grammar (Lezer parser), autocomplete provider, and taxable system. The editor supports aggregate unfastened files via tabs and syncs contented pinch some the section filesystem and the in-memory git moving tree.
Compiler. LaTeX compilation uses SwiftLaTeX's pdfTeX motor compiled to WebAssembly. The motor runs successful a representation filesystem (MEMFS), wherever your task files are written earlier each compilation. When the motor asks for a record it doesn't person (a class, package, font, ...), the work worker resolves it done a chain: antecedently cached files first, past the package subset bundled pinch the app, past a TeX Live reflector (a texmf-dist reflector connected jsDelivr, pinch a organization SwiftLaTeX server arsenic fallback). Every resolved record is stored successful the browser's cache storage, truthful each package is downloaded astatine astir once. After the first successful compile, the bundled subset is besides prefetched successful the inheritance truthful the halfway package group useful offline.
Git. All git operations usage isomorphic-git, a axenic JavaScript implementation of git. The repository lives successful an in-memory filesystem (LightningFS) backed by IndexedDB. Your task files are synced betwixt the section filesystem and the git moving tree. Remote operations (push/pull/clone) spell done a CORS proxy since browsers can't speak the git protocol directly.
PDF viewer. Rendered pinch pdf.js, Mozilla's PDF rendering library. Supports multi-page rendering pinch a matter furniture for action and search.
File system. The app uses the File System Access API to read/write your existent files connected disk. This requires a Chromium-based browser (Chrome, Edge, Arc, Brave). For different browsers, there's a fallback utilizing the Origin Private File System (OPFS).
Frontend. SvelteKit pinch the fixed adapter. The full app is pre-built to fixed HTML/CSS/JS and deployed to GitHub Pages. No SSR, nary API routes, nary server. Tailwind CSS handles styling.
- pdfTeX only. No XeTeX aliases LuaTeX, truthful fontspec, polyglossia and thing other that needs them won't compile.
- No bibtex aliases biber. The motor doesn't vessel either. Documents utilizing biblatex get a plain thebibliography generated from the .bib file, truthful references show up but the citation style is ignored. Classic bibtex workflows request a .bbl successful the project. A existent bibtex successful WASM is adjacent connected the list.
- TeX Live 2020 era. Packages are pinned to the aforesaid era arsenic the engine's format file, truthful newer package versions aren't available.
- Git remotes request a CORS proxy. Browsers can't speak the git protocol directly. The default proxy is configurable, spot below.
- Direct files entree is Chromium only. Firefox and Safari autumn backmost to a virtual filesystem, spot Browser support.
Everything runs successful your browser. Your files ne'er time off your instrumentality unless you explicitly push to a remote.
- No telemetry, nary analytics, nary tracking.
- No accounts, nary cookies, nary information collection.
- Git authentication tokens are stored successful your browser's localStorage. They ne'er touch a server I control.
- LaTeX compilation happens successful a WebAssembly sandbox. There are nary ammunition commands being executed. No pdflatex, nary exec(), nary spawn().
- Git operations usage a JavaScript library, not CLI commands. No bid injection is possible.
- The CORS proxy for git remotes is simply a known trade-off. By default it uses cors.isomorphic-git.org (the isomorphic-git project's nationalist proxy). You tin constituent it astatine your ain if you prefer.
- Packages that aren't bundled are fetched from nationalist TeX Live mirrors connected demand. Only package filenames are sent, ne'er your archive content. Fetched files are cached locally, truthful this happens erstwhile per package. The fallback server tin beryllium changed aliases abnormal wholly via the texliveMirror penchant (empty drawstring turns it off).
- LaTeX and TeX are free and open-source software. This task uses them. It doesn't redistribute aliases modify their source.
| Framework | Svelte 5 + SvelteKit (static adapter) |
| Editor | CodeMirror 6 + civilization LaTeX connection support |
| Compiler | pdfTeX via WebAssembly (SwiftLaTeX) |
| Git | isomorphic-git + LightningFS |
| pdf.js | |
| Styling | Tailwind CSS 4 |
| Language | TypeScript |
| Deployment | GitHub Pages |
Open http://localhost:5173 successful Chrome aliases Edge.
Full functionality requires the File System Access API, which is disposable successful Chromium-based browsers (Chrome, Edge, Arc, Brave, Opera). Firefox and Safari tin still usage the editor pinch the virtual filesystem fallback, but won't beryllium capable to read/write straight to section folders.
MIT
Built by Braian Plaku
English (US) ·
Indonesian (ID) ·