paper-compile
Skill này làm gì
Phiên bản Codex này của skill biên dịch bài báo sẽ build bài báo LaTeX thành PDF và sửa lỗi. Nó dành cho tác giả chuẩn bị bài báo để nộp trong Codex.
Khi nào nên dùng
- ✓Khi bài báo LaTeX của bạn đã sẵn sàng và bạn cần một file PDF.
- ✓Khi việc build thất bại và bạn cần sửa các lỗi.
- ✓Khi cùng một lỗi build cứ lặp lại và bạn cần ý kiến thứ hai.
Liên kết skill
https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/blob/main/skills/skills-codex/paper-compile/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi cần bài báo LaTeX của mình được biên dịch thành PDF, và tôi muốn các lỗi build được sửa.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent kiểm tra các công cụ và file LaTeX, chạy build và đọc lỗi. Nó sửa lỗi và build lại tối đa ba lần; nếu cùng một lỗi lặp lại, nó giữ nhật ký và yêu cầu một ý kiến thứ hai tập trung.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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).
- RESCUE_ON_REPEAT_FAILURE = true — If the same compile class fails after two attempts, preserve
compile.logand ask for a focused rescue / second opinion before further edits.
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
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
Automated checks:
- PDF file exists and is > 100KB (not empty/corrupt)
- Total page count is reasonable (MAX_PAGES + appendix + references)
- No "??" in the PDF (undefined references — grep the log)
- No "[?]" in the PDF (undefined citations — grep the log)
- Figures are rendered (not missing image placeholders)
# Check for undefined references
grep -c "LaTeX Warning.*undefined" compile.log
# Check for missing citations
grep -c "Citation.*undefined" compile.log
Step 6: Page Count Verification
CRITICAL: Verify paper fits within MAX_PAGES.
For ML conferences (ICLR/NeurIPS/ICML/CVPR/ACL/AAAI): Main body = first page through end
Câu hỏi thường gặp
Nó có thể dùng những engine nào?
Mặc định nó dùng pdflatex, và có thể chuyển sang xelatex hoặc lualatex cho phông chữ tùy chỉnh hoặc văn bản CJK.
Nó có kiểm tra giới hạn số trang không?
Có. Nó biết các quy định trang của những venue phổ biến và kiểm tra theo chúng.
Nếu LaTeX chưa được cài thì sao?
Skill kiểm tra trước và đưa ra hướng dẫn cài đặt cho macOS, Ubuntu hoặc máy chủ.
Chi tiết
Mô tả gốc của tác giả
Compile LaTeX paper to PDF, fix errors, and verify output. Use when user says \\\"\u7f16\u8bd1\u8bba\u6587\\\", \\\"compile paper\\\", \\\"build PDF\\\", \\\"\u751f\u6210PDF\\\", or wants to compile LaTeX into a submission-ready PDF.
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10607
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
ablation-planner
18kGiúp agent của bạn lên kế hoạch thí nghiệm ablation cho một bài báo, chọn các thí nghiệm mà người phản biện có khả năng yêu cầu khi kết quả chính đã ổn.
alphaxiv
18kCho phép agent của bạn đọc nhanh một bài báo nghiên cứu bằng các bản tóm tắt AlphaXiv, với toàn văn hoặc mã LaTeX dự phòng, từ liên kết arXiv hoặc ID.
analyze-results
18kGiúp agent của bạn phân tích kết quả thí nghiệm học máy, so sánh các lần chạy với một baseline, và biến các con số thành phát hiện rõ ràng và bước tiếp theo.
arxiv
18kCho phép agent của bạn tìm bài báo trên arXiv, đọc chi tiết của chúng và lưu PDF vào thư viện của bạn theo một chủ đề nghiên cứu.
Skill tương tự
obsidian-vault-maintainer
394kGiúp agent của bạn giữ gọn kho ghi nhớ kiểu Obsidian, với liên kết wiki hoạt động tốt, thuộc tính nhất quán và các phần tự tạo an toàn.
wiki-maintainer
394kGiúp agent của bạn duy trì wiki bộ nhớ OpenClaw với các trang có thể lặp lại, khối được quản lý an toàn và kiểm tra mâu thuẫn hoặc thiếu sót.
obsidian
394kCho phép agent của bạn đọc, tìm, tạo và sửa ghi chú, công việc, liên kết và thuộc tính trong Obsidian bằng dòng lệnh Obsidian chính thức.