Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaTeX Live Editor

Local Overleaf-style editor: LaTeX source on the left, compiled PDF on the right.

Three ways to run it

Mode What runs Docs
Web (Node server) node server.js, edit in your browser this README
Finder "Open With" double-click a .tex → auto-starts the server, opens the browser docs/macos-open-with.md
Native macOS app one .app, no server, no browser (Tauri/Rust) docs/native-app-tauri.md

Build the native app: cd src-tauri && cargo tauri build (needs Rust + tauri-cli).

Setting it up on a brand-new Mac from scratch? See docs/fresh-machine-setup.md — copy-paste steps for installing everything (Homebrew, TeX, Rust/Tauri) and running the app, including a universal (Intel + Apple Silicon) build.

Making changes? See docs/development-workflow.md — the dev loop (cargo tauri dev), which file to edit for what, rebuilding & reinstalling the app, and commit/push.

Editor shortcuts

Shortcut Action
⌘S / Ctrl+S Save + compile
⌘↵ / Ctrl+Enter Compile
⌘/ / Ctrl+/ Toggle % comment on the selection
⌥↑ / ⌥↓ Move line(s) up / down
⇧⌘D / ⇧Ctrl+D Duplicate line / selection
⌘F Find (CodeMirror search)

Setup — installs anything missing

cd ~/Documents/ResumeBuilder-files/latex-editor
bash setup.sh

It detects what's missing, then installs: Homebrew → Node.js → TeX → the exact LaTeX packages the resume needs → npm dependencies. It finishes by compiling your actual resume to prove it works.

MacTeX is the default. If no TeX is installed you'll be asked, with MacTeX preselected — press Enter to take it:

Which TeX distribution?
    1  MacTeX     ~4 GB     everything included, nothing to add
                            later (default)
    2  BasicTeX   ~100 MB   minimal; this script then installs the
                            exact packages your resume needs

  Choose [1/2] (default 1):
Flag Effect
(none) Interactive — asks which TeX, shows the plan, confirms
-y No prompts; installs MacTeX
--basic Use the small BasicTeX instead
--full Force MacTeX (same as the default)
--check Report only, install nothing

To install MacTeX with no questions at all:

bash setup.sh -y

setup-check.sh is the earlier report-only version; setup.sh --check does the same thing and is the one to prefer.

If TeX was just installed, open a new terminal before running npm start — the shell needs to pick up /Library/TeX/texbin on your PATH.

Run the web server (macOS and Windows)

Needs Node.js and a LaTeX compiler (pdflatex). The same commands work on both platforms. The native Tauri app and Finder “Open With” wrapper are macOS-only — on Windows, use this web mode.

1. Prerequisites

Windows macOS
Node.js nodejs.org or winget install OpenJS.NodeJS.LTS bash setup.sh (above) or nodejs.org
TeX (for Compile) winget install --id MiKTeX.MiKTeX bash setup.sh installs MacTeX / BasicTeX

After installing TeX, open a new terminal so pdflatex is on your PATH.

2. Install dependencies (first time only)

cd path/to/latex-editor
npm install

3. Start

npm start

Open http://localhost:3000

By default the editor binds to ../KLDV_Prasad_Resume.tex (next to this repo). To bind a different file:

# macOS / Linux
DOC=/full/path/to/file.tex npm start

# Windows PowerShell
$env:DOC="C:\full\path\to\file.tex"; npm start

4. Stop

In the terminal where the server is running, press Ctrl+C.

The first Compile after a fresh MiKTeX install can take a minute while packages download. Later compiles are fast.

Fixing "Compilation failed / Unknown error"

That message meant the server couldn't find a real error to report. It's now fixed — errors are read from the compiler's stdout as well as the log file, so you get the actual LaTeX message. If compilation still fails, the cause is almost always one of these two:

The fix for both is the same — run the installer:

bash setup.sh

1. No LaTeX compiler installed

The server prints ⚠ No LaTeX compiler found on startup when this is the case. setup.sh installs BasicTeX for you. To verify afterwards:

curl -s http://localhost:3000/health

2. A package is missing (common with BasicTeX)

BasicTeX is minimal, so packages this resume uses may be absent. setup.sh installs exactly the ones needed. Note that two of them live under different tlmgr names, which is a common stumbling block:

\usepackage{...} tlmgr package
helvet psnfss
tabularx tools
everything else same name

Manually, that would be:

sudo tlmgr update --self
sudo tlmgr install psnfss tools titlesec enumitem geometry xcolor hyperref

Live file sync

The editor is bound to a real file on disk — by default ../KLDV_Prasad_Resume.tex. This means:

  • Edits in the browser are auto-saved to that file (700 ms after you stop typing)
  • Edits made to the file by anything else — Claude, your IDE, a script — appear in the browser within a second and recompile automatically

So you can ask Claude to change your resume and watch it update live, without touching a button. The toolbar shows the bound filename: green = saved, yellow dot = unsaved changes pending.

Bind a different file:

DOC=~/Documents/ResumeBuilder-files/KLDV_Prasad_Resume-v9.tex npm start

Your cursor position and scroll are preserved when a remote change arrives, and the browser reconnects on its own if you restart the server.

Features

Feature How
Compile Ctrl+S / Cmd+S, or the Compile button
Save to disk Automatic, or Ctrl+S to save and compile at once
Download PDF Toolbar button (runs 2 passes so references settle)
Download .tex Toolbar button
Open a .tex file Toolbar button
Resize panes Drag the divider

Endpoints added for sync

Method Path Purpose
GET /doc Current contents of the bound file
POST /doc Write the editor's contents back to it
GET /watch SSE stream; emits change when the file is edited externally

How the compiler is chosen

  • Documents using \usepackage{fontspec} → XeLaTeX (required for system fonts like Calibri)
  • Everything else → pdfLaTeX

The server searches PATH plus typical install locations for MacTeX / Homebrew (macOS) and MiKTeX / TeX Live (Windows). After installing TeX, restart the server so it picks up the new PATH.

Endpoints

Method Path Purpose
GET /health Which compilers were found, and the PATH searched
GET /default-template The resume template loaded on first visit
POST /compile {latex} → PDF bytes, or {error, details}
POST /download {latex, filename} → PDF as attachment

Reset the editor

If you want to discard your edits and reload the original template, run this in the browser console:

localStorage.removeItem('latex-editor-source'); location.reload();

About

Local LaTeX editor with live PDF preview

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages