Paper compile

From Lambenthan/empiricalwiki · View interactive version

Paper compile is an AI agent skill from the GitHub repository Lambenthan/empiricalwiki. LaTeX compile → PDF — latexmk compile + auto-fix + page count/anonymity/font/[UNCONFIRMED] checks + submission checklist

How to use this skill

Skill file

/paper-compile

Compile a LaTeX paper to PDF, auto-fix common errors, and verify submission requirements.

Input: the paper/ directory generated by /paper-draft. Run latexmk compilation,

parse errors and attempt auto-fix (missing packages, undefined references, figure paths).

Verify page limit, anonymous compliance, font embedding, and clearance of [UNCONFIRMED] markers.

Generate a submission checklist.

Inputs

Outputs

Wiki Interaction

Reads

Writes

Graph edges created

Workflow

Precondition: confirm paper/main.tex exists. Confirm latexmk is installed (which latexmk).

Step 1: Compile

  1. First compilation:

```bash

cd paper/ && latexmk -pdf -interaction=nonstopmode main.tex 2>&1

```

  1. Parse compilation output:
  1. If compilation succeeds (main.pdf generated): proceed to Step 3
  2. If compilation fails: proceed to Step 2

Step 2: Auto-Fix

If --fix is enabled, attempt to auto-fix each error type:

2a. Missing package:

# check if the package is installable via TeX Live
tlmgr info {package-name} 2>/dev/null
# if installable and user confirms:
tlmgr install {package-name}

If not installable: comment out the \usepackage{xxx} line and annotate % TODO: install package {xxx}

2b. Undefined reference/citation:

2c. Missing figure:

2d. Syntax error:

Re-compile after fixes (up to 3 fix-compile cycles):

cd paper/ && latexmk -pdf -interaction=nonstopmode main.tex 2>&1

Step 3: Verification Checks

After successful compilation, run the following checks:

3a. Page count check:

# get PDF page count
python3 -c "
import subprocess
result = subprocess.run(['pdfinfo', 'paper/main.pdf'], capture_output=True, text=True)
for line in result.stdout.splitlines():
    if line.startswith('Pages:'):
        print(line.split(':')[1].strip())
"

Compare against the venue page limit (retrieved from the PAPER_PLAN venue or the venue table in academic-writing.md).

3b. Anonymity check:

Scan all .tex files:

3c. [UNCONFIRMED] marker check:

# scan references.bib and all .tex files
grep -rn "VERIFY" paper/

3d. Font embedding check:

pdffonts paper/main.pdf

3e. Content completeness check:

Step 4: Generate Submission Checklist and Report

# Compile Report

## Compilation
- Status: {SUCCESS / FAILED}
- Compiler: latexmk + pdflatex
- Rounds: {N} (including auto-fix rounds)
- Errors: {N} (fixed: {M}, remaining: {K})
- Warnings: {N} (overfull: {O}, underfull: {U}, other: {W})

## Verification Results

| Check | Status | Details |
|-------|--------|---------|
| Page count | {PASS/FAIL} | {N} pages (limit: {L}) |
| Anonymous | {PASS/WARN} | {details} |
| [UNCONFIRMED] citations | {PASS/FAIL} | {N} remaining |
| Fonts embedded | {PASS/FAIL} | {details} |
| No TODOs | {PASS/WARN} | {N} remaining |
| Figures referenced | {PASS/WARN} | {details} |
| Abstract present | {PASS/FAIL} | {details} |

## Submission Checklist

- [ ] PDF compiles without errors
- [ ] Page count within venue limit ({L} pages)
- [ ] All [UNCONFIRMED] citations resolved
- [ ] Anonymous submission (no author info)
- [ ] All fonts embedded
- [ ] No TODO/FIXME markers
- [ ] All figures referenced in text
- [ ] Abstract present and complete
- [ ] Supplementary material prepared (if applicable)
- [ ] Paper title matches submission system

## Blocking Issues
{list of FAIL items that must be resolved before submission}

## Warnings (non-blocking)
{list of WARN items for consideration}

## Next Steps
- {specific actions to resolve blocking issues}
- Run `/refine paper/main.tex --focus writing` for final polish
- Manual review of anonymous compliance

Append log:

python3 tools/research_wiki.py log wiki/ \
  "paper-compile | {SUCCESS/FAILED} | {pages} pages, {errors} errors, {verify_count} [UNCONFIRMED], {checks_passed}/{checks_total} checks passed"

Constraints

Error Handling

Dependencies

Tools(via Bash)

MCP Servers

Claude Code Native

Shared References

Called by

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.