English · 中文
Browser-only LaTeX → PDF.
No account. No install. No backend—just a tab.
I was tired of paying for basics. I wrote a thesis in LaTeX and fought the toolchain more than the content. Cloud editors paywall git; local setups diverge across machines. I wanted: open browser, write LaTeX, get a PDF. So I built this.
TeXbrain was originally created by Braian Plaku. This repository—vanabel/texbrain—is a maintained fork with substantial improvements and extra documentation. Live demo (this fork): tex.vanabel.cn. Upstream public demo: tex.swimmingbrain.dev—a different codebase and deployment. Maintainer / contributor: vanabel.
- Why it exists
- About this fork
- What it does
- Features
- Editor sidebar
- SyncTeX
- BibTeX example
- Documentation
- Quick start (local)
- License
TeXbrain is a full editor: your .tex files compile to PDF in the browser. There is no server processing your sources—the editor, compilers, and git client all run client-side.
Open a folder, edit, preview PDF, commit, push to GitHub—from one tab.
| Compile in-browser | WebAssembly TeX. Default: SwiftLaTeX pdfTeX. Optional BusyTeX for real BibTeX when your project uses classic \bibliography / \bibliographystyle or biblatex with backend=bibtex. On missing .sty / .cls, optional CTAN auto-fetch (retry after download). |
| PDF preview | Dev: pdf.js. Default production: native browser PDF. Optional VITE_PDF_VIEWER=pdfjs at build time for pdf.js + SyncTeX in the preview. Details: FAQ — SyncTeX & PDF.js. |
| Git | Clone, branch, stage, commit, push, pull, merge via isomorphic-git—no CLI. |
| Local files | File System Access API on Chromium—read/write your disk folder. |
| Projects | Tree, tabs, drag-and-drop; .tex, .bib, .sty, .cls, and more. |
| Sidebar | Files, Outline (sections + \input / \include), References (cites + numbered equations). Ctrl+B toggles the sidebar. |
| Editor | CodeMirror 6—highlighting, completions, folding, snippets, themes. Project-wide \cite{…} / \eqref{…} completion from .bib / .bbl and equation labels. |
| Palette & snippets | Command palette; searchable math/env snippets. |
| Offline | After load, editing and compilation work without the network. |
| Templates | Article, thesis, beamer, report, CV, letter, minimal. |
| SyncTeX | Double-click editor → PDF; Ctrl/⌘+click PDF → source (pdf.js preview). See FAQ. |
The left sidebar has three tabs (Ctrl+B):
| Tab | What it shows |
|---|---|
| Files | Project file tree. |
| Outline | \part … \subparagraph from the active .tex, including \input / \include. Click to jump. |
| References | Citation keys (.bib / .bbl) and numbered equations (from entry .tex + includes; skipped when the project has more than 120 .tex paths). |
- Click a key or equation number → jump to source.
- Ctrl+click / ⌘+click → insert
\cite{key}or\eq{number}.
Double-click the editor to scroll the PDF toward the cursor; Ctrl+click (Windows/Linux) or ⌘+click (macOS) on the pdf.js preview to open the matching .tex line. Default production builds use the native PDF viewer, so preview SyncTeX needs VITE_PDF_VIEWER=pdfjs at build time.
Full details, env vars, and hosting notes: FAQ — SyncTeX.
Sample project: examples/bibtex-metapost-english-chinese/. In the app: welcome screen → Clone Repository → Use official TeXbrain repo (BibTeX EN/ZH example). Classic BibTeX needs BusyTeX on the host (pnpm run download-busytex). Known issues (cleveref, sortname): FAQ — BibTeX.
| Guide | English | 中文 |
|---|---|---|
| Index | docs/README.md | docs/README.zh-CN.md |
| Technical (architecture, stack, privacy) | docs/en/technical.md | docs/zh-CN/technical.md |
| Deployment (local, Pages, PM2, NAS, CDN) | docs/en/deployment.md | docs/zh-CN/deployment.md |
| FAQ (SyncTeX, CTAN auto-fetch, BusyTeX, fonts, troubleshooting) | docs/en/faq.md | docs/zh-CN/faq.md |
| Collaboration workflow (GitHub, Collab) | docs/en/collaboration-workflow.md | docs/zh-CN/collaboration-workflow.md |
| Roadmap | ROADMAP.md | ROADMAP.zh-CN.md |
git clone https://github.com/vanabel/texbrain.git
cd texbrain
pnpm install
pnpm exec svelte-kit sync
pnpm devOpen http://localhost:5173 in Chrome or Edge. Optional BusyTeX: pnpm run download-busytex. Deploying to GitHub Pages, PM2, or a NAS: Deployment guide.
Original author: Braian Plaku. This fork is maintained by vanabel.