Sync Overleaf
Standard post-step to push updated tables/figures into an Overleaf-synced folder.
Inputs (infer if obvious, otherwise ask)
- Source directory in the project (typically
results/tables/andresults/figures/). - Destination Overleaf folder (typically under
~/Dropbox (MIT)/Apps/Overleaf/<paper>/— confirm location; project folders may live in separate unsynced Dropbox roots).
Steps
- Confirm destination exists and is synced —
ls -la <dest>and check files are real (not Dropbox placeholders). - Diff — for each source file, compare to the existing destination file:
Build a list of: NEW, CHANGED, UNCHANGED.diff -q source dest - Copy only NEW + CHANGED files. Preserve filenames exactly so
\input{}/\includegraphics{}calls don't need editing. - Report — list NEW and CHANGED file paths and their sizes. ≤ 10 lines.
Editing .tex files (not just copying artifacts)
The user edits in the Overleaf web editor while Claude edits locally. Treat this as a two-way sync, never a one-way push.
- Pull first. Invoke the
overleafskill (or runoverleaf-sync-now sync) to refresh the local copy before touching any.tex/.bib. - Diff before writing. Show the user a diff of the pulled Overleaf version against the local copy. If they differ, stop and ask which to keep. Do not merge on your own.
- Targeted edits only. Never regenerate or overwrite a whole
.texfile when an Edit on the specific block will do. Regenerating clobbers the user's web-editor prose — this has already cost recovery from Overleaf version history.
Verify the compile before reporting done
After ANY table or figure edit:
- Recompile the document.
- Look at the affected page — page-fit, header layout, rendering — don't infer it from a clean exit code.
- Report the actual measurement (e.g.,
Overfull \hbox (83.0pt too wide) at line 412). Never say a fit is "fixed" without a compile that shows it.
Conventions
- Never delete files in the Overleaf folder — only add/overwrite.
- If a filename collision exists but content differs intentionally (e.g., anonymized version), confirm with the user before overwriting.
- After copy, suggest the user trigger a fresh Overleaf compile.
Anti-patterns
- Do not paste table content into chat — only path + size.
- Do not assume the Overleaf folder structure; confirm first if not previously used in this session.