How Real-Time Collaborative LaTeX Editing Works in LetX
LetX is a browser LaTeX editor where several people type in the same document at once and one build serves all of them. Two pieces make that work: a CRDT that merges everyone’s keystrokes without locking the file, and a compile service that runs latexmk on a full TeX Live 2025 on build servers, not on anyone’s laptop. Here is what happens at each step, and what it means for a paper with three co-authors and a deadline.
Why passing .tex files around breaks
The usual way to co-write LaTeX treats the document as a file that one person holds at a time. A supervisor emails comments on a PDF, the student fixes them locally, emails a new PDF back, and somebody misses an edit. A shared Dropbox folder produces conflicted copy files when two people save within a minute of each other. Git works well for people who already use it, but it merges line by line, and a LaTeX paragraph written as one long line turns every overlapping edit into a conflict. All three end the same way, with a folder of final_v2_really_final.tex and nobody sure which one compiles.
What happens when two people type at once
Each file in a LetX project is a shared Yjs document, which is a CRDT: a conflict-free replicated data type. Every character you insert gets its own identity and is placed relative to the characters around it, not at a line and column number. Your keystroke lands in your own copy first, so typing never waits for the network. It then travels over a WebSocket to that document’s room on the server, which passes it to everyone else who has the file open.
Because an edit is anchored to neighbouring characters rather than to an offset, edits can arrive in any order and every copy still ends with the same text. That is the whole promise of a CRDT: no lock, no “this file is being edited by someone else”, and no merge step afterwards. You see your co-authors’ cursors and names in the file while they work.
Two practical consequences are worth knowing. First, if the Wi-Fi drops, you keep typing: your edits wait in the browser’s storage and merge when the connection returns. Second, a CRDT guarantees that everyone converges on the same text, not that the text makes sense. If two people rewrite the same sentence at the same moment, both rewrites survive and one of you has to tidy the result. Agreeing who owns which section still helps, as it would on paper. The common collaboration problems post covers the habits that prevent the rest.
What happens when someone presses Compile
Compile turns the project into a job on a queue. Build workers, which run as containers on AWS Fargate separately from the servers that host the editor, take jobs in turn. The worker brings the project’s files into a build folder for that project and runs latexmk, which repeats the LaTeX, BibTeX or Biber and makeindex passes until cross-references and citations settle. You choose the engine per project: pdfLaTeX, XeLaTeX or LuaLaTeX (which one to use).
The distribution is the full TeX Live 2025, so every package TeX Live ships is already installed and every collaborator builds with exactly the same versions. “It compiles on my machine” stops being an argument, because every build uses the same installation. TeX Live 2025 also supports LaTeX’s tagging, so \DocumentMetadata{tagging=on} on the first line produces a tagged PDF with its structure and reading order.
A few things keep that build dependable when it matters, five minutes before a deadline:
- Incremental first, clean when the leftovers are the problem. The build folder is kept between compiles, so the next build reuses the auxiliary files. When a build fails because of a leftover, such as an
.auxfile that still names a package you removed, the worker drops the leftovers and builds again from your sources alone; a build that fails for reasons outside your document is retried from a clean folder. - A stopped worker does not lose your job. If a worker stops in the middle of a build, the job goes back on the queue and another worker picks it up.
- One build per project at a time. When two co-authors press Compile together, the builds of that project run one after the other, so neither writes over the other’s output.
- Same input, no rebuild. When every file in the project is exactly as it was in an earlier successful build, the PDF comes straight from cache without running TeX.
The new PDF appears for everyone in the project. A typical document comes back in a few seconds end to end, queue included. Paid plans use a priority queue and allow longer builds for very large documents; the details are on the pricing page. For more on building without a local install, see compiling LaTeX online.
Jumping between the PDF and the source
Every build runs with SyncTeX, which records where each piece of the PDF came from in the source. Click a word in the PDF and the cursor lands on that word in the source, in whichever file it lives: chapters/methods.tex as easily as main.tex when a thesis is split with \include. Going the other way, after a build the PDF scrolls to the line you are editing. In review this is what saves time: a co-author says “the table on page 14”, and you click it rather than search for it. The multi-file projects guide shows how to split a long document so this keeps working.
Reading errors, and letting Lexi fix them
LetX runs latexmk with -file-line-error, so the log names the file and the line of each error. The log panel lists the problems on their own, and clicking one takes you to that line, in the right file. The LaTeX problems guides explain the usual suspects, from Missing $ inserted to undefined references.
Lexi, the assistant built into the editor, works from the same log. It reads the open project, every file and the bibliography included, and the real latexmk output, edits the source in place, and rebuilds, so it fixes the line LaTeX complained about rather than guessing. Each error in the log has Explain and Fix buttons, and the version before each Lexi edit is kept in history, one click away. Free accounts get a few Lexi runs to try it; paid plans include a monthly allowance. Your documents are never used to train AI models. More in fixing LaTeX errors with AI.
Version history, comments and roles
- History per file. Every save that changes a file becomes a version, marked with who saved it and when. Open any version to read it, or restore it. A restore is itself an ordinary edit, so it reaches every collaborator at once and nobody is left on an old copy. Free accounts see the recent versions; paid plans keep the full version history.
- Comments beside the source. Discuss an equation in a comment on its line, reply in a thread, and resolve it when the fix is in. See track changes and comments in LaTeX for the review workflow.
- Roles that match how papers are written. Owner, Editor, Commenter and Viewer. A supervisor who should review but not edit joins as Commenter; a reader who only needs the PDF joins as Viewer.
Inviting co-authors, and what it costs
Invite people by email, or share a link that grants Viewer, Commenter or Editor access. Collaborators are unlimited on every plan, Free included. The free plan has no time limit, unlimited projects and 40 compiles a day; paid plans add unlimited compiles, longer builds, full version history, the priority queue, two-way GitHub sync and a monthly Lexi allowance. Verified students, faculty and staff pay half price on Academic Pro, and a lab or class can share one bill on Team. Prices are on the pricing page.
Moving a project in, and taking it out again
- From Overleaf or Prism: upload a project zip, or import several projects in one step from an Overleaf download or a Prism export; their folders are kept. How to move every project at once.
- From GitHub: an Open in LetX link opens a public repository as a project. Two-way sync with a repository, private ones included, is part of Pro.
- From an assistant: Claude and ChatGPT can create, edit and compile LetX projects through the LetX connector.
- Out: download the PDF, or the whole source as a zip, at any time. LetX does not submit to journals for you; start from a journal template and upload the files to the journal, or to arXiv, which wants the .tex source.
If you are deciding between editors, LetX vs Overleaf compares the two side by side, and real-time collaborative LaTeX is the short introduction to writing a paper together. Or start a free project and invite a co-author.
Frequently asked questions
What happens if two people edit the same line at the same time?
Both edits are kept. LetX syncs every keystroke through a Yjs CRDT, so simultaneous edits merge into one text that is identical on every screen, with no lock and no merge step. The CRDT does not choose between two rewrites of the same sentence: if two people rewrite the same words at once, both versions appear and one of you tidies them.
Can I keep writing if my connection drops?
Yes. Your edits are kept in the browser while you are offline and merge with everyone else’s when the connection returns. Compiling needs the connection, because the build runs on LetX’s build servers rather than on your computer.
Which TeX distribution does LetX compile with?
Full TeX Live 2025, through latexmk, with pdfLaTeX, XeLaTeX or LuaLaTeX chosen per project. Every package TeX Live ships is already installed, so there is nothing to add with tlmgr, and every collaborator builds with the same versions.
Do collaborators need a paid plan?
No. Every plan, Free included, has unlimited collaborators. Invite people by email or share a link with Viewer, Commenter or Editor access. Nobody you invite needs a paid seat to edit a shared project.
Does Lexi see my compile errors?
Yes. Lexi, the assistant built into the editor, reads the project and the real latexmk log, edits the source and rebuilds, so it fixes the line LaTeX reported instead of guessing. Free accounts get a few runs to try it, and paid plans include a monthly allowance.
Keep reading
Ready to try LetX?
Join researchers and students focusing on their work, not the tools.
Get Started Free
Written by Shihab Shahriar Antor , AI Engineer & Founder of Shahriar Labs. Builder of LetX (collaborative LaTeX) and offSchool (SSC science and maths, learned through simulations).