• 2 min read

LiteTeX

A small LaTeX editor in the browser: projects stay on my device, one Compile button runs a full TeX Live, and errors come back in plain English.

TypeScriptCodeMirrorPDF.jsVercel FunctionsSupabaseLaTeX
LiteTeX with LaTeX source on the left and the compiled PDF on the right
LiteTeX with LaTeX source on the left and the compiled PDF on the right LiteTeX in dark mode with LaTeX source and the compiled PDF

What it is

LiteTeX is a LaTeX editor for papers and résumés that loads fast and stays out of the way. Projects live in the browser’s storage, so there is no sign-up to start. Compiling runs on a full TeX Live through texlive.net.

  • Editing. LaTeX highlighting, autocomplete for commands, environments, labels and citations, search and replace, folding and multiple cursors.
  • Projects. Folders, images and other binary files. Overleaf zip import and zip export, with the main file found automatically.
  • One Compile button. It uses LuaLaTeX by default, keeps pdfLaTeX documents working, and switches to XeLaTeX on its own for packages that need it.
  • Errors I can act on. The TeX log becomes a list of plain-English errors that jump to the right line, and the PDF still shows when there are errors.
  • Templates. Research paper, résumé and blank.
  • Phones and tablets. A split view on tablets, and a PDF viewer with pinch zoom on phones.
  • Optional account. Email or GitHub and Google sign-in with background sync. Data stays local first, and a conflict keeps both versions.

The README puts the editor at about 150 KB of JavaScript and the start page under 30 KB.

The LiteTeX landing page

How it works

  • Fitting the free compiler. texlive.net takes only text and refuses requests over about 1 MB. LiteTeX sends binary files and files in sub-folders as text, and a small Lua script rebuilds them at the start of the TeX run. Requests over the limit are compressed. If that is still too big, photos are scaled down for that compile only.
  • The relay. texlive.net sends no CORS headers, so a Vercel Function forwards the job and returns the PDF or the log.
  • The PDF viewer. Pages are capped at about 5 million pixels, and canvases that scroll off screen are freed, which keeps long documents usable on phones.
  • Self-hosting. A Node server with a job queue runs latexmk, and a Docker image bundles the app with TeX Live. A hosted copy can point at it from the settings.

Stack

TypeScript with no framework, Vite, CodeMirror 6, PDF.js, fflate, IndexedDB, a service worker, a Vercel Function, Lua, Supabase over plain fetch with row-level security, Node and Docker for the optional compile server.

Back to top