In this article, I compare these two approaches to editing LaTeX documents on Overleaf:
- Edit directly using Overleaf's editor.
- My setup: fetch from Overleaf using git, edit locally (using vim,
pdflatex, and macOS Preview), and push to Overleaf using git.
Table of Contents
Advantages of Local Editing over Overleaf¶
- Offline use: Local editing is very useful in flights or areas with spotty connectivity. Sometimes I have lost changes with Overleaf.
- I can use git to check diffs, create branches, and selectively commit/discard changes.
- With a local PDF viewer, I can go back after clicking a hyperref.
- Overleaf's custom PDF viewer doesn't have the bookmarks sidebar. I can use the browser's PDF viewer instead of Overleaf's custom viewer to get back bookmarks, but then I lose dark mode and synctex.
- Spellcheck: Vim can iterate over typos. Vim can have per-project
spellfiles. - In vim I can
set scrolloff=8. Then vim starts scrolling the screen a few lines before the cursor reaches the end of screen.
Advantages of Overleaf over Local Editing¶
- Multiple people can simultaneously edit the document.
- SyncTex: I can jump from position in PDF to position in code and vice versa.
Features Available in Both Setups¶
- Smart Autocomplete: In vim, this can be achieved using the TexLab plugin.
- Dark mode PDFs:
As of Feb 2026, Overleaf does this using the CSS filter
invert(95%) hue-rotate(180deg) brightness(90%) contrast(90%);. When building PDFs locally, I use github:sharmaeklavya2/tex-colorscheme. Overleaf's solution is much cleaner here.