Power Up Overleaf with TeXRA: A Git-Based Workflow
Overleaf is the go-to platform for collaborative LaTeX writing. But what if you could combine its convenience with the advanced AI editing, local tool integration (like latexdiff), and VS Code power offered by TeXRA? You can, using Overleaf's Git integration!
This guide outlines a workflow to clone your Overleaf project, leverage TeXRA locally in VS Code, and seamlessly sync your changes back. Get the best of both worlds: Overleaf for collaboration, TeXRA for AI-powered local editing.
Why Bridge Overleaf and TeXRA?
- AI Superpowers: Apply TeXRA's specialized agents (
correct,polish,draw,paper2slide, etc.) locally. - Local Tooling: Use
latexdifffor precise change tracking, local compilation for previews. - VS Code Environment: Benefit from VS Code's features and extensions (like LaTeX Workshop).
- Robust Git: Employ granular version control, branching, and offline work locally.
Prerequisites
- Overleaf account with Git access enabled for your project (check Overleaf plans).
- Git installed locally (git-scm.com).
- TeXRA installed in VS Code (Installation Guide).
Workflow Steps
1. Clone Your Overleaf Project
Option A: Use TeXRA's clone command (recommended)
- In VS Code, open the command palette (Ctrl/Cmd+Shift+P) and run TeXRA: Clone Overleaf Project.
- Paste the Overleaf project URL or 24-character project ID when prompted.
- Enter your Overleaf Git token (it begins with
olp_). TeXRA saves it to VS Code's secret storage so future clones can reuse it. - The command runs
git clonedirectly into your workspace root so the cloned project becomes the repository you're working in. Make sure that folder is empty before starting.
Token storage: Reset the cached token anytime via the VS Code command Developer: Clear Secret Storage.
Option B: Manual terminal fallback
- Overleaf: Go to your project > Menu > Git. Copy the Git clone URL (
https://git.overleaf.com/YOUR_PROJECT_ID).
- Local Terminal: Navigate to your desired local directory and run:bash(Enter Overleaf credentials if prompted).
git clone https://git.overleaf.com/YOUR_PROJECT_ID your-local-folder
2. Edit Locally with TeXRA in VS Code
- Open
your-local-folderin VS Code. - Use TeXRA as usual:
- Select files, agent, model.
- Write instructions.
- Execute ().
- Review outputs (
*_r0_*.tex, etc.). - Use
latexdiff() or merge (). - Leverage features like auto-extract () and tool options ().
- Optionally use LaTeX Workshop for local previews (Setup).
3. Commit Local Changes
As you work, commit changes frequently using VS Code's Source Control () or the terminal:
# Stage changes (e.g., all modified files)
git add .
# Commit with a descriptive message
git commit -m "Refined methodology section using TeXRA polish"4. Sync Back to Overleaf
- (Recommended) Pull: Fetch and merge any changes made directly on Overleaf since your last pull:bashResolve any merge conflicts locally using standard Git tools.
git pull - Push: Upload your local commits to Overleaf:bashRefresh Overleaf in your browser to see the synced changes.
git push
Important Considerations
- Merge Conflicts: The biggest potential issue. Pulling changes from Overleaf before pushing your local work is the best way to minimize complex conflicts.
- Authentication: Git may occasionally re-prompt for Overleaf credentials.
- Large Projects: Be mindful of potential Overleaf Git size limitations.
This Git-based workflow empowers you to enhance your Overleaf projects with TeXRA's powerful local AI and tooling capabilities, offering a flexible and efficient development cycle.
Next Steps
- Best Practices: Optimize your TeXRA usage.
- LaTeX Diff: Master change comparison.
- Intelligent Merge: Understand AI-assisted merging.