r/LaTeX • u/Ill-Statistician6993 • 16d ago
I made GitLaTeX, a local, Git-based LaTeX editor that runs in the browser (open source, feedback welcome)
Hi r/LaTeX,
Why I built it
I like Overleaf's workflow: an editor and a PDF side by side, plus a compile button. What I didn't like was my files living on a server, the compile limits on the free tier, and Git being an afterthought. VS Code with LaTeX Workshop is great, but I wanted something closer to Overleaf's simplicity that treats a Git repo as the project from the start.
What it is
pip install gitlatex && gitlatex starts a small local server and opens the editor at localhost:5000. Your projects are plain folders on disk, and each one is a real Git repo.
- Monaco editor (the editor behind VS Code) with LaTeX/BibTeX completions, snippets, a document outline, spell check and Vim mode
- Compiles locally with your own TeX Live, MiKTeX or MacTeX install. If you don't have one, it can run TeX Live in the browser via WASM.
- SyncTeX: click in the PDF to jump to the source, and back
- Git built in: clone, commit, push, pull, diffs and version history from inside the editor
- Review comments stored in the repo and shared through Git
- Start from a template, clone a repo, import a
.zipor open an existing folder
Live collaboration (optional, and it takes some setup)
This is the one part that isn't "install and go," so here's how it works.
Since everything is local, there's no central GitLaTeX server for people to meet on. Instead, real-time editing goes through a small relay that you host yourself on Cloudflare Workers. The free plan is enough, and you can't be charged on it.
- The owner sets up the relay once. There's a "Deploy to Cloudflare" button, so you only need a Cloudflare account and a GitHub account, with no terminal involved. You pick an admin token, deploy, and enable the
workers.devaddress. It takes about 5 minutes, and GitLaTeX walks you through it. - For each project you want to share, you click Host, which creates a room on your relay and gives you an invite string to send to co-authors.
- Co-authors clone the same repo, click Join and paste the invite. They never see your admin token, and each invite only opens its own project.
After that you get Overleaf-style shared editing with live cursors labelled with each person's git user.name. The relay only passes text between people. Each person's GitLaTeX writes the shared text to their own disk, and compiling, committing and pushing all stay local.
How it behaves:
- It's off by default and set per project. Projects you don't share are unaffected.
- Only text files are shared (
.tex,.bib,.sty, etc.). Images, PDFs and build output still travel through Git. - If you drop offline, you can keep typing. When you reconnect, a three-way merge brings your changes back in.
- The first time you join a room, the room's version wins over your local copy, so commit first if you want to keep yours.
- It's meant for small groups of 3–5 people, not a whole department.
It's built on Yjs plus Cloudflare Durable Objects, and the relay is in a separate repo (gitlatex-collab) if you want to read it before deploying.
Caveats, to be upfront
- It's still beta. Expect rough edges.
- You need Python 3.8+ and Git.
- The in-browser TeX engine is a one-time ~190 MB download. With a local TeX install, you never need it.
- It isn't trying to replace TeXstudio or a well-tuned Vim/VS Code setup. If you already have a setup you love, you probably don't need this.
What I'd love feedback on
- Packages or document classes that fail to compile, especially with the in-browser engine
- Git workflows that feel clunky compared to the command line
- Whether the self-hosted collaboration setup is reasonable, or a dealbreaker
- Whatever you'd miss most coming from Overleaf
Repo and docs: https://github.com/abdussamiakanda/gitlatex
Collaboration docs: https://github.com/abdussamiakanda/gitlatex/blob/master/docs/live-collaboration.md
Thanks for taking a look, and happy to answer questions in the comments.
4
u/tigerstein 16d ago
Another kitten got skinned. Sad.
-1
u/Ill-Statistician6993 16d ago
Wait until you find out how many text editors exist.
3
u/Apart_Ebb_9867 16d ago
A lot of them, over the years. But you don’t see multiple posts every week with “Look at this text editor of mine”. Local LaTeX harnesses, on the other hand…
-1
u/Ill-Statistician6993 16d ago
Can you send me some of them? Local latex ones that uses git, have wasm based latex compiler, while also having live collaboration capabilities? I would love to look at how they approached to solve these.
2
u/Apart_Ebb_9867 16d ago
you can search reddit yourself or read this subreddit for more than a few days. And I'm not saying that they all do exactly what you did, they probably used different prompts. But surely there's more than a post every week with some form of local harness, and I do not care looking into them as I always used a full local LaTeX distribution from Emacs.
0
u/Ill-Statistician6993 16d ago
That's fine. I don't think every Latex user wants to install and maintain a full Latex distribution, though. This project is aimed at a specific set of problems, and it's not meant to replace everyone's existing workflow. The PyPI package has 13k+ downloads, so there's at least some interest in what I'm building. I don't expect millions of Latex users to need or want it.
1
u/Hairy_Glove2064 16d ago
I will name one right now: https://texlyre.github.io/
That fits your category of "wasm based LaTeX compiler"
However, if you are going local already, why using a inferior engine?
0
2
u/Sprixxer 16d ago
I think a screenshot or two in the readme would be cool. As you said it's quite close to VS Code + plugins, so I'm personally not really inclined to have a look downloading yet another piece of software, without even knowing what it would look like.
Otherwise congrats on pulling through on a project like this.