Skip to content

vanabel/texbrain

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

130 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English · 中文

TeXbrain

TeXbrain

License SvelteKit TypeScript

Browser-only LaTeX → PDF.
No account. No install. No backend—just a tab.

Open the app → tex.vanabel.cn


Why it exists

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.

About this fork

TeXbrain was originally created by Braian Plaku. This repositoryvanabel/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.


Contents


What it does

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.


Features

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.

Editor sidebar (files, outline, references)

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}.

SyncTeX (editor ↔ PDF)

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.


BibTeX example (English / Chinese)

Sample project: examples/bibtex-metapost-english-chinese/. In the app: welcome screen → Clone RepositoryUse official TeXbrain repo (BibTeX EN/ZH example). Classic BibTeX needs BusyTeX on the host (pnpm run download-busytex). Known issues (cleveref, sortname): FAQ — BibTeX.


Documentation

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

Quick start (local)

git clone https://github.com/vanabel/texbrain.git
cd texbrain
pnpm install
pnpm exec svelte-kit sync
pnpm dev

Open http://localhost:5173 in Chrome or Edge. Optional BusyTeX: pnpm run download-busytex. Deploying to GitHub Pages, PM2, or a NAS: Deployment guide.


License

MIT

Original author: Braian Plaku. This fork is maintained by vanabel.

About

FOSS browser-based latex editor with live preview, real-time collaboration, and git integration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 70.5%
  • Svelte 13.9%
  • TypeScript 13.2%
  • CSS 1.9%
  • Other 0.5%