ltx

A local browser editor for LaTeX papers that you and Claude Code can edit at the same time.

Source on GitHub

ltx editing a paper: source on the left in an economics-paper layout, PDF on the right
The editor with a paper open: source on the left, background-built PDF on the right.

Why

When Claude Code edits a .tex file while you have it open in an editor, one of you loses work: the editor reloads over your typing, or your save overwrites the edit. ltx treats the file on disk as the shared document. Your keystrokes stay local and are saved as small patches; edits that arrive from outside are merged into the open buffer within about a second, around whatever you have typed. You keep working in the browser, Claude keeps working in the terminal, and the PDF rebuilds in the background.

Features

Install

Needs Python 3.11+, uv and tectonic.

brew install tectonic
uv tool install git+https://github.com/danieldager/ltx

To try it without installing: uvx --from git+https://github.com/danieldager/ltx ltx --help.

Use

ltx new paper/            # main.tex and references.bib from a template
ltx open paper/main.tex   # start the server, open the browser
ltx stop paper/           # stop the server for that folder

Use with Claude Code

Install the skill once with ltx setup-claude (it writes ~/.claude/skills/ltx/SKILL.md; --uninstall removes it). With a paper open, talk to Claude Code in the terminal as usual. It reads these files:

FileUse
selection.json“rewrite this paragraph”: the text you have selected
comments.jsonselect text, add a comment, say “do the comments”; Claude sets status and reply
suggestions.jsonedits Claude proposes; you accept, reject or discuss each in the editor
compile_errors.json“fix the build”

To have Claude pick up comments as you write them, ask it to monitor with Claude Code’s Monitor tool and this command:

ltx watch paper/main.tex

It prints one line per newly opened comment and nothing otherwise, so each line wakes Claude, which applies the comment and goes back to waiting.

Status

A personal tool, tested on macOS only. No CRLF or BOM handling; files must be UTF-8 with LF line endings. Undefined reference warnings are not linked to a file. See the README for the full list.