paper-compile
하는 일
이 스킬은 LaTeX 연구 논문을 PDF로 빌드하고, 빌드를 멈추게 하는 오류를 고칩니다. 제출을 준비하는 저자를 위한 스킬입니다.
사용하는 경우
- ✓LaTeX 논문이 준비되어 PDF가 필요할 때.
- ✓LaTeX 빌드가 실패해 오류를 고쳐야 할 때.
- ✓논문이 학회의 쪽수 제한에 맞는지 확인해야 할 때.
스킬 링크
https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/paper-compile/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“LaTeX 논문을 PDF로 컴파일해 주세요. 빌드 오류가 있으면 고쳐 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 도구와 파일이 있는지 확인하고, 빌드를 실행한 뒤 오류를 읽습니다. 오류를 고치고 최대 세 번까지 다시 빌드한 다음, 출력을 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Paper Compile: LaTeX to Submission-Ready PDF
Compile the LaTeX paper and fix any issues: $ARGUMENTS
Constants
- COMPILER =
latexmk— LaTeX build tool. Handles multi-pass compilation automatically. - ENGINE =
pdflatex— LaTeX engine. Options:pdflatex(default),xelatex(for CJK/custom fonts),lualatex. - MAX_COMPILE_ATTEMPTS = 3 — Maximum attempts to fix errors and recompile.
- PAPER_DIR =
paper/— Directory containing LaTeX source files. - MAX_PAGES — Page limit. ML conferences: main body to Conclusion end (excluding references & appendix). ICLR=9, NeurIPS=9, ICML=8. IEEE venues: references ARE included in page count. IEEE journal ≈ 12-14 pages, IEEE conference ≈ 5-8 pages (all inclusive).
Workflow
Step 1: Verify Prerequisites
Check that the compilation environment is ready:
# Check LaTeX installation
which pdflatex && which latexmk && which bibtex
# If not installed, provide instructions:
# macOS: brew install --cask mactex-no-gui
# Ubuntu: sudo apt-get install texlive-full
# Server: conda install -c conda-forge texlive-core
Verify all required files exist:
# Must exist
ls $PAPER_DIR/main.tex
# Should exist
ls $PAPER_DIR/references.bib
ls $PAPER_DIR/sections/*.tex
ls $PAPER_DIR/figures/*.pdf 2>/dev/null || ls $PAPER_DIR/figures/*.png 2>/dev/null
Step 2: First Compilation Attempt
cd $PAPER_DIR
# Clean previous build artifacts
latexmk -C
# Full compilation (pdflatex + bibtex + pdflatex × 2)
latexmk -pdf -interaction=nonstopmode -halt-on-error main.tex 2>&1 | tee compile.log
Step 3: Error Diagnosis and Auto-Fix
If compilation fails, read compile.log and fix common errors:
Missing packages:
! LaTeX Error: File `somepackage.sty' not found.
→ Install via tlmgr install somepackage or remove the \usepackage if unused.
Undefined references:
LaTeX Warning: Reference `fig:xyz' on page 3 undefined
→ Check \label{fig:xyz} exists in the correct figure environment.
Missing figures:
! LaTeX Error: File `figures/fig1.pdf' not found.
→ Check if the file exists with a different extension (.png vs .pdf). Update the \includegraphics path.
Citation undefined:
LaTeX Warning: Citation `smith2024' undefined
→ Add the missing entry to references.bib or fix the citation key.
[VERIFY] markers in text:
→ Search for [VERIFY] markers left by /paper-write. These indicate unverified citations or facts. Search for the correct information or flag to the user.
Overfull hbox:
Overfull \hbox (12.5pt too wide) in paragraph at lines 42--45
→ Minor: usually ignorable. If severe (>20pt), rephrase the text or adjust figure width.
BibTeX errors:
I was expecting a `,' or a `}'---line 15 of references.bib
→ Fix BibTeX syntax (missing comma, unmatched braces, special characters in title).
\crefname undefined for custom theorem types:
→ Ensure \crefname{assumption}{Assumption}{Assumptions} and similar are in the preamble after \newtheorem{assumption}.
Step 4: Iterative Fix Loop
for attempt in 1..MAX_COMPILE_ATTEMPTS:
compile()
if success:
break
parse_errors()
auto_fix()
For each error:
- Read the error message from
compile.log - Locate the source file and line number
- Apply the fix
- Recompile
Stuck after 2 attempts? If Codex plugin is installed, invoke /codex:rescue — Codex can independently read the LaTeX source and compile.log to spot issues Claude missed (e.g., conflicting packages, encoding problems, subtle macro errors). If not installed, continue with Claude's own diagnosis.
Step 5: Post-Compilation Checks
After successful compilation, verify the output:
# Check PDF exists and has content
ls -la main.pdf
# Check page count
pdfinfo main.pdf | grep Pages
# macOS: open for visual inspection
# open main.pdf
Visual review (automated): If the compiled PDF exists, read it directly to check visual presentation:
- Figure quality: readable labels, legible text, distinguishable colors
- Layout: no orphaned section headers, no awkward page breaks
- Figures appear near their first text reference (not pages away)
- Tables: aligned columns, consistent decimal precision
- No overfull content visibly extending past margins
This is a quick visual scan, not a full review — the improvement loop does deeper visual review.
Automated checks:
- PDF file exists and is >
자주 묻는 질문
어떤 LaTeX 엔진을 쓰나요?
기본적으로 pdflatex를 쓰며, 사용자 지정 글꼴이나 CJK 텍스트를 위해 xelatex나 lualatex를 쓸 수 있습니다.
쪽수 제한은 어떻게 처리하나요?
ICLR, NeurIPS, IEEE 같은 주요 학회의 쪽수 규칙을 알고 있으며, 그 기준으로 확인합니다.
LaTeX가 설치되어 있어야 하나요?
네. 먼저 LaTeX 도구가 있는지 확인하고, 없으면 설치 방법을 안내합니다.
상세 정보
작성자의 원본 설명
Compile LaTeX paper to PDF, fix errors, and verify output. Use when user says \"编译论文\", \"compile paper\", \"build PDF\", \"生成PDF\", or wants to compile LaTeX into a submission-ready PDF.
인기도
- GitHub 스타
- 18k
- 순위
- #10559
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
ablation-planner
18k에이전트가 논문의 제거 실험(ablation)을 계획하도록 돕습니다. 주요 결과가 좋아 보이면 심사위원이 요청할 가능성이 높은 실험을 고릅니다.
alphaxiv
18k에이전트가 arXiv 링크나 ID로 AlphaXiv 요약을 써서 논문 한 편을 빠르게 읽도록 합니다. 요약이 없으면 원문이나 LaTeX를 씁니다.
analyze-results
18k에이전트가 머신러닝 실험 결과를 분석하고, 실행 결과를 기준선과 비교하며, 숫자를 명확한 발견과 다음 단계로 정리하도록 돕습니다.
arxiv
18k에이전트가 arXiv에서 학술 논문을 검색하고, 세부 정보를 읽고, 연구 주제에 맞는 PDF를 내 라이브러리에 저장하도록 돕습니다.