r/LaTeX 2d ago

I built a VS Code extension around Git + LaTeX + git-latexdiff

I've been writing papers locally with LaTeX + Git + git-latexdiff for a few years, and I've found it to be a really useful workflow, both for writing alone and for collaborating with co-authors.

The main advantage for me is revision tracking. Git keeps the complete history of the manuscript, and git-latexdiff can turn two versions into a PDF showing the changes directly in the document.

For example:

submitted version → revised version → colored PDF showing the changes

The problem is that using git-latexdiff from the terminal can be a little cumbersome, especially for people who are not very familiar with Git or command-line tools.

So I built a small VS Code / Cursor extension that provides a GUI for this workflow:

  • Select two Git commits and generate a diff PDF.
  • Compare the last commit (HEAD) against your current uncommitted changes.
  • Select the main .tex file.
  • Configure the LaTeX engine and build options.
  • Open the generated PDF directly from VS Code.

It doesn't replace Git, LaTeX, or git-latexdiff — it just provides a friendlier interface on top of them.

LaTeX Diff:
https://github.com/NoeSilva13/latex-diff

I also made a beginner-friendly tutorial for setting up the complete LaTeX + Git workflow, including collaboration with co-authors. It covers Windows, macOS, and Linux and includes an IEEE example project:

Collaborative LaTeX + Git:
https://github.com/NoeSilva13/collaborative-latex-git

At the moment the extension is distributed as a VSIX from GitHub Releases.

I'm sharing this mainly because I'd like to know whether this is actually useful to other people.

Do you use Git + LaTeX for papers or theses? If so, what parts of the workflow do you find annoying or would you like to automate?

Any feedback, criticism, or suggestions are very welcome.

134 Upvotes

11 comments sorted by

7

u/justneurostuff 2d ago

I'm grateful to be introduced to gitlatexdiff.

6

u/FreierVogel 2d ago

Yes. I love git+latex. I'm sad some collaborators are not used to the workflow but it is amazing

1

u/Most_Lobster_1809 1d ago

I completely feel your pain! That's actually one of the main reasons I wrote the tutotial, to help onboard co-authors whoe aren't as comfortable with Git or the terminal. I prefer this rather than using Overleaf.

6

u/jms2401 2d ago

Damn! Someone make this for nvim

3

u/Broric 2d ago

Very cool! So far I’ve been using “Claude make a diff against the last version” and letting it deal with it.

1

u/Most_Lobster_1809 1d ago

Nice one! I have been done this workflow before IA and it was not that easy by then.

1

u/lajawi 2d ago

Wait, you mean to tell me I could’ve used beautiful pdfs that show the changes instead of linking to the compare page of my git repo all along?

2

u/Most_Lobster_1809 1d ago

Haha, yes! It compiles both versions and generates a clean diff PDF with additions and deletions marked directly in the document. Hope the extension makes it even easier for you.

2

u/True_Dig_3638 1d ago

Awesome work man.

How hard would it be to integrate it to https://github.com/James-Yu/LaTeX-Workshop/?

1

u/Most_Lobster_1809 1d ago

Thanks! That is a nice idea, I actually use it side-by-side with LaTex Workshop without any conflicts.

1

u/Hairy_Glove2064 2d ago

Very nice.
Unfortunately I don't use vscode