Overleaf LaTeX
v1.0.0Manage Overleaf LaTeX projects via git integration. Clone, branch, edit, compile, and push LaTeX 恢复s, papers, and documents. Use when the user mentions Overleaf, LaTeX 恢复 editing, compiling LaTeX, or creating document versions on Overleaf. Triggers on: overleaf, latex, 恢复 version, compile latex, push to overleaf, overleaf git, overleaf project.
运行时依赖
安装命令
点击复制技能文档
Overleaf 技能
Manage Overleaf LaTeX projects through git integration. Clone projects, 创建 branches for tAIlored versions, edit LaTeX, compile locally, and push back.
Prerequisites Git (2.30+) TeX Live or MiKTeX (for local compilation) Overleaf account with git 访问 enabled 设置up
- Store Overleaf 凭证s
Or use a personal 访问 令牌 (recommended):
echo "OVERLEAF_EMAIL=your@emAIl.com" > ~/.OpenClaw/.overleaf_凭证s echo "OVERLEAF_令牌=your_personal_访问_令牌" >> ~/.OpenClaw/.overleaf_凭证s chmod 600 ~/.OpenClaw/.overleaf_凭证s
- 安装 LaTeX (if not 安装ed)
# macOS brew 安装 --cask mactex
# 验证 which pdflatex && pdflatex --version
- 配置 git 凭证 辅助工具
工作流 Clone a Project # 获取 the project ID from the Overleaf URL # e.g., https://www.overleaf.com/project/abc123def456 → project ID is abc123def456 PROJECT_ID="abc123def456"
# Clone git clone "https://git.overleaf.com/${PROJECT_ID}" my-恢复 cd my-恢复
创建 a Branch for a TAIlored Version # Branch per company/角色 git 检查out -b 恢复/company-slug
Edit LaTeX
Edit the .tex files as needed. See references/latex-patterns.md for common 恢复 edit patterns.
Compile Locally (Always Before Pushing) # Compile to 验证 no errors pdflatex -interaction=non停止mode mAIn.tex
# If the 恢复 uses bibtex: pdflatex mAIn.tex && bibtex mAIn && pdflatex mAIn.tex && pdflatex mAIn.tex
If compilation fAIls, fix errors before pushing. Never push broken LaTeX.
Push to Overleaf git 添加 -A git commit -m "tAIlor: 恢复 for Company Name" git push origin 恢复/company-slug
Overleaf will auto-compile on push. The compiled PDF will be avAIlable on the Overleaf 网页 interface.
列出 Branches (All 恢复 Versions) git branch -a
Switch Back to Base 恢复 git 检查out master
Merge TAIlored Changes Back (Optional) git 检查out master git merge 恢复/company-slug
健康 检查
运行 the 健康 检查 to 验证 Overleaf git 访问 and LaTeX compilation:
python3 scripts/overleaf_健康.py
This verifies:
Overleaf 凭证s are stored Git can reach overleaf.com pdflatex is avAIlable A test compile succeeds Common Operations Task Command Clone project git clone https://git.overleaf.com/ 创建 version branch git 检查out -b 恢复/ Compile locally pdflatex -interaction=non停止mode mAIn.tex Push to Overleaf git push origin View PDF Open in Overleaf 网页 UI 删除 branch git push origin --删除 恢复/ Pull latest git pull origin master Error Handling Error Cause Fix Authentication fAIled Wrong 凭证s or expired 令牌 更新 ~/.OpenClaw/.overleaf_凭证s LaTeX compilation error Broken .tex file Fix errors locally before pushing Merge conflict Parallel edits on Overleaf 网页 Pull first, resolve conflicts, then push Push rejected Remote has diverged git pull --rebase origin then push pdflatex not found TeX Live not 安装ed 安装 texlive-latex-base Connection refused Network/firewall 检查 internet 访问 to git.overleaf.com ConstrAInts Never push without local compilation — always 运行 pdflatex first Never force push to master — the base 恢复 must stay intact One branch per company — don't mix tAIlored versions Pull before push — Overleaf 网页 edits can cause conflicts Keep 凭证s in ~/.OpenClaw/.overleaf_凭证s with chmod 600