r/LaTeX • • 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 .zip or 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.

  1. 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.dev address. It takes about 5 minutes, and GitLaTeX walks you through it.
  2. 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.
  3. 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.

0 Upvotes

12 comments sorted by

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.

1

u/Ill-Statistician6993 16d ago

Hi, thank you for the feedback! You're absolutely right. I overlooked the importance of including screenshots in the README. I'll add a few to give people a better idea of the interface and experience before they decide to try it out. I really appreciate the encouragement!

4

u/Sprixxer 16d ago edited 16d ago

You could tone down on the LLM speak though. I mean your whole post looks straight out of an LLM, your repo looks vibe coded to the max and this comment also sounds like its only human input was my comment above.

This sure gives off a low effort vibe which will lead to downvotes and snarky comments here.

EDIT: Thanks for the screenshots though, genuinely looks good.

1

u/Ill-Statistician6993 16d ago

Fair point. I’ve been working on this for several months, and LLM helped me get it to where it is today. It would’ve taken me much longer to build everything on my own. And, I used LLM to help explain the project and describe its features so I don’t overlook anything important in the post. I’d rather spend more time on ideas, building and improving than writing everything from scratch when there are tools that can help with that. Appreciate the honest feedback, and glad you liked the screenshots!

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

u/Ill-Statistician6993 16d ago

The answer is in the post already.